|
RCM — ESP32 Room Controller
WT32-ETH01 firmware
|
Периодическая отправка команд на LCM по I2C (тестовая задача). More...
#include "i2c_cmd_device.h"#include "driver/i2c_master.h"#include "esp_check.h"#include "esp_log.h"#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "i2c_bus.h"Go to the source code of this file.
Macros | |
| #define | I2C_DEVICE_ADDR 0x20 |
| Заводской адрес LCM (7 бит); после SET_ADDR может отличаться | |
| #define | CMD_INTERVAL_MS 1000 |
Functions | |
| static esp_err_t | i2c_cmd_send (uint8_t *data, size_t data_len) |
| esp_err_t | i2c_cmd_device_init (void) |
| Добавляет LCM как устройство на общую шину (i2c_bus_init при необходимости). | |
| static void | i2c_cmd_task (void *arg) |
| esp_err_t | i2c_cmd_device_start (void) |
| Запускает задачу циклической отправки команд на LCM. | |
Variables | |
| static const char * | TAG = "i2c_cmd" |
| static uint8_t | s_commands [] |
| static i2c_master_dev_handle_t | s_i2c_dev |
| static bool | s_initialized |
Периодическая отправка команд на LCM по I2C (тестовая задача).
Использует общую шину i2c_bus. Адрес LCM: 0x7F (заводской) или из NVM.
Definition in file i2c_cmd_device.c.
| #define CMD_INTERVAL_MS 1000 |
Definition at line 21 of file i2c_cmd_device.c.
Referenced by i2c_cmd_device_start(), and i2c_cmd_task().
| #define I2C_DEVICE_ADDR 0x20 |
Заводской адрес LCM (7 бит); после SET_ADDR может отличаться
Definition at line 20 of file i2c_cmd_device.c.
Referenced by i2c_cmd_device_init().
| esp_err_t i2c_cmd_device_init | ( | void | ) |
Добавляет LCM как устройство на общую шину (i2c_bus_init при необходимости).
Definition at line 37 of file i2c_cmd_device.c.
References i2c_bus_add_device(), i2c_bus_init(), I2C_DEVICE_ADDR, s_i2c_dev, s_initialized, and TAG.
Referenced by app_main().
| esp_err_t i2c_cmd_device_start | ( | void | ) |
Запускает задачу циклической отправки команд на LCM.
Definition at line 73 of file i2c_cmd_device.c.
References CMD_INTERVAL_MS, i2c_cmd_task(), s_initialized, and TAG.
Referenced by app_main().
|
static |
Definition at line 32 of file i2c_cmd_device.c.
References I2C_BUS_TIMEOUT_MS, and s_i2c_dev.
Referenced by i2c_cmd_task().
|
static |
Definition at line 52 of file i2c_cmd_device.c.
References CMD_INTERVAL_MS, i2c_cmd_send(), s_commands, and TAG.
Referenced by i2c_cmd_device_start().
|
static |
Definition at line 23 of file i2c_cmd_device.c.
Referenced by i2c_cmd_task().
|
static |
Definition at line 29 of file i2c_cmd_device.c.
Referenced by i2c_cmd_device_init(), and i2c_cmd_send().
|
static |
Definition at line 30 of file i2c_cmd_device.c.
Referenced by i2c_cmd_device_init(), and i2c_cmd_device_start().
|
static |
Definition at line 17 of file i2c_cmd_device.c.
Referenced by i2c_cmd_device_init(), i2c_cmd_device_start(), and i2c_cmd_task().