Bridle API 4.1.99
A Zephyr based application framework
Loading...
Searching...
No Matches
stk8ba58.c File Reference

Driver for an STK8BA58 I2C-based 3-axis accelerometer. More...

#include <zephyr/drivers/sensor.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/__assert.h>
#include "stk8ba58.h"
#include <zephyr/logging/log.h>

Macros

#define DT_DRV_COMPAT   sensortek_stk8ba58
 
#define STK8BA58_DEFINE(inst)
 

Functions

 LOG_MODULE_REGISTER (STK8BA58, CONFIG_SENSOR_LOG_LEVEL)
 
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

Driver for an STK8BA58 I2C-based 3-axis accelerometer.

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   sensortek_stk8ba58

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( STK8BA58  ,
CONFIG_SENSOR_LOG_LEVEL   
)