Jump to content

Component: CAN (CAL) (Misc): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(7 intermediate revisions by 3 users not shown)
Line 46: Line 46:


Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].
Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].
==Downloadable macro reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdentStd'''
|-
| colspan="2" | Sets the ID to send along with the data in the next CAN message  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Send buffer: 0  to,2 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Hi
|-
| colspan="2" | The high byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Lo
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdentExd'''
|-
| colspan="2" | Sets the optional 32-bit ID to send along with the standard ID and data in the next CAN message  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Send buffer: 0  to,2 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID3
|-
| colspan="2" | The high byte (bits 24-31) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID2
|-
| colspan="2" | The mid-high byte (bits 16-23) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID1
|-
| colspan="2" | The mid-low byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID0
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxData'''
|-
| colspan="2" | 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. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Send buffer: 0  to,2 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data_Cnt
|-
| colspan="2" | The number of bytes of data to add, 0 to 8 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D0
|-
| colspan="2" | Data byte 0 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D1
|-
| colspan="2" | Data byte 1 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D2
|-
| colspan="2" | Data byte 2 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D3
|-
| colspan="2" | Data byte 3 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D4
|-
| colspan="2" | Data byte 4 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D5
|-
| colspan="2" | Data byte 5 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D6
|-
| colspan="2" | Data byte 6 to add 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D7
|-
| colspan="2" | Data byte 7 to add 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMask'''
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | mask
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | id
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetValue'''
|-
| colspan="2" | Get the Value of the Named property 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxData'''
|-
| colspan="2" | Returns the data byte at index from the buffer specified 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | buffer
|-
| colspan="2" | The index of the required buffer 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | index
|-
| colspan="2" | The index of the required data byte in the buffer 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXMask'''
|-
| colspan="2" | Initialization setting for RX Mask 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
|-
| colspan="2" | Mask Number (0 or 1) 
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBuffer'''
|-
| colspan="2" | Sends the contents of the buffer previously filled with Set_TX_... calls  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Send buffer: 0  to,2 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXFilter'''
|-
| colspan="2" | Initialization setting for RX Filter 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Filter
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxDataCount'''
|-
| colspan="2" | Returns the number of valid data bytes in the buffer 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | buffer
|-
| colspan="2" | The index of the required buffer 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Init'''
|-
| colspan="2" | Must be called at least once and after every Uninit call to enable the CAN instance  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitTXBuffer'''
|-
| colspan="2" | Initialization settings for TX Buffers 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | TX Buffer ID = 0,1 or 2 
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | ID
|-
| colspan="2" | CAN Address 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Length
|-
| colspan="2" | Number of bytes to send 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" | Data Array (of Length bytes) 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMaskStd'''
|-
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
|-
| colspan="2" | Mask number 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Hi
|-
| colspan="2" | The high byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Lo
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMaskExd'''
|-
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
|-
| colspan="2" | Mask 0 or 1 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID3
|-
| colspan="2" | The high byte (bits 24-31) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID2
|-
| colspan="2" | The mid-high byte (bits 16-23) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID1
|-
| colspan="2" | The mid-low byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID0
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetValue'''
|-
| colspan="2" | Set the Value of the Named property 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilter'''
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | filter
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | id
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdent'''
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | buffer
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | id
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx'''
|-
| colspan="2" | Checks to see if any messages are available for 'Buffer' specified  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Send buffer: 0  to 1 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXConfig'''
|-
| colspan="2" | Initialization setting for RX Buffer Config 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Buffer
|-
| colspan="2" | Buffer Number (0 or 1) 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | Config data byte 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Uninit'''
|-
| colspan="2" | Uninitialises the CAN, freeing its connections for general use  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetList'''
|-
| colspan="2" | Get the Filter List of the Named Property 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIdent'''
|-
| colspan="2" | Generic function to get the received message Identifier.   
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | buffer
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilterStd'''
|-
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Filter
|-
| colspan="2" | Filter number 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Hi
|-
| colspan="2" | The high byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Lo
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilterExd'''
|-
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Filter
|-
| colspan="2" | Send filter: 0  to 3 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID3
|-
| colspan="2" | The high byte (bits 24-31) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID2
|-
| colspan="2" | The mid-high byte (bits 16-23) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID1
|-
| colspan="2" | The mid-low byte (bits 8-15) of the ID 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ID0
|-
| colspan="2" | The low byte (bits 0-7) of the ID 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
==Property reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | Selects the CAN channel to be used 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | TX Pin
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | RX Pin
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | TX Remap
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | RX Remap
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Bus Rate
|-
| colspan="2" | selects the Bus Rate (KHz) 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Sample Point
|-
| colspan="2" | selects the Sample Point for bit reading 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | SJW
|-
| colspan="2" | Synchronization Jump Width adjusts the bit clock by 1 to 4 TQ periods 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Fosc
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | BRGCON1
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | BRGCON2
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | BRGCON3
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | ID Type
|-
| colspan="2" | selects the CAN ID type 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Message ID
|-
| colspan="2" | CAN Message ID for Transmit Buffer 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Length
|-
| colspan="2" | Number of valid data bytes in the message 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D0
|-
| colspan="2" | Data byte 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D1
|-
| colspan="2" | Data byte 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D2
|-
| colspan="2" | Data byte 2 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D3
|-
| colspan="2" | Data byte 3 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D4
|-
| colspan="2" | Data byte 4 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D5
|-
| colspan="2" | Data byte 5 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D6
|-
| colspan="2" | Data byte 6 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D7
|-
| colspan="2" | Data byte 7 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Message ID
|-
| colspan="2" | CAN Message ID for Transmit Buffer 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Length
|-
| colspan="2" | Number of valid data bytes in the message 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D0
|-
| colspan="2" | Data byte 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D1
|-
| colspan="2" | Data byte 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D2
|-
| colspan="2" | Data byte 2 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D3
|-
| colspan="2" | Data byte 3 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D4
|-
| colspan="2" | Data byte 4 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D5
|-
| colspan="2" | Data byte 5 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D6
|-
| colspan="2" | Data byte 6 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D7
|-
| colspan="2" | Data byte 7 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Message ID
|-
| colspan="2" | CAN Message ID for Transmit Buffer 2 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Length
|-
| colspan="2" | Number of valid data bytes in the message 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D0
|-
| colspan="2" | Data byte 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D1
|-
| colspan="2" | Data byte 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D2
|-
| colspan="2" | Data byte 2 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D3
|-
| colspan="2" | Data byte 3 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D4
|-
| colspan="2" | Data byte 4 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D5
|-
| colspan="2" | Data byte 5 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D6
|-
| colspan="2" | Data byte 6 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | D7
|-
| colspan="2" | Data byte 7 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Settings
|-
| colspan="2" | Filter setting for Receive Buffer 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Mask
|-
| colspan="2" | Value for Receive Mask 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 0
|-
| colspan="2" | Value for Filter 0 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 1
|-
| colspan="2" | Value for Filter 1 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Settings
|-
| colspan="2" | Filter setting for Receive Buffer 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Mask
|-
| colspan="2" | Value for Receive Mask 1 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 2
|-
| colspan="2" | Value for Filter 2 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 3
|-
| colspan="2" | Value for Filter 3 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 4
|-
| colspan="2" | Value for Filter 4 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | Filter 5
|-
| colspan="2" | Value for Filter 5 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|}


==Macro reference==
==Macro reference==


===CheckRx===
===CheckRx===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx'''
| width="90%" class="mtx-class-macrohead" | '''CheckRx'''
|-
|-
| colspan="2" | Checks to see if any messages are available for 'Buffer' specified  
| colspan="2" | Checks to see if any messages are available for 'Buffer' specified  
Line 968: Line 69:


