123

Dependencies:   mbed

Fork of LG by igor Apu

DeviceTimers.h

Committer:
Diletant
Date:
2016-05-09
Revision:
156:e68ee0bcdcda
Parent:
137:14a0c452cf32
Child:
167:bedc0a9d559a

File content as of revision 156:e68ee0bcdcda:

#ifndef __DEVICE_TIMERS_H__
#define __DEVICE_TIMERS_H__

typedef struct _DeviceTimerSettings {
  uint32_t match;
} DeviceTimerSettings;

typedef struct _DeviceTimerState {
  //Match Register 0. MR0 can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR0 matches the TC.
  uint32_t MR0;
  //Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs.
  uint32_t MCR;
  //Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR.
  uint32_t TCR;
} DeviceTimerState;

typedef struct _DeviceTimer {
  DeviceTimerSettings settings;
  DeviceTimerState state;
} DeviceTimer;

void InitMeasurementTimerWithDefaults(void);
//void DeviceInitMeasurementTimer(unsigned int TimerInterval);
void InitMeasurementTimer(void);
void DeviceEnableMeasurementTimer(void);

void InitRegularTimerWithDefaults(void);
void InitRegularTimer(void);
void DeviceEnableRegularTimer(void);

#endif  /* __DEVICE_TIMERS_H__ */