Commit graph

315 commits

Author SHA1 Message Date
Michael (XIAO Xufeng)
562af8f65e global: move the soc component out of the common list
This MR removes the common dependency from every IDF components to the SOC component.

Currently, in the ``idf_functions.cmake`` script, we include the header path of SOC component by default for all components.
But for better code organization (or maybe also benifits to the compiling speed), we may remove the dependency to SOC components for most components except the driver and kernel related components.

In CMAKE, we have two kinds of header visibilities (set by include path visibility):

(Assume component A --(depends on)--> B, B is the current component)

1. public (``COMPONENT_ADD_INCLUDEDIRS``): means this path is visible to other depending components (A) (visible to A and B)
2. private (``COMPONENT_PRIV_INCLUDEDIRS``): means this path is only visible to source files inside the component (visible to B only)

and we have two kinds of depending ways:

(Assume component A --(depends on)--> B --(depends on)--> C, B is the current component)

1. public (```COMPONENT_REQUIRES```): means B can access to public include path of C. All other components rely on you (A) will also be available for the public headers. (visible to A, B)
2. private (``COMPONENT_PRIV_REQUIRES``): means B can access to public include path of C, but don't propagate this relation to other components (A). (visible to B)

1. remove the common requirement in ``idf_functions.cmake``, this makes the SOC components invisible to all other components by default.
2. if a component (for example, DRIVER) really needs the dependency to SOC, add a private dependency to SOC for it.
3. some other components that don't really depends on the SOC may still meet some errors saying "can't find header soc/...", this is because it's depended component (DRIVER) incorrectly include the header of SOC in its public headers. Moving all this kind of #include into source files, or private headers
4. Fix the include requirements for some file which miss sufficient #include directives. (Previously they include some headers by the long long long header include link)

This is a breaking change. Previous code may depends on the long include chain.
You may need to include the following headers for some files after this commit:

- soc/soc.h
- soc/soc_memory_layout.h
- driver/gpio.h
- esp_sleep.h

The major broken include chain includes:

1. esp_system.h no longer includes esp_sleep.h. The latter includes driver/gpio.h and driver/touch_pad.h.
2. ets_sys.h no longer includes soc/soc.h
3. freertos/portmacro.h no longer includes soc/soc_memory_layout.h

some peripheral headers no longer includes their hw related headers, e.g. rom/gpio.h no longer includes soc/gpio_pins.h and soc/gpio_reg.h

BREAKING CHANGE
2019-04-16 13:21:15 +08:00
Angus Gratton
f871cc5ffa Merge branch 'feat/spi_hal_support' into 'master'
spi_master: refactor and add HAL support

See merge request idf/esp-idf!4159
2019-04-15 07:57:11 +08:00
michael
8a364b4bdf sdmmc: support SDIO over SPI 2019-04-12 02:24:28 +08:00
morris
f5b03c9ea3 misc adjustment of esp32 component 2019-04-03 19:57:46 +08:00
Michael (XIAO Xufeng)
af2fc96ee1 spi_master: refactor and add HAL support 2019-03-28 17:14:50 +08:00
morris
c159984264 separate rom from esp32 component to esp_rom
1. separate rom include files and linkscript to esp_rom
2. modefiy "include rom/xxx.h" to "include esp32/rom/xxx.h"
3. Forward compatible
4. update mqtt
2019-03-21 18:51:45 +08:00
Per Malmberg
36c73e6d70 Easier use of -Wsign-conversion warnings needs changes.
Merges https://github.com/espressif/esp-idf/pull/3129
2019-03-21 15:08:04 +08:00
michael
b812520b19 spi_master: add support for variable dummy length in a same device
Resolves https://github.com/espressif/esp-idf/issues/2741
2019-02-27 02:13:33 +08:00
Angus Gratton
3952d25a99 Merge branch 'feature/add_api_get_rmt_idle_level' into 'master'
feature(rmt):  fixed some RMT related issues.

See merge request idf/esp-idf!3864
2019-02-26 11:57:10 +08:00
Angus Gratton
ca72c3e97b Merge branch 'bugfix/fix_dig_gpio_unable_hold_bug' into 'master'
bugfix(gpio):  fixed digital gpio unable hold bug during deep-sleep.

See merge request idf/esp-idf!3877
2019-02-26 11:56:27 +08:00
Angus Gratton
280d39aedd Merge branch 'bugfix/i2s_pdm_adc_use_apll' into 'master'
bugfix(i2s): allow to use apll in pdm/adc/dac mode

See merge request idf/esp-idf!3800
2019-02-26 11:47:49 +08:00
Darian Leung
099b83af67 CAN: Add functions to clear queues and fix multiple bugs
This commits adds the functions can_clear_transmit_queue() and
can_clear_receive_queue(). Closes #2906

The following bug are fixed:

- CAN_IO_UNUSED is now explicitly cast to enum type. Closes #2825
- Fix multiple documentation errors. Closes #2898, Closes #2794
- can_reconfigure_alerts() returns incorrect current_alerts. Closes #3028
- Add missing header file. Closes #3065
2019-02-18 21:31:33 +08:00
kooho
919a36b6b5 driver(gpio): fixed digital gpio unable hold bug during deep-sleep. 2018-12-18 17:04:12 +08:00
Paul Abbott
be567d3eb5 driver(rmt): Fixed some RMT related issues.
1. Add missing get function to RMT API: rmt_get_idle_level().
2. Suppress error message from rmt_wait_tx_done() if wait_time==0 (allows for polling).
3. Remove the blank lines between parameter lists.

Merges https://github.com/espressif/esp-idf/pull/2666
2018-12-18 13:32:39 +08:00
Jeroen Domburg
d6ee27e313 Merge branch 'feat/spi_check_length_buffer' into 'master'
spi: add checks for slave buffer valid and master length

See merge request idf/esp-idf!3744
2018-12-04 11:48:32 +08:00
kooho
da223fad4e driver(rmt): Add API get rmt channel's status.
closes https://github.com/espressif/esp-idf/issues/1175
closes https://github.com/espressif/esp-idf/issues/2599
closes https://github.com/espressif/esp-idf/issues/2452
2018-11-28 07:20:45 +00:00
Wang Jia Lin
70554e8caa Merge branch 'doc/uart_lightsleep_wakeup_doc' into 'master'
doc(uart):  update the comment of uart_set_wakeup_threshold

See merge request idf/esp-idf!3556
2018-11-28 11:35:56 +08:00
Wangjialin
4b34ae1258 bugfix(i2s): allow to use apll in pdm/adc/dac mode
1. Allow to use apll in pdm mode
2. Add clock frequency configuration for PDM mode
3. Allow to use apll in ADC/DAC mode
2018-11-27 18:41:20 +08:00
michael
cfba157fdd spi_slave: add valid check for DMA buffers
The DMA cannot receive data correctly when the buffer address is not
WORD aligned. Currently we only check whether the buffer is in the DRAM
region.

The DMA always write in WORDs, so the length arguments should also be
multiples of 32 bits.

A check is added to see whether the buffer is WORD aligned and has valid
length.
2018-11-26 03:49:26 +00:00
Mahavir Jain
765bf674d0 i2s: add (optional) support to clear tx descriptor in underflow case
It has been observed that, in case of underflow (data unavailability) in
I2S transmission, previously filled up tx descriptors continue to get
transmitted on line, causing noise in case of audio use case.

This change adds optional `tx_desc_auto_clear` field during I2S driver intialization
than can zero initialize tx descriptor in case of underflow situation in
interrupt handler itself.

