Component: CAN (CAL) (Misc)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 2.4
Category Misc


CAN component

CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. Low level routines for controling the internal CAN peripheral.

Component Pack

COMMSA

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to build a component using a CAL component Using CAL Components.


Downloadable macro reference

Fc9-comp-macro.png SetTxIdentStd
Sets the ID to send along with the data in the next CAN message  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to,2 
Fc9-u8-icon.png - BYTE Hi
The high byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE Lo
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdentExd
Sets the optional 32-bit ID to send along with the standard ID and data in the next CAN message  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to,2 
Fc9-u8-icon.png - BYTE ID3
The high byte (bits 24-31) of the ID 
Fc9-u8-icon.png - BYTE ID2
The mid-high byte (bits 16-23) of the ID 
Fc9-u8-icon.png - BYTE ID1
The mid-low byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE ID0
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxData
Sets the CAN transmit data for the buffer specified (0, 1 or 2). The count parameter Data_Cnt indicates the number of valid data bytes. D0 to D7 are the payload data bytes to be loaded into the transmit buffer. 
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to,2 
Fc9-u8-icon.png - BYTE Data_Cnt
The number of bytes of data to add, 0 to 8 
Fc9-u8-icon.png - BYTE D0
Data byte 0 to add 
Fc9-u8-icon.png - BYTE D1
Data byte 1 to add 
Fc9-u8-icon.png - BYTE D2
Data byte 2 to add 
Fc9-u8-icon.png - BYTE D3
Data byte 3 to add 
Fc9-u8-icon.png - BYTE D4
Data byte 4 to add 
Fc9-u8-icon.png - BYTE D5
Data byte 5 to add 
Fc9-u8-icon.png - BYTE D6
Data byte 6 to add 
Fc9-u8-icon.png - BYTE D7
Data byte 7 to add 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMask
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
Fc9-u8-icon.png - BYTE mask
 
Fc9-u32-icon.png - ULONG id
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetValue
Get the Value of the Named property 
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetRxData
Returns the data byte at index from the buffer specified 
Fc9-u8-icon.png - BYTE buffer
The index of the required buffer 
Fc9-u8-icon.png - BYTE index
The index of the required data byte in the buffer 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png InitRXMask
Initialization setting for RX Mask 
Fc9-u8-icon.png - BYTE Mask
Mask Number (0 or 1) 
Fc9-u32-icon.png - ULONG Value
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBuffer
Sends the contents of the buffer previously filled with Set_TX_... calls  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to,2 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png InitRXFilter
Initialization setting for RX Filter 
Fc9-u8-icon.png - BYTE Filter
 
Fc9-u32-icon.png - ULONG Value
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxDataCount
Returns the number of valid data bytes in the buffer 
Fc9-u8-icon.png - BYTE buffer
The index of the required buffer 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Init
Must be called at least once and after every Uninit call to enable the CAN instance  
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png InitTXBuffer
Initialization settings for TX Buffers 
Fc9-u8-icon.png - BYTE Buffer
TX Buffer ID = 0,1 or 2 
Fc9-u32-icon.png - ULONG ID
CAN Address 
Fc9-u8-icon.png - BYTE Length
Number of bytes to send 
Fc9-string-icon.png - STRING Data
Data Array (of Length bytes) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMaskStd
Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter  
Fc9-u8-icon.png - BYTE Mask
Mask number 
Fc9-u8-icon.png - BYTE Hi
The high byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE Lo
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMaskExd
Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
Fc9-u8-icon.png - BYTE Mask
Mask 0 or 1 
Fc9-u8-icon.png - BYTE ID3
The high byte (bits 24-31) of the ID 
Fc9-u8-icon.png - BYTE ID2
The mid-high byte (bits 16-23) of the ID 
Fc9-u8-icon.png - BYTE ID1
The mid-low byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE ID0
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetValue
Set the Value of the Named property 
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Value
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilter
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
Fc9-u8-icon.png - BYTE filter
 
Fc9-u32-icon.png - ULONG id
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdent
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
Fc9-u8-icon.png - BYTE buffer
 
