12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef __HAL_UART4_H
- #define __HAL_UART4_H
- #include <stdint.h>
- #ifdef __cplusplus
- extern 'C'
- {
- #endif
- #ifdef __HAL_UART4_H_GLOBAL
- #define __HAL_UART4_H_EXTERN
- #else
- #define __HAL_UART4_H_EXTERN extern
- #endif
- /************************************************************************************************
- * Version *
- ************************************************************************************************/
- /************************************************************************************************
- * How to use *
- ************************************************************************************************/
- /************************************************************************************************
- * Enable config *
- ************************************************************************************************/
- /************************************************************************************************
- * Includes *
- ************************************************************************************************/
- #include "stm32f4xx.h"
- /************************************************************************************************
- * Defines *
- ************************************************************************************************/
- #define RX_TX_BUF_LEN (50)
- typedef struct
- {
- uint8_t rx[RX_TX_BUF_LEN];
- uint8_t tx[RX_TX_BUF_LEN];
- uint8_t rx_len;
- uint8_t tx_len;
- uint8_t rx_count_u8;
- uint8_t tx_count_u8;
- uint8_t device_type;
- uint8_t rx_finished_flg;
- uint8_t disconnect_flg;
- uint8_t rx_over_time;
- uint8_t rx_over_time_count;
- uint16_t disconnect_count;
- } uart_type;
- extern uart_type uart_msg;
- void hal_uart4_init(void);
- void uart4_rx_ticks(void);
- void uart4_start_send(uart_type * p_msg);
- /************************************************************************************************
- * Defines *
- ************************************************************************************************/
- #ifdef __cplusplus
- };
- #endif
- #endif // __HAL_UART4_H
|