Skip to content

Commit ba65689

Browse files
authored
update readme.md (#41)
- update readme.md - update GitHub actions - update license 2023
1 parent 45d61ea commit ba65689

File tree

7 files changed

+67
-31
lines changed

7 files changed

+67
-31
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.3.8] - 2023-02-04
10+
- update readme.md
11+
- update GitHub actions
12+
- update license 2023
13+
14+
915
## [0.3.7] - 2022-11-16
1016
- fix #40 - add interrupt section to readme.md
1117

PCF8574.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// FILE: PCF8574.cpp
33
// AUTHOR: Rob Tillaart
44
// DATE: 02-febr-2013
5-
// VERSION: 0.3.7
5+
// VERSION: 0.3.8
66
// PURPOSE: Arduino library for PCF8574 - 8 channel I2C IO expander
77
// URL: https://github.com/RobTillaart/PCF8574
88
// http://forum.arduino.cc/index.php?topic=184800
9-
//
10-
// HISTORY: See CHANGELOG.md
11-
//
9+
1210

1311
#include "PCF8574.h"
1412

@@ -186,7 +184,7 @@ void PCF8574::rotateLeft(const uint8_t n)
186184
}
187185

188186

189-
void PCF8574::reverse() // quite fast: 14 shifts, 3 or, 3 assignment.
187+
void PCF8574::reverse() // quite fast: 4 and, 14 shifts, 3 or, 3 assignment.
190188
{
191189
uint8_t x = _dataOut;
192190
x = (((x & 0xAA) >> 1) | ((x & 0x55) << 1));
@@ -240,6 +238,5 @@ void PCF8574::selectN(const uint8_t pin)
240238
};
241239

242240

243-
244-
// -- END OF FILE --
241+
// -- END OF FILE --
245242

PCF8574.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
// FILE: PCF8574.h
44
// AUTHOR: Rob Tillaart
55
// DATE: 02-febr-2013
6-
// VERSION: 0.3.7
6+
// VERSION: 0.3.8
77
// PURPOSE: Arduino library for PCF8574 - 8 channel I2C IO expander
88
// URL: https://github.com/RobTillaart/PCF8574
99
// http://forum.arduino.cc/index.php?topic=184800
10-
//
1110

1211

1312
#include "Arduino.h"
1413
#include "Wire.h"
1514

1615

17-
#define PCF8574_LIB_VERSION (F("0.3.7"))
16+
#define PCF8574_LIB_VERSION (F("0.3.8"))
1817

1918
#ifndef PCF8574_INITIAL_VALUE
2019
#define PCF8574_INITIAL_VALUE 0xFF
@@ -40,7 +39,7 @@ class PCF8574
4039
// note: setting the address corrupt internal buffer values
4140
// a read8() / write8() call updates them.
4241
bool setAddress(const uint8_t deviceAddress);
43-
uint8_t getAddress();
42+
uint8_t getAddress();
4443

4544

4645
uint8_t read8();
@@ -63,7 +62,8 @@ class PCF8574
6362

6463
// rotate, shift, toggle, reverse expect all lines are output
6564
void toggle(const uint8_t pin);
66-
void toggleMask(const uint8_t mask = 0xFF); // default 0xFF ==> invertAll()
65+
// default 0xFF ==> invertAll()
66+
void toggleMask(const uint8_t mask = 0xFF);
6767
void shiftRight(const uint8_t n = 1);
6868
void shiftLeft(const uint8_t n = 1);
6969
void rotateRight(const uint8_t n = 1);
@@ -91,5 +91,5 @@ class PCF8574
9191
};
9292

9393

94-
// -- END OF FILE --
94+
// -- END OF FILE --
9595

README.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ Related to the PCF8575 16 channel IO expander library https://github.com/RobTil
1818
This library gives easy control over the 8 pins of a PCF8574 and PCF8574A chip.
1919
These chips are identical in behaviour although there are two distinct address ranges.
2020

