@CHIP-RTOS C Library V2.06 - CAN API
CAN_Close_Port
Close down a specified CAN port. int CAN_Close_Port ( unsigned int port_idx ); Parameters
port_idx
- CAN port specifier:
CAN0_PORT = 0, or CAN1_PORT = 1
Return Value
- Error code -
CAN_EC_SUCCESS = 0: Success
CAN_EC_INVALID_PARAMS = -1: port_idx
invalid
Comments
- This function closes a CAN port, releasing any resources it was
using (e.g. heap memory for FIFO's and RTX event group). Prior to
releasing the event group, the event
bits in the RTX event group associated with this port are
strobed
in order to release any program threads which were
waiting on
events for this port which is now being closed.
Any user callback vectors that had
been set for this port will be removed.
The CAN device is deactivated. Any pending transmission is aborted.
Aborting a pending transmission requires some additional time beyond when
this API returns such that if the port were to be immediately reopened,
a subsequent call to CAN_Send could
fail due to a transmit buffer still busy condition.
Inside this API the interrupts are masked for a short period and then
re-enabled. This function is reentrant.
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-
SC12 | SC13 | SC11 | SC1x3 |
-
n/a | n/a | n/a | V0.90 |
Supported by @CHIP-RTOS C Library since version
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|