File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
documentation/drivers/MCP230XX
examples/drivers/mcp23017 Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -86,22 +86,22 @@ All properties are read-only.
8686
8787#### Methods
8888
89- ##### ` bankWrite (byte)`
89+ ##### ` write (byte)`
9090
9191Temporarily sets the mode of all pins to output and writes all pins at once.
9292
9393``` js
9494let expander = new MCP23008 (); // defaults to 0x20!
95- expander .bankWrite (0b11111111 ); // Set all pins to 1
95+ expander .write (0b11111111 ); // Set all pins to 1
9696```
9797
98- ##### ` bankRead ()`
98+ ##### ` read ()`
9999
100100Temporarily sets the mode of all pins to input, reads all pins at once, and returns their values.
101101
102102``` js
103103let expander = new MCP23008 (); // defaults to 0x20!
104- trace (` ${ expander .bankRead ()} \n ` );
104+ trace (` ${ expander .read ()} \n ` );
105105```
106106
107107
@@ -173,22 +173,22 @@ All properties are read-only.
173173
174174#### Methods
175175
176- ##### ` bankWrite (word)`
176+ ##### ` write (word)`
177177
178178Temporarily sets the mode of all pins to output and writes all pins at once.
179179
180180``` js
181181let expander = new MCP23017 (); // defaults to 0x20!
182- expander .bankWrite (0b1111111111111111 ); // Set all pins to 1
182+ expander .write (0b1111111111111111 ); // Set all pins to 1
183183```
184184
185- ##### ` bankRead ()`
185+ ##### ` read ()`
186186
187187Temporarily sets the mode of all pins to input, reads all pins at once, and returns their values.
188188
189189``` js
190190let expander = new MCP23017 (); // defaults to 0x20!
191- trace (` ${ expander .bankRead ()} \n ` );
191+ trace (` ${ expander .read ()} \n ` );
192192```
193193
194194### Pin Class
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default function() {
3030 let last = Date . now ( ) ;
3131
3232 // Set pins 0-15
33- expander . bankWrite ( 0x0000 ) ;
33+ expander . write ( 0x0000 ) ;
3434
3535 button . mode ( Digital . Input ) ;
3636
@@ -46,13 +46,13 @@ export default function() {
4646 last = now ;
4747
4848 // Check if the button is pressed...
49- if ( expander . bankRead ( ) >> 15 ) {
49+ if ( expander . read ( ) >> 15 ) {
5050 indicator ^= 1 ;
5151 }
5252 }
5353 // Set pins 8-15 (Or: port B)
5454 ports . b = ( indicator << 8 ) ;
5555
56- expander . bankWrite ( ports . b | ports . a ) ;
56+ expander . write ( ports . b | ports . a ) ;
5757 } , 50 ) ;
5858}
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class Expander extends SMBus {
7676 Object . freeze ( this ) ;
7777 }
7878
79- bankWrite ( state ) {
79+ write ( state ) {
8080 if ( this . offset ) {
8181 // Read IODIR state
8282 let iodir = this . readWord ( this . IODIR ) ;
@@ -103,7 +103,7 @@ class Expander extends SMBus {
103103 this . writeByte ( this . IODIR , iodir ) ;
104104 }
105105 }
106- bankRead ( ) {
106+ read ( ) {
107107 if ( this . offset ) {
108108 // Read IODIR state
109109 let iodir = this . readWord ( this . IODIR ) ;
You can’t perform that action at this time.
0 commit comments