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

69 Commits

Author SHA1 Message Date
Dylan Laduranty
0ce8780dfa cpu/saml1x: avoid the use of bitfield
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-05-29 17:45:25 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Benjamin Valentin
9dcb3991d2 cpu/sam0_common: move adc_res_t to common code 2023-01-17 17:18:07 +01:00
Benjamin Valentin
124b849503 cpu: call early_init() 2023-01-08 22:26:12 +01:00
Benjamin Valentin
361a94460a cpu/sam0_common: add ADC pin aliases 2022-08-31 18:23:44 +02:00
Benjamin Valentin
ae664baa58 cpu/saml1x: define ADC pins 2022-05-30 20:41:18 +02:00
Benjamin Valentin
11acdd0526 cpu/samd*: adjust PM_BLOCKER_INITIAL to the new API
For saml1x and samd5x this becomes now obsolete as the default provides
this behavior.
2022-04-06 12:29:25 +02:00
Benjamin Valentin
0340ac6129 cpu: include IDLE in PM_NUM_MODES 2022-04-06 12:29:25 +02:00
ee175fb583
cpu/samx21: allow to override #ifndef PM_BLOCKER_INITIAL 2022-03-11 10:48:12 +01:00
benpicco
e8cbf1ea90
Merge pull request #16681 from benpicco/drivers/dose-collision
drivers/dose: make use of UART collision detection feature
2021-12-08 20:48:28 +01:00
Benjamin Valentin
a51fb298dc cpu/sam0_common: implement periph_uart_collision feature 2021-12-08 17:35:00 +01:00
Benjamin Valentin
669104d841 cpu/sam0_common: SPI: don't perform DMA transfer for small buffers
Setting up a DMA transfer can take longer than sending out a buffer
byte by byte if the buffer is small.

DMA only shows advantages for large buffers, using it for every transfer
will cause a net slowdown.

Since we did not come up with a good way to determine the treshold based
on the SPI frequency, just use a fixed buffer for now so that DMA can be
used without slowing things down overall.
2021-11-19 17:22:51 +01:00
Jean-Pierre De Jesus DIAZ
480e22be66 cpu/sam*: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-11 12:45:15 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Benjamin Valentin
9c1455d55f cpu: make pm_layered a DEFAULT_MODULE
Allow to disable pm_layered in the bootloader to save some ROM.
2021-01-27 13:21:20 +01:00
Benjamin Valentin
8004aa4d34 cpu/sam0_common: not every CPU has DMA 2021-01-12 15:48:37 +01:00
Benjamin Valentin
360c0b27fc cpu/saml1x: add NVM User Page Mapping 2020-11-10 12:18:47 +01:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +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
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
6007a31813
sam0: Add periph_gpio_fast_read feature where applicable 2020-09-10 22:13:25 +02:00
Dylan Laduranty
35536233f9 cpu/saml1x: fix RTT issue in init process
RTT module may get stuck during the init process if the RTC was running from
a previous boot. Unsure we don't remove the peripheral clock during the CPU
init if RTC is active from a previous boot and add a workaround to disable
this module as it will be re-init at some point later by the auto_init module
or by the user's application.
2020-09-09 21:27:48 +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
cc7f897cbc cpu/saml1x: define CPU_COMMON_SAML1X symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
6a490af52b cpu/saml1x: add all parts to Kconfig 2020-08-24 16:11:48 +02:00
6fa2b44c01
saml1x: Remove MPU feature
The MPU on the cortex-m23 has some differences with the MPU on the older
cortex-m devices. It is not implemented in the cortex-m MPU driver. This
removes the available feature as it gives a false sense of security by
advertising the feature, but implementing it with noop's
2020-08-20 14:37:08 +02:00
Leandro Lanzieri
38636a8089
cpu/saml1x: Add Kconfig symbols 2020-07-16 18:09:59 +02:00
Leandro Lanzieri
84de2d8f7b
cpu/saml1x: Specify CPU_FAM only in Makefile.features 2020-07-16 18:09:58 +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
bcfe4bac0b
cpu/saml1x: add unified rtt configuration 2020-06-19 09:16:22 +02:00
Dylan Laduranty
00b14cce27
Merge pull request #14106 from benpicco/cpu/saml1x/pm_deep_flag
cpu/saml1x: pm: set deep flag
2020-06-17 22:02:34 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE 2020-06-16 12:05:40 +02:00
ec1d575e7c
cpu/saml1x: Add DMA peripheral to init 2020-06-12 20:04:05 +02:00
Benjamin Valentin
e1ca9102d5 cpu/saml1x: pm: set deep flag
STANDBY mode is considered Deep Sleep on all other sam0 platforms.
Set it here too to be consistent.
2020-05-20 17:17:11 +02:00
Benjamin Valentin
bfb3d52a63 cpu/sam0_common: implement periph/dac
The sam0 MCUs all have a DAC peripheral.
The DAC has a resulution of 10 or 12 bits and can have one or two
output channels.

