I2C Peripheral
Bootloader » Peripheral Definitions

I2C peripheral interface. More...

Collaboration diagram for I2C Peripheral:

## Data Structures

struct | i2c_transfer_info_t
| Synchronization state between I2C ISR and read/write functions. More...

## Enumerations

enum | { kI2CGlitchFilterWidth_ns = 50 }
| Default width of glitches to filter in nanoseconds. More...
enum | { kI2CGlitchFilterMaxCycles = 31 }

## Functions

static bool | i2c_poll_for_activity (const peripheral_descriptor_t *self)
| I2C slave poll for activity function.
static status_t | i2c_full_init (const peripheral_descriptor_t *self, serial_byte_receive_func_t function)
| I2C slave init function.
static void | i2c_full_shutdown (const peripheral_descriptor_t *self)
| I2C slave shutdown function.
static void | i2c_peripheral_init (uint32_t instance)
| I2C slave internal init function.
status_t | i2c_write (const peripheral_descriptor_t *self, const uint8_t *buffer, uint32_t byteCount)
| I2C slave writing data function.
static void | i2c_initial_data_sink (uint8_t sink_byte, uint32_t instance)
static void | i2c_data_sink (uint8_t sink_byte, uint32_t instance)
static void | i2c_data_source (uint8_t *source_byte)
static void | i2c_set_glitch_filter_width (I2C_Type *base, uint32_t busClock_Hz, uint32_t glitchWidth_ns)
static void | i2c_SlaveIRQHandler (uint32_t instance)
void | I2C0_IRQHandler (void)
| Implementation of I2C0 handler named in startup code. More...
void | I2C1_IRQHandler (void)
| Implementation of I2C1 handler named in startup code. More...
static uint8_t | i2c_DummyRead (volatile I2C_Type *base)

## Variables

const peripheral_control_interface_t | g_i2cControlInterface
| I2C slave control interface information. More...
const peripheral_byte_inteface_t | g_i2cByteInterface = {.init = NULL, .write = i2c_write }
| I2C slave byte interface information. More...
static i2c_transfer_info_t | s_i2cInfo
| Global state for the I2C slave peripheral interface. More...
static bool | s_i2cActivity [FSL_FEATURE_SOC_I2C_COUNT] = { false }
| Global state for the I2C slave peripheral interface.
static const uint32_t | g_i2cBaseAddr [] = I2C_BASE_ADDRS
static bool | s_i2cIntialized [FSL_FEATURE_SOC_I2C_COUNT] = { false }
static serial_byte_receive_func_t | s_i2c_app_data_sink_callback
| I2C slave receiving data call back function.

## Usage Information

I2C peripheral interface.

## Data Structure Documentation

struct i2c_transfer_info_t

Synchronization state between I2C ISR and read/write functions.

### Data Fields

const uint8_t * | writeData
| The applications data to write.
volatile uint32_t | bytesToTransfer
| The total number of bytes to be transmitted.
void(* | data_source )(uint8_t *source_byte)
void(* | data_sink )(uint8_t sink_byte, uint32_t instance)

## Enumeration Type Documentation

anonymous enum

Default width of glitches to filter in nanoseconds.

Enumerator
kI2CGlitchFilterWidth_ns | Width of glitches to filter in nanoseconds.

anonymous enum

Enumerator
kI2CGlitchFilterMaxCycles | Max cycles supported to set glitch filter.

## Function Documentation

void I2C0_IRQHandler | ( | void |  | ) |

Implementation of I2C0 handler named in startup code.

Passes instance to generic I2C IRQ handler.

void I2C1_IRQHandler | ( | void |  | ) |

Implementation of I2C1 handler named in startup code.

Passes instance to generic I2C IRQ handler.

## Variable Documentation

const peripheral_byte_inteface_t g_i2cByteInterface = {.init = NULL, .write = i2c_write }

I2C slave byte interface information.

Byte I/O interface for the I2C peripheral driver.

const peripheral_control_interface_t g_i2cControlInterface

Initial value:
= {
.pollForActivity = i2c_poll_for_activity, .init = i2c_full_init, .shutdown = i2c_full_shutdown, .pump = 0
}
i2c_poll_for_activity
static bool i2c_poll_for_activity(const peripheral_descriptor_t *self)
I2C slave poll for activity function.
Definition: i2c_peripheral_interface.c:162
i2c_full_shutdown
static void i2c_full_shutdown(const peripheral_descriptor_t *self)
I2C slave shutdown function.
Definition: i2c_peripheral_interface.c:279
i2c_full_init
static status_t i2c_full_init(const peripheral_descriptor_t *self, serial_byte_receive_func_t function)
I2C slave init function.
Definition: i2c_peripheral_interface.c:259

I2C slave control interface information.

Control interface for the I2C peripheral driver.

i2c_transfer_info_t s_i2cInfo

static

Initial value:
= {
.writeData = 0, .bytesToTransfer = 0, .data_source = i2c_data_source, .data_sink = i2c_initial_data_sink
}

Global state for the I2C slave peripheral interface.