mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 19:37:45 +08:00
add new drv but not benefit stm32h723vg
This commit is contained in:
31
User_Code/module/periph/imu/BMI088/BMI088Middleware.c
Normal file
31
User_Code/module/periph/imu/BMI088/BMI088Middleware.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "BMI088Middleware.h"
|
||||
#include "main.h"
|
||||
|
||||
SPI_HandleTypeDef *BMI088_SPI;
|
||||
|
||||
void BMI088_ACCEL_NS_L(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(ACC_CS_GPIO_Port, ACC_CS_Pin, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void BMI088_ACCEL_NS_H(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(ACC_CS_GPIO_Port, ACC_CS_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void BMI088_GYRO_NS_L(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(GYRO_CS_GPIO_Port, GYRO_CS_Pin, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void BMI088_GYRO_NS_H(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(GYRO_CS_GPIO_Port, GYRO_CS_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
uint8_t BMI088_read_write_byte(uint8_t txdata)
|
||||
{
|
||||
uint8_t rx_data;
|
||||
HAL_SPI_TransmitReceive(BMI088_SPI, &txdata, &rx_data, 1, 100); //1000or100?
|
||||
return rx_data;
|
||||
}
|
||||
Reference in New Issue
Block a user