/* Programs a half word at a specified address.  */
FMC_STATE_T FMC_ProgramHalfWord(uint32_t addr, uint16_t data)
/* Programs a half word at a specified address.  */
FMC_STATE_T FMC_ProgramHalfWord(uint32_t addr, uint16_t data)
{
    FMC_STATE_T state;
    state = FMC_WaitForReady(FMC_DELAY_PROGRAM);
    if (state == FMC_STATE_COMPLETE)
    {
        FMC->CTRL2_B.PG = BIT_SET;
        *(__IO uint16_t*)addr = data;
        state = FMC_WaitForReady(FMC_DELAY_PROGRAM);
        FMC->CTRL2_B.PG = BIT_RESET;
    }
    return state;
}