API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

int8_t TSMART_RTC_Init (void)
 Initialize RTC. More...
 
int8_t TSMART_RTC_GetTime (tsmart_rtc_time_t *TSMART_RTC_time)
 Gets date and time from the RTC. More...
 
int8_t TSMART_RTC_SetTime (tsmart_rtc_time_t *TSMART_RTC_time)
 Sets date and time on the RTC. More...
 
int8_t TSMART_RTC_SetAlarm (tsmart_rtc_time_t *TSMART_RTC_time)
 Sets a single alarm on the RTC. More...
 
int8_t TSMART_RTC_SetAlarmIn (tsmart_rtc_time_t *TSMART_RTC_time)
 Sets a single relative alarm the RTC. More...
 
int8_t TSMART_RTC_GetAlarm (tsmart_rtc_time_t *TSMART_RTC_time)
 Gets the date and time of the set alarm. More...
 
int8_t TSMART_RTC_WaitForAlarm (portTickType TSMART_RTC_xticks)
 Waits for RTC alarm. More...
 

Detailed Description

Function Documentation

int8_t TSMART_RTC_GetAlarm ( tsmart_rtc_time_t TSMART_RTC_time)

Gets the date and time of the set alarm.

Parameters
TSMART_RTC_timeTime structure
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
int8_t TSMART_RTC_GetTime ( tsmart_rtc_time_t TSMART_RTC_time)

Gets date and time from the RTC.

Parameters
TSMART_RTC_timeTime and date structure
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_RTC_Init ( void  )

Initialize RTC.

This function initializes the hardware configuration of the RTC and the associated OS mechanisms.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, cumulocity_wifi.c, pwr.c, and rtc.c.
int8_t TSMART_RTC_SetAlarm ( tsmart_rtc_time_t TSMART_RTC_time)

Sets a single alarm on the RTC.

The alarm is set using the time and date fields in the TSMART_RTC_time structure.

Note
User can set ONLY one alarm at the same time.
Parameters
TSMART_RTC_timeTime structure
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
rtc.c.
int8_t TSMART_RTC_SetAlarmIn ( tsmart_rtc_time_t TSMART_RTC_time)

Sets a single relative alarm the RTC.

Sets an alarm to be triggered in a time relative to the current RTC value. The alarm is set using the time fields in the TSMART_RTC_time structure.

Note
User can set ONLY one alarm at the same time.
Not uses the date fields.
Parameters
TSMART_RTC_timeTime structure
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
pwr.c.
int8_t TSMART_RTC_SetTime ( tsmart_rtc_time_t TSMART_RTC_time)

Sets date and time on the RTC.

Parameters
TSMART_RTC_timeTime structure
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, cumulocity_wifi.c, and rtc.c.
int8_t TSMART_RTC_WaitForAlarm ( portTickType  TSMART_RTC_xticks)

Waits for RTC alarm.

Waits for the interrupt associated to the RTC alarm. Whenever the RTC alarm matches with the current time and date, a handler will be triggered and a semaphore will be set, releasing the current function.

Parameters
TSMART_RTC_xticksMaximum waiting timeout.
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
rtc.c.