===GetList===
===GetList===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetList'''
| width="90%" class="mtx-class-macrohead" | '''GetList'''
|-
|-
| colspan="2" | Get the Filter List of the Named Property 
| colspan="2" | Get the Filter List of the Named Property 
Line 987: Line 88:


===GetRxData===
===GetRxData===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxData'''
| width="90%" class="mtx-class-macrohead" | '''GetRxData'''
|-
|-
| colspan="2" | Returns the data byte at index from the buffer specified 
| colspan="2" | Returns the data byte at index from the buffer specified 
Line 1,011: Line 112:


===GetRxDataCount===
===GetRxDataCount===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxDataCount'''
| width="90%" class="mtx-class-macrohead" | '''GetRxDataCount'''
|-
|-
| colspan="2" | Returns the number of valid data bytes in the buffer 
| colspan="2" | Returns the number of valid data bytes in the buffer 
Line 1,030: Line 131:


===GetRxIdent===
===GetRxIdent===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIdent'''
| width="90%" class="mtx-class-macrohead" | '''GetRxIdent'''
|-
|-
| colspan="2" | Generic function to get the received message Identifier.   
| colspan="2" | Generic function to get the received message Identifier.   
Line 1,049: Line 150:


===GetValue===
===GetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetValue'''
| width="90%" class="mtx-class-macrohead" | '''GetValue'''
|-
|-
| colspan="2" | Get the Value of the Named property 
| colspan="2" | Get the Value of the Named property 
Line 1,068: Line 169:


===Init===
===Init===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Init'''
| width="90%" class="mtx-class-macrohead" | '''Init'''
|-
|-
| colspan="2" | Must be called at least once and after every Uninit call to enable the CAN instance  
| colspan="2" | Must be called at least once and after every Uninit call to enable the CAN instance  
Line 1,082: Line 183:


