TT-System-Firmware APIs 19.13.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
bh_arc_telem.c File Reference
Include dependency graph for bh_arc_telem.c:

Data Structures

struct  bh_arc_telem_config
struct  bh_arc_telem_map
struct  bh_arc_telem_rtio_data

Macros

#define DT_DRV_COMPAT   tenstorrent_bh_arc_telemetry
#define BH_ARC_TELEM_RCV_BUF_LEN   7U
#define BH_ARC_TELEM_MAP_ENTRY(node_id)
#define BH_ARC_TELEM_MAP_COUNT(inst)
#define BH_ARC_TELEM_DEFINE(inst)

Functions

 LOG_MODULE_REGISTER (bh_arc_telem, CONFIG_SENSOR_LOG_LEVEL)
static int bh_arc_telem_raw_to_sensor_value (uint8_t telem_tag, int32_t scale_micro, uint32_t raw, struct sensor_value *val)
static const struct bh_arc_telem_mapbh_arc_telem_find_map (const struct bh_arc_telem_config *cfg, enum sensor_channel channel, uint8_t channel_index)
static int bh_arc_telem_read_raw (const struct bh_arc_telem_config *cfg, const struct bh_arc_telem_map *map, uint32_t *raw)
static int bh_arc_telem_decoder_get_frame_count (const uint8_t *buffer, struct sensor_chan_spec chan_spec, uint16_t *frame_count)
static int bh_arc_telem_decoder_get_size_info (struct sensor_chan_spec channel, size_t *base_size, size_t *frame_size)
static int bh_arc_telem_decoder_decode (const uint8_t *buffer, struct sensor_chan_spec chan_spec, uint32_t *fit, uint16_t max_count, void *data_out)
static bool bh_arc_telem_decoder_has_trigger (const uint8_t *buffer, enum sensor_trigger_type trig)
 SENSOR_DECODER_API_DT_DEFINE ()
static int bh_arc_telem_get_decoder (const struct device *dev, const struct sensor_decoder_api **decoder)
static void bh_arc_telem_submit_sample (struct rtio_iodev_sqe *iodev_sqe)
static void bh_arc_telem_submit (const struct device *sensor, struct rtio_iodev_sqe *sqe)
static int bh_arc_telem_init (const struct device *dev)
static DEVICE_API (sensor, bh_arc_telem_api)

Macro Definition Documentation

◆ BH_ARC_TELEM_DEFINE

#define BH_ARC_TELEM_DEFINE ( inst)
Value:
static const struct bh_arc_telem_map \
bh_arc_telem_maps_##inst[MAX(1, BH_ARC_TELEM_MAP_COUNT(inst))] = { \
DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), BH_ARC_TELEM_MAP_ENTRY)}; \
static const struct bh_arc_telem_config bh_arc_telem_cfg_##inst = { \
.smbus = SMBUS_DT_SPEC_GET(DT_PHANDLE(DT_DRV_INST(inst), arc)), \
.maps = bh_arc_telem_maps_##inst, \
}; \
DEVICE_DT_INST_DEFINE(inst, bh_arc_telem_init, NULL, NULL, &bh_arc_telem_cfg_##inst, \
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &bh_arc_telem_api)
#define NULL
Definition avs.c:45
#define BH_ARC_TELEM_MAP_ENTRY(node_id)
Definition bh_arc_telem.c:314
#define BH_ARC_TELEM_MAP_COUNT(inst)
Definition bh_arc_telem.c:322
static int bh_arc_telem_init(const struct device *dev)
Definition bh_arc_telem.c:290
#define DT_PHANDLE(node_id, prop)
#define DT_DRV_INST(inst)
#define SMBUS_DT_SPEC_GET(node_id)
#define MAX(a, b)
Definition bh_arc_telem.c:29
size_t map_count
Definition bh_arc_telem.c:32
Definition bh_arc_telem.c:35

◆ BH_ARC_TELEM_MAP_COUNT

#define BH_ARC_TELEM_MAP_COUNT ( inst)
Value:
#define DT_CHILD_NUM_STATUS_OKAY(node_id)

◆ BH_ARC_TELEM_MAP_ENTRY

#define BH_ARC_TELEM_MAP_ENTRY ( node_id)
Value:
{ \
.channel = (enum sensor_channel)DT_PROP(node_id, channel_type), \
.channel_index = DT_PROP(node_id, channel_index), \
.telem_tag = DT_PROP(node_id, telemetry_tag), \
.scale_micro = DT_PROP(node_id, scale_micro), \
},
#define DT_PROP(node_id, prop)
sensor_channel

◆ BH_ARC_TELEM_RCV_BUF_LEN

#define BH_ARC_TELEM_RCV_BUF_LEN   7U

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_bh_arc_telemetry

Function Documentation

◆ bh_arc_telem_decoder_decode()

int bh_arc_telem_decoder_decode ( const uint8_t * buffer,
struct sensor_chan_spec chan_spec,
uint32_t * fit,
uint16_t max_count,
void * data_out )
static

◆ bh_arc_telem_decoder_get_frame_count()

int bh_arc_telem_decoder_get_frame_count ( const uint8_t * buffer,
struct sensor_chan_spec chan_spec,
uint16_t * frame_count )
static

◆ bh_arc_telem_decoder_get_size_info()

int bh_arc_telem_decoder_get_size_info ( struct sensor_chan_spec channel,
size_t * base_size,
size_t * frame_size )
static

◆ bh_arc_telem_decoder_has_trigger()

bool bh_arc_telem_decoder_has_trigger ( const uint8_t * buffer,
enum sensor_trigger_type trig )
static

◆ bh_arc_telem_find_map()

const struct bh_arc_telem_map * bh_arc_telem_find_map ( const struct bh_arc_telem_config * cfg,
enum sensor_channel channel,
uint8_t channel_index )
static

◆ bh_arc_telem_get_decoder()

int bh_arc_telem_get_decoder ( const struct device * dev,
const struct sensor_decoder_api ** decoder )
static

◆ bh_arc_telem_init()

int bh_arc_telem_init ( const struct device * dev)
static

◆ bh_arc_telem_raw_to_sensor_value()

int bh_arc_telem_raw_to_sensor_value ( uint8_t telem_tag,
int32_t scale_micro,
uint32_t raw,
struct sensor_value * val )
static

◆ bh_arc_telem_read_raw()

int bh_arc_telem_read_raw ( const struct bh_arc_telem_config * cfg,
const struct bh_arc_telem_map * map,
uint32_t * raw )
static

◆ bh_arc_telem_submit()

void bh_arc_telem_submit ( const struct device * sensor,
struct rtio_iodev_sqe * sqe )
static

◆ bh_arc_telem_submit_sample()

void bh_arc_telem_submit_sample ( struct rtio_iodev_sqe * iodev_sqe)
static

◆ DEVICE_API()

DEVICE_API ( sensor ,
bh_arc_telem_api  )
static

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( bh_arc_telem ,
CONFIG_SENSOR_LOG_LEVEL  )

◆ SENSOR_DECODER_API_DT_DEFINE()

SENSOR_DECODER_API_DT_DEFINE ( )