Skyward boardcore
|
#include <stm32f2_f4_i2c.h>
Public Member Functions | |
void | init () |
bool | send (unsigned char address, const void *data, int len, bool sendStop=true) |
bool | recv (unsigned char address, void *data, int len) |
Static Public Member Functions | |
static I2C1Driver & | instance () |
Driver for the I2C1 peripheral in STM32F2 and STM32F4 under Miosix
Definition at line 35 of file stm32f2_f4_i2c.h.
void miosix::I2C1Driver::init | ( | ) |
Initializes the peripheral. The only supported mode is 100KHz, master, 7bit address. Note that there is no need to manually call this member function as the constructor already inizializes the I2C peripheral. The only use of this member function is to reinitialize the peripheral if the microcontroller clock frequency or the APB prescaler is changed.
Definition at line 201 of file stm32f2_f4_i2c.cpp.
|
static |
Definition at line 195 of file stm32f2_f4_i2c.cpp.
bool miosix::I2C1Driver::recv | ( | unsigned char | address, |
void * | data, | ||
int | len ) |
Receive data from a device connected to the I2C bus
address | device address (bit 0 is forced at 1) |
data | pointer to a buffer where data will be received |
len | length of data to receive |
Definition at line 359 of file stm32f2_f4_i2c.cpp.
bool miosix::I2C1Driver::send | ( | unsigned char | address, |
const void * | data, | ||
int | len, | ||
bool | sendStop = true ) |
Send data to a device connected to the I2C bus
address | device address (bit 0 is forced at 0) |
data | pointer with data to send |
len | length of data to send |
sendStop | if set to false disables the sending of a stop condition after data transmission has finished |
Definition at line 254 of file stm32f2_f4_i2c.cpp.