Files
chargeflow/components/led/include/ledc_driver.h
2025-12-09 11:48:31 +00:00

35 lines
938 B
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <stdint.h>
#include "esp_err.h"
#include "driver/gpio.h"
/**
* @brief Inicializa o controlador LEDC para os 3 LEDs (R,G,B)
*
* @param gpio_red GPIO ligado ao LED vermelho (via ULN2003)
* @param gpio_green GPIO ligado ao LED verde (via ULN2003)
* @param gpio_blue GPIO ligado ao LED azul (via ULN2003)
*
* @return ESP_OK em sucesso, erro caso contrário
*/
esp_err_t ledc_init(gpio_num_t gpio_red,
gpio_num_t gpio_green,
gpio_num_t gpio_blue);
/**
* @brief Define a intensidade RGB (0255 por cor)
*
* @param red Intensidade do vermelho (0255)
* @param green Intensidade do verde (0255)
* @param blue Intensidade do azul (0255)
*
* @return ESP_OK em sucesso, erro caso contrário
*/
esp_err_t ledc_set_rgb(uint32_t red, uint32_t green, uint32_t blue);
/**
* @brief Desliga todos os LEDs (R,G,B)
*/
esp_err_t ledc_clear(void);