Commit graph

22 commits

Author SHA1 Message Date
Darian Leung
a049e02d96 can: Refactor CAN to use HAL and LowLevel layers
The following commit refactors the CAN driver such that
it is split into HAL and Lowlevel layers. The following
changes have also been made:

- Added bit field members to can_message_t as alternative
  to message flags. Updated examples and docs accordingly
- Register field names and fields of can_dev_t updated
2020-01-09 16:13:51 +08:00
Mahavir Jain
3be94b6952 Merge branch 'bugfix/can_critical_section_logs' into 'master'
can: Fix critical section ESP_LOG functions

Closes IDFGH-2270 and IDF-1067

See merge request espressif/esp-idf!7081
2019-12-26 16:22:17 +08:00
Darian Leung
4c3d49e3f0 can: Fix semaphore take in critical section
This commit fixes can_reconfigure_alerts() which
could lead to a call to xSemaphoreTake() whilst
inside a critical section.

Closes https://github.com/espressif/esp-idf/issues/4277
2019-12-20 22:00:33 +08:00
Darian Leung
b6af587975 can: Fix critical section ESP_LOG functions
This commit removes any function calls within
the CAN driver that result in a call to ESP_LOG
whilst inside a critical section.

These function calls are either moved outside
critical sections (e.g., intr_alloc and gpio
functions), or substituted (e.g., assert()).

Closes https://github.com/espressif/esp-idf/issues/4412
2019-12-20 20:58:48 +08:00
Darian Leung
d2114d70a0 CAN: Fix critical section compliance
This commit makes the CAN driver ISR use the ISR version
of critical section.
2019-10-29 20:06:39 +08:00
Angus Gratton
7ce75a42c7 Merge branch 'master' into feature/esp32s2beta_merge 2019-10-25 15:13:52 +11:00
Darian Leung
434d1d29d1 can: Fix reset mode entry and exit calls
This commit fixes multiple bugs caused by incorrect calls to
can_enter_reset_mode() and can_exit_reset_mode. Example test
scripts also updated to match new runners.
2019-10-25 03:40:43 +08:00
Angus Gratton
ae21d669b9 Merge branch 'master' into feature/esp32s2beta_merge 2019-10-17 18:22:08 +11:00
Angus Gratton
0f1923ab22 Merge branch 'bugfix/o2_build_warnings' into 'master'
Fix -O2 build warnings

Closes IDFGH-1945 and IDFGH-1946

See merge request espressif/esp-idf!6311
2019-10-17 13:09:28 +08:00
Darian
820fd6447d can: Add support for lower bit rates
This commit adds support for lower bit rates in the CAN Driver for
ESP32 Rev 2 or later chips.
2019-10-17 12:33:17 +08:00
Ivan Grokhotkov
6e423d5cf6 drivers/can: fix skipped function calls when assertions disabled
When CONFIG_FREERTOS_ASSERT_DISABLE is set, the function calls wrapped
inside the assertion macros would be removed from the code.

Closes https://github.com/espressif/esp-idf/issues/4143
2019-10-13 15:37:19 +02:00
Angus Gratton
438d513a95 Merge branch 'master' into feature/esp32s2beta_merge 2019-09-16 16:18:48 +10:00
Konstantin Kondrashov
d064cd485c can/driver: Add module reset before enabling 2019-08-09 17:09:56 +08:00
Angus Gratton
04ae56806c Merge branch 'master' into feature/esp32s2beta_update 2019-08-08 15:26:58 +10:00
Angus Gratton
24d26fccde Merge branch 'master' into feature/esp32s2beta_update 2019-08-08 13:44:24 +10:00
Anton Maklakov
afbaf74007 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes) 2019-08-01 16:28:56 +07:00
David Cermak
d127849d80 can: suppress clang tidy warning about nullptr dereference 2019-06-13 16:23:20 +02:00
suda-morris
84b2f9f14d build and link hello-world for esp32s2beta 2019-06-11 13:07:37 +08:00
Konstantin Kondrashov
399d2d2605 all: Using xxx_periph.h
Using xxx_periph.h in whole IDF instead of xxx_reg.h, xxx_struct.h, xxx_channel.h ... .

Cleaned up header files from unnecessary headers (releated to soc/... headers).
2019-06-03 14:15:08 +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
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
Darian Leung
1d2727f4c8 CAN Driver
The following commit contains the first version of the ESP32 CAN Driver.

closes #544
2018-07-04 14:01:57 +08:00