This is a basic code to be used for Sequana BLE Lab exercises.

Embed: (wiki syntax)

« Back to documentation index

Kmx65Sensor Class Reference

Kmx65Sensor Class Reference

KX64 accelerometer/magnetometer sensor interface. More...

#include <Kmx65.h>

Inherits Sensor< Kmx65Value >.

Public Member Functions

 Kmx65Sensor (SPI &spi, PinName cs)
 Create and initialize sensor interface.
virtual void start (EventQueue &ev_queue)
 Schedule measurement process.
const Kmx65Valueget_value ()
 Get current value of the sensor.
void register_updater (Callback< void()> func)
 Register characteristic update method.

Protected Member Functions

void updater ()
 Callback function periodically updating sensor value.

Detailed Description

KX64 accelerometer/magnetometer sensor interface.

Definition at line 108 of file Kmx65.h.


Constructor & Destructor Documentation

Kmx65Sensor ( SPI &  spi,
PinName  cs 
)

Create and initialize sensor interface.

Parameters:
spiSPI bus to use
csCS/SS pin to use to select sensor on a bus

Definition at line 115 of file Kmx65.h.


Member Function Documentation

const Kmx65Value & get_value (  ) [inherited]

Get current value of the sensor.

Assumption is that the sensor object caches the last value recently updated.

Returns:
Current sensor value.

Definition at line 43 of file Sensor.h.

void register_updater ( Callback< void()>  func ) [inherited]

Register characteristic update method.

This method will be called every time the sensor value changes and it's supposed to update the BEL characteristic based on the current sensor value.

Parameters:
funcCallback function called by sensor to update its characteristic value.

Definition at line 56 of file Sensor.h.

void start ( EventQueue &  ev_queue ) [virtual]

Schedule measurement process.

Initialize driver and setup periodic sensor updates.

Implements Sensor< Kmx65Value >.

Definition at line 128 of file Kmx65.cpp.

void updater (  ) [protected]

Callback function periodically updating sensor value.

Definition at line 117 of file Kmx65.cpp.