1
0
forked from me/IronOS

I2C into nicer wrapper for FreeRToS

This commit is contained in:
Ben V. Brown
2018-04-14 13:37:42 +10:00
parent cc09157106
commit f599624b6f
14 changed files with 223 additions and 104 deletions

View File

@@ -8,10 +8,11 @@
#ifndef LIS2DH12_HPP_
#define LIS2DH12_HPP_
#include "stm32f1xx_hal.h"
#include "FRToSI2C.hpp"
#include "LIS2DH12_defines.hpp"
class LIS2DH12 {
public:
LIS2DH12(I2C_HandleTypeDef* i2cHandle);
LIS2DH12(FRToSI2C* i2cHandle);
void initalize();
uint8_t getOrientation();
void getAxisReadings(int16_t *x, int16_t *y, int16_t *z);
@@ -21,7 +22,7 @@ private:
void I2C_RegisterWrite(uint8_t reg, uint8_t data);
uint8_t I2C_RegisterRead(uint8_t reg);
I2C_HandleTypeDef* i2c;
FRToSI2C* i2c;
};
#endif /* LIS2DH12_HPP_ */