MAV'RIC
Public Member Functions
I2c Class Reference
Inheritance diagram for I2c:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool init (void)=0
 Hardware initialization.
virtual bool probe (uint32_t address)=0
 Test if a chip answers for a given I2C address.
virtual bool write (const uint8_t *buffer, uint32_t nbytes, uint32_t address)=0
 Write multiple bytes to a I2C slave device.
virtual bool read (uint8_t *buffer, uint32_t nbytes, uint32_t address)=0
 Read multiple bytes to a I2C slave device.
virtual bool transfer (uint8_t *out_buffer, uint32_t ntxbytes, uint8_t *in_buffer, uint32_t nrxbytes, uint32_t address)
 Write then Read data to/from an I2C device.

Member Function Documentation

virtual bool I2c::init ( void  ) [pure virtual]

Hardware initialization.

Returns:
true Success
false Error

Implemented in I2c_stm32, I2c_avr32, I2c_chibios, and I2c_dummy.

virtual bool I2c::probe ( uint32_t  address) [pure virtual]

Test if a chip answers for a given I2C address.

Parameters:
addressSlave adress
Returns:
true Slave found
false Slave not found

Implemented in I2c_stm32, I2c_avr32, I2c_chibios, and I2c_dummy.

Here is the caller graph for this function:

virtual bool I2c::read ( uint8_t *  buffer,
uint32_t  nbytes,
uint32_t  address 
) [pure 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

Implemented in I2c_stm32, I2c_avr32, I2c_chibios, and I2c_dummy.

Here is the caller graph for this function:

virtual bool I2c::transfer ( uint8_t *  out_buffer,
uint32_t  ntxbytes,
uint8_t *  in_buffer,
uint32_t  nrxbytes,
uint32_t  address 
) [inline, virtual]

Write then Read data to/from an I2C device.

Parameters:
out_bufferData buffer (output)
ntxbytesNumber of bytes to write
in_bufferData buffer (input)
nrxbytesNumber of bytes to read
addressSlave adress
Returns:
true Success
false Failed

Reimplemented in I2c_chibios.

Here is the call graph for this function:

virtual bool I2c::write ( const uint8_t *  buffer,
uint32_t  nbytes,
uint32_t  address 
) [pure 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

Implemented in I2c_stm32, I2c_avr32, I2c_chibios, and I2c_dummy.

Here is the caller graph for this function:


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