
#include <stddef.h>
// #include "RTE.h"
#include "BU91R65.h"
// #include "RTE_GPIO_R7F7016843.h"

BU91R65_Handler_st_t g_stBU91R65Chip0;
// uint8_t g_u8BU91R65Chip0Buffer[BU91R65_BUFFER_SIZE];
BU91R65DDRAMUnion g_stBU91R65Chip0Seg;

BU91R65_Handler_st_t g_stBU91R65Chip1;
// uint8_t g_u8BU91R65Chip1Buffer[BU91R65_BUFFER_SIZE];
BU91R65DDRAMUnion g_stBU91R65Chip1Seg;

// BU91R65_Handler_st_t g_stBU98R10Chip2;
// uint8_t g_u8BU98R10Chip2Buffer[BU91R65_BUFFER_SIZE];
// BU91R65DDRAMUnion g_stBU98R10Chip2Seg;

void BU91R65_Register(void)
{
    BU91R65_Config_st_t stConfig;

    /* Power on */
    //BU98R10_GPIO_Request(RTE_GPIO_PORT06_PIN02);/*不一定需要*/

    BU91R65_Init(1UL);//Trim到200-400khz

    stConfig.u8DefaultVal           = 0x00U;
    stConfig.u8FrameFreq            = BU98R10_FRAME_FREQ_120_0_Hz;
    stConfig.u16PinCS               = BU91R65_Chip0_Set_nCS;
    stConfig.u16PinSCLK             = BU91R65_Chip0_Set_SCLK;
    stConfig.u16PinSD               = BU91R65_Chip0_Set_SD;
    // stConfig.stColorSetting.u8SRR   = 7U;
    // stConfig.stColorSetting.u8SRF   = 0U;
    // stConfig.stColorSetting.u8SGR   = 7U;
    // stConfig.stColorSetting.u8SGF   = 0U;
    // stConfig.stColorSetting.u8SBR   = 7U;
    // stConfig.stColorSetting.u8SBF   = 0U;
    // stConfig.stColorSetting.u8LRS   = 0U;
    // stConfig.stColorSetting.u8LRW   = 47U;
    // stConfig.stColorSetting.u8LGS   = 0U;
    // stConfig.stColorSetting.u8LGW   = 47U;
    // stConfig.stColorSetting.u8LBS   = 0U;
    // stConfig.stColorSetting.u8LBW   = 47U;
    stConfig.pu8Buffer              = &g_stBU91R65Chip0Seg;
    
    BU91R65_Add(&g_stBU91R65Chip0, &stConfig);
    
    stConfig.u16PinCS               = BU91R65_Chip1_Set_nCS;
    stConfig.u16PinSCLK             = BU91R65_Chip1_Set_SCLK;
    stConfig.u16PinSD               = BU91R65_Chip1_Set_SD;
    stConfig.pu8Buffer              = &g_stBU91R65Chip1Seg;
    BU91R65_Add(&g_stBU91R65Chip1, &stConfig);

    // stConfig.u16PinCS               = RTE_GPIO_PORT11_PIN07;
    // stConfig.u16PinSCLK             = RTE_GPIO_PORT11_PIN04;
    // stConfig.u16PinSD               = RTE_GPIO_PORT10_PIN10;
    // stConfig.pu8Buffer              = &g_stBU98R10Chip2Seg;
    // BU91R65_Add(&g_stBU98R10Chip2, &stConfig);
}




