mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'feat/tsens_intr_priority_configurable' into 'master'
feat(tsens): support configurable interrupt priority Closes IDF-7960 See merge request espressif/esp-idf!51413
This commit is contained in:
@@ -39,6 +39,7 @@ In order to install a built-in temperature sensor instance, the first thing is t
|
||||
|
||||
- :cpp:member:`range_min`: The minimum value of the testing range you have evaluated.
|
||||
- :cpp:member:`range_max`: The maximum value of the testing range you have evaluated.
|
||||
- :cpp:member:`temperature_sensor_config_t::intr_priority` sets the interrupt priority. If it is set to ``0``, the driver will allocate an interrupt with a default low or medium priority (1, 2, or 3). Otherwise, use the priority number 1, 2, or 3, not the bitmask.
|
||||
- :cpp:member:`allow_pd` configures if the driver allows the system to power down the peripheral in light sleep mode. Before entering sleep, the system will backup the temperature sensor register context, which will be restored later when the system exit the sleep mode. Powering down the peripheral can save more power, but at the cost of more memory consumed to save the register context. It's a tradeoff between power consumption and memory consumption. This configuration option relies on specific hardware feature, if you enable it on an unsupported chip, you will see error message like ``not able to power down in light sleep``.
|
||||
|
||||
After the ranges are set, the structure could be passed to :cpp:func:`temperature_sensor_install`, which will instantiate the temperature sensor instance and return a handle.
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
- :cpp:member:`range_min`:所测量温度范围的最小值。
|
||||
- :cpp:member:`range_max`:所测量温度范围的最大值。
|
||||
- :cpp:member:`temperature_sensor_config_t::intr_priority`:设置中断优先级。设置为 ``0`` 时,驱动程序将分配默认的低或中优先级中断(优先级 1、2 或 3)。如需指定优先级,请使用数值 1、2 或 3,而不是位掩码。
|
||||
- :cpp:member:`allow_pd` 配置驱动程序是否允许系统在睡眠模式下关闭外设电源。在进入睡眠之前,系统将备份温度传感器寄存器上下文,当系统退出睡眠模式时,这些上下文将被恢复。关闭外设可以节省更多功耗,但代价是消耗更多内存来保存寄存器上下文。你需要在功耗和内存消耗之间做权衡。此配置选项依赖于特定的硬件功能,如果在不支持的芯片上启用它,你将看到类似 ``not able to power down in light sleep`` 的错误消息。
|
||||
|
||||
设置好温度范围后,将配置结构体传递给 :cpp:func:`temperature_sensor_install`,该函数将创建温度传感器模块并返回句柄。
|
||||
|
||||
Reference in New Issue
Block a user