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

233 Commits

Author SHA1 Message Date
Benjamin Valentin
5f002ced1f Revert "cpu/sam0_common: UART: implement inverted RX & TX"
This reverts commit 585dc15f99.

I did misunderstand this feature: This only inverts the data
bits (instead of `c` uart will transmit `~c`), not the whole
line level.

This is not very useful on it's own, so revert it.
2021-05-21 12:47:03 +02:00
Benjamin Valentin
69b16dc8a2 cpu/sam0_common: only include RTC/RTT symbols if module is used
This allows to use the sam0 RTT together with the rtt_rtc module.
The idea is to use RTT as a monotonic counter, but still keep track
of the time with the virtual RTC module.
2021-04-30 10:39:51 +02:00
Benjamin Valentin
13fbb7c1a0 cpu/sam0_common: add rtc_tamper_pin_mask() 2021-04-13 10:45:16 +02:00
Benjamin Valentin
9d482c4448 cpu/sam0_common: RTC: only write TAMPCTRL when tamper is enabled
If we configure TAMPCTRL early, GPIO events will set bits in the
TAMPCTRL register.
That means that after a wake-up, we can't tell if the bit was set
because it was the wake-up source or if it was already set by a
run-time GPIO event.
2021-04-13 10:45:16 +02:00
Benjamin Valentin
73dbda99ac cpu/sam0_common: add rtc_get_tamper()
Add a function to query which tamper event woke the CPU from hibernation.
2021-04-13 10:45:16 +02:00
Dylan Laduranty
cf40e0bfed
Merge pull request #16069 from benpicco/cpu/sam0_common/periph/spi-revert
Revert "cpu/sam0_common: SPI: only mux MISO on spi_acquire()"
2021-02-25 19:15:09 +01:00
Benjamin Valentin
a17686b551 Revert "cpu/sam0_common: SPI: only mux MISO on spi_acquire()"
This reverts commit 31bf0c5257.
2021-02-22 19:46:10 +01:00
Benjamin Valentin
56654478d4 sam0/adc: work around ADC errata on SAM D5x/E5x
The ADC SYNCBUSY.SWTRIG gets stuck to '1' after wake-up from Standby Sleep mode.
Ignore the ADC `SYNCBUSY.SWTRIG` status bit, this functionality is not used by
the driver anyway.
2021-02-22 12:39:32 +01:00
Dylan Laduranty
1d0dbb4626
Merge pull request #15846 from benpicco/cpu/sam0_common-spi_fixes
cpu/sam0_common: SPI: MOSI only operation & fix for adafruit-itsybitsy-m4
2021-01-28 09:26:28 +01:00
Benjamin Valentin
31bf0c5257 cpu/sam0_common: SPI: only mux MISO on spi_acquire() 2021-01-26 21:42:06 +01:00
benpicco
98726ded6d
Merge pull request #14662 from benpicco/cpu/samd20
cpu/samd21: add support for SAMD20 & SAM D20 Xplained Pro board
2021-01-26 19:14:36 +01:00
Benjamin Valentin
00a467e86d cpu/sam0_common: SPI: allow to only configure MOSI/CLK
Some slave devices (e.g. LED strips) don't have a back-channel and
will only need MOSI and CLK.
2021-01-24 17:51:44 +01:00
Benjamin Valentin
f11fc64af6 cpu/sam0_common: PWM: fix build on samd20
There is no SYNCBUSY register, so the dummy fallback does not work.
This code path is not used anyway, so just ifdef it out.
2021-01-21 20:29:15 +01:00
Daniel Lockau
ef7cbdb312 cpu/sam0_common/periph/flashpage: fix unaligned writes 2021-01-20 09:55:47 +01:00
Benjamin Valentin
3a7aa5d09a cpu/sam0_common: RTC: add timeout to spurious tamper event
Errate 2.17.4 says:

> Upon enabling the RTC tamper detection feature, a false tamper
> detection *can* be reported by the RTC.

It turns out that this spurious event is not always generated.
If RTC alarm is used and the CPU was previously woken from hibernate
by RTC, it *can* happen that the false tamper event is *not* generated.

In this case, we will block indefinitely on the mutex.

To solve this, add a timeout to the event.
Also poll the event instead of using a mutex, as we have already set
`PM->SLEEPCFG.bit.SLEEPMODE` at this point.
2021-01-12 17:36:40 +01:00
Benjamin Valentin
5b11da01c1 cpu/sam0_common: UART: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
93d27bb9a0 cpu/sam0_common: I2C: add support for SAMD20 2021-01-12 15:48:39 +01:00
ba85c2d9ca
cpu/sam0_common: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
dylad
e98459f414 cpu/saml11: fix GPIO/IOBUS management 2020-12-15 17:00:54 +01:00
Dylan Laduranty
aec905d697
Merge pull request #15620 from benpicco/cpu/sam0_common/dac_startup
cpu/sam0_common: DAC: wait for DAC to be ready
2020-12-15 12:25:32 +01:00
dylad
a1f5b6182d cpu/sam0: add initial Ethernet support 2020-12-13 22:01:50 +01:00
Benjamin Valentin
c5c46ba35b cpu/sam0_common: DAC: wait for DAC to be ready
The DAC can have some start-up delay.
If we try to write to it before it's ready, it will get stuck.

