Fledex.Driver.Manager (fledex v0.7.0)

View Source

This modules manages a (set of) concrete driver(s).

This module is used by the Fledex.LedStrip and the dispatches to the concrete Fledex.Driver.Impl-driver (or even drivers).

Summary

Types

The structure to hold the driver related data.

This structure is for holding several driver_t structures.

Functions

This function removes from a list of drivers (with their driver_configs) all those that are not adhering to the Interface specification

Types

driver_t()

@type driver_t() :: {driver :: module(), config :: keyword()}

The structure to hold the driver related data.

It consists of tuples with:

  • driver: Which modules should get loaded. Each module usually should have a default configuration, which can then be overwritten with specific settings
  • config: a keyword list to modify the default settings. Each module has their own set of settings. You need to check the driver module documentation for allowed settings

Note

You can specify a driver module several times and give them different settings. This allows for example to send the same data to two different SPI ports.

Example:

{Fledex.Driver.Impl.Kino, update_freq: 10 }

drivers_t()

@type drivers_t() :: [driver_t()]

This structure is for holding several driver_t structures.

Functions

remove_invalid_drivers(drivers)

@spec remove_invalid_drivers([{module(), keyword()}]) :: [{module(), keyword()}]

This function removes from a list of drivers (with their driver_configs) all those that are not adhering to the Interface specification