/* Programs a half word at a specified Option Byte Data address.  */
FLASH_STS FLASH_ProgramOBData(uint32_t Address, uint32_t Data)
/* Programs a half word at a specified Option Byte Data address.  */
FLASH_STS FLASH_ProgramOBData(uint32_t Address, uint32_t Data)
{
    FLASH_STS status = FLASH_COMPL;
    assert_param(IS_OB_DATA_ADDRESS(Address));
    if (FLASH_GetReadOutProtectionL2STS() != RESET)
    {
        status = FLASH_ERR_RDP2;
        return status;
    }
    FLASH_ClearFlag(FLASH_STS_CLRFLAG);
    status = FLASH_WaitForLastOpt(ProgramTimeout);
    if (status == FLASH_COMPL)
    {
        FLASH->OPTKEY = FLASH_KEY1;
        FLASH->OPTKEY = FLASH_KEY2;
        FLASH->CTRL |= CTRL_Set_OPTPG;
        *(__IO uint32_t*)Address = (uint32_t)Data;
        status = FLASH_WaitForLastOpt(ProgramTimeout);
        if (status != FLASH_TIMEOUT)
        {
            FLASH->CTRL &= CTRL_Reset_OPTPG;
        }
    }
    return status;
}