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

35 Commits

Author SHA1 Message Date
Marian Buschsieweke
c2c2cc8592
drivers/periph_gpio: let gpio_read() return bool
Since https://github.com/RIOT-OS/RIOT/pull/20935 gpio_write()
uses a `bool` instead of an `int`. This does the same treatment for
`gpio_read()`.

This does indeed add an instruction to `gpio_read()` implementations.
However, users caring about an instruction more are better served with
`gpio_ll_read()` anyway. And `gpio_read() == 1` is often seen in
newcomer's code, which would now work as expected.
2024-10-23 13:24:09 +02:00
Benjamin Valentin
4627f66caa drivers/periph/gpio: make gpio_write() take a bool 2024-10-22 16:39:48 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
Gerson Fernando Budke
166ee62300
cpu/atxmega: Drop unnecessary test config
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-01 14:12:24 +01:00
Gerson Fernando Budke
549e2b4de1
cpu/atxmega: Fix PM states on peripherals
Fix the required PM state on i2c and spi peripherals.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-01 14:12:23 +01:00
Gerson Fernando Budke
3b9368a99e
cpu/avr8: Enable PM periph to all SoC
This refactor the current xmega PM peripheral to avr8 common and extend
PM to cpus families.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-01 14:12:23 +01:00
Gerson Fernando Budke
783afbc666 cpu/avr8_common: Add AVR8_ISR macro
The current ISR implementation for AVR8 requires use of
avr8_[enter/exit]_isr pair which add some boilerplate on code.
This add AVR8_ISR which clean-up the code and make it simpler
and hides any schedule detail from the user perspective.

This is a preparation for future scheduling and irq optimizations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 20:00:19 +02:00
Gerson Fernando Budke
b7873015aa cpu/avr8_common: Split avr8_state
The avr8_state store state information used to determine scheduling
and uart irq. This move all uart irq states to avr8_state_uart
variable. It introduce the use of General Purpose IO Register 0
(GPIOR0) when available and now all uarts from xmega can be used.

This is a preparation for future scheduling and irq optimizations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 19:01:13 +02:00
Marian Buschsieweke
3227fb3b17
Merge pull request #18619 from maribu/core/mutex/cleanup
core/mutex: clean up
2022-10-03 10:58:07 +02:00
c8a57747dd cpu/atxmega: update ASPACE <-> ASIZE condition 2022-09-27 10:20:22 +02:00
Marian Buschsieweke
0ba5c314c1
cpu/atxmega: add missing includes 2022-09-26 18:54:39 +02:00
Marian Buschsieweke
023b6ae7cf
cpu/atxmega: fix building with avr-libc 2.1.0
Due to the lack of new official avr-libc releases (which includes the
vendor header files needed to support different version of MCUs),
support for new MCUs was lacking. Distributions such as Debian addressed
this by extending the upstream code with vendor header files directly
obtained from Atmel / Microchip, but without paying attention to
details. As such, a naming inconsistency (ASIZE vs ASPACE) between
officially supported MCUs and new MCUs was introduced.

