Clock

class brainstem.entity.Clock(module, index)[source]

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.

getDay()[source]

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

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getHour()[source]

Get the two digit hour value (0-23). The two digit hour portion of the real-time clock value.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getMinute()[source]

Get the two digit minute value (0-59). The two digit minute portion of the real-time clock value.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getMonth()[source]

Get the two digit month value (1-12). The two digit month portion of the real-time clock value.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getSecond()[source]

Get the two digit second value (0-59). The two digit second portion of the real-time clock value.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getYear()[source]

Get the four digit year value (0-4095). Get the year portion of the real-time clock value.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

setDay(day)[source]

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

Parameters:

day (const unsigned char) – The two digit day portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setHour(hour)[source]

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

Parameters:

hour (const unsigned char) – The two digit hour portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setMinute(min)[source]

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

Parameters:

min (const unsigned char) – The two digit minute portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setMonth(month)[source]

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

Parameters:

month (const unsigned char) – The two digit month portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setSecond(sec)[source]

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

Parameters:

sec (const unsigned char) – The two digit second portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setYear(year)[source]

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

Parameters:

year (const unsigned short) – Set the year portion of the real-time clock value.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte