| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ramdisk.c File Reference

## Detailed Description

Functions to manage the physical Dataflash media, including reading and writing of blocks of data. These functions are called by the SCSI layer when data must be stored or retrieved to/from the physical storage media. If a different media is used (such as a SD card or EEPROM), functions similar to these will need to be generated.

Definition in file ramdisk.c.

`#include "usbmsdev.h"`
`#include "ramdisk.h"`

Go to the source code of this file.

## Data Structures
struct | FAT12_img

## Macros
#define | USBDATARAM LOCATE_AT(DATA_RAM_START_ADDRESS)

## Functions
void | DataRam_WriteBlocks (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
| DataRAM write blocks function.
void | DataRam_ReadBlocks (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
| DataRAM read blocks function.
uint32_t | MassStorage_GetAddressInImage (uint32_t startblock, uint16_t requestblocks, uint16_t *availableblocks)
| DataRAM read blocks function.
void | DataRam_Initialize (void)
| DataRAM Initilisation function.

## Variables
static int | InitializedFlag = 0
USBDATARAM uint8_t | DiskImage [DATA_RAM_PHYSICAL_SIZE]
static const uint8_t | FAT12_header []
static const uint8_t | FAT12_root_dir []
static const uint8_t | FAT12_file_readme_txt []
static const uint8_t | FAT12_file_index_htm []
static struct FAT12_img | FAT12_img []

## Macro Definition Documentation

#define USBDATARAM LOCATE_AT(DATA_RAM_START_ADDRESS)

Definition at line 50 of file ramdisk.c.

## Variable Documentation

USBDATARAM uint8_t DiskImage[DATA_RAM_PHYSICAL_SIZE]

Definition at line 51 of file ramdisk.c.

const uint8_t FAT12_file_index_htm[]
| static

Initial value:
= {
0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a,
0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a, 0x09, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0a, 0x09,
0x09, 0x3c, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65,
0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x68, 0x31, 0x20, 0x7b,
0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x72, 0x65, 0x64, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61,
0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x7d, 0x0a, 0x09, 0x09,
0x09, 0x68, 0x32, 0x20, 0x7b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x62, 0x6c, 0x75, 0x65, 0x3b,
0x7d, 0x0a, 0x09, 0x09, 0x09, 0x70, 0x20, 0x7b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x67, 0x72,
0x65, 0x65, 0x6e, 0x3b, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x7b, 0x62,
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x52, 0x47, 0x42, 0x28, 0x32,
0x31, 0x35, 0x2c, 0x32, 0x33, 0x32, 0x2c, 0x32, 0x34, 0x34, 0x29, 0x3b, 0x7d, 0x0a, 0x09, 0x09,
0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64,
0x3e, 0x0a, 0x0a, 0x09, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x0a, 0x0a, 0x09, 0x09, 0x3c, 0x68,
0x31, 0x3e, 0x4e, 0x58, 0x50, 0x20, 0x4c, 0x50, 0x43, 0x34, 0x33, 0x58, 0x58, 0x20, 0x44, 0x75,
0x61, 0x6c, 0x20, 0x43, 0x6f, 0x72, 0x65, 0x20, 0x55, 0x53, 0x42, 0x2f, 0x6c, 0x77, 0x49, 0x50,
0x20, 0x44, 0x65, 0x6d, 0x6f, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x68, 0x72,
0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x70, 0x3e, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20,
0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x69, 0x73, 0x69,
0x74, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x77, 0x77, 0x77, 0x2e, 0x6c, 0x70,
0x63, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x3e, 0x20, 0x77, 0x77, 0x77, 0x2e,
0x6c, 0x70, 0x63, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x3c, 0x2f, 0x61, 0x3e,
0x20, 0x3c, 0x2f, 0x70, 0x3e, 0x0a, 0x0a, 0x09, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x0a,
0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 107 of file ramdisk.c.

const uint8_t FAT12_file_readme_txt[]
| static

Initial value:
= {
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x55, 0x53, 0x42, 0x20, 0x4d, 0x65,
0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x64, 0x65, 0x6d, 0x6f,
0x6e, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

Definition at line 101 of file ramdisk.c.

const uint8_t FAT12_header[]
| static

Definition at line 54 of file ramdisk.c.

struct FAT12_img FAT12_img[]
| static

Initial value:
= {
{FAT12_header, 0, sizeof(FAT12_header)},
{FAT12_root_dir, 0x400, sizeof(FAT12_root_dir)},
{FAT12_file_readme_txt, 0x600, sizeof(FAT12_file_readme_txt)},
{FAT12_file_index_htm, 0xC00, sizeof(FAT12_file_index_htm)},
}

const uint8_t FAT12_root_dir[]
| static

Initial value:
= {
0x4c, 0x50, 0x43, 0x55, 0x53, 0x42, 0x6c, 0x69, 0x62, 0x20, 0x20, 0x28, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x45, 0x41, 0x44, 0x4d, 0x45, 0x20, 0x20, 0x54, 0x58, 0x54, 0x21, 0x00, 0x00, 0x00, 0x00,
0x21, 0x00, 0xbb, 0x32, 0x00, 0x00, 0xdc, 0x83, 0xbb, 0x32, 0x02, 0x00, 0x5d, 0x00, 0x00, 0x00,
0x41, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x65, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x2f, 0x2e, 0x00,
0x68, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x49, 0x4e, 0x44, 0x45, 0x58, 0x20, 0x20, 0x20, 0x48, 0x54, 0x4d, 0x20, 0x00, 0x00, 0x0f, 0x93,
0x4a, 0x41, 0x4a, 0x41, 0x00, 0x00, 0x0f, 0x93, 0x4a, 0x41, 0x05, 0x00, 0x68, 0x01, 0x00, 0x00,
}

Definition at line 90 of file ramdisk.c.

int InitializedFlag = 0
| static

Definition at line 48 of file ramdisk.c.