14 #include "adc_ctrl_regs.h"
19 if (adc_ctrl == NULL) {
30 if (adc_ctrl == NULL) {
37 alert_idx = ADC_CTRL_ALERT_TEST_FATAL_FAULT_BIT;
45 (ptrdiff_t)ADC_CTRL_ALERT_TEST_REG_OFFSET,
58 *index_out = ADC_CTRL_INTR_COMMON_MATCH_PENDING_BIT;
75 if (adc_ctrl == NULL || type == NULL ||
80 *type = irq_types[irq];
89 if (adc_ctrl == NULL || snapshot == NULL) {
93 *snapshot = mmio_region_read32(adc_ctrl->
base_addr,
94 (ptrdiff_t)ADC_CTRL_INTR_STATE_REG_OFFSET);
103 if (adc_ctrl == NULL) {
108 (ptrdiff_t)ADC_CTRL_INTR_STATE_REG_OFFSET, snapshot);
117 if (adc_ctrl == NULL || is_pending == NULL) {
122 if (!adc_ctrl_get_irq_bit_index(irq, &index)) {
126 uint32_t intr_state_reg = mmio_region_read32(
127 adc_ctrl->
base_addr, (ptrdiff_t)ADC_CTRL_INTR_STATE_REG_OFFSET);
136 if (adc_ctrl == NULL) {
142 (ptrdiff_t)ADC_CTRL_INTR_STATE_REG_OFFSET, UINT32_MAX);
150 if (adc_ctrl == NULL) {
155 if (!adc_ctrl_get_irq_bit_index(irq, &index)) {
162 (ptrdiff_t)ADC_CTRL_INTR_STATE_REG_OFFSET,
171 if (adc_ctrl == NULL) {
176 if (!adc_ctrl_get_irq_bit_index(irq, &index)) {
182 (ptrdiff_t)ADC_CTRL_INTR_TEST_REG_OFFSET, intr_test_reg);
191 if (adc_ctrl == NULL || state == NULL) {
196 if (!adc_ctrl_get_irq_bit_index(irq, &index)) {
200 uint32_t intr_enable_reg = mmio_region_read32(
201 adc_ctrl->
base_addr, (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET);
213 if (adc_ctrl == NULL) {
218 if (!adc_ctrl_get_irq_bit_index(irq, &index)) {
222 uint32_t intr_enable_reg = mmio_region_read32(
223 adc_ctrl->
base_addr, (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET);
228 (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET,
238 if (adc_ctrl == NULL) {
243 if (snapshot != NULL) {
244 *snapshot = mmio_region_read32(adc_ctrl->
base_addr,
245 (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET);
250 (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET, 0u);
259 if (adc_ctrl == NULL || snapshot == NULL) {
264 (ptrdiff_t)ADC_CTRL_INTR_ENABLE_REG_OFFSET, *snapshot);