RA Flexible Software Package Documentation  Release v5.2.0

 
DA16XXX Transport Layer (rm_at_transport_da16xxx_uart)

Functions

void rm_at_transport_da16xxx_uart_callback (uart_callback_args_t *p_args)
 
fsp_err_t rm_at_transport_da16xxx_uartOpen (at_transport_da16xxx_ctrl_t *const p_ctrl, at_transport_da16xxx_cfg_t const *const p_cfg)
 
fsp_err_t rm_at_transport_da16xxx_uart_atCommandSendThreadSafe (at_transport_da16xxx_ctrl_t *const p_ctrl, at_transport_da16xxx_data_t *p_at_cmd)
 
fsp_err_t rm_at_transport_da16xxx_uart_atCommandSend (at_transport_da16xxx_ctrl_t *const p_ctrl, at_transport_da16xxx_data_t *p_at_cmd)
 
fsp_err_t rm_at_transport_da16xxx_uart_giveMutex (at_transport_da16xxx_ctrl_t *const p_ctrl, uint32_t mutex_flag)
 
fsp_err_t rm_at_transport_da16xxx_uart_takeMutex (at_transport_da16xxx_ctrl_t *const p_ctrl, uint32_t mutex_flag)
 
size_t rm_at_transport_da16xxx_uart_bufferRecv (at_transport_da16xxx_ctrl_t *const p_ctrl, const char *p_data, uint32_t length, uint32_t rx_timeout)
 
fsp_err_t rm_at_transport_da16xxx_statusGet (at_transport_da16xxx_ctrl_t *const p_ctrl, at_transport_da16xxx_status_t *p_status)
 
fsp_err_t rm_at_transport_da16xxx_uartClose (at_transport_da16xxx_ctrl_t *const p_ctrl)
 

Detailed Description

Transport layer implementation for linking DA16XXX Drivers with Communications layer.

Overview

This Transport Layer provides an abstraction interface between the DA16XXX driver and communications layers. Currently, the module supports only UART, but will support SPI in future.

Refer to WiFi Onchip DA16XXX Framework Driver (rm_wifi_da16xxx).

Features

Refer to WiFi Onchip DA16XXX Framework Driver (rm_wifi_da16xxx).

Configuration

Build Time Configurations for rm_at_transport_da16xxx_uart

The following build time configurations are defined in fsp_cfg/rm_at_transport_da16xxx_uart_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Size of RX buffer for CMD PortManual Entry3000
Semaphore maximum timeoutManual Entry10000
Number of retries for AT commandsManual Entry10
Module Reset PortRefer to the RA Configuration tool for available options.06 Specify the module reset pin port for the MCU.
Module Reset PinRefer to the RA Configuration tool for available options.03 Specify the module reset pin for the MCU.

Refer to WiFi Onchip DA16XXX Framework Driver (rm_wifi_da16xxx).

Interrupt Configuration

Refer to UART (r_sci_uart).

Clock Configuration

Refer to UART (r_sci_uart).

Pin Configuration

Refer to UART (r_sci_uart).

Usage Notes

Limitations

Refer to WiFi Onchip DA16XXX Framework Driver (rm_wifi_da16xxx).

Data Structures

struct  at_transport_da16xxx_extended_cfg_t
 
struct  at_transport_da16xxx_instance_ctrl_t
 

Data Structure Documentation

◆ at_transport_da16xxx_extended_cfg_t

struct at_transport_da16xxx_extended_cfg_t

User configuration structure, used in open function

Data Fields
const uint32_t num_uarts Number of UART interfaces to use.
const uart_instance_t * uart_instances[AT_TRANSPORT_DA16XXX_CFG_MAX_NUMBER_UART_PORTS] SCI UART instances.
const bsp_io_port_pin_t reset_pin Reset pin used for module.

◆ at_transport_da16xxx_instance_ctrl_t

struct at_transport_da16xxx_instance_ctrl_t

AT_TRANSPORT_DA16XXX private control block. DO NOT MODIFY.

Data Fields

at_transport_da16xxx_cfg_t const * p_cfg
 Pointer to initial configurations.
 
uint32_t num_uarts
 number of UARTS currently used for communication with module
 
uint32_t curr_cmd_port
 Current UART instance index for AT commands.
 
uint32_t open
 Flag to indicate if transport instance has been initialized.
 
uint8_t cmd_rx_queue_buf [AT_TRANSPORT_DA16XXX_CFG_CMD_RX_BUF_SIZE]
 Command port receive buffer used by byte queue // FreeRTOS.
 
StreamBufferHandle_t socket_byteq_hdl
 Socket stream buffer handle.
 
StaticStreamBuffer_t socket_byteq_struct
 Structure to hold stream buffer info.
 
SemaphoreHandle_t tx_sem
 Transmit binary semaphore handle.
 
SemaphoreHandle_t rx_sem
 Receive binary semaphore handle.
 
uart_instance_tuart_instance_objects [AT_TRANSPORT_DA16XXX_CFG_MAX_NUMBER_UART_PORTS]
 UART instance object.
 
SemaphoreHandle_t uart_tei_sem [AT_TRANSPORT_DA16XXX_CFG_MAX_NUMBER_UART_PORTS]
 UART transmission end binary semaphore.
 
const bsp_io_port_pin_t reset_pin
 Reset pin used for module.
 
bool(* p_callback )(at_transport_da16xxx_callback_args_t *p_args)
 Pointer to callback function.
 
void const * p_context
 Pointer to the user-provided context.
 

Function Documentation

◆ rm_at_transport_da16xxx_uart_callback()

void rm_at_transport_da16xxx_uart_callback ( uart_callback_args_t p_args)

UART Callback routine.

Parameters
[in]p_argsPointer to uart callback structure.

◆ rm_at_transport_da16xxx_uartOpen()

fsp_err_t rm_at_transport_da16xxx_uartOpen ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
at_transport_da16xxx_cfg_t const *const  p_cfg 
)

Opens and configures the WIFI_DA16XXX Middleware module.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]p_cfgPointer to pin configuration structure.
Return values
FSP_SUCCESSWIFI_DA16XXX successfully configured.
FSP_ERR_ASSERTIONThe parameter p_cfg or p_instance_ctrl is NULL.
FSP_ERR_OUT_OF_MEMORYThere is no more heap memory available.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ALREADY_OPENModule is already open. This module can only be opened once.
FSP_ERR_WIFI_INIT_FAILEDWiFi module initialization failed.

◆ rm_at_transport_da16xxx_uart_atCommandSendThreadSafe()

fsp_err_t rm_at_transport_da16xxx_uart_atCommandSendThreadSafe ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
at_transport_da16xxx_data_t p_at_cmd 
)

Send an AT command with testing for return response.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]p_at_cmdPointer to AT command data structure.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.

◆ rm_at_transport_da16xxx_uart_atCommandSend()

fsp_err_t rm_at_transport_da16xxx_uart_atCommandSend ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
at_transport_da16xxx_data_t p_at_cmd 
)

Send and receive an AT command with testing for return. Thread-Safe

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]p_at_cmdPointer to Transport layer instance data structure.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONAssertion error occurred.

◆ rm_at_transport_da16xxx_uart_giveMutex()

fsp_err_t rm_at_transport_da16xxx_uart_giveMutex ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
uint32_t  mutex_flag 
)

Give the mutex for the send basic call.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]mutex_flagFlags for the mutex.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred giving the mutex.

◆ rm_at_transport_da16xxx_uart_takeMutex()

fsp_err_t rm_at_transport_da16xxx_uart_takeMutex ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
uint32_t  mutex_flag 
)

Take the mutex for the send basic call.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]mutex_flagFlags for the mutex.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred taking the mutex.

◆ rm_at_transport_da16xxx_uart_bufferRecv()

size_t rm_at_transport_da16xxx_uart_bufferRecv ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
const char *  p_data,
uint32_t  length,
uint32_t  rx_timeout 
)

Receive data from stream buffer.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
[in]p_dataPointer to data.
[in]lengthData length.
[in]rx_timeoutTimeout for receiving data on the buffer.
Return values
Numberof bytes pulled from Streambuffer
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONAssertion error occurred.
FSP_ERR_INVALID_DATAAccuracy of data is not guaranteed

◆ rm_at_transport_da16xxx_statusGet()

fsp_err_t rm_at_transport_da16xxx_statusGet ( at_transport_da16xxx_ctrl_t *const  p_ctrl,
at_transport_da16xxx_status_t p_status 
)

Gets the status of the configured DA16xxx transport.

Return values
FSP_SUCCESSStatus stored in p_status.
FSP_ERR_ASSERTIONNULL pointer.

◆ rm_at_transport_da16xxx_uartClose()

fsp_err_t rm_at_transport_da16xxx_uartClose ( at_transport_da16xxx_ctrl_t *const  p_ctrl)

Closes the AT Transport DA16XXX Middleware module.

Parameters
[in]p_ctrlPointer to Transport layer instance control structure.
Return values
FSP_SUCCESSWIFI_DA16XXX successfully configured.
FSP_ERR_ASSERTIONThe parameter p_cfg or p_instance_ctrl is NULL.
FSP_ERR_NOT_OPENThe Transport layer instance is not open.