#include <registers.h>
Public Member Functions | |
Accessor_ (Registers *registers, uint8_t register_index, uint8_t register_width, uint8_t array_length) | |
void * | raw () const |
Public Attributes | |
const uint8_t | index |
const uint16_t | length |
const uint8_t | width |
Private Attributes | |
Registers * | registers_ |
This class provides an accessor of fields contained in one or more consecutive UM6 registers. Each register is nominally a uint32_t, but XYZ vectors are stored as a pair of int16_t values in one register and one in the following register. Other values are stored as int32_t representation or float32s.
This class takes care of the necessary transformations to simplify the actual "business logic" of the driver.
Definition at line 93 of file registers.h.
um6::Accessor_::Accessor_ | ( | Registers * | registers, |
uint8_t | register_index, | ||
uint8_t | register_width, | ||
uint8_t | array_length | ||
) | [inline] |
Definition at line 96 of file registers.h.
void * um6::Accessor_::raw | ( | ) | const |
This is ridiculous to have a whole source file for this tiny implementation, but it's necessary to resolve the otherwise circular dependency between the Registers and Accessor classes, when Registers contains Accessor instances and Accessor is a template class.
Definition at line 39 of file registers.cpp.
const uint8_t um6::Accessor_::index |
Number/address of the register in the array of uint32s which is shared with the UM6 firmware.
Definition at line 107 of file registers.h.
const uint16_t um6::Accessor_::length |
Length of how many sub-register fields comprise this accessor. Not required to stay within the bounds of a single register.
Definition at line 116 of file registers.h.
Registers* um6::Accessor_::registers_ [private] |
Definition at line 119 of file registers.h.
const uint8_t um6::Accessor_::width |
Width of the sub-register field, in bytes, either 2 or 4.
Definition at line 111 of file registers.h.