The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Device::Chip::ProtocolBase::SPI - a role for implementing SPI protocols

DESCRIPTION

This role (or abstract base class) provides some convenient wrapper methods for providing higher-level SPI protocol implementations, by using simpler lower-level ones. It can be used by implementation classes to help provide parts of the API.

WRAPPER METHODS

write

   await $protocol->write( $words );

A wrapper for "readwrite" that ignores the result.

read

   $words = await $protocol->read( $len );

A wrapper for "readwrite" that sends unspecified data which the chip will ignore, returning the result.

This implementation currently sends all-bits-low.

write_no_ss

A wrapper for "readwrite_no_ss" that ignores the result.

read_no_ss

A wrapper for "readwrite_no_ss" that sends unspecified data which the chip will ignore, returning the result.

This implemention currenetly sends all-bits-low.

readwrite

   $words_in = await $protocol->readwrite( $words_out );

A wrapper for performing a complete SPI transfer, using "assert_ss", "readwrite_no_ss", "release_ss".

write_then_read

   $words_in = await $protocol->write_then_read( $words_out, $len_in )

A wrapper for performing a complete SPI transfer in two phases, using "assert_ss", "write_no_ss", "read_no_ss" and "release_ss".

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>