Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LG by
DeviceTimers.h@156:e68ee0bcdcda, 2016-05-09 (annotated)
- Committer:
- Diletant
- Date:
- Mon May 09 20:03:26 2016 +0000
- Revision:
- 156:e68ee0bcdcda
- Parent:
- 138:14a0c452cf32
- Child:
- 167:bedc0a9d559a
Device & ... update. Not final!!!
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Diletant | 138:14a0c452cf32 | 1 | #ifndef __DEVICE_TIMERS_H__ |
| Diletant | 138:14a0c452cf32 | 2 | #define __DEVICE_TIMERS_H__ |
| Diletant | 138:14a0c452cf32 | 3 | |
| Diletant | 156:e68ee0bcdcda | 4 | typedef struct _DeviceTimerSettings { |
| Diletant | 156:e68ee0bcdcda | 5 | uint32_t match; |
| Diletant | 156:e68ee0bcdcda | 6 | } DeviceTimerSettings; |
| Diletant | 156:e68ee0bcdcda | 7 | |
| Diletant | 156:e68ee0bcdcda | 8 | typedef struct _DeviceTimerState { |
| Diletant | 156:e68ee0bcdcda | 9 | //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. |
| Diletant | 156:e68ee0bcdcda | 10 | uint32_t MR0; |
| Diletant | 156:e68ee0bcdcda | 11 | //Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. |
| Diletant | 156:e68ee0bcdcda | 12 | uint32_t MCR; |
| Diletant | 156:e68ee0bcdcda | 13 | //Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. |
| Diletant | 156:e68ee0bcdcda | 14 | uint32_t TCR; |
| Diletant | 156:e68ee0bcdcda | 15 | } DeviceTimerState; |
| Diletant | 156:e68ee0bcdcda | 16 | |
| Diletant | 156:e68ee0bcdcda | 17 | typedef struct _DeviceTimer { |
| Diletant | 156:e68ee0bcdcda | 18 | DeviceTimerSettings settings; |
| Diletant | 156:e68ee0bcdcda | 19 | DeviceTimerState state; |
| Diletant | 156:e68ee0bcdcda | 20 | } DeviceTimer; |
| Diletant | 156:e68ee0bcdcda | 21 | |
| Diletant | 156:e68ee0bcdcda | 22 | void InitMeasurementTimerWithDefaults(void); |
| Diletant | 156:e68ee0bcdcda | 23 | //void DeviceInitMeasurementTimer(unsigned int TimerInterval); |
| Diletant | 156:e68ee0bcdcda | 24 | void InitMeasurementTimer(void); |
| Diletant | 156:e68ee0bcdcda | 25 | void DeviceEnableMeasurementTimer(void); |
| Diletant | 156:e68ee0bcdcda | 26 | |
| Diletant | 156:e68ee0bcdcda | 27 | void InitRegularTimerWithDefaults(void); |
| Diletant | 156:e68ee0bcdcda | 28 | void InitRegularTimer(void); |
| Diletant | 156:e68ee0bcdcda | 29 | void DeviceEnableRegularTimer(void); |
| Diletant | 156:e68ee0bcdcda | 30 | |
| Diletant | 138:14a0c452cf32 | 31 | #endif /* __DEVICE_TIMERS_H__ */ |
