hal_ws2812.h 1.8 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef __hal_ws2812_h__
  2. #define __hal_ws2812_h__
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <string.h>
  6. #include "sdk_common.h"
  7. #include "SEGGER_RTT.h"
  8. #include "usr_config.h"
  9. #define WS_L nrf_gpio_pin_write(PIN_SEL,1);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0)
  10. #define WS_H nrf_gpio_pin_write(PIN_SEL,1);nrf_gpio_pin_write(PIN_SEL,1);nrf_gpio_pin_write(PIN_SEL,1);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0);nrf_gpio_pin_write(PIN_SEL,0)
  11. #define WS_GREEN WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L
  12. #define WS_RED WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L
  13. #define WS_BLUE WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H
  14. #define WS_WHITE WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H;WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H;WS_L;WS_L;WS_L;WS_L;WS_H;WS_H;WS_H;WS_H
  15. #define WS_BLACK WS_L;WS_L;WS_L;WS_L;WS_L;WS_L;WS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