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
cd5a847684
cpu/sam0_common: define CPU_FAM based on CPU_MODEL
2020-08-24 16:13:18 +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
Benjamin Valentin
e32b0783c4
cpu/samd21: define CPU_COMMON_SAMD21 symbol and use it
2020-08-24 16:13:18 +02:00
Benjamin Valentin
582da9b233
cpu/sam0_common: add script to generate Kconfig files for all parts
...
e.g. Usage:
./sam0_common/dist/kconfig_gen.sh samd51
2020-08-24 16:13:18 +02:00
János Brodbeck
083b3c167f
sam0/adc: add support for samd5x/same5x
...
Add samd5x/same5x support through introducing ADC_DEV as alias for ADC0/ADC1/ADC. ADC (respectively ADC0) is the default if no device is set.
2020-08-19 18:00:29 +02:00
Leandro Lanzieri
7dc6639f59
cpu/cortexm_common: add default Kconfig configuration
2020-08-12 12:22:43 +02:00
Leandro Lanzieri
f4e651e26d
cpu/sam0_common: Add default Kconfig configuration
...
The configuration file is included by samd21 so it is merged when using
Kconfig.
2020-08-12 12:22:42 +02:00
Leandro Lanzieri
0ddd2886b7
cpu/sam0_common: add sam0_common_periph module to Kconfig
2020-08-12 12:22:39 +02:00
benpicco
419ee52ddc
Merge pull request #14711 from benpicco/cpu/sam0_common/gpio-intermediate_irq
...
cpu/sam0_common: GPIO: ignore stale interrupts
2020-08-11 16:32:57 +02:00
benpicco
3ef906c841
Merge pull request #14563 from benpicco/cpu/sam0_common-bitarithm_test_and_clear
...
cpu/sam0_common: GPIO: use bitarithm_test_and_clear()
2020-08-11 14:05:06 +02:00
Francisco
16f47fc893
Merge pull request #14502 from benpicco/cpu/sam0_common/flashpage_cleanup
...
cpu/sam0_common: flashpage: clean up implementation
2020-08-10 08:21:49 +02:00
Benjamin Valentin
d02aa4a6b5
cpu/sam0_common: RTC: use RIOT_EPOCH
2020-08-07 13:24:10 +02:00
Benjamin Valentin
39d71ac671
cpu/sam0_common: GPIO: ignore interrupts when interrupts are disabled
...
If we disable an external interrupt, GPIO events that would generate an interrupt will still set the interrupt flag.
That means once we enable the interrupt again, a stale interrupt will be triggered.
This is surprising and probably not what the user wants, unfortunately the API documentation is not very clear about what to expect.
There is however no way to drop those intermediate interrupts with the current API.
Ignoring the events that occurred while the GPIO interrupt were disabled is probably the right (and expected) thing to.
2020-08-05 16:57:05 +02:00
Leandro Lanzieri
d7dbbb71ac
Merge pull request #14226 from benpicco/cpu/sam0_common/i2c_arbitrary_freqs
...
cpu/sam0_common: i2c: fix BAUD handling & cleanup
2020-08-04 14:49:10 +02:00
Benjamin Valentin
1472d2095c
cpu/sam0_common: i2c: document frequency constraints
2020-08-04 12:13:28 +02:00
Benjamin Valentin
e560042488
cpu/sam0_common: flashpage: split RWWEE and normal functions
...
Move common code into helper functions and extract the commands
that differ between normal and RWWEE page reading / writing.
This cuts down on `#ifdef` use.
2020-08-04 12:00:49 +02:00
Benjamin Valentin
83a56ae666
cpu/sam0_common: merge RTC & RTT implementation
...
The RTC and RTT share the same peripheral, so they can also
share the same code.
This is needed to integrate the Tamper Detection into common
RTC/RTT code.
2020-07-31 22:00:09 +02:00
Benjamin Valentin
cc2a3c9fd3
cpu/sam0_common: GPIO: use bitarithm_test_and_clear()
2020-07-28 12:43:39 +02:00
Benjamin Valentin
003c25b2e8
cpu/sam0_common: uart: document frequency constraints
2020-07-28 11:22:22 +02:00
Benjamin Valentin
e1f84de6c5
cpu/sam0_common: UART: simplify init sequence
...
We don't need to read-modify-write the CTRLA register to disable
the UART.
The entire CTRLA register is re-written just a few lines below, so
we can just set it to 0 to disable the UART.
There is also no need to reset the UART since we re-write all config
registers in init.
2020-07-28 11:22:22 +02:00
Benjamin Valentin
28c1c502bc
cpu/sam0_common: UART: implement arithmetic BAUD mode
...
SAMD20 does not implement a Fractional Baud mode, so we have to
implement Asynchronous Arithmetic mode.
2020-07-28 11:22:22 +02:00
Benjamin Valentin
e6f33fc436
cpu/sam0_common: uart: implement the periph_uart_reconfigure feature
2020-07-28 10:10:15 +02:00
Benjamin Valentin
62dbb21f19
cpu/sam0_common: UART move pin configuration to function
...
Makes the init code easier to read.
2020-07-28 10:10:15 +02:00
Benjamin Valentin
4df36cbfda
cpu/sam0_common: i2c: improve readability of baud rate calculation
...
Use variables to represent fSCL an fGCLK to make the baud rate calculation
more readable.
2020-07-25 15:14:55 +02:00
Benjamin Valentin
2fb0d9061f
cpu/sam0_common: i2c: fix High Speed
2020-07-25 15:14:55 +02:00
Benjamin Valentin
7269dc4e3a
cpu/sam0_common: i2c: allow arbitrary I2C frequencies
...
The Atmel I2C peripheral supports arbitrary I2C frequencies.
Since the `i2c_speed_t` enum just encodes the raw frequency values,
we can just use them in the peripheral definition.
We just have to remove the switch-case block that will generate an error
for values outside of `i2c_speed_t`.
2020-07-25 15:14:55 +02:00
Benjamin Valentin
48340f971f
cpu/sam0_common: flashpage: clean up helper function
2020-07-14 20:50:50 +02:00
benpicco
30ebabb84e
Merge pull request #14007 from benpicco/cpu/sam0_common-pwm
...
cpu/sam0_common: move PWM to common code, add support for saml21, samd5x
2020-07-09 10:01:08 +02:00
Benjamin Valentin
bce7d25f10
cpu/sam0_common: add PWM support for saml2x, samd5x
2020-07-08 21:51:12 +02:00
Francisco
325b7a8d8e
Merge pull request #13631 from benpicco/cpu/sam0_common/spi-deinit
...
drivers/periph/spi: add periph_spi_reconfigure feature & implementation for sam0
2020-06-30 15:34:53 +02:00
Francisco
48bdd7018a
Merge pull request #14302 from fjmolinas/pr_sam0_rtt_opt
...
cpu/sam0_common/rt%: use READREQUEST when accessing CLOCK/COUNT regs
2020-06-24 08:42:03 +02:00
Bas Stottelaar
6774f7e412
Merge pull request #14337 from benpicco/TIMER_CHANNEL_NUMOF
...
use TIMER_CHANNEL_NUMOF instead of TIMER_CHANNELS
2020-06-24 01:19:17 +02:00
Benjamin Valentin
c8ff026640
cpu/sam0_common: use TIMER_CHANNEL_NUMOF
2020-06-24 00:45:35 +02:00
Francisco
a73b61e30b
Merge pull request #14320 from benpicco/cpu/sam0_common-gpio_gclk
...
cpu/sam0_common: GPIO always default to MAIN clock for EXTI, make configurable
2020-06-23 22:48:45 +02:00
Benjamin Valentin
3e91914831
cpu/sam0_common: spi: implement the periph_spi_reconfigure feature
2020-06-21 21:19:17 +02:00
Francisco Molina
bdda25c534
cpu/sam0_common/rt%: issue READREQUEST to access CLOCK/COUNT regs
...
read-synchronized register will stall immediatly when read, instead
issue READREQUEST and wait for sync to be unset.
2020-06-19 14:10:31 +02:00
Benjamin Valentin
c0203ad35c
cpu/sam0_common: GPIO default to MAIN clock for EXTI, make configurable
...
Currently only samd21 used the 32 kHz clock for EXTI which makes it miss fast events.
All newer members of the family use the MAIN clock.
While touching this, also make the clock source configurable to this can be overwritten,
e.g. in the board config if desired.
2020-06-19 13:27:48 +02:00
Francisco
a970163812
Merge pull request #14312 from benpicco/cpu/sam0_common/periph/uart-rxonly
...
cpu/sam0_common: UART: allow RX only configuration
2020-06-19 11:44:10 +02:00
benpicco
c3314e1a0c
Merge pull request #14303 from fjmolinas/pr_sam0_unified_rtt
...
cpu/sam0: unified rtt configuration
2020-06-19 11:30:06 +02:00
Francisco Molina
ff24aa61f3
cpu/sam0_common/periph/rtt: uncrustify
2020-06-19 09:16:24 +02:00
Francisco Molina
15bbd95b6a
cpu/sam0_common/rtt: add configurable RTT_FREQUENCY
2020-06-19 09:16:24 +02:00
Benjamin Valentin
5c3ae77df9
cpu/sam0_common: UART: allow RX only configuration
2020-06-19 00:33:50 +02:00
Dylan Laduranty
6bf0a41399
Merge pull request #13600 from benpicco/sam0-gpio
...
cpu/sam0_common: GPIO IRQ optimizations
2020-06-17 21:23:19 +02:00
07c78efc83
Merge pull request #14285 from fjmolinas/pr_uart_nb_race
...
sam0/stm32: fix possible uart_nonblocking deadlock
2020-06-17 12:14:25 +02:00
Francisco Molina
80d682becd
cpu/sam0: avoid deadlock on nonblocking write
...
If a write to a full tsrb is attempted with disabled interrupts
or in a interrupt then a deadlock will occure. To avoid this make
space in the ringbuffer by synchronously writing to uart.
2020-06-17 10:01:21 +02:00