Microchip® Advanced Software Framework

freertos_usart_serial.c File Reference

FreeRTOS Peripheral Control API For the USART.

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

#include <string.h>
#include "serial.h"
#include "freertos_usart_serial.h"
#include "freertos_peripheral_control_private.h"

Macros

#define BITS_PER_5_MS   (200UL)
 
#define IER_ERROR_INTERRUPTS   (US_IER_OVRE | US_IER_FRAME | US_IER_PARE)
 
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
 
#define RX_NOT_USED   (uint8_t *) 0x1
 
#define SR_ERROR_INTERRUPTS   (US_CSR_OVRE | US_CSR_FRAME | US_CSR_PARE)
 

Enumerations

enum  buffer_operations {
  data_added = 0,
  data_removed,
  data_added = 0,
  data_removed
}
 

Functions

static void configure_rx_dma (uint32_t usart_index, enum buffer_operations operation_performed)
 
freertos_usart_if freertos_usart_serial_init (Usart *p_usart, const sam_usart_opt_t *const uart_parameters, const freertos_peripheral_options_t *const freertos_driver_parameters)
 Initializes the FreeRTOS ASF USART driver for the specified USART port. More...
 
uint32_t freertos_usart_serial_read_packet (freertos_usart_if p_usart, uint8_t *data, uint32_t len, portTickType block_time_ticks)
 Initiate a completely multi-byte read operation on a USART peripheral. More...
 
status_code_t freertos_usart_write_packet_async (freertos_usart_if p_usart, const uint8_t *data, size_t len, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte write operation on a USART peripheral. More...
 
static void local_usart_handler (const portBASE_TYPE usart_index)
 

Variables

static const
freertos_pdc_peripheral_parameters_t 
all_usart_definitions [MAX_USARTS]
 
static freertos_pdc_rx_control_t rx_buffer_definitions [MAX_USARTS]
 
static freertos_dma_event_control_t tx_dma_control [MAX_USARTS]
 

#define BITS_PER_5_MS   (200UL)
#define IER_ERROR_INTERRUPTS   (US_IER_OVRE | US_IER_FRAME | US_IER_PARE)
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
#define RX_NOT_USED   (uint8_t *) 0x1
#define SR_ERROR_INTERRUPTS   (US_CSR_OVRE | US_CSR_FRAME | US_CSR_PARE)

Referenced by local_usart_handler().

Enumerator
data_added 
data_removed 
data_added 
data_removed 

const freertos_pdc_peripheral_parameters_t all_usart_definitions[MAX_USARTS]
static
freertos_pdc_rx_control_t rx_buffer_definitions[MAX_USARTS]
static
freertos_dma_event_control_t tx_dma_control[MAX_USARTS]
static