1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/lpc2387/include
Marian Buschsieweke 1d0f90dcdf
cpu/lpc2387: Various fixes for GPIO driver
- Fixed documentation
- Use bitwise operation instead of multiplication and addition in `GPIO_PIN()`
- Allow GPIOs to be configured as input via `gpio_init()`
- Fixed bugs in `gpio_init_mux`:
    - `0x01 << ((pin & 31) * 2)` was used before to generate the bitmask, but
      this would shift by 62 to the left. Correct is `0x01 << ((pin & 15) * 2)`
      (See [datasheet](https://www.nxp.com/docs/en/user-guide/UM10211.pdf) at
      pages 156ff)
    - Only one of the two bits was cleared previously
- Changed strategy to access GPIO pins:
    - Previous strategy:
        - Set all bits in FIOMASK except the one for the pin to control to
          disable access to them
        - Set/clear/read all pins in the target GPIO port (but access to all but
          the target pin is ignored because of the applied FIOMASK)
    - New strategy:
        - Set/clear/read only the target pin
    - Advantages:
        - Only one access to a GPIO register instead of two
        - Proven approach: Access to GPIOs on lpc2387 is mostly done by
          accessing the GPIO registers directy (e.g. see the sht11 driver).
          Those accesses never touch the FIOMASK register
        - No unwanted side effects: Disabling all but one pin in a GPIO port
          without undoing that seems not to be a good idea
2018-06-18 09:10:25 +02:00
..
vendor cpus: mv vendor headers to include/vendor/. 2017-03-07 08:55:15 +01:00
cpu_conf.h cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
cpu.h cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
lpc2387.h cpus: mv vendor headers to include/vendor/. 2017-03-07 08:55:15 +01:00
periph_cpu.h cpu/lpc2387: Various fixes for GPIO driver 2018-06-18 09:10:25 +02:00