===InitRXConfig===
===InitRXConfig===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXConfig'''
| width="90%" class="mtx-class-macrohead" | '''InitRXConfig'''
|-
|-
| colspan="2" | Initialization setting for RX Buffer Config 
| colspan="2" | Initialization setting for RX Buffer Config 
Line 1,106: Line 207:


===InitRXFilter===
===InitRXFilter===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXFilter'''
| width="90%" class="mtx-class-macrohead" | '''InitRXFilter'''
|-
|-
| colspan="2" | Initialization setting for RX Filter 
| colspan="2" | Initialization setting for RX Filter 
Line 1,130: Line 231:


===InitRXMask===
===InitRXMask===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitRXMask'''
| width="90%" class="mtx-class-macrohead" | '''InitRXMask'''
|-
|-
| colspan="2" | Initialization setting for RX Mask 
| colspan="2" | Initialization setting for RX Mask 
Line 1,154: Line 255:


===InitTXBuffer===
===InitTXBuffer===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitTXBuffer'''
| width="90%" class="mtx-class-macrohead" | '''InitTXBuffer'''
|-
|-
| colspan="2" | Initialization settings for TX Buffers 
| colspan="2" | Initialization settings for TX Buffers 
Line 1,188: Line 289:


===SendBuffer===
===SendBuffer===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBuffer'''
| width="90%" class="mtx-class-macrohead" | '''SendBuffer'''
|-
|-
| colspan="2" | Sends the contents of the buffer previously filled with Set_TX_... calls  
| colspan="2" | Sends the contents of the buffer previously filled with Set_TX_... calls  
Line 1,207: Line 308:


===SetRxFilter===
===SetRxFilter===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilter'''
| width="90%" class="mtx-class-macrohead" | '''SetRxFilter'''
|-
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
Line 1,231: Line 332:


===SetRxFilterExd===
===SetRxFilterExd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilterExd'''
| width="90%" class="mtx-class-macrohead" | '''SetRxFilterExd'''
|-
|-
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
Line 1,270: Line 371:


===SetRxFilterStd===
===SetRxFilterStd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilterStd'''
| width="90%" class="mtx-class-macrohead" | '''SetRxFilterStd'''
|-
|-
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
Line 1,299: Line 400:


