Commit graph

135 commits

Author SHA1 Message Date
Ivan Grokhotkov
956a28a95c driver: add periph_ctrl support for SDMMC, SDIO slave, CAN, EMAC 2017-09-04 22:43:51 +08:00
michael
b834fcf78a fix(spi_master): this fix the SPI MOSI output missing bug. 2017-09-04 22:43:51 +08:00
Simon Werner
c8d8fb58e7 Fixed incorrect value in comments for GPIO_NUM_33.
Merges https://github.com/espressif/esp-idf/pull/676
2017-08-30 17:55:00 +10:00
Darian Leung
88b05f9391 esp_adc_cal: Added ADC calibration component
Added component containg API that is able to correct raw ADC readings
into a voltage in mV. Also provided a helper function that combines
the process of getting the raw ADC1 reading then converting it to a
voltage in mV. In doing so, the adc1_get_voltage() function of the ADC
driver has been deprecated. Instead there is now adc1_get_raw to obtain
the raw ADC1 reading, and adc1_to_voltage() that gets the raw reading
and converts all in one function. Functions using the deprecated
adc1_get_voltage() have also been updated to use adc1_get_raw().

Conversion is based on ADC characteristics. The characteristics are based
on the ADC's v_ref, herefore the appropriate structure and functions have
been provided to obtain the ADC characteristics.

The existing ADC driver has also been modified by adding a function to
route the internal ADC reference voltage to a GPIO allowing users to measure
it manually.

Relevant documentation has also been updated
2017-08-29 18:43:14 +08:00
Jeroen Domburg
edbeee8326 Merge branch 'bugfix/spi_def_typo_lsbfirst' into 'master'
bugfix(spi_master): fix the definition of ``SPI_DEVICE_BIT_LSBFIRST``.

See merge request !1154
2017-08-29 11:24:31 +08:00
Ivan Grokhotkov
3161854efb Merge branch 'bugfix/spi_hd_rx' into 'master'
fix(spi_dma_rx): add check to avoid using SPI half-duplex mode DMA with both MOSI and MISO phases.

See merge request !1111
2017-08-28 17:36:58 +08:00
Ivan Grokhotkov
b636f81619 Merge branch 'bugfix/spi_command' into 'master'
fix(spi_master): fix the command field to make it more intuitive to use.

See merge request !1119
2017-08-28 10:29:56 +08:00
michael
0cb14f1648 fix(spi_dma_rx): add check to avoid using SPI half-duplex mode DMA with both MOSI and MISO phases. 2017-08-26 02:15:30 +08:00
michael
dd1e6ea296 typo(spi_master): fix the definition of `SPI_DEVICE_BIT_LSBFIRST`.
also fix the documentation of spi_device_transmit.
2017-08-26 02:04:37 +08:00
Wang Jia Lin
f1ecffb46c Merge branch 'bugfix/touch_pad_driver' into 'master'
driver(touch): fix bug and add more features

See merge request !1056
2017-08-23 19:12:39 +08:00
Ivan Grokhotkov
2861f3e88e Merge branch 'bugfix/spi_dma_align' into 'master'
fix(spi_dma): fix the receive error with RX DMA start with non-aligned address.

See merge request !1112
2017-08-22 23:39:53 +08:00
Wangjialin
842caaab21 driver(touch): fix bug and add more features
1. add sens_struct.h
2. add definition of RTCCNTL and RTCIO
3. modify touch pad examples
4. update example code.
5. add comments add option in menuconfig
6. fix issue that pad index 8 and 9 are mismatched
7. add touch_pad_read_filtered() api to get value filtered by iir filter
8. modify touch pad isr func
9. Make the items in perihperal.ld in the sequence of address
10. delete Kconfig for touch pad
11. add touchpad filter APIs to adjust the filter
12. add touch_pad into index.rst
13. add touch_pad in Doxyfile
14. add touch_pad.rst
2017-08-22 21:21:39 +08:00
michael
4c9754726f fix(spi_master): fix the command field to make it more intuitive to use. 2017-08-21 20:37:57 +08:00
michael
a01db5569c fix(spi_dma): fix the receive error with RX DMA start with non-aligned address. 2017-08-18 10:14:49 +08:00
Ivan Grokhotkov
6baf8195ee sdmmc: add support for high speed (HS) mode
By default SD cards are initialized in default speed (DS) mode. Enabling
HS mode requires SWITCH_FUNC command to be sent twice: first time to
query if the card supports switching to HS mode, second time to perform
the switch.

