Subversion Repositories HomeAutomation

Rev

Rev 73 | Blame | Last modification | View Log | SVN | RSS feed

  1. #ifndef timebase_h_
  2. #define timebase_h_
  3.  
  4.  
  5. /*-----------------------------------------------------------------------------
  6.  * Includes
  7.  *---------------------------------------------------------------------------*/
  8. #include <inttypes.h>
  9.  
  10.  
  11. /*-----------------------------------------------------------------------------
  12.  * Defines
  13.  *---------------------------------------------------------------------------*/
  14. #define TIMEBASE_PRESCALE (64)
  15. #define TIMEBASE_HITS_PER_1MS (F_OSC/TIMEBASE_PRESCALE/1000)
  16. #define TIMEBASE_RELOAD ((uint8_t)(0xff-TIMEBASE_HITS_PER_1MS+1))
  17.  
  18.  
  19. /*-----------------------------------------------------------------------------
  20.  * Public Function Prototypes
  21.  *---------------------------------------------------------------------------*/
  22. void Timebase_Init(void);
  23. uint32_t Timebase_CurrentTime(void);
  24. uint32_t Timebase_PassedTimeMillis(uint32_t t0);
  25.  
  26.  
  27. #endif
  28.