Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Interfaces for Peripheral Sensor Interface (PSI5). More...

Data Structures

struct  psi5_frame
 PSI5 frame structure. More...
struct  psi5_rx_callback_config
 Configuration structure for RX callback. More...
struct  psi5_rx_callback_configs
 Composite configuration structure for RX callback registration. More...
struct  psi5_driver_api
 @driver_ops{PSI5} More...

Typedefs

typedef 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.
typedef 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.

Enumerations

enum  psi5_frame_type { PSI5_SERIAL_FRAME_4_BIT_ID , PSI5_SERIAL_FRAME_8_BIT_ID , PSI5_DATA_FRAME }
 PSI5 frame type. More...

Functions

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_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_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.
typedef int(* psi5_start_sync_t) (const struct device *dev, uint8_t channel)
 @def_driverbackendgroup{PSI5,psi5_interface}
typedef 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.
typedef 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.
typedef 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.

Detailed Description

Interfaces for Peripheral Sensor Interface (PSI5).

Since
4.2
Version
0.1.0

Typedef Documentation

◆ psi5_register_callback_t

typedef int(* psi5_register_callback_t) (const struct device *dev, uint8_t channel, struct psi5_rx_callback_configs callback_configs)

#include <psi5.h>

Callback API upon adding RX callback See psi5_register_callback() for argument description.

◆ psi5_rx_frame_callback_t

typedef void(* psi5_rx_frame_callback_t) (const struct device *dev, uint8_t channel, uint32_t num_frame, void *user_data)

#include <psi5.h>

Defines the application callback handler function signature for receiving frame.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
num_frameNumber of received frame.
user_dataUser data provided when receiving frame.

◆ psi5_send_t

typedef 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)

#include <psi5.h>

Callback API upon sending PSI5 frame See psi5_send() for argument description.

◆ psi5_start_sync_t

typedef int(* psi5_start_sync_t) (const struct device *dev, uint8_t channel)

#include <psi5.h>

@def_driverbackendgroup{PSI5,psi5_interface}

Callback API upon starting sync PSI5 See psi5_start_sync() for argument description

◆ psi5_stop_sync_t

typedef int(* psi5_stop_sync_t) (const struct device *dev, uint8_t channel)

#include <psi5.h>

Callback API upon stopping sync PSI5 See psi5_stop_sync() for argument description.

◆ psi5_tx_callback_t

typedef void(* psi5_tx_callback_t) (const struct device *dev, uint8_t channel, int status, void *user_data)

#include <psi5.h>

Defines the application callback handler function signature for sending.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
statusPSI5 status (0: transmission completed successfully, -EIO: transmission error occurred).
user_dataUser data provided when the frame was sent.

Enumeration Type Documentation

◆ psi5_frame_type

#include <psi5.h>

PSI5 frame type.

Enumerator
PSI5_SERIAL_FRAME_4_BIT_ID 

Serial message frame with 4-bit message ID.

PSI5_SERIAL_FRAME_8_BIT_ID 

Serial message frame with 8-bit message ID.

PSI5_DATA_FRAME 

Data frame.

Function Documentation

◆ psi5_register_callback()

int psi5_register_callback ( const struct device * dev,
uint8_t channel,
struct psi5_rx_callback_configs callback_configs )

#include <psi5.h>

Add a callback function to handle messages received for a specific channel.

The callback must be registered before the sync pulse generator started when the channel is configured to synchronous mode.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
callback_configsThe callback configurations.
Return values
0successful.
-EINVALinvalid channel.

◆ psi5_send()

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 )

#include <psi5.h>

Transmitting PSI5 data on a specific channel.

The channel must be configured to synchronous mode and can only begin transmission after the sync pulse generator has started.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
dataPSI5 data to transmit.
timeoutTimeout waiting for ready to transmit new data.
callbackOptional callback for when the frame was sent or a transmission error occurred. If NULL, this function is blocking until frame is sent.
user_dataUser data to pass to callback function.
Return values
0successful.
-EINVALinvalid channel.
-ENOTSUPunsupported parameter was passed to the function.
-ENETDOWNstopped state.
-EIOgeneral transmit error occurred.
-EAGAINtimeout.

◆ psi5_start_sync()

int psi5_start_sync ( const struct device * dev,
uint8_t channel )

#include <psi5.h>

Start the sync pulse generator on a specific channel.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
Return values
0successful.
-EINVALinvalid channel.
-EALREADYdevice is already started.
-EIOgeneral input/output error, failed to start device.

◆ psi5_stop_sync()

int psi5_stop_sync ( const struct device * dev,
uint8_t channel )

#include <psi5.h>

Stop the sync pulse generator on a specific channel.

Parameters
devPointer to the device structure for the driver instance.
channelThe hardware channel of the driver instance.
Return values
0successful.
-EINVALinvalid channel.
-EALREADYdevice is already started.
-EIOgeneral input/output error, failed to stop device.