A set of classes that mimic the behaviour of Mbed Ticker class but using TIMER0, TIMER1, TIMER2 and the RIT.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TickersSys.h Source File

TickersSys.h

00001 /*
00002     Copyright (c) 2011 Andy Kirkham
00003  
00004     Permission is hereby granted, free of charge, to any person obtaining a copy
00005     of this software and associated documentation files (the "Software"), to deal
00006     in the Software without restriction, including without limitation the rights
00007     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008     copies of the Software, and to permit persons to whom the Software is
00009     furnished to do so, subject to the following conditions:
00010  
00011     The above copyright notice and this permission notice shall be included in
00012     all copies or substantial portions of the Software.
00013  
00014     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00017     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00019     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00020     THE SOFTWARE.
00021 */
00022 
00023 #ifndef AJK_TICKERSSYS_H
00024 #define AJK_TICKERSSYS_H
00025 
00026 #include "mbed.h"
00027 #include "Tickers.h"
00028 #include <list>
00029 
00030 namespace AjK {
00031 
00032 class Ticker0;
00033 
00034 // Ticker0 controller.
00035 class Ticker0Sys {
00036 protected:
00037     list<Ticker0 *> tickers;
00038     
00039 public:
00040     void init(void);
00041     Ticker0Sys();
00042     void isr(void);    
00043     void addTicker(Ticker0 *t);
00044     void delTicker(Ticker0 *t);        
00045 };
00046 
00047 class Ticker1;
00048 
00049 // Ticker1 controller.
00050 class Ticker1Sys {
00051 protected:
00052     list<Ticker1 *> tickers;
00053     
00054 public:
00055     void init(void);
00056     Ticker1Sys();
00057     void isr(void);    
00058     void addTicker(Ticker1 *t);
00059     void delTicker(Ticker1 *t);        
00060 };
00061 
00062 class Ticker2;
00063 
00064 // Ticker2 controller.
00065 class Ticker2Sys {
00066 protected:
00067     list<Ticker2 *> tickers;
00068     
00069 public:
00070     void init(void);
00071     Ticker2Sys();
00072     void isr(void);    
00073     void addTicker(Ticker2 *t);    
00074     void delTicker(Ticker2 *t);    
00075 };
00076 
00077 class Ticker4;
00078 
00079 // TickerR controller.
00080 class TickerRSys {
00081 protected:
00082     list<Ticker4 *> tickers;
00083     
00084 public:
00085     void init(void);
00086     TickerRSys();
00087     void isr(void);    
00088     void addTicker(Ticker4 *t);    
00089     void delTicker(Ticker4 *t);    
00090 };
00091 
00092 }; // namespace AjK ends.
00093 
00094 using namespace AjK;
00095 
00096 #endif