LCM — CH32V003 Light Control Module
Light Control Module, I2C slave
Loading...
Searching...
No Matches
lcm_relay.h
Go to the documentation of this file.
1
/********************************** (C) COPYRIGHT *******************************
2
* File Name : lcm_relay.h
3
* Description : Драйвер 8 реле LCM (GPIO push-pull, активный высокий уровень).
4
*********************************************************************************/
5
6
#ifndef __LCM_RELAY_H
7
#define __LCM_RELAY_H
8
9
#include <stdint.h>
10
11
/*********************************************************************
12
* @fn LCM_Relay_Init
13
*
14
* @brief Настройка выводов реле как цифровых выходов push-pull.
15
*
16
* @details PC3–PC7 (порт C) и PD0, PD2, PD3 (порт D). Начальное состояние —
17
* все пины в 0 (реле выключены). PC1/PC2 (I2C) настраиваются
18
* отдельно в lcm_i2c.c.
19
*
20
* @return LCM_ERR_NONE или LCM_ERR_GPIO_INIT/LCM_ERR_GPIO_GET.
21
*/
22
uint8_t
LCM_Relay_Init
(
void
);
23
24
/*********************************************************************
25
* @fn LCM_Relay_Apply
26
*
27
* @brief Применить битовую маску реле к физическим выводам GPIO.
28
*
29
* @param relay_state — маска реле (LSB = реле 0, 1 = включено).
30
*
31
* @details Обходит все 8 реле; для каждого бита маски выставляет SetBits
32
* или ResetBits на соответствующем порту/пине, затем проверяет
33
* уровень через GPIO_ReadOutputDataBit().
34
*
35
* @return LCM_ERR_NONE или код LCM_ERR_GPIO_*.
36
*/
37
uint8_t
LCM_Relay_Apply
(uint8_t relay_state);
38
39
#endif
/* __LCM_RELAY_H */
LCM_Relay_Init
uint8_t LCM_Relay_Init(void)
Definition
lcm_relay.c:75
LCM_Relay_Apply
uint8_t LCM_Relay_Apply(uint8_t relay_state)
Definition
lcm_relay.c:143
User
lcm_relay.h
Generated by
1.11.0