I believe I've understood the concept of interrupt and how to initialize it, but I've seen in various places where they would first AND (select) the NVIC_PR registers against F bits before (ORing) the priority bits. For example in TM4C123 GPIO Port Interrupt Programming there was this line towards the end:
NVIC_PRI7_R = (NVIC_PRI7_R & 0xFF00FFFF) | 0x00A00000 The purpose is to set Port F interrupt a priority of 5 (by setting the top 3 bits [23:21] to the value; hence .1010. or 0xA to represent the a value of 5). So, why can't I just do this instead?
NVIC_PRI7_R |= 0x00A00000 What is & 0xFF00FFFF doing here? Why do I want to clear bits [23:16] before OR-ing priority bits [23:21]? The bits between [20:16] are not used anyway.