ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
ext_i2c.c File Reference

HAL binding of the Qwiic devices (see ext_i2c.h). More...

#include "ext_i2c.h"
#include "imu_i2c.h"
#include "cmsis_os2.h"
#include "main.h"
Include dependency graph for ext_i2c.c:

Go to the source code of this file.

Macros

#define EXT_I2C_TIMEOUT_MS   3u
 

Functions

static int32_t xfer (void *h, uint16_t reg, uint16_t regsz, uint8_t *d, uint16_t len, int write)
 
static int32_t wr16 (void *h, uint16_t reg, const uint8_t *d, uint16_t n)
 
static int32_t rd16 (void *h, uint16_t reg, uint8_t *d, uint16_t n)
 
static int32_t wr8 (void *h, uint8_t reg, const uint8_t *d, uint16_t n)
 
static int32_t rd8 (void *h, uint8_t reg, uint8_t *d, uint16_t n)
 
static void dly (uint32_t ms)
 
void ext_i2c_tof_bus (vl53_bus_t *b, uint8_t addr7)
 16-bit registers
 
void ext_i2c_flow_bus (sensor_bus_t *b, uint8_t addr7)
 8-bit registers

 

Detailed Description

HAL binding of the Qwiic devices (see ext_i2c.h).

Definition in file ext_i2c.c.

Macro Definition Documentation

◆ EXT_I2C_TIMEOUT_MS

#define EXT_I2C_TIMEOUT_MS   3u

Definition at line 10 of file ext_i2c.c.

Function Documentation

◆ xfer()

static int32_t xfer ( void *  h,
uint16_t  reg,
uint16_t  regsz,
uint8_t *  d,
uint16_t  len,
int  write 
)
static

Definition at line 12 of file ext_i2c.c.

References EXT_I2C_TIMEOUT_MS, imu_i2c_handle(), imu_i2c_lock(), imu_i2c_unlock(), and st().

Referenced by rd16(), rd8(), wr16(), and wr8().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wr16()

static int32_t wr16 ( void *  h,
uint16_t  reg,
const uint8_t *  d,
uint16_t  n 
)
static

Definition at line 23 of file ext_i2c.c.

References n, and xfer().

Referenced by ext_i2c_tof_bus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rd16()

static int32_t rd16 ( void *  h,
uint16_t  reg,
uint8_t *  d,
uint16_t  n 
)
static

Definition at line 24 of file ext_i2c.c.

References n, and xfer().

Referenced by ext_i2c_tof_bus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wr8()

static int32_t wr8 ( void *  h,
uint8_t  reg,
const uint8_t *  d,
uint16_t  n 
)
static

Definition at line 25 of file ext_i2c.c.

References n, and xfer().

Referenced by ext_i2c_flow_bus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rd8()

static int32_t rd8 ( void *  h,
uint8_t  reg,
uint8_t *  d,
uint16_t  n 
)
static

Definition at line 26 of file ext_i2c.c.

References n, and xfer().

Referenced by ext_i2c_flow_bus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dly()

static void dly ( uint32_t  ms)
static

Definition at line 27 of file ext_i2c.c.

References ms.

Referenced by ext_i2c_flow_bus(), and ext_i2c_tof_bus().

Here is the caller graph for this function:

◆ ext_i2c_tof_bus()

void ext_i2c_tof_bus ( vl53_bus_t *  b,
uint8_t  addr7 
)

16-bit registers

Definition at line 29 of file ext_i2c.c.

References b, dly(), rd16(), and wr16().

Referenced by ext_sens_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ext_i2c_flow_bus()

void ext_i2c_flow_bus ( sensor_bus_t *  b,
uint8_t  addr7 
)

8-bit registers

Definition at line 34 of file ext_i2c.c.

References b, dly(), rd8(), and wr8().

Referenced by ext_sens_start().

Here is the call graph for this function:
Here is the caller graph for this function: