CAN2_SetAcceptanceMask how to use

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CAN2_SetAcceptanceMask how to use

647 次查看
李志權
Contributor II

when i call it,it will return 9 ERR_NOTAVAIL

how to use?

标签 (1)
0 项奖励
7 回复数

538 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 志權

     Could you tell us which chip or board you are used?

     And where the CAN2_SetAcceptance Mask from?

     For the convenience of solving the question, it is best for you to paste you 9 ERR_NOTALAIL.

Best regards!

Jing

0 项奖励

538 次查看
李志權
Contributor II

k60-can.bmpcan-test-main.bmp
can-test-setmask.bmp

0 项奖励

538 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi ,

The following is the API definition:

LDD_TError CAN_SetAcceptanceMask(LDD_TDeviceData *DeviceDataPtr, LDD_CAN_TMBIndex BufferIdx, LDD_CAN_TAccMask AccMask);

and below is some description for parameters as well as the return value.

** @param
**     DeviceDataPtr   - Device data structure
**                       pointer returned by [Init] method.
** @param
**     BufferIdx   - Index for Acceptance Mask
**                       Message Buffer.
** @param
**     AccMask     - 11-bit Mask could be selected for
**                       a standard frame or 29-bit for an extended
**                       frame.
** @return
**                     - Error code, possible codes:
**                       ERR_OK - OK
**                       ERR_SPEED - This device does not work in
**                       the active clock configuration
**                       ERR_PARAM_RANGE - Value of buffer index is
**                       out of range.
**                       ERR_NOTAVAIL - Acceptance mask isn't
**                       possible change when CAN component is
**                       running, component must be disabled or
**                       switched to freeze mode.

So maybe you call this API when CAN is running, please disable it or put it into freeze mode before calling this function.

Hope that helps,

B.R

Kan

538 次查看
李志權
Contributor II


so,how to enter freeze mode and how to exit freeze mode?

0 项奖励

538 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

You may use "CAN_SetOperationMode" to enter or exit the Freeze mode. Please kindly refer to the following for details.

1.png

Hope that helps,

B.R

Kan

0 项奖励

538 次查看
李志權
Contributor II

There are 2 a callback function

Can i give NULL for use CAN_SetOperationMode

0 项奖励

538 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Yes, you can set them as NULL.

B.R

Kan

0 项奖励