/* configure counter reload value, and prescaler divider value  */
ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div)
/* configure counter reload value, and prescaler divider value  */
ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div)
{
    uint32_t timeout = FWDGT_PSC_TIMEOUT;
    uint32_t flag_status = RESET;
    FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE;
    do{
       flag_status = FWDGT_STAT & FWDGT_STAT_PUD;
    }while((--timeout > 0U) && ((uint32_t)RESET != flag_status));
    if((uint32_t)RESET != flag_status){
        return ERROR;
    }
    FWDGT_PSC = (uint32_t)prescaler_div;
    timeout = FWDGT_RLD_TIMEOUT;
    do{
       flag_status = FWDGT_STAT & FWDGT_STAT_RUD;
    }while((--timeout > 0U) && ((uint32_t)RESET != flag_status));
    if((uint32_t)RESET != flag_status){
        return ERROR;
    }
    FWDGT_RLD = RLD_RLD(reload_value);
    FWDGT_CTL = FWDGT_KEY_RELOAD;
    return SUCCESS;
}