#include "board.h"
#include "libstoragemedia.h"
#include <USBD_Config.h>
#include <USBD_LEDs.h>
#include <HIDMSDDriver.h>
#include <HIDDKeyboard.h>
#include <MSDFunction.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
Detailed Description
This file contains all the specific code for the usb_hid_msd
Contents
The code can be roughly broken down as follows:
- Configuration functions
- VBus_Configure
- PIO configurations in start of main
- Interrupt handlers
- Callback functions
- USBDCallbacks_RequestReceived
- The main function, which implements the program behaviour
Definition in file main.c.
Define Documentation
Size of one block in bytes.
Definition at line 172 of file main.c.
Nand flash
Definition at line 169 of file main.c.
Media index for different disks RAM disk
Definition at line 167 of file main.c.
SD card
Definition at line 168 of file main.c.
#define LED_NUMLOCK USBD_LEDOTHER |
Num lock LED index.
Definition at line 161 of file main.c.
Maximum number of LUNs which can be defined.
Definition at line 165 of file main.c.
Master clock frequency in Hz
Definition at line 149 of file main.c.
#define MSD_BUFFER_SIZE (12*BLOCK_SIZE) |
Size of the MSD IO buffer in bytes (6K, more the better).
Definition at line 175 of file main.c.
Number of keys used in the example.
Definition at line 152 of file main.c.
#define NUM_MODIFIER_KEYS (NUM_KEYS - NUM_NORMAL_KEYS) |
Number of modifier keys.
Definition at line 158 of file main.c.
#define NUM_NORMAL_KEYS 1 |
Number of non-modifiers keys.
Definition at line 155 of file main.c.
#define RAMDISK_SIZE 128*1024 |
Ramdisk size: 20K (WinXP can not format the disk if lower than 20K)
Definition at line 178 of file main.c.
Function Documentation
COMPILER_SECTION |
( |
"ramdisk_region" |
|
) |
|
List of pinsPushButtons to configure for the application.
Definition at line 180 of file main.c.
void HIDDKeyboardCallbacks_LedsChanged |
( |
uint8_t |
numLockStatus, |
|
|
uint8_t |
capsLockStatus, |
|
|
uint8_t |
scrollLockStatus | |
|
) |
| | |
Invoked when the status of the keyboard LEDs changes. Turns the num. lock LED on or off.
- Parameters:
-
| numLockStatus | Indicates the current status of the num. lock key. |
| capsLockStatus | Indicates the current status of the caps lock key. |
| scrollLockStatus | Indicates the current status of the scroll lock key |
Definition at line 307 of file main.c.
Initializes drivers and start the USB composite device.
Definition at line 444 of file main.c.
Invoked when a new SETUP request is received from the host. Forwards the request to the Mass Storage device driver handler function.
- Parameters:
-
Definition at line 247 of file main.c.
void USBDDriverCallbacks_ConfigurationChanged |
( |
uint8_t |
cfgnum |
) |
|
Invoked when the configuration of the device changes. Parse used endpoints.
- Parameters:
-
| cfgnum | New configuration number. |
Definition at line 237 of file main.c.
Variable Documentation
Device LUNs.
Definition at line 220 of file main.c.
Available media.
Definition at line 217 of file main.c.
LUN read/write buffer.
Definition at line 223 of file main.c.
Delay for data write refresh
Definition at line 228 of file main.c.
Total data write to disk
Definition at line 226 of file main.c.