esp32_BNO08x 1.4
C++ BNO08x IMU driver component for esp-idf.
BNO08xSH2HAL Class Reference

Fully static class containing callback implementations for sh2 HAL lib. More...

#include <BNO08xSH2HAL.hpp>

Static Public Member Functions

static void set_hal_imu (BNO08x *hal_imu)
 Sets the BNO08x driver object to be used with sh2 HAL lib callbacks. More...
 
static int spi_open (sh2_Hal_t *self)
 Opens SPI instance by waiting for interrupt. More...
 
static void spi_close (sh2_Hal_t *self)
 Closes SPI instance (nothing to do here, but required by sh2 HAL lib for cases where other communication protocols are used.) More...
 
static int spi_read (sh2_Hal_t *self, uint8_t *pBuffer, unsigned len, uint32_t *t_us)
 SPI rx callback for sh2 HAL lib. More...
 
static int spi_write (sh2_Hal_t *self, uint8_t *pBuffer, unsigned len)
 SPI tx callback for sh2 HAL lib. More...
 
static uint32_t get_time_us (sh2_Hal_t *self)
 Get time in microseconds callback for sh2 HAL lib. More...
 
static void hal_cb (void *cookie, sh2_AsyncEvent_t *pEvent)
 General event callback for sh2 HAL lib, used to notify tasks of reset. More...
 
static void sensor_event_cb (void *cookie, sh2_SensorEvent_t *event)
 Sensor event callback for sh2 HAL lib, sends received reports to data_proc_task(). More...
 

Detailed Description

Fully static class containing callback implementations for sh2 HAL lib.

Member Function Documentation

◆ get_time_us()

uint32_t BNO08xSH2HAL::get_time_us ( sh2_Hal_t *  self)
static

Get time in microseconds callback for sh2 HAL lib.

Parameters
selfsh2 HAL lib object being used with BNO08x driver instance.
Returns
Time in microseconds.

◆ hal_cb()

void BNO08xSH2HAL::hal_cb ( void *  cookie,
sh2_AsyncEvent_t *  pEvent 
)
static

General event callback for sh2 HAL lib, used to notify tasks of reset.

Parameters
cookieUser set input parameter as void pointer (unused), see sh2_Open().
pEventPointer to asynchronous event.
Returns
void, nothing to return

◆ sensor_event_cb()

void BNO08xSH2HAL::sensor_event_cb ( void *  cookie,
sh2_SensorEvent_t *  event 
)
static

Sensor event callback for sh2 HAL lib, sends received reports to data_proc_task().

Parameters
cookieUser set input parameter as void pointer (unused), see sh2_Open().
eventPointer to sensor event.
Returns
void, nothing to return

◆ set_hal_imu()

void BNO08xSH2HAL::set_hal_imu ( BNO08x hal_imu)
static

Sets the BNO08x driver object to be used with sh2 HAL lib callbacks.

Parameters
hal_imuPointer to BNO08x driver object to be used with sh2 HAL lib callbacks.
Returns
void, nothing to return

◆ spi_close()

void BNO08xSH2HAL::spi_close ( sh2_Hal_t *  self)
static

Closes SPI instance (nothing to do here, but required by sh2 HAL lib for cases where other communication protocols are used.)

Returns
void, nothing to return

◆ spi_open()

int BNO08xSH2HAL::spi_open ( sh2_Hal_t *  self)
static

Opens SPI instance by waiting for interrupt.

Returns
Always returns 0.

◆ spi_read()

int BNO08xSH2HAL::spi_read ( sh2_Hal_t *  self,
uint8_t *  pBuffer,
unsigned  len,
uint32_t *  t_us 
)
static

SPI rx callback for sh2 HAL lib.

Parameters
selfsh2 HAL lib object being used with BNO08x driver instance.
pBufferBuffer to store received packet.
lenLength of bytes to read.
t_usTime in microseconds (unused, forced sh2 HAL lib required function type)
Returns
Size of received packet in bytes, 0 on failure.

◆ spi_write()

int BNO08xSH2HAL::spi_write ( sh2_Hal_t *  self,
uint8_t *  pBuffer,
unsigned  len 
)
static

SPI tx callback for sh2 HAL lib.

Parameters
selfsh2 HAL lib object being used with BNO08x driver instance.
pBufferBuffer containing data to write.
lenLength in bytes to write.
Returns
Size of sent data (len param), 0 on failure.

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