Dependencies:   mbed

ID.cpp

Committer:
daugihao
Date:
2011-09-30
Revision:
4:8046ba0a87b5
Parent:
3:eb6d9211592d
Child:
5:6134277e4d57

File content as of revision 4:8046ba0a87b5:

#include "mbed.h"
#include "LPC.h"
//Function to document the relevant information on LPC chips to load onto
int SerialBuffered::IDCheck(int idcode) {
    switch (idcode) {
    
        //Cortex M3 - LPC17xx
        case 637615927:
            strcpy(strChipType, "LPC1768 - Cortex M3");  //Chip name
            lastSector = 29;                             //Last available sector in Flash
            RAM = 268435968;                             //First RAM address
            strcpy(speed, "4000");                       //Chip speed
            break;
            
        case 1023410219:
            strcpy(strChipType, "LPC1343 - ARM7");  //Can run up to 115200 baud
            lastSector = 27;
            RAM = 0x40000200;
            strcpy(speed, "4000");                      
            break;
            
        //ARM7
        case 117702437:
            strcpy(strChipType, "LPC2387 - ARM7");
            lastSector = 27;
            RAM = 0x40000200;
            strcpy(speed, "4000");                       
            break;
            
        default:
            strcpy(strChipType, "\n\rUnrecognised chip! Please add into the \"CheckTargetPresent\" function the chip's relevant information.\r\n\n");
            return(2);
    }
    return 0;
}