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
42
43
48
49
54
55
56
57
58
59
60
61
62
63
64
65
66
72
73
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* ... */
#ifndef __MAIN_H
#define __MAIN_H
#include "stdio.h"
#include "usbh_core.h"
#include "usbh_msc.h"
#include "usbh_hid.h"
#include "usbh_hid_parser.h"
#include "stm324xg_eval_io.h"
#include "lcd_log.h"
#include "ff.h"
#include "ff_gen_drv.h"
#include "usbh_diskio_dma.h"
10 includes
Includes
typedef enum {
APPLI_HID_IDLE = 0,
APPLI_HID_WAIT,
APPLI_HID_START,
APPLI_HID_MOUSE,
APPLI_HID_KEYBOARD,
...}Demo_HID_State;
typedef enum {
HID_MOUSE_IDLE = 0,
HID_MOUSE_WAIT,
HID_MOUSE_START,
...}Demo_mouse_State;
typedef enum {
HID_KEYBOARD_IDLE = 0,
HID_KEYBOARD_WAIT,
HID_KEYBOARD_START,
...}Demo_keyboard_State;
typedef enum {
DEMO_IDLE = 0,
DEMO_WAIT,
DEMO_MSC_START,
DEMO_HID_START,
DEMO_HID,
DEMO_MSC,
DEMO_MSC_REENUMERATE,
DEMO_HID_REENUMERATE,
...}Demo_State;
typedef enum {
APPLI_MSC_IDLE = 0,
APPLI_MSC_WAIT,
APPLI_MSC_FILE_OPERATIONS,
APPLI_MSC_EXPLORER,
...}Demo_MSC_State;
typedef struct _DemoStateMachine {
__IO Demo_State state;
__IO Demo_MSC_State msc_state;
__IO Demo_HID_State hid_state;
__IO Demo_mouse_State mouse_state;
__IO Demo_keyboard_State keyboard_state;
__IO uint8_t select;
...}DEMO_StateMachine;
typedef enum {
APPLICATION_IDLE = 0,
APPLICATION_FS_DISCONNECT,
APPLICATION_FS_START,
APPLICATION_FS_READY,
APPLICATION_HS_DISCONNECT,
APPLICATION_HS_START,
APPLICATION_HS_READY,
APPLICATION_RUNNING,
...}DUAL_ApplicationTypeDef;
extern DEMO_StateMachine demo;
extern USBH_HandleTypeDef hUSBHost_FS;
extern USBH_HandleTypeDef hUSBHost_HS;
extern HCD_HandleTypeDef hhcd_FS;
extern HCD_HandleTypeDef hhcd_HS;
extern FATFS USBH_fatfs;
extern DUAL_ApplicationTypeDef Appli_HS_state;
extern DUAL_ApplicationTypeDef Appli_FS_state;
extern uint8_t *DEMO_MOUSE_menu[];
extern uint8_t prev_select;
Exported types
#define hUSBHost hUSBHost_HS
#define LCD_UsrLogY(...) LCD_LineColor = LCD_COLOR_YELLOW;\
printf(__VA_ARGS__);\
FRESULT Explore_Disk(char *path, uint8_t recu_level);...
void MSC_File_Operations(void);
void Toggle_Leds(void);
void Menu_Init(void);
void MSC_MenuProcess(void);
void HID_MenuProcess(void);
void Demo_SelectItem(uint8_t **menu, uint8_t item);
void HID_MouseMenuProcess(void);
void HID_KeyboardMenuProcess(void);
void HID_MOUSE_ButtonReleased(uint8_t button_idx);
void HID_MOUSE_ButtonPressed(uint8_t button_idx);
void USR_MOUSE_ProcessData(HID_MOUSE_Info_TypeDef *data);
void USR_KEYBRD_ProcessData(uint8_t data);
void DUAL_MenuProcess(void);
void DUAL_MenuInit(void);
void Demo_ProbeKey(JOYState_TypeDef state);/* ... */
#endif