System RTC#

Modules#

sl_sysrtc_clock_config_t

sl_sysrtc_interrupt_enables_t

sl_sysrtc_version_t

Enumerations#

enum
SL_SYSRTC_GROUP_0
SL_SYSRTC_GROUP_1
SL_SYSRTC_GROUP_LAST
}

Enumeration to represent sysrtc group numbers.

enum
SL_SYSRTC_CHANNEL_0
SL_SYSRTC_CHANNEL_1
SL_SYSRTC_CHANNEL_LAST
}

Enumeration to represent sysrtc channel numbers.

Typedefs#

typedef rsi_sysrtc_clk_inp_t
typedef rsi_sysrtc_config_t
typedef rsi_sysrtc_group_config_t
typedef rsi_sysrtc_group_channel_compare_config_t
typedef rsi_sysrtc_group_channel_capture_config_t
typedef void(*
sl_sysrtc_callback_t)(void *callback_flag)

Typedef for the function pointer of the interrupt callback function.

Functions#

sl_status_t
sl_si91x_sysrtc_init(const sl_sysrtc_config_t *config_ptr)

Initializes SYSRTC and enables the peripheral.

sl_status_t
sl_si91x_sysrtc_configure_clock(sl_sysrtc_clock_config_t *clk_ptr)

Configures SYSRTC input clock source.

sl_status_t
sl_si91x_sysrtc_configure_group(sl_sysrtc_group_number_t group_number, sl_sysrtc_group_config_t const *config_ptr)

Configures SYSRTC compare and capture channel's groups, configures group number, and enables its compare & capture channels.

sl_status_t
sl_si91x_sysrtc_register_callback(sl_sysrtc_callback_t on_sysrtc_callback, void *callback_flag_value, sl_sysrtc_group_number_t group_number, sl_sysrtc_interrupt_enables_t *interrupt_enable_ptr)

Registers callback of timer interrupt and enables respective interrupts as per selected interrupt flag.

sl_status_t
sl_si91x_sysrtc_unregister_callback(sl_sysrtc_group_number_t group_number, sl_sysrtc_interrupt_enables_t *interrupt_enabled_handle)

Unregisters timer interrupt callback and disables interrupts as per selected interrupt flag.

sl_status_t
sl_si91x_sysrtc_set_compare_value(sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t compare_value)

Sets SYSRTC compare value for the selected channel of the given group.

sl_status_t
sl_si91x_sysrtc_get_compare_value(sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t *compare_value)

Gets SYSRTC compare register value for the selected channel of the given group.

sl_status_t
sl_si91x_sysrtc_sets_register_capture_input(sl_sysrtc_group_number_t group_number)

Sets register input high for the capture channel of the passed group of SYSRTC.

sl_status_t
sl_si91x_sysrtc_set_gpio_as_capture_input(sl_sysrtc_group_number_t group_number)

Configures SYSRTC input GPIO pins for SYSRTC capture channel input.

sl_status_t
sl_si91x_sysrtc_set_compare_output_gpio(sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel)

Configures SYSRTC compare output GPIO pins of the given channel of the given group.

sl_status_t
sl_si91x_sysrtc_get_count(uint32_t *count_value)

Gets SYSRTC current counter register value.

sl_status_t
sl_si91x_sysrtc_get_capture_value(sl_sysrtc_group_number_t group_number, uint32_t *capture_value)

Gets SYSRTC capture register value of the given group.

sl_status_t
sl_si91x_sysrtc_get_compare_output(sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t *compare_output_bit)

Gets SYSRTC compare register value of the given group and channel.

sl_status_t
sl_si91x_sysrtc_is_running(boolean_t *running_status)

Gets SYSRTC running status, status is true if running else false if stopped.

sl_status_t
sl_si91x_sysrtc_is_locked(boolean_t *lock_status)

Gets SYSRTC lock status, status is true if locked else false if unlocked.

void

Enables SYSRTC IO through GPIO if passed true else through register if passed false.

__STATIC_INLINE void

Starts SYSRTC counter.

__STATIC_INLINE void

Stops the SYSRTC counter.

__STATIC_INLINE void

Restores SYSRTC to its reset state.

__STATIC_INLINE void

Locks SYSRTC registers.

__STATIC_INLINE void

Unlocks SYSRTC registers.

__STATIC_INLINE void

Sets the SYSRTC counter register value of counter.

To get the release version of SYSRTC.

void

De-initializes SYSRTC by disabling its clock.

Enumeration Documentation#

sl_sysrtc_group_number_t#

sl_sysrtc_group_number_t

Enumeration to represent sysrtc group numbers.

Enumerator
SL_SYSRTC_GROUP_0

enum for SYSRTC group-0

SL_SYSRTC_GROUP_1

enum for SYSRTC group-1

SL_SYSRTC_GROUP_LAST

Last member of enum for validation.


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

sl_sysrtc_channel_number_t#

sl_sysrtc_channel_number_t

Enumeration to represent sysrtc channel numbers.

