Clock Class

class ClockClass : public Acroname::BrainStem::EntityClass

ClockClass: Provides an interface to a real-time clock entity on a BrainStem module. The clock entity may be used to get and set the real time of the system. The clock entity has a one second resolution.

Note

Clock time must be reset if power to the BrainStem module is lost.

Public Functions

ClockClass(void)

Constructor.

virtual ~ClockClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters:
  • pModule – The module to which this entity belongs.

  • index – The index of the clock entity being initialized.

aErr getYear(uint16_t *year)

Get the four digit year value (0-4095).

Parameters:

year – Get the year portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setYear(const uint16_t year)

Set the four digit year value (0-4095).

Parameters:

year – Set the year portion of the real-time clock value.

Returns:

Returns common entity return values

aErr getMonth(uint8_t *month)

Get the two digit month value (1-12).

Parameters:

month – The two digit month portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setMonth(const uint8_t month)

Set the two digit month value (1-12).

Parameters:

month – The two digit month portion of the real-time clock value.

Returns:

Returns common entity return values

aErr getDay(uint8_t *day)

Get the two digit day of month value (1-28, 29, 30 or 31 depending on the month).

Parameters:

day – The two digit day portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setDay(const uint8_t day)

Set the two digit day of month value (1-28, 29, 30 or 31 depending on the month).

Parameters:

day – The two digit day portion of the real-time clock value.

Returns:

Returns common entity return values

aErr getHour(uint8_t *hour)

Get the two digit hour value (0-23).

Parameters:

hour – The two digit hour portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setHour(const uint8_t hour)

Set the two digit hour value (0-23).

Parameters:

hour – The two digit hour portion of the real-time clock value.

Returns:

Returns common entity return values

aErr getMinute(uint8_t *min)

Get the two digit minute value (0-59).

Parameters:

min – The two digit minute portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setMinute(const uint8_t min)

Set the two digit minute value (0-59).

Parameters:

min – The two digit minute portion of the real-time clock value.

Returns:

Returns common entity return values

aErr getSecond(uint8_t *sec)

Get the two digit second value (0-59).

Parameters:

sec – The two digit second portion of the real-time clock value.

Returns:

Returns common entity return values

aErr setSecond(const uint8_t sec)

Set the two digit second value (0-59).

Parameters:

sec – The two digit second portion of the real-time clock value.

Returns:

Returns common entity return values