Example Application 1.0.0
A Zephyr-based example application
Loading...
Searching...
No Matches

Public API provided by the blink driver class. More...

Functions

int blink_set_period_ms (const struct device *dev, unsigned int period_ms)
 Configure the LED blink period.
static int blink_off (const struct device *dev)
 Turn LED blinking off.

Detailed Description

Public API provided by the blink driver class.

The public API is the interface that is used by applications to interact with devices that implement the blink driver class. If support for system calls is needed, functions accessing device fields need to be tagged with __syscall and provide an implementation that follows the z_impl_${function_name} naming scheme.

Function Documentation

◆ blink_off()

int blink_off ( const struct device * dev)
inlinestatic

Turn LED blinking off.

This is a convenience function to turn off the LED blinking. It also shows how to create convenience functions that re-use other driver functions, or driver operations, to provide a higher-level API.

Parameters
devBlink device instance.
Returns
See blink_set_period_ms().

◆ blink_set_period_ms()

int blink_set_period_ms ( const struct device * dev,
unsigned int period_ms )

Configure the LED blink period.

Parameters
devBlink device instance.
period_msPeriod of the LED blink in milliseconds.
Return values
0if successful.
-EINVALif period_ms can not be set.
-errnoOther negative errno code on failure.