System RTC#


Introduction#

The System Real-Time Clock (SYSRTC) offers precise timekeeping and timer functionality essential for various applications. It is fundamental for tasks that require accurate time measurement, event scheduling, and power management. This SYSRTC driver provides a comprehensive set of functions to configure and utilize peripherals effectively, ensuring optimal performance and reliability in time-critical applications.

Configuration#

The configuration parameters of the SYSRTC function include setting the clock frequency and initializing and enabling the peripherals:

  • Setting the clock source frequency: Choose between 32kHz RC or 1kHz RO clock sources using the sl_si91x_sysrtc_configure_clock function.

  • Initialization: Initialize and enable the SYSRTC peripheral with the sl_si91x_sysrtc_init function.

  • Additionally, configure the SYSRTC to continue running during a debug halt by specifying the appropriate setting in the initialization function.

SYSRTC block diagramSYSRTC block diagram

  • For more information on configuring available parameters, see the respective peripheral example readme document.

Usage#

The SYSRTC has to be initialized by calling the following parameters:

  1. Configure the SYSRTC input clock frequency by using the sl_si91x_sysrtc_configure_clock function.

  2. Initialize the SYSRTC and enable the peripherals by calling the sl_si91x_sysrtc_init function.

  3. Once configured, the SYSRTC can be customized to specific application requirements by using the following functions:

  4. Further functions allow for fine-grained control over time-sensitive operations:

The following functions will initiate and configure the SYSRTC, representing the general flow for implementation:

  1. Configure the SYSRTC input clock frequency by using the sl_si91x_sysrtc_configure_clock function.

  2. Initialize the SYSRTC and enable the peripherals by calling the sl_si91x_sysrtc_init function.

  3. Configure the SYSRTC group number and enable its compare and capture channels by using the sl_si91x_sysrtc_configure_group function.

  4. Register the callback for the timer interrupt by using the sl_si91x_sysrtc_register_callback function.

  5. Set the SYSRTC counter register value with the sl_si91x_sysrtc_set_count function.

  6. Set the SYSRTC compare value for the selected channel of the group by using the sl_si91x_sysrtc_set_compare_value function, if the compare channel is enabled.

  7. Get the SYSRTC running status with the sl_si91x_sysrtc_is_running function, if required to check the timer running status.

  8. Start the SYSRTC counter by using the sl_si91x_sysrtc_start function.

  9. Get the SYSRTC current counter register value by using the sl_si91x_sysrtc_get_count function if needed.

  10. Stop the SYSRTC counter by using the sl_si91x_sysrtc_stop function.

  11. De-initialize the SYSRTC by disabling its clock by calling the sl_si91x_sysrtc_deinit function.

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

clock sources enum

typedef rsi_sysrtc_config_t

SYSRTC config structure.

typedef rsi_sysrtc_group_config_t

SYSRTC group config structure.

typedef rsi_sysrtc_group_channel_compare_config_t

renaming group compare channel config structure

typedef rsi_sysrtc_group_channel_capture_config_t

renaming group capture channel config structure

typedef void(*
sl_sysrtc_callback_t)(void *callback_flag)

Typedef for the SYSRTC callback function.

Functions#

sl_status_t
sl_si91x_sysrtc_init(const sl_sysrtc_config_t *config_ptr)

To initialize SYSRTC and enable the peripheral.

sl_status_t
sl_si91x_sysrtc_configure_clock(sl_sysrtc_clock_config_t *clk_ptr)

To configure the SYSRTC input clock source frequency.

sl_status_t
sl_si91x_sysrtc_configure_group(sl_sysrtc_group_number_t group_number, sl_sysrtc_group_config_t const *config_ptr)

To configure the SYSRTC groups of compare and 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)

To register the callback for the timer interrupt.

sl_status_t
sl_si91x_sysrtc_unregister_callback(sl_sysrtc_group_number_t group_number, sl_sysrtc_interrupt_enables_t *interrupt_enabled_handle)

To unregister the timer interrupt callback.

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)

To set the 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)

To get the SYSRTC current compare register value for the selected channel of the selected group.

sl_status_t
sl_si91x_sysrtc_sets_register_capture_input(sl_sysrtc_group_number_t group_number)

To set register-input for the capture channel of the selected group of SYSRTC.

sl_status_t
sl_si91x_sysrtc_set_gpio_as_capture_input(sl_sysrtc_group_number_t group_number)

To configure input pins for the SYSRTC capture channel of the selected group.

sl_status_t
sl_si91x_sysrtc_set_compare_output_gpio(sl_sysrtc_group_number_t group_number, sl_sysrtc_channel_number_t channel)

To configure the output pins of the selected compare channel of the given group.

sl_status_t
sl_si91x_sysrtc_get_count(uint32_t *count_value)

To get the 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)