Enumerator
SL_SYSRTC_CHANNEL_0

enum for SYSRTC channel-0

SL_SYSRTC_CHANNEL_1

enum for SYSRTC channel-1

SL_SYSRTC_CHANNEL_LAST

Last member of enum for validation.


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

Typedef Documentation#

sl_clock_sources_t#

typedef rsi_sysrtc_clk_inp_t sl_clock_sources_t

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

sl_sysrtc_config_t#

typedef rsi_sysrtc_config_t sl_sysrtc_config_t

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

sl_sysrtc_group_config_t#

typedef rsi_sysrtc_group_config_t sl_sysrtc_group_config_t

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

sl_sysrtc_group_compare_channel_action_config_t#

typedef rsi_sysrtc_group_channel_compare_config_t sl_sysrtc_group_compare_channel_action_config_t

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

sl_sysrtc_group_capture_channel_input_edge_config_t#

typedef rsi_sysrtc_group_channel_capture_config_t sl_sysrtc_group_capture_channel_input_edge_config_t

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

sl_sysrtc_callback_t#

typedef void(* sl_sysrtc_callback_t) (void *callback_flag) )(void *callback_flag)

Typedef for the function pointer of the interrupt callback function.

Parameters
N/Acallback_flag

(void *) parameter for updating flag values


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

Function Documentation#

sl_si91x_sysrtc_init#

sl_status_t sl_si91x_sysrtc_init (const sl_sysrtc_config_t * config_ptr)

Initializes SYSRTC and enables the peripheral.

Parameters
[in]config_ptr

Pointer to SYSRTC config structure sl_sysrtc_config_t.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, SYSRTC initialized properly.


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

sl_si91x_sysrtc_configure_clock#

sl_status_t sl_si91x_sysrtc_configure_clock (sl_sysrtc_clock_config_t * clk_ptr)

Configures SYSRTC input clock source.

Parameters
[in]clk_ptr

Pointer to clock configuration structure sl_sysrtc_clock_config_t.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Clock source parameter has an invalid value.

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, timer clock-source parameters configured properly.


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

sl_si91x_sysrtc_configure_group#

sl_status_t sl_si91x_sysrtc_configure_group (sl_sysrtc_group_number_t group_number, sl_sysrtc_group_config_t const * config_ptr)

Configures SYSRTC compare and capture channel's groups, configures group number, and enables its compare & capture channels.

Parameters
[in]group_number

SYSRTC group number to be used.

[in]config_ptr

(const *) Pointer to group configuration structure sl_sysrtc_group_config_t.

Also configures match out actions for respective compare channel and input events for capture.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Counter direction parameter has an invalid value.

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_register_callback#

sl_status_t sl_si91x_sysrtc_register_callback (sl_sysrtc_callback_t on_sysrtc_callback, void * callback_flag_value, sl_sysrtc_group_number_t group_number, sl_sysrtc_interrupt_enables_t * interrupt_enable_ptr)

Registers callback of timer interrupt and enables respective interrupts as per selected interrupt flag.

Parameters
[in]on_sysrtc_callback

(function pointer) Callback function pointer to be called when timer interrupt occurred.

[in]callback_flag_value

(void *) pointer to interrupt flag value variable sl_sysrtc_callback_t.

[in]group_number

SYSRTC group number whose interrupts needs to be enabled.

[in]interrupt_enable_ptr

pointer to interrupt enable structure sl_sysrtc_interrupt_enables_t.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - interrupt_enable_ptr parameter is a null pointer.

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

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Successfully registered timer timeout callback.


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

sl_si91x_sysrtc_unregister_callback#

sl_status_t sl_si91x_sysrtc_unregister_callback (sl_sysrtc_group_number_t group_number, sl_sysrtc_interrupt_enables_t * interrupt_enabled_handle)

Unregisters timer interrupt callback and disables interrupts as per selected interrupt flag.

Parameters
[in]group_number

pointer to interrupts enable structure sl_sysrtc_interrupt_enables_t.

[in]interrupt_enabled_handle

SYSRTC group number whose interrupts needs to be enabled.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number parameter has an invalid value.

    • SL_STATUS_NULL_POINTER (0x0022) - parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Successfully unregistered timer interrupt callback.


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

sl_si91x_sysrtc_set_compare_value#

sl_status_t sl_si91x_sysrtc_set_compare_value (sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t compare_value)

Sets SYSRTC compare value for the selected channel of the given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

[in]compare_value

Compare register value.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number or channel parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_get_compare_value#

sl_status_t sl_si91x_sysrtc_get_compare_value (sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t * compare_value)

Gets SYSRTC compare register value for the selected channel of the given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

[in]compare_value

Pointer to the variable to store compare value read.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number or channel parameter has an invalid value.

    • SL_STATUS_NULL_POINTER (0x0022) - compare_value parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_sets_register_capture_input#

sl_status_t sl_si91x_sysrtc_sets_register_capture_input (sl_sysrtc_group_number_t group_number)

Sets register input high for the capture channel of the passed group of SYSRTC.

