1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

cpu/esp32: remove ESP-IDF dac interface API

This commit is contained in:
Gunar Schorcht 2023-03-27 01:36:35 +02:00
parent d93972c369
commit 5fac30bc9a
3 changed files with 4 additions and 93 deletions

View File

@ -1,41 +0,0 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_esp32_esp_idf_api
* @{
*
* @file
* @brief Interface for the ESP-IDF DAC HAL API
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @}
*/
#ifdef MODULE_PERIPH_DAC
#include <stdbool.h>
#include "driver/dac_common.h"
esp_err_t esp_idf_dac_output_voltage(dac_channel_t channel, uint8_t dac_value)
{
return dac_output_voltage(channel, dac_value);
}
esp_err_t esp_idf_dac_output_enable(dac_channel_t channel)
{
return dac_output_enable(channel);
}
esp_err_t esp_idf_dac_output_disable(dac_channel_t channel)
{
return dac_output_disable(channel);
}
#endif

View File

@ -1,47 +0,0 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_esp32_esp_idf_api
* @{
*
* @file
* @brief Interface for the ESP-IDF DAC HAL API
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @}
*/
#ifndef ESP_IDF_API_DAC_H
#define ESP_IDF_API_DAC_H
#include "esp_err.h"
#include "hal/dac_types.h"
#ifndef DOXYGEN /* Hide implementation details from doxygen */
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name ESP-IDF interface wrapper functions
* @{
*/
esp_err_t esp_idf_dac_output_voltage(dac_channel_t channel, uint8_t dac_value);
esp_err_t esp_idf_dac_output_enable(dac_channel_t channel);
esp_err_t esp_idf_dac_output_disable(dac_channel_t channel);
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* DOXYGEN */
#endif /* ESP_IDF_API_DAC_H */

View File

@ -23,8 +23,8 @@
#include "periph/dac.h"
#include "esp_common.h"
#include "driver/dac_common.h"
#include "soc/dac_periph.h"
#include "esp_idf_api/dac.h"
#define ENABLE_DEBUG 0
#include "debug.h"
@ -61,22 +61,21 @@ void dac_set(dac_t line, uint16_t value)
{
assert(line < DAC_NUMOF);
assert(_dac_channels[line] != DAC_CHANNEL_MAX);
esp_idf_dac_output_voltage(_dac_channels[line],
value >> (16 - SOC_DAC_RESOLUTION));
dac_output_voltage(_dac_channels[line], value >> (16 - SOC_DAC_RESOLUTION));
}
void dac_poweroff(dac_t line)
{
assert(line < DAC_NUMOF);
assert(_dac_channels[line] != DAC_CHANNEL_MAX);
esp_idf_dac_output_disable(_dac_channels[line]);
dac_output_disable(_dac_channels[line]);
}
void dac_poweron(dac_t line)
{
assert(line < DAC_NUMOF);
assert(_dac_channels[line] != DAC_CHANNEL_MAX);
esp_idf_dac_output_enable(_dac_channels[line]);
dac_output_enable(_dac_channels[line]);
}
static bool _dac_conf_check(void)