First the matching
The #ifndef CONFIGURE_H matches the #endif at the bottom of the file
The other #ifdefs match with the #endif 2 line below them
#ifdef CONFIGURE_H is there to make sure the heaader file is not included twice
for example if your code is
The second inlcude will be ignored because CONFIGURE_H was defined by the first include, and the #ifndef CONFIGURE_H will be false, so nothing will be included.
The #ifdef __cplusplus is there to make sure that if the initilaizePeripherals function is part of a c++ application, the compiler knows this is a C function.