|
| I2CDevice (I2C_TypeDef *I2C_Port, uint8_t address, uint32_t speed=100000) |
| Configure and enable the I2C device. More...
|
|
virtual | ~I2CDevice () |
| Deinitialize the device. More...
|
|
|
void | WriteRegister (uint8_t reg, uint8_t value) |
| Write some data into a register. More...
|
|
void | WriteBuffer (uint8_t reg, uint8_t *buffer, uint8_t length) |
| Send a buffer of data to the device. More...
|
|
uint8_t | ReadRegister (uint8_t reg) |
| Read some data from a register. More...
|
|
void | ReadBuffer (uint8_t reg, uint8_t *buffer, uint8_t length) |
| Read a buffer of data from the device. More...
|
|
I2CDevice::I2CDevice |
( |
I2C_TypeDef * |
Port, |
|
|
uint8_t |
address, |
|
|
uint32_t |
speed = 100000 |
|
) |
| |
Configure and enable the I2C device.
- Parameters
-
Port | : I2C1, I2C2 or I2C3 |
address | : device's slave address |
speed | : I2C bus speed (in Hz), default is 100Khz |
- Return values
-
I2CDevice::~I2CDevice |
( |
| ) |
|
|
virtual |
Deinitialize the device.
- Parameters
-
- Return values
-
void I2CDevice::ReadBuffer |
( |
uint8_t |
reg, |
|
|
uint8_t * |
buffer, |
|
|
uint8_t |
length |
|
) |
| |
|
protected |
Read a buffer of data from the device.
- Parameters
-
reg | : the first register where to read the data |
buffer | : the buffer containing the data to read |
length | : the length of the buffer |
- Return values
-
uint8_t I2CDevice::ReadRegister |
( |
uint8_t |
reg | ) |
|
|
protected |
Read some data from a register.
- Parameters
-
reg | : the register where to read the data |
- Return values
-
void I2CDevice::WriteBuffer |
( |
uint8_t |
reg, |
|
|
uint8_t * |
buffer, |
|
|
uint8_t |
length |
|
) |
| |
|
protected |
Send a buffer of data to the device.
- Parameters
-
reg | : the first register where to write the data |
buffer | : the buffer containing the data to write |
length | : the length of the buffer |
- Return values
-
void I2CDevice::WriteRegister |
( |
uint8_t |
reg, |
|
|
uint8_t |
value |
|
) |
| |
|
protected |
Write some data into a register.
- Parameters
-
reg | : the register where to write the data |
value | : the value to write to the register |
- Return values
-
The documentation for this class was generated from the following files:
- /Users/blackswords/Public/Dropbox/Projet M1/roverSTM/Libraries/MyLib/I2CDevice.h
- /Users/blackswords/Public/Dropbox/Projet M1/roverSTM/Libraries/MyLib/I2CDevice.cpp