LNSC-2420-Firmware/src/led_chplex.h
Thomas Kolb df3211333e Properly shut down peripherals before entering deep sleep
This is most important for the LEDs and the RS485 interface. If any LED
is on when deep sleep is entered, it will stay on the whole sleep time,
drawing about 10 mA on the 3,3V rail.

The RS485 transceiver must be switched to RX mode, as it consumes about
30 mA from the 5V rail in TX mode.
2021-06-12 16:02:21 +02:00

26 lines
625 B
C

#ifndef LED_CHPLEX_H
#define LED_CHPLEX_H
#include <stdint.h>
#define LED_CHPLEX_IDX_SOLAR_ON 0
#define LED_CHPLEX_IDX_LOAD_ON 1
#define LED_CHPLEX_IDX_ERR_TEMP 2
#define LED_CHPLEX_IDX_ERR_LOAD 3
#define LED_CHPLEX_IDX_CHARGE_PULSE 4
#define LED_CHPLEX_IDX_DISCHARGE_PULSE 5
void led_chplex_init(void);
void led_chplex_periodic(void);
void led_chplex_on(uint8_t idx);
void led_chplex_off(uint8_t idx);
void led_chplex_toggle(uint8_t idx);
void led_chplex_mask(uint8_t mask);
void led_chplex_deepsleep_prepare(void);
void led_chplex_deepsleep_resume(void);
#endif // LED_CHPLEX_H