fix gpio doc, refer to gpio overview from module docs
This commit is contained in:
parent
209bde603d
commit
52ed168cbe
|
@ -15,7 +15,7 @@ Read DHT11 humidity temperature combo sensor.
|
|||
`dht.read11(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, IO index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
- `status` as defined in Constants
|
||||
|
@ -45,7 +45,7 @@ Read DHT21/22/33/43 and AM2301/2302/2303 humidity temperature combo sensors.
|
|||
`dht.read2x(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, IO index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
- `status` as defined in Constants
|
||||
|
|
|
@ -57,7 +57,7 @@ Read digital GPIO pin value.
|
|||
`gpio.read(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` pin to read, 0 ~ 33 I/O index
|
||||
`pin` pin to read, see [GPIO Overview](#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
0 = low, 1 = high
|
||||
|
@ -70,13 +70,13 @@ Establish or clear a callback function to run on interrupt for a GPIO.
|
|||
`gpio.trig(pin, type [, callback])`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0 ~ 33 I/O index
|
||||
- `pin`, see [GPIO Overview](#gpio-overview)
|
||||
- `type` trigger type, one of
|
||||
- `INTR_UP` for trigger on rising edge
|
||||
- `INTR_DOWN` for trigger on falling edge
|
||||
- `INTR_UP_DOWN` for trigger on both edges
|
||||
- `INTR_LOW` for trigger on low level
|
||||
- `INTR_HIGH` for trigger on high level
|
||||
- `gpio.INTR_UP` for trigger on rising edge
|
||||
- `gpio.INTR_DOWN` for trigger on falling edge
|
||||
- `gpio.INTR_UP_DOWN` for trigger on both edges
|
||||
- `gpio.INTR_LOW` for trigger on low level
|
||||
- `gpio.INTR_HIGH` for trigger on high level
|
||||
- `callback` optional function to be called when trigger fires, trigger is disabled when omitted. Parameters are:
|
||||
- `pin`
|
||||
- `level`
|
||||
|
@ -91,11 +91,11 @@ Configuring wake-from-sleep-on-GPIO-level.
|
|||
`gpio.wakeup(pin, level)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0 ~ 33 I/O index
|
||||
- `pin`, see [GPIO Overview](#gpio-overview)
|
||||
- `level` wake-up level, one of
|
||||
- `INTR_NONE` to disable wake-up
|
||||
- `INTR_LOW` for wake-up on low level
|
||||
- `INTR_HIGH` for wake-up on high level
|
||||
- `gpio.INTR_NONE` to disable wake-up
|
||||
- `gpio.INTR_LOW` for wake-up on low level
|
||||
- `gpio.INTR_HIGH` for wake-up on high level
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
@ -108,8 +108,8 @@ Set digital GPIO pin value.
|
|||
`gpio.write(pin, level)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` pin to write, 0 ~ 33 I/O index
|
||||
- `level` `gpio.HIGH` or `gpio.LOW`
|
||||
- `pin` pin to write, see [GPIO Overview](#gpio-overview)
|
||||
- `level` 1 or 0
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
|
|
@ -83,8 +83,8 @@ Initialize the I²C interface for master mode.
|
|||
|
||||
####Parameters
|
||||
- `id` interface id
|
||||
- `pinSDA` 0~33, IO index
|
||||
- `pinSCL` 0-33, IO index
|
||||
- `pinSDA` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `pinSCL` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `speed` bit rate in Hz, positive integer
|
||||
- `i2c.SLOW` for 100000 Hz, max for `i2c.SW`
|
||||
- `i2c.FAST` for 400000 Hz
|
||||
|
@ -196,8 +196,8 @@ Initialize the I²C interface for slave mode.
|
|||
#### Parameters
|
||||
- `id` interface id, `i2c.HW0` or `i2c.HW1`
|
||||
- `slave_config` table containing slave configuration information
|
||||
- `sda` 0~33, IO index
|
||||
- `scl` 0-33, IO index
|
||||
- `sda` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `scl` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `addr` slave address (7bit or 10bit)
|
||||
- `10bit` enable 10bit addressing with `true`, use 7bit with `false` (optional, defaults to `false` is omitted)
|
||||
- `rxbuf_len` length of receive buffer (optional, defaults to 128 if omitted)
|
||||
|
|
|
@ -55,7 +55,7 @@ Stops forcing power onto the bus. You only need to do this if you used the 'powe
|
|||
`ow.depower(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
@ -71,7 +71,7 @@ Reads a byte.
|
|||
`ow.read(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
byte read from slave device
|
||||
|
@ -83,7 +83,7 @@ Reads multi bytes.
|
|||
`ow.read_bytes(pin, size)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0~33, I/O index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `size` number of bytes to be read from slave device (up to 256)
|
||||
|
||||
#### Returns
|
||||
|
@ -96,7 +96,7 @@ Performs a 1-Wire reset cycle.
|
|||
`ow.reset(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
- `1` if a device responds with a presence pulse
|
||||
|
@ -109,7 +109,7 @@ Clears the search state so that it will start from the beginning again.
|
|||
`ow.reset_search(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
@ -121,7 +121,7 @@ Looks for the next device.
|
|||
`ow.search(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`rom_code` string with length of 8 upon success. It contains the rom code of slave device. Returns `nil` if search was unsuccessful.
|
||||
|
@ -136,7 +136,7 @@ Issues a 1-Wire rom select command. Make sure you do the `ow.reset(pin)` first.
|
|||
`ow.select(pin, rom)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0~33, I/O index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `rom` string value, len 8, rom code of the slave device
|
||||
|
||||
#### Returns
|
||||
|
@ -204,7 +204,7 @@ Sets a pin in onewire mode.
|
|||
`ow.setup(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
@ -216,7 +216,7 @@ Issues a 1-Wire rom skip command, to address all on bus.
|
|||
`ow.skip(pin)`
|
||||
|
||||
#### Parameters
|
||||
`pin` 0~33, I/O index
|
||||
`pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
@ -228,7 +228,7 @@ Sets up the search to find the device type `family_code`. The search itself has
|
|||
`ow.target_search(pin, family_code)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0~33, I/O index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `family_code` byte for family code
|
||||
|
||||
#### Returns
|
||||
|
@ -244,7 +244,7 @@ Writes a byte. If `power` is 1 then the wire is held high at the end for parasit
|
|||
`ow.write(pin, v, power)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0~33, I/O index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `v` byte to be written to slave device
|
||||
- `power` 1 for wire being held high for parasitically powered devices
|
||||
|
||||
|
@ -261,7 +261,7 @@ Writes multi bytes. If `power` is 1 then the wire is held high at the end for pa
|
|||
`ow.write_bytes(pin, buf, power)`
|
||||
|
||||
#### Parameters
|
||||
- `pin` 0~33, IO index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `buf` string to be written to slave device
|
||||
- `power` 1 for wire being held high for parasitically powered devices
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ Routes the sigma-delta channel to the specified pin. Target prescale and duty va
|
|||
|
||||
#### Parameters
|
||||
- `channel` 0~7, sigma-delta channel index
|
||||
- `pin` 0~33, IO index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
|
||||
#### Returns
|
||||
`nil`
|
||||
|
|
|
@ -18,7 +18,7 @@ Send data to up to 8 led strip using its native format which is generally Green,
|
|||
|
||||
#### Parameters
|
||||
Variable number of tables, each describing a single strip. Required elements are:
|
||||
- `pin` 0 ~ 33, I/O index
|
||||
- `pin` IO index, see [GPIO Overview](gpio.md#gpio-overview)
|
||||
- `data` payload to be sent to one or more WS2812 like leds through GPIO2
|
||||
|
||||
Payload type could be:
|
||||
|
@ -316,6 +316,3 @@ The concatenated buffer.
|
|||
```
|
||||
ws2812.write({pin = 4, data = buffer1 .. buffer2})
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue