mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/driver-bmi088.git
synced 2025-09-29 08:37:33 +00:00
Resolved conflicts
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
#include <sta/debug/assert.hpp>
|
||||
|
||||
#include <sta/config.hpp>
|
||||
#ifndef STA_SPATZ_ENABLED
|
||||
|
||||
namespace sta
|
||||
{
|
||||
BMI088::BMI088(Device* gyro_device, Device* accel_device)
|
||||
BMI088::BMI088(SPIDevice* gyro_device, SPIDevice* accel_device)
|
||||
: gyro_device{gyro_device}, accel_device(accel_device)
|
||||
{
|
||||
STA_ASSERT(gyro_device != nullptr);
|
||||
@@ -143,7 +146,7 @@ namespace sta
|
||||
void BMI088::getAcceleration(float* x, float* y, float* z)
|
||||
{
|
||||
uint16_t i_x,i_y,i_z;
|
||||
getRawRotation(&i_x, &i_y, &i_z);
|
||||
getRawAcceleration(&i_x, &i_y, &i_z);
|
||||
convertRawToActual(&i_x, x, f_accel_range);
|
||||
convertRawToActual(&i_y, y, f_accel_range);
|
||||
convertRawToActual(&i_z, z, f_accel_range);
|
||||
@@ -204,3 +207,5 @@ namespace sta
|
||||
}
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_SPATZ_ENABLED
|
103
src/mock.cpp
Normal file
103
src/mock.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
#include <sta/config.hpp>
|
||||
#ifdef STA_SPATZ_ENABLED
|
||||
|
||||
#include <sta/drivers/bmi088.hpp>
|
||||
#include <sta/debug/spatz.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
|
||||
|
||||
#define STA_BMI088_ACC_SPATZ_ID 3
|
||||
#define STA_BMI088_GYRO_SPATZ_ID 4
|
||||
|
||||
namespace sta
|
||||
{
|
||||
BMI088::BMI088(SPIDevice* gyro_device, SPIDevice* accel_device)
|
||||
: gyro_device{gyro_device}, accel_device(accel_device)
|
||||
{
|
||||
STA_ASSERT(gyro_device != nullptr);
|
||||
STA_ASSERT(accel_device != nullptr);
|
||||
}
|
||||
|
||||
bool BMI088::init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void BMI088::setGyroscopeMode(GyroMode mode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::setGyroscopeRange(GyroRange range)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::setGyroscopeBandwidth(GyroBandwidth bandwidth)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::getRawRotation(uint16_t* x, uint16_t* y, uint16_t* z)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::getRotation(float* x, float* y, float* z)
|
||||
{
|
||||
float omegas[3];
|
||||
spatz::request(STA_BMI088_GYRO_SPATZ_ID, omegas, 3);
|
||||
|
||||
*x = omegas[0];
|
||||
*y = omegas[1];
|
||||
*z = omegas[2];
|
||||
}
|
||||
|
||||
|
||||
void BMI088::setAccelerometerMode(AccelMode mode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::setAccelerometerRange(AccelRange range)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::setAccelerometerBandwidth(AccelBandwidth bandwidth, AccelODR odr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::getRawAcceleration(uint16_t* x, uint16_t* y, uint16_t* z)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMI088::getAcceleration(float* x, float* y, float* z)
|
||||
{
|
||||
float acc[3];
|
||||
spatz::request(STA_BMI088_ACC_SPATZ_ID, acc, 3);
|
||||
|
||||
*x = acc[0];
|
||||
*y = acc[1];
|
||||
*z = acc[2];
|
||||
}
|
||||
|
||||
bool BMI088::busRead(Part part, uint8_t reg, uint8_t * buffer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BMI088::busWrite(Part part, uint8_t reg, uint8_t value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void BMI088::convertRawToActual(uint16_t* i, float* f, float f_range)
|
||||
{
|
||||
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_SPATZ_ENABLED
|
Reference in New Issue
Block a user