Public Member Functions | Public Attributes | Private Attributes | List of all members
um7::Accessor_ Class Reference

#include <registers.h>

Inheritance diagram for um7::Accessor_:
Inheritance graph
[legend]

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

Registersregisters_
 

Detailed Description

This class provides an accessor of fields contained in one or more consecutive UM7 registers. Each register is nominally a uint32_t, but XYZ vectors are sometimes 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.

Constructor & Destructor Documentation

um7::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.

Member Function Documentation

void * um7::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.

Member Data Documentation

const uint8_t um7::Accessor_::index

Number/address of the register in the array of uint32s which is shared with the UM7 firmware.

Definition at line 107 of file registers.h.

const uint16_t um7::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* um7::Accessor_::registers_
private

Definition at line 119 of file registers.h.

const uint8_t um7::Accessor_::width

Width of the sub-register field, in bytes, either 2 or 4.

Definition at line 111 of file registers.h.


The documentation for this class was generated from the following files:


um7
Author(s): Mike Purvis , Alex Brown
autogenerated on Tue Feb 11 2020 03:26:50