aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/esp8266.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-26 16:20:39 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-26 16:20:39 +0200
commitd945680142d5b16d8809ea200833edd97caec2f8 (patch)
treeba1e23bf440181e8a2c61587b5274877563fe880 /stm32f091/esp8266.h
parente2ae9e96ba05baa389ebc49a65a941bada87e3aa (diff)
esp send with dma in seperate function
Diffstat (limited to 'stm32f091/esp8266.h')
-rw-r--r--stm32f091/esp8266.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/stm32f091/esp8266.h b/stm32f091/esp8266.h
index d18c214..8038679 100644
--- a/stm32f091/esp8266.h
+++ b/stm32f091/esp8266.h
@@ -2,17 +2,28 @@
#include "consts.h"
+#include <stdlib.h>
#include <stdint.h>
-extern char g_ws_esp8266_dma_rx_buffer[WS_DMA_RX_BUFFER_SIZE];
+/** @brief null-terminated rx buffer string */
+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];
-// void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *, uint16_t);
-/** @brief This function handles DMA1 channel 2 to 3 and DMA2 channel 1 to 2 interrupts. */
+/** @brief DMA1 channel 2-3 & DMA2 channel 1-2 interrupt handler */
void DMA1_Ch2_3_DMA2_Ch1_2_IRQHandler(void);
-/** @brief This function handles DMA1 channel 1 interrupt. */
+/** @brief DMA1 channel 1 interrupt handler */
void DMA1_Ch1_IRQHandler(void);
+/** @brief USART1 interrupt handler */
void USART1_IRQHandler(void);
+/** @brief send response to incoming request on specific channel */
+void ws_esp8266_res_send(unsigned int channel, uint8_t* data, size_t size);
+
+/** @brief send data to esp over uart with dma */
+void ws_esp8266_send(uint8_t* data, size_t size);
+
+// TODO: remove/update/document/refactor these functions
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);