ESP32-Mesh-OTA/main/Blinky_LED.h

41 lines
840 B
C
Raw Normal View History

2021-01-16 00:23:02 +01:00
#ifndef H_BLINKY_LED
#define H_BLINKY_LED
#include <string.h>
#include "esp_wifi.h"
#include "esp_system.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "Mesh_OTA.h"
2021-01-16 18:23:10 +01:00
#define GPIO_BOOT_BTN 0 //GPIO0 (Boot BTN)
#define GPIO_LED 2 //GPIO2 (internal blue LED in DevKit V1.0)
#define GPIO_INPUT_PIN_SEL (1ULL<<GPIO_BOOT_BTN)
struct blinky_packet
{
enum blinky_packet_type
{
LED_OFF,
LED_ON,
} type;
mesh_addr_t meshSenderAddr; //stores addr of sender of this packet
2021-01-16 00:23:02 +01:00
};
2021-01-16 18:23:10 +01:00
typedef struct blinky_packet BLINKY_PACKET_t;
2021-01-16 00:23:02 +01:00
esp_err_t errBlinkyLEDInitialize();
void vGPIOInitialize();
2021-01-16 18:23:10 +01:00
void rxHandle(uint8_t* pu8Data, uint8_t* pu8Sender);
2021-01-16 00:23:02 +01:00
void vTaskReadUserInput(void *arg);
void vTaskReceiveData(void *arg);
#endif /* H_BLINKY_LED */
2021-01-16 18:23:10 +01:00