1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

77 Commits

Author SHA1 Message Date
Bas Stottelaar
94171b7389 cpu/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:34:12 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Gunar Schorcht
ce431b2343 cpu/esp32: use RTT based RTC implementation 2020-04-07 09:12:44 +02:00
Gunar Schorcht
0e7eb48d6a cpu/esp32: use RTT instead of RTC in pm_layered 2020-04-07 09:12:44 +02:00
Gunar Schorcht
f67cb48f6d cpu/esp32: add RTT counter implementation
fixup! cpu/esp32: add RTT counter implementation
2020-04-07 09:12:44 +02:00
Gunar Schorcht
85b18a1c10 cpu/esp32: fix wake-up sources for sleep modes
When entering a sleep mode, all wake-up sources should first be disabled before the wake-up sources required for the sleep mode are then stepwise enabled again. Otherwise, an wake-up configuration of one sleep mode may affect the wake-up within another sleep mode.
2020-03-29 12:55:50 +02:00
Gunar Schorcht
4f977316fe cpu/esp_common: stop WiFi interface before sleep/reboot
The WiFi interface should be stopped before reboot or sleep. But stopping the WiFi interface disconnects an existing connection. Usually, esp_wifi_netdev tries to reconnect on an disconnect event. However, trying reconnect with a stopped WiFi interface may lead to a crash. Therefore, the stop event has to be handled.
2020-03-23 12:38:36 +01:00
Gunar Schorcht
09899e4b8d cpu/esp32/periph_gpio: funcs for enter/exit sleep 2020-03-23 12:38:36 +01:00
Gunar Schorcht
f4aa253645 cpu/esp32/periph_rtc: funcs for enter/exit sleep 2020-03-23 12:38:36 +01:00
Gunar Schorcht
dff74a3278 cpu/esp32: add pm_layered support 2020-03-23 12:38:36 +01:00
Gunar Schorcht
a7652df499 cpu/esp32: function to set gpio drive strength 2020-03-23 12:25:47 +01:00
Gunar Schorcht
15ea6feeaf cpu/esp32: use hibernate mode for pm_off
Now, where the vendor files for light/deep sleep mode are added, function `pm_off` does not need to implement this mode by itself. Instead the existing deep sleep with disabled wakeup sources is used for pm_off.
2020-03-23 12:25:47 +01:00
Gunar Schorcht
3faf99a894 cpu/esp32: add vendor files for light/deep sleep 2020-03-23 12:25:47 +01:00
Gunar Schorcht
2cbf90d9fe cpu/esp32: small fix of rtc_init for light sleep
`rtc_init` is used after light sleep to update the system time from RTC timer. The fix corrects a small difference of about 230 ms which would sum up with each wakeup from light sleep.
2020-03-22 23:53:02 +01:00
Gunar Schorcht
825b01e8e1 cpu/esp32: remove gpio_config_sleep_mode func
The function were used to set the GPIO pads in sleep mode. This function isn't required for deep or light sleep.
2020-03-22 23:53:02 +01:00
Benjamin Valentin
1ca26adde8 cpu/esp32: rtc: use rtc_mktime() for Y2038k
By using a custom EPOCH for the RTC implementation, we can extend the
range of the 32 bit counter based RTC by 118 years.

It also reduces the code size compared to the stdlib based POSIX functions.
2020-03-03 11:01:02 +01:00
Gunar Schorcht
350a0bbbb3 cpu/esp32: remove extra isync from periph/timer 2020-02-21 09:09:34 +01:00
Gunar Schorcht
05faec7cf8 cpu/esp*: move periph/i2c_sw to esp/common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
0292f8b6a3 cpu/esp*: move periph/hwrng to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
d90164b19a cpu/esp*: move perioph/spi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
66ee155562 cpu/esp*: move periph/flash to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b0517c6733 cpu/esp*: move periph/uart to cpu/esp_common
tmp
2020-02-21 09:09:34 +01:00
benpicco
66c7c63c94
Merge pull request #13061 from gschorcht/cpu/esp32/rtc_xtal_32k
cpu/esp32: allow external 32 kHz crystal for the RTC hardware timer
2020-02-07 10:24:22 +01:00
Gunar Schorcht
4c0cfdcc8e cpu/esp32: allow external 32 kHz crystal for RTC 2020-02-07 00:46:16 +01:00
Marian Buschsieweke
746e4d2fba
cpu/esp32/periph: adc_sample() now returns int32_t 2020-01-10 14:13:14 +01:00
Gunar Schorcht
25d04c4742 cpu/esp32: fixes and cleanups of RTC timer
- Unecessary definitions are removed.

- Since the 48-bit RTC hardware timer uses a RC oscillator as clock, it is pretty inaccurate and leads to a RTC time deviation of up to 3 seconds per minute. Therefore, a calibration during the boot time determines a correction factor for the 48-bit RTC hardware timer. Function _rtc_time_to_us uses now this correction factor and converts a raw 48-bit RTC time to a corrected time in microseconds. Thus, the 48-bit RTC timer becomes much more accurate, but it can't still reach the accuracy of the PLL driven 64-bit system timer. The Advantage of using RTC over 64-bit sydtem timer is that it also continues in deep sleep mode and after software reset.

