libyggdrasil  v1.0.0
bsp::mid::drv::I2C< Context > Struct Template Reference

I2C implementation for Midgard. More...

#include <i2c.hpp>

Static Public Member Functions

static bool init ()
 Init function. More...
 
static bool deinit ()
 Deinit function. More...
 
template<size_t N>
static ALWAYS_INLINE void read (u8 address, std::array< u8, N > &data)
 I2C receive. More...
 
template<size_t N>
static ALWAYS_INLINE void write (u8 address, const std::array< u8, N > &data)
 I2C write. More...
 

Detailed Description

template<auto Context>
struct bsp::mid::drv::I2C< Context >

I2C implementation for Midgard.

Warning
Do not use this on its own!
Template Parameters
ContextI2C context

Member Function Documentation

◆ deinit()

template<auto Context>
static bool bsp::mid::drv::I2C< Context >::deinit ( )
inlinestatic

Deinit function.

Returns
Success

◆ init()

template<auto Context>
static bool bsp::mid::drv::I2C< Context >::init ( )
inlinestatic

Init function.

Returns
Success

◆ read()

template<auto Context>
template<size_t N>
static ALWAYS_INLINE void bsp::mid::drv::I2C< Context >::read ( u8  address,
std::array< u8, N > &  data 
)
inlinestatic

I2C receive.

Template Parameters
NData size
Parameters
addressDevice address
dataArray for the read data

◆ write()

template<auto Context>
template<size_t N>
static ALWAYS_INLINE void bsp::mid::drv::I2C< Context >::write ( u8  address,
const std::array< u8, N > &  data 
)
inlinestatic

I2C write.

Template Parameters
NData size
Parameters
addressDevice address
dataArray to send

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