![]() |
RZA Flexible Software Package Documentation
Release v1.1.0
|
|
Functions | |
fsp_err_t | R_SCIF_UART_Open (uart_ctrl_t *const p_api_ctrl, uart_cfg_t const *const p_cfg) |
fsp_err_t | R_SCIF_UART_Read (uart_ctrl_t *const p_api_ctrl, uint8_t *const p_dest, uint32_t const bytes) |
fsp_err_t | R_SCIF_UART_Write (uart_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const bytes) |
fsp_err_t | R_SCIF_UART_BaudSet (uart_ctrl_t *const p_api_ctrl, void const *const p_baud_setting) |
fsp_err_t | R_SCIF_UART_InfoGet (uart_ctrl_t *const p_api_ctrl, uart_info_t *const p_info) |
fsp_err_t | R_SCIF_UART_Close (uart_ctrl_t *const p_api_ctrl) |
fsp_err_t | R_SCIF_UART_Abort (uart_ctrl_t *const p_api_ctrl, uart_dir_t communication_to_abort) |
fsp_err_t | R_SCIF_UART_BaudCalculate (uart_ctrl_t *const p_api_ctrl, uint32_t baudrate, bool bitrate_modulation, uint32_t baud_rate_error_x_1000, scif_baud_setting_t *const p_baud_setting) |
fsp_err_t | R_SCIF_UART_ReadStop (uart_ctrl_t *const p_api_ctrl, uint32_t *remaining_bytes) |
fsp_err_t | R_SCIF_UART_CallbackSet (uart_ctrl_t *const p_api_ctrl, void(*p_callback)(uart_callback_args_t *), void const *const p_context, uart_callback_args_t *const p_callback_memory) |
Driver for the SCIF peripheral on RZ MPUs. This module implements the UART Interface.
Data Structures | |
struct | scif_uart_instance_ctrl_t |
struct | scif_baud_setting_t |
struct | scif_uart_extended_cfg_t |
Enumerations | |
enum | scif_clk_src_t |
enum | scif_uart_flow_control_t |
enum | scif_uart_noise_cancellation_t |
enum | scif_uart_receive_trigger_t |
enum | scif_uart_rts_trigger_t |
struct scif_uart_instance_ctrl_t |
UART instance control block.
struct scif_baud_setting_t |
Register settings to achieve a desired baud rate and modulation duty.
Data Fields | ||
---|---|---|
struct scif_baud_setting_t | __unnamed__ | |
uint8_t | brr | Bit Rate Register setting. |
uint8_t | mddr | Modulation Duty Register setting. |
struct scif_uart_extended_cfg_t |
UART on SCIF device Configuration
Data Fields | ||
---|---|---|
uint8_t | bri_ipl | Break interrupt priority. |
IRQn_Type | bri_irq | Break interrupt IRQ number. |
scif_clk_src_t | clock | The source clock for the baud-rate generator. |
scif_uart_noise_cancellation_t | noise_cancel | Noise cancellation setting. |
scif_baud_setting_t * | p_baud_setting | Register settings for a desired baud rate. |
scif_uart_receive_trigger_t | rx_fifo_trigger | Receive FIFO trigger level. |
scif_uart_rts_trigger_t | rts_fifo_trigger | RTS trigger level. |
scif_uart_flow_control_t | flow_control | CTS/RTS function. |
enum scif_clk_src_t |
Enumeration for SCIF clock source
Receive FIFO trigger configuration.
RTS trigger level.
fsp_err_t R_SCIF_UART_Open | ( | uart_ctrl_t *const | p_api_ctrl, |
uart_cfg_t const *const | p_cfg | ||
) |
Configures the UART driver based on the input configurations. If reception is enabled at compile time, reception is enabled at the end of this function. Implements uart_api_t::open
FSP_SUCCESS | Channel opened successfully. |
FSP_ERR_ASSERTION | Pointer to UART control block or configuration structure is NULL. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | The requested channel does not exist on this MPU. |
FSP_ERR_ALREADY_OPEN | Control block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure. |
fsp_err_t R_SCIF_UART_Read | ( | uart_ctrl_t *const | p_api_ctrl, |
uint8_t *const | p_dest, | ||
uint32_t const | bytes | ||
) |
Receives user specified number of bytes into destination buffer pointer. Implements uart_api_t::read
FSP_SUCCESS | Data reception successfully ends. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. Number of transfers outside the max or min boundary when transfer instance used |
FSP_ERR_NOT_OPEN | The control block has not been opened |
FSP_ERR_IN_USE | A previous read operation is still in progress. |
FSP_ERR_UNSUPPORTED | SCIF_UART_CFG_RX_ENABLE is set to 0 |
fsp_err_t R_SCIF_UART_Write | ( | uart_ctrl_t *const | p_api_ctrl, |
uint8_t const *const | p_src, | ||
uint32_t const | bytes | ||
) |
Transmits user specified number of bytes from the source buffer pointer. Implements uart_api_t::write
FSP_SUCCESS | Data transmission finished successfully. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. Number of transfers outside the max or min boundary when transfer instance used |
FSP_ERR_NOT_OPEN | The control block has not been opened |
FSP_ERR_IN_USE | A UART transmission is in progress |
FSP_ERR_UNSUPPORTED | SCIF_UART_CFG_TX_ENABLE is set to 0 |
fsp_err_t R_SCIF_UART_BaudSet | ( | uart_ctrl_t *const | p_api_ctrl, |
void const *const | p_baud_setting | ||
) |
Updates the baud rate using the clock selected in Open. p_baud_setting is a pointer to a scif_baud_setting_t structure. Implements uart_api_t::baudSet
FSP_SUCCESS | Baud rate was successfully changed. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL or the UART is not configured to use the internal clock. |
FSP_ERR_NOT_OPEN | The control block has not been opened |
fsp_err_t R_SCIF_UART_InfoGet | ( | uart_ctrl_t *const | p_api_ctrl, |
uart_info_t *const | p_info | ||
) |
Provides the driver information, including the maximum number of bytes that can be received or transmitted at a time. Implements uart_api_t::infoGet
FSP_SUCCESS | Information stored in provided p_info. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened |
fsp_err_t R_SCIF_UART_Close | ( | uart_ctrl_t *const | p_api_ctrl | ) |
Aborts any in progress transfers. Disables interrupts, receiver, and transmitter. Closes lower level transfer drivers if used. Removes power. Implements uart_api_t::close
FSP_SUCCESS | Channel successfully closed. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened |
fsp_err_t R_SCIF_UART_Abort | ( | uart_ctrl_t *const | p_api_ctrl, |
uart_dir_t | communication_to_abort | ||
) |
Provides API to abort ongoing transfer. Transmission is aborted after the current character is transmitted. Reception is still enabled after abort(). Any characters received after abort() and before the transfer is reset in the next call to read(), will arrive via the callback function with event UART_EVENT_RX_CHAR. Implements uart_api_t::communicationAbort
FSP_SUCCESS | UART transaction aborted successfully. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_UNSUPPORTED | The requested Abort direction is unsupported. |
fsp_err_t R_SCIF_UART_BaudCalculate | ( | uart_ctrl_t *const | p_api_ctrl, |
uint32_t | baudrate, | ||
bool | bitrate_modulation, | ||
uint32_t | baud_rate_error_x_1000, | ||
scif_baud_setting_t *const | p_baud_setting | ||
) |
Calculates baud rate register settings. Evaluates and determines the best possible settings set to the baud rate related registers.
[in] | p_api_ctrl | Pointer to the UART control block. |
[in] | baudrate | Baud rate [bps]. For example, 19200, 57600, 115200, etc. |
[in] | bitrate_modulation | Enable bitrate modulation |
[in] | baud_rate_error_x_1000 | <baud_rate_percent_error> x 1000 required for module to function. Absolute max baud_rate_error is 15000 (15%). |
[out] | p_baud_setting | Baud setting information stored here if successful |
FSP_SUCCESS | Baud rate is set successfully |
FSP_ERR_ASSERTION | Null pointer |
FSP_ERR_INVALID_ARGUMENT | Baud rate is '0', source clock frequency could not be read, or error in calculated baud rate is larger than 10%. |
fsp_err_t R_SCIF_UART_ReadStop | ( | uart_ctrl_t *const | p_api_ctrl, |
uint32_t * | remaining_bytes | ||
) |
Provides API to abort ongoing read. Reception is still enabled after abort(). Any characters received after abort() and before the transfer is reset in the next call to read(), will arrive via the callback function with event UART_EVENT_RX_CHAR. Implements uart_api_t::readStop
FSP_SUCCESS | UART transaction aborted successfully. |
FSP_ERR_ASSERTION | Pointer to UART control block is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_UNSUPPORTED | The requested Abort direction is unsupported. |
fsp_err_t R_SCIF_UART_CallbackSet | ( | uart_ctrl_t *const | p_api_ctrl, |
void(*)(uart_callback_args_t *) | p_callback, | ||
void const *const | p_context, | ||
uart_callback_args_t *const | p_callback_memory | ||
) |
Updates the user callback and has option of providing memory for callback structure. Implements uart_api_t::callbackSet
FSP_SUCCESS | Callback updated successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_NO_CALLBACK_MEMORY | p_callback is non-secure and p_callback_memory is either secure or NULL. |