MeterLogger
Functions
led.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ICACHE_FLASH_ATTR void led_init (void)
 
ICACHE_FLASH_ATTR void led_on (void)
 
ICACHE_FLASH_ATTR void led_off (void)
 
ICACHE_FLASH_ATTR void led_blink (void)
 
ICACHE_FLASH_ATTR void led_pattern_a (void)
 
ICACHE_FLASH_ATTR void led_pattern_b (void)
 
ICACHE_FLASH_ATTR void led_pattern_c (void)
 
ICACHE_FLASH_ATTR void led_stop_pattern (void)
 

Function Documentation

◆ led_blink()

ICACHE_FLASH_ATTR void led_blink ( void  )

Definition at line 99 of file led.c.

References led_on(), led_single_blink_off_timer, led_single_blink_off_timer_func(), NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, and os_timer_setfn.

Referenced by en61107_receive_timeout_timer_func().

99  {
100  led_on();
104 }
#define os_timer_disarm
Definition: osapi.h:51
static os_timer_t led_single_blink_off_timer
Definition: led.c:6
#define NULL
Definition: def.h:47
#define os_timer_func_t
Definition: os_type.h:35
#define os_timer_setfn
Definition: osapi.h:52
ICACHE_FLASH_ATTR static void led_single_blink_off_timer_func(void *arg)
Definition: led.c:32
ICACHE_FLASH_ATTR void led_on(void)
Definition: led.c:88
#define os_timer_arm(a, b, c)
Definition: osapi.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_init()

ICACHE_FLASH_ATTR void led_init ( void  )

Definition at line 80 of file led.c.

References BIT2, FUNC_GPIO2, gpio_output_set(), PERIPHS_IO_MUX_GPIO2_U, and PIN_FUNC_SELECT.

80  {
81  //Set GPIO2 to output mode
83 
84  // Set GPIO2 to HIGH (turn blue led off)
85  gpio_output_set(BIT2, 0, BIT2, 0);
86 }
#define PIN_FUNC_SELECT(PIN_NAME, FUNC)
Definition: eagle_soc.h:270
#define PERIPHS_IO_MUX_GPIO2_U
Definition: eagle_soc.h:258
#define BIT2
Definition: eagle_soc.h:58
void gpio_output_set(uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask)
#define FUNC_GPIO2
Definition: eagle_soc.h:259
Here is the call graph for this function:

◆ led_off()

ICACHE_FLASH_ATTR void led_off ( void  )

Definition at line 93 of file led.c.

References BIT2, and gpio_output_set().

Referenced by ac_out_off_timer_func(), ac_pwm_timer_func(), led_blinker_timer_func(), led_double_blink_timer_func(), led_single_blink_off_timer_func(), and led_stop_pattern().

93  {
94 
95  // Set GPIO2 to HIGH
96  gpio_output_set(BIT2, 0, BIT2, 0);
97 }
#define BIT2
Definition: eagle_soc.h:58
void gpio_output_set(uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_on()

ICACHE_FLASH_ATTR void led_on ( void  )

Definition at line 88 of file led.c.

References BIT2, and gpio_output_set().

Referenced by ac_pwm_timer_func(), led_blink(), led_blinker_timer_func(), and led_double_blink_timer_func().

88  {
89  //Set GPIO2 to LOW
90  gpio_output_set(0, BIT2, BIT2, 0);
91 }
#define BIT2
Definition: eagle_soc.h:58
void gpio_output_set(uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_pattern_a()

ICACHE_FLASH_ATTR void led_pattern_a ( void  )

Definition at line 106 of file led.c.

References led_blinker_timer, led_blinker_timer_func(), led_blinker_timer_running, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, and os_timer_setfn.

Referenced by ac_motor_valve_open(), ac_test(), ac_test_timer_func(), ac_thermo_close(), and wifi_scan_done_cb().

106  {
109  led_blinker_timer_running = true; // state variable to control stopping after pattern is done
110  os_timer_arm(&led_blinker_timer, 1000, 1);
111 }
#define os_timer_disarm
Definition: osapi.h:51
ICACHE_FLASH_ATTR static void led_blinker_timer_func(void *arg)
Definition: led.c:16
#define NULL
Definition: def.h:47
#define os_timer_func_t
Definition: os_type.h:35
#define os_timer_setfn
Definition: osapi.h:52
static volatile bool led_blinker_timer_running
Definition: led.c:11
static os_timer_t led_blinker_timer
Definition: led.c:5
#define os_timer_arm(a, b, c)
Definition: osapi.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_pattern_b()

ICACHE_FLASH_ATTR void led_pattern_b ( void  )

Definition at line 113 of file led.c.

References led_blinker_timer, led_blinker_timer_func(), led_blinker_timer_running, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, and os_timer_setfn.

Referenced by ac_motor_valve_close(), ac_test_timer_func(), ac_thermo_open(), and watchdog_timer_func().

113  {
116  led_blinker_timer_running = true; // state variable to control stopping after pattern is done
118 }
#define os_timer_disarm
Definition: osapi.h:51
ICACHE_FLASH_ATTR static void led_blinker_timer_func(void *arg)
Definition: led.c:16
#define NULL
Definition: def.h:47
#define os_timer_func_t
Definition: os_type.h:35
#define os_timer_setfn
Definition: osapi.h:52
static volatile bool led_blinker_timer_running
Definition: led.c:11
static os_timer_t led_blinker_timer
Definition: led.c:5
#define os_timer_arm(a, b, c)
Definition: osapi.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_pattern_c()

ICACHE_FLASH_ATTR void led_pattern_c ( void  )

Definition at line 120 of file led.c.

References led_double_blink_timer, led_double_blink_timer_func(), led_double_blinker_timer_running, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, and os_timer_setfn.

120  {
121  // blink fast two times every 5th second
124  led_double_blinker_timer_running = true; // state variable to control stopping after pattern is done
126 }
#define os_timer_disarm
Definition: osapi.h:51
#define NULL
Definition: def.h:47
#define os_timer_func_t
Definition: os_type.h:35
#define os_timer_setfn
Definition: osapi.h:52
static os_timer_t led_double_blink_timer
Definition: led.c:8
#define os_timer_arm(a, b, c)
Definition: osapi.h:50
ICACHE_FLASH_ATTR static void led_double_blink_timer_func(void *arg)
Definition: led.c:36
static volatile bool led_double_blinker_timer_running
Definition: led.c:12
Here is the call graph for this function:

◆ led_stop_pattern()

ICACHE_FLASH_ATTR void led_stop_pattern ( void  )

Definition at line 128 of file led.c.

References led_blinker_timer_running, led_double_blinker_timer_running, and led_off().

Referenced by ac_out_off_timer_func(), ac_thermo_pwm(), wifi_reconnect_timer_func(), and wifi_scan_done_cb().

128  {
131  led_off();
132 }
ICACHE_FLASH_ATTR void led_off(void)
Definition: led.c:93
static volatile bool led_blinker_timer_running
Definition: led.c:11
static volatile bool led_double_blinker_timer_running
Definition: led.c:12
Here is the call graph for this function:
Here is the caller graph for this function: