Example #1
0
AST_HIF_HW_RESULT ast_hif_hw_read(AST_HIF_HW_TYPE type, kal_uint32 addr, kal_uint32 size, AST_HIF_HW_CALLBACK fCB)
{
    HIF_RESULT result = HIF_RESULT_OK;
    switch (type)
    {
    case AST_HIF_HW_TYPE_A0H_CPU:
    	#if defined(MT6255)
        result = hif_mcu_read_fast(ast_hif_hw_handle, HIF_TYPE_A0H_CPU, addr, size);
      #else
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0H_CPU, addr, size, fCB);
      #endif
        break;
    case AST_HIF_HW_TYPE_A0H_DMA:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0H_DMA, addr, size, fCB);
        break;
    case AST_HIF_HW_TYPE_A0L_CPU:
    	#if defined(MT6255)
        result = hif_mcu_read_fast(ast_hif_hw_handle, HIF_TYPE_A0L_CPU, addr, size);
      #else
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0L_CPU, addr, size, fCB);
      #endif
        break;
    case AST_HIF_HW_TYPE_A0L_DMA:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0L_DMA, addr, size, fCB);
        break;
    default:
        ASSERT(0);
        break;
    }
    return (AST_HIF_HW_RESULT)result;
}
AST_HIF_HW_RESULT ast_hif_hw_read(AST_HIF_HW_TYPE type, kal_uint32 addr, kal_uint32 size, AST_HIF_HW_CALLBACK fCB)
{
    HIF_RESULT result;
    switch (type)
    {
    case AST_HIF_HW_TYPE_A0H_CPU:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0H_CPU, addr, size, fCB);
        break;
    case AST_HIF_HW_TYPE_A0H_DMA:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0H_DMA, addr, size, fCB);
        break;
    case AST_HIF_HW_TYPE_A0L_CPU:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0L_CPU, addr, size, fCB);
        break;
    case AST_HIF_HW_TYPE_A0L_DMA:
        result = hif_read(ast_hif_hw_handle, HIF_TYPE_A0L_DMA, addr, size, fCB);
        break;
    default:
        ASSERT(0);
        result = HIF_RESULT_INVALID_ARGUMENT;
        break;
    }
    return (AST_HIF_HW_RESULT)result;
}