Microchip® Advanced Software Framework

composite/device/example4/uart_samd.c File Reference

UART functions.

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

#include <asf.h>
#include "conf_example.h"
#include "uart.h"
#include "main.h"
#include "ui.h"

Functions

void uart_close (uint8_t port)
 Closes communication line. More...
 
void uart_config (uint8_t port, usb_cdc_line_coding_t *cfg)
 Configures communication line. More...
 
void uart_open (uint8_t port)
 Opens communication line. More...
 
void uart_rx_notify (uint8_t port)
 Called by CDC interface Callback running when CDC device have 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 uint8_t tx_data
 
struct usart_config usart_conf
 
struct usart_module usart_module_edbg
 

void uart_close ( uint8_t  port)

Closes communication line.

Referenced by main_cdc_disable().

void uart_config ( uint8_t  port,
usb_cdc_line_coding_t cfg 
)

Configures communication line.

Parameters
cfgline configuration
void uart_open ( uint8_t  port)

Opens communication line.

Referenced by main_cdc_enable().

void uart_rx_notify ( uint8_t  port)

Called by CDC interface Callback running when CDC device have received data.

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, udi_cdc_is_tx_ready(), udi_cdc_putc(), udi_cdc_signal_overrun(), 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_data, udi_cdc_getc(), udi_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

Referenced by uart_config(), and usart_rx_callback().

struct usart_config usart_conf

Referenced by uart_config().