NAME

Device::Chip::ProtocolBase::SPI - a base class for implementing SPI protocols

DESCRIPTION

This 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

$protocol->write( $words )->get

A wrapper for "readwrite" that ignores the result.

read

$words = $protocol->read( $len )->get

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 = $protocol->readwrite( $words_out )->get

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

write_then_read

$words_in = $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>