This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
Jonas Holmberg 738dca560f Added I2C soft implementation. Added barometer functionality.
In this commit the the barometer is commented out and is not used in the
system. This part also has athe beginnings of the calibration functions
for accel and gyro
2016-10-28 10:22:13 +02:00

29 lines
566 B
C

/*
* i2c_soft.h
*
* Created on: 27 okt. 2016
* Author: holmis
*/
#ifndef DRIVERS_I2C_SOFT_H_
#define DRIVERS_I2C_SOFT_H_
#include "stm32f4xx.h"
typedef struct
{
GPIO_TypeDef * i2c_Port;
uint16_t i2c_scl_pin;
uint16_t i2c_sda_pin;
}I2C_SOFT_handle_t;
void i2c_soft_Init(I2C_TypeDef *i2c, I2C_SOFT_handle_t *out_profile);
bool i2c_soft_Write(I2C_SOFT_handle_t *handle, uint8_t addr, uint8_t reg, uint8_t data);
bool i2c_soft_Read(I2C_SOFT_handle_t *handle, uint8_t addr, uint8_t reg, uint8_t len, uint8_t *buf);
#endif /* DRIVERS_I2C_SOFT_H_ */