- Added support for Arduino Mega ADK board.

This commit is contained in:
Ilya Bakulin 2012-01-23 05:32:51 +04:00
parent 452fee3d61
commit 5daa359bd3
2 changed files with 7 additions and 2 deletions

3
Usb.h
View file

@ -50,7 +50,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
#else #else
typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560 //typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560
typedef MAX3421e<P53, Pe6> MAX3421E; // Arduino Mega ADK
#endif #endif
//Debug macros. In 1.0 it is possible to move strings to PROGMEM by defining USBTRACE (Serial.print(F(s))) //Debug macros. In 1.0 it is possible to move strings to PROGMEM by defining USBTRACE (Serial.print(F(s)))

View file

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