Microchip® Advanced Software Framework

freertos_twi_master.c File Reference

FreeRTOS Peripheral Control API For the TWI.

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

#include <string.h>
#include "twi_master.h"
#include "freertos_twi_master.h"
#include "freertos_peripheral_control_private.h"

Data Structures

struct  twi_module
 

Macros

#define IER_ERROR_INTERRUPTS   (TWI_IER_NACK | TWI_IER_ARBLST | TWI_IER_OVRE)
 
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
 
#define SR_ERROR_INTERRUPTS   (TWI_SR_NACK | TWI_SR_ARBLST | TWI_SR_OVRE)
 
#define TWI_TIMEOUT_COUNTER   (0xffffffffUL)
 

Functions

freertos_twi_if freertos_twi_master_init (Twi *p_twi, const freertos_peripheral_options_t *const freertos_driver_parameters)
 Initializes the FreeRTOS ASF TWI (I2C) master driver for the specified TWI port. More...
 
status_code_t freertos_twi_read_packet_async (freertos_twi_if p_twi, twi_packet_t *p_packet, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte read operation on an TWI peripheral. More...
 
status_code_t freertos_twi_write_packet_async (freertos_twi_if p_twi, twi_packet_t *p_packet, portTickType block_time_ticks, xSemaphoreHandle notification_semaphore)
 Initiate a completely asynchronous multi-byte write operation on a TWI peripheral. More...
 
static void local_twi_handler (const portBASE_TYPE twi_index)
 

Variables

static const
freertos_pdc_peripheral_parameters_t 
all_twi_definitions [MAX_TWIS]
 
static const
freertos_dma_event_control_t 
null_dma_control = {NULL, NULL}
 
static freertos_dma_event_control_t rx_dma_control [MAX_TWIS]
 
static struct twi_module twis [MAX_TWIS]
 
static freertos_dma_event_control_t tx_dma_control [MAX_TWIS]
 

#define IER_ERROR_INTERRUPTS   (TWI_IER_NACK | TWI_IER_ARBLST | TWI_IER_OVRE)
#define MASK_ALL_INTERRUPTS   (0xffffffffUL)
#define SR_ERROR_INTERRUPTS   (TWI_SR_NACK | TWI_SR_ARBLST | TWI_SR_OVRE)

Referenced by local_twi_handler().

#define TWI_TIMEOUT_COUNTER   (0xffffffffUL)

const freertos_pdc_peripheral_parameters_t all_twi_definitions[MAX_TWIS]
static
const freertos_dma_event_control_t null_dma_control = {NULL, NULL}
static
freertos_dma_event_control_t rx_dma_control[MAX_TWIS]
static
freertos_dma_event_control_t tx_dma_control[MAX_TWIS]
static