fremoclock  1_3A01
FREMO Clock - Software for UTG
UserSettings.c File Reference

Contains all functions to access the common data. More...

Go to the source code of this file.

Functions

uint8_t UserSettingsGetEepromStatus (void)
 Read eeprom status from EEPROM. More...
 
uint8_t UserSettingsGetSystemStatus (void)
 Read system status from EEPROM. More...
 
void UserSettingsSetSystemStatus (uint8_t status)
 Write system status to EEPROM. More...
 
void UserSettingsSetEepromStatus (uint8_t status)
 Write eeprom status to EEPROM. More...
 
void UserSettingsSaveClockValues (uint8_t factor, uint16_t pulse, uint8_t startMinute, uint8_t startHour, uint8_t endMinute, uint8_t endHour, uint8_t minute, uint8_t hour)
 Write factor, pulse width, startTime, endTime and current clock to EEPROM. More...
 
uint8_t UserSettingsGetStartMinute (void)
 Read minute of startTime from EEPROM. More...
 
uint8_t UserSettingsGetStartHour (void)
 Read hour of startTime from EEPROM. More...
 
uint8_t UserSettingsGetEndMinute (void)
 Read minute of endTime from EEPROM. More...
 
uint8_t UserSettingsGetEndHour (void)
 Read hour of endTime from EEPROM. More...
 
uint8_t UserSettingsGetCurrentMinute (void)
 Read minute of current clock time from EEPROM. More...
 
uint8_t UserSettingsGetCurrentHour (void)
 Read hour of current clock time from EEPROM. More...
 
uint8_t UserSettingsGetFactor (void)
 Read factor from EEPROM. More...
 
uint16_t UserSettingsGetPulse (void)
 Read pulse width from EEPROM. More...
 

Variables

uint8_t EEMEM eucEepromSize
 SV1: SV_ADDR_EEPROM_SIZE (not used for now) More...
 
uint8_t EEMEM eucSwVersion
 SV2: SV_ADDR_SW_VERSION (not used for now) More...
 
uint16_t EEMEM euiSerialNumber
 SV3,4: SV_ADDR_SERIAL_NUMBER (not used for now) More...
 
uint8_t EEMEM eucSystemStatus
 SV5: system status. More...
 
uint8_t EEMEM eucClockTimeFactor
 SV6: factor for time shortening. More...
 
uint8_t EEMEM eucClockPulse
 SV7: length o clock pulse in 10mS. More...
 
uint8_t EEMEM eucClockMinute
 SV8: actual model time. More...
 
uint8_t EEMEM eucClockHour
 SV9: actual model time. More...
 
uint8_t EEMEM eucStartTimeMinute
 SV10: More...
 
uint8_t EEMEM eucStartTimeHour
 SV11: More...
 
uint8_t EEMEM eucEndTimeMinute
 SV12: More...
 
uint8_t EEMEM eucEndTimeHour
 SV13: More...
 
uint8_t EEMEM eucEepromStatus = 255
 SVxx: if 255 eeprom is erased. More...
 

Detailed Description

Contains all functions to access the common data.

With:

  • EEPROM
  • Basic parameter
  • etc

Target:

  • AtMega128 on PROTO_128 and AtMega48/88/168

Software

  • AVR-GCC

History:

  • 150424 First implementation (R 0)
Version
$Id: UserSettings.c 159 2016-09-03 06:51:47Z pischky $
Author
Stefan Seibt [StS] stumm.nosp@m.l@us.nosp@m.ers.s.nosp@m.ourc.nosp@m.eforg.nosp@m.e.ne.nosp@m.t
Date
24-Apr-2015

Definition in file UserSettings.c.

Function Documentation

uint8_t UserSettingsGetCurrentHour ( void  )

Read hour of current clock time from EEPROM.

Returns
the hour of current clock time

Definition at line 157 of file UserSettings.c.

uint8_t UserSettingsGetCurrentMinute ( void  )

Read minute of current clock time from EEPROM.

Returns
the minute of current clock time

Definition at line 151 of file UserSettings.c.

