Assa teamet / Mbed 2 deprecated EINT1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Mbize
Date:
Fri May 02 12:19:01 2014 +0000
Commit message:
a

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 02 12:19:01 2014 +0000
@@ -0,0 +1,65 @@
+#include "LPC17xx.h"
+#include "mbed.h"
+     /* printuart(14,"SLEEP MODE ON");          
+      EINTInit();   
+
+      LPC_SC->PCON &= ~(0x03 <<0); 
+
+      flagwakeup=0;
+
+      while(flagwakeup==0)
+          checkwdt_ev(); //reset watchdog
+
+    NVIC_DisableIRQ(EINT1_IRQn);
+
+    LPC_PINCON->PINSEL4 &= ~(0x03 << 22);   //as gpio
+    LPC_GPIO2->FIODIR &= ~(0x01 <<11);  // as input
+    LPC_PINCON->PINSEL2 &= ~(0x03<<26); // P2.13 as GPIO
+    LPC_GPIO2->FIODIR &=~(1<<13);   //P2.13 as input
+
+    printuart(16,"SLEEP MODE OFF");*/
+
+
+int main()
+{
+ LPC_PINCON->PINSEL4 &= ~(3UL<<22); // Reset P2.11  to GPIO
+ LPC_PINCON->PINSEL4 |= (0x01<<22); // P2.11 as external interupt
+
+ LPC_PINCON->PINSEL4 &= ~(3UL<<26); // Reset P2.13  to GPIO
+ LPC_PINCON->PINSEL4 |= (0x01<<26); // P2.13 as external interupt
+
+ LPC_GPIOINT->IO2IntEnF = ((0x01 <<11) | (0x01 <<13));   //Port2.11 and P2.13 are  falling edge.
+
+
+ //LPC_SC->EXTMODE = (EINT1_EDGE | EINT3_EDGE) ;      //INT1 and INT3 edge trigger
+
+ LPC_SC->EXTPOLAR = 0;              //INT1 and INT3 is falling edge by default
+
+
+
+ NVIC_EnableIRQ(EINT1_IRQn);
+
+ return( TRUE );
+}
+
+
+
+void EINT1_IRQHandler (void)
+
+{
+  LPC_SC->EXTINT = EINT1;       /* clear interrupt */
+
+  LPC_SC->PCONP |= (0x01 <<3);      //power on uart0
+  LPC_SC->PCONP |= (0x01 <<4);      //power on uart1
+  LPC_SC->PCONP |= (0x01 <<7);      //power on i2c0
+  LPC_SC->PCONP |= (0x01 <<8);      //power on SPI
+  LPC_SC->PCONP |= (0x01 <<10);     //power on SSP1
+  LPC_SC->PCONP |= (0x01 <<19);     //power on i2c1
+  LPC_SC->PCONP |= (0x01 <<21);     //ppower on SSP0
+  LPC_SC->PCONP |= (0x01 <<26);     //power on i2c2
+
+  //test2_count_fhn(15,"SLEEP MODE OFF");
+
+  flagwakeup=1;
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 02 12:19:01 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file