Bridle API 4.1.99
A Zephyr based application framework
Loading...
Searching...
No Matches
STK8BA58 3-Axis Accelerometer

3-axis Accelerometer Sensor STK8BA58 More...

Modules

 STK8BA58 Register Access
 This file provides a set of functions needed to drive the STK8BA58 simplified inertial module.
 

Data Structures

struct  stk8ba58_config
 

Macros

#define STK8BA58_DEFINE(inst)
 

Functions

static int stk8ba58_get_range (const struct device *dev, uint8_t *range)
 
static int stk8ba58_set_range (const struct device *dev, uint8_t range)
 
static int stk8ba58_get_odr (const struct device *dev, uint8_t *odr)
 
static int stk8ba58_set_odr (const struct device *dev, uint8_t odr)
 
static int stk8ba58_get_pm (const struct device *dev, uint8_t *pm)
 
static int stk8ba58_set_pm (const struct device *dev, uint8_t pm)
 
static int stk8ba58_accel_getcfg (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val)
 
static int stk8ba58_attr_get (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val)
 
static int stk8ba58_accel_setcfg (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, const struct sensor_value *val)
 
static int stk8ba58_attr_set (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, const struct sensor_value *val)
 
static int stk8ba58_sample_fetch_accel (const struct device *dev)
 
static int stk8ba58_sample_fetch (const struct device *dev, enum sensor_channel chan)
 
static void stk8ba58_convert (struct sensor_value *val, int raw_val, float gain)
 
static int stk8ba58_get_channel (enum sensor_channel chan, struct sensor_value *val, struct stk8ba58_data *data, float gain)
 
static int stk8ba58_channel_get (const struct device *dev, enum sensor_channel chan, struct sensor_value *val)
 
static DEVICE_API (sensor, stk8ba58_driver_api)
 
static int stk8ba58_init (const struct device *dev)
 

Detailed Description

3-axis Accelerometer Sensor STK8BA58

Since
4.1
Version
1.0.0

The IMU sensor driver for an I2C-based STK8BA58 3-axis accelerometer.

Macro Definition Documentation

◆ STK8BA58_DEFINE

#define STK8BA58_DEFINE (   inst)

#include <drivers/sensor/sensortek/stk8ba58/stk8ba58.c>

Value:
static struct stk8ba58_data stk8ba58_data_##inst; \
static const struct stk8ba58_config stk8ba58_config_##inst = \
{ \
.i2c = I2C_DT_SPEC_INST_GET(inst), \
IF_ENABLED(CONFIG_STK8BA58_TRIGGER, \
(.gpio_int = GPIO_DT_SPEC_INST_GET_OR(inst, \
irq_gpios, { 0 }), \
) \
) \
.range = DT_INST_PROP(inst, range), \
.pm = DT_INST_PROP(inst, power_mode), \
.odr = DT_INST_PROP(inst, odr), \
}; \
SENSOR_DEVICE_DT_INST_DEFINE(inst, stk8ba58_init, NULL, \
&stk8ba58_data_##inst, \
&stk8ba58_config_##inst, \
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, \
&stk8ba58_driver_api);
static int stk8ba58_init(const struct device *dev)
Definition stk8ba58.c:522
Definition stk8ba58.h:33
uint8_t odr
Definition stk8ba58.h:36
uint8_t range
Definition stk8ba58.h:35
const struct i2c_dt_spec i2c
Definition stk8ba58.h:34
Definition stk8ba58.h:174

Function Documentation

◆ DEVICE_API()

static DEVICE_API ( sensor  ,
stk8ba58_driver_api   
)
static

◆ stk8ba58_accel_getcfg()

static int stk8ba58_accel_getcfg ( const struct device *  dev,
enum sensor_channel  chan,
enum sensor_attribute  attr,
struct sensor_value *  val 
)
static

◆ stk8ba58_accel_setcfg()

static int stk8ba58_accel_setcfg ( const struct device *  dev,
enum sensor_channel  chan,
enum sensor_attribute  attr,
const struct sensor_value *  val 
)
static

◆ stk8ba58_attr_get()

static int stk8ba58_attr_get ( const struct device *  dev,
enum sensor_channel  chan,
enum sensor_attribute  attr,
struct sensor_value *  val 
)
static

◆ stk8ba58_attr_set()

static int stk8ba58_attr_set ( const struct device *  dev,
enum sensor_channel  chan,
enum sensor_attribute  attr,
const struct sensor_value *  val 
)
static

◆ stk8ba58_channel_get()

static int stk8ba58_channel_get ( const struct device *  dev,
enum sensor_channel  chan,
struct sensor_value *  val 
)
static

◆ stk8ba58_convert()

static void stk8ba58_convert ( struct sensor_value *  val,
int  raw_val,
float  gain 
)
inlinestatic

◆ stk8ba58_get_channel()

static int stk8ba58_get_channel ( enum sensor_channel  chan,
struct sensor_value *  val,
struct stk8ba58_data data,
float  gain 
)
inlinestatic

◆ stk8ba58_get_odr()

static int stk8ba58_get_odr ( const struct device *  dev,
uint8_t *  odr 
)
static

◆ stk8ba58_get_pm()

static int stk8ba58_get_pm ( const struct device *  dev,
uint8_t *  pm 
)
static

◆ stk8ba58_get_range()

static int stk8ba58_get_range ( const struct device *  dev,
uint8_t *  range 
)
static

◆ stk8ba58_init()

static int stk8ba58_init ( const struct device *  dev)
static

◆ stk8ba58_sample_fetch()

static int stk8ba58_sample_fetch ( const struct device *  dev,
enum sensor_channel  chan 
)
static

◆ stk8ba58_sample_fetch_accel()

static int stk8ba58_sample_fetch_accel ( const struct device *  dev)
static

◆ stk8ba58_set_odr()

static int stk8ba58_set_odr ( const struct device *  dev,
uint8_t  odr 
)
static

◆ stk8ba58_set_pm()

static int stk8ba58_set_pm ( const struct device *  dev,
uint8_t  pm 
)
static

◆ stk8ba58_set_range()

static int stk8ba58_set_range ( const struct device *  dev,
uint8_t  range 
)
static