123

Dependencies:   mbed

Fork of LG by igor Apu

DeviceTimers.h

Committer:
Kovalev_D
Date:
2016-10-19
Revision:
197:7a05523bf588
Parent:
173:7f938afb0447

File content as of revision 197:7a05523bf588:

#ifndef __DEVICE_TIMERS_H__
#define __DEVICE_TIMERS_H__

typedef struct _DeviceTimerSettings {
} 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 InitMeasurementTimerDefaultSettings(void);
void InitMeasurementTimerState(void);
void DeviceStartMeasurementTimer(void);

void timersSetMeasurementPeriod(uint32_t period);

void InitRegularTimerDefaultSettings(void);
void InitRegularTimerState(void);
void DeviceStartRegularTimer(void);

void timersSetRegularPeriod(uint32_t period);

#endif  /* __DEVICE_TIMERS_H__ */