Calendar#

Modules#

clock_calibration_config_t

sl_calendar_version_t

Typedefs#

typedef AON_CLK_T

Renaming clock type enum.

typedef RTC_TIME_CONFIG_T

Renaming datetime structure.

typedef RTC_MONTH_T

Renaming month structure.

typedef RTC_DAY_OF_WEEK_T

Renaming days of week structure.

typedef void(*

Typedef for the function pointer of the callback function.

Functions#

TIME_CONVERSION_ENUM(time_conversion_enum)

Enumeration to represent time conversion format.

RC_CLOCK_CALIBRATION_ENUM(rc_clock_calibration_enum)

Enumeration to represent different rc clock calibration configurations.

RO_CLOCK_CALIBRATION_ENUM(ro_clock_calibration_enum)

Enumeration to represent different ro clock calibration configurations.

sl_status_t
sl_si91x_calendar_set_configuration(sl_calendar_clock_t clock_type)

Configuration and initialization of Calendar i.e., RTC clock.

sl_status_t
sl_si91x_calendar_set_date_time(sl_calendar_datetime_config_t *config)

Set the date and time of the Calendar RTC.

sl_status_t
sl_si91x_calendar_get_date_time(sl_calendar_datetime_config_t *config)

Get the date and time of an existing Calendar RTC.

sl_status_t
sl_si91x_calendar_rcclk_calibration(clock_calibration_config_t *clock_calibration_config)

Calibrate the RC Clock.

sl_status_t
sl_si91x_calendar_roclk_calibration(clock_calibration_config_t *clock_calibration_config)

Calibrate the RO Clock.

sl_status_t

Register the callback of the msec trigger and enable it.

sl_status_t

Register the callback of the sec trigger and enable it.

sl_status_t

Register the callback of the alarm trigger and enable it.

sl_status_t

Unregister the callback of the msec trigger and disable it.

sl_status_t

Unregister the callback of the sec trigger and disable it.

sl_status_t

Unregister the callback of the alarm trigger and disable it.

sl_status_t
sl_si91x_calendar_set_alarm(sl_calendar_datetime_config_t *alarm)

Set the date and time of new alarm in RTC.

sl_status_t
sl_si91x_calendar_get_alarm(sl_calendar_datetime_config_t *alarm)

Get the date and time of an existing alarm in RTC.

sl_status_t
sl_si91x_calendar_build_datetime_struct(sl_calendar_datetime_config_t *date, uint8_t Century, uint8_t Year, sl_calendar_month_t Month, sl_calendar_days_of_week_t DayOfWeek, uint8_t Day, uint8_t Hour, uint8_t Minute, uint8_t Second, uint16_t Milliseconds)

Build the structure for date-time configuration.

sl_status_t
sl_si91x_calendar_convert_unix_time_to_ntp_time(uint32_t time, uint32_t *ntp_time)

Convert Unix timestamp to NTP timestamp.

sl_status_t
sl_si91x_calendar_convert_ntp_time_to_unix_time(uint32_t ntp_time, uint32_t *time)

Convert NTP timestamp to Unix timestamp.

boolean_t

Return the state of msec trigger of RTC (enabled or disabled).

boolean_t

Return the state of sec trigger of RTC (enabled or disabled).

boolean_t

Return the state of alarm trigger of RTC (enabled or disabled).

__STATIC_INLINE void

Start the Calendar RTC.

__STATIC_INLINE void

Stop the Calendar RTC.

__STATIC_INLINE void

Initialize the calibration for Calendar clocks.

__STATIC_INLINE void

Clear the msec trigger.

__STATIC_INLINE void

Clear the sec trigger.

__STATIC_INLINE void

Clear the alarm trigger.

__STATIC_INLINE void

De-initialize calendar operation.

__STATIC_INLINE void

De-initialize calendar operation.

Macros#

#define
SLI_ALARM_IRQHandler IRQ028_Handler

Alarm IRQ Handler.

#define

RTC IRQ Handler.

#define
SLI_NVIC_ALARM MCU_CAL_ALARM_IRQn

Alarm NVIQ enable.

#define
SLI_NVIC_MSEC_SEC MCU_CAL_RTC_IRQn

RTC NVIQ enable.

#define

Time Conversion format enum declaration.

#define

Time Conversion format enum declaration.

#define

Time Conversion format enum declaration.

Typedef Documentation#

sl_calendar_clock_t#

typedef AON_CLK_T sl_calendar_clock_t

Renaming clock type enum.


Definition at line 71 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_calendar_datetime_config_t#

typedef RTC_TIME_CONFIG_T sl_calendar_datetime_config_t

Renaming datetime structure.


Definition at line 72 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_calendar_month_t#

typedef RTC_MONTH_T sl_calendar_month_t

Renaming month structure.


Definition at line 73 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_calendar_days_of_week_t#

typedef RTC_DAY_OF_WEEK_T sl_calendar_days_of_week_t

Renaming days of week structure.


Definition at line 74 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

calendar_callback_t#

typedef void(* calendar_callback_t) (void) )(void)

