aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/esp8266.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-29 18:01:56 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-29 18:01:56 +0200
commit9e9ea9d07ed2a176d6f6e83b5b100da22d8fca50 (patch)
treea683bde4664dad75c3b5a1efbd4223a4ab3b40dd /stm32f091/esp8266.h
parentead710db271795380207141f0add7278ba12ada0 (diff)
parentaae57dc32a843351fb2e17721afcd841bedec0a6 (diff)
Merge branch 'protocol' into dev
Diffstat (limited to 'stm32f091/esp8266.h')
-rw-r--r--stm32f091/esp8266.h44
1 files changed, 33 insertions, 11 deletions
diff --git a/stm32f091/esp8266.h b/stm32f091/esp8266.h
index c09a557..94a7356 100644
--- a/stm32f091/esp8266.h
+++ b/stm32f091/esp8266.h
@@ -1,16 +1,38 @@
#pragma once
+#include <stm32f0xx_hal.h>
+#include <stdlib.h>
#include <stdint.h>
+#include <stdbool.h>
-void ws_esp8266_ATsendCommand(uint8_t* data);
-int ws_esp8266_checkOK(uint8_t *receiveData,int length);
-int ws_esp8266_receivingMsg(uint8_t *receiveData,int length);
-int ws_esp8266_unlink(uint8_t *receiveData,int length);
-void ws_esp8266_StartEsp();
-void ws_esp8266_disconnect();
-void ws_esp8266_mode();
+#include "consts.h"
+
+/** @brief DMA rx buffer */
+extern uint8_t g_ws_esp8266_dma_rx_buffer[WS_DMA_RX_BUFFER_SIZE];
+/** @brief null-terminated tx buffer string */
+extern uint8_t g_ws_esp8266_dma_tx_buffer[WS_DMA_TX_BUFFER_SIZE];
+
+/** @brief DMA1 channel 2-3 & DMA2 channel 1-2 interrupt handler */
+void DMA1_Ch2_3_DMA2_Ch1_2_IRQHandler(void);
+/** @brief DMA1 channel 1 interrupt handler */
+void DMA1_Ch1_IRQHandler(void);
+/** @brief USART1 interrupt handler */
+void USART1_IRQHandler(void);
+
+/** @brief send data to esp over uart with dma */
+void ws_esp8266_send(uint8_t* data, size_t size);
+
+/** @brief line idle, handle new data on dma buffer */
+void ws_esp8266_incoming_data_chunk();
+
+/** @brief connect to access point using wifi.h credentials */
void ws_esp8266_connect();
-void ws_esp8266_serveraan();
-void ws_esp8266_serveruit();
-void ws_esp8266_mux();
-void ws_esp8266_close();
+/** @brief set esp to access point client mode (connect to AP, not become one) */
+void ws_esp8266_ap_client_mode();
+/** @brief initialize and configure the tcp server */
+void ws_esp8266_start_tcp_server();
+
+/** @brief set mac address of the esp client */
+void ws_esp8266_set_mac();
+/** @brief set static ip address of the esp client */
+void ws_esp8266_set_ip();