First, when looking for a channel, first loop through all mapped channels to see if the GPIO was already mapped. This prevents a single GPIO being configured for more than one channel at a time. Second, do not use a GPIOTE channel if the channel is already in use (e.g., by a library, sketch, or other code outside the Board Support Package).