William Reynolds
/
LPC_Bootloader
ID.cpp@3:eb6d9211592d, 2011-09-29 (annotated)
- Committer:
- daugihao
- Date:
- Thu Sep 29 15:15:57 2011 +0000
- Revision:
- 3:eb6d9211592d
- Parent:
- 1:0872c208795f
- Child:
- 4:8046ba0a87b5
Adjustable speeds for different chip types
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
daugihao | 0:15536fa79743 | 1 | #include "mbed.h" |
daugihao | 0:15536fa79743 | 2 | #include "LPC.h" |
daugihao | 0:15536fa79743 | 3 | //Function to document the relevant information on LPC chips to load onto |
daugihao | 0:15536fa79743 | 4 | int SerialBuffered::IDCheck(int idcode) { |
daugihao | 0:15536fa79743 | 5 | switch (idcode) { |
daugihao | 0:15536fa79743 | 6 | //Cortex M3 - LPC17xx |
daugihao | 0:15536fa79743 | 7 | case 637615927: |
daugihao | 1:0872c208795f | 8 | strcpy(strChipType, "LPC1768 - Cortex M3"); //Chip name |
daugihao | 1:0872c208795f | 9 | lastSector = 29; //Last available sector in Flash |
daugihao | 1:0872c208795f | 10 | RAM = 268435968; //First RAM address |
daugihao | 3:eb6d9211592d | 11 | strcpy(speed, "4000"); //Chip speed |
daugihao | 0:15536fa79743 | 12 | break; |
daugihao | 1:0872c208795f | 13 | //ARM7 |
daugihao | 1:0872c208795f | 14 | case 117702437: |
daugihao | 1:0872c208795f | 15 | strcpy(strChipType, "LPC2387 - ARM7"); |
daugihao | 1:0872c208795f | 16 | lastSector = 27; |
daugihao | 1:0872c208795f | 17 | RAM = 0x40000200; |
daugihao | 3:eb6d9211592d | 18 | strcpy(speed, "4000"); //Chip speed |
daugihao | 0:15536fa79743 | 19 | break; |
daugihao | 0:15536fa79743 | 20 | |
daugihao | 0:15536fa79743 | 21 | default: |
daugihao | 0:15536fa79743 | 22 | strcpy(strChipType, "\n\rUnrecognised chip! Please add into the \"CheckTargetPresent\" function the chip's relevant information.\r\n\n"); |
daugihao | 1:0872c208795f | 23 | return(2); |
daugihao | 0:15536fa79743 | 24 | } |
daugihao | 0:15536fa79743 | 25 | return 0; |
daugihao | 0:15536fa79743 | 26 | } |