drivers/SAUL

Dear all , I would like to ask you if there is any example of the drivers/saul . Thank you in advance!

Hi,

depends on what you are looking for. Have a look at the default example for the iotlab-m3 or the samr21-xpro. These are so far the only boards that have bindings to some sensors/gpios via SAUL. But as coincidence I am working on some SAUL optimizations and on SAULifying many more drivers as we speak, expect some PRs to this topic end of this week…

Hope that gives you some direction, otherwise let us know if you have more specific questions on SAUL!

Cheers, Hauke

Dear Hauke, Thank you for your answer. I executed the default example in my samr21 but unfortunately only the led is supported. I hoped that there was an abstraction on the rest of the gpios so I would be able to connect an actuator easily. Best, Ilias

Hej,

I see your point. Actually SAUL is (so far) not really intended for hot-plugging. But what you can easily do, is define the pin(s) you connect to your actuator at compile time and make them available via the SAUL registry. To do this in the simplest way, you can just edit the boards/samr21-xpro/include/gpio_params.h file and add the pins that you need control over, maybe like this (if your actuator is connected to pin PB02):

static const saul_gpio_params_t saul_gpio_params[] = { { .name = "LED(orange)", .pin = LED_GPIO, .dir = GPIO_DIR_OUT, }, { .name = "My Actuator", .pin = GPIO_PIN(PB, 2), .dir = GPIO_DIR_OUT } };

And thats it, now your actuator pin should be listed when using the saul shell command.

Cheers, Hauke