/* Programs a half word at a specified Option Byte Data address.  */
FMC_STATE_T FMC_ProgramOptionByteData(uint32_t addr, uint8_t data)
/* Programs a half word at a specified Option Byte Data address.  */
FMC_STATE_T FMC_ProgramOptionByteData(uint32_t addr, uint8_t data)
{
    FMC_STATE_T state;
    state = FMC_WaitForReady(FMC_DELAY_ERASE);
    if (state == FMC_STATE_COMPLETE)
    {
        FMC->CTRL2_B.OBP = BIT_SET;
        *(__IO uint16_t*)addr = data;
        state = FMC_WaitForReady(FMC_DELAY_ERASE);
        if (state != FMC_STATE_TIMEOUT)
        {
            FMC->CTRL2_B.OBP = BIT_RESET;
        }
    }
    return state;
}