To get the SYSRTC capture register value of a 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)

To read the SYSRTC compare channel output bit value of a given group.

sl_status_t
sl_si91x_sysrtc_is_running(boolean_t *running_status)

To get the SYSRTC running status.

sl_status_t
sl_si91x_sysrtc_is_locked(boolean_t *lock_status)

To get the SYSRTC lock status.

void

To set the SYSRTC input/output mode for the capture and compare channels.

__STATIC_INLINE void

To start the SYSRTC counter.

__STATIC_INLINE void

To stop the SYSRTC counter.

__STATIC_INLINE void

To reset the SYSRTC to its default state.

__STATIC_INLINE void

To lock the SYSRTC registers.

__STATIC_INLINE void

To unlock the SYSRTC registers.

__STATIC_INLINE void

To set the SYSRTC counter register value.

To get the SYSRTC version.

void

To de-initialize the SYSRTC by disabling its clock.

Enumeration Documentation#

sl_sysrtc_group_number_t#

sl_sysrtc_group_number_t

Enumeration to represent SYSRTC group numbers.

This enumeration defines the group numbers for the SYSRTC module. It includes options for group 0, group 1, and a validation member.

Enumerator
SL_SYSRTC_GROUP_0

Enumerator for SYSRTC group 0.

SL_SYSRTC_GROUP_1

Enumerator for SYSRTC group 1.

SL_SYSRTC_GROUP_LAST

Last enumerator for validation.


Definition at line 80 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.

This enumeration defines the channel numbers for the SYSRTC module. It includes options for channel 0, channel 1, and a validation member.

Enumerator
SL_SYSRTC_CHANNEL_0

Enumerator for SYSRTC channel 0.

SL_SYSRTC_CHANNEL_1

Enumerator for SYSRTC channel 1.

SL_SYSRTC_CHANNEL_LAST

Last enumerator for validation.


Definition at line 92 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

clock sources enum


Definition at line 55 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

SYSRTC config structure.


Definition at line 56 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

SYSRTC group config structure.


Definition at line 57 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

renaming group compare channel config structure


Definition at line 59 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

renaming group capture channel config structure


Definition at line 61 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 SYSRTC callback function.

Parameters
[in]callback_flag

Pointer to a user-defined flag or data structure that can be used within the callback function.

This typedef defines the function signature for the callback function used by the SYSRTC. The callback function is called when a specific SYSRTC event occurs.


Definition at line 72 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)

To initialize SYSRTC and enable the peripheral.

Parameters
[in]config_ptr

Pointer to the SYSRTC configuration structure sl_sysrtc_config_t.

This API initializes the SYSRTC and configures it to run during debug halt, based on user input.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, SYSRTC initialized properly.

    • SL_STATUS_NULL_POINTER - The parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 158 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)

To configure the SYSRTC input clock source frequency.

Parameters
[in]clk_ptr

Pointer to the clock configuration structure sl_sysrtc_clock_config_t.

This API configures the clock source for the SYSRTC. It allows the selection of 32 KHz RC, 32 KHz RO, or 1 KHz RO clock sources based on user input. For using the 1kHz clock source, pass the division factor value as '16'; otherwise, pass '0'.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, timer clock-source parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - Clock source parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 176 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)

To configure the SYSRTC groups of compare and capture channels.

Parameters
[in]group_number

SYSRTC group number to be used.

[in]config_ptr

Pointer to the group configuration structure sl_sysrtc_group_config_t.

Configures the specified group number and enables its compare and capture channels. Additionally, sets up match-out actions for the corresponding compare channels and input events for the capture channels.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - Counter direction parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 199 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)

To register the callback for the timer interrupt.

Parameters
[in]on_sysrtc_callback

Function pointer to the callback function to be called when a timer interrupt occurs.

[in]callback_flag_value

Pointer to the interrupt flag value variable sl_sysrtc_callback_t.

[in]group_number

SYSRTC group number whose interrupts need to be enabled.

[in]interrupt_enable_ptr

Pointer to the interrupt enable structure sl_sysrtc_interrupt_enables_t.

Registers the callback for the timer interrupt and enables the corresponding interrupts based on the selected interrupt flags.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Successfully registered timer timeout callback.

    • SL_STATUS_BUSY - The callback is already registered; unregister the previous callback before registering a new one.

    • SL_STATUS_INVALID_PARAMETER - The group_number parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The interrupt_enable_ptr parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 227 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)

To unregister the timer interrupt callback.

Parameters
[in]group_number

SYSRTC group number whose interrupts need to be disabled.

[in]interrupt_enabled_handle

Pointer to the interrupt enable structure sl_sysrtc_interrupt_enables_t.

Unregisters the timer interrupt callback and disables interrupts according to the selected interrupt flag.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Successfully unregistered timer interrupt callback.

    • SL_STATUS_INVALID_PARAMETER - The group_number parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The interrupt_enabled_handle parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 251 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)