Parameters
[in]group_number

SYSRTC group number to use.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_set_gpio_as_capture_input#

sl_status_t sl_si91x_sysrtc_set_gpio_as_capture_input (sl_sysrtc_group_number_t group_number)

Configures SYSRTC input GPIO pins for SYSRTC capture channel input.

Parameters
[in]group_number

SYSRTC group number to use.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_set_compare_output_gpio#

sl_status_t sl_si91x_sysrtc_set_compare_output_gpio (sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel)

Configures SYSRTC compare output GPIO pins of the given channel of the given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number or channel parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_get_count#

sl_status_t sl_si91x_sysrtc_get_count (uint32_t * count_value)

Gets SYSRTC current counter register value.

Parameters
[in]count_value

Pointer to the variable to store count value read.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - count_value parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_get_capture_value#

sl_status_t sl_si91x_sysrtc_get_capture_value (sl_sysrtc_group_number_t group_number, uint32_t * capture_value)

Gets SYSRTC capture register value of the given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]capture_value

Pointer to the variable to store capture value read.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - count_value parameter is a null pointer.

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_get_compare_output#

sl_status_t sl_si91x_sysrtc_get_compare_output (sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel, uint32_t * compare_output_bit)

Gets SYSRTC compare register value of the given group and channel.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

[in]compare_output_bit

Pointer to the variable to store compare output.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - compare_output parameter is a null pointer.

    • SL_STATUS_INVALID_PARAMETER (0x0021) - group_number or channel parameter has an invalid value.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_is_running#

sl_status_t sl_si91x_sysrtc_is_running (boolean_t * running_status)

Gets SYSRTC running status, status is true if running else false if stopped.

Parameters
[in]running_status

Pointer to the variable to store SYSRTC running status.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - running_status parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_is_locked#

sl_status_t sl_si91x_sysrtc_is_locked (boolean_t * lock_status)

Gets SYSRTC lock status, status is true if locked else false if unlocked.

Parameters
[in]lock_status

Pointer to the variable to store SYSRTC lock status.

Returns

  • status 0 if successful, else error code as follows:

    • SL_STATUS_NULL_POINTER (0x0022) - lock_status parameter is a null pointer.

    • SL_STATUS_OK (0x0000) - Success, parameters configured properly.


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

sl_si91x_sysrtc_enable_input_output_gpio#

void sl_si91x_sysrtc_enable_input_output_gpio (bool is_gpio_enabled)

Enables SYSRTC IO through GPIO if passed true else through register if passed false.

Parameters
[in]is_gpio_enabled

Bool to enable or disable IO through GPIO.

Returns

  • none


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

sl_si91x_sysrtc_start#

__STATIC_INLINE void sl_si91x_sysrtc_start (void )

Starts SYSRTC counter.

Parameters
N/A

Note

  • This function will send a start command to the SYSRTC peripheral. The SYSRTC peripheral will use some LF clock ticks before the command is executed. The rsi_sysrtc_wait_sync() function is used to wait for the start command to be executed.

Returns

  • none


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

sl_si91x_sysrtc_stop#

__STATIC_INLINE void sl_si91x_sysrtc_stop (void )

Stops the SYSRTC counter.

Parameters
N/A

This function will send a stop command to the SYSRTC peripheral. The SYSRTC peripheral will use some LF clock ticks before the command is executed. The rsi_sysrtc_wait_sync() function can be used to wait for the stop command to be executed.

Note

  • This function requires the SYSRTC to be enabled.

Returns

  • none


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

sl_si91x_sysrtc_reset#

__STATIC_INLINE void sl_si91x_sysrtc_reset (void )

Restores SYSRTC to its reset state.

Parameters
N/A

Returns

  • none


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

sl_si91x_sysrtc_lock#

__STATIC_INLINE void sl_si91x_sysrtc_lock (void )

Locks SYSRTC registers.

Parameters
N/A

Note

  • When SYSRTC registers are locked SYSRTC_EN, SYSRTC_CFG, SYSRTC_CMD, SYSRTC_SWRST, SYSRTC_CNT and SYSRTC_TOPCNT registers cannot be written to.

Returns

  • none


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

sl_si91x_sysrtc_unlock#

__STATIC_INLINE void sl_si91x_sysrtc_unlock (void )

Unlocks SYSRTC registers.

Parameters
N/A

Returns

  • none


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

sl_si91x_sysrtc_set_count#

__STATIC_INLINE void sl_si91x_sysrtc_set_count (uint32_t value)

Sets the SYSRTC counter register value of counter.

Parameters
[in]value

The new SYSRTC counter value.

Returns

  • none


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

sl_si91x_sysrtc_get_version#

sl_sysrtc_version_t sl_si91x_sysrtc_get_version (void )

To get the release version of SYSRTC.

Parameters
[in]

Returns


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

sl_si91x_sysrtc_deinit#

void sl_si91x_sysrtc_deinit (void )

De-initializes SYSRTC by disabling its clock.

Parameters
[in]

Returns

  • none


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