/* Read the output port width of the TPIU. 
This function uses the  */
uint32_t am_hal_tpiu_port_width_get(void)
/* Read the output port width of the TPIU. 
This function uses the  */
uint32_t am_hal_tpiu_port_width_get(void)
{
    uint32_t ui32Temp;
    uint32_t ui32Width;
    ui32Width = 1;
    ui32Temp = AM_REG(TPIU, CSPSR);
    while ( !(ui32Temp & 1) )
    {
        ui32Temp = ui32Temp >> 1;
        ui32Width++;
        if (ui32Width > 32)
        {
            ui32Width = 0;
            break;
        }
    }
    return ui32Width;
}