Commit graph

138 commits

Author SHA1 Message Date
Ivan Grokhotkov fdfa7e6cc2 Merge branch 'bugfix/sdmmc_timeout' into 'master'
sdmmc: handle card removal when CD is not used

When SD card is removed during transaction, SDMMC peripheral can report
a range of errors, such as timeouts, CRC errors, start/end bit errors.
Under normal conditions (card is inserted), SDMMC peripheral also generates
command done or data done interrupts. When the card is removed, such
interrupts may not be always generated.

This change fixes handling of timeout interrupts and SBE interrupts.
It also adds a one second timeout into the event processing loop. This
timeout allows applications to recover in cases when the SDMMC peripheral
doesn’t generate command/data done event on card removal.

Fixes TW11592.

See merge request !678
2017-04-25 16:27:12 +08:00
Angus Gratton fd3ef4cdfe Merge branch 'bugfix/github_fixes' into 'master'
Various fixes from Github

Some one-line fixes from Github PRs.

See merge request !689
2017-04-21 12:27:32 +08: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
Michael Kellner eeb0aaa09e spidriver: Display length errors correctly
SPI transfer length is bits, not bytes, so the error should indicate bits. Also, there are separate lengths for rx and
tx (confusingly named rxlength and length... if rxlength is 0, length is used). The code checks the tx length for the
rx, so it never validates rxlength.

Originally contributed as part of #511 https://github.com/espressif/esp-idf/pull/511
2017-04-21 11:03:07 +10:00
Jonathan Kaufmann bf82b441ae Fixed bug in ledc_set_fade_with_step where returned while holding critical section.
Merges PR #515 https://github.com/espressif/esp-idf/pull/515
2017-04-21 11:03:07 +10:00
Ivan Grokhotkov 49848eaed5 sdmmc: handle card removal when CD is not used
When SD card is removed during transaction, SDMMC peripheral can report
a range of errors, such as timeouts, CRC errors, start/end bit errors.
Under normal conditions (card is inserted), SDMMC peripheral also generates
command done or data done interrupts. When the card is removed, such
interrupts may not be always generated.

This change fixes handling of timeout interrupts and SBE interrupts.
It also adds a one second timeout into the event processing loop. This
timeout allows applications to recover in cases when the SDMMC peripheral
doesn’t generate command/data done event on card removal.
2017-04-19 12:50:51 +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
Wangjialin 315aa1fcd8 Fix uart tx function block issue
To enable tx empty interrupt each time the tx ringbuffer get filled, so that tx function will not block if tx data length is larger than tx ringbuffer size.
Reported from customer of Audio team.
2017-04-12 16:57:37 +08:00
devsaurus ae94fe04ef components/driver/rmt: Add const qualifier for config and tx data. 2017-04-11 18:55:56 +08:00
devsaurus cc164b0dc3 fix rmt_set_tx_thr_intr_en(): check evt_thresh only in enable path 2017-04-11 18:55:56 +08:00
shinyquagsire23 8e89a136e1 Fix impossible check in uart_set_line_inverse 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
Angus Gratton b9a06e68dd Merge branch 'bugfix/minor_fixes' into 'master'
Minor fixes and PRs cherry-picked from Github



See merge request !602
2017-03-23 17:57:28 +08:00
Angus Gratton 64f26be053 rmt driver: Remove accidental ESP_LOGE in isr handler
Closes #451 https://github.com/espressif/esp-idf/issues/451
2017-03-22 14:33:22 +08:00
Angus Gratton c30bba8c63 rmt driver: Fix parameter & description of rmt_driver_install
Closes #187 https://github.com/espressif/esp-idf/issues/187
2017-03-22 12:30:34 +08:00
Ivan Grokhotkov 9254d2846f Merge branch 'feature/ledc_low_speed_channels' into 'master'
add ledc low speed channels

1. add low speed channels
2. modify example code.

See merge request !490
2017-03-21 15:35:40 +08:00
Ivan Grokhotkov 91d35f01f2 Merge branch 'bugfix/i2c_spikes_on_master_init_#393_from_github' into 'master'
bugfix: I2C spikes on master init

Fix I2C spikes on master init.
Before I2C io init, set high level on SDA/SCK IOs.

Fixes https://github.com/espressif/esp-idf/issues/393

See merge request !593
2017-03-21 15:09:16 +08:00
Ivan Grokhotkov e4e8a903c3 Merge branch 'bugfix/touch_pad_read_takes_too_much_time' into 'master'
modify touch pad read function

