refactor: split pheripherals to separate library
fix: add missing include guards
feat: add input handling functions