Throughout twi_hw_master.c, there are lots of places where the code directly accesses PPI channel #0 and thus assumes it's available, as in:
NRF_PPI->CH[0].TEP = (uint32_t)&NRF_TWI1->TASKS_STOP;
Later on, if I invoke nrf_drv_ppi_channel_alloc() to use one of the PPI channels for something in my own application, that function will initially return channel #0, which in incorrect since that entry is already taken by the TWI master.
This seems like a bug. It seems like nrf_drv_ppi_channel_alloc() should look at each of the EEP/TEP registers to find which channels are actually allocated, rather than rely the m_channels_allocated bitmask. It also seems like TWI HW Master should use nrf_drv_ppi_channel_alloc() to prevent these collisions. This is in SDK v8.0.0. Thoughts?