@@ -172,6 +172,9 @@ typedef pio_hw_t *PIO;
172
172
*/
173
173
#ifndef PIO_NUM
174
174
static_assert (PIO1_BASE - PIO0_BASE == (1u << 20 ), "hardware layout mismatch" );
175
+ #if NUM_PIOS > 2
176
+ static_assert (PIO2_BASE - PIO0_BASE == (2u << 20 ), "hardware layout mismatch" );
177
+ #endif
175
178
#define PIO_NUM (pio ) (((uintptr_t)(pio) - PIO0_BASE) >> 20)
176
179
#endif
177
180
@@ -185,6 +188,9 @@ static_assert(PIO1_BASE - PIO0_BASE == (1u << 20), "hardware layout mismatch");
185
188
*/
186
189
#ifndef PIO_INSTANCE
187
190
static_assert (PIO1_BASE - PIO0_BASE == (1u << 20 ), "hardware layout mismatch" );
191
+ #if NUM_PIOS > 2
192
+ static_assert (PIO2_BASE - PIO0_BASE == (2u << 20 ), "hardware layout mismatch" );
193
+ #endif
188
194
#define PIO_INSTANCE (instance ) ((pio_hw_t *)(PIO0_BASE + (instance) * (1u << 20)))
189
195
#endif
190
196
@@ -214,8 +220,13 @@ static_assert(DREQ_PIO0_TX1 == DREQ_PIO0_TX0 + 1, "");
214
220
static_assert (DREQ_PIO0_TX2 == DREQ_PIO0_TX0 + 2 , "" );
215
221
static_assert (DREQ_PIO0_TX3 == DREQ_PIO0_TX0 + 3 , "" );
216
222
static_assert (DREQ_PIO0_RX0 == DREQ_PIO0_TX0 + NUM_PIO_STATE_MACHINES , "" );
223
+ static_assert (DREQ_PIO1_TX0 == DREQ_PIO0_RX0 + NUM_PIO_STATE_MACHINES , "" );
217
224
static_assert (DREQ_PIO1_RX0 == DREQ_PIO1_TX0 + NUM_PIO_STATE_MACHINES , "" );
218
- #define PIO_DREQ_NUM (pio , sm , is_tx ) ((sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))
225
+ #if NUM_PIOS > 2
226
+ static_assert (DREQ_PIO2_TX0 == DREQ_PIO1_RX0 + NUM_PIO_STATE_MACHINES , "" );
227
+ static_assert (DREQ_PIO2_RX0 == DREQ_PIO2_TX0 + NUM_PIO_STATE_MACHINES , "" );
228
+ #endif
229
+ #define PIO_DREQ_NUM (pio , sm , is_tx ) (DREQ_PIO0_TX0 + (sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))
219
230
#endif
220
231
221
232
/**
0 commit comments