Typedef for the function pointer of the callback function.


Definition at line 79 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

Function Documentation#

TIME_CONVERSION_ENUM#

TIME_CONVERSION_ENUM (time_conversion_enum )

Enumeration to represent time conversion format.

Parameters
N/A

Definition at line 92 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

RC_CLOCK_CALIBRATION_ENUM#

RC_CLOCK_CALIBRATION_ENUM (rc_clock_calibration_enum )

Enumeration to represent different rc clock calibration configurations.

Parameters
N/A

Definition at line 99 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

RO_CLOCK_CALIBRATION_ENUM#

RO_CLOCK_CALIBRATION_ENUM (ro_clock_calibration_enum )

Enumeration to represent different ro clock calibration configurations.

Parameters
N/A

Definition at line 110 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_set_configuration#

sl_status_t sl_si91x_calendar_set_configuration (sl_calendar_clock_t clock_type)

Configuration and initialization of Calendar i.e., RTC clock.

Parameters
[in]clock_type

(sl_calendar_clock_t) Enum for RTC Clock Type (RO, RC or XTAL)

Returns

  • status 0 if successful, else error code as follow. SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_FAIL (0x0001) - The function is failed


Definition at line 138 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_set_date_time#

sl_status_t sl_si91x_calendar_set_date_time (sl_calendar_datetime_config_t * config)

Set the date and time of the Calendar RTC.

Parameters
[in]config

(sl_calendar_datetime_config_t) Pointer to the Date Configuration Structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 153 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_get_date_time#

sl_status_t sl_si91x_calendar_get_date_time (sl_calendar_datetime_config_t * config)

Get the date and time of an existing Calendar RTC.

Parameters
[in]config

(sl_calendar_datetime_config_t) Pointer to the Date Configuration Structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 170 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_rcclk_calibration#

sl_status_t sl_si91x_calendar_rcclk_calibration (clock_calibration_config_t * clock_calibration_config)

Calibrate the RC Clock.

Parameters
[in]clock_calibration_config

(clock_calibration_config_t) pointer to the clock calibration structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 188 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_roclk_calibration#

sl_status_t sl_si91x_calendar_roclk_calibration (clock_calibration_config_t * clock_calibration_config)

Calibrate the RO Clock.

Parameters
[in]clock_calibration_config

(clock_calibration_config_t) pointer to the clock calibration structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 206 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_register_msec_trigger_callback#

sl_status_t sl_si91x_calendar_register_msec_trigger_callback (calendar_callback_t callback)

Register the callback of the msec trigger and enable it.

Parameters
[in]callback

(function pointer) Callback function pointer to be called when msec interrupt is triggered

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_BUSY (0x0004) - The callback is already registered, unregister previous callback before registering new one


Definition at line 221 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_register_sec_trigger_callback#

sl_status_t sl_si91x_calendar_register_sec_trigger_callback (calendar_callback_t callback)

Register the callback of the sec trigger and enable it.

Parameters
[in]callback

(function pointer) Callback function pointer to be called when sec interrupt is triggered

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_BUSY (0x0004) - The callback is already registered, unregister previous callback before registering new one


Definition at line 236 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_register_alarm_trigger_callback#

