add source code that exists so far
This commit is contained in:
parent
275c84b48f
commit
ef307a24f5
21 changed files with 3276 additions and 0 deletions
12
SourceCode/include/common/theGPIO.h
Normal file
12
SourceCode/include/common/theGPIO.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef GPIO_H
|
||||
#define GPIO_H
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "../network/theWebServer.h"
|
||||
|
||||
esp_err_t relay_put_handler(httpd_req_t *req);
|
||||
|
||||
#endif
|
12
SourceCode/include/common/theLogger.h
Normal file
12
SourceCode/include/common/theLogger.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_spi_flash.h"
|
||||
|
||||
void print_logo();
|
||||
void print_esp32_information();
|
||||
void setup_all_log_levels();
|
||||
|
||||
#endif
|
9
SourceCode/include/common/theNVS.h
Normal file
9
SourceCode/include/common/theNVS.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef NVS_H
|
||||
#define NVS_H
|
||||
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
void setup_nvs(void);
|
||||
|
||||
#endif
|
9
SourceCode/include/common/theSNTP.h
Normal file
9
SourceCode/include/common/theSNTP.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef SNTP_H
|
||||
#define SNTP_H
|
||||
|
||||
#include "esp_sntp.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
void setup_sntp();
|
||||
|
||||
#endif
|
9
SourceCode/include/network/theFirewall.h
Normal file
9
SourceCode/include/network/theFirewall.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef FIREWALL_H
|
||||
#define FIREWALL_H
|
||||
|
||||
#include "theWebServer.h"
|
||||
|
||||
esp_err_t firewall_get_handler(httpd_req_t *req);
|
||||
esp_err_t firewall_post_handler(httpd_req_t *req);
|
||||
|
||||
#endif
|
18
SourceCode/include/network/theWebServer.h
Normal file
18
SourceCode/include/network/theWebServer.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef WEBSERVER_H
|
||||
#define WEBSERVER_H
|
||||
|
||||
#include "esp_system.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_http_server.h"
|
||||
#include "esp_log.h"
|
||||
#include "cJSON.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#include "../common/theGPIO.h"
|
||||
#include "theFirewall.h"
|
||||
|
||||
void custom_json_response(httpd_req_t *req, char *message, char *type);
|
||||
void custom_request_middleware(httpd_req_t *req);
|
||||
void setup_web_server(char *serverIp);
|
||||
|
||||
#endif
|
26
SourceCode/include/network/theWifi.h
Normal file
26
SourceCode/include/network/theWifi.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef WIFI_H
|
||||
#define WIFI_H
|
||||
|
||||
#include "string.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/event_groups.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "secrets.h"
|
||||
|
||||
#define ESP_WIFI_SSID SSID
|
||||
#define ESP_WIFI_PASS PSK
|
||||
|
||||
#define WIFI_CONNECTED_BIT BIT0
|
||||
#define WIFI_FAIL_BIT BIT1
|
||||
|
||||
void setup_wifi(char *serverIp);
|
||||
|
||||
#endif
|
Reference in a new issue