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

176 Commits

Author SHA1 Message Date
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
Juergen Fitschen
ac8a81b8f3 cpu/saml21: disable fast clock if it is not requested 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
Benjamin Valentin
6f2cdb95da cpu/saml21: pm: don't check individual part numbers
Just check if the define is availiable instead.
2020-02-12 11:44:20 +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
Benjamin Valentin
1496149bba cpu/sam0: don't hard-code peripheral clocks
Instead of hard-coding the peripheral clocks to CLOCK_CORECLOCK
introduce helper functions to return the frequency of the individual
GCLKs and use those for baud-rate calculations.

This requires the GCLK to be part of the peripheral's config struct.
While this is already the case for most peripherals, this also adds
it for those where it wasn't used before.

As it defaults to 0 (CLOCK_CORECLOCK) no change is to be expected.
2020-02-04 21:06:21 +01:00
925445d0ff
cpu/sam0: factorize dependencies in Makefile.dep 2020-01-28 13:18:39 +01:00
Benjamin Valentin
0d977b3b3c cpu/sam0_common/periph/uart: implement buffered write
Implement interrupt based uart_write() using a tsrb for the TX buffer.

To enable it, add

    USEMODULE += periph_uart_nonblocking

to your Makefile.
2019-11-27 19:01:00 +01:00
Benjamin Valentin
9df377d699 cpu/sam*: pm: make use of DEBUG_PUTS()
`pm_set()` gets called by the idle thread whose stack is too small
for normal DEBUG()/printf().

Use DEBUG_PUTS() instead to print the static debug strings.
2019-11-22 01:30:03 +01:00
Yegor Yefremov
5b0252b150 doxygen/ADC: don't include overridden typedefs
Add missing #ifndefs to overridden ADC resolution typedefs.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:32 +01:00
Francisco Molina
347a0fc804 cpu/ boards/: remove exports for CPU_FAM 2019-10-18 08:55:33 +02:00
Francisco Molina
5e9b92a326 cpu: remove CPU_ARCH exports 2019-10-18 08:55:33 +02:00
Benjamin Valentin
01b3484ffb cpu/saml21: add definitions for low power SRAM
SAML21 provides 2/4/8 kiB of Low Power SRAM that is retained
in backup mode.

This adds definitions to make that memory availiable to RIOT.
2019-10-01 18:39:40 +02:00
dylad
e189d085b0 cpu/sam0: add support for SAMR34 MCU 2019-09-26 10:48:03 +02:00
Marian Buschsieweke
df27dbef7a
cpu: Moved stdio_init() into cpu_init()
- Removed stdio_init() from newlib's _init(), as this is too late in the boot
  process to allow DEBUG()ing during periph_init()
- Added stdio_init() to the various cpu_init() routines of the ARM CPUs just
  before periph_init()
2019-09-06 16:54:23 +02:00
Benjamin Valentin
7e5088982b cpu: saml21: don't silently ignore missing makefile
-include will throw no error if sam0_common/Makefile.features does not exist.
This may not have been intentional as none of the other sam0 implementations
do this.

Replace it with a normal include.
2019-08-03 14:50:58 +02:00
Benjamin Valentin
a9b0db3ba4 cpu/sam0_common: add hwrng driver 2019-08-03 14:50:58 +02:00
Benjamin Valentin
c9c3cb84bf cpu: saml1x/saml21: setup 32kHz Oscilator in cpu.c
Clock setup does not belong in the peripheral driver.
2019-06-18 13:20:04 +02:00
Benjamin Valentin
46565ad339 cpu: saml1x/saml21: reduce differences in cpu.c
The init code for both MCUs is so alike, but it diverged over time.
Re-order the code, so that it's the same on both families again.
2019-06-18 13:20:04 +02:00
dylad
f7ee2d2e15 cpu/saml21: set PL2 by default 2019-05-30 21:51:13 +02:00
Benjamin Valentin
849dd4cdce sam0_common: make Timer implementation common across all sam0 MCUs
The currently supported SAM0 MCUs (samd21, saml21, saml1x) share the same
Timer peripheral, yet each of them carries it's own copy of the Timer
driver.

This introduces a new timer driver that is common for all sam0 MCUs and
uses structs for configuration instead of defines.
2019-05-21 11:47:59 +02:00
Benjamin Valentin
077056b949 sam0_common: make RTT implementation common across all sam0 MCUs
The currently supported SAM0 MCUs (samd21, saml21, saml1x) share the
same RTC peripheral, yet each of them carries it's own copy of the RTT
driver.

