Energy Driven Computing - University of Southampton / Mbed 2 deprecated Hibernus

Dependencies:   mbed

Fork of Hibernus by Bogdan Lazarescu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Driver_LPC11U24.h Source File

Driver_LPC11U24.h

00001 /**    Hibernus Library
00002  *     University of Southampton 2017
00003  *
00004  *      Open-source liberary that enable any of your Mbed project work with transient enegy sources.
00005  *      In order to use this library include the "hibernus.h" header file, and use the "Hibernus()" method at the beginning of you main funtion.
00006  *      For more details and example see the "main.cpp" exampe file, and the attached documnetation
00007  *
00008  *
00009  *     Released under the MIT License: http://mbed.org/license/mit
00010  */
00011 #ifndef CONFIG_H_
00012 #define CONFIG_H_
00013 #ifdef LPC11U24
00014 #include "mbed.h"
00015 #include "IAP.h"
00016 
00017 /////for LPC11U24
00018 #define RAM_Start 0x10000000
00019 #define FLASH_Start 0x00000000
00020 #define RAM_Size 8192
00021 #define flash_Size  32768               //32K flash
00022 #define sector_Size FLASH_SECTOR_SIZE       //4K sector size
00023 
00024 #define No_Of_4B_Peripheral_Reg 10
00025 #define No_Of_1B_Peripheral_Reg 0
00026 
00027 const unsigned int REG_Addresses_4B[83] = {
00028 (unsigned int)&LPC_GPIO_PIN_INT->ISEL,                    /*!< (@ 0x4004C000) Pin Interrupt Mode register */
00029 (unsigned int)&LPC_GPIO_PIN_INT->IENR,                       /*!< (@ 0x4004C004) Pin Interrupt Enable (Rising) register */
00030 (unsigned int)&LPC_GPIO_PIN_INT->SIENR,                      /*!< (@ 0x4004C008) Set Pin Interrupt Enable (Rising) register */
00031 (unsigned int)&LPC_GPIO_PIN_INT->CIENR,                      /*!< (@ 0x4004C00C) Clear Pin Interrupt Enable (Rising) register */
00032 (unsigned int)&LPC_GPIO_PIN_INT->IENF,                       /*!< (@ 0x4004C010) Pin Interrupt Enable Falling Edge / Active Level register */
00033 (unsigned int)&LPC_GPIO_PIN_INT->SIENF,                      /*!< (@ 0x4004C014) Set Pin Interrupt Enable Falling Edge / Active Level register */
00034 (unsigned int)&LPC_GPIO_PIN_INT->CIENF,                      /*!< (@ 0x4004C018) Clear Pin Interrupt Enable Falling Edge / Active Level address */
00035 (unsigned int)&LPC_GPIO_PIN_INT->RISE,                       /*!< (@ 0x4004C01C) Pin Interrupt Rising Edge register */
00036 (unsigned int)&LPC_GPIO_PIN_INT->FALL,                       /*!< (@ 0x4004C020) Pin Interrupt Falling Edge register */
00037 (unsigned int)&LPC_GPIO_PIN_INT->IST,
00038 };
00039  
00040 const unsigned int REG_Addresses_1B[30] = {}; 
00041 
00042 #if HasInternalComparator == 1
00043     void configure_VR_comparator_interrupt(void);
00044   void configure_VH_comparator_interrupt(void);
00045     void Comparator_Setup(void);
00046 #else
00047     extern "C" void FLEX_INT0_IRQHandler(void);
00048     extern "C" void FLEX_INT1_IRQHandler(void);
00049   void configure_VH_gpio_interrupt(void);
00050   void configure_VR_gpio_interrupt(void);
00051 #endif
00052     
00053 void erase_flags_memory(void);
00054 void restore_flags(void);
00055 void Enter_LLS(void);
00056 void setFlag(volatile unsigned int*);
00057 bool isFlagSet(volatile unsigned int*);
00058 void copyRamToFlash(void);
00059 
00060 #endif
00061 #endif
00062