Skip to content

Commit e8ca1bb

Browse files
lpradermkellner
authored andcommitted
MCP230XX doc formatting update
1 parent 0308b27 commit e8ca1bb

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

documentation/drivers/MCP230XX/MCP230XX.md

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The [MCP23008](http://www.microchip.com/wwwproducts/en/MCP23008) device provides
88

99
The [MCP23017](http://www.microchip.com/wwwproducts/en/MCP23017) device provides 16-bit, general purpose, parallel I/O expansion for I2C bus applications. (Description from MCP23017 product page)
1010

11-
## Module "MCP230XX"
11+
### Module "MCP230XX"
1212

1313
The driver module "MCP230XX" exports the following:
1414

@@ -19,7 +19,7 @@ export {
1919
};
2020
```
2121

22-
## MCP23008 Class
22+
### MCP23008 Class
2323

2424
The `MCP23008` class produces instances that represent a single MCP23008 IC on the I2C bus. The `MCP23008` class extends an internal `Expander` class, which extends the `SMBus` class. `Expander` is not exported.
2525

@@ -46,9 +46,9 @@ export default function() {
4646

4747
![](ESP8266-MCP23008-leds.png)
4848

49-
### Constructor Description
49+
#### Constructor Description
5050

51-
#### `MCP23008([dictionary])`
51+
##### `MCP23008([dictionary])`
5252

5353
| Argument | Type | Description |
5454
| --- | --- | :--- |
@@ -60,7 +60,7 @@ let leds = new MCP23008({ sda: 4, scl: 5 });
6060
```
6161

6262
<a id="MCP23008-dictionary"></a>
63-
### Dictionary
63+
#### Dictionary
6464

6565
| Parameter | Type | Default Value | Description
6666
| --- | --- | --- | :--- |
@@ -71,7 +71,7 @@ let leds = new MCP23008({ sda: 4, scl: 5 });
7171
| `inputs` | `number` (byte) | `0b11111111` | A byte representing the input/output initialization state of the 8 GPIO pins. `1` for input, `0` for output |
7272
| `pullups` | `number` (byte) | `0b00000000` | A byte representing the pullup initialization state of the 8 GPIO pins. `1` for pullup, `0` for default |
7373

74-
### Properties
74+
#### Properties
7575

7676
All properties are read-only.
7777

@@ -84,9 +84,9 @@ All properties are read-only.
8484
| `GPPU` | `number` | `0x09` | `GPPU` register |
8585
| 0-8 | `pin` | | `Pin` instances (see the section [Pin Class](#pin-class)) |
8686

87-
### Methods
87+
#### Methods
8888

89-
#### `bankWrite(byte)`
89+
##### `bankWrite(byte)`
9090

9191
Temporarily sets the mode of all pins to output and writes all pins at once.
9292

@@ -95,7 +95,7 @@ let expander = new MCP23008(); // defaults to 0x20!
9595
expander.bankWrite(0b11111111); // Set all pins to 1
9696
```
9797

98-
#### `bankRead()`
98+
##### `bankRead()`
9999

100100
Temporarily sets the mode of all pins to input, reads all pins at once, and returns their values.
101101

@@ -105,7 +105,7 @@ trace(`${expander.bankRead()}\n`);
105105
```
106106

107107

108-
## MCP23017 Class
108+
### MCP23017 Class
109109

110110
The `MCP23017` class produces instances that represent a single MCP23017 IC on the I2C bus. The `MCP23017` class extends an internal `Expander` class, which extends the `SMBus` class.
111111

@@ -132,9 +132,9 @@ export default function() {
132132

133133
![](ESP8266-MCP23017-leds.png)
134134

135-
### Constructor Description
135+
#### Constructor Description
136136

137-
#### `MCP23017([dictionary])`
137+
##### `MCP23017([dictionary])`
138138

139139
| Argument | Type | Description |
140140
| --- | --- | :--- |
@@ -146,7 +146,7 @@ let leds = new MCP23017({ sda: 4, scl: 5 });
146146
```
147147

148148
<a id="MCP23017-dictionary"></a>
149-
### Dictionary
149+
#### Dictionary
150150

151151
| Parameter | Type | Default Value | Description
152152
| --- | --- | --- | :--- |
@@ -157,7 +157,7 @@ let leds = new MCP23017({ sda: 4, scl: 5 });
157157
| `inputs` | `number` (word) | `0b1111111111111111` | A word representing the input/output initialization state of the 16 GPIO pins. `1` for input, `0` for output |
158158
| `pullups` | `number` (word) | `0b0000000000000000` | A word representing the pullup initialization state of the 16 GPIO pins. `1` for pullup, `0` for default |
159159

160-
### Properties
160+
#### Properties
161161

162162
All properties are read-only.
163163

@@ -171,9 +171,9 @@ All properties are read-only.
171171
| 0-16 | `pin` | | `Pin` instances (see the section [Pin Class](#pin-class)) |
172172

173173

174-
### Methods
174+
#### Methods
175175

176-
#### `bankWrite(word)`
176+
##### `bankWrite(word)`
177177

178178
Temporarily sets the mode of all pins to output and writes all pins at once.
179179

@@ -182,7 +182,7 @@ let expander = new MCP23017(); // defaults to 0x20!
182182
expander.bankWrite(0b1111111111111111); // Set all pins to 1
183183
```
184184

185-
#### `bankRead()`
185+
##### `bankRead()`
186186

187187
Temporarily sets the mode of all pins to input, reads all pins at once, and returns their values.
188188

@@ -191,7 +191,7 @@ let expander = new MCP23017(); // defaults to 0x20!
191191
trace(`${expander.bankRead()}\n`);
192192
```
193193

194-
## Pin Class
194+
### Pin Class
195195

196196
The `Pin` class represents a single pin within a `MCP23008` or `MCP23017` instance object. The class is not exported; `Pin` instances are automatically created by `MCP23008` and `MCP23017` instances.
197197

@@ -218,54 +218,51 @@ export default function() {
218218

219219
![](ESP8266-MCP23008-leds.png)
220220

221-
### Constructor Description
221+
#### Constructor Description
222222

223-
#### `Pin(dictionary)`
223+
##### `Pin(dictionary)`
224224

225225
| Argument | Type | Description |
226226
| --- | --- | :--- |
227227
| `dictionary` | `object` | An object with properties to initialize the result. The required parameters are specified in the [Dictionary](#Pin-dictionary) section below.
228228

229229

230230
<a id="Pin-dictionary"></a>
231-
### Dictionary
231+
#### Dictionary
232232

233233
| Parameter | Type | Description
234234
| --- | --- | :--- |
235235
| `pin` | `number` | The GPIO pin number |
236236
| `expander` | `expander` | The instance of `Expander` that created this `Pin` instance |
237237

238-
### Properties
238+
#### Properties
239239

240240
All properties are read-only.
241241

242-
| Name | Description |
243-
| --- | :--- |
244-
| `pin` | The GPIO pin number |
245-
| `expander` | The instance of `Expander` that this `Pin` belongs to |
246-
242+
| Name | Type | Description |
243+
| --- | --- | :--- |
244+
| `pin` | `number` | The GPIO pin number |
245+
| `expander` | `expander` | The instance of `Expander` that this `Pin` belongs to |
247246

248-
### Methods
247+
#### Methods
249248

250-
#### `mode(mode)`
249+
##### `mode(mode)`
251250

252251
| Argument | Type | Description |
253252
| --- | --- | :--- |
254253
| `mode` | `number` | A number representing the desired mode. May be input, input pullup, or output.
255254

256255
Sets the pin's mode to the specified mode.
257256

258-
#### `read()`
257+
##### `read()`
259258

260259
Sets the pin's mode to input, reads the value of the pin object, and returns the value.
261260

262-
#### `write(value)`
261+
##### `write(value)`
263262

264263
Sets the pin's mode to output and writes the value to the pin object.
265264

266-
267-
268-
## Manifest Example
265+
### Manifest Example
269266

270267
```
271268
{

0 commit comments

Comments
 (0)