This happens now that `tests/driver_dac_dds` immediately sets a DAC
value after init.

The samd2x class of MCUs doesn't have this bit, but a quick test on
samd10 shows that it might not be nececary there - the DAC does not
get stuck when writing to it immediately after init.
2020-12-13 02:11:36 +01:00
Benjamin Valentin
8f72212eb0 cpu/sam0_common: SPI: add support for QSPI in SPI mode
We can use the QSPI peripheral as an additional (non-Quad) SPI peripheral.
2020-12-11 22:33:08 +01:00
Benjamin Valentin
94c7f40b9c cpu/sam0_common: SPI: add support for SAMD20 2020-12-11 22:33:07 +01:00
Benjamin Valentin
fb2a6b7024 cpu/sam0_common: SPI: cleanup
Insert whitespace and factor out functions to make it easier to
add functionality.
2020-12-11 22:33:07 +01:00
Benjamin Valentin
2845554b4e cpu/sam0_common: flashpage: rename to sam0_flashpage_aux_write()
`flashpage_write_raw()` got renamed to `flashpage_write()`.
Now `sam0_flashpage_aux_write_raw()` is the only remaining 'raw'
function, even though it behaves just like `flashpage_write()`.

So let's also rename that for consistency.
2020-11-17 00:34:31 +01:00
72d7a903a2
sam0: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:41 +01:00
Benjamin Valentin
4e8c461f46 cpu/sam0_common: flashpage: invalidate cache on _lock() 2020-11-10 14:21:47 +01:00
Benjamin Valentin
e6192a13bd cpu/sam0_common: flashpage: support unaligned writes
We can pad the unaligned bytes with 0xFF to make up a whole word that
can be written.
2020-11-10 12:18:47 +01:00
Benjamin Valentin
20f093ede6 cpu/sam0_common: flashpage: introduce functions to write to user page 2020-11-10 12:18:47 +01:00
Leandro Lanzieri
7185edb070
cpu/sam0_common/periph: add periph_rtc_rtt module to Kconfig 2020-11-06 15:57:56 +01:00
Marian Buschsieweke
60802f864a
Merge pull request #15149 from benpicco/cpu/samd21-gclk7
cpu/samd21: improve GCLK7 magic
2020-11-03 18:14:09 +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
fb61443bbd cpu/*: remove unused assert.h include 2020-10-22 11:13:09 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Benjamin Valentin
35d6736d9d cpu/sam0_common: PWM: use named GCLK for disabling peripheral 2020-10-02 23:17:53 +02:00
35f357a9ad
cpu/sam0_common: fix typos
- 'acces' -> 'access'
- 'withing' -> 'within'
2020-10-02 07:58:35 +02:00
Benjamin Valentin
310eb4970c cpu/sam0_common: GPIO: use tamper detection to wake from Deep Sleep
On samd5x only the RTC can wake the CPU from Deep Sleep (pm modes 0 & 1).
The external interrupt controller is disabled, but we can use the tamper
detection of the RTC.

If an gpio interrupt is configured on one of the five tamper detect pins,
those can be used to wake the CPU from Deep Sleep / Hibernate.
2020-09-17 18:46:25 +02:00
Benjamin Valentin
0499d016ad cpu/sam0_common: implement RTC tamper detection 2020-09-17 18:45:50 +02:00
benpicco
5715f5776b
Merge pull request #14804 from bergzand/pr/sam0/gpio_iobus
sam0_common: Use Single-cycle I/O Port for GPIO when available
2020-09-10 23:45:43 +02:00
Dylan Laduranty
4db8a1f602
Merge pull request #14478 from benpicco/cpu/sam0/tc_pwm
cpu/sam0_common: add support to run PWM off TC timers
2020-09-10 23:04:58 +02:00
ddb22a3c56
sam0_common: Use Single-cycle I/O Port for GPIO when available
The Cortex-m0 based ATSAM devices can use the Single-cycle I/O Port for
GPIO. This commit modifies the gpio_t type to use this port when
available. It is mapped back to the peripheral memory space for
configuration access.  When it is not available, the _port_iobus() and
_port() functions behave identical, which is the case for the samd51.
2020-09-10 22:13:24 +02:00
Benjamin Valentin
0437461812 cpu/sam0_common: PWM: add support to run PWM off TC timers 2020-09-10 21:47:03 +02:00
Leandro Lanzieri
2e79e00ca7
treewide: change Kconfig prefix for module symbols
This changes the prefix used for the symbols that reprensent modules
(not the ones generated from USEMODULE).

MOD_ => MODULE_
2020-08-31 09:57:28 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Benjamin Valentin
52a95642d5 sam0/adc: make driver MCU family agnostic
Replace checks for `CPU_SAMD21` with checks for actual defines.
2020-08-24 16:13:18 +02:00
Benjamin Valentin
7ed4979148 cpu/samd5x: define CPU_COMMON_SAMD5X symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
cc7f897cbc cpu/saml1x: define CPU_COMMON_SAML1X symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
5d96151775 cpu/saml21: define CPU_COMMON_SAML21 symbol and use it 2020-08-24 16:13:18 +02:00