Clock

See the Clock Entity for generic information.

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

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.

getDay()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

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

Return type:

brainstem.result.Result

getHour()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

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

Return type:

brainstem.result.Result

getMinute()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

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

Return type:

brainstem.result.Result

getMonth()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

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

Return type:

brainstem.result.Result

getSecond()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

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

Return type:

brainstem.result.Result

getYear()[source]

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

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned short

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

Return type:

brainstem.result.Result

setDay(day)[source]

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

Parameters:

day (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.Result

Return type:

unsigned byte

setHour(hour)[source]

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

Parameters:

hour (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.Result

Return type:

unsigned byte

setMinute(minute)[source]

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

Parameters:

minute (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.Result

Return type:

unsigned byte

setMonth(month)[source]

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

Parameters:

month (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.Result

Return type:

unsigned byte

setSecond(second)[source]

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

Parameters:

second (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.Result

Return type:

unsigned byte

setYear(year)[source]

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

Parameters:

year (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.Result

Return type:

unsigned byte