Ultra Low-Power Timer#
Introduction#
Ultra-Low-Power (ULP) timers are typically used to operate with extremely low power consumption. These timers are used in battery-powered or energy-efficient devices, where minimizing power usage is essential for extending battery life.
ULP timers offer configurable settings, allowing developers to adjust parameters such as clock frequency, timer resolution, and interrupt behavior to suit the specific needs of their applications.
Key features include:
The ULP-Timer module supports four different instances ulp_timer_instance_t.
Each ULP-timer can be independently programmed to operate in periodic or one-shot mode ulp_timer_mode_t.
Each ULP-timer can be independently configured as either a 32-bit counter or a microsecond timer ulp_timer_type_t.
Configuration#
The configurable parameters for the ULP-Timer include:
The ULP-timer is initialized and its clocks are configured using sl_si91x_ulp_timer_init.
Parameters such as match count, timer type, mode, and timer direction can be configured using sl_si91x_ulp_timer_set_configuration.
For more information on configuring available parameters, see the respective peripheral example readme document.
Usage#
The common ULP-timer functions can be used after ULP-timer structures are specified, passing an instance of ulp_timer_config_t.
These functions will initiate and configure the ULP-timer below, which is the flow for implementation.
Initialize the ULP-Timer by enabling its clock source using the sl_si91x_ulp_timer_init function.
Configure the ULP-Timer parameters using the sl_si91x_ulp_timer_set_configuration function.
Register the callback for the timer timeout interrupt and enable the interrupt using the sl_si91x_ulp_timer_register_timeout_callback function.
Start the ULP-Timer using the sl_si91x_ulp_timer_start function.
Stop the ULP-Timer using the sl_si91x_ulp_timer_stop function.
De-initialize the ULP-Timer clock by disabling the peripheral clock using the sl_si91x_ulp_timer_deinit function.
The above functions allow for initializing the ULP-TIMER instance and generating interrupts.
Additional Timer Configuration functions for managing the ULP timer, you can use the following functions to adjust the timer's type, direction, and callback settings:
Set the ULP-Timer type:sl_si91x_ulp_timer_set_type
Set the ULP-Timer mode as one-shot or periodic:sl_si91x_ulp_timer_set_mode
Set the ULP-Timer direction:sl_si91x_ulp_timer_set_direction
Set the ULP-Timer match value:sl_si91x_ulp_timer_set_count
To retrieve information about the current configuration and status of the ULP timer, you can use the following functions:
Read the ULP-Timer mode:sl_si91x_ulp_timer_get_mode
Read the ULP-Timer type:sl_si91x_ulp_timer_get_type
Read the ULP-Timer direction (up-counter or down-counter):sl_si91x_ulp_timer_get_direction
Read the ULP-Timer current count:sl_si91x_ulp_timer_get_count
Modules#
Enumerations#
Enumeration to represent ULP timer instances.
Enumeration to represent ULP timer modes.
Enumeration to represent ULP timer types.
Enumeration to represent values of clock sources to select as Timer clock.
Typedefs#
Typedef for the function pointer of the callback function.
Renaming clock type enum.
Renaming clock type enum.
Functions#
To initialize the ULP-Timer by enabling its clock source.
To configure and enable the ULP-Timer input clock source.
To configure the ULP-Timer parameters.
To start the ULP-Timer.
To stop the ULP-Timer instance.
To restart the ULP-Timer.
To set the ULP-Timer type.
To set the ULP-Timer direction.
To set the ULP-Timer mode as one-shot or periodic.
To set the ULP-Timer match value.
To get the ULP-Timer current count.
To get the ULP-Timer type.
To get the ULP-Timer mode.
To get the ULP-Timer direction (up-counter or down-counter).
To register the callback for the timer timeout interrupt and enable the interrupt.
To unregister the callback for the timer interrupt and disable its interrupts.
To configure and enable the SOC clock source for the timer.
To configure the XTAL clock when the clock source is an external XTAL clock.
To de-initialize the ULP-Timer clock by disabling the peripheral clock.
To get the ULP-Timer API version.
Macros#
default 1-second timer match-value for down-counter timer-type with 20Mhz clock
Static clock type for the ULP timer.
Dynamic clock type for the ULP timer.
Enumeration Documentation#
ulp_timer_instance_t#
ulp_timer_instance_t
Enumeration to represent ULP timer instances.
This enumeration defines the possible instances of the Ultra Low-Power (ULP) timer.
Enumerator | |
---|---|
ULP_TIMER_0 | ULP Timer 0 Instance. |
ULP_TIMER_1 | ULP Timer 1 Instance. |
ULP_TIMER_2 | ULP Timer 2 Instance. |
ULP_TIMER_3 | ULP Timer 3 Instance. |
ULP_TIMER_LAST | Last member of the enum for validation. |
73
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
ulp_timer_mode_t#
ulp_timer_mode_t
Enumeration to represent ULP timer modes.
This enumeration defines the possible modes for the Ultra Low-Power (ULP) timer.
Enumerator | |
---|---|
ULP_TIMER_MODE_ONESHOT | ULP Timer one-shot mode. |
ULP_TIMER_MODE_PERIODIC | ULP Timer periodic mode. |
ULP_TIMER_MODE_LAST | Last member of the enum for validation. |
87
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
ulp_timer_type_t#
ulp_timer_type_t
Enumeration to represent ULP timer types.
This enumeration defines the possible types for the Ultra Low-Power (ULP) timer.
Enumerator | |
---|---|
ULP_TIMER_TYP_DEFAULT | ULP Timer normal down counter type. |
ULP_TIMER_TYP_1US | ULP Timer one microsecond type. |
ULP_TIMER_TYP_256US | ULP Timer 256 microsecond type. |
ULP_TIMER_TYP_LAST | Last member of the enum for validation. |
99
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
ulp_timer_clk_input_source_t#
ulp_timer_clk_input_source_t
Enumeration to represent values of clock sources to select as Timer clock.
This enumeration defines the possible clock sources that can be selected as the timer clock for the Ultra Low-Power (ULP) timer.
Enumerator | |
---|---|
ULP_TIMER_REF_CLK_SRC | Reference clock input source. |
ULP_TIMER_32KHZ_RO_CLK_SRC | 32 kHz RO clock input source |
ULP_TIMER_32KHZ_RC_CLK_SRC | 32 kHz RC clock input source |
ULP_TIMER_32KHZ_XTAL_CLK_SRC | 32 kHz XTAL clock input source |
ULP_TIMER_MHZ_RC_CLK_SRC | 32 MHz RC clock input source |
ULP_TIMER_20MHZ_RO_CLK_SRC | 20 MHz RO clock input source |
ULP_TIMER_ULP_CLK_SRC_LAST | Last member of the enum for validation. |
112
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
Typedef Documentation#
ulp_timer_callback_t#
typedef void(* ulp_timer_callback_t) (void) )(void)
Typedef for the function pointer of the callback function.
62
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
ulp_timer_clock_t#
typedef CLK_ENABLE_T ulp_timer_clock_t
Renaming clock type enum.
64
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
ulp_timer_direction_t#
typedef ulp_timer_dir_t ulp_timer_direction_t
Renaming clock type enum.
65
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
Function Documentation#
sl_si91x_ulp_timer_init#
sl_status_t sl_si91x_ulp_timer_init (ulp_timer_clk_src_config_t * timer_clk_ptr)
To initialize the ULP-Timer by enabling its clock source.
[in] | timer_clk_ptr | Pointer to the timer clock configuration structure. |
This API configures the clock frequency, clock type, enables/disables synchronization to ULPSS pclk, and skips/allows waiting for timer clock switching.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Success, timer clock-source parameters configured properly.
SL_STATUS_INVALID_PARAMETER - Timer clock type or timer clock source values are invalid.
SL_STATUS_NULL_POINTER - The parameter is a null pointer
SL_STATUS_INVALID_CONFIGURATION - Timer clock-source configuration structure members have invalid configurations.
For more information on status codes, see SL STATUS DOCUMENTATION.
181
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_configure_clock#
sl_status_t sl_si91x_ulp_timer_configure_clock (ulp_timer_clk_src_config_t * timer_clk_ptr)
To configure and enable the ULP-Timer input clock source.
[in] | timer_clk_ptr | Pointer to the timer clock configuration structure ulp_timer_clk_src_config_t. |
This API configures the clock frequency, clock type, enables/disables synchronization to ULPSS pclk, and determines whether to skip/allow waiting for timer clock switching. This function is invoked within the sl_si91x_ulp_timer_init API.
Note
There are two XTAL clock sources: internal and external. To enable the external XTAL clock source, you must configure the UULP_GPIO pins using sl_si91x_ulp_timer_configure_xtal_clock, and it should be called first.
To use the SOC clock source, you need to use the sl_si91x_ulp_timer_configure_soc_clock API to configure the ULPSS SOC rather than the clock configuration API.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Success, timer clock-source parameters configured properly.
SL_STATUS_INVALID_PARAMETER - Timer clock type or timer clock source values are invalid.
SL_STATUS_NULL_POINTER - The parameter is a null pointer.
SL_STATUS_INVALID_CONFIGURATION - Timer clock-source configuration structure members have invalid configurations.
For more information on status codes, see SL STATUS DOCUMENTATION.
208
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_set_configuration#
sl_status_t sl_si91x_ulp_timer_set_configuration (ulp_timer_config_t * timer_config_ptr)
To configure the ULP-Timer parameters.
[in] | timer_config_ptr | Pointer to the timer configuration structure ulp_timer_config_t. |
This API configures the parameters such as timer number, mode, type, match value, and direction. Additionally, it configures the integral and fractional values of clock cycles per microsecond or per 256 microseconds as per the selected timer type.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Success, timer parameters are configured properly.
SL_STATUS_INVALID_PARAMETER - Timer configuration structure member 'timer_direction' has an invalid value.
SL_STATUS_NULL_POINTER - The parameter is a null pointer.
SL_STATUS_INVALID_MODE - Timer configuration structure member 'timer_mode' has an invalid value.
SL_STATUS_INVALID_TYPE - Timer configuration structure member 'timer_type' has an invalid value.
SL_STATUS_INVALID_INDEX - Timer configuration structure member 'timer_num' has an invalid value.
For more information on status codes, see SL STATUS DOCUMENTATION.
233
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_start#
sl_status_t sl_si91x_ulp_timer_start (ulp_timer_instance_t timer_num)
To start the ULP-Timer.
[in] | timer_num | Enum for ULP-timer number (0 to 3), see ulp_timer_instance_t for possible values. |
This API is used to start the Ultra Low-Power (ULP) timer.
Note
The timer instance must not be in a running state when calling this API.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully started the timer instance.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
256
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_stop#
sl_status_t sl_si91x_ulp_timer_stop (ulp_timer_instance_t timer_num)
To stop the ULP-Timer instance.
[in] | timer_num | Enum for ULP-timer number (0 to 3), see ulp_timer_instance_t for possible values. |
This API stops the Ultra Low-Power (ULP) timer instance but does not disable it. To disable the timer, use sl_si91x_ulp_timer_deinit.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully stopped the timer instance.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
278
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_restart#
sl_status_t sl_si91x_ulp_timer_restart (ulp_timer_instance_t timer_num)
To restart the ULP-Timer.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
This API restarts the Ultra Low-Power (ULP) timer instance. If the timer is running, it stops the timer first and then starts it again. If the timer is stopped, it simply starts the timer.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully restarted the timer instance.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
301
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_set_type#
sl_status_t sl_si91x_ulp_timer_set_type (ulp_timer_instance_t timer_num, ulp_timer_type_t timer_type)
To set the ULP-Timer type.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[in] | timer_type | Enum for ULP-timer type, see ulp_timer_type_t for possible values. |
This API sets the ULP-Timer type, which includes 256 µs, 1 µs, and count-down types.
1 microsecond type: The time unit is 1 µs.
256 microsecond type: The time unit is 256 µs.
Count-down timer type: The time unit is one clock cycle period.
Note
This API should be used when the timer is stopped.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully set the timer type.
SL_STATUS_INVALID_TYPE - 'timer_type' parameter value is invalid.
SL_STATUS_INVALID_INDEX - 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
328
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_set_direction#
sl_status_t sl_si91x_ulp_timer_set_direction (ulp_timer_instance_t timer_num, ulp_timer_direction_t timer_direction)
To set the ULP-Timer direction.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[in] | timer_direction | Enum for ULP-timer direction, see ulp_timer_direction_t for possible values. |
This API sets the Ultra Low-Power (ULP) timer direction as either up-counting or down-counting. By default, it operates as a down-counter.
Note
The API should be used when the timer is stopped.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully set the timer direction.
SL_STATUS_INVALID_PARAMETER - The 'timer_direction' parameter value is invalid.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
353
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_set_mode#
sl_status_t sl_si91x_ulp_timer_set_mode (ulp_timer_instance_t timer_num, ulp_timer_mode_t timer_mode)
To set the ULP-Timer mode as one-shot or periodic.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[in] | timer_mode | Enum for ULP-timer mode, see ulp_timer_mode_t for possible values. |
In a one-shot operation, the timer counts down to the timeout and then generates a single interrupt after which it returns to the idle state. In contrast, in periodic operation, the timer continuously generates interrupts at intervals equal to the timeout period.
Note
This API should be used before starting the timer.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully set the timer mode.
SL_STATUS_INVALID_MODE - The 'timer_mode' parameter value is invalid.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
379
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_set_count#
sl_status_t sl_si91x_ulp_timer_set_count (ulp_timer_instance_t timer_num, uint32_t timer_match_value)
To set the ULP-Timer match value.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[in] | timer_match_value | ULP-timer timeout value. |
When the timer reaches the match value and if the interrupt is enabled, it will generate an interrupt to the processor.
For one microsecond type, match value = number of microseconds.
For 256 microsecond type, match value = (time in microseconds) / 256.
For normal up/down counter type, timer = (number of clock cycles per microsecond * time in microseconds).
Note
The API should be used when the timer is stopped.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully set the timer match value.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
408
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_get_count#
sl_status_t sl_si91x_ulp_timer_get_count (ulp_timer_instance_t timer_num, uint32_t * count_value)
To get the ULP-Timer current count.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[out] | count_value | Pointer to the variable which will store the current count of the timer. |
If the counter is set to down-counting, the counter register bits indicate the time remaining until the timeout, initially read as 32'hFFFF_FFFF. If the counter is set to up-counting, these bits directly show the up-running counter/timer value. The timer current-count value is updated to the count-value variable provided by the user as the second argument.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully read the timer's current count value.
SL_STATUS_NULL_POINTER - The pointer to the 'count_value' parameter is a null pointer.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
433
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_get_type#
sl_status_t sl_si91x_ulp_timer_get_type (ulp_timer_instance_t timer_num, uint32_t * timer_type)
To get the ULP-Timer type.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[out] | timer_type | Pointer to the variable which will store the current type of the timer. |
This API updates the timer type value to the timer_type variable, passed as reference by the user.
'0' for down-counter type
'1' for 1us type
'2' for 256us type
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully read the timer's current type.
SL_STATUS_NULL_POINTER - The pointer to the 'timer_type' parameter is a null pointer.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
459
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_get_mode#
sl_status_t sl_si91x_ulp_timer_get_mode (ulp_timer_instance_t timer_num, uint32_t * timer_mode)
To get the ULP-Timer mode.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[out] | timer_mode | Pointer to the variable which will store the current mode of the timer, see ulp_timer_mode_t. |
Updates the timer mode value to the timer_mode variable, passed as reference by the user.
'0' for one-shot mode
'1' for periodic mode
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully read the timer's current mode.
SL_STATUS_NULL_POINTER - The pointer to the 'timer_mode' parameter is a null pointer.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
484
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_get_direction#
sl_status_t sl_si91x_ulp_timer_get_direction (ulp_timer_instance_t timer_num, uint32_t * timer_direction)
To get the ULP-Timer direction (up-counter or down-counter).
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[out] | timer_direction | Pointer to the variable which will store the current direction of the timer, see ulp_timer_direction_t. |
Updates the timer direction to the timer_direction variable, passed as reference by the user.
'0' for down-counting
'1' for up-counting
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully read the timer's current direction.
SL_STATUS_NULL_POINTER - The pointer to 'timer_direction' parameter is a null pointer.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
509
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_register_timeout_callback#
sl_status_t sl_si91x_ulp_timer_register_timeout_callback (ulp_timer_instance_t timer_num, ulp_timer_callback_t on_timeout_callback)
To register the callback for the timer timeout interrupt and enable the interrupt.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
[in] | on_timeout_callback | Function pointer to the callback function to be called when the timer timeout interrupt occurs. |
This API registers the callback function for the timer timeout interrupt and enables the interrupt for the specified timer instance. If a callback is already registered, the user must first unregister the existing callback before registering a new one. Otherwise, it will return a SL_STATUS_BUSY error.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully registered the timer timeout callback.
SL_STATUS_BUSY - The callback is already registered, unregister the previous callback before registering a new one.
SL_STATUS_ALLOCATION_FAILED - Timer interrupt enabling failed.
SL_STATUS_NULL_POINTER - The pointer to 'callback_data_input' parameter is a null pointer.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
531
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_unregister_timeout_callback#
sl_status_t sl_si91x_ulp_timer_unregister_timeout_callback (ulp_timer_instance_t timer_num)
To unregister the callback for the timer interrupt and disable its interrupts.
[in] | timer_num | Enum for ULP-timer number, see ulp_timer_instance_t for possible values. |
This API is used to unregister the existing callback interrupt for the specified timer instance.
Pre-conditions:
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Successfully unregistered the timer timeout callback.
SL_STATUS_ALLOCATION_FAILED - Timer interrupt disabling failed.
SL_STATUS_INVALID_INDEX - The 'timer_num' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
552
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_configure_soc_clock#
sl_status_t sl_si91x_ulp_timer_configure_soc_clock (boolean_t div_factor_type, uint16_t div_factor)
To configure and enable the SOC clock source for the timer.
[in] | div_factor_type | Value to divide the clock. Ensure that it should be an odd number if |
[in] | div_factor | Selects the type of divider for
|
This API is used to select the ULPSS processor clock source as the timer input clock source, which is greater than 100MHz (used for high-power mode). If div_factor_type
value is 1, the div_factor
should be an odd number; otherwise, it will throw an error. The div_factor_type
selects the type of divider for m4_soc_clk_2ulpss
:
'0' Even Divider is selected
'1' Odd Divider is selected Use this API in place of the timer init API.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Success.
SL_STATUS_INVALID_PARAMETER - The 'div_factor' is not valid according to
div_factor_type
.
For more information on status codes, see SL STATUS DOCUMENTATION.
578
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_configure_xtal_clock#
sl_status_t sl_si91x_ulp_timer_configure_xtal_clock (uint8_t xtal_pin)
To configure the XTAL clock when the clock source is an external XTAL clock.
[in] | xtal_pin | Pin number of UULP_GPIO. Possible values are 0 to 4. |
This API enables the external XTAL clock source. It needs to be called before calling the sl_si91x_ulp_timer_configure_clock API.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK - Success.
SL_STATUS_INVALID_PARAMETER - The 'xtal_pin' parameter value is invalid.
For more information on status codes, see SL STATUS DOCUMENTATION.
595
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_deinit#
void sl_si91x_ulp_timer_deinit (void )
To de-initialize the ULP-Timer clock by disabling the peripheral clock.
N/A |
This API disables the peripheral clock for the ULP-Timer and unregisters the callback for all timer instances.
Note
Unregisters the callbacks of all timer instances.
610
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
sl_si91x_ulp_timer_get_version#
sl_ulp_timer_version_t sl_si91x_ulp_timer_get_version (void )
To get the ULP-Timer API version.
N/A |
This API is used to retrieve the version information of the ULP-Timer API.
Returns
sl_ulp_timer_version_t The version of the ULP-Timer API.
620
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
Macro Definition Documentation#
SL_TIMER_MATCH_VALUE_DEFAULT#
#define SL_TIMER_MATCH_VALUE_DEFAULTValue:
20000000
default 1-second timer match-value for down-counter timer-type with 20Mhz clock
53
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
SL_ULP_TIMER_CLK_TYPE_STATIC#
#define SL_ULP_TIMER_CLK_TYPE_STATICValue:
1
Static clock type for the ULP timer.
55
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h
SL_ULP_TIMER_CLK_TYPE_DYNAMIC#
#define SL_ULP_TIMER_CLK_TYPE_DYNAMICValue:
0
Dynamic clock type for the ULP timer.
56
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_ulp_timer.h