The touch pad read function taks too much time within spin lock waiting for the "done bit". (about 7.6ms as we tested)
So we try to use a mutex on the touch read function and any other functions might change the "done bit".

See merge request !543
2017-03-21 14:46:30 +08:00
Wangjialin 1ad68de8b8 bugfix: I2C spikes on master init #393 from github
Fix I2C spikes on master init.
This issue is reported from https://github.com/espressif/esp-idf/issues/393
Before I2C io init, set high level on SDA/SCK IOs.
2017-03-19 17:05:07 +08:00
Wangjialin 94b91ee4af bugfix: i2c driver not working in 'RELEASE' configuration
This issue is reported from https://github.com/espressif/esp-idf/issues/304.
We found that when we operate the hw command registers in I2C struct, sometimes the behaviour would be different in DEBUG/RELEASE optimisation level:

The code looks like this:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;

In DEBUG configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f3ab0:    3388          l32i.n    a8, a3, 12
400f3ab2:    14c882            addi    a8, a8, 20
400f3ab5:    a08840            addx4    a8, a8, a4
400f3ab8:    0020c0            memw
400f3abb:    2898          l32i.n    a9, a8, 8
400f3abd:    0020c0            memw
400f3ac0:    28b8          l32i.n    a11, a8, 8
400f3ac2:    74a090            extui    a10, a9, 0, 8
400f3ac5:    00af92            movi    a9, 0xffffff00
400f3ac8:    109b90            and    a9, a11, a9
400f3acb:    2099a0            or    a9, a9, a10
400f3ace:    0020c0            memw
400f3ad1:    2899          s32i.n    a9, a8, 8

In RELEASE configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f2ba2:    580572            l8ui    a7, a5, 88
400f2ba5:    747070            extui    a7, a7, 0, 8
400f2ba8:    0020c0            memw
400f2bab:    584572            s8i    a7, a5, 88

Looks like the compiler will make it a 8bit operation after optimisation.
But the register value changes from 0x901 to 0x101.
After this 8-bit optimisation, the 11th bit changed from 1 to zero, which caused this error.

We are still trying to find out why that happens, because there might be some risk when operating the register struct.
This is a workaround to avoid "-=" operation on I2C register struct fields.
2017-03-19 16:09:44 +08:00
Wangjialin 7670e93639 Feature: add ledc low speed channels
1. Add low speed channels for LEDC module.
2. Improve fade object allocate mechanism.
3. Improve ledc example, add 2 low speed channels in example.
4. Remove debug code
5. Improve the register bit field name of slow clock.
2017-03-17 17:26:30 +08:00
Wangjialin 5d5b625d0e bugfix: fix uart 2-stop-bit error
Fix uart data bug when stop-bit is set as 2-bit mode.
This is just a software workaround.
2017-03-12 11:38:14 +08:00
Chu Shu Chen 194d4e9ffd fix(touch_pad): modify touch pad read function and touch_pad_deinit
The touch pad read function taks too much time within spin lock waiting for the "done bit". (about 7.6ms as we tested)
So we try to use a mutex on the touch read function and any other functions might change the "done bit".
2017-03-11 11:42:44 +08:00
Angus Gratton e7aea584f5 Merge branch 'bugfix/free_iram' into 'master'
uart driver: Remove ISR from IRAM



See merge request !486
2017-03-03 14:08:10 +08:00
Angus Gratton 3db4402f3c uart driver: Remove UART ISR handler from IRAM
Doesn't change example behaviour, as ISR wasn't being registered as
ESP_INTR_FLAG_IRAM.
2017-03-03 16:17:55 +11:00
Angus Gratton 6ee5a1e492 sdmmc: Use slot width as default slot_config width parameter, instead of 4
Ref #361 https://github.com/espressif/esp-idf/pull/361
2017-03-03 14:59:15 +11:00
Daniel Campora c08a2871e6 sdmmc: Add width field to the slot config.
Therefore if the width is set to 1, you can choose to only
configure the CLK, DAT0 and CMD pins.

