26 template<
typename CLK,
typename MOSI,
typename MISO,
typename SPI_SS >
class SPi {
34 SPI_SS::SetDirWrite();
45 #if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
48 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
51 #if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__)
55 template<
typename SS,
typename INTR >
class MAX3421e {
56 static uint8_t vbusState;
60 void regWr(uint8_t reg, uint8_t data);
61 uint8_t*
bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
63 uint8_t
regRd(uint8_t reg);
64 uint8_t*
bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
78 template<
typename SS,
typename INTR >
82 template<
typename SS,
typename INTR >
101 template<
typename SS,
typename INTR >
105 while(!(SPSR & (1 << SPIF)));
107 while(!(SPSR & (1 << SPIF)));
114 template<
typename SS,
typename INTR >
119 while(!(SPSR & (1 << SPIF)));
123 while(!(SPSR & (1 << SPIF)));
131 template<
typename SS,
typename INTR >
140 template<
typename SS,
typename INTR >
144 while(!(SPSR & (1 << SPIF)));
146 while(!(SPSR & (1 << SPIF)));
153 template<
typename SS,
typename INTR >
157 while(!(SPSR & (1 << SPIF)));
161 while(!(SPSR & (1 << SPIF)));
171 template<
typename SS,
typename INTR >
182 template<
typename SS,
typename INTR >
207 template<
typename SS,
typename INTR >
228 template<
typename SS,
typename INTR >
231 bus_sample = regRd(
rHRSL);
244 if((regRd(
rMODE) & bmLOWSPEED) == 0) {
263 template<
typename SS,
typename INTR >
269 pinvalue = INTR::IsSet();
272 rcode = IntHandler();
282 template<
typename SS,
typename INTR >
285 uint8_t HIRQ_sendback = 0x00;
295 regWr(
rHIRQ, HIRQ_sendback);
296 return( HIRQ_sendback);