mirror of
https://github.com/EFeru/hoverboard-sideboard-hack-STM.git
synced 2026-01-13 14:36:35 +00:00
Added Hovercar variant
- hovercar variant - iBUS receiver support - updated baud rate to 115200
This commit is contained in:
54
Inc/util.h
54
Inc/util.h
@@ -24,17 +24,19 @@
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/* Rx Structures USART */
|
||||
/* Tx structure USART MAIN */
|
||||
#ifdef SERIAL_CONTROL
|
||||
typedef struct{
|
||||
uint16_t start;
|
||||
int16_t roll;
|
||||
int16_t pitch;
|
||||
int16_t yaw;
|
||||
uint16_t sensors;
|
||||
int16_t pitch; // Angle
|
||||
int16_t dPitch; // Angle derivative
|
||||
int16_t cmd1; // RC Channel 1
|
||||
int16_t cmd2; // RC Channel 2
|
||||
uint16_t sensors; // RC Switches and Optical sideboard sensors
|
||||
uint16_t checksum;
|
||||
} SerialSideboard;
|
||||
#endif
|
||||
/* Rx structure USART MAIN */
|
||||
#ifdef SERIAL_FEEDBACK
|
||||
typedef struct{
|
||||
uint16_t start;
|
||||
@@ -49,17 +51,46 @@ typedef struct{
|
||||
} SerialFeedback;
|
||||
#endif
|
||||
|
||||
/* Tx structure USART AUX */
|
||||
#ifdef SERIAL_AUX_TX
|
||||
typedef struct{
|
||||
uint16_t start;
|
||||
int16_t signal1;
|
||||
int16_t signal2;
|
||||
uint16_t checksum;
|
||||
} SerialAuxTx;
|
||||
#endif
|
||||
/* Rx structure USART AUX */
|
||||
#ifdef SERIAL_AUX_RX
|
||||
#ifdef CONTROL_IBUS
|
||||
typedef struct{
|
||||
uint8_t start;
|
||||
uint8_t type;
|
||||
uint8_t channels[IBUS_NUM_CHANNELS*2];
|
||||
uint8_t checksuml;
|
||||
uint8_t checksumh;
|
||||
} SerialCommand;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* general functions */
|
||||
void consoleLog(char *message);
|
||||
void get_tick_count_ms(unsigned long *count);
|
||||
void intro_demo_led(uint32_t tDelay);
|
||||
uint8_t switch_check(uint16_t ch, uint8_t type);
|
||||
|
||||
/* input initialization function */
|
||||
void input_init(void);
|
||||
void UART_DisableRxErrors(UART_HandleTypeDef *huart);
|
||||
|
||||
/* usart read functions */
|
||||
void usart_rx_check(void);
|
||||
/* handle functions */
|
||||
void handle_mpu6050(void);
|
||||
void handle_sensors(void);
|
||||
void handle_usart(void);
|
||||
void handle_leds(void);
|
||||
|
||||
/* usart2 read functions */
|
||||
void usart2_rx_check(void);
|
||||
#ifdef SERIAL_DEBUG
|
||||
void usart_process_debug(uint8_t *userCommand, uint32_t len);
|
||||
#endif
|
||||
@@ -67,6 +98,15 @@ void usart_process_debug(uint8_t *userCommand, uint32_t len);
|
||||
void usart_process_data(SerialFeedback *Feedback_in, SerialFeedback *Feedback_out);
|
||||
#endif
|
||||
|
||||
/* usart1 read functions */
|
||||
void usart1_rx_check(void);
|
||||
#ifdef SERIAL_AUX_RX
|
||||
void usart_process_command(SerialCommand *command_in, SerialCommand *command_out);
|
||||
#endif
|
||||
|
||||
/* AUX Serial Print data */
|
||||
void aux_print_to_console(void);
|
||||
|
||||
/* 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);
|
||||
|
||||
Reference in New Issue
Block a user