Unify the drivers and move them to sam0_common.
2019-05-09 20:54:00 +02:00
Benjamin Valentin
9aa8c619c1 sam0_common: make RTC implementation common across all sam0 MCUs
The currently supported SAM0 MCUs (samd21, saml21, saml1x) share the
same RTC peripheral, yet each of them carries it's own copy of the RTC
driver.

Unify the drivers and move them to sam0_common.
2019-04-15 22:25:47 +02:00
7cf3510b64
cpu/saml21: extends exti configuration for saml21 variants
Added a configuration for saml21g18a and fixes the configuration for samr30g18a
2019-01-30 09:32:59 +01:00
13654a950b cpu/samr30: add support for samr30g18a
Co-authored-by: biboc <bapclenet@gmail.com>
2018-10-01 10:15:08 +02:00
Juan Carrano
da85094b65 cpu/saml21: Fix possibly uninitialized variable in pm.c. 2018-06-11 18:35:41 +02:00
dylad
20ac4b060d cpu/saml21: fix RTC wrong condition for #if 2018-03-06 21:36:18 +01:00
Joakim Nohlgård
3a9cd9653f saml21: Update FEATURE_PERIPH_PM -> MODULE_PERIPH_PM 2017-12-08 05:22:09 +01:00
smlng
b283b7784c make: fix various compile errors with Wextra
pkg, nordic_softdevice_ble: disable CFLAGS to omit compiler error
        sys, pm_layered: fix casting nonscalar to the same type
        cpu, stm32_common: fix type-limits, remove always true assert
        cpu, stm32f4: fix pointer arithmetic in periph/i2c
        drivers, at86rf2xx: fix type-limits where condition always true
        saul, gpio: fix if no gpio configured for saul
        cpu, saml21: add frequency check to periph/timer
        driver, cc110x: fix unused param and type-limts errors
        boards, wsn430-common: fix old-style-declaration
        make: fix old style definition
        drivers, sdcard_spi: fix old style typedef
        driver, at30tse: remove unnecessary check
        driver, nrf24: fix type-limit
        driver, pn532: change buffer from char to uint8_t
        tests/driver_sdcard: fix type limits
        boards, feather-m0: add missing field inits
        driver, tcs37727: fix type limits
        pkg, emb6: disable some compiler warnings
        tests/emb6: disable some compiler warings
        pkg, openthread: fix sign compare and unused params
        tests/trickle: fix struct init
        tests/pthread_cooperation: fix type limits
        board, mips-malta: remove feature periph_uart
        shell: fix var size for netif command
        gnrc, netif: fix sign-compare
        gnrc, nib: fix sign-compare
        shell: fix output in netif command
        posix: fix type-limits in pthread_cond
