Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lpc810_helloworld by
main.cpp
00001 // sample code for ToraGi I2C board(2014/2) 00002 // please select LPC800-MAX on mbed compiler 00003 // Note: CPU on this board is LPC810 (NOT LPC812) 00004 #include "mbed.h" 00005 00006 DigitalOut myled(P0_1); 00007 00008 // generated by Switch Matrix Tool LPC810M021FN8 00009 //---------------------------- 00010 // pin assigment 00011 //---------------------------- 00012 // Pin Function 00013 // 1------ RESET 00014 // 2(P0_4) I2C0_SCL 00015 // 3------ SWCLK 00016 // 4------ SWDIO 00017 // 5(P0_1) PIO0_1 00018 // 6------ VDD 00019 // 7------ VSS 00020 // 8(P0_0) I2C0_SDA 00021 //---------------------------- 00022 void SwitchMatrix_Init() 00023 { 00024 /* Enable SWM clock */ 00025 LPC_SYSCON->SYSAHBCLKCTRL |= (1<<7); 00026 00027 /* Pin Assign 8 bit Configuration */ 00028 /* I2C0_SDA */ 00029 LPC_SWM->PINASSIGN7 = 0x00ffffffUL; 00030 /* I2C0_SCL */ 00031 LPC_SWM->PINASSIGN8 = 0xffffff04UL; 00032 00033 /* Pin Assign 1 bit Configuration */ 00034 /* SWCLK */ 00035 /* SWDIO */ 00036 /* RESET */ 00037 LPC_SWM->PINENABLE0 = 0xffffffb3UL; 00038 } 00039 00040 int main() { 00041 SwitchMatrix_Init(); 00042 00043 while(1) { 00044 myled = 1; 00045 wait_ms(50); 00046 myled = 0; 00047 wait_ms(50); 00048 } 00049 }
Generated on Mon Jul 18 2022 23:47:42 by
1.7.2
