NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bus_i2c_stm32f30x.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <platform.h>
#include "build_config.h"
#include "gpio.h"
#include "system.h"
#include "bus_i2c.h"
Include dependency graph for bus_i2c_stm32f30x.c:

Macros

#define I2C1_SCL_GPIO   GPIOB
 
#define I2C1_SCL_GPIO_AF   GPIO_AF_4
 
#define I2C1_SCL_PIN   GPIO_Pin_6
 
#define I2C1_SCL_PIN_SOURCE   GPIO_PinSource6
 
#define I2C1_SCL_CLK_SOURCE   RCC_AHBPeriph_GPIOB
 
#define I2C1_SDA_GPIO   GPIOB
 
#define I2C1_SDA_GPIO_AF   GPIO_AF_4
 
#define I2C1_SDA_PIN   GPIO_Pin_7
 
#define I2C1_SDA_PIN_SOURCE   GPIO_PinSource7
 
#define I2C1_SDA_CLK_SOURCE   RCC_AHBPeriph_GPIOB
 
#define I2C2_SCL_GPIO   GPIOF
 
#define I2C2_SCL_GPIO_AF   GPIO_AF_4
 
#define I2C2_SCL_PIN   GPIO_Pin_6
 
#define I2C2_SCL_PIN_SOURCE   GPIO_PinSource6
 
#define I2C2_SCL_CLK_SOURCE   RCC_AHBPeriph_GPIOF
 
#define I2C2_SDA_GPIO   GPIOA
 
#define I2C2_SDA_GPIO_AF   GPIO_AF_4
 
#define I2C2_SDA_PIN   GPIO_Pin_10
 
#define I2C2_SDA_PIN_SOURCE   GPIO_PinSource10
 
#define I2C2_SDA_CLK_SOURCE   RCC_AHBPeriph_GPIOA
 

Functions

void i2cSetOverclock (uint8_t OverClock)
 
void i2cInit (I2CDevice index)
 
uint16_t i2cGetErrorCounter (void)
 
bool i2cWrite (uint8_t addr_, uint8_t reg, uint8_t data)
 
bool i2cRead (uint8_t addr_, uint8_t reg, uint8_t len, uint8_t *buf)
 

Macro Definition Documentation

#define I2C1_SCL_CLK_SOURCE   RCC_AHBPeriph_GPIOB
#define I2C1_SCL_GPIO   GPIOB
#define I2C1_SCL_GPIO_AF   GPIO_AF_4
#define I2C1_SCL_PIN   GPIO_Pin_6
#define I2C1_SCL_PIN_SOURCE   GPIO_PinSource6
#define I2C1_SDA_CLK_SOURCE   RCC_AHBPeriph_GPIOB
#define I2C1_SDA_GPIO   GPIOB
#define I2C1_SDA_GPIO_AF   GPIO_AF_4
#define I2C1_SDA_PIN   GPIO_Pin_7
#define I2C1_SDA_PIN_SOURCE   GPIO_PinSource7
#define I2C2_SCL_CLK_SOURCE   RCC_AHBPeriph_GPIOF
#define I2C2_SCL_GPIO   GPIOF
#define I2C2_SCL_GPIO_AF   GPIO_AF_4
#define I2C2_SCL_PIN   GPIO_Pin_6
#define I2C2_SCL_PIN_SOURCE   GPIO_PinSource6
#define I2C2_SDA_CLK_SOURCE   RCC_AHBPeriph_GPIOA
#define I2C2_SDA_GPIO   GPIOA
#define I2C2_SDA_GPIO_AF   GPIO_AF_4
#define I2C2_SDA_PIN   GPIO_Pin_10
#define I2C2_SDA_PIN_SOURCE   GPIO_PinSource10

Function Documentation

uint16_t i2cGetErrorCounter ( void  )
void i2cInit ( I2CDevice  index)
bool i2cRead ( uint8_t  addr_,
uint8_t  reg,
uint8_t  len,
uint8_t *  buf 
)
void i2cSetOverclock ( uint8_t  OverClock)
bool i2cWrite ( uint8_t  addr_,
uint8_t  reg,
uint8_t  data 
)