Merge branch 'master' of github.com:felis/USB_Host_Shield_2.0 into dev

This commit is contained in:
Oleg Mazurov 2012-02-05 08:17:26 -07:00
commit 2f031cea85
3 changed files with 13 additions and 1 deletions

2
Usb.h
View file

@ -49,6 +49,8 @@ e-mail : support@circuitsathome.com
#ifdef BOARD_BLACK_WIDDOW #ifdef BOARD_BLACK_WIDDOW
typedef MAX3421e<P6, P3> MAX3421E; // Black Widow typedef MAX3421e<P6, P3> MAX3421E; // Black Widow
#elif defined(BOARD_MEGA_ADK)
typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK
#else #else
typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560 typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560
#endif #endif

View file

@ -20,6 +20,9 @@ e-mail : support@circuitsathome.com
#ifndef _avrpins_h_ #ifndef _avrpins_h_
#define _avrpins_h_ #define _avrpins_h_
/* Uncomment the following if you have Arduino Mega ADK board with MAX3421e built-in */
//#define BOARD_MEGA_ADK
#include <avr/io.h> #include <avr/io.h>
#ifdef PORTA #ifdef PORTA
@ -465,6 +468,7 @@ template<typename Tp_pin, typename Tc_bit>
#define P51 Pb2 #define P51 Pb2
#define P52 Pb1 #define P52 Pb1
#define P53 Pb0 #define P53 Pb0
#define P54 Pj2
#endif //"Mega" pin numbers #endif //"Mega" pin numbers

View file

@ -87,6 +87,12 @@ MAX3421e< SS, INTR >::MAX3421e()
spi::init(); spi::init();
INTR::SetDirRead(); INTR::SetDirRead();
#ifdef BOARD_MEGA_ADK
/* For Mega ADK, which has Max3421e on-board, set MAX_RESET to Output mode, and pull Reset to HIGH */
DDRJ |= 0x04;
PORTJ |= 0x04;
#endif
/* MAX3421E - full-duplex SPI, level interrupt */ /* MAX3421E - full-duplex SPI, level interrupt */
regWr( rPINCTL,( bmFDUPSPI + bmINTLEVEL )); regWr( rPINCTL,( bmFDUPSPI + bmINTLEVEL ));
}; };