Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Gamecube.h
- Committer:
- christopherjwang
- Date:
- 2015-12-06
- Revision:
- 1:a93f71ee6778
- Parent:
- 0:7434770d9fc9
File content as of revision 1:a93f71ee6778:
#ifndef GAMECUBE_H
#define GAMECUBE_H
#include <stdint.h>
#include <mbed.h>
//================================================================================
// Gamecube
//================================================================================
// gamecube controller device status ids
#define NINTENDO_DEVICE_GC_WIRED 0x0900
class Gamecube{
public:
Gamecube(PinName _data_line);
int get_device_id();
void gc_write_read(uint32_t* wbuff, uint8_t wbuff_len, uint32_t *rbuff, uint8_t rbuff_len);
void rumble(bool r);
void update(void);
bool A;
bool B;
bool X;
bool Y;
bool START;
bool L;
bool R;
bool Z;
bool D_UP;
bool D_DOWN;
bool D_LEFT;
bool D_RIGHT;
int JOYSTICK_X;
int JOYSTICK_Y;
int C_STICK_X;
int C_STICK_Y;
int LEFT_TRIGGER;
int RIGHT_TRIGGER;
private:
DigitalOut data_line;
bool _rumble;
};
#endif // include guard