===SetRxMask===
===SetRxMask===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMask'''
| width="90%" class="mtx-class-macrohead" | '''SetRxMask'''
|-
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
Line 1,323: Line 424:


===SetRxMaskExd===
===SetRxMaskExd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMaskExd'''
| width="90%" class="mtx-class-macrohead" | '''SetRxMaskExd'''
|-
|-
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
| colspan="2" | Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
Line 1,362: Line 463:


===SetRxMaskStd===
===SetRxMaskStd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMaskStd'''
| width="90%" class="mtx-class-macrohead" | '''SetRxMaskStd'''
|-
|-
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
| colspan="2" | Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter   
Line 1,391: Line 492:


===SetTxData===
===SetTxData===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxData'''
| width="90%" class="mtx-class-macrohead" | '''SetTxData'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 1,455: Line 556:


===SetTxIdent===
===SetTxIdent===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdent'''
| width="90%" class="mtx-class-macrohead" | '''SetTxIdent'''
|-
|-
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
| colspan="2" | Generic function to set Identifier.  CAN registers will be configured depending upon Std/Ext mode setting.  
Line 1,479: Line 580:


===SetTxIdentExd===
===SetTxIdentExd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdentExd'''
| width="90%" class="mtx-class-macrohead" | '''SetTxIdentExd'''
|-
|-
| colspan="2" | Sets the optional 32-bit ID to send along with the standard ID and data in the next CAN message  
| colspan="2" | Sets the optional 32-bit ID to send along with the standard ID and data in the next CAN message  
Line 1,518: Line 619:


===SetTxIdentStd===
===SetTxIdentStd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdentStd'''
| width="90%" class="mtx-class-macrohead" | '''SetTxIdentStd'''
|-
|-
| colspan="2" | Sets the ID to send along with the data in the next CAN message  
| colspan="2" | Sets the ID to send along with the data in the next CAN message  
Line 1,547: Line 648:


===SetValue===
===SetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetValue'''
| width="90%" class="mtx-class-macrohead" | '''SetValue'''
|-
|-
| colspan="2" | Set the Value of the Named property 
| colspan="2" | Set the Value of the Named property 
Line 1,571: Line 672:


===Uninit===
===Uninit===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Uninit'''
| width="90%" class="mtx-class-macrohead" | '''Uninit'''
|-
|-
| colspan="2" | Uninitialises the CAN, freeing its connections for general use  
| colspan="2" | Uninitialises the CAN, freeing its connections for general use  
Line 1,586: Line 687:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 1,657: Line 758:
| colspan="2" | selects the CAN ID type 
| colspan="2" | selects the CAN ID type 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 0
| width="90%" class="mtx-class-propfolder" | TX Buffer 0
|-
|-
|-
|-
Line 1,711: Line 812:
| colspan="2" | Data byte 7 
| colspan="2" | Data byte 7 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 1
| width="90%" class="mtx-class-propfolder" | TX Buffer 1
|-
|-
|-
|-
Line 1,765: Line 866:
| colspan="2" | Data byte 7 
| colspan="2" | Data byte 7 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 2
| width="90%" class="mtx-class-propfolder" | TX Buffer 2
|-
|-
|-
|-
Line 1,819: Line 920:
| colspan="2" | Data byte 7 
| colspan="2" | Data byte 7 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | RX Buffer 0
| width="90%" class="mtx-class-propfolder" | RX Buffer 0
|-
|-
|-
|-
Line 1,843: Line 944:
| colspan="2" | Value for Filter 1 
| colspan="2" | Value for Filter 1 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | RX Buffer 1
| width="90%" class="mtx-class-propfolder" | RX Buffer 1
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

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 Source Code

Please click here to download the component source project: FC_Comp_Source_CAN.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_CAN.fcfx

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.

Macro reference

CheckRx

CheckRx
Checks to see if any messages are available for 'Buffer' specified  
- BYTE Buffer
Send buffer: 0 to 1 
- BYTE Return


GetList

GetList
Get the Filter List of the Named Property 
- STRING Name
 
- STRING Return


GetRxData

