/* configure counter value, window value, and prescaler divider value  */
void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler)
/* configure counter value, window value, and prescaler divider value  */
void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler)
{
    uint32_t reg_cfg = 0, reg_ctl = 0;
    reg_cfg = WWDGT_CFG &((~(uint32_t)WWDGT_CFG_WIN)|(~(uint32_t)WWDGT_CFG_PSC));
    reg_ctl = WWDGT_CTL &(~(uint32_t)WWDGT_CTL_CNT);
    reg_cfg |= (uint32_t)(CFG_WIN(window));
    reg_cfg |= (uint32_t)(prescaler);
    reg_ctl |= (uint32_t)(CTL_CNT(counter));
    WWDGT_CFG = (uint32_t)reg_cfg;  
    WWDGT_CTL = (uint32_t)reg_ctl;
}