platform_linux.h 797 B

12345678910111213141516171819202122232425
  1. /* What the real-hardware frontends share: key events and the backlight. */
  2. #ifndef RADIO_PLATFORM_LINUX_H
  3. #define RADIO_PLATFORM_LINUX_H
  4. #include <stdbool.h>
  5. #include "app.h"
  6. #define DEFAULT_KEYS_NAME "radio-keys"
  7. #define DEFAULT_BACKLIGHT "/sys/class/backlight/radio-backlight/brightness"
  8. /*
  9. * Feed key presses from an evdev device into the app. path may be NULL to
  10. * look for the input device named DEFAULT_KEYS_NAME. Returns false, leaving
  11. * the UI display-only, if there is none.
  12. */
  13. bool platform_keys_start(struct app *app, const char *path);
  14. /* Write to a sysfs brightness file; a NULL path does nothing. */
  15. void platform_backlight_set(const char *path, bool on);
  16. /* Run the GLib main loop until SIGINT or SIGTERM. */
  17. void platform_run(void);
  18. #endif /* RADIO_PLATFORM_LINUX_H */