fremoclock
1_3A01
FREMO Clock - Software for UTG
|
User function called by timer ISR. More...
Go to the source code of this file.
Functions | |
static void | ClockGeneratePulse (void) |
This function is called by SysHWTimer every 100ms. More... | |
void | ClockKernelInit (void) |
Initialization of the pulse generator. More... | |
void | SysTimerUserInterrupt (void) |
This function is called by SysHWTimer every 1ms. More... | |
void | SysTimerUserInterrupt10 (void) |
This function is called by SysHWTimer every 10ms. More... | |
void | SysTimerUserInterrupt100 (void) |
This function is called by SysHWTimer every 100ms. More... | |
void | ClockSetStatus (uint8_t ucStatus) |
Set status of pulse generator. More... | |
uint8_t | ClockReadStatus (void) |
Read status of pulse generator. More... | |
uint8_t | ClockIsRunning (void) |
Value used as parameter to ClockSetStatus() to start clock. More... | |
void | ClockSetPeriod (uint16_t uiPeriod) |
Set length of model minute in 100ms. More... | |
uint16_t | ClockReadPeriod (void) |
Get length of model minute in 100ms. More... | |
void | ClockSetPulse (uint16_t uiPulse) |
Set length of pulse length in 100ms. More... | |
uint16_t | ClockReadPulse (void) |
Get length of pulse length in 100ms. More... | |
void | ClockSetTime (fclock_t newValue) |
Set actual time. More... | |
fclock_t | ClockGetTime (void) |
Get actual time. More... | |
void | ClockSetTimeFactor (uint8_t ucFactor) |
Set time factor. More... | |
uint8_t | ClockReadTimeFactor (void) |
Get time factor. More... | |
void | ClockSetStartTimeMinute (uint8_t ucMinute) |
Set the minute of the start time. More... | |
uint8_t | ClockReadStartTimeMinute (void) |
Get the minute of the start time. More... | |
void | ClockSetStartTimeHour (uint8_t ucHour) |
Set the hour of the start time. More... | |
uint8_t | ClockReadStartTimeHour (void) |
Get the hour of the start time. More... | |
void | ClockSetEndTimeMinute (uint8_t ucMinute) |
Set the minute of the end time. More... | |
uint8_t | ClockReadEndTimeMinute (void) |
Get the minute of the end time. More... | |
void | ClockSetEndTimeHour (uint8_t ucHour) |
Set the hour of the end time. More... | |
uint8_t | ClockReadEndTimeHour (void) |
Get the hour of the end time. More... | |
Variables | |
static volatile uint16_t | uiClockTimer = 0 |
Gets decremented every 100 milliseconds by interrupt. More... | |
static volatile uint16_t | uiClockPeriod = 0 |
Value of minute in model time (60 in 1:1) at least 2*uiClockPulse. More... | |
static volatile uint16_t | uiClockPulse = 0 |
Length of pulse on the clock line. More... | |
static volatile uint8_t | ucClockStatus = 0 |
Clock status byte. More... | |
static volatile bool | ucClockOddPulse = 0 |
odd minute?! More... | |
static volatile fclock_t | ucClock = CLOCK_MIDNIGHT |
actual model time More... | |
static uint8_t | ucClockTimeFactor |
static uint8_t | ucStartTimeMinute |
static uint8_t | ucStartTimeHour |
static uint8_t | ucEndTimeMinute |
static uint8_t | ucEndTimeHour |
User function called by timer ISR.
Subroutines for clock kernel with:
Software:
Targets:
History:
Definition in file ClockKernel.c.
|
static |
This function is called by SysHWTimer every 100ms.
Be careful, not to overload this isr. Runs with global interrupts disabled. It generates the clock pulse on the output pin and increment actual model time as appropriate.
Definition at line 458 of file ClockKernel.c.
fclock_t ClockGetTime | ( | void | ) |
Get actual time.
Atomic access to variable clock
.
Definition at line 317 of file ClockKernel.c.
uint8_t ClockIsRunning | ( | void | ) |
Value used as parameter to ClockSetStatus() to start clock.
Definition at line 228 of file ClockKernel.c.
void ClockKernelInit | ( | void | ) |
Initialization of the pulse generator.
Definition at line 107 of file ClockKernel.c.
uint8_t ClockReadEndTimeHour | ( | void | ) |
Get the hour of the end time.
endTimeHour
Definition at line 446 of file ClockKernel.c.
uint8_t ClockReadEndTimeMinute | ( | void | ) |
Get the minute of the end time.
endTimeMinute
Definition at line 422 of file ClockKernel.c.
uint16_t ClockReadPeriod | ( | void | ) |
Get length of model minute in 100ms.
The read is done with interrupts disabled.
Definition at line 255 of file ClockKernel.c.
uint16_t ClockReadPulse | ( | void | ) |
Get length of pulse length in 100ms.
The read is done with interrupts disabled.
clockPulse
Definition at line 286 of file ClockKernel.c.
uint8_t ClockReadStartTimeHour | ( | void | ) |
Get the hour of the start time.
startTimeHour
Definition at line 398 of file ClockKernel.c.
uint8_t ClockReadStartTimeMinute | ( | void | ) |
Get the minute of the start time.
startTimeMinute
Definition at line 374 of file ClockKernel.c.
uint8_t ClockReadStatus | ( | void | ) |
Read status of pulse generator.
The read is done with interrupts disabled.
Definition at line 214 of file ClockKernel.c.
uint8_t ClockReadTimeFactor | ( | void | ) |
Get time factor.
Definition at line 350 of file ClockKernel.c.
void ClockSetEndTimeHour | ( | uint8_t | ucHour | ) |
Set the hour of the end time.
ucHour | new value of variable endTimeMinute |
Definition at line 434 of file ClockKernel.c.
void ClockSetEndTimeMinute | ( | uint8_t | ucMinute | ) |
Set the minute of the end time.
ucMinute | new value of variable endTimeMinute |
Definition at line 410 of file ClockKernel.c.
void ClockSetPeriod | ( | uint16_t | uiPeriod | ) |
Set length of model minute in 100ms.
The write is done with interrupts disabled.
uiPeriod | the new value of clockPeriod |
Definition at line 239 of file ClockKernel.c.
void ClockSetPulse | ( | uint16_t | uiPulse | ) |
Set length of pulse length in 100ms.
The write is done with interrupts disabled.
uiPulse | the new value for clockPulse |
Definition at line 270 of file ClockKernel.c.
void ClockSetStartTimeHour | ( | uint8_t | ucHour | ) |
Set the hour of the start time.
ucHour | new value of variable startTimeHour |
Definition at line 386 of file ClockKernel.c.
void ClockSetStartTimeMinute | ( | uint8_t | ucMinute | ) |
Set the minute of the start time.
ucMinute | new value of variable startTimeMinute |
Definition at line 362 of file ClockKernel.c.
void ClockSetStatus | ( | uint8_t | ucStatus | ) |
Set status of pulse generator.
Bits used are:
The write is done with interrupts disabled.
ucStatus | the new status |
Definition at line 187 of file ClockKernel.c.
void ClockSetTime | ( | fclock_t | newValue | ) |
Set actual time.
Atomic access to variable clock.
newValue | the new value for clock . |
Definition at line 301 of file ClockKernel.c.
void ClockSetTimeFactor | ( | uint8_t | ucFactor | ) |
Set time factor.
ucFactor | the new time factor. |
Definition at line 331 of file ClockKernel.c.
void SysTimerUserInterrupt | ( | void | ) |
This function is called by SysHWTimer every 1ms.
Be careful, not to overload this isr. Runs with global interrupts disabled.
Definition at line 135 of file ClockKernel.c.
void SysTimerUserInterrupt10 | ( | void | ) |
This function is called by SysHWTimer every 10ms.
Be careful, not to overload this isr. Runs with global interrupts disabled.
Definition at line 145 of file ClockKernel.c.
void SysTimerUserInterrupt100 | ( | void | ) |
This function is called by SysHWTimer every 100ms.
Be careful, not to overload this isr. Runs with global interrupts disabled.
Definition at line 155 of file ClockKernel.c.
|
static |
actual model time
Definition at line 88 of file ClockKernel.c.
|
static |
odd minute?!
Definition at line 85 of file ClockKernel.c.
|
static |
Clock status byte.
Definition at line 82 of file ClockKernel.c.
|
static |
Definition at line 91 of file ClockKernel.c.
|
static |
Definition at line 95 of file ClockKernel.c.
|
static |
Definition at line 94 of file ClockKernel.c.
|
static |
Definition at line 93 of file ClockKernel.c.
|
static |
Definition at line 92 of file ClockKernel.c.
|
static |
Value of minute in model time (60 in 1:1) at least 2*uiClockPulse.
Definition at line 76 of file ClockKernel.c.
|
static |
Length of pulse on the clock line.
Definition at line 79 of file ClockKernel.c.
|
static |
Gets decremented every 100 milliseconds by interrupt.
Definition at line 73 of file ClockKernel.c.