sl_status_t sl_si91x_calendar_register_alarm_trigger_callback (calendar_callback_t callback)

Register the callback of the alarm trigger and enable it.

Parameters
[in]callback

(function pointer) Callback function pointer to be called when alarm interrupt is triggered

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_BUSY (0x0004) - The callback is already registered, unregister previous callback before registering new one


Definition at line 251 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_unregister_msec_trigger_callback#

sl_status_t sl_si91x_calendar_unregister_msec_trigger_callback (void )

Unregister the callback of the msec trigger and disable it.

Parameters
N/A

Returns

  • status 0 if successful, else error code as follow SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_FAIL (0x0001) - The function is failed


Definition at line 266 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_unregister_sec_trigger_callback#

sl_status_t sl_si91x_calendar_unregister_sec_trigger_callback (void )

Unregister the callback of the sec trigger and disable it.

Parameters
N/A

Returns

  • status 0 if successful, else error code as follow SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_FAIL (0x0001) - The function is failed


Definition at line 281 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_unregister_alarm_trigger_callback#

sl_status_t sl_si91x_calendar_unregister_alarm_trigger_callback (void )

Unregister the callback of the alarm trigger and disable it.

Parameters
N/A
  • Pre-conditions:

    • sl_si91x_calendar_register_alarm_trigger_callback

Returns

  • status 0 if successful, else error code as follow SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_FAIL (0x0001) - The function is failed


Definition at line 296 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_set_alarm#

sl_status_t sl_si91x_calendar_set_alarm (sl_calendar_datetime_config_t * alarm)

Set the date and time of new alarm in RTC.

Parameters
[in]alarm

Pointer to the Date Configuration Structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 313 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_get_alarm#

sl_status_t sl_si91x_calendar_get_alarm (sl_calendar_datetime_config_t * alarm)

Get the date and time of an existing alarm in RTC.

Parameters
[in]alarm

Pointer to the Date Configuration Structure

Returns

  • status 0 if successful, else error code as follow SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 332 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_build_datetime_struct#

sl_status_t sl_si91x_calendar_build_datetime_struct (sl_calendar_datetime_config_t * date, uint8_t Century, uint8_t Year, sl_calendar_month_t Month, sl_calendar_days_of_week_t DayOfWeek, uint8_t Day, uint8_t Hour, uint8_t Minute, uint8_t Second, uint16_t Milliseconds)

Build the structure for date-time configuration.

Parameters
[in]date

Pointer to the Date Configuration Structure

[in]Century

(uint8_t) Century (0-4)

[in]Year

(uint8_t) Year (1-99) + (Century * 1000)

[in]Month

(enum) Month from the RTC_MONTH_T enum

[in]DayOfWeek

(enum) Day of Week from the RTC_DAY_OF_WEEK_T enum

[in]Day

Day (uint8_t) (1-31)

[in]Hour

Hour (uint8_t) (0-23)

[in]Minute

Minutes (uint8_t) (0-59)

[in]Second

Seconds (uint8_t) (0-59)

[in]Milliseconds

Milliseconds (uint16_t) (0-999)

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid SL_STATUS_OK (0x0000) - Success


Definition at line 352 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_convert_unix_time_to_ntp_time#

sl_status_t sl_si91x_calendar_convert_unix_time_to_ntp_time (uint32_t time, uint32_t * ntp_time)

Convert Unix timestamp to NTP timestamp.

Parameters
[in]time

(uint32_t) Unix timestamp

[in]ntp_time

(uint32_t) variable to store NTP timestamp

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 375 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_convert_ntp_time_to_unix_time#

sl_status_t sl_si91x_calendar_convert_ntp_time_to_unix_time (uint32_t ntp_time, uint32_t * time)

Convert NTP timestamp to Unix timestamp.

Parameters
[in]ntp_time

(uint32_t) NTP timestamp

[in]time

(uint32_t) variable to store Unix timestamp

Returns

  • status 0 if successful, else error code as follow SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_OK (0x0000) - Success


Definition at line 389 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_is_msec_trigger_enabled#

boolean_t sl_si91x_calendar_is_msec_trigger_enabled (void )

Return the state of msec trigger of RTC (enabled or disabled).