- If the 64-bit system timer is used to emulate the RTC timer, it uses the RTC hardware timer to continue its operation after software .
2019-12-26 18:13:10 +01:00
Gunar Schorcht
21b2c8d334 cpu/esp32: introduce pseudomodule esp_rtc_timer
It is possible to use different timers as RTC timer for the periph_rtc module. Either the 48-bit RTC hardware timer is used directly or the PLL driven 64-bit system timer emulates a RTC timer. The latter one is much more accurate. Pseudomodule esp_rtc_timer controlls which timer is used. Only if esp_rtc_timer is enabled explicitly, the 48-bit RTC hardware timer is used. Otherwise the 64-bit sytstem timer is used to emulate the RTC timer.
2019-12-25 09:47:52 +01:00
Gunar Schorcht
8d25e6909e cpu/esp32: module to print startup info
Startup information, including board configuration, is only printed when module esp_log_startup is used. This reduces the amount of information that is printed by default to the console during the startup. The user can enable module esp_log_startup to get the additional startup information.
2019-11-28 18:59:09 +01:00
Gunar Schorcht
e3bb708e4d cpu/esp32/periph: flush UART TX FIFO before a baudrate change 2019-11-28 08:57:26 +01:00
a8c3c6ab68 cpu/esp32: fix typos 2019-11-23 22:39:36 +01:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Gunar Schorcht
5d51c03af9 cpu/esp32: replace ets_printf by printf
Wherever possible, ets_printf is replaced by newlib printf.
2019-11-22 11:11:19 +01:00
Gunar Schorcht
db945bdd86 cpu/esp32: fix CS handling in spi_transfer_bytes
If `SPI_CS_UNDEF` is given as the `cs` parameter, CS pin must not be handled by the driver. Furthermore, if `cont` parameter is true, CS pin must not be disabled at the end of one transfer.
2019-10-22 08:14:49 +02:00
Gunar Schorcht
02d81b717e
Merge pull request #12063 from maribu/i2c_release
drivers/periph/i2c: Updated i2c_release() to return void
2019-10-01 19:50:38 +02:00
benpicco
52bf448a3b
Merge pull request #12035 from gschorcht/cpu/esp32/fix_periph_flash
cpu/esp32: fix and improve periph/flash
2019-10-01 10:22:06 +02:00
Martine Lenders
1598c8c6f8
Merge pull request #11950 from gschorcht/cpu/esp32/periph-gpio_read-fix
cpu/esp32: fix of gpio_read for output ports
2019-09-24 20:20:40 +02:00
Gunar Schorcht
fc5692d67c cpu/esp32: driver for ESP32 CAN as periph_can 2019-09-20 19:39:23 +02:00
Gunar Schorcht
cb8b1b12c1 cpu/esp32: fix errno for I2C addr ack error
fixup! cpu/esp32: fix errno for I2C addr ack error
2019-09-05 10:35:02 +02:00
Marian Buschsieweke
a4810f3276
cpu/esp32: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Gunar Schorcht
5fc015e31b cpu/esp32: fix periph_flash param checks for mtd 2019-08-21 01:16:47 +02:00
Gunar Schorcht
c6d33cf5de cpu/esp32: erase improvement for periph_flash
Performance of erasing the whole flash is drastically improved by erasing blocks of 64 kbyte, if possible, instead of erasing sectors of 4 kByte.
2019-08-20 01:56:38 +02:00
Gunar Schorcht
1c60e175ca cpu/esp32: fix periph_flash timing problems
While deleting multiple sectors in flash, interrupts were disabled over the whole time. Thus, deleting the entire flash led to the triggering of the watchdog timer and thus to a restart. Therefore, the interrupts and the cache are disabled only for the time of deleting a single sector. The same problem occurred for read and write large data sets.
2019-08-20 01:51:05 +02:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Gunar Schorcht
9772562359 cpu/esp32: fix of gpio_read for output ports
Although it isn't explicitly specified in API, gpio_read should return the last written output value for output ports. Since the handling of inputs and outputs is strictly separated by several registers in ESP32, gpio_read returned always the initial value of the input register. Therefore, a case distinction had to make. While for input ports the real value has to be read from the input register, the last written value for the output port has to be read from the output register.
2019-08-01 15:22:02 +02:00
Leandro Lanzieri
44d981947d
Merge pull request #11293 from gschorcht/cpu/esp32/periph/conf/spi
boards/esp32: changes the approach for configurations of SPI interfaces in board definitions
2019-05-14 12:07:19 +02:00
Leandro Lanzieri
ab6d0fe08c
Merge pull request #11292 from gschorcht/cpu/esp32/periph/conf/pwm
boards/esp32: changes the approach for configurations of PWM channels in board definitions
2019-05-13 16:11:05 +02:00
Kevin "Bear Puncher" Weiss
6afb0603aa
Merge pull request #11291 from gschorcht/cpu/esp32/periph/conf/i2c
boards/esp32: changes the approach for configurations of I2C in board definitions
2019-05-09 08:26:01 -07:00
Kevin "Bear Puncher" Weiss
795ad18f2e
Merge pull request #11294 from gschorcht/cpu/esp32/periph/conf/uart
boards/esp32: changes the approach for configurations of UART interfaces in board definitions
2019-05-09 08:25:40 -07:00