IoAbstraction
wireHelpers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
3  * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4  */
5 
6 #ifndef IOA_WIRE_HELPERS_H
7 #define IOA_WIRE_HELPERS_H
8 
9 #include "IoAbstraction.h"
10 #include "PlatformDetermination.h"
11 #include "PlatformDeterminationWire.h"
12 #include "IoLogging.h"
13 
28 void write4BitToReg8(WireType wireImpl, uint8_t i2cAddress, uint8_t reg, bool lowBits, uint8_t val);
29 
38 void toggleBitInRegister16(WireType wireType, uint8_t addr, uint8_t regAddr, uint8_t theBit, bool value);
39 
48 void toggleBitInRegister8(WireType wireType, uint8_t addr, uint8_t regAddr, uint8_t theBit, bool value);
49 
58 bool wireWriteReg8(WireType wireType, uint8_t addr, uint8_t reg, uint8_t command);
59 
68 bool wireWriteReg16(WireType wireType, uint8_t addr, uint8_t reg, uint16_t command);
69 
77 uint8_t wireReadReg8(WireType wireType, uint8_t addr, uint8_t reg);
78 
86 uint16_t wireReadReg16(WireType wireType, uint8_t addr, uint8_t reg);
87 
88 #endif // IOA_WIRE_HELPERS_H
Using basic IoFacilities allows one to abstract away the use of IoExpanders, such that the switching ...
Some very basic logging utilities for any IoAbstraction user that log to a chosen serial interface....
void toggleBitInRegister16(WireType wireType, uint8_t addr, uint8_t regAddr, uint8_t theBit, bool value)
Definition: wireHelpers.cpp:57
void write4BitToReg8(WireType wireImpl, uint8_t i2cAddress, uint8_t reg, bool lowBits, uint8_t val)
Definition: wireHelpers.cpp:69
void toggleBitInRegister8(WireType wireType, uint8_t addr, uint8_t regAddr, uint8_t theBit, bool value)
Definition: wireHelpers.cpp:45
uint8_t wireReadReg8(WireType wireType, uint8_t addr, uint8_t reg)
Definition: wireHelpers.cpp:20
uint16_t wireReadReg16(WireType wireType, uint8_t addr, uint8_t reg)
Definition: wireHelpers.cpp:9
bool wireWriteReg16(WireType wireType, uint8_t addr, uint8_t reg, uint16_t command)
Definition: wireHelpers.cpp:30
bool wireWriteReg8(WireType wireType, uint8_t addr, uint8_t reg, uint8_t command)
Definition: wireHelpers.cpp:38