| Kinetis SDK Demo Applications User Guide 1.0.0-beta Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- Demos

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions | Variables
task_slave.c File Reference
`#include "fsl_i2c_slave_driver.h"`
`#include "fsl_smc_manager.h"`
`#include "i2c_rtos.h"`

## Enumerations
enum | rx_state_t { RX_STATE_IDLE, RX_STATE_CMD, RX_STATE_DATA }

## Functions
static i2c_status_t | data_sink (uint8_t sinkByte)
static i2c_status_t | data_source (uint8_t *sourceByte)
static void | on_error (i2c_status_t error)
uint8_t | get_temp_in_byte (uint32_t index)
| MSG_QUEUE_DECLARE (mqSlaveData, 10, 1)
static void | handle_cmd (uint8_t *buf, uint8_t cmd)
void | task_slave (void *param)

## Variables
static i2c_slave_user_config_t | slaveDev
static volatile uint32_t | curCmd
static smc_power_mode_config_t | smc_config_data
uint32_t | gSlaveId
static msg_queue_handler_t | hMsgQueue

## Enumeration Type Documentation

enum rx_state_t

Enumerator
RX_STATE_IDLE |
RX_STATE_CMD |
RX_STATE_DATA |

## Function Documentation

static i2c_status_t data_sink | ( | uint8_t | sinkByte | ) |
| static

FIXME: msg_queue system for BM has serious bug! sometimes, queue elements is not FIFO!. order is wrong. so in BM, use var: gI2c_data_received and gI2c_data_sink_sync to do work around. if this problem fixed. var gI2c_data_received and gI2c_data_sink_sync can be deleted, BM and RTOS can be unified.

static i2c_status_t data_source | ( | uint8_t * | sourceByte | ) |
| static

uint8_t get_temp_in_byte | ( | uint32_t | index | ) |

Get the 32bits temperature in byte designed for BM version of I2C_RTOS demo from the ISR context

Get the 32bits temperature in byte from the ISR context

static void handle_cmd | ( | uint8_t * | buf,
|  | uint8_t | cmd
| ) |  |
| static

MSG_QUEUE_DECLARE | ( | mqSlaveData | ,
|  | 10 | ,
|  | 1 |
| ) |  |

static void on_error | ( | i2c_status_t | error | ) |
| static

void task_slave | ( | void * | param | ) |

task for slave getting request and put response

## Variable Documentation

volatile uint32_t curCmd
| static

uint32_t gSlaveId

msg_queue_handler_t hMsgQueue
| static

i2c_slave_user_config_t slaveDev
| static

smc_power_mode_config_t smc_config_data
| static