ROM
All user-callable ROM functions are invoked via the call_trap() function. The C-prototype for this function
is:
Example 7-1. Invoking user-callable ROM functions
typedef union {
void * ptr;
unsigned long val;
} rmf_return_t;
rmf_return_t call_trap(unsigned short fid, void *ptr);
Input parameters are a function ID code (fid) and a void pointer which is internally recast to a structure
type specific to the function being called.
There are 32 bits of data returned. Depending on the function, these may be a pointer to a structure or
simply an unsigned long. When using the rmf_return_t C language data type, the user will need to specify
varName.ptr or varName.val, depending on the data type into which the user needs to cast the result.
It is possible to call ROM functions directly in assembler. An inspection of the call_trap() source code in
the example below shows how this is done. Simply load register D0 with the function ID and A0 with a
structure pointer. Then run the assembler “trap #0” instruction to transfer control to the supervisor routine
associated with that instruction.
The result will be returned in register A0.
Example 7-2. call_trap()
rmf_return_t call_trap(unsigned short fid, void *ptr)
{
rmf_return_t result;
asm {
move.w fid,d0
move.l ptr,a0
trap #0
move.l a0,result
// D0 contains function ID (16 bits)
// A0 contains pointer to structure (32 bits)
// store in local 'result' variable
}
return result;
}
Only predefined, Freescale functions can be called via call_trap(). These are defined in Table 7-39 .
MMA955xL Intelligent, Motion-Sensing Platform Hardware Reference Manual, Rev. 1.0
Freescale Semiconductor, Inc.
101
相关PDF资料
KITMMA955XLEVM KIT EVALUATION FOR MMA955XL
KITMPL115A1EVB KIT EVALUATION FOR MPL115A1
KITMPL115A1SPI KIT EVALUATION FOR PL115A1SP1
KITMPL115A2I2C KIT EVALUATION FOR PL115A2I2C
KITMPVZ5004EVK KIT EVAL PRESSURE SENS BOARD
KN500B1/4 SWITCH KNOB STRAIGHT .50" BLACK
KN5700B1/4 SWITCH KNOB STRAIGHT .75" BLACK
KN700B1/4 SWITCH KNOB STRAIGHT .75" BLACK
相关代理商/技术参数
KITMMA9551LEVM 功能描述:加速传感器开发工具 Dev Board MMA9551L RoHS:否 制造商:Murata 工具用于评估:SCA3100-D04 加速:2 g 传感轴:Triple Axis 接口类型:SPI 工作电压:3.3 V
KITMMA955XLEVM 功能描述:加速传感器开发工具 EVM KIT FOR MMA955XL RoHS:否 制造商:Murata 工具用于评估:SCA3100-D04 加速:2 g 传感轴:Triple Axis 接口类型:SPI 工作电压:3.3 V
KITMMDS08AB32 功能描述:DEV KIT FOR 68HC908AB32 MMDS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
KITMMDS08JB8 功能描述:DEV KIT FOR 68HC908JB8 MMDS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
KITMMDS08JL 功能描述:DEVKIT 68HC908JL3/JK3/JK1 MMDS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
KITMMDS08KX 功能描述:DEV KIT FOR 68HC908KX8/KX2 MMDS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
KITMMDS08MR32 功能描述:DEVKIT FOR 68HC908MR32/MR16 MMDS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
KITMMEVS08AB32 功能描述:DEV KIT FOR 68HC908AB32 MMEVS RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP