Microchip® Advanced Software Framework

freertos_spi_master.c File Reference

FreeRTOS Peripheral Control API For the SPI.

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

#include <string.h>
#include "spi_master.h"
#include "freertos_spi_master.h"
#include "freertos_peripheral_control_private.h"

Macros

#define IER_ERROR_INTERRUPTS   (SPI_IER_MODF)
 
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
 
#define SR_ERROR_INTERRUPTS   (SPI_SR_MODF)
 

Functions

status_code_t freertos_spi_full_duplex_packet_async (freertos_spi_if p_spi, uint8_t *rx_data, uint8_t *tx_data, uint32_t len, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte full duplex operation on an SPI peripheral. More...
 
freertos_spi_if freertos_spi_master_init (Spi *p_spi, const freertos_peripheral_options_t *const freertos_driver_parameters)
 Initializes the FreeRTOS ASF SPI master driver for the specified SPI port. More...
 
status_code_t freertos_spi_read_packet_async (freertos_spi_if p_spi, uint8_t *data, uint32_t len, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte read operation on an SPI peripheral. More...
 
status_code_t freertos_spi_write_packet_async (freertos_spi_if p_spi, const uint8_t *data, size_t len, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte write operation on an SPI peripheral. More...
 
static void local_spi_handler (const portBASE_TYPE spi_index)
 

Variables

static const
freertos_pdc_peripheral_parameters_t 
all_spi_definitions [MAX_SPIS]
 
static const
freertos_dma_event_control_t 
null_dma_control = {NULL, NULL}
 
static freertos_dma_event_control_t rx_dma_control [MAX_SPIS]
 
static freertos_dma_event_control_t tx_dma_control [MAX_SPIS]
 

#define IER_ERROR_INTERRUPTS   (SPI_IER_MODF)
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
#define SR_ERROR_INTERRUPTS   (SPI_SR_MODF)

Referenced by local_spi_handler().

const freertos_pdc_peripheral_parameters_t all_spi_definitions[MAX_SPIS]
static
const freertos_dma_event_control_t null_dma_control = {NULL, NULL}
static
freertos_dma_event_control_t rx_dma_control[MAX_SPIS]
static
freertos_dma_event_control_t tx_dma_control[MAX_SPIS]
static