28 #include <mraa/gpio.hpp> 67 KXTJ3(
int bus, uint8_t addr = 0x0f);
90 void SensorInit(KXTJ3_ODR_T odr, KXTJ3_RESOLUTION_T resolution, KXTJ3_G_RANGE_T g_range);
148 void SetOdr(KXTJ3_ODR_T odr);
285 void EnableInterruptPin(KXTJ3_INTERRUPT_POLARITY_T polarity, KXTJ3_INTERRUPT_RESPONSE_T response_type);
364 void InstallIsr(mraa_gpio_edge_t edge,
int pin,
void (*isr)(
void *),
void *isr_args);
void EnableWakeUpSingleAxisDirection(KXTJ3_WAKEUP_SOURCE_T axis)
Enables wakeup interrupt for the given axis (axis with direction)
Definition: kxtj3.cxx:225
float GetWakeUpThresholdGRange()
Get the current threshold difference value before sending wakeup interrupt.
Definition: kxtj3.cxx:308
void SetResolution(KXTJ3_RESOLUTION_T resolution)
Sets the resolution of the sensor. High resolution (14 bits and 12 bits) or low resolution (8 bits)...
Definition: kxtj3.cxx:77
void SensorSelfTest()
Performs a self-test of the sensor. The test applies an electrostatic force to the sensor...
Definition: kxtj3.cxx:101
void DisableInterruptPin()
Disables interrupts on the interrupt pin of the sensor.
Definition: kxtj3.cxx:171
void SetGRange(KXTJ3_G_RANGE_T g_range)
Sets the acceleration range of the sensor.
Definition: kxtj3.cxx:71
void SensorActive()
Sets the sensor to active mode.
Definition: kxtj3.cxx:59
void SetWakeUpMotionTime(float desired_time)
Sets the timer of motion before sending a wakeup interrupt.
Definition: kxtj3.cxx:260
void SensorStandby()
Sets the sensor to standby mode.
Definition: kxtj3.cxx:65
void SetWakeUpNonActivityTime(float desired_time)
Sets the timer of non-activity before sending another wakeup interrupt.
Definition: kxtj3.cxx:281
void SetWakeUpNonActivityCounter(uint8_t count)
Sets the timer counter of non-activity before sending another wakeup interrupt.
Definition: kxtj3.cxx:275
float GetWakeUpMotionTime()
Get the current count value of the timer of motion before sending a wakeup interrupt.
Definition: kxtj3.cxx:266
void SetInerruptResponse(KXTJ3_INTERRUPT_RESPONSE_T response_type)
Sets the response type of the interrupt pin.
Definition: kxtj3.cxx:183
float GetWakeUpNonActivityTime()
Get the current count value of the timer of non-activity before sending another wakeup interrupt...
Definition: kxtj3.cxx:287
void SetInterruptPolarity(KXTJ3_INTERRUPT_POLARITY_T polarity)
Sets the polarity of the interrupt pin.
Definition: kxtj3.cxx:177
void UninstallIsr()
Uninstalls a previously installed interrupt handler for interrupt pin.
Definition: kxtj3.cxx:214
void DisableWakeUpInterrupt()
Disables the wakeup function (motion detection)
Definition: kxtj3.cxx:159
Use it to get axis and direction for wake-up function.
Definition: kxtj3.h:168
void SensorSoftwareReset()
Performs a sensor software reset. The software reset clears the RAM of the sensor and resets all regi...
Definition: kxtj3.cxx:107
void DisableWakeUpSingleAxisDirection(KXTJ3_WAKEUP_SOURCE_T axis)
Disables wakeup interrupt for the given axis (axis with direction)
Definition: kxtj3.cxx:231
void SetWakeUpThresholdGRange(float g_threshold)
Sets the threshold g value for acceleration difference before sending a wakeup interrupt.
Definition: kxtj3.cxx:302
void DisableDataReadyInterrupt()
Disables the data ready interrupt.
Definition: kxtj3.cxx:147
void SetWakeUpThresholdCounter(uint16_t count)
Sets the threshold counter for acceleration difference before sending a wakeup interrupt.
Definition: kxtj3.cxx:296
void SensorInit(KXTJ3_ODR_T odr, KXTJ3_RESOLUTION_T resolution, KXTJ3_G_RANGE_T g_range)
Initializes the sensor with given sampling rate, resolution and acceleration range. This gets called in the constructor, so it will not need to be called unless the device is reset.
Definition: kxtj3.cxx:44
void EnableWakeUpLatch()
Enables the Unlatched mode motion interrupt (ULMODE). This mode is always by default enabled...
Definition: kxtj3.cxx:242
float GetWakeUpSamplePeriod()
Gets the duration of one sample period (in seconds) for the wakeup function depending on the sampling...
Definition: kxtj3.cxx:136
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
bool GetInterruptStatus()
Gets the status of the interrupts. (Has an interrupt occurred)
Definition: kxtj3.cxx:189
void InstallIsr(mraa_gpio_edge_t edge, int pin, void(*isr)(void *), void *isr_args)
Installs an interrupt handler to be executed when an interrupt is detected on the interrupt pin...
Definition: kxtj3.cxx:208
void SetOdr(KXTJ3_ODR_T odr)
Sets the ODR of the sensor.
Definition: kxtj3.cxx:83
float GetAccelerationSamplePeriod()
Gets the duration of one sample period (in seconds) for getting the acceleration data depending on th...
Definition: kxtj3.cxx:131
std::vector< float > GetAccelerationVector()
Definition: kxtj3.cxx:122
void SetWakeUpMotionCounter(uint8_t count)
Sets the timer counter of motion before sending a wakeup interrupt.
Definition: kxtj3.cxx:254
std::vector< float > GetAccelerationRawVector()
Definition: kxtj3.cxx:113
void DisableWakeUpLatch()
Disables the Unlatched mode motion interrupt (ULMODE). This mode is always by default enabled...
Definition: kxtj3.cxx:248
void EnableDataReadyInterrupt()
Enables the data ready interrupt. Availability of new acceleration data is reflected as an interrupt...
Definition: kxtj3.cxx:141
virtual ~KXTJ3()
KXTJ3 destructor.
Definition: kxtj3.cxx:39
uint8_t ReadInterruptSource1()
Gets the source of the interrupt The value stored is one or more of the KXTJ3_INTERRUPT_SOURCE_T valu...
Definition: kxtj3.cxx:194
KXTJ3(int bus, uint8_t addr=0x0f)
KXTJ3 constructor.
Definition: kxtj3.cxx:33
void ClearInterrupt()
Clears latching interrupts information of Wakeup (with axis and direction information) and Data Ready...
Definition: kxtj3.cxx:219
void SelfTestDigitalCommunication()
Performs a self-test for digital communication of the sensor. The test sets DCST bit in CTRL_REG2...
Definition: kxtj3.cxx:95
uint8_t GetWhoAmI()
Gets "who am I" value of the sensor.
Definition: kxtj3.cxx:50
void SetOdrForWakeup(KXTJ3_ODR_WAKEUP_T odr)
Sets the ODR of the wakeup function of the sensor.
Definition: kxtj3.cxx:89
KXTJ3_INTERRUPT_SOURCE_T GetInterruptSource()
Gets the source of the interrupt.
Definition: kxtj3.cxx:203
void EnableInterruptPin(KXTJ3_INTERRUPT_POLARITY_T polarity, KXTJ3_INTERRUPT_RESPONSE_T response_type)
Enables interrupts on the interrupt pin, sets polarity and response types. Polarity ACTIVE_HIGH or AC...
Definition: kxtj3.cxx:165
kxtj3_wakeup_axes GetWakeUpAxisDirection()
Gets the source axis and direction of motion detection of the wakeup function interrupt.
Definition: kxtj3.cxx:237
Sensor context.
Definition: kxtj3.h:181
void EnableWakeUpInterrupt()
Enables the wakeup function (motion detection)
Definition: kxtj3.cxx:153