Closes: https://github.com/espressif/esp-idf/issues/1789
2018-11-23 14:31:09 +05:30
kooho
33138a3dec driver(i2c): enable I2C master hardware filter by default. 2018-11-23 10:27:59 +08:00
Michael (XIAO Xufeng)
8cddfa35b8 spi: fix the crash when callbacks are not in the IRAM
Introduced in 9c23b8e5 and 4f87a62f. To get higher speed, menuconfig
options are added to put ISR and other functions into the IRAM.  The
interrupt flag ESP_INTR_FLAG_IRAM is also mistakenly set when the ISR is
put into the IRAM. However callbacks, which are wrote by the user, are
called in the master and slave ISR. The user may not be aware of that
these callbacks are not disabled during flash operations. Any cache miss
during flash operation will cause panic.

Essentially IRAM functions and intrrupt flag ESP_INTR_FLAG_IRAM are
different, the latter means not disabling the ISR during flash
operations.  New bus_config flag intr_flags is offered to help set the
interrupt attribute, including priority level, SHARED, IRAM (not
disabled during flash operations).  It introduced a small BREAK to
IDFv3.1 (but the same as IDFv3.0) that the user has to manually set IRAM
flag now (therefore he's aware of the IRAM thing) to void the ISR being
disabled during flash operations.
2018-11-20 13:07:13 +08:00
michael
26626dfbf2 spi: add documents explicitly showing the executing core of the ISR
It is an ESP specific FreeRTOS feature that the ISR is always executed
on the core which calls the interrupt register function. In the SPI
driver, the function is always called in the bus initialization
function.

Hence, the ISR will be executed on the core which initialize the driver.

If the core is starved due to higher priority ISRs, or the interrupt is
disabled on the core (spinlock called, etc.), the ISR will not get
executed and SPI transactions will not be handled.

(MINOR CHANGE)

Resolves https://github.com/espressif/esp-idf/issues/2432.
2018-11-13 11:49:31 +08:00
kooho
ea963c480c driver(uart):update the comment of uart_set_wakeup_threshold
closes https://github.com/espressif/esp-idf/issues/2627
2018-11-05 13:09:12 +08:00
Michael (XIAO Xufeng)
9b5d0f3322 spi: shown owner of spi host explicitly 2018-10-29 20:22:44 +08:00
Krzysztof Budzynski
cd5f8bcf74 MCPWM API doc update 2018-10-10 08:15:23 +08:00
Michael (Xiao Xufeng)
4af51833f3 spi_master: add new polling mode to decrease time cost each transaction 2018-09-20 19:46:46 +08:00
Ivan Grokhotkov
002d913ab6 uart: add function to set light sleep wakeup threshold 2018-09-06 15:40:46 +08:00
Ivan Grokhotkov
1c5522575e driver/gpio: support wakeup function for RTC IOs 2018-09-06 15:40:46 +08:00
Ivan Grokhotkov
97b2281c49 Merge branch 'bugfix/can_driver_multiple_bugs' into 'master'
CAN: Add pm_lock, fix gpio bug, update docs

See merge request idf/esp-idf!3138
2018-09-04 20:34:06 +08:00
Darian Leung
dc3fa14a26 CAN: Add pm_lock, fix gpio bug, update docs
This commit does the following

- Add power management lock to CAN driver so that APB frequency does not change
whilst CAN driver is in use
- Fix incorrect flag in can_transmit()
- Refactor can_driver_install() and can_driver_uninstall() so that critical sections
are shorter
- Fix CAN gpio configuration bug on RX pin. Closes #2302
- Add docs about multiple ID configuration and fix example links
2018-09-01 02:46:05 +08:00
Ivan Grokhotkov
78fab8a0f9 sdmmc: implement partial DDR support
Works for 3.3V eMMC in 4 line mode.
Not implemented:
- DDR mode for SD cards (UHS-I) also need voltage to be switched to 1.8V.
- 8-line DDR mode for eMMC to be implemented later.
2018-08-30 13:11:54 +08:00
Ivan Grokhotkov
de42d99b1d sdmmc: command layer refactoring 2018-08-30 13:11:54 +08:00
sergiu2014
383464749a eMMC/MMC support for ESP32
Merges https://github.com/espressif/esp-idf/pull/1941
Previous work in https://github.com/espressif/esp-idf/pull/590
2018-08-30 11:36:28 +08:00
Angus Gratton
a53a5eeabd Merge branch 'bugfix/add_mutex_for_some_touchpad_apis' into 'master'
fix(touch): add_mutex_for_some_touchpad_apis

See merge request idf/esp-idf!2714
2018-08-08 16:28:28 +08:00
fuzhibo
81c762eb86 fix(touch): add_mutex_for_some_touchpad_apis 2018-08-01 18:06:21 +08:00
kooho
01516abe5a Add some comments in pcnt.h. 2018-07-24 10:33:58 +08:00
Ivan Grokhotkov
baa4613fc1 Merge branch 'bugfix/fix_touchpad_wakeup_status' into 'master'
fix(sleep): swap touchpad num in wakeup status

See merge request idf/esp-idf!2708
2018-07-24 04:08:43 +08:00
Ivan Grokhotkov
c46b8178f2 Merge branch 'bugfix/sdmmc_auto_stop_cmd' into 'master'
sdmmc: enable host auto_stop only for certain commands

See merge request idf/esp-idf!2710
2018-07-18 14:55:45 +08:00
fuzhibo
54a67d92a4 fix(sleep): swap touchpad num in wakeup status 2018-07-17 20:25:06 +08:00
Wang Jia Lin
5480a6b6e5 Merge branch 'bugfix/clear_intr_status_when_enable_intr' into 'master'
driver(gpio): fix the gpio interrupt false triggering issue

See merge request idf/esp-idf!2498
2018-07-17 15:44:00 +08:00
Jiang Jiang Jian
8809fabcd5 Merge branch 'bugfix/ledc_duty_and_freq' into 'master'
bugfix(ledc): fix bugs reported from unit-test and github.

See merge request idf/esp-idf!2735
2018-07-16 12:12:48 +08:00
Angus Gratton
2ae758ebcb Merge branch 'bugfix/spi_sdio_sdkconfig_include' into 'master'
sdio_example/spi: fix sdkconfig include issue

See merge request idf/esp-idf!2756
2018-07-16 08:00:15 +08:00
Ivan Grokhotkov
b354770f42 Merge branch 'bugfix/fixes_from_github' into 'master'
Fixes from Github

See merge request idf/esp-idf!2730
2018-07-13 15:03:50 +08:00
Ivan Grokhotkov
6d46eed8e4 sdmmc: enable host auto_stop only for certain commands
Perviously host send_auto_stop flag would be set for every data
transfer over 1 block long. This caused stop commands to be sent
after CMD53, which shouldn't be done. Fix by adding an explicit list
of commands for which send_auto_stop should be set.
2018-07-13 03:28:10 +00:00
hou wen xiang
5402ace528 driver(gpio) : Fixed the gpio related bug for release v3.1. 2018-07-12 20:19:02 +08:00
Angus Gratton
a67d5d89e0 Replace all DOS line endings with Unix
Command run was:
git ls-tree -r HEAD --name-only | xargs dos2unix
2018-07-12 19:10:37 +08:00
Michael (XIAO Xufeng)
95dbfbe4c0 sdio_example/spi: fix sdkconfig include issue
(MINOR CHANGES)
2018-07-12 15:59:16 +08:00
Wangjialin
ab44c6ecc2 bugfix(ledc): fix bugs reported from unit-test and github.
1. In ledc_set_duty_and_update, return if duty updated. Close https://github.com/espressif/esp-idf/issues/2082
2. fix ledc_set_freq function for low speed mode.
2018-07-10 02:22:23 +08:00
Le-Andrew
a8da9c1b96 Fixed typos on booleans.
Merges https://github.com/espressif/esp-idf/pull/2067
2018-07-09 14:36:06 +08:00