27 #define WII_FLAG_MOTION_PLUS_CONNECTED (1 << 0) 28 #define WII_FLAG_NUNCHUCK_CONNECTED (1 << 1) 29 #define WII_FLAG_CALIBRATE_BALANCE_BOARD (1 << 2) 31 #define wii_check_flag(flag) (wii_event_flag & (flag)) 32 #define wii_set_flag(flag) (wii_event_flag |= (flag)) 33 #define wii_clear_flag(flag) (wii_event_flag &= ~(flag)) 296 return wiiBalanceBoardRaw[pos];
409 return (wiiState & 0x08);
438 bool activeConnection;
442 uint8_t wii_event_flag;
444 uint32_t ButtonState;
445 uint32_t OldButtonState;
446 uint32_t ButtonClickState;
447 uint16_t hatValues[4];
449 uint8_t HIDBuffer[3];
451 uint16_t stateCounter;
452 bool unknownExtensionConnected;
453 bool extensionConnected;
454 bool checkBatteryLevel;
455 bool motionPlusInside;
458 uint8_t control_scid[2];
459 uint8_t control_dcid[2];
460 uint8_t interrupt_scid[2];
461 uint8_t interrupt_dcid[2];
464 void HID_Command(uint8_t* data, uint8_t nbytes);
465 void setReportMode(
bool continuous, uint8_t mode);
467 void writeData(uint32_t offset, uint8_t size, uint8_t* data);
468 void initExtension1();
469 void initExtension2();
471 void statusRequest();
473 void readData(uint32_t offset, uint16_t size,
bool EEPROM);
474 void readExtensionType();
476 void readWiiBalanceBoardCalibration();
478 void checkMotionPresent();
479 void initMotionPlus();
480 void activateMotionPlus();
482 uint16_t wiiBalanceBoardRaw[4];
483 uint16_t wiiBalanceBoardCal[3][4];
488 bool activateNunchuck;
489 bool motionValuesReset;
493 uint8_t batteryLevel;
497 void enableIRCamera1();
498 void enableIRCamera2();
499 void writeSensitivityBlock1();
500 void writeSensitivityBlock2();
501 void write0x08Value();
502 void setWiiModeNumber(uint8_t mode_number);
504 uint16_t IR_object_x1;
505 uint16_t IR_object_y1;
506 uint8_t IR_object_s1;
507 uint16_t IR_object_x2;
508 uint16_t IR_object_y2;
509 uint8_t IR_object_s2;
510 uint16_t IR_object_x3;
511 uint16_t IR_object_y3;
512 uint8_t IR_object_s3;
513 uint16_t IR_object_x4;
514 uint16_t IR_object_y4;
515 uint8_t IR_object_s4;
void setLedToggle(LEDEnum a)
void setLedRaw(uint8_t value)
uint8_t getAnalogHat(HatEnum a)
void ACLData(uint8_t *ACLData)
uint8_t getBatteryLevel()
WII(BTD *p, bool pair=false)
bool getButtonClick(ButtonEnum b)
bool wiiUProControllerConnected
bool wiiBalanceBoardConnected
uint16_t getWeightRaw(BalanceBoardEnum pos)
bool getButtonPress(ButtonEnum b)
float getWeight(BalanceBoardEnum pos)