Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SIO2HOST - UART

This module performs serial input/output functionalities via UART.

Functions

void sio2host_deinit (void)
 DeInitializes the Serial IO Module. More...
 
void sio2host_disable (void)
 Disables the Serial IO Module. More...
 
void sio2host_enable (void)
 Enables the Serial IO Module. More...
 
uint8_t sio2host_getchar (void)
 This function performs a blocking character receive functionality. More...
 
int sio2host_getchar_nowait (void)
 This function performs a non-blocking character receive functionality. More...
 
void sio2host_init (void)
 Initializes the Serial IO Module. More...
 
void sio2host_putchar (uint8_t)
 This function prints the character to the host. More...
 
uint8_t sio2host_rx (uint8_t *data, uint8_t max_length)
 Receives data from UART. More...
 
uint8_t sio2host_tx (uint8_t *data, uint8_t length)
 Transmits data via UART. More...
 

void sio2host_deinit ( void  )

DeInitializes the Serial IO Module.

References usart_disable(), usart_disable_transceiver(), USART_TRANSCEIVER_RX, and USART_TRANSCEIVER_TX.

Referenced by app_resources_uninit().

void sio2host_disable ( void  )

Disables the Serial IO Module.

Returns
void

References usart_disable().

void sio2host_enable ( void  )

Enables the Serial IO Module.

Returns
void

References usart_enable().

uint8_t sio2host_getchar ( void  )

This function performs a blocking character receive functionality.

Returns
returns the data which is received

References sio2host_rx().

Referenced by cert_select_band().

int sio2host_getchar_nowait ( void  )

This function performs a non-blocking character receive functionality.

Returns
'-1' if no data is recieved or returns the data if a character is received

References sio2host_rx().

Referenced by range_test_tx_off_task(), range_test_tx_on_task(), and serial_data_handler().

void sio2host_putchar ( uint8_t  )

This function prints the character to the host.

Returns
void

References sio2host_tx().

Referenced by APP_TaskHandler(), appDataInd(), appUartSendMessage(), csc_app_recv_buf(), and csc_app_send_buf().

uint8_t sio2host_rx ( uint8_t *  data,
uint8_t  max_length 
)

Receives data from UART.

Parameters
datapointer to the buffer where the received data is to be stored
max_lengthmaximum length of data to be received
Returns
actual number of bytes received

References serial_rx_buf, serial_rx_buf_head, serial_rx_buf_tail, and serial_rx_count.

Referenced by app_send_transparent_uart_data(), APP_TaskHandler(), csc_app_send_buf(), demoTimerCb(), mote_demo_init(), serial_data_handler(), sio2host_getchar(), and sio2host_getchar_nowait().

uint8_t sio2host_tx ( uint8_t *  data,
uint8_t  length 
)

Transmits data via UART.

Parameters
dataPointer to the buffer where the data to be transmitted is present
lengthNumber of bytes to be transmitted
Returns
Number of bytes actually transmitted

References length, STATUS_OK, and usart_serial_write_packet().

Referenced by log_output(), serial_data_handler(), and sio2host_putchar().