This change implements SWITCH_FUNC command and adds the procedure to
switch to HS mode.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
e6258ac6cb sdmmc: don’t flip word order in MMC_RSP_BITS
MMC_RSP_BITS helper function had a hack that it flipped word order in
the response, assuming that response size is 4 words. This hack does not
work for responses which are not 4 words long (such as the SWITCH_FUNC
response, which is 64 words long).

This change removes the hack and the matching word order reversal code
in sdmmc driver.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
159a2d01d1 Merge branch 'bugfix/spi_dma' into 'master'
bugfix(spi_master): fix several issues when using RX DMA

See merge request !1006
2017-08-16 18:55:25 +08:00
michael
ed1d084aea fix(spi_master): make the address field more intuitive to use.
The address field should be placed at the highest bits of address and slv_wr_status registers. Instead of breaking the address into two parts and fill in each register, move the address to the highest bits and write to the registers respectively.

Breaking change: if you fill-in the SPI address filed in a previous version in some way and it works correctly, you still have to rewrite the address, in a more intuitive way.
2017-08-15 14:49:31 +08:00
michael
227b011f6a fix(spi_master): fix SPI master, now able to transfer more than 32 bytes in non-DMA-accessable area.
apply for internal space to hold these data.
use DMA when it's enabled, no matter long or short.

TW#12226, github#551
2017-08-14 17:19:57 +08:00
Ivan Grokhotkov
b260f6cb25 Merge branch 'bugfix/sdmmc_unaligned_write' into 'master'
sdmmc: fix reads/writes to/from unaligned buffers

See merge request !1071
2017-08-08 02:55:13 +08:00
Ivan Grokhotkov
dfda0fa67b Merge branch 'feature/add_gpio_drive_capability' into 'master'
feature(gpio): add APIs to set and get pad drive capability.

See merge request !1010
2017-08-07 17:21:42 +08:00
Ivan Grokhotkov
512898edee sdmmc: fix reads/writes to/from unaligned buffers
SDMMC hardware treats all buffers as aligned, and ignores 2 LSBs of
addresses written into DMA descriptors. Previously SDMMC host driver
assumed that data buffers passed from SDDMC command layer would be
aligned. However alignment checks were never implemented in the command
layer, as were the checks that the buffer coming from the application
would be in DMA capable memory. Most of the time this was indeed true.
However in some cases FATFS library can pass buffers offset by 2 bytes
from word boundary. “DMA capable” restriction may be broken if pSRAM
support is used.

This change adds buffer checks to the SDMMC host driver (alignment and
DMA capability), so that the host layer will error out for incompatible
buffers. In SDMMC command layer, a check is added to read and write
functions. If an incompatible buffer is passed from the application, new
buffer (512 bytes size) is allocated, and the transfer is performed
using {READ,WRITE}_SINGLE_BLOCK commands.
2017-08-01 03:15:11 +08:00
Dmitry Yakovlev
e5bb45f381 driver: SD protocol driver for SPI peripheral 2017-07-20 13:43:07 +08:00
Ivan Grokhotkov
5f8785eaec sdmmc: add support for SPI protocol commands 2017-07-20 13:34:21 +08:00
Ivan Grokhotkov
3b96771feb sdmmc: fix probing clock frequency
Probing clock frequency should be 400kHz, not 4MHz.
2017-07-20 13:34:21 +08:00
Ivan Grokhotkov
54dc350907 spi_master: fix duplicate bit mask for SPI_TRANS_MODE_DIOQIO_ADDR 2017-07-20 13:34:21 +08:00
Wangjialin
c30149e4bd feature(gpio): add APIs to set and get pad drive capability. RTC pads use RTC registers to contol drive capability. 2017-07-19 11:23:41 +08:00
Ivan Grokhotkov
cbe23147bf driver/rtc: add support for attaching handlers to RTC_CNTL interrupts 2017-07-10 17:21:49 +08:00
Wangjialin
40fd9db55d bugfix(uart): fix bugs reported from github
1. uart_set_line_inverse API issue, https://github.com/espressif/esp-idf/issues/673
2. tx buffer length issue, https://github.com/espressif/esp-idf/issues/710
2017-06-27 16:41:59 +08:00
krzychb
05f56d1d25 [TW#13322] Typo in documentation, fixes #694 2017-06-19 22:42:22 +02:00
krzychb
30edcca1fb docs: Generate Doxygen directives for API documentation
This is to resolve issue reported in https://github.com/espressif/esp-idf/issues/130.
2017-05-19 18:26:02 +02:00
zelll
0b447db8d8 uart driver: Move UART_EVENT_MAX to last
Merges https://github.com/espressif/esp-idf/pull/594
2017-05-17 11:36:13 +10:00
Konstantin Fedorov
31de20a217 docs: Error in gpio_install_isr_service() description
Merges https://github.com/espressif/esp-idf/pull/564
2017-05-17 11:04:17 +10:00
Ivan Grokhotkov
98e15df7f6 examples: add ULP ADC example 2017-05-16 13:15:02 +08:00
Jiang Jiang Jian
a6608648db Merge branch 'driver_merge_tmp/mcpwm' into 'master'
feature: Motor Control PWM(mcpwm) driver and examples



See merge request !698
2017-05-12 18:21:38 +08:00
Wangjialin
1f055d28b8 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
2017-05-12 16:21:02 +08:00
Kewal M Shah
2008f4d88c feature: add Motor Control PWM(mcpwm) driver
1. Name change from chopper to carrier, block diagram update, minor changes to example codes
2. mcpwm_reg.h changed, brought uniformity in comments, worked on suggestions, duty to accept float. Some name changes!
3. Minor readme changes and Indetation
4. Minor change:  move mcpwm_reg.h and mcpwm_struct.h to new path
5. Minor change: addition of BLDC example code and Readme
6. Name changed from epwm to mcpwm
7. Improve the reg name in mcpwm_struct.h
8. Name change chopper>carrier, deadband>deadtime
2017-05-12 15:47:59 +08:00
Jeroen Domburg
8af3fe4e84 Warn against and check for non-DMA-capable pointers being passed to SPI when DMA is used 2017-05-05 12:28:03 +08:00
Angus Gratton
7db85a386a Merge branch 'bugfix/i2s_driver' into 'master'
I2S driver - fixed support for 24 and 32-bits, fixed tx/rx at the same time

- Modify sample can test with 24, 32-bits audio
- Add i2s sample README
- simply i2s_push function
- change sample rates, bits per sample, channel on fly

See merge request !483
2017-04-28 08:00:07 +08:00
krzychb
1a19747678 Getting started guides 2017-04-27 19:51:42 +02:00
Jeroen Domburg
04b901e629 SPI: More MR issues fixed, style fixup 2017-04-27 11:49:04 +08:00
Jeroen Domburg
cecb846450 SPI: Fix comment for 3wire, make GPIO pins GPIO_MODE_INPUT_OUTOUT. Fixes https://github.com/espressif/esp-idf/issues/533 2017-04-27 11:49:04 +08:00
Jeroen Domburg
4c06dca15c SPI: Small fixes according to MR comments 2017-04-27 11:49:04 +08:00
Jeroen Domburg
e9c372bc2d SPI: Split common SPI stuff out of master driver; add slave driver; add workaround for DMA issue. 2017-04-27 11:49:04 +08:00
Tuan PM
fc1ee2666a I2S: fixed support for 24 and 32-bits, fixed tx/rx at the same time and others in log:
Add support 24, 32 bits

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

Add support 24, 32 bits

reduce push function

Modify sample can test with 24, 32-bits

Add i2s sample README

Fixed i2s_set_clk got reset sometime

can changes bit-wide while running

Fix sample rate calculation for DAC mode from @jeroen

modify example can change bits per sample every 5 seconds

cleanup

add comment for bytes_per_sample

update as @angus suggestions

Add i2s_set_clk api

I2S driver bug fixed as following log:

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

limit dma buffer to 4092

change gpio_matrix_*_check to inline function, remove some comments and rename test_i2s function to setup_triangle_sine_waves

for change commit title
2017-04-27 10:00:10 +07:00
Angus Gratton
94a61389ff Merge branch 'bugfix/driver_const_params' into 'master'
components/driver: 'const' all config calls.

Merges PR #519 https://github.com/espressif/esp-idf/pull/519

See merge request !687
2017-04-21 12:25:15 +08:00
Michel Pollet
349a77cb55 components/driver: 'const' all config calls.
Some were, some weren't. They all could/should be.

Signed-off-by: Michel Pollet <buserror@gmail.com>
2017-04-13 18:33:33 +01:00
devsaurus
ae94fe04ef components/driver/rmt: Add const qualifier for config and tx data. 2017-04-11 18:55:56 +08:00
Jeroen Domburg
76295c7a13 Fix timing adjustment needed for higher speeds of SPI master bus. 2017-03-28 11:31:59 +08:00
Ivan Grokhotkov
6ad0a157e3 driver/rtc: add APIs to enable/disable hold function 2017-03-24 10:11:13 +08:00