00001
00049 #ifndef RTC32_DRIVER_H
00050 #define RTC32_DRIVER_H
00051
00052
00053 #include "avr_compiler.h"
00054
00055
00056
00062 #define RTC32_SyncBusy() ( RTC32.SYNCCTRL & RTC32_SYNCBUSY_bm )
00063
00068 #define RTC32_ToscBusy() !( VBAT.STATUS & VBAT_XOSCRDY_bm )
00069
00074 #define RTC32_SyncCnt() ( RTC32.SYNCCTRL |= RTC32_SYNCCNT_bm )
00075
00081 #define RTC32_SyncCntBusy() ( RTC32.SYNCCTRL & RTC32_SYNCCNT_bm )
00082
00087 #define RTC32_GetOverflowFlag() ( RTC32.INTFLAGS & RTC32_OVFIF_bm )
00088
00093 #define RTC32_GetCompareFlag() ( RTC32.INTFLAGS & RTC32_COMPIF_bm )
00094
00101 #define RTC32_GetPeriod() ( RTC32.PER )
00102
00110 #define RTC32_SetCompareValue( _cmpVal ) ( RTC32.COMP = (_cmpVal) )
00111
00119 #define RTC32_GetCompareValue() ( RTC32.COMP )
00120
00121
00122
00123 void RTC32_ToscEnable( bool use1khz );
00124 void RTC32_Reset( void );
00125 void RTC32_Initialize( uint32_t period,
00126 uint32_t count,
00127 uint32_t compareValue );
00128 void RTC32_SetOverflowIntLevel( RTC32_OVFINTLVL_t intLevel );
00129 void RTC32_SetCompareIntLevel( RTC32_COMPINTLVL_t intLevel );
00130 void RTC32_SetIntLevels( RTC32_OVFINTLVL_t ovfIntLevel,
00131 RTC32_COMPINTLVL_t compIntLevel );
00132 void RTC32_SetAlarm( uint32_t alarmTimeout );
00133 uint32_t RTC32_GetCount( void );
00134 void RTC32_SetCount( uint32_t count );
00135 void RTC32_SetPeriod( uint32_t period );
00136
00151 #endif