mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(temperature_sensor): Add temperature sensor sleep retention support on esp32h4
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/regdma.h"
|
||||
#include "soc/apb_saradc_reg.h"
|
||||
#include "temperature_sensor_private.h"
|
||||
|
||||
// Temperature sensor sleep retention entries
|
||||
// Temperature sensor registers require set the reg_update bit to make the configuration take effect
|
||||
|
||||
/* Temperature sensor Registers Context
|
||||
Include: APB_SARADC_INT_ENA_REG /
|
||||
APB_SARADC_APB_TSENS_CTRL_REG / APB_SARADC_TSENS_CTRL2_REG / APB_TSENS_WAKE_REG / APB_TSENS_SAMPLE_REG
|
||||
*/
|
||||
#define TEMPERATURE_SENSOR_RETENTION_REGS_CNT 5
|
||||
#define TEMPERATURE_SENSOR_RETENTION_MAP_BASE APB_SARADC_INT_ENA_REG
|
||||
static const uint32_t temperature_sensor_regs_map[4] = {0x6c1, 0, 0, 0};
|
||||
static const regdma_entries_config_t temperature_sensor_regs_entries[] = {
|
||||
[0] = {
|
||||
.config = REGDMA_LINK_ADDR_MAP_INIT(REGDMA_TSENS_LINK(0x00), TEMPERATURE_SENSOR_RETENTION_MAP_BASE, TEMPERATURE_SENSOR_RETENTION_MAP_BASE, TEMPERATURE_SENSOR_RETENTION_REGS_CNT, 0, 0, temperature_sensor_regs_map[0], temperature_sensor_regs_map[1], temperature_sensor_regs_map[2], temperature_sensor_regs_map[3]), \
|
||||
.owner = ENTRY(0) | ENTRY(2)
|
||||
}, \
|
||||
};
|
||||
|
||||
const temperature_sensor_reg_ctx_link_t temperature_sensor_regs_retention = {
|
||||
.link_list = temperature_sensor_regs_entries,
|
||||
.link_num = ARRAY_SIZE(temperature_sensor_regs_entries),
|
||||
.module_id = SLEEP_RETENTION_MODULE_TEMP_SENSOR,
|
||||
};
|
||||
Reference in New Issue
Block a user