this transfers data (which is stored in "bin" file in mbed storage) into LPC1114, LPC1115, LPC81x, LPC82x, LPC1768/LPC1769 and LPC11U68/LPC11E68 internal flash memory through ISP.

Dependencies:   mbed MODSERIAL DirectoryList

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers isp.h Source File

isp.h

00001 #ifndef MBED_ISP__ISP__
00002 #define MBED_ISP__ISP__
00003 
00004 
00005 int     isp_flash_write( const char *file_name );
00006 void    start_target_in_normal_mode( int baud_rate );
00007 void    start_success_indicator( void );
00008 void    toggle_led( char v );
00009 void    leds_off( void );
00010 void    show_progress( int total_size, int file_size );
00011 
00012 
00013 enum {
00014     NO_ERROR                            = 0x00,
00015 
00016     ERROR_AT_TARGET_OPEN,
00017     ERROR_DATA_SIZE_ZERO,
00018     
00019     ERROR_AT_FILE_OPEN,
00020     ERROR_AT_SECTOR_ERASE,
00021 
00022     ERROR_AT_MALLOC_FOR_WRITE_BUFF,
00023     ERROR_AT_WRITE_COMMAND,
00024     ERROR_AT_PREPARE_COMMAND,
00025     ERROR_AT_COPY_COMMAND,
00026     ERROR_AT_SENDING_CHECKSUM,
00027 
00028     ERROR_AT_MALLOC_FOR_VERIFY_FILE_BUFF,
00029     ERROR_AT_MALLOC_FOR_VERIFY_DATA_BUFF,
00030     ERROR_AT_READ_COMMAND,
00031 
00032     ERROR_DATA_DOES_NOT_MATCH, 
00033     
00034     WARNING_CRP_CODE_DETECTED
00035 };
00036 
00037 
00038 enum {
00039     NO_ISP  = 0x4E697370,
00040     CRP1    = 0x12345678,
00041     CRP2    = 0x87654321,
00042     CRP3    = 0x43218765,
00043     CRP_CHECK_ERROR    = 0xFFFFFFFF
00044 };
00045 
00046 
00047 #endif  //  MBED_ISP__ISP__
00048