/* BigIOinput.h - Read parallel to serial input BigIOinput *PRELIMINARY* Arduino header Copyright (c) 2011 Devon Sean McCullough Licensed under the GPL (GNU Public License) BigIOinput(size, clock, shift, qh) // size and pins load() // load register from external inputs = shift() // shift one bit from register = shift(size) // ... size bits ... = read(position) // read bit at position = read(size, position) // ... size bits starting at position read(size, position, buffer) // ... to packed binary buffer read(size, position, buffer, map) // ... permuted by map bit and byte indices, positions and values are all zero-origin little-endian so pointers to int, long, etc. should work as expected with Arduino avr-gcc assuming extra high-order bits are set to known values, e.g., zeros. */ #ifndef BigIOinput_h #define BigIOinput_h #include "WProgram.h" #include "BigIO.h" class BigIOinput { public: BigIOinput(int size, byte shift, byte clock, byte qh); void load(); boolean shift(); BigIO_t shift(int size); boolean read(int position); BigIO_t read(int size, int position); BigIO_t read(int size, int position, const int *map); void read(int size, int position, byte *buffer); void read(int size, int position, byte *buffer, const int *map); private: int _size, _position; byte _shift, _clock, _qh; }; #endif // end BigIOinput.h