2013-09-29 13:10:03 -04:00
|
|
|
//
|
|
|
|
// FILE: FastShiftIn.h
|
|
|
|
// AUTHOR: Rob Tillaart
|
2017-04-26 18:43:41 -04:00
|
|
|
// VERSION: 0.1.3
|
2013-09-29 13:10:03 -04:00
|
|
|
// PURPOSE: shiftin
|
|
|
|
// DATE: 2013-09-29
|
|
|
|
// URL:
|
|
|
|
//
|
|
|
|
// Released to the public domain
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef FastShiftIn_h
|
|
|
|
#define FastShiftIn_h
|
|
|
|
|
|
|
|
#if defined(ARDUINO) && ARDUINO >= 100
|
2015-03-06 09:09:11 -05:00
|
|
|
#include "Arduino.h"
|
2013-09-29 13:10:03 -04:00
|
|
|
#else
|
2015-03-06 09:09:11 -05:00
|
|
|
#include "WProgram.h"
|
2013-09-29 13:10:03 -04:00
|
|
|
#endif
|
|
|
|
|
2017-04-26 18:43:41 -04:00
|
|
|
#define FASTSHIFTIN_LIB_VERSION "0.1.3"
|
2015-03-06 09:09:11 -05:00
|
|
|
|
|
|
|
#define FASTSHIFTIN_NOVALUE -1
|
2013-09-29 13:10:03 -04:00
|
|
|
|
|
|
|
class FastShiftIn
|
|
|
|
{
|
2015-03-06 09:09:11 -05:00
|
|
|
public:
|
|
|
|
FastShiftIn(const uint8_t, const uint8_t, const uint8_t);
|
2013-09-29 13:10:03 -04:00
|
|
|
int read(void);
|
|
|
|
|
2015-03-06 09:09:11 -05:00
|
|
|
private:
|
2013-09-29 13:10:03 -04:00
|
|
|
uint8_t _bitorder;
|
|
|
|
int _value;
|
2015-03-06 09:09:11 -05:00
|
|
|
|
|
|
|
uint8_t _databit;
|
2013-09-29 13:10:03 -04:00
|
|
|
volatile uint8_t *_datain;
|
2015-03-06 09:09:11 -05:00
|
|
|
|
|
|
|
uint8_t _clockbit;
|
2013-09-29 13:10:03 -04:00
|
|
|
volatile uint8_t *_clockin;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// -- END OF FILE --
|