1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp8266/periph/adc.c

56 lines
1020 B
C
Raw Normal View History

2018-09-05 02:39:50 +02:00
/*
2019-09-05 13:35:58 +02:00
* Copyright (C) 2019 Gunar Schorcht
2018-09-05 02:39:50 +02:00
*
* 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_esp8266
* @ingroup drivers_periph_adc
* @{
*
* @file
* @brief Low-level ADC driver implementation
*
* @author Gunar Schorcht <gunar@schorcht.net>
*
* @}
*/
#include "cpu.h"
#include "mutex.h"
#include "periph/adc.h"
#include "periph_conf.h"
#include "board.h"
2019-09-05 13:35:58 +02:00
#include "esp_common.h"
2018-09-05 02:39:50 +02:00
#include "sdk/sdk.h"
#define ENABLE_DEBUG 0
#include "debug.h"
2019-09-05 13:35:58 +02:00
extern uint16_t test_tout(void);
2018-09-05 02:39:50 +02:00
int adc_init(adc_t line)
{
CHECK_PARAM_RET (line < ADC_NUMOF, -1)
/* no special initialization needed */
2018-09-05 02:39:50 +02:00
return 0;
}
int32_t adc_sample(adc_t line, adc_res_t res)
2018-09-05 02:39:50 +02:00
{
CHECK_PARAM_RET (line < ADC_NUMOF, -1)
CHECK_PARAM_RET (res == ADC_RES_10BIT, -1)
2019-09-05 13:35:58 +02:00
return test_tout();
2018-09-05 02:39:50 +02:00
}
2019-09-05 13:35:58 +02:00
void adc_print_config(void)
{
printf("\tADC\t\tpins=[ A0 ]\n");
}