/**
* @file WS2812_ATY.h
*
* @param Project DEVICE_DRIVER_ATY_LIB
*
* @author ATY
*
* @copyright
* - Copyright 2017 - 2026 MZ-ATY
* - This code follows:
* - MZ-ATY Various Contents Joint Statement -
*
* https://mengze.top/MZ-ATY_VCJS
* - CC 4.0 BY-NC-SA -
*
* https://creativecommons.org/licenses/by-nc-sa/4.0/
* - Your use will be deemed to have accepted the terms of this statement.
*
* @brief functions of WS2812 for C platform
*
* @version
* - 1_01_251112 > ATY
* -# Refactor to Dev-style; remove legacy global interfaces
* - 1_02_251218 > ATY
* -# Refactor all
********************************************************************************
*/
#ifndef __WS2812_ATY_H
#define __WS2812_ATY_H
#include "INCLUDE_ATY.h"
/******************************* For user *************************************/
/******************************************************************************/
struct WS2812_ATY_Dev{
uint8_t (*set)(uint8_t* buffer, uint8_t count);
uint8_t count;
uint8_t* buffer;
float brightness; // 0.0 - 1.0
uint8_t code0;
uint8_t code1;
uint8_t autoUpdate;
uint8_t lock;
};
uint8_t WS2812_Flush(struct WS2812_ATY_Dev* dev);
void WS2812_GetRGB(struct WS2812_ATY_Dev* dev, uint16_t index, uint8_t* R, uint8_t* G, uint8_t* B);
uint8_t WS2812_Fill(struct WS2812_ATY_Dev* dev, uint8_t R, uint8_t G, uint8_t B);
uint8_t WS2812_SetPixel(struct WS2812_ATY_Dev* dev, uint16_t index, uint8_t R, uint8_t G, uint8_t B);
uint8_t WS2812_GetPixel(struct WS2812_ATY_Dev* dev, uint16_t index, uint8_t* R, uint8_t* G, uint8_t* B);
uint8_t WS2812_Clear(struct WS2812_ATY_Dev* dev);
#endif /* __WS2812_ATY_H */
/******************************** End Of File *********************************/