Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Various types used by the cascoda posix api. More...
#include <pthread.h>
#include <stdint.h>
#include <unistd.h>
#include "ca821x-posix/ca821x-posix-config.h"
#include "ca821x-posix/ca821x-posix-evbme.h"
#include "ca821x_api.h"
#include "ca821x_error.h"
Go to the source code of this file.
Classes | |
union | ca821x_util_init_extra_arg |
Extra argument to the function ca821x_util_init(). More... | |
struct | buffer_queue_item |
Single item in a singly-linked list of data buffers. More... | |
struct | buffer_queue |
Queue struct for singly-linked list of buffer_queue_items. More... | |
struct | ca821x_exchange_base |
Base structure for exchange private data collections. More... | |
struct | ca_device_info |
Struct for getting info of connected devices (primarily for enumerating them) More... | |
Typedefs | |
typedef ca_error(* | ca821x_errorhandler) (ca_error error, struct ca821x_dev *pDeviceRef) |
Error callback. More... | |
typedef ca_error(* | exchange_user_callback) (const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef) |
Optional Exchange User Callback. More... | |
typedef ca_error(* | exchange_write) (const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef) |
Exchange write function. More... | |
typedef ca_error(* | exchange_write_isready) (struct ca821x_dev *pDeviceRef) |
Exchange write isready function. More... | |
typedef ssize_t(* | exchange_read) (struct ca821x_dev *pDeviceRef, uint8_t *buf) |
Exchange read function. More... | |
typedef void(* | exchange_signal_read) (struct ca821x_dev *pDeviceRef) |
Exchange signalling function to trigger read return. More... | |
typedef void(* | exchange_flush_unread) (struct ca821x_dev *pDeviceRef) |
Exchange signalling function to flush external buffers. More... | |
typedef void(* | util_device_found) (struct ca_device_info *aDeviceInfo, void *aContext) |
Function type for handling enumerated devices when finding them. More... | |
Enumerations | |
enum | ca821x_exchange_type { ca821x_exchange_kernel = 1 , ca821x_exchange_usb , ca821x_exchange_uart } |
Enumeration for identifying the underlying exchange interface type. More... | |
Various types used by the cascoda posix api.
typedef ca_error(* ca821x_errorhandler) (ca_error error, struct ca821x_dev *pDeviceRef) |
Error callback.
Optional callback for the application layer to handle any exchange errors which would otherwise cause a crash.
typedef void(* exchange_flush_unread) (struct ca821x_dev *pDeviceRef) |
Exchange signalling function to flush external buffers.
Function for the exchange to implement. The implementation should clear all external buffers, discarding any messages that were left behind from past executions.
This function will be called when the device is opened.
pDeviceRef | a Pointer to the relevant pDeviceRef struct |
typedef ssize_t(* exchange_read) (struct ca821x_dev *pDeviceRef, uint8_t *buf) |
Exchange read function.
Function for the exchange to implement. The implementation should read from the ca821x and copy the data into buf. This function should block as necessary to reduce CPU load (although returning a length of zero is still functionally correct).
If the function does block, it must be able to be woken by a call to the associated exchange_signal_read implementation.
buf | buffer containing the message read from the ca821x |
pDeviceRef | a Pointer to the relevant pDeviceRef struct |
typedef void(* exchange_signal_read) (struct ca821x_dev *pDeviceRef) |
Exchange signalling function to trigger read return.
Function for the exchange to implement. The implementation should cause the associated exchange_read function to stop blocking and return.
pDeviceRef | a Pointer to the relevant pDeviceRef struct |
typedef ca_error(* exchange_user_callback) (const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef) |
Optional Exchange User Callback.
Optional callback for the application layer to handle any non-ca821x communication with a device over the same protocol. Any command IDs which are not recognised as a valid ca821x SPI command will be passed to this callback.
typedef ca_error(* exchange_write) (const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef) |
Exchange write function.
Function for the exchange to implement. The implementation should send the data in 'buf' to the ca821x.
buf | buffer containing the message to send to the ca821x |
len | length of the buffer data |
pDeviceRef | a Pointer to the relevant pDeviceRef struct |
typedef ca_error(* exchange_write_isready) (struct ca821x_dev *pDeviceRef) |
Exchange write isready function.
Function for the exchange to implement. The implementation should return true (nonzero) if it is ready to send, or 0 if not.
pDeviceRef | a Pointer to the relevant pDeviceRef struct |
CA_ERROR_SUCCESS | The exchange is ready to send a packet |
CA_ERROR_BUSY | The exhange is not ready to send a packet |
typedef void(* util_device_found) (struct ca_device_info *aDeviceInfo, void *aContext) |
Function type for handling enumerated devices when finding them.
aDeviceInfo | The information about the found device |
aContext | Generic context pointer requested when callback was provided |
enum ca821x_exchange_type |