/* Programs a half word at a specified address.  */
FMC_STATUS_T FMC_ProgramHalfWord(uint32_t address, uint16_t data)
/* Programs a half word at a specified address.  */
FMC_STATUS_T FMC_ProgramHalfWord(uint32_t address, uint16_t data)
{
    FMC_STATUS_T status = FMC_STATUS_COMPLETE;
    __set_PRIMASK(1);
    status = FMC_WaitForLastOperation(0x000B0000);
    if(status == FMC_STATUS_COMPLETE)
    {
        FMC->CTRL2_B.PG = BIT_SET;
        *(__IOM uint16_t *)address = data;
        status = FMC_WaitForLastOperation(0x000B0000);
        FMC->CTRL2_B.PG = BIT_RESET;
    }
    __set_PRIMASK(0);
    return status;
}