22 #if defined(ARDUINO) && ARDUINO >=100
33 template<
typename CLK,
typename MOSI,
typename MISO,
typename SPI_SS >
class SPi {
41 SPI_SS::SetDirWrite();
52 #if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
55 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
58 #if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__)
67 template<
typename SS,
typename INTR >
class MAX3421e {
68 static uint8_t vbusState;
72 void regWr(uint8_t reg, uint8_t data);
73 uint8_t*
bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
75 uint8_t
regRd(uint8_t reg);
76 uint8_t*
bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
80 int8_t
Init(
int mseconds);
95 template<
typename SS,
typename INTR >
99 template<
typename SS,
typename INTR >
106 #ifdef BOARD_MEGA_ADK
118 template<
typename SS,
typename INTR >
122 while(!(SPSR & (1 << SPIF)));
124 while(!(SPSR & (1 << SPIF)));
131 template<
typename SS,
typename INTR >
136 while(!(SPSR & (1 << SPIF)));
140 while(!(SPSR & (1 << SPIF)));
148 template<
typename SS,
typename INTR >
157 template<
typename SS,
typename INTR >
161 while(!(SPSR & (1 << SPIF)));
163 while(!(SPSR & (1 << SPIF)));
170 template<
typename SS,
typename INTR >
174 while(!(SPSR & (1 << SPIF)));
178 while(!(SPSR & (1 << SPIF)));
182 printf(
"%2.2x ", *data_p);
197 template<
typename SS,
typename INTR >
208 template<
typename SS,
typename INTR >
222 template<
typename SS,
typename INTR >
248 template<
typename SS,
typename INTR >
256 if(mseconds < 1000) mseconds = 1000;
279 template<
typename SS,
typename INTR >
282 bus_sample = regRd(
rHRSL);
295 if((regRd(
rMODE) & bmLOWSPEED) == 0) {
314 template<
typename SS,
typename INTR >
320 pinvalue = INTR::IsSet();
323 rcode = IntHandler();
333 template<
typename SS,
typename INTR >
336 uint8_t HIRQ_sendback = 0x00;
346 regWr(
rHIRQ, HIRQ_sendback);
347 return( HIRQ_sendback);