Microchip® Advanced Software Framework

uart_samd.c File Reference

UART functions.

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

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

Functions

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...
 
static void usart_rx_callback (struct usart_module *const module)
 USART interrupt callback function. More...
 
static void usart_tx_callback (struct usart_module *const module)
 USART interrupt callback function. More...
 

Variables

static uint8_t rx_data
 
static volatile uint8_t tx_callback_flag = 0
 
static uint8_t tx_data
 
struct usart_config usart_conf
 
struct usart_module usart_module_edbg
 

void uart_close ( void  )

Closes communication line.

References usart_disable(), and usart_module_edbg.

void uart_open ( void  )

Opens communication line.

References usart_enable(), and usart_module_edbg.

Referenced by ui_usb_enum_event().

void uart_rx_notify ( void  )

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

References tx_callback_flag, tx_data, uhi_cdc_getc(), ui_com_rx_start(), USART_CALLBACK_BUFFER_TRANSMITTED, usart_enable_callback(), usart_module_edbg, and usart_write_buffer_job().

static void usart_rx_callback ( struct usart_module *const  module)
static

USART interrupt callback function.

Called by USART driver when receiving is complete.

  • Parameters
    moduleUSART module causing the interrupt (not used)

References rx_data, uhi_cdc_is_tx_ready(), uhi_cdc_putc(), ui_com_overflow(), ui_com_tx_start(), ui_com_tx_stop(), usart_module_edbg, and usart_read_buffer_job().

Referenced by uart_config().

static void usart_tx_callback ( struct usart_module *const  module)
static

USART interrupt callback function.

Called by USART driver when transmit is complete.

  • Parameters
    moduleUSART module causing the interrupt (not used)

References tx_callback_flag, tx_data, uhi_cdc_getc(), uhi_cdc_is_rx_ready(), ui_com_rx_start(), ui_com_rx_stop(), USART_CALLBACK_BUFFER_TRANSMITTED, usart_disable_callback(), usart_module_edbg, and usart_write_buffer_job().

Referenced by uart_config().

uint8_t rx_data
static
volatile uint8_t tx_callback_flag = 0
static
uint8_t tx_data
static
struct usart_config usart_conf

Referenced by uart_config().