[X-LiteS] Gyro added

This commit is contained in:
Bertrand Songis
2019-04-02 20:12:50 +02:00
parent b967d5b08a
commit a13ee14bbb
18 changed files with 468 additions and 318 deletions
+11 -7
View File
@@ -143,13 +143,17 @@ elseif(PCB STREQUAL XLITES)
set(STATUS_LEDS YES)
endif()
#if(PCB STREQUAL XLITES)
# add_definitions(-DGYRO)
# set(TARGET_SRC
# ${TARGET_SRC}
# ../common/arm/stm32/lsm6ds3_driver.cpp
# )
#endif()
if(PCB STREQUAL XLITES)
add_definitions(-DGYRO)
set(TARGET_SRC
${TARGET_SRC}
../common/arm/stm32/lsm6ds3_driver.cpp
)
set(SRC
${SRC}
gyro.cpp
)
endif()
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR PCB STREQUAL X3)
option(PXX1 "PXX1 protocol support" OFF)
+5
View File
@@ -290,6 +290,11 @@ void boardInit()
initHeadphoneTrainerSwitch();
vbattRTC = getRTCBattVoltage();
#if defined(GYRO)
gyroInit();
#endif
#endif // !defined(SIMU)
}
+6
View File
@@ -805,4 +805,10 @@ extern Fifo<uint8_t, TELEMETRY_FIFO_SIZE> telemetryFifo;
extern DMAFifo<32> serial2RxFifo;
#endif
// Gyro driver
#define GYRO_VALUES_COUNT 6
#define GYRO_BUFFER_LENGTH (GYRO_VALUES_COUNT * sizeof(int16_t))
int gyroInit();
int gyroRead(uint8_t buffer[GYRO_BUFFER_LENGTH]);
#endif // _BOARD_H_