common/pic24_ecan.c File Reference

#include "pic24_all.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void formatStandardDataFrameECAN (ECANMSG *p_ecanmsg, uint16 u16_id, uint8 u8_len)
void formatExtendedDataFrameECAN (ECANMSG *p_ecanmsg, uint32 u32_id, uint8 u8_len)
uint32 getIdExtendedDataFrameECAN (ECANMSG *p_ecanmsg)
void clrRxFullFlagECAN1 (uint8 u8_bufNum)
uint8 getRxFullFlagECAN1 (uint8 u8_bufNum)
void clrRxFullOvfFlagsECAN1 (void)
void configTxRxBufferECAN1 (uint8 u8_bufNum, uint8 u8_type, uint8 u8_priority)
void startTxECAN1 (uint8 u8_bufNum)
uint8 getTxInProgressECAN1 (uint8 u8_bufNum)
void configRxFilterECAN1 (uint8 u8_filtNum, uint32 u32_id, uint8 u8_idType, uint8 u8_bufnum, uint8 u8_maskReg)
void configRxMaskECAN1 (uint8 u8_maskNum, uint32 u32_idMask, uint8 u8_idType, uint8 u8_matchType)


Detailed Description

ECAN support functions.
See also:
pic24_ecan.h for details.

Definition in file pic24_ecan.c.


Function Documentation

void clrRxFullFlagECAN1 ( uint8  u8_bufNum  ) 

Clear full bit of buffer u8_bufNum

Parameters:
u8_bufNum buffer number of full bit to clear (0 to 31)

Definition at line 115 of file pic24_ecan.c.

void clrRxFullOvfFlagsECAN1 ( void   ) 

Operation: Clear all of the full and overflow RX flags.

Definition at line 143 of file pic24_ecan.c.

void configRxFilterECAN1 ( uint8  u8_filtNum,
uint32  u32_id,
uint8  u8_idType,
uint8  u8_bufnum,
uint8  u8_maskReg 
)

Configure an acceptance Filter

Parameters:
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 231 of file pic24_ecan.c.

void configRxMaskECAN1 ( uint8  u8_maskNum,
uint32  u32_idMask,
uint8  u8_idType,
uint8  u8_matchType 
)

Configure an acceptance MASK

Parameters:
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 289 of file pic24_ecan.c.

void configTxRxBufferECAN1 ( uint8  u8_bufNum,
uint8  u8_type,
uint8  u8_priority 
)

Configure a buffer as either RX or TX buffer, only has to be done for first 8 buffers.

Parameters:
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 154 of file pic24_ecan.c.

void formatExtendedDataFrameECAN ( ECANMSG *  p_ecanmsg,
uint32  u32_id,
uint8  u8_len 
)

Format an extended data frame u8_n for TX

Parameters:
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 77 of file pic24_ecan.c.

void formatStandardDataFrameECAN ( ECANMSG *  p_ecanmsg,
uint16  u16_id,
uint8  u8_len 
)

Format a standard data frame u8_n for TX

Parameters:
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 57 of file pic24_ecan.c.

uint32 getIdExtendedDataFrameECAN ( ECANMSG *  p_ecanmsg  ) 

Extract the 29-bit message id from an extended data frame

Parameters:
p_ecanmsg pointer to RX message buffer (ECANMSG* )
Returns:
29-bit message id

Definition at line 96 of file pic24_ecan.c.

uint8 getRxFullFlagECAN1 ( uint8  u8_bufNum  ) 

Get full bit of buffer u8_bufNum, zero if empty, non-zero if ull

Parameters:
u8_bufNum buffer number of full bit to read(0 to 31)

Definition at line 130 of file pic24_ecan.c.

uint8 getTxInProgressECAN1 ( uint8  u8_bufNum  ) 

Start Transmit for buffer u8_bufNum

Parameters:
u8_bufNum buffer number (0 to 7)

Definition at line 206 of file pic24_ecan.c.

void startTxECAN1 ( uint8  u8_bufNum  ) 

Start Transmit for buffer u8_bufNum

Parameters:
u8_bufNum buffer number (0 to 7)

Definition at line 188 of file pic24_ecan.c.


Generated on Sun Mar 15 11:14:22 2009 for PIC24 Support Libraries by  doxygen 1.5.8