Class hal::soft::minimum_speed_i2c
ClassList > hal > soft > minimum_speed_i2c
A i2c wrapper to ensure that the lowesti2c device frequency is used.
#include <i2c_minimum_speed.hpp>
Inherits the following classes: hal::i2c
Public Static Attributes
Type | Name |
---|---|
constexpr static auto | default_max_speed = = 2'000'000 |
Public Functions inherited from hal::i2c
See hal::i2c
Type | Name |
---|---|
status | configure (const settings & p_settings) Configure i2c to match the settings supplied. |
result< transaction_t > | transaction (hal::byte p_address, std::span< const hal::byte > p_data_out, std::span< hal::byte > p_data_in, hal::function_ref< hal::timeout_function > p_timeout) perform an i2c transaction with another device on the bus. The type of transaction depends on values of input parameters. This function will block until the entire transfer is finished. |
virtual | ~i2c () = default |
Public Static Functions
Type | Name |
---|---|
result< minimum_speed_i2c > | create (hal::i2c & p_i2c, hertz p_frequency=default_max_speed) Factory function to create minimum_speed_i2c object. |
Public Static Attributes Documentation
variable default_max_speed
constexpr static auto hal::soft::minimum_speed_i2c::default_max_speed;
Public Static Functions Documentation
function create
Factory function to create minimum_speed_i2c object.
static result< minimum_speed_i2c > hal::soft::minimum_speed_i2c::create (
hal::i2c & p_i2c,
hertz p_frequency=default_max_speed
)
Parameters:
p_i2c
- i2c object that the device will usep_frequency
- the maximum starting frequency the device can use
Returns:
minimum_speed_i2c - the configured i2c object using the lowest seen frequency
The documentation for this class was generated from the following file libraries/include/libhal-soft/i2c_minimum_speed.hpp