button.h 449 B

12345678910111213141516
  1. #ifndef BUTTON_H_INCLUDED
  2. #define BUTTON_H_INCLUDED
  3. #include "unicore-mx/stm32/gpio.h"
  4. static const uint32_t Channel[5] = { 8, 9, 7, 6, 5 };
  5. static const uint32_t Channel_Pin[5] = { GPIO8, GPIO9, GPIO7, GPIO6, GPIO5 };
  6. static const char Channel_name[5][16] = { "Red", "Purple", "Green", "Blue", "Yellow" };
  7. void button_init(void);
  8. int button_poll(void (*callback)(uint8_t press, int hold));
  9. int input_get_swr(void);
  10. #define N_BUTTONS 2
  11. #endif