/* initialize TSI plus prescaler,charge plus,transfer plus,max cycle number  */
void tsi_init(uint32_t prescaler, uint32_t charge_duration, uint32_t transfer_duration, uint32_t max_number)
/* initialize TSI plus prescaler,charge plus,transfer plus,max cycle number  */
void tsi_init(uint32_t prescaler, uint32_t charge_duration, uint32_t transfer_duration, uint32_t max_number)
{
    if(RESET == (TSI_CTL & TSI_CTL_TSIS)){
        uint32_t ctl;
        ctl = TSI_CTL;
        ctl &= ~(TSI_CTL_CTCDIV|TSI_CTL_CTDT|TSI_CTL_CDT|TSI_CTL_MCN);
        ctl |= (prescaler|charge_duration|transfer_duration|max_number);
        TSI_CTL = ctl;
    }
}