Skip to content

Commit 5c0a340

Browse files
committed
docs(readme): add intro and links to documentation
1 parent a5c22b2 commit 5c0a340

File tree

9 files changed

+63
-55
lines changed

9 files changed

+63
-55
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717

1818
<br />
1919

20+
Bus and Device classes for [i2c-bus](https://www.npmjs.com/package/i2c-bus), with promised functions.
21+
22+
**You probably don't need this library anymore**. The original purpose of the library was to have `async` methods instead of callbacks. Currently `i2c-bus` support promises.
23+
24+
**Besides that** it is still useful for me to have a class for Bus and Device, and an easy way to catch the errors produced in the bus, as well as typexcript typings. And it saves some time not having to write it for every library.
25+
2026

2127
[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/dark.png)](#table-of-contents)
2228

@@ -50,6 +56,8 @@ npm i async-i2c-bus
5056

5157
The package exports the `Bus`, `Device` and `BusError` classes.
5258

59+
You can check the [full documentation](https://async-i2c-bus.alejandroherr.io/)
60+
5361
### Bus
5462

5563
The `Bus` wraps the original implementation with a `typescript` class.
@@ -152,11 +160,3 @@ class WeatherSensor {
152160
## License
153161

154162
Licensed under [MIT](https://opensource.org/licenses/MIT).
155-
156-
<!-- [![Npm Package](https://img.shields.io/npm/v/homieiot.ts?style=flat-square)](https://www.npmjs.com/package/homieiot.ts)
157-
[![Dependencies](https://img.shields.io/david/AlejandroHerr/homieiot.ts.svg?style=flat-square)](https://david-dm.org/alejandroherr/homieiot.ts)
158-
[![Dev Dependencies](https://img.shields.io/david/dev/AlejandroHerr/homieiot.ts.svg?style=flat-square)](https://david-dm.org/alejandroherr/homieiot.ts?type=dev)
159-
[![CircleCI](https://img.shields.io/circleci/project/github/AlejandroHerr/homieiot.ts/master.svg?style=flat-square&logo=circleci)](https://circleci.com/gh/AlejandroHerr/homieiot.ts)
160-
[![codecov](https://codecov.io/gh/AlejandroHerr/homieiot.ts/branch/master/graph/badge.svg)](https://codecov.io/gh/AlejandroHerr/homieiot.ts)
161-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
162-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) -->

blueprint.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{ template:title }}
22
{{ template:badges}}
33
{{ template:description }}
4+
{{ load:readme/intro.md }}
45
{{ template:toc }}
56
{{ load:readme/installation.md }}
67
{{ load:readme/usage.md }}

docs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
<br />
2121

22+
Bus and Device classes for [i2c-bus](https://www.npmjs.com/package/i2c-bus), with promised functions.
23+
24+
**You probably don't need this library anymore**. The original purpose of the library was to have `async` methods instead of callbacks. Currently `i2c-bus` support promises.
25+
26+
**Besides that** it is still useful for me to have a class for Bus and Device, and an easy way to catch the errors produced in the bus, as well as typexcript typings. And it saves some time not having to write it for every library.
27+
2228
[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/dark.png)](#table-of-contents)
2329

2430
## Table of Contents
@@ -50,6 +56,8 @@ npm i async-i2c-bus
5056

5157
The package exports the `Bus`, `Device` and `BusError` classes.
5258

59+
You can check the [full documentation](https://async-i2c-bus.alejandroherr.io/)
60+
5361
### Bus
5462

5563
The `Bus` wraps the original implementation with a `typescript` class.
@@ -151,11 +159,3 @@ class WeatherSensor {
151159
## License
152160

153161
Licensed under [MIT](https://opensource.org/licenses/MIT).
154-
155-
<!-- [![Npm Package](https://img.shields.io/npm/v/homieiot.ts?style=flat-square)](https://www.npmjs.com/package/homieiot.ts)
156-
[![Dependencies](https://img.shields.io/david/AlejandroHerr/homieiot.ts.svg?style=flat-square)](https://david-dm.org/alejandroherr/homieiot.ts)
157-
[![Dev Dependencies](https://img.shields.io/david/dev/AlejandroHerr/homieiot.ts.svg?style=flat-square)](https://david-dm.org/alejandroherr/homieiot.ts?type=dev)
158-
[![CircleCI](https://img.shields.io/circleci/project/github/AlejandroHerr/homieiot.ts/master.svg?style=flat-square&logo=circleci)](https://circleci.com/gh/AlejandroHerr/homieiot.ts)
159-
[![codecov](https://codecov.io/gh/AlejandroHerr/homieiot.ts/branch/master/graph/badge.svg)](https://codecov.io/gh/AlejandroHerr/homieiot.ts)
160-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
161-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) -->

docs/classes/bus.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
\+ **new Bus**(`__namedParameters`: object): *[Bus](bus.md)*
1212

13-
*Defined in [src/lib/Bus.ts:10](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L10)*
13+
*Defined in [src/lib/Bus.ts:10](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L10)*
1414

1515
**Parameters:**
1616

@@ -28,23 +28,23 @@ Name | Type |
2828

2929
**busNumber**: *number*
3030

31-
*Defined in [src/lib/Bus.ts:8](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L8)*
31+
*Defined in [src/lib/Bus.ts:8](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L8)*
3232

3333
___
3434

3535
### isOpen
3636

3737
**isOpen**: *boolean* = false
3838

39-
*Defined in [src/lib/Bus.ts:10](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L10)*
39+
*Defined in [src/lib/Bus.ts:10](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L10)*
4040

4141
## Methods
4242

4343
### close
4444

4545
**close**(): *Promise‹this›*
4646

47-
*Defined in [src/lib/Bus.ts:35](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L35)*
47+
*Defined in [src/lib/Bus.ts:35](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L35)*
4848

4949
**Returns:** *Promise‹this›*
5050

@@ -54,7 +54,7 @@ ___
5454

5555
**deviceId**(`address`: number): *Promise‹number›*
5656

57-
*Defined in [src/lib/Bus.ts:205](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L205)*
57+
*Defined in [src/lib/Bus.ts:205](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L205)*
5858

5959
**Parameters:**
6060

@@ -70,7 +70,7 @@ ___
7070

7171
**i2cFuncs**(): *Promise‹I2cFuncs›*
7272

73-
*Defined in [src/lib/Bus.ts:49](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L49)*
73+
*Defined in [src/lib/Bus.ts:49](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L49)*
7474

7575
**Returns:** *Promise‹I2cFuncs›*
7676

@@ -80,7 +80,7 @@ ___
8080

8181
**i2cRead**(`address`: number, `length`: number, `buffer`: Buffer): *Promise‹I2cReadResponse›*
8282

83-
*Defined in [src/lib/Bus.ts:169](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L169)*
83+
*Defined in [src/lib/Bus.ts:169](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L169)*
8484

8585
**Parameters:**
8686

@@ -98,7 +98,7 @@ ___
9898

9999
**i2cWrite**(`address`: number, `length`: number, `buffer`: Buffer): *Promise‹I2cWriteResponse›*
100100

101-
*Defined in [src/lib/Bus.ts:181](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L181)*
101+
*Defined in [src/lib/Bus.ts:181](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L181)*
102102

103103
**Parameters:**
104104

@@ -116,7 +116,7 @@ ___
116116

117117
**open**(): *Promise‹this›*
118118

119-
*Defined in [src/lib/Bus.ts:22](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L22)*
119+
*Defined in [src/lib/Bus.ts:22](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L22)*
120120

121121
**Returns:** *Promise‹this›*
122122

@@ -126,7 +126,7 @@ ___
126126

127127
**readByte**(`address`: number, `command`: number): *Promise‹number›*
128128

129-
*Defined in [src/lib/Bus.ts:61](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L61)*
129+
*Defined in [src/lib/Bus.ts:61](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L61)*
130130

131131
**Parameters:**
132132

@@ -143,7 +143,7 @@ ___
143143

144144
**readI2cBlock**(`address`: number, `command`: number, `length`: number, `buffer`: Buffer): *Promise‹I2cReadResponse›*
145145

146-
*Defined in [src/lib/Bus.ts:85](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L85)*
146+
*Defined in [src/lib/Bus.ts:85](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L85)*
147147

148148
**Parameters:**
149149

@@ -162,7 +162,7 @@ ___
162162

163163
**readWord**(`address`: number, `command`: number): *Promise‹number›*
164164

165-
*Defined in [src/lib/Bus.ts:73](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L73)*
165+
*Defined in [src/lib/Bus.ts:73](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L73)*
166166

167167
**Parameters:**
168168

@@ -179,7 +179,7 @@ ___
179179

180180
**receiveByte**(`address`: number): *Promise‹number›*
181181

182-
*Defined in [src/lib/Bus.ts:97](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L97)*
182+
*Defined in [src/lib/Bus.ts:97](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L97)*
183183

184184
**Parameters:**
185185

@@ -195,7 +195,7 @@ ___
195195

196196
**scan**(`startAddress?`: undefined | number, `endAddress?`: undefined | number): *Promise‹number[]*
197197

198-
*Defined in [src/lib/Bus.ts:193](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L193)*
198+
*Defined in [src/lib/Bus.ts:193](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L193)*
199199

200200
**Parameters:**
201201

@@ -212,7 +212,7 @@ ___
212212

213213
**sendByte**(`address`: number, `byte`: number): *Promise‹this›*
214214

215-
*Defined in [src/lib/Bus.ts:109](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L109)*
215+
*Defined in [src/lib/Bus.ts:109](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L109)*
216216

217217
**Parameters:**
218218

@@ -229,7 +229,7 @@ ___
229229

230230
**writeByte**(`address`: number, `command`: number, `byte`: number): *Promise‹this›*
231231

232-
*Defined in [src/lib/Bus.ts:121](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L121)*
232+
*Defined in [src/lib/Bus.ts:121](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L121)*
233233

234234
**Parameters:**
235235

@@ -247,7 +247,7 @@ ___
247247

248248
**writeI2cBlock**(`address`: number, `command`: number, `length`: number, `buffer`: Buffer): *Promise‹I2cWriteResponse›*
249249

250-
*Defined in [src/lib/Bus.ts:157](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L157)*
250+
*Defined in [src/lib/Bus.ts:157](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L157)*
251251

252252
**Parameters:**
253253

@@ -266,7 +266,7 @@ ___
266266

267267
**writeQuick**(`address`: number, `bit`: 0 | 1): *Promise‹this›*
268268

269-
*Defined in [src/lib/Bus.ts:145](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L145)*
269+
*Defined in [src/lib/Bus.ts:145](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L145)*
270270

271271
**Parameters:**
272272

@@ -283,7 +283,7 @@ ___
283283

284284
**writeWord**(`address`: number, `command`: number, `word`: number): *Promise‹this›*
285285

286-
*Defined in [src/lib/Bus.ts:133](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L133)*
286+
*Defined in [src/lib/Bus.ts:133](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L133)*
287287

288288
**Parameters:**
289289

@@ -301,7 +301,7 @@ ___
301301

302302
**create**(`__namedParameters`: object): *[Bus](bus.md)*
303303

304-
*Defined in [src/lib/Bus.ts:217](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L217)*
304+
*Defined in [src/lib/Bus.ts:217](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L217)*
305305

306306
**Parameters:**
307307

@@ -319,7 +319,7 @@ ___
319319

320320
**createAndOpen**(`__namedParameters`: object): *Promise‹[Bus](bus.md)*
321321

322-
*Defined in [src/lib/Bus.ts:221](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/Bus.ts#L221)*
322+
*Defined in [src/lib/Bus.ts:221](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/Bus.ts#L221)*
323323

324324
**Parameters:**
325325

docs/classes/buserror.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Defined in node_modules/typescript/lib/lib.es5.d.ts:984
5252

5353
**create**(`message`: string): *[BusError](buserror.md)*
5454

55-
*Defined in [src/lib/BusError.ts:2](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/BusError.ts#L2)*
55+
*Defined in [src/lib/BusError.ts:2](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/BusError.ts#L2)*
5656

5757
**Parameters:**
5858

@@ -68,7 +68,7 @@ ___
6868

6969
**createFromError**(`error`: Error): *[BusError](buserror.md)*
7070

71-
*Defined in [src/lib/BusError.ts:15](https://github.com/AlejandroHerr/async-i2c-bus/blob/a580dec/src/lib/BusError.ts#L15)*
71+
*Defined in [src/lib/BusError.ts:15](https://github.com/AlejandroHerr/async-i2c-bus/blob/a5c22b2/src/lib/BusError.ts#L15)*
7272

7373
**Parameters:**
7474

0 commit comments

Comments
 (0)