You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
621 B

1 year ago
  1. #include "light_ctrl_service.h"
  2. zaf_gpio_t rlight;
  3. zaf_gpio_t glight;
  4. zaf_gpio_t blight;
  5. void LightCtrlService_init() {
  6. zaf_gpio_init_as_output(&rlight, LED_R_PIN, kxs_gpio_nopull, true, false);
  7. zaf_gpio_init_as_output(&glight, LED_G_PIN, kxs_gpio_nopull, true, false);
  8. zaf_gpio_init_as_output(&blight, LED_B_PIN, kxs_gpio_nopull, true, false);
  9. }
  10. void LightCtrlService_RedLight_setState(bool state) { zaf_gpio_write(&rlight, state); }
  11. void LightCtrlService_BlueLight_setState(bool state) { zaf_gpio_write(&blight, state); }
  12. void LightCtrlService_GreenLight_setState(bool state) { zaf_gpio_write(&glight, state); }