Major UART communication improvement

- the UART communication is improved based on UART Idle line detection interrupt
- both Tx and Rx are efficiently handled using DMA

Other:
- minor visual improvements
This commit is contained in:
EmanuelFeru
2020-06-21 23:07:01 +02:00
parent e9d74bea29
commit 1e7bf7cd90
11 changed files with 312 additions and 183 deletions

View File

@@ -51,6 +51,41 @@ void consoleLog(char *message);
void toggle_led(uint32_t gpio_periph, uint32_t pin);
void intro_demo_led(uint32_t tDelay);
/* input initialization function */
void input_init(void);
/* usart read functions */
void usart_rx_check(void);
#ifdef SERIAL_DEBUG
void usart_process_debug(uint8_t *userCommand, uint32_t len);
#endif
#ifdef SERIAL_CONTROL
typedef struct{
uint16_t start;
int16_t roll;
int16_t pitch;
int16_t yaw;
uint16_t sensors;
uint16_t checksum;
} SerialSideboard;
#endif
#ifdef SERIAL_FEEDBACK
typedef struct{
uint16_t start;
int16_t cmd1;
int16_t cmd2;
int16_t speedR_meas;
int16_t speedL_meas;
int16_t batVoltage;
int16_t boardTemp;
uint16_t cmdLed;
uint16_t checksum;
} SerialFeedback;
void usart_process_data(SerialFeedback *Feedback_in, SerialFeedback *Feedback_out);
#endif
/* i2c write/read functions */
int8_t i2c_writeBytes(uint8_t slaveAddr, uint8_t regAddr, uint8_t length, uint8_t *data);
int8_t i2c_writeByte (uint8_t slaveAddr, uint8_t regAddr, uint8_t data);