Files
esp-idf/components/hal/sdm_hal.c

26 lines
652 B
C
Raw Normal View History

2022-05-17 13:47:14 +08:00
/*
2025-08-07 10:55:52 +08:00
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
2022-05-17 13:47:14 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "hal/sdm_ll.h"
#include "hal/sdm_hal.h"
2025-08-07 10:55:52 +08:00
void sdm_hal_init(sdm_hal_context_t *hal, const sdm_hal_init_config_t *config)
{
hal->dev = SDM_LL_GET_HW(config->group_id);
// enable clock
// note that, this will enables all the channels' output, and channel can't be disable/enable separately
sdm_ll_enable_clock(hal->dev, true);
}
void sdm_hal_deinit(sdm_hal_context_t *hal)
2022-05-17 13:47:14 +08:00
{
2025-08-07 10:55:52 +08:00
if (hal && hal->dev) {
// disable clock
sdm_ll_enable_clock(hal->dev, false);
hal->dev = NULL;
}
2022-05-17 13:47:14 +08:00
}