Microchip® Advanced Software Framework

uartSerializer.c File Reference

Implementation of uart serialize interface.

Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.

#include <types.h>
#include <uartSerializer.h>
#include "asf.h"
#include "conf_sio2host.h"

Macros

#define USART_DOUBLE_SPEED   1ul
 Sets USART U2Xn bit value. More...
 

Typedefs

typedef SercomUsart * UsartChannel_t
 

Functions

bool getByteUsart (uint8_t *p)
 Receive byte on uart. More...
 
static void hwInit (void)
 Startup initialization of the usart. More...
 
void hwInitUsart0 (void)
 Startup initialization of the usart0. More...
 
static void hwUnInit (void)
 Clear startup initialization parameters to start user application. More...
 
void hwUnInitUsart0 (void)
 Clear startup initialization parameters to start user application. More...
 
void setByteUsart (uint16_t length, uint8_t *data)
 Transmit byte to uart. More...
 
void usart_disable0 (void)
 

Variables

struct usart_module host_uart_module
 
UsartChannel_t usartTty
 

#define USART_DOUBLE_SPEED   1ul

Sets USART U2Xn bit value.

typedef SercomUsart* UsartChannel_t

bool getByteUsart ( uint8_t *  p)

Receive byte on uart.

Parameters
[out]p- pointer to byte memory;
Returns
true - there is received byte;
false - there is not received byte;

References host_uart_module, STATUS_OK, and usart_read_wait().

static void hwInit ( void  )
inlinestatic

Startup initialization of the usart.

Referenced by hwInitUsart0().

static void hwUnInit ( void  )
inlinestatic

Clear startup initialization parameters to start user application.

Referenced by hwUnInitUsart0().

void hwUnInitUsart0 ( void  )

Clear startup initialization parameters to start user application.

References host_uart_module, hwUnInit(), usart_disable_transceiver(), usart_reset(), USART_TRANSCEIVER_RX, and USART_TRANSCEIVER_TX.

Referenced by usart_disable0().

void setByteUsart ( uint16_t  length,
uint8_t *  data 
)

Transmit byte to uart.

Parameters
[in]len- number of bytes to transmit;
[in]p- pointer to byte memory;

References host_uart_module, STATUS_OK, and usart_write_wait().

struct usart_module host_uart_module
UsartChannel_t usartTty