FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ > Class Template Reference

Abstract synchronous I2C Manager for all MCU architectures. More...

#include <fastarduino/i2c_handler_common.h>

Inheritance diagram for i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >:

Public Types

using ABSTRACT_FUTURE = future::AbstractFakeFuture
 The abstract base class of all futures to be defined for this I2C Manager. More...
 
template<typename OUT , typename IN >
using FUTURE = future::FakeFuture< OUT, IN >
 The template base class of all futures to be defined for this I2C Manager. More...
 

Public Member Functions

void begin ()
 Prepare and enable the MCU for I2C transmission. More...
 
void end ()
 Disable MCU I2C transmission. More...
 
void begin_ ()
 Prepare and enable the MCU for I2C transmission. More...
 
void end_ ()
 Disable MCU I2C transmission. More...
 

Friends

template<typename >
class I2CDevice
 

Detailed Description

template<typename ARCH_HANDLER_, I2CMode MODE_, typename STATUS_HOOK_, bool HAS_DEBUG_, typename DEBUG_HOOK_>
class i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >

Abstract synchronous I2C Manager for all MCU architectures.

A specific abstract subclass is defined for each MCU architecture (ATmega, ATtiny). You should never need to subclass AbstractI2CSyncManager yourself.

Template Parameters
ARCH_HANDLER_the type of an actual class handling I2C control on actual target architecture
MODE_the I2C mode for this manager
STATUS_HOOK_the type of the hook to be called. This can be a simple function pointer (of type I2C_STATUS_HOOK) or a Functor class (or Functor class reference). Using a Functor class will generate smaller code.
HAS_DEBUG_tells this I2C Manager to call a debugging hook at each step of an I2C transaction; this is useful for debugging support for a new I2C device; using false will generate smaller code.
DEBUG_HOOK_the type of the hook to be called when HAS_DEBUG_ is true. This can be a simple function pointer (of type I2C_DEBUG_HOOK) or a Functor class (or Functor class reference). Using a Functor class will generate smaller code.
See also
I2CMode
I2C_STATUS_HOOK
I2C_DEBUG_HOOK
i2c::debug
i2c::status

Definition at line 419 of file i2c_handler_common.h.

Member Typedef Documentation

◆ ABSTRACT_FUTURE

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
using i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::ABSTRACT_FUTURE = future::AbstractFakeFuture

The abstract base class of all futures to be defined for this I2C Manager.

For a synchronous manager, it is always future::AbstractFakeFuture.

Definition at line 435 of file i2c_handler_common.h.

◆ FUTURE

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
template<typename OUT , typename IN >
using i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::FUTURE = future::FakeFuture<OUT, IN>

The template base class of all futures to be defined for this I2C Manager.

For a synchronous manager, it is always future::FakeFuture.

Definition at line 441 of file i2c_handler_common.h.

Member Function Documentation

◆ begin()

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
void i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::begin ( )
inline

Prepare and enable the MCU for I2C transmission.

Preparation includes setup of I2C pins (SDA and SCL). This method is synchronized.

See also
end()
begin_()

Definition at line 450 of file i2c_handler_common.h.

◆ end()

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
void i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::end ( )
inline

Disable MCU I2C transmission.

This method is synchronized.

See also
begin()
end_()

Definition at line 461 of file i2c_handler_common.h.

◆ begin_()

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
void i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::begin_ ( )
inline

Prepare and enable the MCU for I2C transmission.

Preparation includes setup of I2C pins (SDA and SCL). This method is NOT synchronized.

See also
end_()
begin()

Definition at line 473 of file i2c_handler_common.h.

◆ end_()

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
void i2c::AbstractI2CSyncManager< ARCH_HANDLER_, MODE_, STATUS_HOOK_, HAS_DEBUG_, DEBUG_HOOK_ >::end_ ( )
inline

Disable MCU I2C transmission.

This method is NOT synchronized.

See also
begin_()
end()

Definition at line 484 of file i2c_handler_common.h.

Friends And Related Function Documentation

◆ I2CDevice

template<typename ARCH_HANDLER_ , I2CMode MODE_, typename STATUS_HOOK_ , bool HAS_DEBUG_, typename DEBUG_HOOK_ >
template<typename >
friend class I2CDevice
friend

Definition at line 662 of file i2c_handler_common.h.


The documentation for this class was generated from the following file: