Driver update: I2S pdm and built-in DAC
1. Modify I2S DAC built-in mode settings 2. Add I2S pdm mode 3. Correct I2S signal index in full-duplex mode 4. Modify dac output function 5. Add dac pad init functions 6. Modify DAC documentation 7. Add i2s_set_dac_mode API
This commit is contained in:
@@ -22,7 +22,8 @@ Setting DAC channel 1 (GPIO 25) voltage to approx 0.78 of VDD_A voltage (VDD * 2
|
||||
|
||||
...
|
||||
|
||||
dac_out_voltage(DAC_CHANNEL_1, 200);
|
||||
dac_output_enable(DAC_CHANNEL_1);
|
||||
dac_output_voltage(DAC_CHANNEL_1, 200);
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
@@ -40,6 +41,9 @@ Enumerations
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: dac_out_voltage
|
||||
|
||||
|
||||
.. doxygenfunction:: dac_output_voltage
|
||||
.. doxygenfunction:: dac_output_enable
|
||||
.. doxygenfunction:: dac_output_disable
|
||||
.. doxygenfunction:: dac_i2s_enable
|
||||
.. doxygenfunction:: dac_i2s_disable
|
||||
|
||||
@@ -60,7 +60,7 @@ Short example configuring I2S to use internal DAC for analog output::
|
||||
static const i2s_config_t i2s_config = {
|
||||
.mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN,
|
||||
.sample_rate = 44100,
|
||||
.bits_per_sample = 8, /* must be 8 for built-in DAC */
|
||||
.bits_per_sample = 16, /* the DAC module will only take the 8bits from MSB */
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
||||
.communication_format = I2S_COMM_FORMAT_I2S_MSB,
|
||||
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // high interrupt priority
|
||||
@@ -72,7 +72,10 @@ Short example configuring I2S to use internal DAC for analog output::
|
||||
|
||||
i2s_driver_install(i2s_num, &i2s_config, 0, NULL); //install and start i2s driver
|
||||
|
||||
i2s_set_pin(i2s_num, NULL); //for internal DAC
|
||||
i2s_set_pin(i2s_num, NULL); //for internal DAC, this will enable both of the internal channels
|
||||
|
||||
//You can call i2s_set_dac_mode to set built-in DAC output mode.
|
||||
//i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
|
||||
|
||||
i2s_set_sample_rates(i2s_num, 22050); //set sample rates
|
||||
|
||||
@@ -112,11 +115,13 @@ Enumerations
|
||||
.. doxygenenum:: i2s_port_t
|
||||
.. doxygenenum:: i2s_mode_t
|
||||
.. doxygenenum:: i2s_event_type_t
|
||||
.. doxygenenum:: i2s_dac_mode_t
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: i2s_set_pin
|
||||
.. doxygenfunction:: i2s_set_dac_mode
|
||||
.. doxygenfunction:: i2s_driver_install
|
||||
.. doxygenfunction:: i2s_driver_uninstall
|
||||
.. doxygenfunction:: i2s_write_bytes
|
||||
|
||||
Reference in New Issue
Block a user