Arduino library for the I²C Multiplexer TCA9548A
TCA9548A.h
Go to the documentation of this file.
1 
14 #ifndef TCA9548A_h
15 #define TCA9548A_h
16 
17 // includes
18 #include <inttypes.h>
19 #include <Arduino.h>
20 #include <Wire.h>
21 
22 // defines
23 #define _TCA9548A_STD_ADDRESS 0x70
24 #define _TCA9548A_LIB_VERSION 102
25 
26 
30 class TCA9548A {
31 // Begin PUBLIC ------------------------------------------------------------------
32  public:
33 
34  // constructors
35  TCA9548A(); // Main construcor of the TCA9548A class.
36  TCA9548A(uint8_t address); // Constructor of the TCA9548A class with non standard i2c address.
37  ~TCA9548A(); // Main destructor of the TCA9548A class.
38 
39  // init function
40  void init(); // Initialize the TCA9548A Multiplexer.
41 
42  // functions
43  void disable(); // Disable the TCA9548A Multiplexer.
44  void set_port(uint8_t port); // Select the port on which the TCA9548A Multiplexer will operate.
45  uint8_t get_port(); // Get the current port on which the TCA9548A Multiplexer operates.
46  uint16_t get_version(); // Get the version of the library.
47 
48 // End PUBLIC --------------------------------------------------------------------
49 
50 // Begin PRIVATE -----------------------------------------------------------------
51  private:
52 
53  // variables
54  uint8_t _addressTCA9548A;
55  uint8_t _portTCA9548A;
56 
57 // End PRIVATE -------------------------------------------------------------------
58 };
59 
60 #endif
TCA9548A::get_port
uint8_t get_port()
Get the current port on which the TCA9548A Multiplexer operates.
Definition: TCA9548A.cpp:128
TCA9548A::~TCA9548A
~TCA9548A()
Main destructor of the TCA9548A class.
Definition: TCA9548A.cpp:76
TCA9548A
The main class of the Arduino library for the I²C Multiplexer TCA9548A.
Definition: TCA9548A.h:30
TCA9548A::set_port
void set_port(uint8_t port)
Select the port on which the TCA9548A Multiplexer will operate.
Definition: TCA9548A.cpp:112
TCA9548A::TCA9548A
TCA9548A()
Main construcor of the TCA9548A class.
Definition: TCA9548A.cpp:58
TCA9548A::get_version
uint16_t get_version()
Get the version of the library.
Definition: TCA9548A.cpp:137
TCA9548A::init
void init()
Initialize the TCA9548A Multiplexer.
Definition: TCA9548A.cpp:87
TCA9548A::disable
void disable()
Disable the TCA9548A Multiplexer.
Definition: TCA9548A.cpp:98