Parameters
N/A

Returns

  • (boolean)true if trigger is enabled, false otherwise


Definition at line 401 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_is_sec_trigger_enabled#

boolean_t sl_si91x_calendar_is_sec_trigger_enabled (void )

Return the state of sec trigger of RTC (enabled or disabled).

Parameters
N/A

Returns

  • (boolean)true if trigger is enabled, false otherwise


Definition at line 413 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_is_alarm_trigger_enabled#

boolean_t sl_si91x_calendar_is_alarm_trigger_enabled (void )

Return the state of alarm trigger of RTC (enabled or disabled).

Parameters
N/A
  • Pre-conditions:

    • sl_si91x_calendar_register_alarm_trigger_callback

Returns

  • (boolean)true if trigger is enabled, false otherwise


Definition at line 425 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_rtc_start#

__STATIC_INLINE void sl_si91x_calendar_rtc_start (void )

Start the Calendar RTC.

Parameters
N/A

Returns

  • none


Definition at line 439 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_rtc_stop#

__STATIC_INLINE void sl_si91x_calendar_rtc_stop (void )

Stop the Calendar RTC.

Parameters
N/A

Returns

  • none


Definition at line 458 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_calibration_init#

__STATIC_INLINE void sl_si91x_calendar_calibration_init (void )

Initialize the calibration for Calendar clocks.

Parameters
N/A

Returns

  • none


Definition at line 469 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_clear_msec_trigger#

__STATIC_INLINE void sl_si91x_calendar_clear_msec_trigger (void )

Clear the msec trigger.

Parameters
N/A

Returns

  • none


Definition at line 480 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_clear_sec_trigger#

__STATIC_INLINE void sl_si91x_calendar_clear_sec_trigger (void )

Clear the sec trigger.

Parameters
N/A

Returns

  • none


Definition at line 491 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_clear_alarm_trigger#

__STATIC_INLINE void sl_si91x_calendar_clear_alarm_trigger (void )

Clear the alarm trigger.

Parameters
N/A

Returns

  • none


Definition at line 502 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_init#

__STATIC_INLINE void sl_si91x_calendar_init (void )

De-initialize calendar operation.

Parameters
N/A

Returns

  • none


Definition at line 516 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_deinit#

__STATIC_INLINE void sl_si91x_calendar_deinit (void )

De-initialize calendar operation.

Parameters
N/A

Returns

  • none


Definition at line 530 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

sl_si91x_calendar_get_version#

sl_calendar_version_t sl_si91x_calendar_get_version (void )

Get the calendar version.

Parameters
[in]

This function is used to know the calendar version.

Returns


Definition at line 545 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

Macro Definition Documentation#

SLI_ALARM_IRQHandler#

#define SLI_ALARM_IRQHandler
Value:
IRQ028_Handler

Alarm IRQ Handler.


Definition at line 48 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

SLI_MSEC_SEC_IRQHandler#

#define SLI_MSEC_SEC_IRQHandler
Value:
IRQ029_Handler

RTC IRQ Handler.


Definition at line 49 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

SLI_NVIC_ALARM#

#define SLI_NVIC_ALARM
Value:
MCU_CAL_ALARM_IRQn

Alarm NVIQ enable.


Definition at line 50 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

SLI_NVIC_MSEC_SEC#

#define SLI_NVIC_MSEC_SEC
Value:
MCU_CAL_RTC_IRQn

RTC NVIQ enable.


Definition at line 51 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

TIME_CONVERSION_ENUM#

#define TIME_CONVERSION_ENUM
Value:
typedef uint8_t name; \
enum name##_enum

Time Conversion format enum declaration.


Definition at line 55 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

RC_CLOCK_CALIBRATION_ENUM#

#define RC_CLOCK_CALIBRATION_ENUM
Value:
typedef uint8_t name; \
enum name##_enum

Time Conversion format enum declaration.


Definition at line 58 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h

RO_CLOCK_CALIBRATION_ENUM#

#define RO_CLOCK_CALIBRATION_ENUM
Value:
typedef uint8_t name; \
enum name##_enum

Time Conversion format enum declaration.


Definition at line 61 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_calendar.h