|
LCM — CH32V003 Light Control Module
Light Control Module, I2C slave
|
#include "lcm_i2c.h"#include "lcm_module.h"#include "lcm_led.h"#include "event_log.h"#include "ch32v00x_conf.h"Go to the source code of this file.
Enumerations | |
| enum | LCM_I2C_RxState { LCM_I2C_WAIT_CMD = 0 , LCM_I2C_WAIT_PARAM , LCM_I2C_ARMED_READ } |
Functions | |
| static uint8_t | LCM_IsTwoByteCmd (uint8_t cmd) |
| static uint8_t | LCM_IsReadCmd (uint8_t cmd) |
| static void | LCM_I2C_ResetRx (void) |
| static void | LCM_I2C_OnRxData (uint8_t byte) |
| void | LCM_I2C_ArmRead (uint8_t byte) |
| void | LCM_I2C_Init (uint8_t addr) |
| void | I2C1_EV_IRQHandler (void) |
| void | I2C1_ER_IRQHandler (void) |
Variables | |
| static volatile LCM_I2C_RxState | s_i2c_rx_state = LCM_I2C_WAIT_CMD |
| static volatile uint8_t | s_i2c_cmd |
| static volatile uint8_t | s_i2c_tx_byte |
| static volatile uint8_t | s_i2c_tx_pending |
| enum LCM_I2C_RxState |
| void LCM_I2C_ArmRead | ( | uint8_t | byte | ) |
Definition at line 129 of file lcm_i2c.c.
References LCM_I2C_ARMED_READ, s_i2c_rx_state, s_i2c_tx_byte, and s_i2c_tx_pending.
Referenced by LCM_Module_ExecuteSingleByte(), and LCM_Module_ExecuteTwoByte().
| void LCM_I2C_Init | ( | uint8_t | addr | ) |
Definition at line 136 of file lcm_i2c.c.
References LCM_I2C_ResetRx(), and LCM_I2C_SPEED_HZ.
Referenced by LCM_Module_Init().
|
static |
Definition at line 104 of file lcm_i2c.c.
References EventLog_PushI2cCmd(), EventLog_PushI2cReadArm(), LCM_I2C_WAIT_CMD, LCM_I2C_WAIT_PARAM, LCM_IsReadCmd(), LCM_IsTwoByteCmd(), LCM_Led_ActivityPulse(), LCM_Module_ExecuteSingleByte(), LCM_Module_ExecuteTwoByte(), s_i2c_cmd, and s_i2c_rx_state.
|
static |
Definition at line 83 of file lcm_i2c.c.
References LCM_I2C_WAIT_CMD, s_i2c_cmd, s_i2c_rx_state, and s_i2c_tx_pending.
Referenced by LCM_I2C_Init().
|
static |
Definition at line 69 of file lcm_i2c.c.
References LCM_GET_ERROR, and LCM_GET_ID.
Referenced by LCM_I2C_OnRxData().
|
static |
Definition at line 50 of file lcm_i2c.c.
References LCM_LAMP_ON, and LCM_SET_ADDR.
Referenced by LCM_I2C_OnRxData().
|
static |
Definition at line 37 of file lcm_i2c.c.
Referenced by LCM_I2C_OnRxData(), and LCM_I2C_ResetRx().
|
static |
Definition at line 36 of file lcm_i2c.c.
Referenced by LCM_I2C_ArmRead(), LCM_I2C_OnRxData(), and LCM_I2C_ResetRx().
|
static |
Definition at line 38 of file lcm_i2c.c.
Referenced by LCM_I2C_ArmRead().
|
static |
Definition at line 39 of file lcm_i2c.c.
Referenced by LCM_I2C_ArmRead(), and LCM_I2C_ResetRx().