Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
alarm_sound.h File Reference
#include "driver/gpio.h"
#include "esp_err.h"
#include "esp_log.h"
Include dependency graph for alarm_sound.h:

Go to the source code of this file.

Data Structures

struct  alarm_handle_t
 

Enumerations

enum  alarm_state { NO_BEEP = 0 , BEEP }
 

Functions

int alarm_sound_init (alarm_handle_t *alarm)
 Initialize the alarm sound output.
 
int alarm_sound_toggle (alarm_handle_t *alarm)
 Toggle the alarm sound on or off.
 

Enumeration Type Documentation

◆ alarm_state

Enumerator
NO_BEEP 
BEEP 

Function Documentation

◆ alarm_sound_init()

int alarm_sound_init ( alarm_handle_t alarm)

Initialize the alarm sound output.

Configures the GPIO and sets initial state. Call once before alarm_sound_toggle().

Parameters
alarmPointer to alarm_handle_t (power_pin must be set)
Returns
ESP_OK on success, error code otherwise

◆ alarm_sound_toggle()

int alarm_sound_toggle ( alarm_handle_t alarm)

Toggle the alarm sound on or off.

Switches between NO_BEEP and BEEP and updates alarm->current_state.

Parameters
alarmPointer to initialized alarm_handle_t
Returns
ESP_OK on success, error code otherwise