initial commit of kl25z rtc code. local changes for debug
Fork of KL25Z_RTC by
KL25Z_RTC.h@1:2e81444e49a9, 2013-06-18 (annotated)
- Committer:
- clemente
- Date:
- Tue Jun 18 08:46:50 2013 +0000
- Revision:
- 1:2e81444e49a9
- Parent:
- 0:12422f7c30d3
- Child:
- 2:56a50064749e
added callback function.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
clemente | 0:12422f7c30d3 | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
clemente | 0:12422f7c30d3 | 2 | * |
clemente | 0:12422f7c30d3 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
clemente | 0:12422f7c30d3 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
clemente | 0:12422f7c30d3 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
clemente | 0:12422f7c30d3 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
clemente | 0:12422f7c30d3 | 7 | * Software is furnished to do so, subject to the following conditions: |
clemente | 0:12422f7c30d3 | 8 | * |
clemente | 0:12422f7c30d3 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
clemente | 0:12422f7c30d3 | 10 | * substantial portions of the Software. |
clemente | 0:12422f7c30d3 | 11 | * |
clemente | 0:12422f7c30d3 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
clemente | 0:12422f7c30d3 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
clemente | 0:12422f7c30d3 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
clemente | 0:12422f7c30d3 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
clemente | 0:12422f7c30d3 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
clemente | 0:12422f7c30d3 | 17 | */ |
clemente | 0:12422f7c30d3 | 18 | |
clemente | 0:12422f7c30d3 | 19 | #ifndef __KL25Z_RTC_H |
clemente | 0:12422f7c30d3 | 20 | #define __KL25Z_RTC_H |
clemente | 0:12422f7c30d3 | 21 | |
clemente | 0:12422f7c30d3 | 22 | #include "mbed.h" |
clemente | 0:12422f7c30d3 | 23 | |
clemente | 0:12422f7c30d3 | 24 | class KL25Z_RTC |
clemente | 0:12422f7c30d3 | 25 | { |
clemente | 0:12422f7c30d3 | 26 | public: |
clemente | 0:12422f7c30d3 | 27 | KL25Z_RTC( unsigned int alarm); |
clemente | 0:12422f7c30d3 | 28 | void RTC_Start( void); |
clemente | 1:2e81444e49a9 | 29 | void RTC_Start( void(*sec_ptr)(void), void(*alrm_ptr)(void)); |
clemente | 0:12422f7c30d3 | 30 | unsigned int RTC_GetAlarm( void); |
clemente | 0:12422f7c30d3 | 31 | unsigned int RTC_Read( void); |
clemente | 1:2e81444e49a9 | 32 | void RTC_Seconds_CallBack( void(*fptr)(void)); |
clemente | 0:12422f7c30d3 | 33 | |
clemente | 0:12422f7c30d3 | 34 | private: |
clemente | 0:12422f7c30d3 | 35 | |
clemente | 0:12422f7c30d3 | 36 | static void _RTC_IRQHandler(void); |
clemente | 0:12422f7c30d3 | 37 | static void _RTC_Seconds_IRQHandler(void); |
clemente | 0:12422f7c30d3 | 38 | |
clemente | 0:12422f7c30d3 | 39 | }; |
clemente | 0:12422f7c30d3 | 40 | |
clemente | 0:12422f7c30d3 | 41 | #endif |