14 #include "pattgen_regs.h"
18 if (pattgen == NULL) {
29 if (pattgen == NULL) {
36 alert_idx = PATTGEN_ALERT_TEST_FATAL_FAULT_BIT;
44 (ptrdiff_t)PATTGEN_ALERT_TEST_REG_OFFSET, alert_test_reg);
56 *index_out = PATTGEN_INTR_COMMON_DONE_CH0_BIT;
59 *index_out = PATTGEN_INTR_COMMON_DONE_CH1_BIT;
77 if (pattgen == NULL || type == NULL || irq < 0 ||
82 *type = irq_types[irq];
90 if (pattgen == NULL || snapshot == NULL) {
94 *snapshot = mmio_region_read32(pattgen->
base_addr,
95 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET);
103 if (pattgen == NULL) {
108 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, snapshot);
117 if (pattgen == NULL || is_pending == NULL) {
122 if (!pattgen_get_irq_bit_index(irq, &index)) {
126 uint32_t intr_state_reg = mmio_region_read32(
127 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET);
136 if (pattgen == NULL) {
142 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, UINT32_MAX);
150 if (pattgen == NULL) {
155 if (!pattgen_get_irq_bit_index(irq, &index)) {
162 (ptrdiff_t)PATTGEN_INTR_STATE_REG_OFFSET, intr_state_reg);
170 if (pattgen == NULL) {
175 if (!pattgen_get_irq_bit_index(irq, &index)) {
181 (ptrdiff_t)PATTGEN_INTR_TEST_REG_OFFSET, intr_test_reg);
190 if (pattgen == NULL || state == NULL) {
195 if (!pattgen_get_irq_bit_index(irq, &index)) {
199 uint32_t intr_enable_reg = mmio_region_read32(
200 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
212 if (pattgen == NULL) {
217 if (!pattgen_get_irq_bit_index(irq, &index)) {
221 uint32_t intr_enable_reg = mmio_region_read32(
222 pattgen->
base_addr, (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
227 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET,
236 if (pattgen == NULL) {
241 if (snapshot != NULL) {
242 *snapshot = mmio_region_read32(pattgen->
base_addr,
243 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET);
248 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET, 0u);
257 if (pattgen == NULL || snapshot == NULL) {
262 (ptrdiff_t)PATTGEN_INTR_ENABLE_REG_OFFSET, *snapshot);