12#ifndef ZEPHYR_INCLUDE_DRIVERS_SENT_H_
13#define ZEPHYR_INCLUDE_DRIVERS_SENT_H_
48#define SENT_MAX_DATA_NIBBLES 8
94 uint32_t num_frame,
void *user_data);
102typedef int (*sent_start_listening_t)(
const struct device *dev,
uint8_t channel);
108typedef int (*sent_stop_listening_t)(
const struct device *dev,
uint8_t channel);
113struct sent_rx_callback_config {
127struct sent_rx_callback_configs {
129 struct sent_rx_callback_config *serial;
131 struct sent_rx_callback_config *fast;
138typedef int (*sent_register_callback_t)(
const struct device *dev,
uint8_t channel,
139 struct sent_rx_callback_configs callback_configs);
141__subsystem
struct sent_driver_api {
142 sent_start_listening_t start_listening;
143 sent_stop_listening_t stop_listening;
144 sent_register_callback_t register_callback;
161static inline int z_impl_sent_start_listening(
const struct device *dev,
uint8_t channel)
163 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
165 if (api->start_listening) {
166 return api->start_listening(dev, channel);
184static inline int z_impl_sent_stop_listening(
const struct device *dev,
uint8_t channel)
186 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
188 if (api->stop_listening) {
189 return api->stop_listening(dev, channel);
205 struct sent_rx_callback_configs callback_configs);
207static inline int z_impl_sent_register_callback(
const struct device *dev,
uint8_t channel,
208 struct sent_rx_callback_configs callback_configs)
210 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
212 if (api->register_callback) {
213 return api->register_callback(dev, channel, callback_configs);
227#include <zephyr/syscalls/sent.h>
sent_frame_type
SENT frame type.
Definition sent.h:34
#define SENT_MAX_DATA_NIBBLES
Maximum number of data nibbles.
Definition sent.h:48
int sent_start_listening(const struct device *dev, uint8_t channel)
Enable a specific channel to start receiving from the bus.
void(* sent_rx_frame_callback_t)(const struct device *dev, uint8_t channel, uint32_t num_frame, void *user_data)
Defines the application callback handler function signature for receiving frame.
Definition sent.h:93
int sent_register_callback(const struct device *dev, uint8_t channel, struct sent_rx_callback_configs callback_configs)
Add a callback function to handle messages received for a specific channel.
int sent_stop_listening(const struct device *dev, uint8_t channel)
Disable a specific channel to stop receiving from the bus.
@ SENT_ENHANCED_SERIAL_FRAME_4_BIT_ID
Enhanced serial message frame with 4-bit message ID.
Definition sent.h:38
@ SENT_SHORT_SERIAL_FRAME
Short serial message frame.
Definition sent.h:36
@ SENT_ENHANCED_SERIAL_FRAME_8_BIT_ID
Enhanced serial message frame with 8-bit message ID.
Definition sent.h:40
@ SENT_FAST_FRAME
Fast message frame.
Definition sent.h:42
#define ENOSYS
Function not implemented.
Definition errno.h:82
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:510
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:516
SENT frame structure.
Definition sent.h:53
struct sent_frame::@073352004002173133105234200026220315236122230346::@052310202357350204237047306111207070070357322354 fast
Fast message.
uint16_t data
Serial message data.
Definition sent.h:66
uint8_t data_nibbles[8]
Array of fast message data nibbles.
Definition sent.h:74
uint8_t crc
CRC checksum for message integrity validation.
Definition sent.h:82
uint8_t id
Serial message ID.
Definition sent.h:63
uint32_t timestamp
Timestamp of when the frame was captured.
Definition sent.h:79
enum sent_frame_type type
Type of SENT frame.
Definition sent.h:55
struct sent_frame::@073352004002173133105234200026220315236122230346::@200101137234253347137231003000335224000042211161 serial
Serial message.