TCA9548A Arduino Library for Soldered Boards
1.0.0
This is a library for the TCA9548A Soldered board.
Toggle main menu visibility
Loading...
Searching...
No Matches
TCA9548A.h
Go to the documentation of this file.
1
/* Version: 1.1.3 | License: Apache 2.0 | Author: JDWifWaf@gmail.com */
2
3
#ifndef TCA9548A_H
4
#define TCA9548A_h
5
6
#include <Arduino.h>
7
#include <Wire.h>
8
9
/* Channel hex values for writeRegister() function */
10
#define TCA_CHANNEL_0 0x1
11
#define TCA_CHANNEL_1 0x2
12
#define TCA_CHANNEL_2 0x4
13
#define TCA_CHANNEL_3 0x8
14
#define TCA_CHANNEL_4 0x10
15
#define TCA_CHANNEL_5 0x20
16
#define TCA_CHANNEL_6 0x40
17
#define TCA_CHANNEL_7 0x80
18
19
class
TCA9548A
20
{
21
public
:
22
TCA9548A
(uint8_t address = 0x70);
// Default IC Address
23
24
void
begin
(TwoWire &inWire = Wire);
// Default TwoWire Instance
25
void
openChannel
(uint8_t channel);
26
void
closeChannel
(uint8_t channel);
27
void
writeRegister
(uint8_t value);
28
inline
byte
readRegister
() {
return
(
byte
)
read
(); }
29
void
closeAll
();
30
void
openAll
();
31
32
protected
:
33
private
:
34
TwoWire *
myWire
;
35
uint8_t
_address
;
36
uint8_t
_channels
;
37
38
void
write
(uint8_t inData);
39
uint8_t
read
();
40
};
41
42
#endif
TCA9548A::_channels
uint8_t _channels
Definition
TCA9548A.h:36
TCA9548A::openAll
void openAll()
Function that connects all output channel to input.
Definition
TCA9548A.cpp:77
TCA9548A::openChannel
void openChannel(uint8_t channel)
Function that connects output channel to input.
Definition
TCA9548A.cpp:29
TCA9548A::writeRegister
void writeRegister(uint8_t value)
Function that directly modifies channels register in TCA9548A.
Definition
TCA9548A.cpp:88
TCA9548A::myWire
TwoWire * myWire
Definition
TCA9548A.h:34
TCA9548A::closeChannel
void closeChannel(uint8_t channel)
Function that disconnects output channel from input.
Definition
TCA9548A.cpp:47
TCA9548A::begin
void begin(TwoWire &inWire=Wire)
Function initializes I2C communication.
Definition
TCA9548A.cpp:18
TCA9548A::write
void write(uint8_t inData)
Function that writes data in registers of TCA9548A.
Definition
TCA9548A.cpp:104
TCA9548A::TCA9548A
TCA9548A(uint8_t address=0x70)
Overloaded constructor with address setting.
Definition
TCA9548A.cpp:11
TCA9548A::readRegister
byte readRegister()
Definition
TCA9548A.h:28
TCA9548A::read
uint8_t read()
Function that reads registers from TCA9548A.
Definition
TCA9548A.cpp:120
TCA9548A::closeAll
void closeAll()
Function that disconnects all output channels frominput.
Definition
TCA9548A.cpp:66
TCA9548A::_address
uint8_t _address
Definition
TCA9548A.h:35
src
libs
TCA9548A
src
TCA9548A.h
Generated on
for TCA9548A Arduino Library for Soldered Boards by
1.17.0. Dark theme by
Tilen Majerle
. All rights reserved. Copyright:
Soldered