* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
- *
- * IN NO EVENT SHALL CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS BE LIABLE TO
- * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ *
+ * IN NO EVENT SHALL CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS BE LIABLE TO
+ * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
* DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF CROSSBOW OR ITS LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
+ * IF CROSSBOW OR ITS LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*
* CROSSBOW TECHNOLOGY AND ITS LICENSORS SPECIFICALLY DISCLAIM ALL WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY
- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS.
*/
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
- *
+ *
* IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
#include <Atm128Timer.h>
-module HplAtm1281Timer1P
+module HplAtm1281Timer1P @safe()
{
provides {
// 16-bit Timers
async command void Timer.off() { call Timer.setScale(AVR_CLOCK_OFF); }
//=== Write a new timer scale. ========================================
- async command void Timer.setScale(uint8_t s) {
+ async command void Timer.setScale(uint8_t s) {
Atm128_TCCRB_t x = (Atm128_TCCRB_t) call TimerCtrl.getControlB();
x.bits.cs = s;
- call TimerCtrl.setControlB(x.flat);
+ call TimerCtrl.setControlB(x.flat);
}
//=== Read the control registers. =====================================
- async command uint8_t TimerCtrl.getControlA() {
- return TCCR1A;
+ async command uint8_t TimerCtrl.getControlA() {
+ return TCCR1A;
}
- async command uint8_t TimerCtrl.getControlB() {
- return TCCR1B;
+ async command uint8_t TimerCtrl.getControlB() {
+ return TCCR1B;
}
- async command uint8_t TimerCtrl.getControlC() {
- return TCCR1C;
+ async command uint8_t TimerCtrl.getControlC() {
+ return TCCR1C;
}
//=== Write the control registers. ====================================
- async command void TimerCtrl.setControlA( uint8_t x ) {
- TCCR1A = x;
+ async command void TimerCtrl.setControlA( uint8_t x ) {
+ TCCR1A = x;
}
- async command void TimerCtrl.setControlB( uint8_t x ) {
- TCCR1B = x;
+ async command void TimerCtrl.setControlB( uint8_t x ) {
+ TCCR1B = x;
}
- async command void TimerCtrl.setControlC( uint8_t x ) {
- TCCR1C = x;
+ async command void TimerCtrl.setControlC( uint8_t x ) {
+ TCCR1C = x;
}
//=== Read the interrupt mask. =====================================
- async command uint8_t TimerCtrl.getInterruptMask() {
- return TIMSK1;
+ async command uint8_t TimerCtrl.getInterruptMask() {
+ return TIMSK1;
}
//=== Write the interrupt mask. ====================================
- async command void TimerCtrl.setInterruptMask( uint8_t x ) {
- TIMSK1 = x;
+ async command void TimerCtrl.setInterruptMask( uint8_t x ) {
+ TIMSK1 = x;
}
//=== Read the interrupt flags. =====================================
- async command uint8_t TimerCtrl.getInterruptFlag() {
- return TIFR1;
+ async command uint8_t TimerCtrl.getInterruptFlag() {
+ return TIFR1;
}
//=== Write the interrupt flags. ====================================
- async command void TimerCtrl.setInterruptFlag( uint8_t x ) {
- TIFR1 = x;
+ async command void TimerCtrl.setInterruptFlag( uint8_t x ) {
+ TIFR1 = x;
}
//=== Capture 16-bit implementation. ===================================
async command void CompareB.stop() { CLR_BIT(TIMSK1,OCIE1B); }
async command void CompareC.stop() { CLR_BIT(TIMSK1,OCIE1C); }
- async command bool Timer.test() {
- return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.tov;
+ async command bool Timer.test() {
+ return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.tov;
}
- async command bool Capture.test() {
- return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.icf;
+ async command bool Capture.test() {
+ return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.icf;
}
- async command bool CompareA.test() {
- return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfa;
+ async command bool CompareA.test() {
+ return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfa;
}
- async command bool CompareB.test() {
- return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfb;
+ async command bool CompareB.test() {
+ return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfb;
}
- async command bool CompareC.test() {
- return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfc;
+ async command bool CompareC.test() {
+ return ((Atm128_TIFR_t)call TimerCtrl.getInterruptFlag()).bits.ocfc;
}
async command bool Timer.isOn() {