Fledex.Driver.Impl.Spi.Utils (fledex v0.8.0)

Copy Markdown View Source

Utility functions for the SPI drivers

Summary

Functions

Clears number leds at startup if the clear_leds: <number> option was specified in the config.

This function defines the default SPI configureation that can be used by concrete implementations. See Fledex.Driver.Impl.Spi for details.

Opens the SPI port with the configuration and returns the reference

Functions

clear_leds(count, config, clear_func)

@spec clear_leds(
  count ::
    non_neg_integer() | {count :: non_neg_integer(), color :: non_neg_integer()},
  config :: keyword(),
  clear_func :: ([Fledex.Color.Types.colorint()], pos_integer(), keyword() ->
                   {keyword(), any()})
) :: keyword()

Clears number leds at startup if the clear_leds: <number> option was specified in the config.

default_spi_config(config)

@spec default_spi_config(keyword()) :: keyword()

This function defines the default SPI configureation that can be used by concrete implementations. See Fledex.Driver.Impl.Spi for details.

open_spi(config)

@spec open_spi(keyword()) :: reference()

Opens the SPI port with the configuration and returns the reference