Mercurial > public > ostc4
comparison Small_CPU/Inc/uart.h @ 916:4832981f9af8 Evo_2_23
External sensor UART: Switch to DMA TX transfers:
The previous version used polling tx function to transfer data. Because of the short command length of the protocols supported this was no big issue. New protocolls (like GNSS) have longer command sequence which have an impact to the program flow. That's why the implementation has been changed to DMA transmission.
author | Ideenmodellierer |
---|---|
date | Mon, 28 Oct 2024 20:34:58 +0100 |
parents | 651d21777b61 |
children | f72613a152dd |
comparison
equal
deleted
inserted
replaced
915:ff318ae65dd0 | 916:4832981f9af8 |
---|---|
23 #endif | 23 #endif |
24 | 24 |
25 #include "stm32f4xx_hal.h" | 25 #include "stm32f4xx_hal.h" |
26 | 26 |
27 | 27 |
28 #define BUFFER_NODATA (7u) /* The read function needs a byte which indicated that no data for processing is available.*/ | 28 #define BUFFER_NODATA_LOW ('~') /* The read function needs a signiture which indicates that no data for processing is available.*/ |
29 /* This byte shall never appear in a normal data steam */ | 29 #define BUFFER_NODATA_HIGH (0xA5) |
30 | 30 |
31 | 31 |
32 UART_HandleTypeDef huart1, huart6; | 32 UART_HandleTypeDef huart1, huart6; |
33 | 33 |
34 void MX_USART1_UART_Init(void); | 34 void MX_USART1_UART_Init(void); |
44 void UART_StartDMA_Receiption(void); | 44 void UART_StartDMA_Receiption(void); |
45 #ifdef ENABLE_CO2_SUPPORT | 45 #ifdef ENABLE_CO2_SUPPORT |
46 void UART_HandleCO2Data(void); | 46 void UART_HandleCO2Data(void); |
47 void DigitalCO2_SendCmd(uint8_t CO2Cmd, uint8_t *cmdString, uint8_t *cmdLength); | 47 void DigitalCO2_SendCmd(uint8_t CO2Cmd, uint8_t *cmdString, uint8_t *cmdLength); |
48 #endif | 48 #endif |
49 | |
50 #ifdef ENABLE_GNSS_SUPPORT | |
51 void UART_HandleGnssData(void); | |
52 #endif | |
49 #ifdef ENABLE_SENTINEL_MODE | 53 #ifdef ENABLE_SENTINEL_MODE |
50 void UART_HandleSentinelData(void); | 54 void UART_HandleSentinelData(void); |
51 #endif | 55 #endif |
52 uint8_t UART_isCO2Connected(); | 56 uint8_t UART_isCO2Connected(); |
53 uint8_t UART_isSentinelConnected(); | 57 uint8_t UART_isSentinelConnected(); |
54 void UART_setTargetChannel(uint8_t channel); | 58 void UART_setTargetChannel(uint8_t channel); |
55 void UART_MUX_SelectAddress(uint8_t muxAddress); | 59 void UART_MUX_SelectAddress(uint8_t muxAddress); |
56 void UART_SendCmdString(uint8_t *cmdString); | 60 void UART_SendCmdString(uint8_t *cmdString); |
61 void UART_SendCmdUbx(uint8_t *cmd, uint8_t len); | |
57 void UART_ReadData(uint8_t sensorType); | 62 void UART_ReadData(uint8_t sensorType); |
63 void UART_WriteData(void); | |
58 void UART_FlushRxBuffer(void); | 64 void UART_FlushRxBuffer(void); |
59 void UART_ChangeBaudrate(uint32_t newBaudrate); | 65 void UART_ChangeBaudrate(uint32_t newBaudrate); |
60 uint8_t UART_isComActive(uint8_t sensorId); | 66 uint8_t UART_isComActive(uint8_t sensorId); |
61 | 67 |
62 void StringToInt(char *pstr, uint32_t *puInt32); | 68 void StringToInt(char *pstr, uint32_t *puInt32); |