/* Check the amount of space used in the FIFO. 
This function returns the available data in the overall FIFO yet to be read by the host. This takes into account the SRAM buffer and hardware FIFO */
uint32_t am_hal_ios_fifo_space_used(void)
/* Check the amount of space used in the FIFO. 
This function returns the available data in the overall FIFO yet to be read by the host. This takes into account the SRAM buffer and hardware FIFO */
uint32_t am_hal_ios_fifo_space_used(void)
{
    uint32_t ui32Val;
    uint32_t ui32Primask;
    ui32Primask = am_hal_interrupt_master_disable();
    ui32Val = g_sSRAMBuffer.ui32Length;
    ui32Val += AM_BFR(IOSLAVE, FIFOPTR, FIFOSIZ);
    am_hal_interrupt_master_set(ui32Primask);
    return ui32Val;
}