21-
| TYPE | ADDRESS-RANGE | notes |
22-
|:---------|:-------------:|:------------------------:|
23-
|PCF8574 | 0x20 to 0x27 | same range as PCF8575 !! |
24-
|PCF8574A | 0x38 to 0x3F | |
21+
| type | address-range | notes |
22+
|:-----------|:---------------:|:-------------------------:|
23+
| PCF8574 | 0x20 to 0x27 | same range as PCF8575 ! |
24+
| PCF8574A | 0x38 to 0x3F |
25+
2526

2627
So you can connect up to 16 PCF8574 on one I2C bus, giving access
2728
to 16 x 8 = 128 IO lines. To maximize IO lines combine 8 x PCF8575 + 8 x PCF8574A giving
@@ -45,24 +46,44 @@ There are two examples to show how interrupts can be used:
4546
- PCF8574_rotaryEncoder.ino
4647

4748

49+
#### Related
50+
51+
16 bit port expanders
52+
53+
- https://github.com/RobTillaart/MCP23017_RT
54+
- https://github.com/RobTillaart/MCP23S17
55+
- https://github.com/RobTillaart/PCF8575
56+
57+
58+
8 bit port expanders
59+
60+
- https://github.com/RobTillaart/MCP23008
61+
- https://github.com/RobTillaart/MCP23S08
62+
- https://github.com/RobTillaart/PCF8574
63+
64+
4865
## I2C Clock
4966

5067
Tested on UNO with **PCF8574_performance** showed that the PCF8574 still works at 500 KHz and failed at 600 KHz.
5168
These values are outside the specs of the datasheet so they are not recommended.
5269
However when performance is needed you can try to overclock the chip.
5370

54-
| clock speed | Read | Write | Notes |
55-
|:-----------:|:------:|:-------:|:------------------|
56-
| 100000 | 236 | 240 | spec datasheet |
71+
| clock speed | Read | Write | Notes |
72+
|:-----------:|:------:|:-------:|:--------------------|
73+
| 100000 | 236 | 240 | spec datasheet |
5774
| 200000 | 132 | 140 |
5875
| 300000 | 104 | 108 |
59-
| 400000 | 96 | 96 | max advised speed |
60-
| 500000 | 92 | 92 | not recommended |
76+
| 400000 | 96 | 96 | max advised speed |
77+
| 500000 | 92 | 92 | not recommended |
6178
| 600000 | crash | crash |
6279

6380

6481
## Interface
6582

83+
```cpp
84+
#include "PCF8574.h"
85+
```
86+
6687
**PCF8574_INITIAL_VALUE** is a define that can be set compile time or before
6788
the include of "pcf8574.h" to overrule the default value used with the **begin()** call.
6889

@@ -144,11 +165,11 @@ This can typical be used to implement a VU meter.
144165

145166
## Error codes
146167

147-
| name | value | description |
148-
|:-------------------|:-----:|:------------------------|
149-
| PCF8574_OK | 0x00 | no error |
150-
| PCF8574_PIN_ERROR | 0x81 | pin number out of range |
151-
| PCF8574_I2C_ERROR | 0x82 | I2C communication error |
168+
| name | value | description |
169+
|:--------------------|:-------:|:--------------------------|
170+
| PCF8574_OK | 0x00 | no error |
171+
| PCF8574_PIN_ERROR | 0x81 | pin number out of range |
172+
| PCF8574_I2C_ERROR | 0x82 | I2C communication error |
152173

153174

154175
## Operation
@@ -160,6 +181,17 @@ It is advised to use pull-up or pull-down resistors so the lines have a defined
160181

161182
## Future
162183

163-
-
184+
#### Must
185+
186+
- keep in sync with PCF8575
187+
188+
#### Should
189+
190+
191+
#### Could
192+
193+
- move code to .cpp
194+
195+
#### Wont
164196

165197

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/PCF8574.git"
1717
},
18-
"version": "0.3.7",
18+
"version": "0.3.8",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=PCF8574
2-
version=0.3.7
2+
version=0.3.8
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for PCF8574 - 8 channel I2C IO expander

test/unit_test_001.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ unittest(test_address)
105105
unittest_main()
106106

107107

108-
// --------
108+
// -- END OF FILE --
109+

0 commit comments

Comments
 (0)