To set the 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.

This API sets the SYSRTC compare register value for the specified channel within the given group.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number or channel parameter has an invalid value.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 274 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)

To get the SYSRTC current compare register value for the selected channel of the selected group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

[out]compare_value

Pointer to the variable to store the compare value read.

This API retrieves the current compare register value for the specified channel within the given group.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number or channel parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The compare_value parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 295 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)

To set register-input for the capture channel of the selected group of SYSRTC.

Parameters
[in]group_number

SYSRTC group number to use.

This API sets the register-input for the capture channel of the selected SYSRTC group, configuring the SYSRTC Input (Capture) from the register.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number parameter has an invalid value.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 319 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)

To configure input pins for the SYSRTC capture channel of the selected group.

Parameters
[in]group_number

SYSRTC group number to use.

Configures GPIO-0 and GPIO-1 as input pins for the capture channel of group 0 and group 1, respectively. Sets pins mode, mux, and direction.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number parameter has an invalid value.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 342 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)

To configure the output pins of the selected compare channel of the given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

Configures GPIO-3 and GPIO-4 as output pins for compare channels 0 and 1 of group 0, respectively. Configures GPIO-1 and GPIO-2 as output pins for compare channels 0 and 1 of group 1, respectively. Sets pins mode, mux, and direction, and enables the input buffer for the pins.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number or channel parameter has an invalid value.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 365 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)

To get the SYSRTC current counter register value.

Parameters
[in]count_value

Pointer to the variable to store the count value read.

Updates the current count of the timer to the count_value input parameter.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, count value retrieved properly.

    • SL_STATUS_NULL_POINTER - The count_value parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 382 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)

To get the SYSRTC capture register value of a given group.

Parameters
[in]group_number

SYSRTC group number to use.

[out]capture_value

Pointer to the variable to store the capture value read.

Updates the capture count value of the timer to the capture_value input parameter.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The capture_value parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 400 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)

To read the SYSRTC compare channel output bit value of a given group.

Parameters
[in]group_number

SYSRTC group number to use.

[in]channel

Channel number to use.

[out]compare_output_bit

Pointer to the variable to store the compare output.

Updates the bit value to the compare_output_bit input parameter.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_INVALID_PARAMETER - The group_number or channel parameter has an invalid value.

    • SL_STATUS_NULL_POINTER - The compare_output_bit parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 419 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)

To get the SYSRTC running status.

Parameters
[in]running_status

Pointer to the variable to store the SYSRTC running status.

Updates the running_status input parameter to 'true' if SYSRTC is running; otherwise, it updates the parameter to 'false'.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_NULL_POINTER - The running_status parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 437 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)

To get the SYSRTC lock status.

Parameters
[in]lock_status

Pointer to the variable to store SYSRTC lock status.

Updates the lock_status input parameter to 'true' if SYSRTC is locked or to 'false' if it is unlocked.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success, parameters configured properly.

    • SL_STATUS_NULL_POINTER - The lock_status parameter is a null pointer.

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 453 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)

To set the SYSRTC input/output mode for the capture and compare channels.

Parameters
[in]is_gpio_enabled

Boolean to enable or disable IO through GPIO.

If "is_gpio_enabled" is set to "true", the input to capture and output from compare channels will be through GPIO. If set to "false", the input to capture and output from compare channels can be set through registers.


Definition at line 465 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 )

To start the SYSRTC counter.

Parameters
N/A

This API sends a start command to the SYSRTC peripheral and waits until the command has been executed.

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.


Definition at line 484 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 )

To stop the SYSRTC counter.

Parameters
N/A

This function sends a stop command to the SYSRTC peripheral and waits until the command is executed.

Note

  • This function requires the SYSRTC to be enabled.


Definition at line 497 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 )

To reset the SYSRTC to its default state.

Parameters
N/A

This function restores the SYSRTC peripheral to its reset state.

Note

  • This function requires the SYSRTC to be enabled.


Definition at line 510 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 )

To lock the SYSRTC registers.

Parameters
N/A

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


Definition at line 522 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 )

To unlock the SYSRTC registers.

Parameters
N/A

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


Definition at line 537 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)

To set the SYSRTC counter register value.

Parameters
[in]value

The new SYSRTC counter value.

This API is used to change the count of SYSRTC when it is stopped. After calling this API, the user should start SYSRTC.


Definition at line 554 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 SYSRTC version.

Parameters
N/A

Retrieve the API version of SYSRTC.

Returns


Definition at line 567 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 )

To de-initialize the SYSRTC by disabling its clock.

Parameters
N/A

This API de-initializes the SYSRTC by disabling its clock. Unregisters the SYSRTC callback and disables all interrupts.


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