www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - CAN API


CAN_Peek

Look at next CAN message, but leave it in queue.

int CAN_Peek (  unsigned int port_idx,

CAN_MSG far *msg );

Parameters

port_idx

CAN port specifier:   CAN0_PORT = 0, or CAN1_PORT = 1

msg

Output Parameter:   Pointer to a CAN_MSG data structure were this API will copy the next CAN message from receiver queue, if one is available.

Return Value

Error code -
CAN_EC_SUCCESS = 0:   Success, a copy of next CAN message in queue is in the data structure referenced by the msg pointer.
CAN_EC_INVALID_PARAMS = -1:   port_idx or msg pointer invalid.
CAN_EC_PORT_NOT_OPENED = -3:   Port has not been opened. CAN_EC_TIMEOUT = -6:   No message available, receiver queue is empty.

Comments

This function picks up a copy of the next received CAN message from the receiver queue FIFO without removing that message from the queue.   This function always returns immediately.   If no message was available, the return value is CAN_EC_TIMEOUT.

Inside this API the interrupts are masked for a short period and then re-enabled.   This function is reentrant.

Important Note:

    No CAN messages will be received until the port's receiver filters have been enabled for reception using the CAN_Rx_Filters API.   Following a system reset, the CAN receiver filters are initialized to reject all incoming CAN messages by default.

See Also

RTOS API

This library function uses a dynamic link to reach the service offered by RTOS software interrupt.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    n/an/an/aV0.90

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.01

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document