12#ifndef ZEPHYR_INCLUDE_DRIVERS_PSI5_H_
13#define ZEPHYR_INCLUDE_DRIVERS_PSI5_H_
95 uint32_t num_frame,
void *user_data);
180static inline int z_impl_psi5_start_sync(
const struct device *dev,
uint8_t channel)
203static inline int z_impl_psi5_stop_sync(
const struct device *dev,
uint8_t channel)
246 return api->
send(dev, channel, data, timeout, callback, user_data);
267static inline int z_impl_psi5_register_callback(
const struct device *dev,
uint8_t channel,
287#include <zephyr/syscalls/psi5.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1425
int(* psi5_send_t)(const struct device *dev, uint8_t channel, const uint64_t data, k_timeout_t timeout, psi5_tx_callback_t callback, void *user_data)
Callback API upon sending PSI5 frame See psi5_send() for argument description.
Definition psi5.h:118
int psi5_register_callback(const struct device *dev, uint8_t channel, struct psi5_rx_callback_configs callback_configs)
Add a callback function to handle messages received for a specific channel.
int psi5_send(const struct device *dev, uint8_t channel, const uint64_t data, k_timeout_t timeout, psi5_tx_callback_t callback, void *user_data)
Transmitting PSI5 data on a specific channel.
int(* psi5_stop_sync_t)(const struct device *dev, uint8_t channel)
Callback API upon stopping sync PSI5 See psi5_stop_sync() for argument description.
Definition psi5.h:112
psi5_frame_type
PSI5 frame type.
Definition psi5.h:34
void(* psi5_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 psi5.h:94
void(* psi5_tx_callback_t)(const struct device *dev, uint8_t channel, int status, void *user_data)
Defines the application callback handler function signature for sending.
Definition psi5.h:83
int psi5_start_sync(const struct device *dev, uint8_t channel)
Start the sync pulse generator on a specific channel.
int psi5_stop_sync(const struct device *dev, uint8_t channel)
Stop the sync pulse generator on a specific channel.
int(* psi5_register_callback_t)(const struct device *dev, uint8_t channel, struct psi5_rx_callback_configs callback_configs)
Callback API upon adding RX callback See psi5_register_callback() for argument description.
Definition psi5.h:149
int(* psi5_start_sync_t)(const struct device *dev, uint8_t channel)
@def_driverbackendgroup{PSI5,psi5_interface}
Definition psi5.h:106
@ PSI5_SERIAL_FRAME_4_BIT_ID
Serial message frame with 4-bit message ID.
Definition psi5.h:36
@ PSI5_DATA_FRAME
Data frame.
Definition psi5.h:40
@ PSI5_SERIAL_FRAME_8_BIT_ID
Serial message frame with 8-bit message ID.
Definition psi5.h:38
#define ENOSYS
Function not implemented.
Definition errno.h:83
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__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:513
void * data
Address of the device instance private data.
Definition device.h:523
Kernel timeout type.
Definition clock.h:65
@driver_ops{PSI5}
Definition psi5.h:155
psi5_register_callback_t register_callback
@driver_ops_optional Add a callback function to handle messages received for a specific channel.
Definition psi5.h:163
psi5_send_t send
@driver_ops_optional Transmitting PSI5 data on a specific channel.
Definition psi5.h:161
psi5_start_sync_t start_sync
@driver_ops_optional Start the sync pulse generator on a specific channel.
Definition psi5.h:157
psi5_stop_sync_t stop_sync
@driver_ops_optional Stop the sync pulse generator on a specific channel.
Definition psi5.h:159
PSI5 frame structure.
Definition psi5.h:46
uint32_t data
Message data.
Definition psi5.h:53
uint32_t timestamp
Timestamp of when the frame was captured.
Definition psi5.h:67
enum psi5_frame_type type
Type of PSI5 frame.
Definition psi5.h:48
uint8_t crc
CRC checksum for message integrity validation.
Definition psi5.h:69
uint8_t id
Serial message ID.
Definition psi5.h:60
struct psi5_frame::@330022343101134217352251334242327212240102240227::@224173255122331001376324052005211026160064033332 serial
Serial message.
uint8_t slot_number
Slot Number.
Definition psi5.h:71
Configuration structure for RX callback.
Definition psi5.h:124
uint32_t max_num_frame
Maximum number of frames to store.
Definition psi5.h:130
struct psi5_frame * frame
Pointer to the buffer for storing received frames.
Definition psi5.h:128
void * user_data
Pointer to user data passed to the callback.
Definition psi5.h:132
psi5_rx_frame_callback_t callback
Callback function invoked on frame reception.
Definition psi5.h:126
Composite configuration structure for RX callback registration.
Definition psi5.h:138
struct psi5_rx_callback_config * serial_frame
Configuration for the serial message callback.
Definition psi5.h:140
struct psi5_rx_callback_config * data_frame
Configuration for the data message callback.
Definition psi5.h:142