doc fixes
This commit is contained in:
parent
daa5848431
commit
96adbabf5c
|
@ -11,7 +11,7 @@ Each DAC is assigned to a dedicated GPIO:
|
|||
|
||||
The DACs are 8-bit, thus the output values are restricted to the range from 0 to 255.
|
||||
|
||||
## dac.disablee()
|
||||
## dac.disable()
|
||||
Disables DAC output on the related GPIO.
|
||||
|
||||
#### Syntax
|
||||
|
|
|
@ -22,7 +22,7 @@ i2s.start(i2s_num, cfg, cb)
|
|||
#### Parameters
|
||||
- `i2s_num` I2S peripheral 0 or 1
|
||||
- `cfg` table containing configuration data:
|
||||
- `mode` I2S work mode. Optional, defaults to `i2s.MODE_MASTER + i2s.MODE_TX` when omitted
|
||||
- `mode` I2S work mode. Optional, defaults to `i2s.MODE_MASTER + i2s.MODE_TX` when omitted.
|
||||
- `i2s.MODE_MASTER`
|
||||
- `i2s.MODE_SLAVE`
|
||||
- `i2s.MODE_TX`
|
||||
|
@ -30,33 +30,33 @@ i2s.start(i2s_num, cfg, cb)
|
|||
- `i2s.MODE_DAC_BUILT_IN`
|
||||
- `i2s.MODE_ADC_BUILT_IN`
|
||||
- `i2s.MODE_PDM`
|
||||
- `rate` audio sample rate. Optional, defauls to 44100 when omitted
|
||||
- `bits` bits per sample. Optional, defaults to 16 when omitted
|
||||
- `channel` channel format of I2S stream. Optional, defaults to `i2s.CHANNEL_RIGHT_LEFT` when omitted
|
||||
- `rate` audio sample rate. Optional, defauls to 44100 when omitted.
|
||||
- `bits` bits per sample. Optional, defaults to 16 when omitted.
|
||||
- `channel` channel format of I2S stream. Optional, defaults to `i2s.CHANNEL_RIGHT_LEFT` when omitted.
|
||||
- `i2s.CHANNEL_RIGHT_LEFT`
|
||||
- `i2s.CHANNEL_ALL_LEFT`
|
||||
- `i2s.CHANNEL_ONLY_LEFT`
|
||||
- `i2s.CHANNEL_ALL_RIGHT`
|
||||
- `i2s.CHANNEL_ONLY_RIGHT`
|
||||
- `format` communicarion format. Optional, defaults to `i2s.FORMAT_I2S + i2s.FORMAT_I2S_MSB` when omitted
|
||||
- `i2s.CHANNEL_ALL_LEFT`
|
||||
- `i2s.CHANNEL_ONLY_LEFT`
|
||||
- `i2s.CHANNEL_ALL_RIGHT`
|
||||
- `i2s.CHANNEL_ONLY_RIGHT`
|
||||
- `format` communication format. Optional, defaults to `i2s.FORMAT_I2S + i2s.FORMAT_I2S_MSB` when omitted.
|
||||
- `i2s.FORMAT_I2S`
|
||||
- `i2s.FORMAT_I2S_MSB`
|
||||
- `i2s.FORMAT_I2S_LSB`
|
||||
- `i2s.FORMAT_PCM`
|
||||
- `i2s.FORMAT_PCM_SHORT`
|
||||
- `i2s.FORMAT_PCM_LONG`
|
||||
- `buffer_count` number of dma buffers. Optional, defaults to 2 when omitted
|
||||
- `buffer_len` size of one dma buffer. Optional, defaults to rate/100
|
||||
- `buffer_count` number of dma buffers. Optional, defaults to 2 when omitted.
|
||||
- `buffer_len` size of one dma buffer. Optional, defaults to rate/100 when omitted.
|
||||
- `bck_pin` clock pin, optional
|
||||
- `ws_pin` WS pin, optional
|
||||
- `data_out_pin` data output pin, optional
|
||||
- `data_in_pin` data input pin, optional
|
||||
- `dac_mode` DAC mode configuration. Optional, defaults to `i2s.DAC_CHANNEL_DISABLE` if omitted
|
||||
- `dac_mode` DAC mode configuration. Optional, defaults to `i2s.DAC_CHANNEL_DISABLE` when omitted.
|
||||
- `i2s.DAC_CHANNEL_DISABLE`
|
||||
- `i2s.DAC_CHANNEL_RIGHT`
|
||||
- `i2s.DAC_CHANNEL_LEFT`
|
||||
- `i2s.DAC_CHANNEL_BOTH`
|
||||
- `adc1_channel` ADC1 channel number 0..7. Optional, defaults to off is omitted
|
||||
- `adc1_channel` ADC1 channel number 0..7. Optional, defaults to off when omitted.
|
||||
- `cb` function called when transmit data is requested or received data is available
|
||||
- the function is called with parameters `i2s_num` and `dir`
|
||||
- `dir` is "tx" for TX data request. Function shall call `i2s.write()`.
|
||||
|
@ -69,7 +69,7 @@ An error is thrown in case of invalid parameters or if the channel failed.
|
|||
|
||||
|
||||
## i2s.stop()
|
||||
Stop I2S bus
|
||||
Stop I2S bus.
|
||||
|
||||
#### Syntax
|
||||
`i2s.stop(i2s_num)`
|
||||
|
@ -84,7 +84,7 @@ An error is thrown in case of invalid parameters or if the channel failed.
|
|||
|
||||
|
||||
## i2s.read()
|
||||
Read data from data-in
|
||||
Read data from I2S receive buffer.
|
||||
|
||||
#### Syntax
|
||||
`i2s.read(i2s_num, size[, wait_ms])`
|
||||
|
@ -92,14 +92,14 @@ Read data from data-in
|
|||
#### Parameters
|
||||
- `i2s_num` I2S peripheral 0 or 1
|
||||
- `size` Bytes to read
|
||||
- `wait_ms` Millisecond to wait if data is not ready. Optional, defaults to 0 (not to wait) if omitted.
|
||||
- `wait_ms` Millisecond to wait if data is not ready. Optional, defaults to 0 (not to wait) when omitted.
|
||||
|
||||
#### Returns
|
||||
Data read from data-in pin. If data is not ready in `wait_ms` millisecond, less than `size` bytes can be returned.
|
||||
|
||||
|
||||
## i2s.write()
|
||||
Write to I2S bus.
|
||||
Write to I2S transmit buffer.
|
||||
|
||||
#### Syntax
|
||||
`i2s.write(i2s_num, data)`
|
||||
|
|
Loading…
Reference in New Issue