[riot-notifications] [RIOT-OS/RIOT] saul/gpio: Low footprint handling of active-low signals + state initialization (#7586)

Ga√ętan Harter notifications at github.com
Fri Sep 8 16:16:57 CEST 2017


This is a low footprint implementation for SAUL active-low and state init.

The basic idea, is to add flags in `saul_gpio_params_t` structures and pass this to `read`/`write` instead of only `pin`.
This removes the need to duplicate drivers and only adds one flag.

I changed the `samr21-xpro` to invert led and button.

My footprint tests where done with `examples/saul` the `samr21-xpro`

Steps  | `samr21-xpro` | `iotlab-m3`
---------|-----------|----------
Original |  17364 | 21352
Change dev | 17340 | 21332
Inverted support | 17360 | 21352
Init support | 17384 | 21380

All steps are done in different commit so I could only put some part of it.

> # Size testing procedure
> 
> export RIOT_VERSION=''  # prevents the version to change size
> make BOARD=samr21-xpro | grep 'examples/saul' | cut -f 4
> make BOARD=iotlab-m3 | grep 'examples/saul' | cut -f 4

I did not put initial state setting in the output only mode for readability, but I could (it is harmless by default). Or put a DEVELHELP message when using it for an input.

This could replace https://github.com/RIOT-OS/RIOT/pull/7151, https://github.com/RIOT-OS/RIOT/pull/7148
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/7586

-- Commit Summary --

  * saul/gpio: use saul_gpio_params_t structure as saul device
  * saul/gpio: add support for inverted mode gpios
  * samr21-xpro/gpio: set LED/BUTTON gpios as inverted
  * saul/gpio: add support to initialized state

-- File Changes --

    M boards/arduino-atmega-common/include/gpio_params.h (3)
    M boards/arduino-due/include/gpio_params.h (3)
    M boards/arduino-mkr-common/include/gpio_params.h (3)
    M boards/arduino-zero/include/gpio_params.h (3)
    M boards/b-l072z-lrwan1/include/gpio_params.h (15)
    M boards/calliope-mini/include/gpio_params.h (6)
    M boards/cc2650stk/include/gpio_params.h (12)
    M boards/frdm-k22f/include/gpio_params.h (9)
    M boards/iotlab-common/include/gpio_params.h (9)
    M boards/maple-mini/include/gpio_params.h (6)
    M boards/microbit/include/gpio_params.h (6)
    M boards/mulle/include/gpio_params.h (9)
    M boards/nrf52840dk/include/gpio_params.h (24)
    M boards/nrf52dk/include/gpio_params.h (24)
    M boards/nucleo-common/include/gpio_params.h (6)
    M boards/nucleo144-common/include/gpio_params.h (12)
    M boards/nucleo32-common/include/gpio_params.h (3)
    M boards/nz32-sc151/include/gpio_params.h (3)
    M boards/pba-d-01-kw2x/include/gpio_params.h (15)
    M boards/remote-pa/include/gpio_params.h (12)
    M boards/remote-reva/include/gpio_params.h (12)
    M boards/remote-revb/include/gpio_params.h (12)
    M boards/samd21-xpro/include/gpio_params.h (6)
    M boards/samr21-xpro/include/gpio_params.h (6)
    M boards/sodaq-autonomo/include/gpio_params.h (3)
    M boards/stm32f0discovery/include/gpio_params.h (9)
    M boards/stm32f3discovery/include/gpio_params.h (27)
    M boards/stm32f4discovery/include/gpio_params.h (15)
    M boards/stm32f7discovery/include/gpio_params.h (15)
    A drivers/include/saul/.swp (0)
    M drivers/include/saul/periph.h (13)
    M drivers/saul/gpio_saul.c (15)
    M sys/auto_init/saul/auto_init_gpio.c (14)
    M sys/include/saul_reg.h (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/7586.patch
https://github.com/RIOT-OS/RIOT/pull/7586.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/7586
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170908/6c20a0cc/attachment-0001.html>


More information about the notifications mailing list