TMF8829 Universal Driver 0.1.0
Loading...
Searching...
No Matches
tmf8829_types.h File Reference

Public typedefs, errors, log levels, and compile-time limits. More...

#include <stddef.h>
#include <stdint.h>
Include dependency graph for tmf8829_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TMF8829_CLK_CORRECTION_PAIRS
 Ring buffer depth for (host_tick, device_tick) clock-correction pairs.
#define TMF8829_MIN_BUFFER_SIZE
 Minimum tmf8829_driver_t::buffer_len in bytes.

Typedefs

typedef struct tmf8829_driver tmf8829_driver_t
typedef struct tmf8829_ops tmf8829_ops_t
typedef enum tmf8829_bus tmf8829_bus_t
 Physical bus used to reach this device instance.
typedef enum tmf8829_err tmf8829_err_t
 Return codes from public driver functions.

Enumerations

enum  tmf8829_bus { TMF8829_BUS_I2C = 0 , TMF8829_BUS_SPI = 1 }
 Physical bus used to reach this device instance. More...
enum  tmf8829_err {
  TMF8829_OK = 0 , TMF8829_E_PARAM = -1 , TMF8829_E_BUS = -2 , TMF8829_E_TIMEOUT = -3 ,
  TMF8829_E_NO_RESULT = -4 , TMF8829_E_BOOTLOADER = -5 , TMF8829_E_STATE = -6 , TMF8829_E_NOT_IMPLEMENTED = -99
}
 Return codes from public driver functions. More...
enum  tmf8829_log_level {
  TMF8829_LOG_NONE = 0x00 , TMF8829_LOG_ERROR = 0x01 , TMF8829_LOG_RESULTS_HEADER = 0x02 , TMF8829_LOG_RESULTS = 0x04 ,
  TMF8829_LOG_CLK_CORRECTION = 0x08 , TMF8829_LOG_INFO = 0x10 , TMF8829_LOG_VERBOSE = 0x20 , TMF8829_LOG_BUS = 0x80 ,
  TMF8829_LOG_DEBUG = 0xFF
}
 Bit-mask log levels (ams-OSRAM compatible). More...

Detailed Description

Public typedefs, errors, log levels, and compile-time limits.

Includes only <stdint.h> and <stddef.h>. Safe to include before any platform headers.

Macro Definition Documentation

◆ TMF8829_CLK_CORRECTION_PAIRS

#define TMF8829_CLK_CORRECTION_PAIRS

Ring buffer depth for (host_tick, device_tick) clock-correction pairs.

Must be a power of two. Overridable with a compile-time -D.

◆ TMF8829_MIN_BUFFER_SIZE

#define TMF8829_MIN_BUFFER_SIZE

Minimum tmf8829_driver_t::buffer_len in bytes.

Used for register staging and bootloader payloads. Larger buffers are required for FIFO download with big chunks.

Typedef Documentation

◆ tmf8829_bus_t

typedef enum tmf8829_bus tmf8829_bus_t

Physical bus used to reach this device instance.

◆ tmf8829_driver_t

◆ tmf8829_err_t

typedef enum tmf8829_err tmf8829_err_t

Return codes from public driver functions.

Functions return int: 0 (TMF8829_OK) on success, negative values from this enumeration on failure.

Note
Host-supplied tmf8829_ops_t callbacks should use the same convention: 0 on success, negative on error.

◆ tmf8829_ops_t

typedef struct tmf8829_ops tmf8829_ops_t

Enumeration Type Documentation

◆ tmf8829_bus

Physical bus used to reach this device instance.

Enumerator
TMF8829_BUS_I2C 

Register access via I2C.

TMF8829_BUS_SPI 

Register access via SPI.

◆ tmf8829_err

Return codes from public driver functions.

Functions return int: 0 (TMF8829_OK) on success, negative values from this enumeration on failure.

Note
Host-supplied tmf8829_ops_t callbacks should use the same convention: 0 on success, negative on error.
Enumerator
TMF8829_OK 

Success.

TMF8829_E_PARAM 

Invalid argument or bad state.

TMF8829_E_BUS 

Underlying bus read/write failed.

TMF8829_E_TIMEOUT 

Poll or wait exceeded budget.

TMF8829_E_NO_RESULT 

No frame / wrong frame type / bad EOF.

TMF8829_E_BOOTLOADER 

Bootloader rejected command or bad image.

TMF8829_E_STATE 

Operation invalid for current mode.

TMF8829_E_NOT_IMPLEMENTED 

Reserved for stubbed entry points.

◆ tmf8829_log_level

Bit-mask log levels (ams-OSRAM compatible).

Combine with bitwise OR. Compared against tmf8829_driver_t::log_level when the driver invokes tmf8829_driver_t::log.

Enumerator
TMF8829_LOG_NONE 

No categories.

TMF8829_LOG_ERROR 

Errors.

TMF8829_LOG_RESULTS_HEADER 

Result stream headers.

TMF8829_LOG_RESULTS 

Result payload detail.

TMF8829_LOG_CLK_CORRECTION 

Clock correction updates.

TMF8829_LOG_INFO 

General information.

TMF8829_LOG_VERBOSE 

Verbose tracing.

TMF8829_LOG_BUS 

Low-level bus traffic.

TMF8829_LOG_DEBUG 

All categories.