2017-11-28 18:31:43 +01:00
Hauke Petersen
89db77710f
Merge pull request #7963 from dylad/opt_sam0_gpio
cpu/sam0: share GPIO configuration
2017-11-13 14:58:56 +01:00
Joakim Nohlgård
e3d5a70e0c cpu/cortexm: Remove leftover _estack declarations
These are leftovers from before the Cortex-M common ISR vectors were
split into vectors_cortexm.c
2017-11-10 15:38:14 +01:00
dylad
a06ace7904 cpu/sam0: share GPIO configuration
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-11-10 10:43:08 +01:00
Hauke Petersen
b3962f8d2c cpu/sam0: removed guards form periph drivers 2017-11-09 12:57:02 +01:00
3ec8126c84 cpu: cortexm: provide periph_pm for all cortexm 2017-11-06 12:01:19 +01:00
a20745b6c5 cpu: make use of Makefile.periph 2017-11-06 12:01:19 +01:00
93246dbedd cpu: sam0: reorganize Makefile.features 2017-11-02 12:59:45 +01:00
Hauke Petersen
938ba0b3c5 Merge pull request #7535 from haukepetersen/opt_cortexm_vectordefs
cpu: use shared Cortex-M base vector table
2017-10-01 21:46:17 +02:00
dylad
1e5262506d cpu/sam0: merge GPIO driver 2017-10-01 14:48:12 +02:00
Hauke Petersen
3ede8e9d95 cpu: force size of CPU specific vector table 2017-09-04 15:13:43 +02:00
Hauke Petersen
1a20ef8223 cpu: unified cortex-m base interrupt vector 2017-09-04 15:13:32 +02:00
dylad
89c885ea40 sam0/uart: merge samd21 & saml21 uart driver
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-08-29 21:26:42 +02:00
Hauke Petersen
10d394802d Merge pull request #6932 from dylad/saml21_multiple_exti
saml21/gpio: Allow multiple EXTI at the same time
2017-08-28 17:35:00 +02:00
24a1aacca2 cpu/sam0: add missing doxygen group definition + cleanup 2017-08-24 14:54:47 +02:00
Francisco Acosta
f2efd88f98 Merge pull request #7129 from haukepetersen/opt_periph_sharetimerset
cpu: add and use shared code for timer_set()
2017-08-01 15:09:48 +02:00
smlng
692cf96297 doc: fix doxygen grouping of cpu periph drivers 2017-06-26 14:42:11 +02:00
biboc
0e41861db0 Change my email address:
<baptiste.clenet@xsoen.com>
to
<bapclenet@gmail.com>
2017-06-19 10:38:16 +02:00
Hauke Petersen
a1499f4190 cpu: add and use shared code for timer_set() 2017-06-02 12:21:56 +02:00
6b0cf6a728 Merge pull request #7027 from dylad/saml21_adc
saml21/adc: initial support
2017-05-12 23:33:47 +02:00
dylad
44dd56c3e8 sam0/adc: merged samd21 & saml21 adc driver
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-05-12 21:02:17 +02:00
8f239e4c61 Merge pull request #6812 from haukepetersen/fix_cortexm_usecommonsleep
cpu/sam0|stm32: use common cortexm_sleep()
2017-05-11 14:44:05 +02:00
dylad
55de3781ca saml21/adc: initial support
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-05-09 22:14:54 +02:00
dylad
600e6ec2ae saml21/gpio: Allow multiple EXTI at the same time
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-04-19 12:43:09 +02:00
dylad
c960eaa491 saml21/gpio: Enable EXTI0 on PB00
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2017-04-09 19:30:50 +02:00
Joakim Nohlgård
339a4da9dc Makefiles: move to new directory /makefiles 2017-04-04 15:11:54 +02:00
Hauke Petersen
190f319066 cpu/sam0|stm32: use common cortexm_sleep() 2017-03-28 20:00:03 +02:00
Hauke Petersen
5c7ed2228d pm_layerd: fix initial value for PM_BLOCKER_INITIAL
the current value was a debugging left-over and should
actually be 0.
2017-03-28 19:32:32 +02:00
Hauke Petersen
4bfce892d3 drivers/periph&cpu: add and use common periph_init() 2017-01-25 16:46:46 +01:00
Hauke Petersen
ea07a6817c cpu/sam0+boards: adapted to new SPI API
- adapted the SPI driver
- merged SPI driver for samr21 and saml21
- adapted all boards using the CPU
2017-01-25 16:46:45 +01:00
245f60edfa cpu: fix typo in author email 2017-01-19 21:45:23 +01:00
Oleg Hahm
d0316fa7ae periph timer: remove timer_irq_(en|dis)able 2017-01-14 15:34:53 +01:00
389870e181 cpu: saml21: re-add periph/pm initialization 2017-01-12 17:48:11 +01:00
Hauke Petersen
6270283033 Merge pull request #6160 from kaspar030/introduce_new_power_management
Introduce new power management
2017-01-12 17:31:49 +01:00
Hauke Petersen
3faf8f6799 Merge pull request #6242 from ant9000/saml21_update_to_xdk3.33
SAM L21 update to ASF xdk 3.33
2017-01-12 17:07:10 +01:00
a8c5fcc5eb cpu: saml21: add periph/pm support 2017-01-12 16:26:02 +01:00
0194091673 remove obsolete lpm code 2017-01-12 11:24:15 +01:00
Hauke Petersen
3a00fe8e49 cpus: make use of cortexm_isr_end() 2016-12-21 11:28:46 +01:00
Antonio Galea
9421152cb8 SAML21: updated periph driver to match ASF-3.33 includes 2016-12-19 18:27:47 +01:00
310e193494 Merge pull request #6224 from haukepetersen/rm_saml21_saml21periphh
cpu/saml21: removed unused saml21_periph.h
2016-12-16 21:07:27 +01:00
Hauke Petersen
74bba2a183 cpu/saml21: removed unused saml21_periph.h 2016-12-15 11:59:54 +01:00
Hauke Petersen
fcb1e68732 cpu/sam0: renamed sam21_common to sam0_common 2016-12-15 11:47:03 +01:00
Hauke Petersen
bfb52afde9 cpu/sam21: unified structure for sam[drl]21 CPUs 2016-12-15 11:39:19 +01:00
Hauke Petersen
2eebf36eb2 cpu/uart: make use of named return values 2016-10-28 10:32:00 +02:00
5ab97fe38b cpu: build cortexm vectors.c without LTO 2016-08-29 13:30:17 +02:00
Joakim Nohlgård
7275f9845f cpu: Conditionally define LITTLE_ENDIAN
Caused problems with redefined macros when building with a recent newlib
2016-07-05 13:22:50 +02:00
Ian Martin
49ae438dd5 doc: eliminate clutter in adc and gpio periph docs 2016-06-29 15:08:32 -04:00
zhuoshuguo
1cbe79a373 CPU: fix include header guards
Fix cpu/lpc2387/include/lpc2387.h
2016-06-08 16:38:20 +02:00
Hauke Petersen
9bd848f113 cpu/saml21: adapted GPIO driver 2016-03-17 14:39:11 +01:00
Hauke Petersen
b23cde98cf cpus: adapted UART implementations to cb type change 2016-03-15 11:02:06 +01:00
Oleg Hahm
1c260c2228 Merge pull request #4655 from bapclenet/SAML21/RTC
Driver RTC for the board SAML21 by FWX
2016-03-09 13:44:50 +01:00
Oleg Hahm
596c25daca Merge pull request #4943 from gebart/pr/while-loops
Use {} notation for empty while loops
2016-03-09 13:42:32 +01:00
Baptiste
455555304c SAML21/RTC: Add RTC driver 2016-03-09 09:28:42 +01:00
6881f65f46 cpu: cortexm*: move cpu_conf.h stuff from cpu.h into cpu_conf_common.h 2016-03-05 18:20:17 +01:00
Joakim Nohlgård
e607de5b95 cpu/saml21: Use {} notation for empty while loops 2016-03-03 16:31:29 +01:00
Peter Kietzmann
c8829a49b8 Merge pull request #4838 from haukepetersen/fix_periph_timerarg
drivers/timer: added callback argument
2016-03-01 08:55:54 +01:00
Joakim Nohlgård
3af809bdfc Merge pull request #4910 from kaspar030/core_header_cleanup
core: header cleanup
2016-02-29 22:48:35 +01:00
Hauke Petersen
b11a3ad74b cpus: adapted timer implementations to API changes 2016-02-29 14:45:00 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
Joakim Nohlgård
f0584f8ee0 cpu/saml21: spi: Cast enum to unsigned int for comparison 2016-02-28 00:09:29 +01:00
Joakim Nohlgård
3d8c8b295d cpu/saml21: Update to match timer_init API change 2016-02-13 21:29:36 +01:00
Hauke Petersen
48a639f8fd cpu/sam21_common: used shared periph_cpu.h 2016-02-08 19:04:28 +01:00
Hauke Petersen
722b342df3 cpu/sam21_common: unified CPUID implementation 2016-02-08 18:55:43 +01:00
Hauke Petersen
ef3169fbf7 cpu/saml21: use sam21_common implementations 2016-02-08 18:45:15 +01:00
Hauke Petersen
940097336a cpu: cleanup and unification of CPUID implementations
- moved definition of CPUID_LEN to periph_cpu.h
- fixed some doxygen
- simplyfied some implementations
2016-02-08 14:36:03 +01:00
Hauke Petersen
ad0abdcadd cpus: use default isr_ctx struct in GPIO drivers 2016-01-27 17:00:37 +01:00
Ludwig Knüpfer
3b2d26b0dc cpu/saml21: fix typo in gpio.c 2015-10-31 17:35:41 +01:00
Hauke Petersen
65673663b5 cpu/saml21: adapted UART driver 2015-10-27 14:59:38 +01:00
Joakim Nohlgård
cbaeccdb90 periph/timer: Drop timer_reset 2015-10-17 20:11:03 +02:00