Skip to content

Commit

Permalink
refactor(mem_map*): Remove all mem map features
Browse files Browse the repository at this point in the history
Since philip_pal is now in the PHiLIP repo it can be removed from riot_pal
philip_pal can now be installed with pip3 install philip_pal
  • Loading branch information
MrKevinWeiss committed Jun 24, 2019
1 parent 9912190 commit d7950d8
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 3,425 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
include riot_pal/mem_map/*
35 changes: 1 addition & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,4 @@ RIOT PAL (RIOT Protocol Abstraction Layer)
Introduction
------------

A set of python modules that abstract away and standardize shell based commands in RIOT and for bare metal memory map access.


### Usage of LLMemMapIf
The LLMemMapIf (Low Level Memory Map Interface) is used to interface to a memory map specified from a csv or other format file. It handles the parsing of offsets, sizes, etc. of the device.

To use this interface a memory must be provided, by default the package contains the PHiLIP memory map. More information about PHiLIP can be found at the [PHiLIP repo](https://github.com/riot-appstore/PHiLIP).

PHILIP_MEM_MAP_PATH - Provides a path to the csv used for updating the list of commands for the LLMemMapIf</br></br>
read_struct - Reads a set of registers defined by the memory map.</br></br>
read_reg - Read a register defined by the memory map.
* cmd_name(str): The name of the register to read.
* offset(int): The number of elements to offset in an array.
* size(int): The number of elements to read in an array.

write_reg - Writes a register defined by the memory map.
* cmd_name(str): The name of the register to read
* data: The data to write to the register
* offset(int): The number of elements to offset in an array.

### Example with PHiLIP
1. Install riot_pal from pip</br>`pip install riot_pal`
2. Start python 3</br>`python3`
3. Create a import modules from riot pal</br>`>>> from riot_pal import LLMemMapIf, PHILIP_MEM_MAP_PATH`
4. Create a connection</br>`>>> phil = LLMemMapIf(PHILIP_MEM_MAP_PATH, 'serial', '/dev/ttyACM0')`
5. View available commands</br>`>>> phil.cmd_list.keys()`
6. View descriptions of commands</br>`>>> phil.cmd_list['sys.sn.12']['description']`
7. Read a register</br>`>>> phil.read_reg('sys.sn.12')`
8. Only view data</br>`>>> phil.read_reg('sys.sn.12')['data']`
9. Write bytes to a register</br>`>>> phil.write_reg('user_reg.64', [4, 2])`
10. Read new data</br>`>>> phil.read_reg('user_reg.64', size=10)['data']`
11. Write a number to a register</br>`>>> phil.write_reg('user_reg.64', 42)`
12. Read new data</br>`>>> phil.read_reg('user_reg.64', size=4)['data']`
13. Read a structure</br>`>>> phil.read_struct('sys')`
A set of python modules that abstract away and standardize shell based commands in RIOT.
7 changes: 1 addition & 6 deletions riot_pal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"""packet init for RIOT PAL
This exposes usful modules in the RIOT PAL packet
"""
from pathlib import Path
from .dut_shell import DutShell
from .ll_shell import LLShell
from .ll_mem_map_if import LLMemMapIf

PHILIP_MEM_MAP_PATH = str(Path(__file__).parents[0]) + \
'/mem_map/philip_mem_map-00_00_01.csv'
__all__ = ['DutShell', 'LLShell', 'LLMemMapIf']
__all__ = ['DutShell']
111 changes: 0 additions & 111 deletions riot_pal/ll_mem_map_if.py

This file was deleted.

175 changes: 0 additions & 175 deletions riot_pal/ll_shell.py

This file was deleted.

Loading

0 comments on commit d7950d8

Please sign in to comment.