/* Check the amount of space left in the FIFO. 
This function returns the available space in the overall FIFO to accept new data. This takes into account the SRAM buffer and hardware FIFO */
uint32_t am_hal_ios_fifo_space_left(void)
/* Check the amount of space left in the FIFO. 
This function returns the available space in the overall FIFO to accept new data. This takes into account the SRAM buffer and hardware FIFO */
uint32_t am_hal_ios_fifo_space_left(void)
{
    uint32_t ui32Val;
    uint32_t ui32Primask;
    ui32Primask = am_hal_interrupt_master_disable();
    ui32Val = g_sSRAMBuffer.ui32Capacity + g_ui32HwFifoSize - 1;
    ui32Val -= g_sSRAMBuffer.ui32Length;
    ui32Val -= AM_BFR(IOSLAVE, FIFOPTR, FIFOSIZ);
    am_hal_interrupt_master_set(ui32Primask);
    return ui32Val;
}