SBB Micro
Source code for the self-balancing-bike microcontroller unit (Teensy 4.1-based). 🚀️
|
Settings for the buses. More...
Macros | |
#define | USED_SPI SPI1 |
Used SPI for sensor IO bus. | |
#define | SPISPEED_IMU 10e6 |
Speed of IMU SPI, max is 10e6. | |
#define | SPISPEED_MAG 10e6 |
Speed of MAG SPI, max is 10e6. | |
#define | SPISPEED_DAC 10e6 |
Speed of MAG SPI, max is 20e6. | |
#define | UART_SPEEDSENS Serial7 |
Used UART for speed sensor bus. | |
#define | BAUD_SPEEDSENS 4e6 |
Baudrate of the UART for speed sensor bus. | |
#define | UART_GPS Serial2 |
Used UART for GPS sensor bus. | |
#define | BAUD_GPS_DEF 9600 |
Default baudrate of GPS sensor (for init only). | |
#define | BAUD_GPS 57600 |
Actual baudrate of GPS sensor. | |
#define | GPS_EXTBUFSIZE 128 |
Extra buffer size for GPS sensor UART. | |
#define | UART_SBUS Serial8 |
Used UART for SBUS communication. /details The UART used for the SBUS receiver. This runs with a baudrate of 100000. Initialization and setting is performed by the SBUS library. | |
#define | ADC_RES 12 |
ADC resolution (in bits). | |
#define | ADC_AVERAGE 8 |
ADC averaging 1/2/8/16 (samples). The more the averaging, the less the noise, but the more the reading time. | |
#define | DAC_RES 12 |
DAC resolution (in bits). | |
#define | DAC_MTR_CH 0 |
DAC channel for motor control. | |
#define | DAC_THROTTLE_CH 1 |
DAC channel for throttle control. | |
#define | PWM_RES 12 |
PWM resolution in bit (max is 14). | |
#define | PWM_FREQ 5e3 |
PWM frequency (max is 5kHz). | |
#define | PWM_MIN 0.1F |
Minimum PWM value for motor current reference. | |
#define | PWM_MAX 0.9F |
Maximum PWM value for motor current reference. | |
Settings for the buses.
Settings of the used buses for the communications with sensorsaand drivers. This includes defines for the SPI and UART(s) used for the sensors, settings for the ADCs, DACs, and PWM.
#define ADC_AVERAGE 8 |
ADC averaging 1/2/8/16 (samples). The more the averaging, the less the noise, but the more the reading time.
#define ADC_RES 12 |
ADC resolution (in bits).
#define BAUD_GPS 57600 |
Actual baudrate of GPS sensor.
#define BAUD_GPS_DEF 9600 |
Default baudrate of GPS sensor (for init only).
#define BAUD_SPEEDSENS 4e6 |
Baudrate of the UART for speed sensor bus.
#define DAC_MTR_CH 0 |
DAC channel for motor control.
#define DAC_RES 12 |
DAC resolution (in bits).
#define DAC_THROTTLE_CH 1 |
DAC channel for throttle control.
#define GPS_EXTBUFSIZE 128 |
Extra buffer size for GPS sensor UART.
#define PWM_FREQ 5e3 |
PWM frequency (max is 5kHz).
#define PWM_MAX 0.9F |
Maximum PWM value for motor current reference.
#define PWM_MIN 0.1F |
Minimum PWM value for motor current reference.
#define PWM_RES 12 |
PWM resolution in bit (max is 14).
#define SPISPEED_DAC 10e6 |
Speed of MAG SPI, max is 20e6.
#define SPISPEED_IMU 10e6 |
Speed of IMU SPI, max is 10e6.
#define SPISPEED_MAG 10e6 |
Speed of MAG SPI, max is 10e6.
#define UART_GPS Serial2 |
Used UART for GPS sensor bus.
#define UART_SBUS Serial8 |
Used UART for SBUS communication. /details The UART used for the SBUS receiver. This runs with a baudrate of 100000. Initialization and setting is performed by the SBUS library.
#define UART_SPEEDSENS Serial7 |
Used UART for speed sensor bus.
#define USED_SPI SPI1 |
Used SPI for sensor IO bus.