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

@@ -9,11 +9,12 @@
#define MMA8652FC_HPP_
#include "stm32f1xx_hal.h"
#include "MMA8652FC_defines.h"
#include "FRToSI2C.hpp"
class MMA8652FC {
public:
MMA8652FC(I2C_HandleTypeDef* i2cHandle);
MMA8652FC(FRToSI2C* i2cHandle);
void initalize(); // Initalize the system
uint8_t getOrientation();// Reads the I2C register and returns the orientation (true == left)
void getAxisReadings(int16_t *x, int16_t *y, int16_t *z);
@@ -23,7 +24,7 @@ private:
void I2C_RegisterWrite(uint8_t reg, uint8_t data);
uint8_t I2C_RegisterRead(uint8_t reg);
I2C_HandleTypeDef* i2c;
FRToSI2C* i2c;
};