#include "app_Telltales.h"
#include "IS31FL3236.h"


typedef struct
{
    uint8_t ICNum;
    uint8_t Chl;
}s_IS31FL3236_LED_Channel_t;

const s_IS31FL3236_LED_Channel_t IS31FL3236_LED_Channel[LED_MAX] = 
{
    /* LED_Save0 = 0,       */  0,  0,
    /* LED_Save1,           */  0,  1,
    /* LED_Save2,           */  0,  2,
    /* LED_Save3,           */  0,  3,
    /* LED_Save4,           */  0,  4,
    /* LED_OBD,             */  0,  5,
    /* LED_Left,            */  0,  6,
    /* LED_HighBeam,        */  0,  7,
    /* LED_ABS,             */  0,  8,
    /* LED_AutoStartStop,   */  0,  9,
    /* LED_Right,           */  0,  10,
    /* LED_TLight,          */  0,  11,
    /* LED_ALight,          */  0,  12,
    /* LED_Temp_R,          */  0,  13,
    /* LED_Temp_W,          */  0,  14,
    /* LED_Battery,         */  0,  15,
    /* LED_TirePressure,    */  0,  16,
    /* LED_Save5,           */  0,  17,
    /* LED_Save6,           */  0,  18,
    /* LED_Save7,           */  0,  19,
    /* LED_Save8,           */  0,  20,
    /* LED_Save9,           */  0,  21,
    /* LED_Save10,          */  0,  22,
    /* LED_OilPressure,     */  0,  23,
    /* LED_Fuel_W,          */  0,  24,
    /* LED_Save11,          */  0,  25,
    /* LED_Fuel_Y,          */  0,  26,
    /* LED_Save12,          */  0,  27,
    /* LED_Save13,          */  0,  28,
    /* LED_Save14,          */  0,  29,
    /* LED_Save15,          */  0,  30,
    /* LED_Save16,          */  0,  31,
    /* LED_Save17,          */  0,  32,
    /* LED_READY,           */  0,  33,
    /* LED_Save18,          */  0,  34,
    /* LED_Save19,          */  0,  35,
};

void App_Telltales_Ctrl(uint8_t Idx, uint8_t Status)
{
    if(IS31FL3236_LED_Channel[Idx].Chl != 0xFF)
    {
        u8IS31Data[IS31FL3236_LED_Channel[Idx].ICNum][IS31FL3236_LED_Channel[Idx].Chl] = Status;
    }
}

void App_Telltales_AllON(void)
{
    uint8_t i = 0;

    for(i = 0; i < LED_MAX; i++)
    {
        App_Telltales_Ctrl(i, 1);
    }
}

void App_Telltales_AllOFF(void)
{
    uint8_t i = 0;

    for(i = 0; i < LED_MAX; i++)
    {
        App_Telltales_Ctrl(i, 0);
    }
}
