I2C bus based on Particle electron drivers.
More...
#include </home/travis/build/forGGe/theCore/platform/stm32/export/aux/i2c_bus.hpp>
|
template<class I2C_Dev > |
void | dispatch () |
| Real dispatch function that operates over given I2C theCore driver. More...
|
|
template<i2c_device dev>
class ecl::i2c_bus< dev >
I2C bus based on Particle electron drivers.
I2C bus itself.
- Template Parameters
-
Speed | I2C bus speed in HZ. |
StretchClk | Enable or disable clock stretching. |
◆ channel
◆ event
◆ handler_fn
◆ i2c_bus()
◆ ~i2c_bus()
◆ init() [1/2]
template<class i2c_config >
Lazy initialization.
- Returns
- Status of operation.
◆ set_rx() [1/2]
template<class i2c_config >
Sets rx buffer with given size.
- Parameters
-
[in,out] | rx | Buffer to write data to. Optional. |
[in] | size | Size |
◆ set_tx() [1/4]
template<class i2c_config >
Sets rx buffer made-up from sequence of similar bytes.
- Parameters
-
[in] | size | Size of sequence |
[in] | fill_byte | Byte to fill a sequence. Optional. |
◆ set_tx() [2/4]
template<class i2c_config >
Sets tx buffer with given size.
- Parameters
-
[in] | tx | Buffer to transmit. Optional. |
[in] | size | Buffer size. |
◆ set_handler() [1/2]
template<class i2c_config >
Sets event handler.
Handler will be used by the bus, until reset_handler() will be called.
- Parameters
-
[in] | handler | Handler itself. |
◆ reset_buffers() [1/2]
template<class i2c_config >
Reset xfer buffers.
Buffers that were set by
- See also
- set_tx() and
-
set_rx() will be no longer used after this call.
◆ reset_handler() [1/2]
Resets previously set handler.
◆ do_xfer() [1/2]
template<class i2c_config >
Executes xfer, using buffers previously set.
When it will be done, handler will be invoked.
- Returns
- Status of operation.
◆ cancel_xfer() [1/2]
template<class i2c_config >
Cancels xfer.
After this call no xfer will occur.
- Returns
- Status of operation.
◆ set_slave_addr() [1/2]
template<class i2c_config >
Sets slave address.
This address is used during communication. In case if there is only one device on the bus, this function may be called only once, before first xfer().
◆ init() [2/2]
Lazy initialization.
- Returns
- Status of operation.
◆ set_rx() [2/2]
template<i2c_device dev>
static void ecl::i2c_bus< dev >::set_rx |
( |
uint8_t * |
rx, |
|
|
size_t |
size |
|
) |
| |
|
static |
Sets rx buffer with given size.
- Parameters
-
[in,out] | rx | Buffer to write data to. Optional. |
[in] | size | Size |
◆ set_tx() [3/4]
template<i2c_device dev>
static void ecl::i2c_bus< dev >::set_tx |
( |
size_t |
size, |
|
|
uint8_t |
fill_byte = 0xff |
|
) |
| |
|
static |
Sets tx buffer made-up from sequence of similar bytes.
- Parameters
-
[in] | size | Size of sequence |
[in] | fill_byte | Byte to fill a sequence. Optional. |
◆ set_tx() [4/4]
template<i2c_device dev>
static void ecl::i2c_bus< dev >::set_tx |
( |
const uint8_t * |
tx, |
|
|
size_t |
size |
|
) |
| |
|
static |
Sets tx buffer with given size.
- Parameters
-
[in] | tx | Buffer to transmit. Optional. |
[in] | size | Buffer size. |
◆ set_handler() [2/2]
Sets event handler.
Handler will be used by the bus, until reset_handler() will be called.
- Parameters
-
[in] | handler | Handler itself. |
◆ reset_buffers() [2/2]
Reset xfer buffers.
Buffers that were set by
- See also
- set_tx() and
-
set_rx() will be no longer used after this call.
◆ reset_handler() [2/2]
Resets previously set handler.
◆ do_xfer() [2/2]
Executes xfer, using buffers previously set.
When it will be done, handler will be invoked.
- Returns
- Status of operation.
◆ cancel_xfer() [2/2]
Cancels xfer.
After this call no xfer will occur.
- Returns
- Status of operation.
◆ set_slave_addr() [2/2]
template<i2c_device dev>
static void ecl::i2c_bus< dev >::set_slave_addr |
( |
uint16_t |
addr | ) |
|
|
static |
Sets slave address.
This address is used during communication. In case there is only one device on the bus, this function may be called only once, before first xfer().
◆ dispatch
template<i2c_device dev>
template<class I2C_Dev >
Real dispatch function that operates over given I2C theCore driver.
- Template Parameters
-
I2C_Dev | theCore I2C driver. |
Upon call, it will determine if data should be send or received from the I2C driver.
The documentation for this class was generated from the following file: