mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge branch 'xxxajk' of github.com:felis/USB_Host_Shield_2.0 into xxxajk
This commit is contained in:
commit
13d625e6be
18 changed files with 202 additions and 114 deletions
1
BTD.cpp
1
BTD.cpp
|
@ -167,6 +167,7 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) {
|
|||
goto FailSetDevTblEntry;
|
||||
|
||||
if (VID == PS3_VID && (PID == PS3_PID || PID == PS3NAVIGATION_PID || PID == PS3MOVE_PID)) {
|
||||
delay(100);
|
||||
rcode = pUsb->setConf(bAddress, epInfo[ BTD_CONTROL_PIPE ].epAddr, 1); // We only need the Control endpoint, so we don't have to initialize the other endpoints of device
|
||||
if (rcode)
|
||||
goto FailSetConfDescr;
|
||||
|
|
|
@ -66,7 +66,7 @@ By default serial debugging is disabled. To turn it on simply change ```ENABLE_U
|
|||
Currently the following boards are supported by the library:
|
||||
|
||||
* All official Arduino AVR boards (Uno, Duemilanove, Mega, Mega 2560, Mega ADK, Leonardo etc.)
|
||||
* Teensy (Teensy 1.0, Teensy 2.0 and Teensy++ 2.0)
|
||||
* Teensy (Teensy++ 1.0, Teensy 2.0, Teensy++ 2.0, and Teensy 3.0)
|
||||
* Balanduino
|
||||
* Sanguino
|
||||
* Black Widdow
|
||||
|
|
1
Usb.h
1
Usb.h
|
@ -18,7 +18,6 @@ e-mail : support@circuitsathome.com
|
|||
#ifndef _usb_h_
|
||||
#define _usb_h_
|
||||
|
||||
|
||||
// WARNING: Do not change the order of includes, or stuff will break!
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
#ifdef BOARD_BLACK_WIDDOW
|
||||
typedef MAX3421e<P6, P3> MAX3421E; // Black Widow
|
||||
#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
||||
typedef MAX3421e<P9, P8> MAX3421E; // Teensy++ 2.0 & 1.0
|
||||
typedef MAX3421e<P9, P8> MAX3421E; // Teensy++ 1.0 and 2.0
|
||||
#elif defined(BOARD_MEGA_ADK)
|
||||
typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK
|
||||
#elif defined(ARDUINO_AVR_BALANDUINO)
|
||||
typedef MAX3421e<P20, P19> MAX3421E; // Balanduino
|
||||
#else
|
||||
typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo etc.)
|
||||
typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo etc.) or Teensy 2.0 and 3.0
|
||||
#endif
|
||||
|
||||
/* Common setup data constant combinations */
|
||||
|
|
35
Wii.cpp
35
Wii.cpp
|
@ -285,11 +285,9 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
|||
}
|
||||
}
|
||||
if (l2capinbuf[9] == 0x31 || l2capinbuf[9] == 0x33 || l2capinbuf[9] == 0x35 || l2capinbuf[9] == 0x37) { // Read the accelerometer
|
||||
accX = ((l2capinbuf[12] << 2) | (l2capinbuf[10] & 0x60 >> 5)) - 500;
|
||||
accY = ((l2capinbuf[13] << 2) | (l2capinbuf[11] & 0x20 >> 4)) - 500;
|
||||
accZ = ((l2capinbuf[14] << 2) | (l2capinbuf[11] & 0x40 >> 5)) - 500;
|
||||
wiimotePitch = (atan2(accY, accZ) + PI) * RAD_TO_DEG;
|
||||
wiimoteRoll = (atan2(accX, accZ) + PI) * RAD_TO_DEG;
|
||||
accXwiimote = ((l2capinbuf[12] << 2) | (l2capinbuf[10] & 0x60 >> 5)) - 500;
|
||||
accYwiimote = ((l2capinbuf[13] << 2) | (l2capinbuf[11] & 0x20 >> 4)) - 500;
|
||||
accZwiimote = ((l2capinbuf[14] << 2) | (l2capinbuf[11] & 0x40 >> 5)) - 500;
|
||||
}
|
||||
switch (l2capinbuf[9]) {
|
||||
case 0x20: // Status Information - (a1) 20 BB BB LF 00 00 VV
|
||||
|
@ -416,14 +414,10 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
|||
case 0x30: // Core buttons - (a1) 30 BB BB
|
||||
break;
|
||||
case 0x31: // Core Buttons and Accelerometer - (a1) 31 BB BB AA AA AA
|
||||
pitch = wiimotePitch; // The pitch is just equal to the angle calculated from the wiimote as there is no Motion Plus connected
|
||||
roll = wiimoteRoll;
|
||||
break;
|
||||
case 0x32: // Core Buttons with 8 Extension bytes - (a1) 32 BB BB EE EE EE EE EE EE EE EE
|
||||
break;
|
||||
case 0x33: // Core Buttons with Accelerometer and 12 IR bytes - (a1) 33 BB BB AA AA AA II II II II II II II II II II II II
|
||||
pitch = wiimotePitch; // The pitch is just equal to the angle calculated from the wiimote as there is no Motion Plus data available
|
||||
roll = wiimoteRoll;
|
||||
#ifdef WIICAMERA
|
||||
// Read the IR data
|
||||
IR_object_x1 = (l2capinbuf[15] | ((uint16_t)(l2capinbuf[17] & 0x30) << 4)); // x position
|
||||
|
@ -486,8 +480,8 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
|||
if (!(l2capinbuf[19] & 0x02)) // Check if fast more is used
|
||||
rollGyroSpeed *= 4.545;
|
||||
|
||||
pitch = (0.93 * (pitch + (pitchGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * wiimotePitch); // Use a complimentary filter to calculate the angle
|
||||
roll = (0.93 * (roll + (rollGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * wiimoteRoll);
|
||||
compPitch = (0.93 * (compPitch + (pitchGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimotePitch()); // Use a complimentary filter to calculate the angle
|
||||
compRoll = (0.93 * (compRoll + (rollGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimoteRoll());
|
||||
|
||||
gyroYaw += (yawGyroSpeed * ((double)(micros() - timer) / 1000000));
|
||||
gyroRoll += (rollGyroSpeed * ((double)(micros() - timer) / 1000000));
|
||||
|
@ -533,11 +527,9 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
|||
if (nunchuckConnected) {
|
||||
hatValues[HatX] = l2capinbuf[15];
|
||||
hatValues[HatY] = l2capinbuf[16];
|
||||
accX = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x10 >> 3)) - 416;
|
||||
accY = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x20 >> 4)) - 416;
|
||||
accZ = (((l2capinbuf[19] & 0xFE) << 2) | (l2capinbuf[20] & 0xC0 >> 5)) - 416;
|
||||
nunchuckPitch = (atan2(accY, accZ) + PI) * RAD_TO_DEG;
|
||||
nunchuckRoll = (atan2(accX, accZ) + PI) * RAD_TO_DEG;
|
||||
accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x10 >> 3)) - 416;
|
||||
accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x20 >> 4)) - 416;
|
||||
accZnunchuck = (((l2capinbuf[19] & 0xFE) << 2) | (l2capinbuf[20] & 0xC0 >> 5)) - 416;
|
||||
}
|
||||
//else if(classicControllerConnected) { }
|
||||
}
|
||||
|
@ -563,14 +555,9 @@ void WII::ACLData(uint8_t* l2capinbuf) {
|
|||
} else if (nunchuckConnected) {
|
||||
hatValues[HatX] = l2capinbuf[15];
|
||||
hatValues[HatY] = l2capinbuf[16];
|
||||
accX = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x0C >> 2)) - 416;
|
||||
accY = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x30 >> 4)) - 416;
|
||||
accZ = ((l2capinbuf[19] << 2) | (l2capinbuf[20] & 0xC0 >> 6)) - 416;
|
||||
nunchuckPitch = (atan2(accY, accZ) + PI) * RAD_TO_DEG;
|
||||
nunchuckRoll = (atan2(accX, accZ) + PI) * RAD_TO_DEG;
|
||||
|
||||
pitch = wiimotePitch; // The pitch is just equal to the angle calculated from the wiimote as there is no Motion Plus connected
|
||||
roll = wiimoteRoll;
|
||||
accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x0C >> 2)) - 416;
|
||||
accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x30 >> 4)) - 416;
|
||||
accZnunchuck = ((l2capinbuf[19] << 2) | (l2capinbuf[20] & 0xC0 >> 6)) - 416;
|
||||
} else if (wiiUProControllerConnected) {
|
||||
hatValues[LeftHatX] = (l2capinbuf[15] | l2capinbuf[16] << 8);
|
||||
hatValues[RightHatX] = (l2capinbuf[17] | l2capinbuf[18] << 8);
|
||||
|
|
33
Wii.h
33
Wii.h
|
@ -152,7 +152,9 @@ public:
|
|||
* @return Pitch in the range from 0-360.
|
||||
*/
|
||||
double getPitch() {
|
||||
return pitch;
|
||||
if (motionPlusConnected)
|
||||
return compPitch;
|
||||
return getWiimotePitch();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -160,7 +162,9 @@ public:
|
|||
* @return Roll in the range from 0-360.
|
||||
*/
|
||||
double getRoll() {
|
||||
return roll;
|
||||
if (motionPlusConnected)
|
||||
return compRoll;
|
||||
return getWiimoteRoll();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -250,21 +254,28 @@ public:
|
|||
|
||||
/**@{*/
|
||||
/** Pitch and roll calculated from the accelerometer inside the Wiimote. */
|
||||
double wiimotePitch;
|
||||
double wiimoteRoll;
|
||||
double getWiimotePitch() {
|
||||
return (atan2(accYwiimote, accZwiimote) + PI) * RAD_TO_DEG;
|
||||
};
|
||||
double getWiimoteRoll() {
|
||||
return (atan2(accXwiimote, accZwiimote) + PI) * RAD_TO_DEG;
|
||||
};
|
||||
/**@}*/
|
||||
|
||||
/**@{*/
|
||||
/** Pitch and roll calculated from the accelerometer inside the Nunchuck. */
|
||||
double nunchuckPitch;
|
||||
double nunchuckRoll;
|
||||
double getNunchuckPitch() {
|
||||
return (atan2(accYnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
|
||||
};
|
||||
double getNunchuckRoll() {
|
||||
return (atan2(accXnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
|
||||
};
|
||||
/**@}*/
|
||||
|
||||
/**@{*/
|
||||
/** Accelerometer values used to calculate pitch and roll. */
|
||||
int16_t accX;
|
||||
int16_t accY;
|
||||
int16_t accZ;
|
||||
int16_t accXwiimote, accYwiimote, accZwiimote;
|
||||
int16_t accXnunchuck, accYnunchuck, accZnunchuck;
|
||||
/**@}*/
|
||||
|
||||
/* Variables for the gyro inside the Motion Plus */
|
||||
|
@ -476,8 +487,8 @@ private:
|
|||
void initMotionPlus();
|
||||
void activateMotionPlus();
|
||||
|
||||
double pitch; // Fusioned angle using a complimentary filter if the Motion Plus is connected
|
||||
double roll; // Fusioned angle using a complimentary filter if the Motion Plus is connected
|
||||
double compPitch; // Fusioned angle using a complimentary filter if the Motion Plus is connected
|
||||
double compRoll; // Fusioned angle using a complimentary filter if the Motion Plus is connected
|
||||
|
||||
bool activateNunchuck;
|
||||
bool motionValuesReset; // This bool is true when the gyro values has been reset
|
||||
|
|
2
adk.h
2
adk.h
|
@ -133,4 +133,4 @@ inline uint8_t ADK::switchAcc(void) {
|
|||
return( pUsb->ctrlReq(bAddress, 0, bmREQ_ADK_SEND, ADK_ACCSTART, 0, 0, 0, 0, 0, NULL, NULL));
|
||||
}
|
||||
|
||||
#endif // _ADK_H_
|
||||
#endif // _ADK_H_
|
||||
|
|
92
avrpins.h
92
avrpins.h
|
@ -22,6 +22,11 @@ e-mail : support@circuitsathome.com
|
|||
#else
|
||||
#define _avrpins_h_
|
||||
|
||||
#if defined(__AVR__)
|
||||
|
||||
// pointers are 16 bits on AVR
|
||||
#define pgm_read_pointer(p) pgm_read_word(p)
|
||||
|
||||
// Support for these boards needs to be manually activated in settings.h or in a makefile
|
||||
#if !defined(BOARD_MEGA_ADK) && defined(__AVR_ATmega2560__) && (USE_UHS_MEGA_ADK || defined(ARDUINO_AVR_ADK))
|
||||
#define BOARD_MEGA_ADK
|
||||
|
@ -505,7 +510,11 @@ public:
|
|||
#define P51 Pb2
|
||||
#define P52 Pb1
|
||||
#define P53 Pb0
|
||||
|
||||
#ifdef BOARD_MEGA_ADK // These pins are not broken out on the Arduino ADK
|
||||
#define P54 Pe6 // INT on Arduino ADK
|
||||
#define P55 Pj2 // MAX_RESET on Arduino ADK
|
||||
#endif
|
||||
|
||||
// "Mega" pin numbers
|
||||
|
||||
|
@ -608,7 +617,7 @@ public:
|
|||
// Arduino Leonardo pin numbers
|
||||
|
||||
#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
||||
// Teensy++ 2.0 pin numbers
|
||||
// Teensy++ 1.0 and 2.0 pin numbers
|
||||
// http://www.pjrc.com/teensy/pinout.html
|
||||
#define P0 Pd0
|
||||
#define P1 Pd1
|
||||
|
@ -656,7 +665,7 @@ public:
|
|||
#define P43 Pf5
|
||||
#define P44 Pf6
|
||||
#define P45 Pf7
|
||||
// Teensy++ 2.0
|
||||
// Teensy++ 1.0 and 2.0
|
||||
|
||||
#elif defined(ARDUINO_AVR_BALANDUINO) && (defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284P__))
|
||||
// Balanduino pin numbers
|
||||
|
@ -733,6 +742,83 @@ public:
|
|||
#define P31 Pa7
|
||||
// Sanguino
|
||||
|
||||
#else
|
||||
#error "Please define board in avrpins.h"
|
||||
|
||||
#endif // Arduino pin definitions
|
||||
|
||||
#endif //_avrpins_h_
|
||||
#endif // __AVR__
|
||||
|
||||
#if defined(__arm__) && defined(CORE_TEENSY)
|
||||
|
||||
// pointers are 32 bits on ARM
|
||||
#define pgm_read_pointer(p) pgm_read_dword(p)
|
||||
|
||||
#include "core_pins.h"
|
||||
#include "avr_emulation.h"
|
||||
|
||||
#define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000)
|
||||
#define GPIO_BITBAND_PTR(reg, bit) ((uint8_t *)GPIO_BITBAND_ADDR((reg), (bit)))
|
||||
|
||||
#define MAKE_PIN(className, baseReg, pinNum, configReg) \
|
||||
class className { \
|
||||
public: \
|
||||
static void Set() { \
|
||||
*GPIO_BITBAND_PTR(baseReg, pinNum) = 1; \
|
||||
} \
|
||||
static void Clear() { \
|
||||
*GPIO_BITBAND_PTR(baseReg, pinNum) = 0; \
|
||||
} \
|
||||
static void SetDirRead() { \
|
||||
configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
|
||||
*(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 0; \
|
||||
} \
|
||||
static void SetDirWrite() { \
|
||||
configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
|
||||
*(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 1; \
|
||||
} \
|
||||
static uint8_t IsSet() { \
|
||||
return *(GPIO_BITBAND_PTR(baseReg, pinNum) + 512); \
|
||||
} \
|
||||
};
|
||||
|
||||
MAKE_PIN(P0, CORE_PIN0_PORTREG, CORE_PIN0_BIT, CORE_PIN0_CONFIG);
|
||||
MAKE_PIN(P1, CORE_PIN1_PORTREG, CORE_PIN1_BIT, CORE_PIN1_CONFIG);
|
||||
MAKE_PIN(P2, CORE_PIN2_PORTREG, CORE_PIN2_BIT, CORE_PIN2_CONFIG);
|
||||
MAKE_PIN(P3, CORE_PIN3_PORTREG, CORE_PIN3_BIT, CORE_PIN3_CONFIG);
|
||||
MAKE_PIN(P4, CORE_PIN4_PORTREG, CORE_PIN4_BIT, CORE_PIN4_CONFIG);
|
||||
MAKE_PIN(P5, CORE_PIN5_PORTREG, CORE_PIN5_BIT, CORE_PIN5_CONFIG);
|
||||
MAKE_PIN(P6, CORE_PIN6_PORTREG, CORE_PIN6_BIT, CORE_PIN6_CONFIG);
|
||||
MAKE_PIN(P7, CORE_PIN7_PORTREG, CORE_PIN7_BIT, CORE_PIN7_CONFIG);
|
||||
MAKE_PIN(P8, CORE_PIN8_PORTREG, CORE_PIN8_BIT, CORE_PIN8_CONFIG);
|
||||
MAKE_PIN(P9, CORE_PIN9_PORTREG, CORE_PIN9_BIT, CORE_PIN9_CONFIG);
|
||||
MAKE_PIN(P10, CORE_PIN10_PORTREG, CORE_PIN10_BIT, CORE_PIN10_CONFIG);
|
||||
MAKE_PIN(P11, CORE_PIN11_PORTREG, CORE_PIN11_BIT, CORE_PIN11_CONFIG);
|
||||
MAKE_PIN(P12, CORE_PIN12_PORTREG, CORE_PIN12_BIT, CORE_PIN12_CONFIG);
|
||||
MAKE_PIN(P13, CORE_PIN13_PORTREG, CORE_PIN13_BIT, CORE_PIN13_CONFIG);
|
||||
MAKE_PIN(P14, CORE_PIN14_PORTREG, CORE_PIN14_BIT, CORE_PIN14_CONFIG);
|
||||
MAKE_PIN(P15, CORE_PIN15_PORTREG, CORE_PIN15_BIT, CORE_PIN15_CONFIG);
|
||||
MAKE_PIN(P16, CORE_PIN16_PORTREG, CORE_PIN16_BIT, CORE_PIN16_CONFIG);
|
||||
MAKE_PIN(P17, CORE_PIN17_PORTREG, CORE_PIN17_BIT, CORE_PIN17_CONFIG);
|
||||
MAKE_PIN(P18, CORE_PIN18_PORTREG, CORE_PIN18_BIT, CORE_PIN18_CONFIG);
|
||||
MAKE_PIN(P19, CORE_PIN19_PORTREG, CORE_PIN19_BIT, CORE_PIN19_CONFIG);
|
||||
MAKE_PIN(P20, CORE_PIN20_PORTREG, CORE_PIN20_BIT, CORE_PIN20_CONFIG);
|
||||
MAKE_PIN(P21, CORE_PIN21_PORTREG, CORE_PIN21_BIT, CORE_PIN21_CONFIG);
|
||||
MAKE_PIN(P22, CORE_PIN22_PORTREG, CORE_PIN22_BIT, CORE_PIN22_CONFIG);
|
||||
MAKE_PIN(P23, CORE_PIN23_PORTREG, CORE_PIN23_BIT, CORE_PIN23_CONFIG);
|
||||
MAKE_PIN(P24, CORE_PIN24_PORTREG, CORE_PIN24_BIT, CORE_PIN24_CONFIG);
|
||||
MAKE_PIN(P25, CORE_PIN25_PORTREG, CORE_PIN25_BIT, CORE_PIN25_CONFIG);
|
||||
MAKE_PIN(P26, CORE_PIN26_PORTREG, CORE_PIN26_BIT, CORE_PIN26_CONFIG);
|
||||
MAKE_PIN(P27, CORE_PIN27_PORTREG, CORE_PIN27_BIT, CORE_PIN27_CONFIG);
|
||||
MAKE_PIN(P28, CORE_PIN28_PORTREG, CORE_PIN28_BIT, CORE_PIN28_CONFIG);
|
||||
MAKE_PIN(P29, CORE_PIN29_PORTREG, CORE_PIN29_BIT, CORE_PIN29_CONFIG);
|
||||
MAKE_PIN(P30, CORE_PIN30_PORTREG, CORE_PIN30_BIT, CORE_PIN30_CONFIG);
|
||||
MAKE_PIN(P31, CORE_PIN31_PORTREG, CORE_PIN31_BIT, CORE_PIN31_CONFIG);
|
||||
MAKE_PIN(P32, CORE_PIN32_PORTREG, CORE_PIN32_BIT, CORE_PIN32_CONFIG);
|
||||
MAKE_PIN(P33, CORE_PIN33_PORTREG, CORE_PIN33_BIT, CORE_PIN33_CONFIG);
|
||||
|
||||
#undef MAKE_PIN
|
||||
|
||||
#endif // __arm__
|
||||
|
||||
#endif //_avrpins_h_
|
||||
|
|
2
cdcacm.h
2
cdcacm.h
|
@ -190,4 +190,4 @@ public:
|
|||
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
||||
};
|
||||
|
||||
#endif // __CDCACM_H__
|
||||
#endif // __CDCACM_H__
|
||||
|
|
|
@ -131,4 +131,4 @@ public:
|
|||
//virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
||||
};
|
||||
|
||||
#endif // __CDCPROLIFIC_H__
|
||||
#endif // __CDCPROLIFIC_H__
|
||||
|
|
|
@ -83,9 +83,9 @@ void loop() {
|
|||
}
|
||||
if(Wii.nunchuckConnected) {
|
||||
Serial.print(F("\tNunchuck Pitch: "));
|
||||
Serial.print(Wii.nunchuckPitch);
|
||||
Serial.print(Wii.getNunchuckPitch());
|
||||
Serial.print(F("\tNunchuck Roll: "));
|
||||
Serial.print(Wii.nunchuckRoll);
|
||||
Serial.print(Wii.getNunchuckRoll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,9 +91,9 @@ void loop() {
|
|||
}
|
||||
if(Wii[i]->nunchuckConnected) {
|
||||
Serial.print(F("\tNunchuck Pitch: "));
|
||||
Serial.print(Wii[i]->nunchuckPitch);
|
||||
Serial.print(Wii[i]->getNunchuckPitch());
|
||||
Serial.print(F("\tNunchuck Roll: "));
|
||||
Serial.print(Wii[i]->nunchuckRoll);
|
||||
Serial.print(Wii[i]->getNunchuckRoll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
hid.h
2
hid.h
|
@ -180,4 +180,4 @@ public:
|
|||
uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
|
||||
};
|
||||
|
||||
#endif // __HID_H__
|
||||
#endif // __HID_H__
|
||||
|
|
|
@ -1216,13 +1216,13 @@ void ReportDescParserBase::SetUsagePage(uint16_t page) {
|
|||
pfUsage = NULL;
|
||||
|
||||
if (page > 0x00 && page < 0x11)
|
||||
pfUsage = /*(UsagePageFunc)pgm_read_word*/(usagePageFunctions[page - 1]);
|
||||
pfUsage = /*(UsagePageFunc)pgm_read_pointer*/(usagePageFunctions[page - 1]);
|
||||
//else if (page > 0x7f && page < 0x84)
|
||||
// E_Notify(pstrUsagePageMonitor);
|
||||
//else if (page > 0x83 && page < 0x8c)
|
||||
// E_Notify(pstrUsagePagePower);
|
||||
//else if (page > 0x8b && page < 0x92)
|
||||
// E_Notify((char*)pgm_read_word(&usagePageTitles1[page - 0x8c]));
|
||||
// E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]));
|
||||
//else if (page > 0xfeff && page <= 0xffff)
|
||||
// E_Notify(pstrUsagePageVendorDefined);
|
||||
else
|
||||
|
@ -1240,13 +1240,13 @@ void ReportDescParserBase::PrintUsagePage(uint16_t page) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (page > 0x00 && page < 0x11)
|
||||
E_Notify((char*)pgm_read_word(&usagePageTitles0[page - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&usagePageTitles0[page - 1]), 0x80);
|
||||
else if (page > 0x7f && page < 0x84)
|
||||
E_Notify(pstrUsagePageMonitor, 0x80);
|
||||
else if (page > 0x83 && page < 0x8c)
|
||||
E_Notify(pstrUsagePagePower, 0x80);
|
||||
else if (page > 0x8b && page < 0x92)
|
||||
E_Notify((char*)pgm_read_word(&usagePageTitles1[page - 0x8c]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]), 0x80);
|
||||
else if (page > 0xfeff && page <= 0xffff)
|
||||
E_Notify(pstrUsagePageVendorDefined, 0x80);
|
||||
else
|
||||
|
@ -1283,15 +1283,15 @@ void ReportDescParserBase::PrintGenericDesktopPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x0a)
|
||||
E_Notify((char*)pgm_read_word(&genDesktopTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDesktopTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x2f && usage < 0x49)
|
||||
E_Notify((char*)pgm_read_word(&genDesktopTitles1[usage - 0x30]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDesktopTitles1[usage - 0x30]), 0x80);
|
||||
else if (usage > 0x7f && usage < 0x94)
|
||||
E_Notify((char*)pgm_read_word(&genDesktopTitles2[usage - 0x80]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDesktopTitles2[usage - 0x80]), 0x80);
|
||||
else if (usage > 0x9f && usage < 0xa9)
|
||||
E_Notify((char*)pgm_read_word(&genDesktopTitles3[usage - 0xa0]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDesktopTitles3[usage - 0xa0]), 0x80);
|
||||
else if (usage > 0xaf && usage < 0xb8)
|
||||
E_Notify((char*)pgm_read_word(&genDesktopTitles4[usage - 0xb0]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDesktopTitles4[usage - 0xb0]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1300,11 +1300,11 @@ void ReportDescParserBase::PrintSimulationControlsPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x0d)
|
||||
E_Notify((char*)pgm_read_word(&simuTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&simuTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x26)
|
||||
E_Notify((char*)pgm_read_word(&simuTitles1[usage - 0x20]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&simuTitles1[usage - 0x20]), 0x80);
|
||||
else if (usage > 0xaf && usage < 0xd1)
|
||||
E_Notify((char*)pgm_read_word(&simuTitles2[usage - 0xb0]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&simuTitles2[usage - 0xb0]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1313,9 +1313,9 @@ void ReportDescParserBase::PrintVRControlsPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x0b)
|
||||
E_Notify((char*)pgm_read_word(&vrTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&vrTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x22)
|
||||
E_Notify((char*)pgm_read_word(&vrTitles1[usage - 0x20]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&vrTitles1[usage - 0x20]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1324,11 +1324,11 @@ void ReportDescParserBase::PrintSportsControlsPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x05)
|
||||
E_Notify((char*)pgm_read_word(&sportsCtrlTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x2f && usage < 0x3a)
|
||||
E_Notify((char*)pgm_read_word(&sportsCtrlTitles1[usage - 0x30]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles1[usage - 0x30]), 0x80);
|
||||
else if (usage > 0x4f && usage < 0x64)
|
||||
E_Notify((char*)pgm_read_word(&sportsCtrlTitles2[usage - 0x50]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles2[usage - 0x50]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1337,9 +1337,9 @@ void ReportDescParserBase::PrintGameControlsPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x04)
|
||||
E_Notify((char*)pgm_read_word(&gameTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&gameTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x3a)
|
||||
E_Notify((char*)pgm_read_word(&gameTitles1[usage - 0x20]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&gameTitles1[usage - 0x20]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1348,7 +1348,7 @@ void ReportDescParserBase::PrintGenericDeviceControlsPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x1f && usage < 0x27)
|
||||
E_Notify((char*)pgm_read_word(&genDevCtrlTitles[usage - 0x20]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&genDevCtrlTitles[usage - 0x20]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1357,7 +1357,7 @@ void ReportDescParserBase::PrintLEDPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x4e)
|
||||
E_Notify((char*)pgm_read_word(&ledTitles[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&ledTitles[usage - 1]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1366,17 +1366,17 @@ void ReportDescParserBase::PrintTelephonyPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x08)
|
||||
E_Notify((char*)pgm_read_word(&telTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x32)
|
||||
E_Notify((char*)pgm_read_word(&telTitles1[usage - 0x1f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles1[usage - 0x1f]), 0x80);
|
||||
else if (usage > 0x4f && usage < 0x54)
|
||||
E_Notify((char*)pgm_read_word(&telTitles2[usage - 0x4f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles2[usage - 0x4f]), 0x80);
|
||||
else if (usage > 0x6f && usage < 0x75)
|
||||
E_Notify((char*)pgm_read_word(&telTitles3[usage - 0x6f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles3[usage - 0x6f]), 0x80);
|
||||
else if (usage > 0x8f && usage < 0x9f)
|
||||
E_Notify((char*)pgm_read_word(&telTitles4[usage - 0x8f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles4[usage - 0x8f]), 0x80);
|
||||
else if (usage > 0xaf && usage < 0xc0)
|
||||
E_Notify((char*)pgm_read_word(&telTitles5[usage - 0xaf]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&telTitles5[usage - 0xaf]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1385,35 +1385,35 @@ void ReportDescParserBase::PrintConsumerPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x07)
|
||||
E_Notify((char*)pgm_read_word(&consTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x23)
|
||||
E_Notify((char*)pgm_read_word(&consTitles1[usage - 0x1f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles1[usage - 0x1f]), 0x80);
|
||||
else if (usage > 0x2f && usage < 0x37)
|
||||
E_Notify((char*)pgm_read_word(&consTitles2[usage - 0x2f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles2[usage - 0x2f]), 0x80);
|
||||
else if (usage > 0x3f && usage < 0x49)
|
||||
E_Notify((char*)pgm_read_word(&consTitles3[usage - 0x3f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles3[usage - 0x3f]), 0x80);
|
||||
else if (usage > 0x5f && usage < 0x67)
|
||||
E_Notify((char*)pgm_read_word(&consTitles4[usage - 0x5f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles4[usage - 0x5f]), 0x80);
|
||||
else if (usage > 0x7f && usage < 0xa5)
|
||||
E_Notify((char*)pgm_read_word(&consTitles5[usage - 0x7f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles5[usage - 0x7f]), 0x80);
|
||||
else if (usage > 0xaf && usage < 0xcf)
|
||||
E_Notify((char*)pgm_read_word(&consTitles6[usage - 0xaf]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles6[usage - 0xaf]), 0x80);
|
||||
else if (usage > 0xdf && usage < 0xeb)
|
||||
E_Notify((char*)pgm_read_word(&consTitles7[usage - 0xdf]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles7[usage - 0xdf]), 0x80);
|
||||
else if (usage > 0xef && usage < 0xf6)
|
||||
E_Notify((char*)pgm_read_word(&consTitles8[usage - 0xef]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles8[usage - 0xef]), 0x80);
|
||||
else if (usage > 0xff && usage < 0x10e)
|
||||
E_Notify((char*)pgm_read_word(&consTitles9[usage - 0xff]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitles9[usage - 0xff]), 0x80);
|
||||
else if (usage > 0x14f && usage < 0x156)
|
||||
E_Notify((char*)pgm_read_word(&consTitlesA[usage - 0x14f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitlesA[usage - 0x14f]), 0x80);
|
||||
else if (usage > 0x15f && usage < 0x16b)
|
||||
E_Notify((char*)pgm_read_word(&consTitlesB[usage - 0x15f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitlesB[usage - 0x15f]), 0x80);
|
||||
else if (usage > 0x16f && usage < 0x175)
|
||||
E_Notify((char*)pgm_read_word(&consTitlesC[usage - 0x16f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitlesC[usage - 0x16f]), 0x80);
|
||||
else if (usage > 0x17f && usage < 0x1c8)
|
||||
E_Notify((char*)pgm_read_word(&consTitlesD[usage - 0x17f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitlesD[usage - 0x17f]), 0x80);
|
||||
else if (usage > 0x1ff && usage < 0x29d)
|
||||
E_Notify((char*)pgm_read_word(&consTitlesE[usage - 0x1ff]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&consTitlesE[usage - 0x1ff]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1422,11 +1422,11 @@ void ReportDescParserBase::PrintDigitizerPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x0e)
|
||||
E_Notify((char*)pgm_read_word(&digitTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&digitTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x23)
|
||||
E_Notify((char*)pgm_read_word(&digitTitles1[usage - 0x1f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&digitTitles1[usage - 0x1f]), 0x80);
|
||||
else if (usage > 0x2f && usage < 0x47)
|
||||
E_Notify((char*)pgm_read_word(&digitTitles2[usage - 0x2f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x2f]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1435,11 +1435,11 @@ void ReportDescParserBase::PrintAlphanumDisplayPageUsage(uint16_t usage) {
|
|||
E_Notify(pstrSpace, 0x80);
|
||||
|
||||
if (usage > 0x00 && usage < 0x03)
|
||||
E_Notify((char*)pgm_read_word(&aplphanumTitles0[usage - 1]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&aplphanumTitles0[usage - 1]), 0x80);
|
||||
else if (usage > 0x1f && usage < 0x4e)
|
||||
E_Notify((char*)pgm_read_word(&aplphanumTitles1[usage - 0x1f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&aplphanumTitles1[usage - 0x1f]), 0x80);
|
||||
else if (usage > 0x7f && usage < 0x96)
|
||||
E_Notify((char*)pgm_read_word(&digitTitles2[usage - 0x80]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x80]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
@ -1450,17 +1450,17 @@ void ReportDescParserBase::PrintMedicalInstrumentPageUsage(uint16_t usage) {
|
|||
if (usage == 1)
|
||||
E_Notify(pstrUsageMedicalUltrasound, 0x80);
|
||||
else if (usage > 0x1f && usage < 0x28)
|
||||
E_Notify((char*)pgm_read_word(&medInstrTitles0[usage - 0x1f]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&medInstrTitles0[usage - 0x1f]), 0x80);
|
||||
else if (usage > 0x3f && usage < 0x45)
|
||||
E_Notify((char*)pgm_read_word(&medInstrTitles1[usage - 0x40]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&medInstrTitles1[usage - 0x40]), 0x80);
|
||||
else if (usage > 0x5f && usage < 0x62)
|
||||
E_Notify((char*)pgm_read_word(&medInstrTitles2[usage - 0x60]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&medInstrTitles2[usage - 0x60]), 0x80);
|
||||
else if (usage == 0x70)
|
||||
E_Notify(pstrUsageDepthGainCompensation, 0x80);
|
||||
else if (usage > 0x7f && usage < 0x8a)
|
||||
E_Notify((char*)pgm_read_word(&medInstrTitles3[usage - 0x80]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&medInstrTitles3[usage - 0x80]), 0x80);
|
||||
else if (usage > 0x9f && usage < 0xa2)
|
||||
E_Notify((char*)pgm_read_word(&medInstrTitles4[usage - 0xa0]), 0x80);
|
||||
E_Notify((char*)pgm_read_pointer(&medInstrTitles4[usage - 0xa0]), 0x80);
|
||||
else
|
||||
E_Notify(pstrUsagePageUndefined, 0x80);
|
||||
}
|
||||
|
|
|
@ -170,4 +170,4 @@ public:
|
|||
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
|
||||
};
|
||||
|
||||
#endif // __HIDDESCRIPTORPARSER_H__
|
||||
#endif // __HIDDESCRIPTORPARSER_H__
|
||||
|
|
|
@ -245,6 +245,10 @@ setRumbleToggle KEYWORD2
|
|||
getPitch KEYWORD2
|
||||
getRoll KEYWORD2
|
||||
getYaw KEYWORD2
|
||||
getWiimotePitch KEYWORD2
|
||||
getWiimoteRoll KEYWORD2
|
||||
getNunchuckPitch KEYWORD2
|
||||
getNunchuckRoll KEYWORD2
|
||||
PAIR KEYWORD2
|
||||
statusRequest KEYWORD2
|
||||
getBatteryLevel KEYWORD2
|
||||
|
@ -267,8 +271,6 @@ ZL LITERAL1
|
|||
ZR LITERAL1
|
||||
HatX LITERAL1
|
||||
HatY LITERAL1
|
||||
nunchuckPitch LITERAL1
|
||||
nunchuckRoll LITERAL1
|
||||
|
||||
####################################################
|
||||
# Methods and Functions for the IR Camera
|
||||
|
|
|
@ -14,6 +14,7 @@ Circuits At Home, LTD
|
|||
Web : http://www.circuitsathome.com
|
||||
e-mail : support@circuitsathome.com
|
||||
*/
|
||||
|
||||
#if !defined(_usb_h_) || defined(__PARSETOOLS_H__)
|
||||
#error "Never include parsetools.h directly; include Usb.h instead"
|
||||
#else
|
||||
|
|
17
usbhost.h
17
usbhost.h
|
@ -44,12 +44,14 @@ public:
|
|||
/* SPI pin definitions. see avrpins.h */
|
||||
#if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
|
||||
typedef SPi< Pb1, Pb2, Pb3, Pb0 > spi;
|
||||
#endif
|
||||
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
|
||||
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
|
||||
typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi;
|
||||
#endif
|
||||
#if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
|
||||
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
|
||||
typedef SPi< Pb7, Pb5, Pb6, Pb4 > spi;
|
||||
#elif defined(__MK20DX128__)
|
||||
typedef SPi< P13, P11, P12, P10 > spi;
|
||||
#else
|
||||
#error "No SPI entry in usbhost.h"
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
|
@ -93,10 +95,9 @@ template< typename SS, typename INTR >
|
|||
MAX3421e< SS, INTR >::MAX3421e() {
|
||||
// Leaving ADK hardware setup in here, for now. This really belongs with the other parts.
|
||||
#ifdef BOARD_MEGA_ADK
|
||||
/* For Mega ADK, which has Max3421e on-board, set MAX_RESET to Output mode, and pull Reset to HIGH */
|
||||
DDRJ |= _BV(PJ2);
|
||||
PORTJ &= ~_BV(PJ2);
|
||||
PORTJ |= _BV(PJ2);
|
||||
// For Mega ADK, which has a Max3421e on-board, set MAX_RESET to output mode, and then set it to HIGH
|
||||
P55::SetDirWrite();
|
||||
P55::Set();
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue