TMF8829 Universal Driver 0.1.0
Loading...
Searching...
No Matches
tmf8829_driver Struct Reference

One driver instance per physical TMF8829. More...

#include <tmf8829.h>

Collaboration diagram for tmf8829_driver:
[legend]

Data Fields

tmf8829_bus_t bus
uint8_t i2c_addr
void * user_ctx
const tmf8829_ops_tops
uint8_t * buffer
uint16_t buffer_len
uint16_t max_write_len
uint8_t log_level
tmf8829_log_fn log
tmf8829_on_stream_header_fn on_stream_header
tmf8829_on_result_fn on_result
tmf8829_on_histogram_fn on_histogram
tmf8829_on_error_fn on_error
tmf8829_fw_image_read_fn fw_image_read
uint32_t host_ticks_per_1000_us
uint8_t config [TMF8829_CFG_PAGE_SIZE]
uint32_t device_serial_number
uint8_t app_version [4]
uint8_t chip_version [2]
uint16_t _clk_corr_ratio_uq
uint8_t _clk_corr_enable
uint8_t _clk_corr_idx
uint8_t _cyclic_running
uint32_t _host_ticks [TMF8829_CLK_CORRECTION_PAIRS]
uint32_t _device_ticks [TMF8829_CLK_CORRECTION_PAIRS]
uint32_t _initialised

Detailed Description

One driver instance per physical TMF8829.

Host supplies buffer, ops, and optional callbacks. Fields whose names start with _ are reserved for internal use but are visible so the struct can be zero-initialised as static storage.

Field Documentation

◆ _clk_corr_enable

uint8_t tmf8829_driver::_clk_corr_enable

Internal: non-zero if pairs are collected.

◆ _clk_corr_idx

uint8_t tmf8829_driver::_clk_corr_idx

Internal: ring index for correction pairs.

◆ _clk_corr_ratio_uq

uint16_t tmf8829_driver::_clk_corr_ratio_uq

Internal: UQ15 clock ratio vs nominal.

◆ _cyclic_running

uint8_t tmf8829_driver::_cyclic_running

Internal: measurement active flag.

◆ _device_ticks

uint32_t tmf8829_driver::_device_ticks[TMF8829_CLK_CORRECTION_PAIRS]

Internal

◆ _host_ticks

uint32_t tmf8829_driver::_host_ticks[TMF8829_CLK_CORRECTION_PAIRS]

Internal

◆ _initialised

uint32_t tmf8829_driver::_initialised

Internal: magic after tmf8829_init.

◆ app_version

uint8_t tmf8829_driver::app_version[4]

Application version triple + build, from registers; see tmf8829_read_device_info.

◆ buffer

uint8_t* tmf8829_driver::buffer

Caller-owned buffer for register IO and download staging.

◆ buffer_len

uint16_t tmf8829_driver::buffer_len

Size of buffer in bytes; must be at least TMF8829_MIN_BUFFER_SIZE.

◆ bus

tmf8829_bus_t tmf8829_driver::bus

Bus protocol for this instance (TMF8829_BUS_I2C or TMF8829_BUS_SPI).

◆ chip_version

uint8_t tmf8829_driver::chip_version[2]

Chip id / revision bytes from TMF8829_REG_CID_RID.

◆ config

uint8_t tmf8829_driver::config[TMF8829_CFG_PAGE_SIZE]

Cached configuration page (TMF8829_CFG_PAGE_SIZE bytes). Filled by tmf8829_get_configuration; consumed by tmf8829_set_configuration.

◆ device_serial_number

uint32_t tmf8829_driver::device_serial_number

Device serial number (little-endian), updated by tmf8829_read_device_info.

◆ fw_image_read

tmf8829_fw_image_read_fn tmf8829_driver::fw_image_read

Optional image reader for tmf8829_download_firmware; may be NULL.

◆ host_ticks_per_1000_us

uint32_t tmf8829_driver::host_ticks_per_1000_us

Host timer ticks that correspond to one millisecond (for clock correction). If 0 after tmf8829_init, the driver assumes 1000 ticks per ms (i.e. tmf8829_ops_t::systick_us counts microseconds). Set before tmf8829_init if your tick is coarser or finer.

◆ i2c_addr

uint8_t tmf8829_driver::i2c_addr

I2C 7-bit address when bus is TMF8829_BUS_I2C; ignored for SPI.

◆ log

tmf8829_log_fn tmf8829_driver::log

Optional log sink; may be NULL.

◆ log_level

uint8_t tmf8829_driver::log_level

Bit mask: tmf8829_log_level; used if log is non-NULL.

◆ max_write_len

uint16_t tmf8829_driver::max_write_len

Optional per-transfer bus write capability in bytes.

Limits the payload length passed to tmf8829_ops_t::write in a single call. Set to 0 to disable this extra cap (driver then only uses protocol limits).

◆ on_error

tmf8829_on_error_fn tmf8829_driver::on_error

Optional error callback; may be NULL.

◆ on_histogram

tmf8829_on_histogram_fn tmf8829_driver::on_histogram

Optional: called per histogram chunk; may be NULL.

◆ on_result

tmf8829_on_result_fn tmf8829_driver::on_result

Optional: called per result chunk; may be NULL.

◆ on_stream_header

tmf8829_on_stream_header_fn tmf8829_driver::on_stream_header

Optional: called with stream header bytes; may be NULL.

◆ ops

const tmf8829_ops_t* tmf8829_driver::ops

Platform callbacks; set by tmf8829_init from its argument.

◆ user_ctx

void* tmf8829_driver::user_ctx

Opaque handle passed to tmf8829_ops_t callbacks (e.g. HAL handle).


The documentation for this struct was generated from the following file: