modm API documentation for STM32F101ZGT6
|
#include <modm/driver/inertial/lsm303a.hpp>
Classes | |
struct | Data |
Public Typedefs | |
typedef FlagsGroup< Control1_t, Control2_t, Control3_t, Control4_t, Control5_t, Control6_t, FifoControl_t, IntConfig_t, ClickConfig_t > | Control_t |
Public Types | |
enum | Register : uint8_t |
enum | Control1 : uint8_t |
CTRL_REG1 default value is 0x07. | |
enum | Control2 : uint8_t |
CTRL_REG2 default value is 0x00. | |
enum | Control3 : uint8_t |
CTRL_REG3 default value is 0x00. | |
enum | Control4 : uint8_t |
CTRL_REG4 default value is 0x00. | |
enum | Control5 : uint8_t |
CTRL_REG5 default value is 0x00. | |
enum | Control6 : uint8_t |
CTRL_REG6 default value is 0x00. | |
enum | Status : uint8_t |
STATUS is read-only. | |
enum | FifoControl : uint8_t |
FIFO_CTRL default value is 0x00. | |
enum | FifoSource : uint8_t |
FIFO_SRC is read-only. | |
enum | IntConfig : uint8_t |
INT_CFG default value is 0x00. | |
enum | IntSource : uint8_t |
INT1_SRC default value is 0x00. | |
enum | ClickConfig : uint8_t |
CLOCK_CFG default value is 0x00. | |
enum | ClickSource : uint8_t |
CLOCK_SRC default value is 0x00. | |
enum | FifoMode : uint8_t |
enum | MeasurementRate : uint8_t |
enum | Scale : uint8_t |
Public Member Functions | |
MODM_FLAGS8 (Control1) | |
MODM_FLAGS8 (Control2) | |
MODM_FLAGS8 (Control3) | |
MODM_FLAGS8 (Control4) | |
MODM_FLAGS8 (Control5) | |
MODM_FLAGS8 (Control6) | |
MODM_FLAGS8 (Status) | |
MODM_FLAGS8 (FifoControl) | |
MODM_FLAGS8 (FifoSource) | |
MODM_FLAGS8 (IntConfig) | |
MODM_FLAGS8 (IntSource) | |
MODM_FLAGS8 (ClickConfig) | |
MODM_FLAGS8 (ClickSource) | |
Lsm303a (Data &data, uint8_t address=0b0011001) | |
Constructor, requires a lsm303a::Data object. | |
bool | configureBlocking (Scale scale, MeasurementRate rate=MeasurementRate::Hz100) |
modm::ResumableResult< bool > | configure (Scale scale, MeasurementRate rate=MeasurementRate::Hz100) |
modm::ResumableResult< bool > | updateControl (Control1_t setMask, Control1_t clearMask=Control1_t (0xff)) |
modm::ResumableResult< bool > | updateControl (Control2_t setMask, Control2_t clearMask=Control2_t (0xff)) |
modm::ResumableResult< bool > | updateControl (Control3_t setMask, Control3_t clearMask=Control3_t (0xff)) |
modm::ResumableResult< bool > | updateControl (Control4_t setMask, Control4_t clearMask=Control4_t (0xff)) |
modm::ResumableResult< bool > | updateControl (Control5_t setMask, Control5_t clearMask=Control5_t (0xff)) |
modm::ResumableResult< bool > | updateControl (Control6_t setMask, Control6_t clearMask=Control6_t (0xff)) |
modm::ResumableResult< bool > | updateFifoControl (FifoControl_t setMask, FifoControl_t clearMask=FifoControl_t (0xff)) |
modm::ResumableResult< bool > | readAcceleration () |
Control1_t | getControl1 () |
Control2_t | getControl2 () |
Control3_t | getControl3 () |
Control4_t | getControl4 () |
Control5_t | getControl5 () |
Control6_t | getControl6 () |
uint8_t | getReference () |
FifoControl_t | getFifoControl () |
Status_t | getStatus () |
FifoSource_t | getFifoSource () |
Data & | getData () |
Get the data object for this sensor. | |
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
modm::ResumableResult< bool > | ping () |
modm::ResumableResult< bool > | read (uint8_t *buffer, std::size_t size) |
Starts a write transaction and waits until finished. | |
void | setAddress (uint8_t address) |
modm::ResumableResult< bool > | write (const uint8_t *buffer, std::size_t size) |
Starts a write transaction and waits until finished. | |
modm::ResumableResult< bool > | writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
Starts a write-read transaction and waits until finished. | |
Protected Member Functions | |
int8_t | getResumableDepth () const |
bool | isResumableRunning () const |
bool | isTransactionRunning () |
modm::ResumableResult< bool > | read (uint8_t reg, uint8_t &value) |
read a 8bit value | |
modm::ResumableResult< bool > | read (uint8_t reg, uint8_t *buffer, uint8_t length) |
read multiple 8bit values from a start register | |
modm::ResumableResult< bool > | runTransaction () |
Starts our own transaction and waits until finished. | |
bool | startRead (uint8_t *buffer, std::size_t size) |
Configures the transaction with a read operation and starts it. | |
bool | startTransaction () |
Starts the transaction with our own transaction object. | |
bool | startTransaction (modm::I2cTransaction *transaction) |
Starts the transaction with a separate transaction object. | |
bool | startWrite (const uint8_t *buffer, std::size_t size) |
Configures the transaction with a write operation and starts it. | |
bool | startWriteRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
Configures the transaction with a write/read operation and starts it. | |
void | stopResumable () |
bool | wasTransactionSuccessful () |
modm::ResumableResult< bool > | write (uint8_t reg, uint8_t value) |
write a 8bit value | |
Protected Attributes | |
I2cWriteReadTransaction | transaction |
|
inheritedinline |
Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.
|
inheritedinlineprotected |
true
when transaction is busy.
|
inheritedinline |
true | device responds to address |
false | no device with address found |
|
inheritedinline |
Sets a new address of the slave device.
address | the slave address not yet shifted left (address < 128). |
|
inheritedinlineprotected |
true
when transaction did not return an error.