Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
driver_examples/flexio/i2c/main.c File Reference
#include <stdio.h>
#include "board.h"
#include "fsl_flexio_i2c_master_driver.h"
#include "fsl_i2c_slave_driver.h"
#include "fsl_i2c_shared_function.h"
#include "fsl_clock_manager.h"
#include "fsl_debug_console.h"

Macros

#define I2C_SLAVE
 
#define I2C_SLAVE_ADDR
 
#define I2C_RESET_BUFF(x, size)
 

Functions

static int32_t i2c_compare_sink_source (uint8_t *source, uint8_t *sink, uint16_t count)
 
static void master_send_slave_receive_int (void)
 
static void master_receive_slave_send_int (void)
 
static void master_send_slave_receive_int_blocking (void)
 
static void master_receive_slave_send_int_blocking (void)
 
int main (void)
 Function prototype for main function. More...
 

Variables

static uint32_t s_flexioInstance
 
flexio_i2c_state_t masterState
 
i2c_slave_state_t slaveState
 
static uint8_t s_masterReadBuffer [13]
 
static uint8_t s_slaveReadBuffer [13]
 
static uint8_t s_masterWriteBuffer [13]
 
static uint8_t s_slaveWriteBuffer [13]
 
static i2c_slave_user_config_t slaveConfig
 

Macro Definition Documentation

#define I2C_RESET_BUFF (   x,
  size 
)
#define I2C_SLAVE

Instance number for I2C0.

#define I2C_SLAVE_ADDR

Function Documentation

static int32_t i2c_compare_sink_source ( uint8_t *  source,
uint8_t *  sink,
uint16_t  count 
)
static
int main ( void  )

Function prototype for main function.

Function prototype for main function.

This function used the input of user as trigger to start the measurement. When user press any key, the conversion will begin, then print converted value and current temperature of the chip.

Function prototype for main function.

Run a simple application which enables watchdog, then continuously refreshes the watchdog to prevent CPU reset Upon SW1 button push, the watchdog will expire after approximately 1 seconds and chip will reset.

Function prototype for main function.

This function uses terminal to enter DAC value and convert this value to DAC output.

Function prototype for main function.

This function use DMA peripheral to transfer two buffers

Function prototype for main function.

Thid function uses DSPI master to send an array to slave and receive the array back from slave, thencompare whether the two buffers are the same.

Function prototype for main function.

This function sends back received buffer from master through DSPI interface.

Function prototype for main function.

This function sends an array through DSPI loopback interface and compare it with received buffer whether they are the same.

Function prototype for main function.

This function use EDMA peripheral to transfer two buffers

Function prototype for main function.

This function use EWM as a watchdog for an external circuit. when the counter reaches high value, EWM enter interrupt.

Function prototype for main function.

This function uses SSD to demonstrate flash mode:

  • Check flash information.
  • Erase a sector and verify.
  • Program a sector and verify.
Parameters
receiveBuffBuffer used to hold received data

Return code from each SSD function

Address of the target location

Return protection status

Number of longword or phrase to be verified

0=normal, 1=user, 2=factory - margin read for reading

static void master_receive_slave_send_int ( void  )
static
static void master_receive_slave_send_int_blocking ( void  )
static
static void master_send_slave_receive_int ( void  )
static
static void master_send_slave_receive_int_blocking ( void  )
static

Variable Documentation

flexio_i2c_state_t masterState
uint32_t s_flexioInstance
static
uint8_t s_masterReadBuffer[13]
static
uint8_t s_masterWriteBuffer[13]
static
uint8_t s_slaveReadBuffer[13]
static
uint8_t s_slaveWriteBuffer[13]
static
i2c_slave_user_config_t slaveConfig
static
i2c_slave_state_t slaveState