Adicionar primeiro
This commit is contained in:
25
components/peripherals/include/ac_relay.h
Executable file
25
components/peripherals/include/ac_relay.h
Executable file
@@ -0,0 +1,25 @@
|
||||
#ifndef AC_RELAY_H_
|
||||
#define AC_RELAY_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* @brief Inicializa o relé de corrente alternada.
|
||||
*/
|
||||
void ac_relay_init(void);
|
||||
|
||||
/**
|
||||
* @brief Define o estado do relé de corrente alternada.
|
||||
*
|
||||
* @param state true para ligar, false para desligar.
|
||||
*/
|
||||
void ac_relay_set_state(bool state);
|
||||
|
||||
/**
|
||||
* @brief Retorna o estado atual do relé de corrente alternada.
|
||||
*
|
||||
* @return true se estiver ligado, false se desligado.
|
||||
*/
|
||||
bool ac_relay_get_state(void);
|
||||
|
||||
#endif /* AC_RELAY_H_ */
|
||||
14
components/peripherals/include/adc.h
Executable file
14
components/peripherals/include/adc.h
Executable file
@@ -0,0 +1,14 @@
|
||||
#ifndef ADC_H_
|
||||
#define ADC_H_
|
||||
|
||||
#include "esp_adc/adc_oneshot.h"
|
||||
#include "esp_adc/adc_cali.h"
|
||||
#include "esp_adc/adc_cali_scheme.h"
|
||||
|
||||
extern adc_oneshot_unit_handle_t adc_handle;
|
||||
|
||||
extern adc_cali_handle_t adc_cali_handle;
|
||||
|
||||
void adc_init(void);
|
||||
|
||||
#endif /* ADC_H_ */
|
||||
12
components/peripherals/include/adc121s021_dma.h
Executable file
12
components/peripherals/include/adc121s021_dma.h
Executable file
@@ -0,0 +1,12 @@
|
||||
#ifndef ADC_DMA_H_
|
||||
#define ADC_DMA_H_
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void adc121s021_dma_init(void);
|
||||
bool adc121s021_dma_get_sample(uint16_t *sample);
|
||||
|
||||
|
||||
#endif /* ADC_DMA_h_ */
|
||||
39
components/peripherals/include/aux_io.h
Executable file
39
components/peripherals/include/aux_io.h
Executable file
@@ -0,0 +1,39 @@
|
||||
#ifndef AUX_IO_H_
|
||||
#define AUX_IO_H_
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize aux
|
||||
*
|
||||
*/
|
||||
void aux_init(void);
|
||||
|
||||
/**
|
||||
* @brief Read digital input
|
||||
*
|
||||
* @param name
|
||||
* @param value
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t aux_read(const char *name, bool *value);
|
||||
|
||||
/**
|
||||
* @brief Write digial output
|
||||
*
|
||||
* @param name
|
||||
* @param value
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t aux_write(const char *name, bool value);
|
||||
|
||||
/**
|
||||
* @brief Read analog input
|
||||
*
|
||||
* @param name
|
||||
* @param value
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t aux_analog_read(const char *name, int *value);
|
||||
|
||||
#endif /* AUX_IO_H_ */
|
||||
22
components/peripherals/include/buzzer.h
Executable file
22
components/peripherals/include/buzzer.h
Executable file
@@ -0,0 +1,22 @@
|
||||
#ifndef BUZZER_H_
|
||||
#define BUZZER_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Inicializa o buzzer e inicia monitoramento automático do estado EVSE.
|
||||
*/
|
||||
void buzzer_init(void);
|
||||
|
||||
/**
|
||||
* @brief Liga e desliga o buzzer manualmente (uso interno ou testes).
|
||||
*/
|
||||
void buzzer_on(void);
|
||||
void buzzer_off(void);
|
||||
|
||||
/**
|
||||
* @brief Ativa o buzzer por um período fixo (em milissegundos).
|
||||
*/
|
||||
void buzzer_beep_ms(uint16_t ms);
|
||||
|
||||
#endif /* BUZZER_H_ */
|
||||
179
components/peripherals/include/energy_meter.h
Executable file
179
components/peripherals/include/energy_meter.h
Executable file
@@ -0,0 +1,179 @@
|
||||
#ifndef ENERGY_METER_H_
|
||||
#define ENERGY_METER_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief Grid energy meter model
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ENERGY_METER_NONE,
|
||||
ENERGY_METER_ORNO_515,
|
||||
ENERGY_METER_ORNO_517,
|
||||
} meter_model_t;
|
||||
|
||||
/**
|
||||
* @brief Initialize energy meter
|
||||
*
|
||||
*/
|
||||
void energy_meter_init(void);
|
||||
|
||||
/**
|
||||
* @brief Get state of energy meter
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
bool meter_get_state(void);
|
||||
|
||||
/**
|
||||
* @brief Get mode of energy meter, stored in NVS
|
||||
*
|
||||
* @return meter_model_t
|
||||
*/
|
||||
meter_model_t meter_get_model(void);
|
||||
|
||||
/**
|
||||
* @brief Set mode of energy meter, stored in NVS
|
||||
*
|
||||
* @param mode
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t meter_set_model(meter_model_t mode);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Start energy meter session, if not started
|
||||
*
|
||||
*/
|
||||
void energy_meter_start_session(void);
|
||||
|
||||
/**
|
||||
* @brief Stop energy meter session, if not stopped
|
||||
*
|
||||
*/
|
||||
void energy_meter_stop_session(void);
|
||||
|
||||
/**
|
||||
* @brief Process energy meter
|
||||
*
|
||||
* @param charging
|
||||
* @param charging_current
|
||||
*/
|
||||
void energy_meter_process(bool charging, uint16_t charging_current);
|
||||
|
||||
/**
|
||||
* @brief Get session actual power
|
||||
*
|
||||
* @return Power in W
|
||||
*/
|
||||
uint32_t energy_meter_get_power(void);
|
||||
|
||||
/**
|
||||
* @brief Get session time
|
||||
*
|
||||
* @return Time in s
|
||||
*/
|
||||
uint32_t energy_meter_get_session_time(void);
|
||||
|
||||
/**
|
||||
* @brief Get charging time
|
||||
*
|
||||
* @return Time in s
|
||||
*/
|
||||
uint32_t energy_meter_get_charging_time(void);
|
||||
|
||||
/**
|
||||
* @brief Get session consumption
|
||||
*
|
||||
* @return Consumption in Wh
|
||||
*/
|
||||
uint32_t energy_meter_get_consumption(void);
|
||||
|
||||
/**
|
||||
* @brief After energy_meter_process, get current measured voltage
|
||||
*
|
||||
* @param voltage Output array of 3 items, values in V
|
||||
*/
|
||||
void energy_meter_get_voltage(float *voltage);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured voltage on L1
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l1_voltage(void);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured voltage on L2
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l2_voltage(void);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured voltage on L3
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l3_voltage(void);
|
||||
|
||||
/**
|
||||
* @brief After energy_meter_process, get current measured current
|
||||
*
|
||||
* @param voltage Output array of 3 items, values in A
|
||||
*/
|
||||
void energy_meter_get_current(float *current);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured current on L1
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l1_current(void);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured current on L2
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l2_current(void);
|
||||
|
||||
/**
|
||||
* @brief Cet current measured current on L3
|
||||
*
|
||||
* @return Voltage in V
|
||||
*/
|
||||
float energy_meter_get_l3_current(void);
|
||||
|
||||
/**
|
||||
* @brief Serialize to string
|
||||
*
|
||||
* @param mode
|
||||
* @return const char*
|
||||
*/
|
||||
const char *meter_model_to_str(meter_model_t mode);
|
||||
|
||||
/**
|
||||
* @brief Parse from string
|
||||
*
|
||||
* @param str
|
||||
* @return meter_model_t
|
||||
*/
|
||||
meter_model_t meter_str_to_model(const char *str);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Serialize to string
|
||||
*
|
||||
* @param mode
|
||||
* @return const char*
|
||||
*/
|
||||
const char *meter_state_to_str(bool state);
|
||||
|
||||
|
||||
#endif /* ENERGY_METER_H_ */
|
||||
53
components/peripherals/include/led.h
Executable file
53
components/peripherals/include/led.h
Executable file
@@ -0,0 +1,53 @@
|
||||
#ifndef LED_H_
|
||||
#define LED_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* @brief Identificadores dos LEDs disponíveis no hardware
|
||||
*/
|
||||
typedef enum {
|
||||
LED_ID_STOP,
|
||||
LED_ID_CHARGING,
|
||||
LED_ID_ERROR,
|
||||
LED_ID_MAX
|
||||
} led_id_t;
|
||||
|
||||
/**
|
||||
* @brief Padrões de comportamento possíveis para os LEDs
|
||||
*/
|
||||
typedef enum {
|
||||
LED_PATTERN_OFF, ///< LED sempre desligado
|
||||
LED_PATTERN_ON, ///< LED sempre ligado
|
||||
LED_PATTERN_BLINK, ///< Pisca com ciclo padrão (500ms on / 500ms off)
|
||||
LED_PATTERN_BLINK_FAST, ///< Pisca rápido (200ms / 200ms)
|
||||
LED_PATTERN_BLINK_SLOW, ///< Pisca lento (300ms / 1700ms)
|
||||
LED_PATTERN_CHARGING_EFFECT ///< Efeito visual para carregamento (2s on / 1s off)
|
||||
} led_pattern_t;
|
||||
|
||||
/**
|
||||
* @brief Inicializa os LEDs com base na configuração da placa
|
||||
* Deve ser chamada uma única vez na inicialização do sistema.
|
||||
*/
|
||||
void led_init(void);
|
||||
|
||||
/**
|
||||
* @brief Define diretamente o tempo ligado/desligado de um LED.
|
||||
* Pode ser usado para padrões personalizados.
|
||||
*
|
||||
* @param led_id Identificador do LED (ver enum led_id_t)
|
||||
* @param ontime Tempo ligado em milissegundos
|
||||
* @param offtime Tempo desligado em milissegundos
|
||||
*/
|
||||
void led_set_state(led_id_t led_id, uint16_t ontime, uint16_t offtime);
|
||||
|
||||
/**
|
||||
* @brief Aplica um dos padrões de piscar definidos ao LED
|
||||
*
|
||||
* @param led_id Identificador do LED (ver enum led_id_t)
|
||||
* @param pattern Padrão desejado (ver enum led_pattern_t)
|
||||
*/
|
||||
void led_apply_pattern(led_id_t led_id, led_pattern_t pattern);
|
||||
|
||||
#endif /* LED_H_ */
|
||||
83
components/peripherals/include/lm75a.h
Normal file
83
components/peripherals/include/lm75a.h
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef LM75A_H
|
||||
#define LM75A_H
|
||||
|
||||
#include "esp_err.h" // Para o uso de tipos de erro do ESP-IDF, caso esteja utilizando.
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Inicializa o sensor LM75A.
|
||||
*
|
||||
* Configura o sensor para leitura e define os pinos de comunicação.
|
||||
*/
|
||||
esp_err_t lm75a_init(void);
|
||||
|
||||
/**
|
||||
* @brief Desinicializa o sensor LM75A.
|
||||
*
|
||||
* Libera os recursos usados pelo sensor.
|
||||
*/
|
||||
esp_err_t lm75a_deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Lê a temperatura do LM75A.
|
||||
*
|
||||
* @param show Se for 1, a temperatura será exibida em algum tipo de log ou interface.
|
||||
* Se for 0, o valor é apenas retornado sem exibição.
|
||||
* @return A temperatura lida em graus Celsius.
|
||||
*/
|
||||
float lm75a_read_temperature(int show);
|
||||
|
||||
/**
|
||||
* @brief Define o valor do limite de temperatura (T_OS) para o sensor LM75A.
|
||||
*
|
||||
* @param tos O limite de temperatura de sobrecarga (T_OS) em graus Celsius.
|
||||
* @return ESP_OK em caso de sucesso ou código de erro se falhar.
|
||||
*/
|
||||
esp_err_t lm75a_set_tos(int tos);
|
||||
|
||||
/**
|
||||
* @brief Define o valor do limite de temperatura de histerese (T_HYS) para o sensor LM75A.
|
||||
*
|
||||
* @param thys O limite de histerese de temperatura (T_HYS) em graus Celsius.
|
||||
* @return ESP_OK em caso de sucesso ou código de erro se falhar.
|
||||
*/
|
||||
esp_err_t lm75a_set_thys(int thys);
|
||||
|
||||
/**
|
||||
* @brief Obtém o limite de temperatura de sobrecarga (T_OS) do sensor LM75A.
|
||||
*
|
||||
* @return O valor atual de T_OS em graus Celsius.
|
||||
*/
|
||||
int lm75a_get_tos(void);
|
||||
|
||||
/**
|
||||
* @brief Obtém o limite de temperatura de histerese (T_HYS) do sensor LM75A.
|
||||
*
|
||||
* @return O valor atual de T_HYS em graus Celsius.
|
||||
*/
|
||||
int lm75a_get_thys(void);
|
||||
|
||||
/**
|
||||
* @brief Habilita ou desabilita a interrupção do LM75A.
|
||||
*
|
||||
* @param en 1 para habilitar a interrupção, 0 para desabilitar.
|
||||
* @return ESP_OK em caso de sucesso ou código de erro se falhar.
|
||||
*/
|
||||
esp_err_t lm75a_set_int(int en);
|
||||
|
||||
/**
|
||||
* @brief Obtém o estado do pino OS (Overtemperature Shutdown) do LM75A.
|
||||
*
|
||||
* @return 1 se o pino OS estiver ativo (indica que a temperatura de sobrecarga foi atingida),
|
||||
* 0 caso contrário.
|
||||
*/
|
||||
int lm75a_get_osio(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LM75A_H */
|
||||
17
components/peripherals/include/ntc_sensor.h
Executable file
17
components/peripherals/include/ntc_sensor.h
Executable file
@@ -0,0 +1,17 @@
|
||||
#ifndef NTC_SENSOR_H_
|
||||
#define NTC_SENSOR_H_
|
||||
|
||||
/**
|
||||
* @brief Initialize ntc senso
|
||||
*
|
||||
*/
|
||||
void ntc_sensor_init(void);
|
||||
|
||||
/**
|
||||
* @brief Return temperature after temp_sensor_measure
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
float ntc_temp_sensor(void);
|
||||
|
||||
#endif /* NTC_SENSOR_H_ */
|
||||
6
components/peripherals/include/peripherals.h
Executable file
6
components/peripherals/include/peripherals.h
Executable file
@@ -0,0 +1,6 @@
|
||||
#ifndef PERIPHERALS_H
|
||||
#define PERIPHERALS_H
|
||||
|
||||
void peripherals_init(void);
|
||||
|
||||
#endif /* PERIPHERALS_H */
|
||||
69
components/peripherals/include/pilot.h
Executable file
69
components/peripherals/include/pilot.h
Executable file
@@ -0,0 +1,69 @@
|
||||
#ifndef PILOT_H_
|
||||
#define PILOT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Níveis categóricos de tensão no sinal CP (Control Pilot)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
PILOT_VOLTAGE_12, ///< Estado A: +12V
|
||||
PILOT_VOLTAGE_9, ///< Estado B: +9V
|
||||
PILOT_VOLTAGE_6, ///< Estado C: +6V
|
||||
PILOT_VOLTAGE_3, ///< Estado D: +3V
|
||||
PILOT_VOLTAGE_1 ///< Estado E/F: abaixo de 3V
|
||||
} pilot_voltage_t;
|
||||
|
||||
/**
|
||||
* @brief Inicializa o driver do sinal Pilot
|
||||
*/
|
||||
void pilot_init(void);
|
||||
|
||||
/**
|
||||
* @brief Define o nível do Pilot: +12V ou -12V
|
||||
*
|
||||
* @param level true = +12V, false = -12V
|
||||
*/
|
||||
void pilot_set_level(bool level);
|
||||
|
||||
/**
|
||||
* @brief Ativa o PWM do Pilot com corrente limitada
|
||||
*
|
||||
* @param amps Corrente em décimos de ampère (ex: 160 = 16A)
|
||||
*/
|
||||
void pilot_set_amps(uint16_t amps);
|
||||
|
||||
/**
|
||||
* @brief Mede o nível de tensão do Pilot e detecta -12V
|
||||
*
|
||||
* @param up_voltage Valor categórico da tensão positiva
|
||||
* @param down_voltage_n12 true se o nível negativo atingir -12V
|
||||
*/
|
||||
void pilot_measure(pilot_voltage_t *up_voltage, bool *down_voltage_n12);
|
||||
|
||||
/**
|
||||
* @brief Retorna o estado lógico atual do Pilot (nível alto = +12V)
|
||||
*
|
||||
* @return true se nível atual for +12V, false se for -12V
|
||||
*/
|
||||
bool pilot_get_state(void);
|
||||
|
||||
/**
|
||||
* @brief Cache interno opcional dos níveis de tensão reais do Pilot
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t high_mv; ///< Pico positivo medido (mV)
|
||||
uint16_t low_mv; ///< Pico negativo medido (mV)
|
||||
} pilot_voltage_cache_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PILOT_H_ */
|
||||
19
components/peripherals/include/proximity.h
Executable file
19
components/peripherals/include/proximity.h
Executable file
@@ -0,0 +1,19 @@
|
||||
#ifndef PROXIMITY_H_
|
||||
#define PROXIMITY_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Initialize proximity check
|
||||
*
|
||||
*/
|
||||
void proximity_init(void);
|
||||
|
||||
/**
|
||||
* @brief Return measured value of max current on PP
|
||||
*
|
||||
* @return current in A
|
||||
*/
|
||||
uint8_t proximity_get_max_current(void);
|
||||
|
||||
#endif /* PROXIMITY_H_ */
|
||||
28
components/peripherals/include/rcm.h
Executable file
28
components/peripherals/include/rcm.h
Executable file
@@ -0,0 +1,28 @@
|
||||
#ifndef RCM_H_
|
||||
#define RCM_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* @brief Initialize residual current monitor
|
||||
*
|
||||
*/
|
||||
void rcm_init(void);
|
||||
|
||||
/**
|
||||
* @brief Test residual current monitor
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool rcm_test(void);
|
||||
|
||||
/**
|
||||
* @brief Residual current monitor was detected leakage
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool rcm_is_triggered(void);
|
||||
|
||||
#endif /* RCM_H_ */
|
||||
94
components/peripherals/include/socket_lock.h
Executable file
94
components/peripherals/include/socket_lock.h
Executable file
@@ -0,0 +1,94 @@
|
||||
#ifndef SOCKED_LOCK_H_
|
||||
#define SOCKED_LOCK_H_
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SOCKED_LOCK_STATUS_IDLE,
|
||||
SOCKED_LOCK_STATUS_OPERATING,
|
||||
SOCKED_LOCK_STATUS_LOCKING_FAIL,
|
||||
SOCKED_LOCK_STATUS_UNLOCKING_FAIL
|
||||
} socket_lock_status_t;
|
||||
|
||||
/**
|
||||
* @brief Initialize socket lock
|
||||
*
|
||||
*/
|
||||
void socket_lock_init(void);
|
||||
|
||||
/**
|
||||
* @brief Get socket lock detection on high, stored in NVS
|
||||
*
|
||||
* @return true when locked has zero resistance
|
||||
* @return false when unlocked has zero resistance
|
||||
*/
|
||||
bool socket_lock_is_detection_high(void);
|
||||
|
||||
/**
|
||||
* @brief Set socket lock detection on high, stored in NVS
|
||||
*
|
||||
* @param detection_high
|
||||
*/
|
||||
void socket_lock_set_detection_high(bool detection_high);
|
||||
|
||||
/**
|
||||
* @brief Get socket lock operating time
|
||||
*
|
||||
* @return time in ms
|
||||
*/
|
||||
uint16_t socket_lock_get_operating_time(void);
|
||||
|
||||
/**
|
||||
* @brief Set socket lock operating time
|
||||
*
|
||||
* @param operating_time - time in ms
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t socket_lock_set_operating_time(uint16_t operating_time);
|
||||
|
||||
/**
|
||||
* @brief Get socket lock retry count
|
||||
*
|
||||
* @return retry count
|
||||
*/
|
||||
uint8_t socket_lock_get_retry_count(void);
|
||||
|
||||
/**
|
||||
* @brief Set socket lock retry count
|
||||
*
|
||||
* @param retry_count
|
||||
*/
|
||||
void socket_lock_set_retry_count(uint8_t retry_count);
|
||||
|
||||
/**
|
||||
* @brief Get socket lock break time
|
||||
*
|
||||
* @return time in ms
|
||||
*/
|
||||
uint16_t socket_lock_get_break_time(void);
|
||||
|
||||
/**
|
||||
* @brief Set socket lock break time
|
||||
*
|
||||
* @param break_time
|
||||
* @return esp_err_t
|
||||
*/
|
||||
esp_err_t socket_lock_set_break_time(uint16_t break_time);
|
||||
|
||||
/**
|
||||
* @brief Set socke lock to locked / unlocked state
|
||||
*
|
||||
* @param locked
|
||||
*/
|
||||
void socket_lock_set_locked(bool locked);
|
||||
|
||||
/**
|
||||
* @brief Get socket lock status
|
||||
*
|
||||
* @return socket_lock_status_t
|
||||
*/
|
||||
socket_lock_status_t socket_lock_get_status(void);
|
||||
|
||||
|
||||
#endif /* SOCKED_LOCK_H_ */
|
||||
41
components/peripherals/include/temp_sensor.h
Normal file
41
components/peripherals/include/temp_sensor.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef TEMP_SENSOR_H_
|
||||
#define TEMP_SENSOR_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize DS18S20 temperature sensor bus
|
||||
*
|
||||
*/
|
||||
void temp_sensor_init(void);
|
||||
|
||||
/**
|
||||
* @brief Get found sensor count
|
||||
*
|
||||
* @return uint8_t
|
||||
*/
|
||||
uint8_t temp_sensor_get_count(void);
|
||||
|
||||
/**
|
||||
* @brief Return lowest temperature after temp_sensor_measure
|
||||
*
|
||||
* @return int16_t
|
||||
*/
|
||||
int16_t temp_sensor_get_low(void);
|
||||
|
||||
/**
|
||||
* @brief Return highest temperature after temp_sensor_measure
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int temp_sensor_get_high(void);
|
||||
|
||||
/**
|
||||
* @brief Return temperature sensor error
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
bool temp_sensor_is_error(void);
|
||||
|
||||
#endif /* TEMP_SENSOR_H_ */
|
||||
Reference in New Issue
Block a user