Merges #361 https://github.com/espressif/esp-idf/pull/361
2017-03-03 14:59:15 +11:00
Jeroen Domburg e35ebbf813 Use THRESH_DMA_TRANS define everywhere, make code match "smaller or equal" description 2017-02-21 18:27:56 +08:00
Lourens Naudé 04f7d96623 Fix SPI read edges in spi_intr
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-02-21 18:26:03 +08:00
Angus Gratton 4db4e28b6e uart driver docs: Remove references to setting interrupt number
Closes #185 https://github.com/espressif/esp-idf/issues/185
2017-02-20 10:39:29 +11:00
Angus Gratton bfdfcbfaef docs: Add missing peripheral driver docs (ADC, DAC, RTC I/O, I2S) 2017-02-20 10:39:29 +11:00
Angus Gratton 21964a42fb rtc_gpio: Replace RTC_GPIO_IS_VALID_GPIO macro with inline function 2017-02-20 10:39:29 +11:00
Dermot Duffy 33500f2561 Add missing variable initialisation.
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-01-25 21:41:45 +08:00
Jan Schmidt ac412feb69 gpio: Attach gpio intr to the isr_server on the right core.
Make sure GPIO interrupts get attached to the core that
the ISR service routine is running on, otherwise they
don't arrive.
2017-01-20 14:56:59 +11:00
antti f8b5c29346 esp32: add [ignore] tag to some unit test cases for CI
Add ignore tag on unit test cases that are not supported in CI yet
2017-01-18 17:08:20 +08:00
devsaurus d8fb30c930 i2c: fix i2c_get_period name
rename i2s_get_period to i2c_get_period
2017-01-16 02:37:10 +08:00
Jeroen Domburg 356e01545c Add test for spi clock, fix corner cases) 2017-01-11 16:13:33 +08:00
Jeroen Domburg daa2b7cbc9 n, h and l actually are 6-bit; they go from 1 to 64. 2017-01-11 14:13:37 +08:00
Jeroen Domburg a98d07d650 Fix clock divider calculation 2017-01-11 13:01:48 +08:00
Jeroen Domburg ee59fa75f4 Rename SPI Master IO pins to more common terminology, add better explanation to queue_length initialization value 2017-01-11 11:25:56 +08:00
Jeroen Domburg 5eb8eb3855 SPI master: rename transaction flags from SPI_* to SPI_TRANS_*, like the documentation says. Also add some explanation about the SPI signals in the documentation 2017-01-10 14:41:12 +08:00
Ivan Grokhotkov edd924f273 sdmmc: add peripheral driver and protocol layer 2017-01-09 04:51:24 +08:00
Jeroen Domburg 23455de4c2 Add SPI Master driver, example, test and docs 2017-01-06 14:20:32 +08:00
Wang Jia Lin ad1d4500f9 Merge branch 'feature/ledc' into 'master'
driver: ledc update

1. add fading functions.
2. clear up ledc.h
3. update api doc.
4. add ledc example

See merge request !347
2017-01-05 20:05:13 +08:00
Wangjialin 6b5e734901 driver: ledc - update fading functions, add example and doc
1. add fading functions.
2. clear up ledc.c and ledc.h
3. update api doc.
4. add ledc example
5. edit ledc.rst and add readme for example code.
6. add s_ prefix for static global values.
7. add mutex for fade functions
8. minor changes according to the comments.
2017-01-05 17:57:52 +08:00
Wangjialin 9c7cc86793 1. modify i2c_set_pin function
2. update example comments and other minor changes
3. rename API:  i2c_cmd_link_create/i2c_cmd_link_delete (+4 squashed commits)

Squashed commits:
[2e0ac3e] 1. coding style: add one space after condition key words.
2. modify i2c.h, use gpio_num_t instead of int, improve comments of return values
3. add i2c index in index.rst
4. add readme for i2c example
[4991d92] update i2c.doc
[88b672e] driver: i2c

1. add mux and spin lock to run in a thread-safe way.
2. modify example code
[4eb15fe] driver: i2c code

1. add i2c master code
2. add i2c slave code
3. add i2c example code
4. add DRAM_ATTR for I2C array
2017-01-03 00:57:19 +08:00
Tuan PM 5462d98e5a Add i2s driver 2016-12-29 17:29:14 +08:00
Wang Jia Lin 8bcd341fca Merge branch 'buffix/uart_frm_err_parity_err_mismatch' into 'master'
bugfix: uart event mismatch

Fix bug of uart frame error and parity error interrupt mismatch in driver code, which will cause the corresponding interrupt can not be cleared correctly, and will finally cause a interrupt watch dog.

See merge request !335
2016-12-29 13:15:48 +08:00
Ivan Grokhotkov 48c4a10827 Merge branch 'feature/gpio_intr_function' into 'master'
GPIO driver: add per-pin interrupt handlers

1. add ISR handler apis so that users of different layers can hook their own isr handler on different GPIO.
    Audio project has different software layers, they need different gpio isr handler for layer instead of processing all GPIO interrupts in one handler.
    If this kind of calling a handler from isr is not proper, please kindly point out.
2. add gpio example code.
3. update gpio doc.

See merge request !345
2016-12-29 12:36:04 +08:00