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

16 Commits

Author SHA1 Message Date
Marian Buschsieweke
043e8cc88e
boards,sys/arduino: major clean up
- Rename all `arduino_pinmap.h` to `arduino_iomap.h`
    - An empty `arduino_pinmap.h` that just includes `arduino_iomap.h`
      is provided for backward compatibility
    - Move all info from `arduino_board.h` into the new file as trivial
      macros, so that they can also be used outside of sketches
    - The new name reflects the fact not just pin mappings, but also
      other I/O features such as PWMs are mapped
- Drop all `arduino_board.h`
    - `arduino_board.h` and `arduino_iomap.h` now provide the exact
      same information, just in a different format
    - a generic `arduino_board.h` is provided instead that just
      uses the info in `arduinio_iomap.h` and provides them in the
      format the code in `sys/arduino` expects it
- Add fine grained features to indicate for mappings
    - availability of mappings for analog pins, DAC pins, PWM pins,
      UART devices, SPI/I2C buses to the corresponding RIOT
      identification can now be expressed:
        - `arduino_pins`: `ARDUINO_PIN_0` etc. are available
        - `arduino_analog`: `ARDUINO_A0` etc. are available
        - `arduino_pwm`: `ARDUINO_PIN_13_PWM_DEV` etc. are available
        - `arduino_dac`: `ARDUINO_DAC0` etc. are available
        - `arduino_uart`: `ARDUINO_UART_D0D1` or similar are available
        - `arduino_spi`: `ARDUINO_SPI_ISP` or similar are available
        - `arduino_i2c`: `ARDUINO_I2C_UNO` or similar are available
    - mechanical/electrical compatibility with specific form factors
      can now be expressed as features:
        - `aruino_shield_nano`: Arduino NANO compatible headers
        - `aruino_shield_uno`: Arduino UNO compatible headers
        - `aruino_shield_mega`: Arduino MEGA compatible headers
        - `aruino_shield_isp`: ISP header is available

This provides the groundwork to implement shield support as modules
that can rely on the I/O mappings, rather than having to provide a
configuration per board.
2023-06-26 17:24:07 +02:00
Gunar Schorcht
ede5f9ebab sys/arduino: add assertion to gpio handling
Not all boards that provide a Arduino pin layout break out all GPIOs. A good example are Adafruit `feather-m0` boards. GPIOs that are not broken out have to be defined as `GPIO_UNDEF` to preserve the Arduino pin layout. However, GPIO functions lead to a complete system lock on `feather-m0` boards if a pin is used that is defined as `GPIO_UNDEF`. Therefore, at least an assert should blow up in this case.
2021-12-27 11:38:05 +01:00
746f56cc3f
sys/arduino: use ztimer as backend high-level timer 2021-06-17 10:23:21 +02:00
0845cac3b8
sys/arduino: provide implementation for analogWrite 2019-11-15 17:51:45 +01:00
c4bb2a2e17
sys/arduino: make ADC feature optional 2019-10-08 10:26:23 +02:00
Kees Bakker
d9e0c6c859 sys/arduino: use 64bit usec to compute millis()
This is quick solution to avoid wrapping around after 4294967 milliseconds.
It uses xtimer_now_usec64 instead of xtimer_now_usec.

Notice that this is more expansive than the previous solution, especially
on AVR systems.
2019-09-19 19:52:43 +02:00
Marian Buschsieweke
8cff47304b
sys/arduino: Make use of US_PER_MS in delay() 2019-08-29 13:57:56 +02:00
Marian Buschsieweke
27eca42f48
sys/arduino: Added millis()
Added arduino-compatilbe "unsigned long millis()"
2019-08-29 13:36:15 +02:00
Benjamin Valentin
9311e05fcf sys/arduino: reduce scope of adc_line_state
This makes cppcheck happy.
2019-08-06 19:43:54 +02:00
Benjamin Valentin
e8dc1119b8 sys: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Federico Pellegrin
75c4dab3c7 sys/arduino: correct micros() return type 2018-10-12 17:40:37 +02:00
Federico Pellegrin
4960607a1e sys/arduino: add arduino time functions micros() and delayMicroseconds() 2018-10-11 14:42:46 +02:00
Laurent Navet
9de00af063 cpu/atmega_common: add adc driver 2017-11-10 14:19:08 +01:00
3b1d67badd sys/arduino: make arduino sketch works on avr based boards 2017-01-03 13:01:30 +01:00
Hauke Petersen
013eed7fa0 sys: adapted to GPIO changes 2016-03-17 14:55:30 +01:00
Hauke Petersen
7855cb3707 sys: added module for running Arduino code 2015-11-27 12:45:12 +01:00