The output pins are always hard-wired to PA2 for DAC0 and PA5 for DAC1
if it exists.

On the same54-xpro I would only get a max value of ~1V when using the
internal reference, so I configured it to use an external voltage reference.

The external reference pin is hard-wired to PA3, so you'll have to connect
that to 3.3V to get results.
2020-05-02 18:31:55 +02:00
Benjamin Valentin
7e156dd2e5 cpu/saml1x, saml2x: PM_NUM_MODES is a valid mode
The mode PM_NUM_MODES is the IDLE mode, so do not skip it.
2020-04-01 18:10:23 +02:00
Benjamin Valentin
5d123cbb22 cpu/sam0_common: distribute PM_NUM_MODES among siblings
Also adapt the defines to the documentation

 - CPUs define up to 4 power modes (from zero, the lowest power mode,
   to PM_NUM_MODES-1, the highest)
 - >> there is an implicit extra idle mode (which has the number PM_NUM_MODES) <<

Previously on saml21 this would always generate pm_set(3) which is an illegal state.
Now pm_layered will correctly generate pm_set(2) for IDLE modes.

Idle power consumption dropped from 750µA to 368µA and wake-up from standby is also
possible. (Before it would just enter STANDBY again as the mode register was never
written with the illegal value.)
2020-04-01 18:10:23 +02:00
Dylan Laduranty
6bba4188fc
Merge pull request #13764 from benpicco/cpu/saml11/use_buck_converter
cpu/saml1x: select buck voltage regulator when possible
2020-04-01 14:47:47 +02:00
Benjamin Valentin
895eb943d8 cpu/sam0_common: add cpu_pm_cb_enter()/leave()
This allows to implement needed work-arounds surrounding sleep on
a per-MCU basis.
2020-03-31 17:18:58 +02:00
Benjamin Valentin
005de7024b cpu/saml1x: enable buck voltage regulator
Switch from the on-chip LDO to the on-chip buck voltage regulator.
2020-03-31 17:18:58 +02:00
Leandro Lanzieri
f69427fcf7
cpu/saml1x: Add Kconfig file 2020-03-31 13:39:41 +02:00
68ec8b2c2b
Merge pull request #13391 from kaspar030/mpu_feature
cpu/cortex-m: turn MPU support into a feature
2020-03-04 07:09:40 +01:00
a3c527fdbc cpu/*: add cortex_mpu to known-to-support CPU families 2020-03-03 22:59:41 +01:00
benpicco
0edfd13df0
Merge pull request #13310 from benpicco/sam0-exti-common
cpu/sam0_common: use generic exti_config
2020-02-26 08:40:49 +01:00
Juergen Fitschen
1265efc785 cpu/sam0*: Wrap cortexm_sleep call 2020-02-24 11:48:13 +01:00
Benjamin Valentin
fd9a247200 cpu/sam0_common: use generic exti_config
Creating an `exti_config` array for a new MCU manually is tedious and error prone.
Luckiely all information is already availiable in the vendor files.

Credit for this discovery & method goes to @Sizurka

The file was generated with

```C

int main(void) {
        puts("static const int8_t exti_config[PORT_GROUPS][32] = {");

        for (unsigned port = 1; port < 5; ++port) {
                printf("#if PORT_GROUPS >= %d\n{\n", port);
                for (unsigned pin = 0; pin < 32; ++pin) {
                        printf("#ifdef PIN_P%c%02uA_EIC_EXTINT_NUM\n", '@' + port, pin);
                        printf("    PIN_P%c%02uA_EIC_EXTINT_NUM,\n", '@' + port, pin);
                        printf("#else\n    -1,\n#endif\n");
                }
                printf("},\n#endif\n\n");
        }

        puts("};");

        return 0;
}
```

No changes in generated code are expected, but this makes adding new members
of the sam0 CPU families much easier.
2020-02-20 11:23:51 +01:00
d7c0102115
cpu/cortexm: move CPU_ARCH/FAM to Makefile.features 2020-02-17 16:02:48 +01:00
1a75f26133 cpu/*: update to PM_BLOCKER_INITIAL as single value 2020-02-14 12:06:05 +01:00
Benjamin Valentin
bd1953dd80 cpu/sam0_common: use vendor files to dispatch MCU headers
Instead of manually re-creating the files from ASF, just use
the vendor provided dispatch headers and ease the maintainance
burden.
2020-02-06 19:52:05 +01:00
Benjamin Valentin
38b6ee56f3 cpu/sam0: use defines for GCLK IDs
Give the clocks explicit names to better identify their meaning.
2020-02-04 21:16:54 +01:00