TMF8829 Universal Driver 0.1.0
Loading...
Searching...
No Matches
tmf8829_ops.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (c) 2026 tmf8829_universal_driver contributors
5 * Derived from ams-OSRAM TMF8829 reference drivers (MIT); adapted for portable multi-instance use.
6 */
7
15
16#ifndef TMF8829_OPS_H
17#define TMF8829_OPS_H
18
19#include "tmf8829_types.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
44typedef int (*tmf8829_read_fn)(tmf8829_driver_t* drv, uint8_t reg, uint8_t* buf, uint16_t len);
45
51typedef int (*tmf8829_write_fn)(tmf8829_driver_t* drv, uint8_t reg, const uint8_t* buf, uint16_t len);
52
56typedef void (*tmf8829_delay_us_fn)(uint32_t us);
57
61typedef uint32_t (*tmf8829_systick_us_fn)(void);
62
73typedef void (*tmf8829_write_pin_enable_fn)(tmf8829_driver_t* drv, int high);
74
83
98
99#ifdef __cplusplus
100} /* extern "C" */
101#endif
102
103#endif /* TMF8829_OPS_H */
Set of platform callbacks required by tmf8829_init.
Definition tmf8829_ops.h:90
tmf8829_read_pin_int_fn read_pin_int
Definition tmf8829_ops.h:96
tmf8829_delay_us_fn delay_us
Definition tmf8829_ops.h:93
tmf8829_write_pin_enable_fn write_pin_enable
Definition tmf8829_ops.h:95
tmf8829_systick_us_fn systick_us
Definition tmf8829_ops.h:94
tmf8829_write_fn write
Definition tmf8829_ops.h:92
tmf8829_read_fn read
Definition tmf8829_ops.h:91
uint32_t(* tmf8829_systick_us_fn)(void)
Free-running microsecond tick (32-bit wrap allowed; only differences are used).
Definition tmf8829_ops.h:61
void(* tmf8829_delay_us_fn)(uint32_t us)
Busy-wait for at least us microseconds (resolution is host-defined).
Definition tmf8829_ops.h:56
int(* tmf8829_write_fn)(tmf8829_driver_t *drv, uint8_t reg, const uint8_t *buf, uint16_t len)
Write len bytes from buf starting at register reg.
Definition tmf8829_ops.h:51
int(* tmf8829_read_fn)(tmf8829_driver_t *drv, uint8_t reg, uint8_t *buf, uint16_t len)
Read len bytes from register reg into buf.
Definition tmf8829_ops.h:44
int(* tmf8829_read_pin_int_fn)(tmf8829_driver_t *drv)
Optional: read the IRQ GPIO level for this instance.
Definition tmf8829_ops.h:82
void(* tmf8829_write_pin_enable_fn)(tmf8829_driver_t *drv, int high)
Drive the sensor enable pin: low if high is zero, else high.
Definition tmf8829_ops.h:73
Public typedefs, errors, log levels, and compile-time limits.
struct tmf8829_driver tmf8829_driver_t
Definition tmf8829_types.h:33