GlobLib
HAL and API libraries for MCUs and hardware.
stm32f103cb_i2c.h File Reference

Header file for stm32f103cb I2C. More...

#include "stm32f103cb_gpio.h"
#include "stm32f103cb_debug.h"
#include <libopencm3/stm32/i2c.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define I2C_TIMEOUT   500000
 The number of loop cycles to wait when polling peripheral registers.
 
#define I2C_MY_ADDRESS   0x32
 The address of this device.
 

Enumerations

Functions

mcu_error I2C_setup (i2c_periph peripheral)
 Initialize I2C data structure and setup port. More...
 
mcu_error I2C_start (i2c_periph peripheral)
 Generate a start condition on the bus. More...
 
mcu_error I2C_stop (i2c_periph peripheral)
 Generate a stop condition on the bus. More...
 
mcu_error I2C_address (i2c_periph peripheral, uint8_t address, uint8_t operation)
 Send a seven bit address on the bus. More...
 
mcu_error I2C_write (i2c_periph peripheral, uint8_t byte)
 Send one byte on the bus. More...
 
uint8_t I2C_read (i2c_periph peripheral)
 Read one byte from the bus without acknowledge generation. More...
 
uint8_t I2C_repeatRead (i2c_periph peripheral)
 Read one byte from the bus with acknowledge generation. More...
 

Detailed Description

Header file for stm32f103cb I2C.

Definition in file stm32f103cb_i2c.h.