13#ifndef ZEPHYR_INCLUDE_DRIVERS_SENT_H_
14#define ZEPHYR_INCLUDE_DRIVERS_SENT_H_
49#define SENT_MAX_DATA_NIBBLES 8
95 uint32_t num_frame,
void *user_data);
103typedef int (*sent_start_listening_t)(
const struct device *dev,
uint8_t channel);
109typedef int (*sent_stop_listening_t)(
const struct device *dev,
uint8_t channel);
114struct sent_rx_callback_config {
128struct sent_rx_callback_configs {
130 struct sent_rx_callback_config *serial;
132 struct sent_rx_callback_config *fast;
139typedef int (*sent_register_callback_t)(
const struct device *dev,
uint8_t channel,
140 struct sent_rx_callback_configs callback_configs);
142__subsystem
struct sent_driver_api {
143 sent_start_listening_t start_listening;
144 sent_stop_listening_t stop_listening;
145 sent_register_callback_t register_callback;
162static inline int z_impl_sent_start_listening(
const struct device *dev,
uint8_t channel)
164 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
166 if (api->start_listening) {
167 return api->start_listening(dev, channel);
185static inline int z_impl_sent_stop_listening(
const struct device *dev,
uint8_t channel)
187 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
189 if (api->stop_listening) {
190 return api->stop_listening(dev, channel);
206 struct sent_rx_callback_configs callback_configs);
208static inline int z_impl_sent_register_callback(
const struct device *dev,
uint8_t channel,
209 struct sent_rx_callback_configs callback_configs)
211 const struct sent_driver_api *api = (
const struct sent_driver_api *)dev->
api;
213 if (api->register_callback) {
214 return api->register_callback(dev, channel, callback_configs);
228#include <zephyr/syscalls/sent.h>
sent_frame_type
SENT frame type.
Definition sent.h:35
#define SENT_MAX_DATA_NIBBLES
Maximum number of data nibbles.
Definition sent.h:49
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:94
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:39
@ SENT_SHORT_SERIAL_FRAME
Short serial message frame.
Definition sent.h:37
@ SENT_ENHANCED_SERIAL_FRAME_8_BIT_ID
Enhanced serial message frame with 8-bit message ID.
Definition sent.h:41
@ SENT_FAST_FRAME
Fast message frame.
Definition sent.h:43
#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:54
uint16_t data
Serial message data.
Definition sent.h:67
uint8_t data_nibbles[8]
Array of fast message data nibbles.
Definition sent.h:75
struct sent_frame::@275::@277 serial
Serial message.
uint8_t crc
CRC checksum for message integrity validation.
Definition sent.h:83
uint8_t id
Serial message ID.
Definition sent.h:64
struct sent_frame::@275::@278 fast
Fast message.
uint32_t timestamp
Timestamp of when the frame was captured.
Definition sent.h:80
enum sent_frame_type type
Type of SENT frame.
Definition sent.h:56