GetRxData
Returns the data byte at index from the buffer specified 
- BYTE buffer
The index of the required buffer 
- BYTE index
The index of the required data byte in the buffer 
- BYTE Return


GetRxDataCount

GetRxDataCount
Returns the number of valid data bytes in the buffer 
- BYTE buffer
The index of the required buffer 
- BYTE Return


GetRxIdent

GetRxIdent
Generic function to get the received message Identifier.  
- BYTE buffer
 
- ULONG Return


GetValue

GetValue
Get the Value of the Named property 
- STRING Name
 
- STRING Return


Init

Init
Must be called at least once and after every Uninit call to enable the CAN instance  
- VOID Return


InitRXConfig

InitRXConfig
Initialization setting for RX Buffer Config 
- BYTE Buffer
Buffer Number (0 or 1) 
- BYTE Value
Config data byte 
- VOID Return


InitRXFilter

InitRXFilter
Initialization setting for RX Filter 
- BYTE Filter
 
- ULONG Value
 
- VOID Return


InitRXMask

InitRXMask
Initialization setting for RX Mask 
- BYTE Mask
Mask Number (0 or 1) 
- ULONG Value
 
- VOID Return


InitTXBuffer

InitTXBuffer
Initialization settings for TX Buffers 
- BYTE Buffer
TX Buffer ID = 0,1 or 2 
- ULONG ID
CAN Address 
- BYTE Length
Number of bytes to send 
- STRING Data
Data Array (of Length bytes) 
- VOID Return


SendBuffer

SendBuffer
Sends the contents of the buffer previously filled with Set_TX_... calls  
- BYTE Buffer
Send buffer: 0 to,2 
- VOID Return


SetRxFilter

SetRxFilter
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
- BYTE filter
 
- ULONG id
 
- VOID Return


SetRxFilterExd

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  
- BYTE Filter
Send filter: 0 to 3 
- BYTE ID3
The high byte (bits 24-31) of the ID 
- BYTE ID2
The mid-high byte (bits 16-23) of the ID 
- BYTE ID1
The mid-low byte (bits 8-15) of the ID 
- BYTE ID0
The low byte (bits 0-7) of the ID 
- VOID Return


SetRxFilterStd

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  
- BYTE Filter
Filter number 
- BYTE Hi
The high byte (bits 8-15) of the ID 
- BYTE Lo
The low byte (bits 0-7) of the ID 
- VOID Return


SetRxMask

SetRxMask
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
- BYTE mask
 
- ULONG id
 
- VOID Return


SetRxMaskExd

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  
- BYTE Mask
Mask 0 or 1 
- BYTE ID3
The high byte (bits 24-31) of the ID 
- BYTE ID2
The mid-high byte (bits 16-23) of the ID 
- BYTE ID1
The mid-low byte (bits 8-15) of the ID 
- BYTE ID0
The low byte (bits 0-7) of the ID 
- VOID Return


SetRxMaskStd

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  
- BYTE Mask
Mask number 
- BYTE Hi
The high byte (bits 8-15) of the ID 
- BYTE Lo
The low byte (bits 0-7) of the ID 
- VOID Return


SetTxData

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. 
- BYTE Buffer
Send buffer: 0 to,2 
- BYTE Data_Cnt
The number of bytes of data to add, 0 to 8 
- BYTE D0
Data byte 0 to add 
- BYTE D1
Data byte 1 to add 
- BYTE D2
Data byte 2 to add 
- BYTE D3
Data byte 3 to add 
- BYTE D4
Data byte 4 to add 
- BYTE D5
Data byte 5 to add 
- BYTE D6
Data byte 6 to add 
- BYTE D7
Data byte 7 to add 
- VOID Return


SetTxIdent

SetTxIdent
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
- BYTE buffer
 
- ULONG id
 
- VOID Return


SetTxIdentExd

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


SetTxIdentStd

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


SetValue

SetValue
Set the Value of the Named property 
- STRING Name
 
- STRING Value
 
- VOID Return


Uninit

Uninit
Uninitialises the CAN, freeing its connections for general use  
- VOID Return


Property reference

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