uint8_t UserSettingsGetEepromStatus ( void  )

Read eeprom status from EEPROM.

Returns
the status

Definition at line 86 of file UserSettings.c.

uint8_t UserSettingsGetEndHour ( void  )

Read hour of endTime from EEPROM.

Returns
the hour of endTime

Definition at line 145 of file UserSettings.c.

uint8_t UserSettingsGetEndMinute ( void  )

Read minute of endTime from EEPROM.

Returns
the minute of endTime

Definition at line 139 of file UserSettings.c.

uint8_t UserSettingsGetFactor ( void  )

Read factor from EEPROM.

Returns
the factor

Definition at line 163 of file UserSettings.c.

uint16_t UserSettingsGetPulse ( void  )

Read pulse width from EEPROM.

Returns
the pulse width

Definition at line 170 of file UserSettings.c.

uint8_t UserSettingsGetStartHour ( void  )

Read hour of startTime from EEPROM.

Returns

Definition at line 133 of file UserSettings.c.

uint8_t UserSettingsGetStartMinute ( void  )

Read minute of startTime from EEPROM.

Returns
the minute of startTime

Definition at line 127 of file UserSettings.c.

uint8_t UserSettingsGetSystemStatus ( void  )

Read system status from EEPROM.

Returns
the status

Definition at line 92 of file UserSettings.c.

void UserSettingsSaveClockValues ( uint8_t  factor,
uint16_t  pulse,
uint8_t  startMinute,
uint8_t  startHour,
uint8_t  endMinute,
uint8_t  endHour,
uint8_t  minute,
uint8_t  hour 
)

Write factor, pulse width, startTime, endTime and current clock to EEPROM.

Parameters
factorthe factor to write
pulsethe pulse width to write
startMinuteminute of startTime
startHourhour of startTime
endMinuteminute of endTime
endHourhour of endTime
minuteminute of current clock time
hourhour of current clock time

Definition at line 111 of file UserSettings.c.

void UserSettingsSetEepromStatus ( uint8_t  status)

Write eeprom status to EEPROM.

Parameters
statusnew value for the status

Definition at line 104 of file UserSettings.c.

void UserSettingsSetSystemStatus ( uint8_t  status)

Write system status to EEPROM.

Parameters
statusnew value for the status

Definition at line 98 of file UserSettings.c.

Variable Documentation

uint8_t EEMEM eucClockHour

SV9: actual model time.

Definition at line 71 of file UserSettings.c.

uint8_t EEMEM eucClockMinute

SV8: actual model time.

Definition at line 70 of file UserSettings.c.

uint8_t EEMEM eucClockPulse

SV7: length o clock pulse in 10mS.

Definition at line 69 of file UserSettings.c.

uint8_t EEMEM eucClockTimeFactor

SV6: factor for time shortening.

Definition at line 68 of file UserSettings.c.

uint8_t EEMEM eucEepromSize

SV1: SV_ADDR_EEPROM_SIZE (not used for now)

Definition at line 60 of file UserSettings.c.

uint8_t EEMEM eucEepromStatus = 255

SVxx: if 255 eeprom is erased.

Definition at line 76 of file UserSettings.c.

uint8_t EEMEM eucEndTimeHour

SV13:

Definition at line 75 of file UserSettings.c.

uint8_t EEMEM eucEndTimeMinute

SV12:

Definition at line 74 of file UserSettings.c.

uint8_t EEMEM eucStartTimeHour

SV11:

Definition at line 73 of file UserSettings.c.

uint8_t EEMEM eucStartTimeMinute

SV10:

Definition at line 72 of file UserSettings.c.

uint8_t EEMEM eucSwVersion

SV2: SV_ADDR_SW_VERSION (not used for now)

Definition at line 61 of file UserSettings.c.

uint8_t EEMEM eucSystemStatus

SV5: system status.

Definition at line 67 of file UserSettings.c.

uint16_t EEMEM euiSerialNumber

SV3,4: SV_ADDR_SERIAL_NUMBER (not used for now)

Definition at line 62 of file UserSettings.c.