MAV'RIC
Public Member Functions
I2c_stm32 Class Reference

I2C peripheral driver for STM32. More...

#include <i2c_stm32.hpp>

Inheritance diagram for I2c_stm32:
Inheritance graph
[legend]
Collaboration diagram for I2c_stm32:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 I2c_stm32 (i2c_stm32_conf_t config=i2c_stm32_default_config())
 Initialises the peripheral.
bool init (void)
 Hardware initialization.
bool probe (uint32_t address)
 Test if a chip answers for a given I2C address.
bool write (const uint8_t *buffer, uint32_t nbytes, uint32_t address)
 Write multiple bytes to a I2C slave device.
bool read (uint8_t *buffer, uint32_t nbytes, uint32_t address)
 Read multiple bytes to a I2C slave device.

Detailed Description

I2C peripheral driver for STM32.


Constructor & Destructor Documentation

I2c_stm32::I2c_stm32 ( i2c_stm32_conf_t  config = i2c_stm32_default_config())

Initialises the peripheral.

Parameters:
configDevice configuration

Member Function Documentation

bool I2c_stm32::init ( void  ) [virtual]

Hardware initialization.

Returns:
true Success
false Error

Implements I2c.

Here is the caller graph for this function:

bool I2c_stm32::probe ( uint32_t  address) [virtual]

Test if a chip answers for a given I2C address.

Parameters:
addressSlave adress
Returns:
True Slave found
False Slave not found

Implements I2c.

bool I2c_stm32::read ( uint8_t *  buffer,
uint32_t  nbytes,
uint32_t  address 
) [virtual]

Read multiple bytes to a I2C slave device.

Parameters:
bufferData buffer
nbytesNumber of bytes to read
addressSlave adress
Returns:
True Data successfully read
False Data not read

Implements I2c.

bool I2c_stm32::write ( const uint8_t *  buffer,
uint32_t  nbytes,
uint32_t  address 
) [virtual]

Write multiple bytes to a I2C slave device.

Parameters:
bufferData buffer
nbytesNumber of bytes to write
addressSlave adress
Returns:
True Data successfully written
False Data not written

Implements I2c.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines