Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
SRPIO< BITORDER, DATA_PIN, CLOCK_PIN > Class Template Reference

#include <SRPIO.h>

Collaboration diagram for SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >:
Collaboration graph

Public Member Functions

 SRPIO ()
 
void write (uint8_t value)
 
void operator<< (uint8_t value)
 
uint8_t read ()
 
void operator>> (uint8_t &value)
 

Protected Attributes

GPIO< DATA_PINm_data
 
GPIO< CLOCK_PINm_clock
 

Detailed Description

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
class SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >

Shift Register Parallel Input Output (SRPIO) template class using GPIO.

Parameters
[in]BITORDERLSBFIRST or MSBFIRST.
[in]DATA_PINboard pin for data input/output signal.
[in]CLOCK_PINboard pin for clock output signal.

Definition at line 31 of file SRPIO.h.

Constructor & Destructor Documentation

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::SRPIO ( )
inline

Construct Shift Register Parallel Input Output (SRPIO) instance with given template parameters. Initiate GPIO pins for data to open drain mode (external pullup resistor) and clock to output mode.

Definition at line 39 of file SRPIO.h.

Member Function Documentation

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
void SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::operator<< ( uint8_t  value)
inline

Serial output operator. Shorthand for write().

Parameters
[in]valueto data output signal.

Definition at line 77 of file SRPIO.h.

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
void SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::operator>> ( uint8_t &  value)
inline

Serial input operator. Shorthand for read().

Parameters
[out]valuefrom data input signal.

Definition at line 116 of file SRPIO.h.

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
uint8_t SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::read ( )
inline

Return deserialized value according to the template bit order parameter. Generates a positive clock pulse for each bit transfer.

Returns
byte read from data input signal.

Definition at line 88 of file SRPIO.h.

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
void SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::write ( uint8_t  value)
inline

Serialize given value according to the template bit order parameter. Generate a positive clock pulse for each bit transfer.

Parameters
[in]valueto data output signal.

Definition at line 50 of file SRPIO.h.

Member Data Documentation

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
GPIO<CLOCK_PIN> SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::m_clock
protected

Definition at line 123 of file SRPIO.h.

template<uint8_t BITORDER, BOARD::pin_t DATA_PIN, BOARD::pin_t CLOCK_PIN>
GPIO<DATA_PIN> SRPIO< BITORDER, DATA_PIN, CLOCK_PIN >::m_data
protected

Definition at line 122 of file SRPIO.h.


The documentation for this class was generated from the following file: