You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
527 B

/*
* i2c.h
*
* Created on: 1 Jun 2019
* Author: maximilian
*/
#ifndef PLATFORM_I2C_H_
#define PLATFORM_I2C_H_
#include "stm32f10x.h"
#include <stdlib.h>
#define STANDARD_I2C_TIMEOUT 1000
void i2cInit(I2C_TypeDef* I2Cx);
void i2c1Init(void);
void i2cStartTransmission(I2C_TypeDef* I2Cx, uint8_t dir, uint8_t slave_addr);
void i2cWrite(I2C_TypeDef* I2Cx, uint8_t* data, uint16_t len, uint32_t timeout);
uint8_t i2cRead(I2C_TypeDef* I2Cx);
void i2cEndTransmission(I2C_TypeDef* I2Cx);
#endif /* PLATFORM_I2C_H_ */