Transport layer initialization.
More...
Transport layer initialization.
|
typedef struct ErpcTransport * | erpc_transport_t |
| Opaque transport object type.
|
|
typedef void(* | rpmsg_ready_cb) (void) |
| Ready callback object type for RPMsg-Lite transport.
|
|
|
erpc_transport_t | erpc_transport_rpmsg_lite_master_init (uint32_t src_addr, uint32_t dst_addr, uint32_t rpmsg_link_id) |
| Create an RPMsg-Lite transport. More...
|
|
void | erpc_transport_rpmsg_lite_master_deinit (erpc_transport_t transport) |
| Deinitialize RPMsg-Lite transport. More...
|
|
erpc_transport_t | erpc_transport_rpmsg_lite_remote_init (uint32_t src_addr, uint32_t dst_addr, void *start_address, uint32_t rpmsg_link_id, rpmsg_ready_cb ready, char *nameservice_name) |
| Create an RPMsg-Lite transport. More...
|
|
void | erpc_transport_rpmsg_lite_remote_deinit (erpc_transport_t transport) |
| Deinitialize RPMsg-Lite transport. More...
|
|
erpc_transport_t | erpc_transport_rpmsg_lite_rtos_master_init (uint32_t src_addr, uint32_t dst_addr, uint32_t rpmsg_link_id) |
| Create an RPMsg-Lite RTOS transport. More...
|
|
void | erpc_transport_rpmsg_lite_rtos_master_deinit (erpc_transport_t transport) |
| Deinitialize RPMsg-Lite RTOS transport. More...
|
|
erpc_transport_t | erpc_transport_rpmsg_lite_rtos_remote_init (uint32_t src_addr, uint32_t dst_addr, void *start_address, uint32_t rpmsg_link_id, rpmsg_ready_cb ready, char *nameservice_name) |
| Create an RPMsg-Lite RTOS transport. More...
|
|
void | erpc_transport_rpmsg_lite_rtos_remote_deinit (erpc_transport_t transport) |
| Deinitialize RPMsg-Lite RTOS transport. More...
|
|
erpc_transport_t | erpc_transport_rpmsg_lite_tty_rtos_remote_init (uint32_t src_addr, uint32_t dst_addr, void *start_address, uint32_t rpmsg_link_id, rpmsg_ready_cb ready, char *nameservice_name) |
| Create an RPMsg-Lite TTY transport. More...
|
|
void | erpc_transport_rpmsg_lite_tty_rtos_remote_deinit (erpc_transport_t transport) |
| Deinitialize an RPMSG lite tty rtos transport. More...
|
|
erpc_transport_t erpc_transport_dspi_master_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create a DSPI master transport.
Create DSPI master transport instance, to be used at master core.
- Parameters
-
[in] | baseAddr | Base address of DSPI peripheral used in this transport layer. |
[in] | baudRate | DSPI baud rate. |
[in] | srcClock_Hz | DSPI source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize DSPI master transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_dspi_slave_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create a DSPI slave transport.
Create DSPI slave transport instance, to be used at slave core.
- Parameters
-
[in] | baseAddr | Base address of DSPI peripheral used in this transport layer. |
[in] | baudRate | DSPI baud rate. |
[in] | srcClock_Hz | DSPI source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize DSPI slave transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_i2c_slave_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create an I2C slave transport.
Create I2C slave transport instance, to be used at slave core.
- Parameters
-
[in] | baseAddr | Base address of I2C peripheral used in this transport layer. |
[in] | baudRate | SPI baud rate. |
[in] | srcClock_Hz | I2C source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize I2C slave transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_lpi2c_slave_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create an LPI2C slave transport.
Create LPI2C slave transport instance, to be used at slave core.
- Parameters
-
[in] | baseAddr | Base address of LPI2C peripheral used in this transport layer. |
[in] | baudRate | SPI baud rate. |
[in] | srcClock_Hz | LPI2C source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize LPI2C slave transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_lpspi_slave_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create a LPSPI slave transport.
Create LPSPI slave transport instance, to be used at slave core.
- Parameters
-
[in] | baseAddr | Base address of LPSPI peripheral used in this transport layer. |
[in] | baudRate | LPSPI baud rate. |
[in] | srcClock_Hz | LPSPI source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize LPSPI slave transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
Create an MU transport.
Create Messaging Unit (MU) transport instance, to be used on both the server and the client side. Base address of the MU peripheral needs to be passed.
- Parameters
-
[in] | baseAddr | Base address of MU peripheral. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize MU transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_rpmsg_linux_init |
( |
int16_t |
local_addr, |
|
|
int8_t |
type, |
|
|
int16_t |
remote_addr |
|
) |
| |
Create an Linux RPMSG endpoint transport.
This function is using RPMSG endpoints based on this implementation: github.com/nxp-mcuxpresso/rpmsg-sysfs/tree/0aa1817545a765c200b1b2f9b6680a420dcf9171 .
When local/remote address is set to '-1', then default addresses will be used. When type is set to '0', then Datagram model will be used, else Stream.
- Parameters
-
[in] | local_addr | Local endpoint address. |
[in] | type | Datagram (0) or Stream (1). |
[in] | remote_addr | Remote endpoint address. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize an Linux RPMSG endpoint transport.
This function deinitialize the Linux RPMSG endpoint transport.
- Parameters
-
[in] | transport | Transport which was returned from init function. |
erpc_transport_t erpc_transport_rpmsg_lite_master_init |
( |
uint32_t |
src_addr, |
|
|
uint32_t |
dst_addr, |
|
|
uint32_t |
rpmsg_link_id |
|
) |
| |
Create an RPMsg-Lite transport.
Create RPMsg-Lite baremetal transport instance, to be used at master core.
- Parameters
-
[in] | src_addr | Address of local RPMsg endpoint used for communication. |
[in] | dst_addr | Address of remote RPMsg endpoint used for communication. |
[in] | rpmsg_link_id | Link ID used to define the rpmsg-lite instance, see rpmsg_platform.h |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize RPMsg-Lite transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_rpmsg_lite_remote_init |
( |
uint32_t |
src_addr, |
|
|
uint32_t |
dst_addr, |
|
|
void * |
start_address, |
|
|
uint32_t |
rpmsg_link_id, |
|
|
rpmsg_ready_cb |
ready, |
|
|
char * |
nameservice_name |
|
) |
| |
Create an RPMsg-Lite transport.
Create RPMsg-Lite baremetal transport instance, to be used at slave/remote core.
- Parameters
-
[in] | src_addr | Address of local RPMsg endpoint used for communication. |
[in] | dst_addr | Address of remote RPMsg endpoint used for communication. |
[in] | start_address | Shared memory base address used for this instance of RPMsg-Lite. |
[in] | rpmsg_link_id | Link ID used to define the rpmsg-lite instance, see rpmsg_platform.h. |
[in] | ready | Callback function, which gets called, when RPMsg is initialized and master core can be notified. |
[in] | nameservice_name | Name of the nameservice channel to be announced to the other core. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize RPMsg-Lite transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_rpmsg_lite_rtos_master_init |
( |
uint32_t |
src_addr, |
|
|
uint32_t |
dst_addr, |
|
|
uint32_t |
rpmsg_link_id |
|
) |
| |
Create an RPMsg-Lite RTOS transport.
Create RPMsg-Lite RTOS transport instance, to be used at master core.
- Parameters
-
[in] | src_addr | Address of local RPMsg endpoint used for communication. |
[in] | dst_addr | Address of remote RPMsg endpoint used for communication. |
[in] | rpmsg_link_id | Link ID used to define the rpmsg-lite instance, see rpmsg_platform.h |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize RPMsg-Lite RTOS transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_rpmsg_lite_rtos_remote_init |
( |
uint32_t |
src_addr, |
|
|
uint32_t |
dst_addr, |
|
|
void * |
start_address, |
|
|
uint32_t |
rpmsg_link_id, |
|
|
rpmsg_ready_cb |
ready, |
|
|
char * |
nameservice_name |
|
) |
| |
Create an RPMsg-Lite RTOS transport.
Create RPMsg-Lite RTOS transport instance, to be used at slave/remote core.
- Parameters
-
[in] | src_addr | Address of local RPMsg endpoint used for communication. |
[in] | dst_addr | Address of remote RPMsg endpoint used for communication. |
[in] | start_address | Shared memory base address used for this instance of RPMsg-Lite. |
[in] | rpmsg_link_id | Link ID used to define the rpmsg-lite instance, see rpmsg_platform.h. |
[in] | ready | Callback function, which gets called, when RPMsg is initialized and master core can be notified. |
[in] | nameservice_name | Name of the nameservice channel to be announced to the other core. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize RPMsg-Lite RTOS transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_rpmsg_lite_tty_rtos_remote_init |
( |
uint32_t |
src_addr, |
|
|
uint32_t |
dst_addr, |
|
|
void * |
start_address, |
|
|
uint32_t |
rpmsg_link_id, |
|
|
rpmsg_ready_cb |
ready, |
|
|
char * |
nameservice_name |
|
) |
| |
Create an RPMsg-Lite TTY transport.
Create RPMsg-Lite TTY transport instance, to be used at slave/remote core. This function is mainly used with Linux running on the master core.
- Parameters
-
[in] | src_addr | Address of local RPMsg endpoint used for communication. |
[in] | dst_addr | Address of remote RPMsg endpoint used for communication. |
[in] | start_address | Shared memory base address used for this instance of RPMsg-Lite. |
[in] | rpmsg_link_id | Link ID used to define the rpmsg-lite instance, see rpmsg_platform.h. |
[in] | ready | Callback function, which gets called, when RPMsg is initialized and master core can be notified. |
[in] | nameservice_name | Name of the nameservice channel to be announced to the other core. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
void erpc_transport_rpmsg_lite_tty_rtos_remote_deinit |
( |
erpc_transport_t |
transport | ) |
|
Deinitialize an RPMSG lite tty rtos transport.
This function deinitialize the RPMSG lite tty rtos transport.
- Parameters
-
[in] | transport | Transport which was returned from init function. |
erpc_transport_t erpc_transport_serial_init |
( |
const char * |
portName, |
|
|
long |
baudRate |
|
) |
| |
Create a host PC serial port transport.
Create a host PC serial port transport instance.
- Parameters
-
[in] | portName | Port name. |
[in] | baudRate | Baud rate. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize a host PC serial port transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_spi_master_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create a SPI master transport.
Create SPI master transport instance, to be used at master core.
- Parameters
-
[in] | baseAddr | Base address of SPI peripheral used in this transport layer. |
[in] | baudRate | SPI baud rate. |
[in] | srcClock_Hz | SPI source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize SPI master transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_spi_slave_init |
( |
void * |
baseAddr, |
|
|
uint32_t |
baudRate, |
|
|
uint32_t |
srcClock_Hz |
|
) |
| |
Create a SPI slave transport.
Create SPI slave transport instance, to be used at slave core.
- Parameters
-
[in] | baseAddr | Base address of SPI peripheral used in this transport layer. |
[in] | baudRate | SPI baud rate. |
[in] | srcClock_Hz | SPI source clock in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize SPI slave transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_spidev_master_init |
( |
const char * |
spidev, |
|
|
uint32_t |
speed_Hz |
|
) |
| |
Create a SPIdev transport.
Create SPIdev master transport instance, to be used at master core.
- Parameters
-
[in] | spidev | SPI device name. |
[in] | speed_Hz | SPI clock speed in Hz. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize SPIdev transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
erpc_transport_t erpc_transport_tcp_init |
( |
const char * |
host, |
|
|
uint16_t |
port, |
|
|
bool |
isServer |
|
) |
| |
Create and open TCP transport.
For server, create a TCP listen socket and wait for connections For client, connect to server
- Parameters
-
[in] | host | hostname/IP address to listen on or server to connect to |
[in] | port | port to listen on or server to connect to |
[in] | isServer | true if we are a server |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Close TCP connection.
For server, stop listening and close all sockets. Note that the server mode uses and accept() which is a not-recommended blocking method so we can't exit until a connection attempts is made. This is a deadlock but assuming that TCP code is supposed to be for test, I assume it's acceptable. Otherwise a non-blocking socket or select() shoudl be used For client, close server connection
- Parameters
-
[in] | transport | Transport which was returned from init function. |
Deinitialize TCP transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
Create a CMSIS UART transport.
Create a CMSIS UART transport instance, to be used on both the server and the client side.
- Parameters
-
[in] | uartDrv | CMSIS USART driver structure address (Driver Control Block). |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize CMSIS UART transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |
Create a Zephyr UART transport.
Create a Zephyr UART transport instance, to be used on both the server and the client side.
- Parameters
-
[in] | dev | Zephyr UART device address. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
erpc_transport_t erpc_transport_usb_cdc_init |
( |
void * |
serialHandle, |
|
|
void * |
serialConfig, |
|
|
void * |
usbCdcConfig, |
|
|
uint8_t * |
usbRingBuffer, |
|
|
uint32_t |
usbRingBufferLength |
|
) |
| |
Create an USB CDC transport.
Create an USB CDC transport instance.
- Parameters
-
[in] | serialHandle | Pointer to point to a memory space of size #SERIAL_MANAGER_HANDLE_SIZE allocated by the caller, see serial manager header file. |
[in] | serialConfig | Pointer to user-defined configuration structure allocated by the caller, see serial manager header file. |
[in] | usbCdcConfig | Pointer to serial port usb config structure allocated by the caller, see serial manager header file. |
[in] | usbRingBuffer | Pointer to point serial manager ring buffer allocated by the caller, see serial manager header file. |
[in] | usbRingBufferLength | Serial manager ring buffer size. |
- Returns
- Return NULL or erpc_transport_t instance pointer.
Deinitialize USB CDC transport.
- Parameters
-
[in] | transport | Transport which was initialized with init function. |