Microchip® Advanced Software Framework

uart_sam.c File Reference

UART functions.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "conf_example.h"
#include "conf_usb_host.h"
#include <asf.h>
#include "flexcom.h"

Macros

#define USART_PERIPH_CLK_ENABLE()   sysclk_enable_peripheral_clock(USART_BASE)
 

Functions

 ISR (USART_HANDLER)
 
void uart_close (void)
 Closes communication line. More...
 
void uart_config (usb_cdc_line_coding_t *cfg)
 Configures communication line. More...
 
void uart_open (void)
 Opens communication line. More...
 
void uart_rx_notify (void)
 Callback called by CDC interface when the CDC device has received data. More...
 

Variables

static sam_usart_opt_t usart_options
 

#define USART_PERIPH_CLK_ENABLE ( )    sysclk_enable_peripheral_clock(USART_BASE)

Referenced by uart_open().

void uart_close ( void  )

Closes communication line.

References USART_BASE, USART_DISABLE, and usart_disable_interrupt().

void uart_rx_notify ( void  )

Callback called by CDC interface when the CDC device has received data.

References USART_BASE, usart_enable_interrupt(), usart_enable_tx(), and usart_get_interrupt_mask().

sam_usart_opt_t usart_options
static
Initial value:
= {
.baudrate = 115200,
.char_length = US_MR_CHRL_8_BIT,
.parity_type = US_MR_PAR_NO,
.stop_bits = US_MR_NBSTOP_1_BIT,
.channel_mode = US_MR_CHMODE_NORMAL,
}