|
PIC24 Support Libraries
|
#include "pic24_ecan.h"Go to the source code of this file.
Functions | |
| void | formatStandardDataFrameECAN (ECANMSG *p_ecanmsg, uint16_t u16_id, uint8_t u8_len) |
| void | formatExtendedDataFrameECAN (ECANMSG *p_ecanmsg, uint32_t u32_id, uint8_t u8_len) |
| uint32_t | getIdExtendedDataFrameECAN (ECANMSG *p_ecanmsg) |
| void | configBaudECAN1 (void) |
| void | clrRxFullFlagECAN1 (uint8_t u8_bufNum) |
| uint8_t | getRxFullFlagECAN1 (uint8_t u8_bufNum) |
| void | clrRxFullOvfFlagsECAN1 (void) |
| void | configTxRxBufferECAN1 (uint8_t u8_bufNum, uint8_t u8_type, uint8_t u8_priority) |
| void | startTxECAN1 (uint8_t u8_bufNum) |
| uint8_t | getTxInProgressECAN1 (uint8_t u8_bufNum) |
| void | configRxFilterECAN1 (uint8_t u8_filtNum, uint32_t u32_id, uint8_t u8_idType, uint8_t u8_bufnum, uint8_t u8_maskReg) |
| void | configRxMaskECAN1 (uint8_t u8_maskNum, uint32_t u32_idMask, uint8_t u8_idType, uint8_t u8_matchType) |
| void clrRxFullFlagECAN1 | ( | uint8_t | u8_bufNum | ) |
Clear full bit of buffer u8_bufNum
| u8_bufNum | buffer number of full bit to clear (0 to 31) |
Definition at line 243 of file pic24_ecan.c.
| void clrRxFullOvfFlagsECAN1 | ( | void | ) |
Operation: Clear all of the full and overflow RX flags.
Definition at line 271 of file pic24_ecan.c.
| void configBaudECAN1 | ( | void | ) |
Configure ECANx peripheral to run at 1Mbps.
Definition at line 176 of file pic24_ecan.c.
| void configRxFilterECAN1 | ( | uint8_t | u8_filtNum, |
| uint32_t | u32_id, | ||
| uint8_t | u8_idType, | ||
| uint8_t | u8_bufnum, | ||
| uint8_t | u8_maskReg | ||
| ) |
Configure an acceptance Filter
| u8_filtNum | filter number (0 to 15) |
| u32_id | identifier, either SID (11 bits) or EID (29 bits) |
| u8_idType | ID type (0: SID, nonzero: EID) |
| u8_bufnum | RX buffer (0-14) to use for filter , if 15, then use FIFO |
| u8_maskReg | Mask register (0-2) to use for filter |
Definition at line 393 of file pic24_ecan.c.
| void configRxMaskECAN1 | ( | uint8_t | u8_maskNum, |
| uint32_t | u32_idMask, | ||
| uint8_t | u8_idType, | ||
| uint8_t | u8_matchType | ||
| ) |
Configure an acceptance MASK
| u8_maskNum | mask number (0 to 3; 0 to 2 specifies mask register, 3 then no mask is used) |
| u32_idMask | mask for the identifier, either SID mask (11 bits) or EID mask (29 bits) |
| u8_idType | ID type (0: SID, nonzero: EID) |
| u8_matchType | Match type; if zero match either SID or EID addresses if filter matches (i.e, match if (Filter SID == Message SID) || (Filter SID:EID = Message SID:EID)) ) If nonzero, match only message types as specified by the filter (either SID or SID:EID). |
Definition at line 451 of file pic24_ecan.c.
Configure a buffer as either RX or TX buffer, only has to be done for first 8 buffers.
| u8_bufNum | buffer number (0 to 7) |
| u8_type | buffer type (0 - receive, 1 transmit) |
| u8_priority | only used for TX, priority (0-3) |
Definition at line 284 of file pic24_ecan.c.
| void formatExtendedDataFrameECAN | ( | ECANMSG * | p_ecanmsg, |
| uint32_t | u32_id, | ||
| uint8_t | u8_len | ||
| ) |
Format an extended data frame u8_n for TX
| p_ecanmsg | pointer to message buffer (ECANMSG* ) |
| u32_id | Standard Identifier (11-bit) |
| u8_len | Number of data bytes in the message |
Definition at line 121 of file pic24_ecan.c.
Referenced by formatStandardDataFrameECAN().
| void formatStandardDataFrameECAN | ( | ECANMSG * | p_ecanmsg, |
| uint16_t | u16_id, | ||
| uint8_t | u8_len | ||
| ) |
Format a standard data frame u8_n for TX
| p_ecanmsg | pointer to message buffer (ECANMSG* ) |
| u16_id | Standard Identifier (11-bit) |
| u8_len | Number of data bytes in the message |
Definition at line 81 of file pic24_ecan.c.
| uint32_t getIdExtendedDataFrameECAN | ( | ECANMSG * | p_ecanmsg | ) |
Extract the 29-bit message id from an extended data frame
| p_ecanmsg | pointer to RX message buffer (ECANMSG* ) |
Definition at line 157 of file pic24_ecan.c.
Referenced by formatExtendedDataFrameECAN().
Get full bit of buffer u8_bufNum, zero if empty, non-zero if ull
| u8_bufNum | buffer number of full bit to read(0 to 31) |
Definition at line 258 of file pic24_ecan.c.
Start Transmit for buffer u8_bufNum
| u8_bufNum | buffer number (0 to 7) |
Definition at line 360 of file pic24_ecan.c.
| void startTxECAN1 | ( | uint8_t | u8_bufNum | ) |
Start Transmit for buffer u8_bufNum
| u8_bufNum | buffer number (0 to 7) |
Definition at line 326 of file pic24_ecan.c.
1.8.13