ISP example program.

Dependencies:   SLCD mbed USBLocalFileSystem

/media/uploads/va009039/lpc81isp-360x240.jpg

FRDM-KL46ZLPC810
UART RXDPTE23p2(P0_4)
UART TXDPTE22p8(P0_0)
nRESETD6p1(P0_5)
nISPD8p5(P0_1)
GNDGNDp7
3.3VP3V3p6

Copy binary image to the disk called LPC81ISP.
Push sw1 or sw3, start write to LPC810 flash.

Committer:
va009039
Date:
Sun Feb 16 12:56:12 2014 +0000
Revision:
1:cccfc461c61f
Parent:
0:ad2b1fc04955
add virtual COM.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:ad2b1fc04955 1 /* mbed Microcontroller Library
va009039 0:ad2b1fc04955 2 * Copyright (c) 2006-2012 ARM Limited
va009039 0:ad2b1fc04955 3 *
va009039 0:ad2b1fc04955 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
va009039 0:ad2b1fc04955 5 * of this software and associated documentation files (the "Software"), to deal
va009039 0:ad2b1fc04955 6 * in the Software without restriction, including without limitation the rights
va009039 0:ad2b1fc04955 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
va009039 0:ad2b1fc04955 8 * copies of the Software, and to permit persons to whom the Software is
va009039 0:ad2b1fc04955 9 * furnished to do so, subject to the following conditions:
va009039 0:ad2b1fc04955 10 *
va009039 0:ad2b1fc04955 11 * The above copyright notice and this permission notice shall be included in
va009039 0:ad2b1fc04955 12 * all copies or substantial portions of the Software.
va009039 0:ad2b1fc04955 13 *
va009039 0:ad2b1fc04955 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
va009039 0:ad2b1fc04955 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
va009039 0:ad2b1fc04955 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
va009039 0:ad2b1fc04955 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
va009039 0:ad2b1fc04955 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
va009039 0:ad2b1fc04955 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
va009039 0:ad2b1fc04955 20 * SOFTWARE.
va009039 0:ad2b1fc04955 21 */
va009039 0:ad2b1fc04955 22 #ifndef MBED_FATFILESYSTEM_H
va009039 0:ad2b1fc04955 23 #define MBED_FATFILESYSTEM_H
va009039 0:ad2b1fc04955 24
va009039 0:ad2b1fc04955 25 #include "FileSystemLike.h"
va009039 0:ad2b1fc04955 26 #include "FileHandle.h"
va009039 0:ad2b1fc04955 27 #include "ff.h"
va009039 0:ad2b1fc04955 28 #include <stdint.h>
va009039 0:ad2b1fc04955 29
va009039 0:ad2b1fc04955 30 using namespace mbed;
va009039 0:ad2b1fc04955 31
va009039 0:ad2b1fc04955 32 class FATFileSystem : public FileSystemLike {
va009039 0:ad2b1fc04955 33 public:
va009039 0:ad2b1fc04955 34
va009039 0:ad2b1fc04955 35 FATFileSystem(const char* n);
va009039 0:ad2b1fc04955 36 virtual ~FATFileSystem();
va009039 0:ad2b1fc04955 37
va009039 0:ad2b1fc04955 38 static FATFileSystem * _ffs[_VOLUMES]; // FATFileSystem objects, as parallel to FatFs drives array
va009039 0:ad2b1fc04955 39 FATFS _fs; // Work area (file system object) for logical drive
va009039 0:ad2b1fc04955 40 int _fsid;
va009039 0:ad2b1fc04955 41
va009039 0:ad2b1fc04955 42 virtual FileHandle *open(const char* name, int flags);
va009039 0:ad2b1fc04955 43 virtual int remove(const char *filename);
va009039 0:ad2b1fc04955 44 virtual int format();
va009039 0:ad2b1fc04955 45 virtual DirHandle *opendir(const char *name);
va009039 0:ad2b1fc04955 46 virtual int mkdir(const char *name, mode_t mode);
va009039 0:ad2b1fc04955 47
va009039 0:ad2b1fc04955 48 virtual int disk_initialize() { return 0; }
va009039 0:ad2b1fc04955 49 virtual int disk_status() { return 0; }
va009039 0:ad2b1fc04955 50 virtual int disk_read(uint8_t * buffer, uint64_t sector) = 0;
va009039 0:ad2b1fc04955 51 virtual int disk_write(const uint8_t * buffer, uint64_t sector) = 0;
va009039 0:ad2b1fc04955 52 virtual int disk_sync() { return 0; }
va009039 0:ad2b1fc04955 53 virtual uint64_t disk_sectors() = 0;
va009039 0:ad2b1fc04955 54
va009039 0:ad2b1fc04955 55 };
va009039 0:ad2b1fc04955 56
va009039 0:ad2b1fc04955 57 #endif