Fc9-u32-icon.png - ULONG id
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Checks to see if any messages are available for 'Buffer' specified  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png InitRXConfig
Initialization setting for RX Buffer Config 
Fc9-u8-icon.png - BYTE Buffer
Buffer Number (0 or 1) 
Fc9-u8-icon.png - BYTE Value
Config data byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Uninit
Uninitialises the CAN, freeing its connections for general use  
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetList
Get the Filter List of the Named Property 
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetRxIdent
Generic function to get the received message Identifier.  
Fc9-u8-icon.png - BYTE buffer
 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png SetRxFilterStd
Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter  
Fc9-u8-icon.png - BYTE Filter
Filter number 
Fc9-u8-icon.png - BYTE Hi
The high byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE Lo
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilterExd
Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
Fc9-u8-icon.png - BYTE Filter
Send filter: 0 to 3 
Fc9-u8-icon.png - BYTE ID3
The high byte (bits 24-31) of the ID 
Fc9-u8-icon.png - BYTE ID2
The mid-high byte (bits 16-23) of the ID 
Fc9-u8-icon.png - BYTE ID1
The mid-low byte (bits 8-15) of the ID 
Fc9-u8-icon.png - BYTE ID0
The low byte (bits 0-7) of the ID 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Selects the CAN channel to be used 
Fc9-type-5-icon.png TX Pin
 
Fc9-type-5-icon.png RX Pin
 
Fc9-type-16-icon.png TX Remap
 
Fc9-type-16-icon.png RX Remap
 
Fc9-type-16-icon.png Bus Rate
selects the Bus Rate (KHz) 
Fc9-type-16-icon.png Sample Point
selects the Sample Point for bit reading 
Fc9-type-16-icon.png SJW
Synchronization Jump Width adjusts the bit clock by 1 to 4 TQ periods 
Fc9-type-14-icon.png Fosc
 
Fc9-type-14-icon.png BRGCON1
 
Fc9-type-14-icon.png BRGCON2
 
Fc9-type-14-icon.png BRGCON3
 
Fc9-type-16-icon.png ID Type
selects the CAN ID type 
Fc9-conn-icon.png TX Buffer 0
Fc9-type-14-icon.png Message ID
CAN Message ID for Transmit Buffer 0 
Fc9-type-14-icon.png Length
Number of valid data bytes in the message 
Fc9-type-14-icon.png D0
Data byte 0 
Fc9-type-14-icon.png D1
Data byte 1 
Fc9-type-14-icon.png D2
Data byte 2 
Fc9-type-14-icon.png D3
Data byte 3 
Fc9-type-14-icon.png D4
Data byte 4 
Fc9-type-14-icon.png D5
Data byte 5 
Fc9-type-14-icon.png D6
Data byte 6 
Fc9-type-14-icon.png D7
Data byte 7 
Fc9-conn-icon.png TX Buffer 1
Fc9-type-14-icon.png Message ID
CAN Message ID for Transmit Buffer 1 
Fc9-type-14-icon.png Length
Number of valid data bytes in the message 
Fc9-type-14-icon.png D0
Data byte 0 
Fc9-type-14-icon.png D1
Data byte 1 
Fc9-type-14-icon.png D2
Data byte 2 
Fc9-type-14-icon.png D3
Data byte 3 
Fc9-type-14-icon.png D4
Data byte 4 
Fc9-type-14-icon.png D5
Data byte 5 
Fc9-type-14-icon.png D6
Data byte 6 
Fc9-type-14-icon.png D7
Data byte 7 
Fc9-conn-icon.png TX Buffer 2
Fc9-type-14-icon.png Message ID
CAN Message ID for Transmit Buffer 2 
Fc9-type-14-icon.png Length
Number of valid data bytes in the message 
Fc9-type-14-icon.png D0
Data byte 0 
Fc9-type-14-icon.png D1
Data byte 1 
Fc9-type-14-icon.png D2
Data byte 2 
Fc9-type-14-icon.png D3
Data byte 3 
Fc9-type-14-icon.png D4
Data byte 4 
Fc9-type-14-icon.png D5
Data byte 5 
Fc9-type-14-icon.png D6
Data byte 6 
Fc9-type-14-icon.png D7
Data byte 7 
Fc9-conn-icon.png RX Buffer 0
Fc9-type-16-icon.png Settings
Filter setting for Receive Buffer 0 
Fc9-type-14-icon.png Mask
Value for Receive Mask 0 
Fc9-type-14-icon.png Filter 0
Value for Filter 0 
Fc9-type-14-icon.png Filter 1
Value for Filter 1 
Fc9-conn-icon.png RX Buffer 1
Fc9-type-16-icon.png Settings
Filter setting for Receive Buffer 1 
Fc9-type-14-icon.png Mask
Value for Receive Mask 1 
Fc9-type-14-icon.png Filter 2
Value for Filter 2 
Fc9-type-14-icon.png Filter 3
Value for Filter 3 
Fc9-type-14-icon.png Filter 4
Value for Filter 4 
Fc9-type-14-icon.png Filter 5
Value for Filter 5