18 lines
406 B
C
18 lines
406 B
C
#pragma once
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#define TYPE_ESP32C3_ADC "esp32c3.adc"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(ESP32C3AdcState, ESP32C3_ADC)
|
|
|
|
#define ESP32C3_ADC_CHANNELS 10
|
|
#define ESP32C3_ADC_IO_SIZE 0x1000
|
|
|
|
struct ESP32C3AdcState {
|
|
SysBusDevice parent_obj;
|
|
MemoryRegion iomem;
|
|
uint32_t regs[ESP32C3_ADC_IO_SIZE / sizeof(uint32_t)];
|
|
uint32_t input[ESP32C3_ADC_CHANNELS];
|
|
uint8_t channel;
|
|
};
|