#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 173 of file main.c.
Nand flash
Definition at line 170 of file main.c.
Media index for different disks RAM disk
Definition at line 168 of file main.c.
SD card
Definition at line 169 of file main.c.
#define LED_NUMLOCK USBD_LEDOTHER |
Num lock LED index.
Definition at line 162 of file main.c.
Maximum number of LUNs which can be defined.
Definition at line 166 of file main.c.
Master clock frequency in Hz
Definition at line 150 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 176 of file main.c.
Number of keys used in the example.
Definition at line 153 of file main.c.
#define NUM_MODIFIER_KEYS (NUM_KEYS - NUM_NORMAL_KEYS) |
Number of modifier keys.
Definition at line 159 of file main.c.
#define NUM_NORMAL_KEYS 1 |
Number of non-modifiers keys.
Definition at line 156 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 179 of file main.c.
Function Documentation
LUN read/write buffer. Invoked when the configuration of the device changes. Parse used endpoints.
- Parameters:
-
| cfgnum | New configuration number. |
Definition at line 225 of file main.c.
COMPILER_SECTION |
( |
"ramdisk_region" |
|
) |
|
List of pinsPushButtons to configure for the application.
Definition at line 181 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 310 of file main.c.
Initializes drivers and start the USB composite device.
Definition at line 458 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 249 of file main.c.
Variable Documentation
Device LUNs.
Definition at line 222 of file main.c.
Available media.
Definition at line 219 of file main.c.