Now that avr-libc 2.1.0 is officially released, hardware support for new
MCUs is provided by upstream out of the box and only ASIZE is used as
name. This commit adds a bit of glue code to create aliases for ASIZE on
older avr-libc versions where needed. This fixes compilation with the
new avr-libc release and results in more consistent code.
2022-09-22 13:56:53 +02:00
Benjamin Valentin
7abaae7bbd treewide: fix typos 2022-09-15 12:12:23 +02:00
Marian Buschsieweke
8cc0199437
cpu/{atmega_common,atxmega}: increase idle thread stack size
Our AVR port doesn't make use of an ISR stack and just victimizes the
stack of whatever thread happens to be running, which in most cases is
the idle thread. Hence, the idle stack has to be large enough to
support the ztimer ISR.
2022-06-27 14:39:57 +02:00
Benjamin Valentin
0340ac6129 cpu: include IDLE in PM_NUM_MODES 2022-04-06 12:29:25 +02:00
Leandro Lanzieri
df7ce1c647
makefiles/kconfig: use two lists for boards and CPUs default configs
This introduces KCONFIG_BOARD_CONFIG and KCONFIG_CPU_CONFIG variable for
boards and CPUs (including common directories) to add default
configuration files to be merged. The current approach, as it uses
Makefile.features, would include boards first, not allowing them to
override CPU configurations.
2021-12-13 12:33:21 +01:00
Francisco Molina
43b3b3991a cpu/atxmega/include/cpu_conf: ztimer64 arithmetic idle stack fix 2021-12-09 12:15:15 +01:00
Gunar Schorcht
007e29ebb5 cpu/periph/i2c: update implementations to new I2C API
Make all `spi_acquire` implementations return `void` and add assertions to check for valid device identifier where missing.
2021-11-29 06:35:25 +01:00
Leandro Lanzieri
92b7e5ea53
cpu/atxmega: fix dependency 2021-11-22 12:25:57 +01:00
Leandro Lanzieri
a37f59b109
cpu/atxmega: model Kconfig 2021-11-22 12:25:29 +01:00
Marian Buschsieweke
32be74291c
Merge pull request #16790 from maribu/cpu/avr8_common/ldscripts
cpu/avr8_common: Fix link with binutils > 2.35.2
2021-10-15 09:59:14 +02:00
Marian Buschsieweke
62d6a560b1
cpu/avr8_common: Fix link with binutils > 2.35.2
The xfa.ld script is incompatible with binutils > 2.35.2 and results
in firmwares that wont boot. Sadly, I couldn't figure out an elegant
way to fix the issue. Instead, I modified the linker script provided
by binutils to also include XFA.
2021-10-13 16:37:19 +02:00
Marian Buschsieweke
35a1b60068
cpu/{atxmega,atmega_common}: fix invalid use of PSTR()
core_panic() doesn't expect the message to be in program memory, but
in data memory. Bad things will happen on AVR when the address is
interpreted as being in data address space, but the allocation is
done in program address space.
2021-09-30 17:15:39 +02:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Marian Buschsieweke
f04b522601
cpu/periph_spi: update implementations to new API
Make all spi_acquire() implementations return `void` and add assertions to
check for valid parameters, where missing.
2021-09-01 21:38:40 +02:00
Benjamin Valentin
87f7e5a963 cpu/atmega_common: move clock init to common code
This code should not be in the realm of the board config, but in
common arch code.
2021-08-27 17:06:50 +02:00
Gerson Fernando Budke
307e8c7a17 cpu/atxmega: Add external bus interface
Introduce XMEGA EBI driver.  This enable EBI for use with all memory
supported by the device and peripherals. It include support to  SRAM,
SDRAM, LCDs or any other external bus access.

Note: This feature only works for A1/A1U series, which are, the series
with EBI hardware.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-24 08:35:41 -03:00
Gerson Fernando Budke
2d3f7bf17c cpu/atxmega: Fix features config
Update features definitions and configurations.  Now atxmega define
features that only are full available on all variations and do not
require any definition at periph_conf.h file.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-17 12:42:59 -03:00
Gerson Fernando Budke
91316a879a cpu/atxmega/periph/spi: Add spi driver
Introduce SPI driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-05-14 23:26:08 -03:00
Gerson Fernando Budke
1dec526d0a cpu/atxmega/periph/i2c: Add i2c driver
Add initial ATxmega i2c master driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-04-25 22:06:23 -03:00
Gerson Fernando Budke
93ed3cd9d6 cpu/atxmega: Add periph power management
The current xmega don't have a way to disable peripherals that are
not in used.  Add peripheral management to allow enable only the mcu
blocks that will be used by application.  This saves power on active
and sleep modes.  By default, at clock initialization, all peripherals
are now disabled and each drive must activate at initialization phase.
The periph_timer and periph_uart were updated with this new feature.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-04-02 14:24:31 -03:00
Gerson Fernando Budke
53235dd2e2 cpu/atxmega/atxmega_cpu: Fix clk sel after dfll en
The current ATxmega clock_init enable DFLL to improve the accuracy of
the 2MHz and 32MHz internal oscillators.  In some ATxmega revisions,
after started DFLL the clock become unstable.  Add another sync point
for 32MHz internal oscilator.

Note:  If clock is not stable, system won't switch from 2MHz to 32MHz
as main clock.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-28 11:40:39 -03:00
Gerson Fernando Budke
70c597620f cpu/avr8_common: Differentiate avr8 cpu cores
Current there is no way to split code between ATmega and ATxmega in
drivers.  This differentiate AVR8 cores into MEGAs and XMEGAs.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-15 20:16:10 -03:00
Gerson Fernando Budke
1a88f0bad6 cpu: Introduce Atmel xmega cpu
Add ATxmega common files and cpu definitions.

This works was originally developed by @Josar.  The 2018 version
were port to 2021 mainline.

This version changes original port to have only the atxmega CPU
definition. With that, all family can be accomodated.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-15 20:16:10 -03:00