satnogs-rotator-firmware
Loading...
Searching...
No Matches
i2c_mux Class Reference

Class that functions for interacting with I2C 1-of-2 multiplexer. More...

#include <i2c_mux.h>

Public Member Functions

 i2c_mux (uint8_t id, uint8_t ch0, uint8_t ch1)
 
void init ()
 Initialize the I2C bus.
 
void set_channel (uint8_t ch)
 Change the channel.
 

Private Attributes

uint8_t _id
 
uint8_t _ch0
 
uint8_t _ch1
 

Detailed Description

Class that functions for interacting with I2C 1-of-2 multiplexer.

Parameters
idI2C ID in HEX
ch0Channel 0 in HEX
ch1Channel 1 in HEX

Definition at line 29 of file i2c_mux.h.

Constructor & Destructor Documentation

◆ i2c_mux()

i2c_mux::i2c_mux ( uint8_t id,
uint8_t ch0,
uint8_t ch1 )
inline

Definition at line 32 of file i2c_mux.h.

References _ch0, _ch1, and _id.

Member Function Documentation

◆ init()

void i2c_mux::init ( )
inline

Initialize the I2C bus.

Definition at line 43 of file i2c_mux.h.

References I2C_FREQ.

Referenced by setup().

◆ set_channel()

void i2c_mux::set_channel ( uint8_t ch)
inline

Change the channel.

Parameters
chSet the channel that is connected with Master, CH0 or CH1

Definition at line 55 of file i2c_mux.h.

References _ch0, _ch1, and _id.

Referenced by homing(), and loop().

Member Data Documentation

◆ _ch0

uint8_t i2c_mux::_ch0
private

Definition at line 68 of file i2c_mux.h.

Referenced by i2c_mux(), and set_channel().

◆ _ch1

uint8_t i2c_mux::_ch1
private

Definition at line 68 of file i2c_mux.h.

Referenced by i2c_mux(), and set_channel().

◆ _id

uint8_t i2c_mux::_id
private

Definition at line 68 of file i2c_mux.h.

Referenced by i2c_mux(), and set_channel().


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