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@167:bedc0a9d559a, 2016-06-05 (annotated)
- Committer:
- Diletant
- Date:
- Sun Jun 05 11:03:33 2016 +0000
- Revision:
- 167:bedc0a9d559a
- Parent:
- 156:e68ee0bcdcda
- Child:
- 173:7f938afb0447
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 | 167:bedc0a9d559a | 22 | void InitMeasurementTimerDefaultSettings(void); |
| Diletant | 156:e68ee0bcdcda | 23 | //void DeviceInitMeasurementTimer(unsigned int TimerInterval); |
| Diletant | 167:bedc0a9d559a | 24 | void InitMeasurementTimerState(void); |
| Diletant | 167:bedc0a9d559a | 25 | void DeviceStartMeasurementTimer(void); |
| Diletant | 156:e68ee0bcdcda | 26 | |
| Diletant | 167:bedc0a9d559a | 27 | void InitRegularTimerDefaultSettings(void); |
| Diletant | 167:bedc0a9d559a | 28 | void InitRegularTimerState(void); |
| Diletant | 167:bedc0a9d559a | 29 | void DeviceStartRegularTimer(void); |
| Diletant | 156:e68ee0bcdcda | 30 | |
| Diletant | 138:14a0c452cf32 | 31 | #endif /* __DEVICE_TIMERS_H__ */ |
