27 template<
typename CLK,
typename MOSI,
typename MISO,
typename SPI_SS >
class SPi
35 SPI_SS::SetDirWrite();
46 #if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
49 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
52 #if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__)
56 template<
typename SS,
typename INTR >
class MAX3421e
58 static uint8_t vbusState;
62 void regWr( uint8_t reg, uint8_t data );
63 uint8_t*
bytesWr( uint8_t reg, uint8_t nbytes, uint8_t* data_p );
64 void gpioWr( uint8_t data );
65 uint8_t
regRd( uint8_t reg );
66 uint8_t*
bytesRd( uint8_t reg, uint8_t nbytes, uint8_t* data_p );
77 template<
typename SS,
typename INTR >
81 template<
typename SS,
typename INTR >
100 template<
typename SS,
typename INTR >
104 SPDR = ( reg | 0x02 );
105 while(!( SPSR & ( 1 << SPIF )));
107 while(!( SPSR & ( 1 << SPIF )));
113 template<
typename SS,
typename INTR >
117 SPDR = ( reg | 0x02 );
119 while(!( SPSR & ( 1 << SPIF )));
123 while(!( SPSR & ( 1 << SPIF )));
130 template<
typename SS,
typename INTR >
139 template<
typename SS,
typename INTR >
144 while(!( SPSR & ( 1 << SPIF )));
146 while(!( SPSR & ( 1 << SPIF )));
152 template<
typename SS,
typename INTR >
157 while(!( SPSR & ( 1 << SPIF )));
161 while(!( SPSR & ( 1 << SPIF )));
170 template<
typename SS,
typename INTR >
181 template<
typename SS,
typename INTR >
206 template<
typename SS,
typename INTR >
229 template<
typename SS,
typename INTR >
233 bus_sample = regRd(
rHRSL );
235 switch( bus_sample ) {
247 if(( regRd(
rMODE ) & bmLOWSPEED ) == 0 ) {
266 template<
typename SS,
typename INTR >
273 pinvalue = INTR::IsSet();
275 if( pinvalue == 0 ) {
276 rcode = IntHandler();
285 template<
typename SS,
typename INTR >
289 uint8_t HIRQ_sendback = 0x00;
290 HIRQ = regRd(
rHIRQ );
299 regWr(
rHIRQ, HIRQ_sendback );
300 return( HIRQ_sendback );