Skip to content

Commit

Permalink
Release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentva committed May 29, 2019
2 parents b6c5b4c + 110b9f0 commit 269d759
Show file tree
Hide file tree
Showing 14 changed files with 813 additions and 426 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ ENV/
# Pycharm project settings
.idea

.pytest_cache
.pytest_cache

build
2 changes: 1 addition & 1 deletion pypozyx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"""

__version__ = '1.2.5'
__version__ = '1.3.0'

VERSION = __version__
version = __version__
Expand Down
17 changes: 15 additions & 2 deletions pypozyx/definitions/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ class PozyxConstants:
LED_OFF = False

# Pozyx device modes
ANCHOR_MODE = 0
TAG_MODE = 1
TAG_MODE = 0
ANCHOR_MODE = 1
ALOHA_MODE = 2

# The GPIO modes
GPIO_DIGITAL_INPUT = 0
Expand Down Expand Up @@ -187,6 +188,13 @@ class PozyxConstants:
UWB_PLEN_4096,
]

# ALOHA send types
ALOHA_SEND_CUSTOM_QUEUED = 0
ALOHA_SEND_CUSTOM_IMMEDIATE = 1
ALOHA_SEND_IMMEDIATE = 2

ALL_ALOHA_TYPES = [ALOHA_SEND_CUSTOM_QUEUED, ALOHA_SEND_CUSTOM_IMMEDIATE, ALOHA_SEND_IMMEDIATE]


# Pozyx firmware identifiers
POZYX_FW_MAJOR = 0xF0
Expand Down Expand Up @@ -290,6 +298,11 @@ class PozyxConstants:
POZYX_FLASH_NETWORK = 3
POZYX_FLASH_ALL = 4

# ALOHA send types
POZYX_QUEUE_CUSTOM_ALOHA = 0
POZYX_SEND_CUSTOM_ALOHA_IMMEDIATE = 1
POZYX_SEND_ALOMA_IMMEDIATE = 2

# possible pin configuration settings
POZYX_INT_CONFIG = 0x24
PIN_MODE_PUSHPULL = 0
Expand Down
142 changes: 77 additions & 65 deletions pypozyx/definitions/registers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class PozyxRegisters:
# Configuration registers
INTERRUPT_MASK = 0x10 # Indicates which interrupts are enabled.
INTERRUPT_PIN = 0x11 # Configure the interrupt pin
LED_CONFIGURATION = 0x15 # Configure the LEDs
POSITIONING_FILTER = 0x14 # Filter used for positioning
LED_CONFIGURATION = 0x15 # Configure the LEDs
POSITIONING_ALGORITHM = 0x16 # Algorithm used for positioning
# Configure the number of anchors and selection procedure
POSITIONING_NUMBER_OF_ANCHORS = 0x17
Expand All @@ -40,11 +40,16 @@ class PozyxRegisters:
# Configure the mode of operation of the pozyx device
OPERATION_MODE = 0x22
SENSORS_MODE = 0x23 # Configure the mode of operation of the sensors
CONFIG_BLINK_PAYLOAD = 0x24 # Configure payload that needs to be transmitted with ALOHA
ALOHA_VARIATION = 0x26 # Configure the variation on the ALOHA
CONFIG_GPIO_1 = 0x27 # Configure GPIO pin 1.
CONFIG_GPIO_2 = 0x28 # Configure GPIO pin 2.
CONFIG_GPIO_3 = 0x29 # Configure GPIO pin 3.
CONFIG_GPIO_4 = 0x2A # Configure GPIO pin 4.

ALL_ALOHA_REGISTERS = [0x18, 0x19, 0x24, 0x25, 0x26]


# Positioning data
POSITION_X = 0x30 # x-coordinate of the device in mm.
POSITION_Y = 0x34 # y-coordinate of the device in mm.
Expand Down Expand Up @@ -95,6 +100,7 @@ class PozyxRegisters:
GPIO_2 = 0x86 # Value of the GPIO pin 2
GPIO_3 = 0x87 # Value of the GPIO pin 3
GPIO_4 = 0x88 # Value of the GPIO pin 4
BLINK_INDEX = 0x89 # The blink index of the ALOHA transmissions

# Functions
RESET_SYSTEM = 0xB0 # Reset the Pozyx device
Expand All @@ -111,6 +117,7 @@ class PozyxRegisters:
RESET_FLASH_MEMORY = 0xB9 # Reset a portion of the configuration in flash memory
SAVE_FLASH_MEMORY = 0xBA # Store a portion of the configuration in flash memory
GET_FLASH_DETAILS = 0xBB # Return information on what is stored in flash
DO_ALOHA = 0xBC # Start / stop ALOHA mode

# Device list functions
# Get all the network IDs's of devices in the device list.
Expand All @@ -130,105 +137,110 @@ class PozyxRegisters:

DO_POSITIONING_WITH_DATA = 0xCC


# Status registers
POZYX_WHO_AM_I = 0x0 # Returns the constant value 0x43.
POZYX_FIRMWARE_VER = 0x1 # Returns the POZYX firmware version.
POZYX_HARDWARE_VER = 0x2 # Returns the POZYX hardware version.
POZYX_ST_RESULT = 0x3 # Returns the self-test result
POZYX_ERRORCODE = 0x4 # Describes a possibly system error.
POZYX_INT_STATUS = 0x5 # Indicates the source of the interrupt.
POZYX_CALIB_STATUS = 0x6 # Returns the calibration status.
POZYX_WHO_AM_I = 0x0 # Returns the constant value 0x43.
POZYX_FIRMWARE_VER = 0x1 # Returns the POZYX firmware version.
POZYX_HARDWARE_VER = 0x2 # Returns the POZYX hardware version.
POZYX_ST_RESULT = 0x3 # Returns the self-test result
POZYX_ERRORCODE = 0x4 # Describes a possibly system error.
POZYX_INT_STATUS = 0x5 # Indicates the source of the interrupt.
POZYX_CALIB_STATUS = 0x6 # Returns the calibration status.

# Configuration registers
POZYX_INT_MASK = 0x10 # Indicates which interrupts are enabled.
POZYX_INT_MASK = 0x10 # Indicates which interrupts are enabled.
POZYX_INT_CONFIG = 0x11 # Configure the interrupt pin
POZYX_CONFIG_LEDS = 0x15 # Configure the LEDs
POZYX_POS_FILTER = 0x14 # Filter used for positioning
POZYX_POS_ALG = 0x16 # Algorithm used for positioning
POZYX_CONFIG_LEDS = 0x15 # Configure the LEDs
POZYX_POS_FILTER = 0x14 # Filter used for positioning
POZYX_POS_ALG = 0x16 # Algorithm used for positioning
# Configure the number of anchors and selection procedure
POZYX_POS_NUM_ANCHORS = 0x17
# Defines the update interval in ms in continuous positioning.
POZYX_POS_INTERVAL = 0x18
POZYX_NETWORK_ID = 0x1A # The network id.
POZYX_UWB_CHANNEL = 0x1C # UWB channel number.
POZYX_NETWORK_ID = 0x1A # The network id.
POZYX_UWB_CHANNEL = 0x1C # UWB channel number.
# Configure the UWB datarate and pulse repetition frequency (PRF)
POZYX_UWB_RATES = 0x1D
POZYX_UWB_PLEN = 0x1E # Configure the UWB preamble length.
POZYX_UWB_GAIN = 0x1F # Configure the power gain for the UWB transmitter
POZYX_UWB_XTALTRIM = 0x20 # Trimming value for the uwb crystal.
POZYX_RANGE_PROTOCOL = 0x21 # The ranging protocol
POZYX_UWB_PLEN = 0x1E # Configure the UWB preamble length.
POZYX_UWB_GAIN = 0x1F # Configure the power gain for the UWB transmitter
POZYX_UWB_XTALTRIM = 0x20 # Trimming value for the uwb crystal.
POZYX_RANGE_PROTOCOL = 0x21 # The ranging protocol
# Configure the mode of operation of the pozyx device
POZYX_OPERATION_MODE = 0x22
POZYX_SENSORS_MODE = 0x23 # Configure the mode of operation of the sensors
POZYX_CONFIG_GPIO1 = 0x27 # Configure GPIO pin 1.
POZYX_CONFIG_GPIO2 = 0x28 # Configure GPIO pin 2.
POZYX_CONFIG_GPIO3 = 0x29 # Configure GPIO pin 3.
POZYX_CONFIG_GPIO4 = 0x2A # Configure GPIO pin 4.
POZYX_SENSORS_MODE = 0x23 # Configure the mode of operation of the sensors
POZYX_CONFIG_BLINK_PAYLOAD = 0x24 # Configure payload that needs to be transmitted with ALOHA
POZYX_ALOHA_VARIATION = 0x26 # Configure the variation on the ALOHA
POZYX_CONFIG_GPIO1 = 0x27 # Configure GPIO pin 1.
POZYX_CONFIG_GPIO2 = 0x28 # Configure GPIO pin 2.
POZYX_CONFIG_GPIO3 = 0x29 # Configure GPIO pin 3.
POZYX_CONFIG_GPIO4 = 0x2A # Configure GPIO pin 4.

# Positioning data
POZYX_POS_X = 0x30 # x-coordinate of the device in mm.
POZYX_POS_Y = 0x34 # y-coordinate of the device in mm.
POZYX_POS_Z = 0x38 # z-coordinate of the device in mm.
POZYX_POS_ERR_X = 0x3C # estimated error covariance of x
POZYX_POS_ERR_Y = 0x3E # estimated error covariance of y
POZYX_POS_ERR_Z = 0x40 # estimated error covariance of z
POZYX_POS_ERR_XY = 0x42 # estimated covariance of xy
POZYX_POS_ERR_XZ = 0x44 # estimated covariance of xz
POZYX_POS_ERR_YZ = 0x46 # estimated covariance of yz
POZYX_POS_X = 0x30 # x-coordinate of the device in mm.
POZYX_POS_Y = 0x34 # y-coordinate of the device in mm.
POZYX_POS_Z = 0x38 # z-coordinate of the device in mm.
POZYX_POS_ERR_X = 0x3C # estimated error covariance of x
POZYX_POS_ERR_Y = 0x3E # estimated error covariance of y
POZYX_POS_ERR_Z = 0x40 # estimated error covariance of z
POZYX_POS_ERR_XY = 0x42 # estimated covariance of xy
POZYX_POS_ERR_XZ = 0x44 # estimated covariance of xz
POZYX_POS_ERR_YZ = 0x46 # estimated covariance of yz

# Sensor data
POZYX_MAX_LIN_ACC = 0x4E # Return the max linear acceleration and reset it to 0
POZYX_PRESSURE = 0x50 # Pressure data in mPa
POZYX_ACCEL_X = 0x54 # Accelerometer data (in mg)
POZYX_PRESSURE = 0x50 # Pressure data in mPa
POZYX_ACCEL_X = 0x54 # Accelerometer data (in mg)
POZYX_ACCEL_Y = 0x56
POZYX_ACCEL_Z = 0x58
POZYX_MAGN_X = 0x5A # Magnemtometer data
POZYX_MAGN_X = 0x5A # Magnemtometer data
POZYX_MAGN_Y = 0x5C
POZYX_MAGN_Z = 0x5E
POZYX_GYRO_X = 0x60 # Gyroscope data
POZYX_GYRO_X = 0x60 # Gyroscope data
POZYX_GYRO_Y = 0x62
POZYX_GYRO_Z = 0x64
# Euler angles heading (or yaw) (1 degree = 16 LSB )
POZYX_EUL_HEADING = 0x66
POZYX_EUL_ROLL = 0x68 # Euler angles roll ( 1 degree = 16 LSB )
POZYX_EUL_PITCH = 0x6A # Euler angles pitch ( 1 degree = 16 LSB )
POZYX_QUAT_W = 0x6C # Weight of quaternion.
POZYX_QUAT_X = 0x6E # x of quaternion
POZYX_QUAT_Y = 0x70 # y of quaternion
POZYX_QUAT_Z = 0x72 # z of quaternion
POZYX_LIA_X = 0x74 # Linear acceleration in x-direction
POZYX_LIA_Y = 0x76 # Linear acceleration in y-direction
POZYX_LIA_Z = 0x78 # Linear acceleration in z-direction
POZYX_GRAV_X = 0x7A # x-component of gravity vector
POZYX_GRAV_Y = 0x7C # y-component of gravity vector
POZYX_GRAV_Z = 0x7E # z-component of gravity vector
POZYX_TEMPERATURE = 0x80 # Temperature
POZYX_EUL_ROLL = 0x68 # Euler angles roll ( 1 degree = 16 LSB )
POZYX_EUL_PITCH = 0x6A # Euler angles pitch ( 1 degree = 16 LSB )
POZYX_QUAT_W = 0x6C # Weight of quaternion.
POZYX_QUAT_X = 0x6E # x of quaternion
POZYX_QUAT_Y = 0x70 # y of quaternion
POZYX_QUAT_Z = 0x72 # z of quaternion
POZYX_LIA_X = 0x74 # Linear acceleration in x-direction
POZYX_LIA_Y = 0x76 # Linear acceleration in y-direction
POZYX_LIA_Z = 0x78 # Linear acceleration in z-direction
POZYX_GRAV_X = 0x7A # x-component of gravity vector
POZYX_GRAV_Y = 0x7C # y-component of gravity vector
POZYX_GRAV_Z = 0x7E # z-component of gravity vector
POZYX_TEMPERATURE = 0x80 # Temperature

# General data
# Returns the number of devices stored internally
POZYX_DEVICE_LIST_SIZE = 0x81
POZYX_RX_NETWORK_ID = 0x82 # The network id of the latest received message
POZYX_RX_DATA_LEN = 0x84 # The length of the latest received message
POZYX_GPIO1 = 0x85 # Value of the GPIO pin 1
POZYX_GPIO2 = 0x86 # Value of the GPIO pin 2
POZYX_GPIO3 = 0x87 # Value of the GPIO pin 3
POZYX_GPIO4 = 0x88 # Value of the GPIO pin 4
POZYX_RX_NETWORK_ID = 0x82 # The network id of the latest received message
POZYX_RX_DATA_LEN = 0x84 # The length of the latest received message
POZYX_GPIO1 = 0x85 # Value of the GPIO pin 1
POZYX_GPIO2 = 0x86 # Value of the GPIO pin 2
POZYX_GPIO3 = 0x87 # Value of the GPIO pin 3
POZYX_GPIO4 = 0x88 # Value of the GPIO pin 4
POZYX_BLINK_INDEX = 0x89 # The blink index of the ALOHA transmissions

# Functions
POZYX_RESET_SYS = 0xB0 # Reset the Pozyx device
POZYX_LED_CTRL = 0xB1 # Control LEDS 1 to 4 on the board
POZYX_TX_DATA = 0xB2 # Write data in the UWB transmit (TX) buffer
POZYX_TX_SEND = 0xB3 # Transmit the TX buffer to some other pozyx device
POZYX_RX_DATA = 0xB4 # Read data from the UWB receive (RX) buffer
POZYX_DO_RANGING = 0xB5 # Initiate ranging measurement
POZYX_DO_POSITIONING = 0xB6 # Initiate the positioning process.
POZYX_RESET_SYS = 0xB0 # Reset the Pozyx device
POZYX_LED_CTRL = 0xB1 # Control LEDS 1 to 4 on the board
POZYX_TX_DATA = 0xB2 # Write data in the UWB transmit (TX) buffer
POZYX_TX_SEND = 0xB3 # Transmit the TX buffer to some other pozyx device
POZYX_RX_DATA = 0xB4 # Read data from the UWB receive (RX) buffer
POZYX_DO_RANGING = 0xB5 # Initiate ranging measurement
POZYX_DO_POSITIONING = 0xB6 # Initiate the positioning process.
# Set the list of anchor ID's used for positioning.
POZYX_POS_SET_ANCHOR_IDS = 0xB7
# Read the list of anchor ID's used for positioning.
POZYX_POS_GET_ANCHOR_IDS = 0xB8
POZYX_FLASH_RESET = 0xB9 # Reset a portion of the configuration in flash memory
POZYX_FLASH_SAVE = 0xBA # Store a portion of the configuration in flash memory
POZYX_FLASH_DETAILS = 0xBB # Return information on what is stored in flash
POZYX_DO_ALOHA = 0xBC

# Device list functions
# Get all the network IDs's of devices in the device list.
Expand All @@ -237,12 +249,12 @@ class PozyxRegisters:
POZYX_DEVICES_DISCOVER = 0xC1
# Obtain the coordinates of the pozyx (anchor) devices within range.
POZYX_DEVICES_CALIBRATE = 0xC2
POZYX_DEVICES_CLEAR = 0xC3 # Clear the list of all pozyx devices.
POZYX_DEVICE_ADD = 0xC4 # Add a pozyx device to the devices list
POZYX_DEVICES_CLEAR = 0xC3 # Clear the list of all pozyx devices.
POZYX_DEVICE_ADD = 0xC4 # Add a pozyx device to the devices list
# Get the stored device information for a given pozyx device
POZYX_DEVICE_GETINFO = 0xC5
# Get the stored coordinates of a given pozyx device
POZYX_DEVICE_GETCOORDS = 0xC6
# Get the stored range inforamation of a given pozyx device
POZYX_DEVICE_GETRANGEINFO = 0xC7
POZYX_CIR_DATA = 0xC8 # Get the channel impulse response (CIR) coefficients
POZYX_CIR_DATA = 0xC8 # Get the channel impulse response (CIR) coefficients

0 comments on commit 269d759

Please sign in to comment.