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) |
Referenced by freertos_usart_serial_init().
#define IER_ERROR_INTERRUPTS (US_IER_OVRE | US_IER_FRAME | US_IER_PARE) |
Referenced by freertos_usart_serial_init().
#define MASK_ALL_INTERRUPTS (0xffffffffUL) |
Referenced by freertos_usart_serial_init().
#define RX_NOT_USED (uint8_t *) 0x1 |
Referenced by freertos_usart_serial_init(), freertos_usart_serial_read_packet(), and local_usart_handler().
#define SR_ERROR_INTERRUPTS (US_CSR_OVRE | US_CSR_FRAME | US_CSR_PARE) |
Referenced by local_usart_handler().
enum buffer_operations |
|
static |
References configASSERT, data_added, freertos_pdc_rx_control::next_byte_to_read, NULL, freertos_pdc_rx_control::past_rx_buffer_end_address, pdc_enable_transfer(), pdc_rx_init(), freertos_pdc_rx_control::rx_pdc_parameters, pdc_packet::ul_addr, pdc_packet::ul_size, usart_disable_interrupt(), and usart_enable_interrupt().
Referenced by freertos_usart_serial_read_packet(), and local_usart_handler().
|
static |
References configASSERT, configure_rx_dma(), data_added, freertos_pdc_rx_control::next_byte_to_read, NULL, freertos_pdc_rx_control::past_rx_buffer_end_address, pdFALSE, freertos_pdc_rx_control::rx_buffer_start_address, freertos_pdc_rx_control::rx_event_semaphore, RX_NOT_USED, freertos_pdc_rx_control::rx_pdc_parameters, SR_ERROR_INTERRUPTS, pdc_packet::ul_addr, pdc_packet::ul_size, usart_disable_interrupt(), usart_get_interrupt_mask(), usart_get_status(), usart_reset_status(), usart_start_rx_timeout(), and xSemaphoreGiveFromISR.
|
static |
|
static |
|
static |