Mercurial > public > ostc4
annotate 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 |
rev | line source |
---|---|
38 | 1 /** |
2 ****************************************************************************** | |
3 * @file uart.h | |
4 * @author heinrichs weikamp gmbh | |
5 * @version V0.0.1 | |
6 * @date 27-March-2014 | |
7 * @brief button control | |
8 * | |
9 ****************************************************************************** | |
10 * @attention | |
11 * | |
12 * <h2><center>© COPYRIGHT(c) 2015 heinrichs weikamp</center></h2> | |
13 * | |
14 ****************************************************************************** | |
15 */ | |
16 | |
17 /* Define to prevent recursive inclusion -------------------------------------*/ | |
18 #ifndef UART_H | |
19 #define UART_H | |
20 | |
21 #ifdef __cplusplus | |
22 extern "C" { | |
23 #endif | |
24 | |
25 #include "stm32f4xx_hal.h" | |
26 | |
662 | 27 |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
28 #define BUFFER_NODATA_LOW ('~') /* The read function needs a signiture which indicates that no data for processing is available.*/ |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
29 #define BUFFER_NODATA_HIGH (0xA5) |
794 | 30 |
889 | 31 |
32 UART_HandleTypeDef huart1, huart6; | |
33 | |
662 | 34 void MX_USART1_UART_Init(void); |
35 void MX_USART1_UART_DeInit(void); | |
36 void MX_USART1_DMA_Init(void); | |
889 | 37 |
38 void MX_USART6_UART_Init(void); | |
39 void MX_USART6_DMA_Init(void); | |
890
651d21777b61
cleanup and disable function for GNSS uart and DMA
heinrichsweikamp
parents:
889
diff
changeset
|
40 void MX_USART6_UART_DeInit(void); |
889 | 41 void GNSS_IO_init(void); |
42 | |
38 | 43 uint8_t UART_ButtonAdjust(uint8_t *array); |
742 | 44 void UART_StartDMA_Receiption(void); |
690 | 45 #ifdef ENABLE_CO2_SUPPORT |
729
d646a0f724a7
Added auto detection functionality for sensors connected to the external interface:
Ideenmodellierer
parents:
721
diff
changeset
|
46 void UART_HandleCO2Data(void); |
794 | 47 void DigitalCO2_SendCmd(uint8_t CO2Cmd, uint8_t *cmdString, uint8_t *cmdLength); |
690 | 48 #endif |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
49 |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
50 #ifdef ENABLE_GNSS_SUPPORT |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
51 void UART_HandleGnssData(void); |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
52 #endif |
690 | 53 #ifdef ENABLE_SENTINEL_MODE |
729
d646a0f724a7
Added auto detection functionality for sensors connected to the external interface:
Ideenmodellierer
parents:
721
diff
changeset
|
54 void UART_HandleSentinelData(void); |
690 | 55 #endif |
729
d646a0f724a7
Added auto detection functionality for sensors connected to the external interface:
Ideenmodellierer
parents:
721
diff
changeset
|
56 uint8_t UART_isCO2Connected(); |
742 | 57 uint8_t UART_isSentinelConnected(); |
729
d646a0f724a7
Added auto detection functionality for sensors connected to the external interface:
Ideenmodellierer
parents:
721
diff
changeset
|
58 void UART_setTargetChannel(uint8_t channel); |
794 | 59 void UART_MUX_SelectAddress(uint8_t muxAddress); |
60 void UART_SendCmdString(uint8_t *cmdString); | |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
61 void UART_SendCmdUbx(uint8_t *cmd, uint8_t len); |
794 | 62 void UART_ReadData(uint8_t sensorType); |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
890
diff
changeset
|
63 void UART_WriteData(void); |
794 | 64 void UART_FlushRxBuffer(void); |
798
e9eba334b942
Migrated CO2 protocol implementation to new format:
Ideenmodellierer
parents:
794
diff
changeset
|
65 void UART_ChangeBaudrate(uint32_t newBaudrate); |
861 | 66 uint8_t UART_isComActive(uint8_t sensorId); |
729
d646a0f724a7
Added auto detection functionality for sensors connected to the external interface:
Ideenmodellierer
parents:
721
diff
changeset
|
67 |
794 | 68 void StringToInt(char *pstr, uint32_t *puInt32); |
69 void StringToUInt64(char *pstr, uint64_t *puint64); | |
704
f1b40364b0af
Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents:
690
diff
changeset
|
70 |
38 | 71 #ifdef __cplusplus |
72 } | |
73 #endif | |
74 | |
75 #endif /* UART_H */ | |
76 | |
77 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ |