Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Universal Synchronous Asynchronous Receiver

Transmitter (USART).

See Quick start guide for the SAM USART module.

This is a low-level driver implementation for the SAM Universal Synchronous/Asynchronous Receiver/Transmitter.

Data Structures

struct  sam_usart_opt_t
 micro definition for LIN mode of SAMV71 More...
 
struct  usart_iso7816_opt_t
 
struct  usart_spi_opt_t
 

Macros

#define SPI_CPHA   (1 << 0)
 Clock phase. More...
 
#define SPI_CPOL   (1 << 1)
 Clock polarity. More...
 
#define SPI_MODE_0   0
 SPI mode definition. More...
 
#define SPI_MODE_1   (SPI_CPHA)
 
#define SPI_MODE_2   (SPI_CPOL)
 
#define SPI_MODE_3   (SPI_CPOL | SPI_CPHA)
 

Functions

void usart_disable_interrupt (Usart *p_usart, uint32_t ul_sources)
 Disable USART interrupts. More...
 
void usart_disable_rx (Usart *p_usart)
 Disable USART receiver. More...
 
void usart_disable_tx (Usart *p_usart)
 Disable USART transmitter. More...
 
void usart_disable_writeprotect (Usart *p_usart)
 Disable write protect of USART registers. More...
 
void usart_drive_RTS_pin_high (Usart *p_usart)
 Drive the pin RTS to 1. More...
 
void usart_drive_RTS_pin_low (Usart *p_usart)
 Drive the pin RTS to 0. More...
 
void usart_enable_interrupt (Usart *p_usart, uint32_t ul_sources)
 Enable USART interrupts. More...
 
void usart_enable_rx (Usart *p_usart)
 Enable USART receiver. More...
 
void usart_enable_tx (Usart *p_usart)
 Enable USART transmitter. More...
 
void usart_enable_writeprotect (Usart *p_usart)
 Enable write protect of USART registers. More...
 
uint8_t usart_get_error_number (Usart *p_usart)
 Get the total number of errors that occur during an ISO7816 transfer. More...
 
uint32_t usart_get_interrupt_mask (Usart *p_usart)
 Read USART interrupt mask. More...
 
Pdc * usart_get_pdc_base (Usart *p_usart)
 Get USART PDC base address. More...
 
uint32_t usart_get_status (Usart *p_usart)
 Get current status. More...
 
uint32_t usart_get_writeprotect_status (Usart *p_usart)
 Get write protect status. More...
 
uint32_t usart_getchar (Usart *p_usart, uint32_t *c)
 Read from USART Receive Holding Register. More...
 
uint32_t usart_init_hw_handshaking (Usart *p_usart, const sam_usart_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in hardware handshaking mode. More...
 
uint32_t usart_init_irda (Usart *p_usart, const sam_usart_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in IrDA mode. More...
 
uint32_t usart_init_iso7816 (Usart *p_usart, const usart_iso7816_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in ISO7816 mode. More...
 
uint32_t usart_init_rs232 (Usart *p_usart, const sam_usart_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in RS232 mode. More...
 
uint32_t usart_init_rs485 (Usart *p_usart, const sam_usart_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in RS485 mode. More...
 
uint32_t usart_init_spi_master (Usart *p_usart, const usart_spi_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in SPI mode and act as a master. More...
 
uint32_t usart_init_spi_slave (Usart *p_usart, const usart_spi_opt_t *p_usart_opt)
 Configure USART to work in SPI mode and act as a slave. More...
 
uint32_t usart_init_sync_master (Usart *p_usart, const sam_usart_opt_t *p_usart_opt, uint32_t ul_mck)
 Configure USART to work in SYNC mode and act as a master. More...
 
uint32_t usart_init_sync_slave (Usart *p_usart, const sam_usart_opt_t *p_usart_opt)
 Configure USART to work in SYNC mode and act as a slave. More...
 
uint32_t usart_is_rx_buf_end (Usart *p_usart)
 Check if one receive buffer is filled. More...
 
uint32_t usart_is_rx_buf_full (Usart *p_usart)
 Check if both receive buffers are full. More...
 
uint32_t usart_is_rx_ready (Usart *p_usart)
 Check if the received data are ready. More...
 
uint32_t usart_is_tx_buf_empty (Usart *p_usart)
 Check if both transmit buffers are empty. More...
 
uint32_t usart_is_tx_buf_end (Usart *p_usart)
 Check if one transmit buffer is empty. More...
 
uint32_t usart_is_tx_empty (Usart *p_usart)
 Check if Transmit Holding Register is empty. More...
 
uint32_t usart_is_tx_ready (Usart *p_usart)
 Check if Transmit is Ready. More...
 
uint32_t usart_putchar (Usart *p_usart, uint32_t c)
 Write to USART Transmit Holding Register. More...
 
uint32_t usart_read (Usart *p_usart, uint32_t *c)
 Read from USART Receive Holding Register. More...
 
void usart_reset (Usart *p_usart)
 Reset the USART and disable TX and RX. More...
 
void usart_reset_iterations (Usart *p_usart)
 Reset the ITERATION in US_CSR when the ISO7816 mode is enabled. More...
 
void usart_reset_nack (Usart *p_usart)
 Reset NACK in US_CSR. More...
 
void usart_reset_rx (Usart *p_usart)
 Immediately stop and disable USART receiver. More...
 
void usart_reset_status (Usart *p_usart)
 Reset status bits (PARE, OVER, MANERR, UNRE and PXBRK in US_CSR). More...
 
void usart_reset_tx (Usart *p_usart)
 Immediately stop and disable USART transmitter. More...
 
void usart_restart_rx_timeout (Usart *p_usart)
 Restart the receive timeout. More...
 
uint32_t usart_send_address (Usart *p_usart, uint32_t ul_addr)
 In Multidrop mode only, the next character written to the US_THR is sent with the address bit set. More...
 
uint32_t usart_set_async_baudrate (Usart *p_usart, uint32_t baudrate, uint32_t ul_mck)
 Calculate a clock divider(CD) and a fractional part (FP) for the USART asynchronous modes to generate a baudrate as close as possible to the baudrate set point. More...
 
void usart_set_rx_timeout (Usart *p_usart, uint32_t timeout)
 Configure the receive timeout register. More...
 
void usart_set_tx_timeguard (Usart *p_usart, uint32_t timeguard)
 Configure the transmit timeguard register. More...
 
void usart_spi_force_chip_select (Usart *p_usart)
 Drive the slave select line NSS (RTS pin) to 0 in SPI master mode. More...
 
void usart_spi_release_chip_select (Usart *p_usart)
 Drive the slave select line NSS (RTS pin) to 1 in SPI master mode. More...
 
void usart_start_rx_timeout (Usart *p_usart)
 Start waiting for a character before clocking the timeout count. More...
 
void usart_start_tx_break (Usart *p_usart)
 Start transmission of a break. More...
 
void usart_stop_tx_break (Usart *p_usart)
 Stop transmission of a break. More...
 
uint32_t usart_write (Usart *p_usart, uint32_t c)
 Write to USART Transmit Holding Register. More...
 
void usart_write_line (Usart *p_usart, const char *string)
 Write one-line string through USART. More...
 

#define SPI_CPHA   (1 << 0)

Clock phase.

#define SPI_CPOL   (1 << 1)

Clock polarity.

#define SPI_MODE_0   0

SPI mode definition.

#define SPI_MODE_1   (SPI_CPHA)
#define SPI_MODE_2   (SPI_CPOL)
#define SPI_MODE_3   (SPI_CPOL | SPI_CPHA)

void usart_disable_interrupt ( Usart *  p_usart,
uint32_t  ul_sources 
)
void usart_disable_rx ( Usart *  p_usart)

Disable USART receiver.

Parameters
p_usartPointer to a USART instance.

Referenced by busart_if_close(), freertos_usart_serial_init(), func_transmitter(), main(), and usart_spi_disable().

void usart_disable_tx ( Usart *  p_usart)

Disable USART transmitter.

Parameters
p_usartPointer to a USART instance.

Referenced by busart_if_close(), freertos_usart_serial_init(), func_receiver(), ISR(), usart_handler(), and usart_spi_disable().

void usart_disable_writeprotect ( Usart *  p_usart)

Disable write protect of USART registers.

Parameters
p_usartPointer to a USART instance.

References US_WPMR_WPKEY_PASSWD.

Referenced by usart_reset().

void usart_drive_RTS_pin_high ( Usart *  p_usart)

Drive the pin RTS to 1.

Parameters
p_usartPointer to a USART instance.

Referenced by platform_set_ble_rts_low(), and usart_reset().

void usart_drive_RTS_pin_low ( Usart *  p_usart)

Drive the pin RTS to 0.

Parameters
p_usartPointer to a USART instance.

Referenced by platform_set_ble_rts_high().

void usart_enable_interrupt ( Usart *  p_usart,
uint32_t  ul_sources 
)
void usart_enable_writeprotect ( Usart *  p_usart)

Enable write protect of USART registers.

Parameters
p_usartPointer to a USART instance.

References US_WPMR_WPKEY_PASSWD.

uint8_t usart_get_error_number ( Usart *  p_usart)

Get the total number of errors that occur during an ISO7816 transfer.

Parameters
p_usartPointer to a USART instance.
Returns
The number of errors that occurred.
uint32_t usart_get_interrupt_mask ( Usart *  p_usart)

Read USART interrupt mask.

Parameters
p_usartPointer to a USART peripheral.
Returns
The interrupt mask value.

Referenced by local_usart_handler(), uart_config(), and uart_rx_notify().

Pdc* usart_get_pdc_base ( Usart *  p_usart)

Get USART PDC base address.

Parameters
p_usartPointer to a UART instance.
Returns
USART PDC registers base for PDC driver to access.

References NULL.

Referenced by bt_configure_usart(), busart_if_open(), configure_primary_uart(), and main().

uint32_t usart_get_status ( Usart *  p_usart)

Get current status.

Parameters
p_usartPointer to a USART instance.
Returns
The current USART status.

Referenced by iso7816_get_char(), iso7816_send_char(), ISR(), local_usart_handler(), USART1_Handler(), usart_handler(), and USART_Handler().

uint32_t usart_get_writeprotect_status ( Usart *  p_usart)

Get write protect status.

Parameters
p_usartPointer to a USART instance.
Returns
0 if no write protect violation occurred, or 16-bit write protect violation source.
uint32_t usart_getchar ( Usart *  p_usart,
uint32_t *  c 
)

Read from USART Receive Holding Register.

Before reading user should check if rx is ready.

Parameters
p_usartPointer to a USART instance.
cPointer where the one-byte received data will be stored.
Return values
0Data has been received.
1on failure.

Referenced by USART_Handler(), usart_spi_read_packet(), usart_spi_read_single(), and usart_spi_write_packet().

uint32_t usart_init_hw_handshaking ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in hardware handshaking mode.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References usart_init_rs232().

Referenced by configure_primary_uart(), and configure_usart().

uint32_t usart_init_irda ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in IrDA mode.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References sam_usart_opt_t::irda_filter, and usart_init_rs232().

Referenced by configure_usart().

uint32_t usart_init_iso7816 ( Usart *  p_usart,
const usart_iso7816_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in ISO7816 mode.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References usart_iso7816_opt_t::bit_order, usart_iso7816_opt_t::dis_suc_nack, usart_iso7816_opt_t::fidi_ratio, usart_iso7816_opt_t::inhibit_nack, usart_iso7816_opt_t::iso7816_hz, ISO7816_T_0, ISO7816_T_1, usart_iso7816_opt_t::max_iterations, usart_iso7816_opt_t::parity_type, usart_iso7816_opt_t::protocol_type, usart_reset(), and usart_set_iso7816_clock().

Referenced by iso7816_init().

uint32_t usart_init_rs232 ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in RS232 mode.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References sam_usart_opt_t::baudrate, sam_usart_opt_t::channel_mode, sam_usart_opt_t::char_length, sam_usart_opt_t::parity_type, sam_usart_opt_t::stop_bits, usart_reset(), and usart_set_async_baudrate().

Referenced by busart_if_open(), config_uart_and_pck(), configure_patch_usart(), configure_primary_uart(), configure_usart(), freertos_usart_serial_init(), serial_bridge_init(), uart_config(), uart_open(), usart_init_hw_handshaking(), usart_init_irda(), usart_init_rs485(), and usart_serial_init().

uint32_t usart_init_rs485 ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in RS485 mode.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References usart_init_rs232().

Referenced by configure_usart().

uint32_t usart_init_spi_master ( Usart *  p_usart,
const usart_spi_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in SPI mode and act as a master.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References usart_spi_opt_t::baudrate, usart_spi_opt_t::channel_mode, usart_spi_opt_t::char_length, usart_spi_opt_t::spi_mode, SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3, usart_reset(), and usart_set_spi_master_baudrate().

Referenced by usart_spi_setup_device().

uint32_t usart_init_spi_slave ( Usart *  p_usart,
const usart_spi_opt_t p_usart_opt 
)

Configure USART to work in SPI mode and act as a slave.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
Return values
0on success.
1on failure.

References usart_spi_opt_t::channel_mode, usart_spi_opt_t::char_length, usart_spi_opt_t::spi_mode, SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3, usart_reset(), and usart_set_spi_slave_baudrate().

uint32_t usart_init_sync_master ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt,
uint32_t  ul_mck 
)

Configure USART to work in SYNC mode and act as a master.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
ul_mckUSART module input clock frequency.
Return values
0on success.
1on failure.

References sam_usart_opt_t::baudrate, sam_usart_opt_t::channel_mode, sam_usart_opt_t::char_length, sam_usart_opt_t::parity_type, sam_usart_opt_t::stop_bits, usart_reset(), and usart_set_sync_master_baudrate().

Referenced by configure_usart().

uint32_t usart_init_sync_slave ( Usart *  p_usart,
const sam_usart_opt_t p_usart_opt 
)

Configure USART to work in SYNC mode and act as a slave.

Note
By default, the transmitter and receiver aren't enabled.
Parameters
p_usartPointer to a USART instance.
p_usart_optPointer to sam_usart_opt_t instance.
Return values
0on success.
1on failure.

References sam_usart_opt_t::channel_mode, sam_usart_opt_t::char_length, sam_usart_opt_t::parity_type, sam_usart_opt_t::stop_bits, usart_reset(), and usart_set_sync_slave_baudrate().

Referenced by configure_usart().

uint32_t usart_is_rx_buf_end ( Usart *  p_usart)

Check if one receive buffer is filled.

Parameters
p_usartPointer to a USART instance.
Return values
1Receive is complete.
0Receive is still pending.

Referenced by main().

uint32_t usart_is_rx_buf_full ( Usart *  p_usart)

Check if both receive buffers are full.

Parameters
p_usartPointer to a USART instance.
Return values
1Receive buffers are full.
0Receive buffers are not full.

Referenced by ble_pdc_uart_handler(), and usart_spi_is_rx_full().

uint32_t usart_is_rx_ready ( Usart *  p_usart)

Check if the received data are ready.

Check if Data have been received and loaded into USART_RHR.

Parameters
p_usartPointer to a USART instance.
Return values
1Some data has been received.
0No data has been received.

Referenced by BLE_PATCH_UART_Handler(), func_receiver(), SB_UART_Handler(), usart_serial_is_rx_ready(), and usart_spi_is_rx_ready().

uint32_t usart_is_tx_buf_empty ( Usart *  p_usart)

Check if both transmit buffers are empty.

Parameters
p_usartPointer to a USART instance.
Return values
1Transmit buffers are empty.
0Transmit buffers are not empty.

Referenced by buffered_uart_putchar().

uint32_t usart_is_tx_buf_end ( Usart *  p_usart)

Check if one transmit buffer is empty.

Parameters
p_usartPointer to a USART instance.
Return values
1Transmit is complete.
0Transmit is still pending.
uint32_t usart_is_tx_empty ( Usart *  p_usart)

Check if Transmit Holding Register is empty.

Check if the last data written in USART_THR have been loaded in TSR and the last data loaded in TSR have been transmitted.

Parameters
p_usartPointer to a USART instance.
Return values
1Transmitter is empty.
0Transmitter is not empty.

Referenced by BLE_PATCH_UART_Handler(), ble_pdc_uart_handler(), bt_usart_stream_write_buffer(), init_chip(), is_serial_output_done(), main(), SB_UART_Handler(), test_backup_mode(), test_wait_mode(), usart_spi_is_tx_empty(), usart_stream_write(), and user_change_clock().

uint32_t usart_is_tx_ready ( Usart *  p_usart)

Check if Transmit is Ready.

Check if data have been loaded in USART_THR and are waiting to be loaded into the Transmit Shift Register (TSR).

Parameters
p_usartPointer to a USART instance.
Return values
1No data is in the Transmit Holding Register.
0There is data in the Transmit Holding Register.

Referenced by usart_spi_is_tx_ready().

uint32_t usart_putchar ( Usart *  p_usart,
uint32_t  c 
)

Write to USART Transmit Holding Register.

Note
Before writing user should check if tx is ready (or empty).
Parameters
p_usartPointer to a USART instance.
cData to be sent.
Return values
0on success.
1on failure.

Referenced by ble_patch_serial_drv_send(), BLE_PATCH_UART_Handler(), SB_UART_Handler(), serial_bridge_task(), usart_spi_read_packet(), usart_spi_read_single(), usart_spi_write_packet(), usart_spi_write_single(), and usart_write_line().

uint32_t usart_read ( Usart *  p_usart,
uint32_t *  c 
)

Read from USART Receive Holding Register.

Note
Before reading user should check if rx is ready.
Parameters
p_usartPointer to a USART instance.
cPointer where the one-byte received data will be stored.
Return values
0on success.
1if no data is available or errors.

Referenced by BLE_PATCH_UART_Handler(), func_receiver(), getchar_timeout(), iso7816_cold_reset(), iso7816_get_char(), iso7816_warm_reset(), ISR(), main(), SB_UART_Handler(), usart_handler(), usart_serial_getchar(), and usart_stream_read().

void usart_reset ( Usart *  p_usart)
void usart_reset_iterations ( Usart *  p_usart)

Reset the ITERATION in US_CSR when the ISO7816 mode is enabled.

Parameters
p_usartPointer to a USART instance.

Referenced by iso7816_cold_reset(), iso7816_get_char(), iso7816_send_char(), and iso7816_warm_reset().

void usart_reset_nack ( Usart *  p_usart)

Reset NACK in US_CSR.

Parameters
p_usartPointer to a USART instance.

Referenced by iso7816_cold_reset(), iso7816_get_char(), iso7816_send_char(), and iso7816_warm_reset().

void usart_reset_rx ( Usart *  p_usart)

Immediately stop and disable USART receiver.

Parameters
p_usartPointer to a USART instance.

Referenced by ISR(), usart_clear(), usart_handler(), usart_reset(), and usart_stream_reset().

void usart_reset_status ( Usart *  p_usart)

Reset status bits (PARE, OVER, MANERR, UNRE and PXBRK in US_CSR).

Parameters
p_usartPointer to a USART instance.

Referenced by ble_pdc_uart_handler(), iso7816_cold_reset(), iso7816_get_char(), iso7816_send_char(), iso7816_warm_reset(), local_usart_handler(), and usart_reset().

void usart_reset_tx ( Usart *  p_usart)

Immediately stop and disable USART transmitter.

Parameters
p_usartPointer to a USART instance.

Referenced by usart_clear(), and usart_reset().

void usart_restart_rx_timeout ( Usart *  p_usart)

Restart the receive timeout.

Parameters
p_usartPointer to a USART instance.
uint32_t usart_send_address ( Usart *  p_usart,
uint32_t  ul_addr 
)

In Multidrop mode only, the next character written to the US_THR is sent with the address bit set.

Parameters
p_usartPointer to a USART instance.
ul_addrThe address to be sent out.
Return values
0on success.
1on failure.

References usart_write().

uint32_t usart_set_async_baudrate ( Usart *  p_usart,
uint32_t  baudrate,
uint32_t  ul_mck 
)

Calculate a clock divider(CD) and a fractional part (FP) for the USART asynchronous modes to generate a baudrate as close as possible to the baudrate set point.

Note
Baud rate calculation: Baudrate = ul_mck/(Over * (CD + FP/8)) (Over being 16 or 8). The maximal oversampling is selected if it allows to generate a baudrate close to the set point.
Parameters
p_usartPointer to a USART instance.
baudrateBaud rate set point.
ul_mckUSART module input clock frequency.
Return values
0Baud rate is successfully initialized.
1Baud rate set point is out of range for the given input clock frequency.

References HIGH_FRQ_SAMPLE_DIV, LOW_FRQ_SAMPLE_DIV, and MAX_CD_VALUE.

Referenced by usart_init_rs232().

void usart_set_rx_timeout ( Usart *  p_usart,
uint32_t  timeout 
)

Configure the receive timeout register.

Parameters
p_usartPointer to a USART instance.
timeoutThe value of receive timeout.

Referenced by configure_primary_uart(), and freertos_usart_serial_init().

void usart_set_tx_timeguard ( Usart *  p_usart,
uint32_t  timeguard 
)

Configure the transmit timeguard register.

Parameters
p_usartPointer to a USART instance.
timeguardThe value of transmit timeguard.

Referenced by iso7816_init().

void usart_spi_force_chip_select ( Usart *  p_usart)

Drive the slave select line NSS (RTS pin) to 0 in SPI master mode.

Parameters
p_usartPointer to a USART instance.

Referenced by usart_spi_select_device().

void usart_spi_release_chip_select ( Usart *  p_usart)

Drive the slave select line NSS (RTS pin) to 1 in SPI master mode.

Parameters
p_usartPointer to a USART instance.

Referenced by usart_spi_deselect_device().

void usart_start_rx_timeout ( Usart *  p_usart)

Start waiting for a character before clocking the timeout count.

Reset the status bit TIMEOUT in US_CSR.

Parameters
p_usartPointer to a USART instance.

Referenced by ble_pdc_uart_handler(), configure_primary_uart(), freertos_usart_serial_init(), and local_usart_handler().

void usart_start_tx_break ( Usart *  p_usart)

Start transmission of a break.

Parameters
p_usartPointer to a USART instance.

Referenced by atCmd_PsMode_Handler().

void usart_stop_tx_break ( Usart *  p_usart)

Stop transmission of a break.

Parameters
p_usartPointer to a USART instance.

Referenced by atCmd_PsMode_Handler().

uint32_t usart_write ( Usart *  p_usart,
uint32_t  c 
)

Write to USART Transmit Holding Register.

Note
Before writing user should check if tx is ready (or empty).
Parameters
p_usartPointer to a USART instance.
cData to be sent.
Return values
0on success.
1on failure.

Referenced by iso7816_send_char(), ISR(), usart_handler(), USART_Handler(), usart_send_address(), and usart_serial_putchar().

void usart_write_line ( Usart *  p_usart,
const char *  string 
)

Write one-line string through USART.

Parameters
p_usartPointer to a USART instance.
stringPointer to one-line string to be sent.

References usart_putchar().

Referenced by main(), and TC0_Handler().