/* Through the threshold value judgment,per channel can redefine as the state mode .  */
uint8_t GetChannelSensorState(uint8_t Ch)
/* Through the threshold value judgment,per channel can redefine as the state mode .  */
uint8_t GetChannelSensorState(uint8_t Ch)
{
    if (Ch == CHANNEL_0)
    {
       return ((uint8_t)((LPRCNT->CAL0  >> 8) & 0x3));
    }
    else if (Ch == CHANNEL_1)
    {
       return ((uint8_t)((LPRCNT->CAL0  >> 24) & 0x3));
    }
    else if (Ch == CHANNEL_2)
    {
       return ((uint8_t)((LPRCNT->CAL1  >> 8) & 0x3));
    }
    else
    {
       return CHANNEL_ERROR;
    }
}