-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdma-fw.h
64 lines (49 loc) · 1.86 KB
/
mdma-fw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/** \file
* \author doragasu
* \date 2015
* \defgroup mdma-fw MegaDrive Memory Administration Firmware
* \{ */
#ifndef _BULK_VENDOR_H_
#define _BULK_VENDOR_H_
/* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include <LUFA/Drivers/Board/Buttons.h>
/** \addtogroup mdma-fw CartStatus Cartridge status information
* Holds information about if the cartridge is or not inserted, and if
* there has been a cartridge status change since last time.
* \{
*/
typedef union {
uint8_t all; ///< Access to all fields simultaneously
struct {
uint8_t statChange:1; ///< Status changed if TRUE
uint8_t inserted:1; ///< Cartridge inserted if TRUE
};
} CartStatus;
/** \} */
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_NO_LEDS
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED1 | LEDS_LED2)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY LEDS_LED1
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR LEDS_LED2
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
/* Function Prototypes: */
void SetupHardware(void);
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
#endif
/** \} */