📄 functions.h
字号:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 15:19:53 IST
// Revision: none
// =====================================================================================
#define setup_irq_hdler(int_name,func_ptr) reg32_write(((WORD*) AVIC_IVR-(4*int_name)),(WORD) func_ptr )
// === MACRO ======================================================================
//
// Name: setup_fiq_hdler
//
// Description: Bind handler routine to certain FIQ (Fast IRQ)
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD int_name interrupt number (or macro name)
// in: WORD func_ptr function name
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 15:20:09 IST
// Revision: none
// =====================================================================================
#define setup_fiq_hdler(int_name,func_ptr) reg32_write(((WORD*) AVIC_FVR-(4*int_name)),(WORD) func_ptr )
// === MACRO ======================================================================
//
// Name: enable_hdler
//
// Description: Enabled triggering of specific IRQ
//
// Example : enable_hdler(GPT_INT)
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD int_name IRQ to enable
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 15:20:37 IST
// Revision: none
// =====================================================================================
#define enable_hdler( int_name ) reg32_write(AVIC_INTENNUM, int_name )
// === MACRO ======================================================================
//
// Name: disable_hdler
//
// Description: Disable triggering of specific IRQ
//
// Example: disable_hdler(GPT_INT)
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD int_name IRQ to disable
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 15:20:48 IST
// Revision: none
// =====================================================================================
#define disable_hdler( int_name ) reg32_write(AVIC_INTDISNUM, int_name )
//2}}}
//----------------------------------------------------------------------
// Exceptions Handling
//----------------------------------------------------------------------
//{{{2
// === MACRO ======================================================================
//
// Name: CAPTURE_EXCEPTION
//
// Description: assign a user handler routine to specific Exception,
// and override default routine
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD handle Exception handler address
// in: function name routine user supplied routine
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:49:18 IST
// Revision: none
// =====================================================================================
#define CAPTURE_EXCEPTION(excep_addr,handler_routine) mem32_write((excep_addr),(WORD)(handler_routine))
//2}}}
//----------------------------------------------------------------------
// Verilog testbench Interaction Macros
//----------------------------------------------------------------------
//{{{2
// === MACRO ======================================================================
//
// Name: verilog_trigger
//
// Description: trigger events in verilog_trigger module, event codes can be found in
// verilog_trigger.h
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD trigger_code Event code to trigger
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:51:43 IST
// Revision: none
// =====================================================================================
//#define verilog_trigger(trigger_code) mem32_write((ARM_PORTHOLE_ADD) , (trigger_code) )
// === MACRO ======================================================================
//
// Name: wait_for_gpio_message
//
// Description: wait for certain i4 bit value to appear on GPIO pads
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD val value to wait for. only 4 LSB are checked
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/02/04 14:30:04 IST
// Revision: none
// =====================================================================================
#define wait_for_gpio_message(val) wait_for_gpio_mcu_message(val)
//2}}}
//----------------------------------------------------------------------
// Assembler Instructions macros
//----------------------------------------------------------------------
//{{{2
// === MACRO ======================================================================
//
// Name: nop
//
// Description: Execute "nop" assembler instruction
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in:
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:54:11 IST
// Revision: none
// =====================================================================================
#define nop() asm ( "nop" );
//2}}}
//1}}}
// ##### EXPORTED TYPE DEFINITIONS ################################################# {{{1
typedef volatile unsigned long WORD;
typedef volatile unsigned short HALF;
typedef volatile unsigned char BYTE;
//1}}}
// ##### HEADER FILE INCLUDES ################################################### {{{1
//#include "argon_memory_map_defines.h"
#include "bono_memory_map_defines.h"
//#include "verilog_trigger.h"
//#include "ccm_low_power_modes.h"
//#include "int_obs_function.h"
//#include "rwlib.h"
//#include "config_pad_mode.h"
//1}}}
// ##### EXPORTED FUNCTION DECLARATIONS ############################################ {{{1
// ##### FUNCTION DECLARATIONS - COMMON API ############################################
//----------------------------------------------------------------------
// Verilog testbench Interaction Functions
//----------------------------------------------------------------------
//{{{2
// === FUNCTION ======================================================================
//
// Name: info_trigger
//
// Description: sends info message composed of 3 32-bit words to verilog-trigger,
// may be used to send comparison events to verilog trigger
// output message format is :
// "Info ARM Event Triggered : INFO1 : <event> , INFO2 : <exp_data> , INFO3 : <act_data>"
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD event event number/ID or data word #1
// in: WORD exp_data expected data / data word #2
// in: WORD act_data actual data / data word #3
// in-out:
// out:
// return: void
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 12:05:45 IST
// Revision: none
// =====================================================================================
//void info_trigger(WORD event ,WORD exp_data , WORD act_data);
// === FUNCTION ======================================================================
//
// Name: info_checktest_trigger
//
// Description: compares expected and actual data, and sends pass/fail events
// and information message to verilog trigger
// output message format is :
// "CheckTest Info ARM Event Triggered : EVENT : <event> Expected : <exp_data> Actual : <act_data>"
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD event event number/ID
// in: WORD exp_data expected data
// in: WORD act_data actual data
// in-out:
// out:
// return: void
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 12:08:23 IST
// Revision: none
// =====================================================================================
void info_checktest_trigger(WORD event ,WORD exp_data , WORD act_data);
// === FUNCTION ======================================================================
//
// Name: wait_for_gpio_mcu_message
//
// Description: waits for certain value on GPIO mcu pins
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD val value on GPIO to wait for
// in-out:
// out:
// return: void
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 12:00:09 IST
// Revision: none
// =====================================================================================
void wait_for_gpio_mcu_message (WORD val);
//2}}}
//----------------------------------------------------------------------
// Init Functions
//----------------------------------------------------------------------
//{{{2
// === FUNCTION ======================================================================
//
// Name: InitArray
//
// Description: Initializes 2 arrays (real and expected results)
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD *exp_val expected results array
// in: WORD *res_val real results array
// in: int num_of_res number of results (array size)
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 12:01:19 IST
// Revision: none
// =====================================================================================
void InitArray(WORD *exp_val, WORD *res_val, int num_of_res);
// === FUNCTION ======================================================================
//
// Name: configure_iomuxc_for_gpio_message_mcu
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -