Added GPIO-related constants and some internal logic