Component: CAN (CAL) (Misc): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 50: | Line 50: | ||
===CheckRx=== | ===CheckRx=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 69: | Line 69: | ||
===GetList=== | ===GetList=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 88: | Line 88: | ||
===GetRxData=== | ===GetRxData=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 112: | Line 112: | ||
===GetRxDataCount=== | ===GetRxDataCount=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 131: | Line 131: | ||
===GetRxIdent=== | ===GetRxIdent=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 150: | Line 150: | ||
===GetValue=== | ===GetValue=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 169: | Line 169: | ||
===Init=== | ===Init=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 183: | Line 183: | ||
===InitRXConfig=== | ===InitRXConfig=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''InitRXConfig''' | ||
|- | |- | ||
| colspan="2" | Initialization setting for RX Buffer Config | | colspan="2" | Initialization setting for RX Buffer Config | ||
| Line 207: | Line 207: | ||
===InitRXFilter=== | ===InitRXFilter=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''InitRXFilter''' | ||
|- | |- | ||
| colspan="2" | Initialization setting for RX Filter | | colspan="2" | Initialization setting for RX Filter | ||
| Line 231: | Line 231: | ||
===InitRXMask=== | ===InitRXMask=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''InitRXMask''' | ||
|- | |- | ||
| colspan="2" | Initialization setting for RX Mask | | colspan="2" | Initialization setting for RX Mask | ||
| Line 255: | Line 255: | ||
===InitTXBuffer=== | ===InitTXBuffer=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''InitTXBuffer''' | ||
|- | |- | ||
| colspan="2" | Initialization settings for TX Buffers | | colspan="2" | Initialization settings for TX Buffers | ||
| Line 289: | Line 289: | ||
===SendBuffer=== | ===SendBuffer=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 308: | Line 308: | ||
===SetRxFilter=== | ===SetRxFilter=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 332: | Line 332: | ||
===SetRxFilterExd=== | ===SetRxFilterExd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 371: | Line 371: | ||
===SetRxFilterStd=== | ===SetRxFilterStd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 400: | Line 400: | ||
===SetRxMask=== | ===SetRxMask=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 424: | Line 424: | ||
===SetRxMaskExd=== | ===SetRxMaskExd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 463: | Line 463: | ||
===SetRxMaskStd=== | ===SetRxMaskStd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 492: | Line 492: | ||
===SetTxData=== | ===SetTxData=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 556: | Line 556: | ||
===SetTxIdent=== | ===SetTxIdent=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 580: | Line 580: | ||
===SetTxIdentExd=== | ===SetTxIdentExd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 619: | Line 619: | ||
===SetTxIdentStd=== | ===SetTxIdentStd=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 648: | Line 648: | ||
===SetValue=== | ===SetValue=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 672: | Line 672: | ||
===Uninit=== | ===Uninit=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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 687: | Line 687: | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 758: | Line 758: | ||
| colspan="2" | selects the CAN ID type | | colspan="2" | selects the CAN ID type | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | TX Buffer 0 | ||
|- | |- | ||
|- | |- | ||
| Line 812: | Line 812: | ||
| colspan="2" | Data byte 7 | | colspan="2" | Data byte 7 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | TX Buffer 1 | ||
|- | |- | ||
|- | |- | ||
| Line 866: | Line 866: | ||
| colspan="2" | Data byte 7 | | colspan="2" | Data byte 7 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | TX Buffer 2 | ||
|- | |- | ||
|- | |- | ||
| Line 920: | Line 920: | ||
| colspan="2" | Data byte 7 | | colspan="2" | Data byte 7 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | RX Buffer 0 | ||
|- | |- | ||
|- | |- | ||
| Line 944: | Line 944: | ||
| colspan="2" | Value for Filter 1 | | colspan="2" | Value for Filter 1 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | 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 | |
| Buffer | |
| Send buffer: 0 to 1 | |
| Return | |
GetList
| GetList | |
| Get the Filter List of the Named Property | |
| Name | |
| Return | |
GetRxData
| GetRxData | |
| Returns the data byte at index from the buffer specified | |
| buffer | |
| The index of the required buffer | |
| index | |
| The index of the required data byte in the buffer | |
| Return | |
GetRxDataCount
| GetRxDataCount | |
| Returns the number of valid data bytes in the buffer | |
| buffer | |
| The index of the required buffer | |
| Return | |
GetRxIdent
| GetRxIdent | |
| Generic function to get the received message Identifier. | |
| buffer | |
| Return | |
GetValue
| GetValue | |
| Get the Value of the Named property | |
| Name | |
| Return | |
Init
| Init | |
| Must be called at least once and after every Uninit call to enable the CAN instance | |
| Return | |
InitRXConfig
| InitRXConfig | |
| Initialization setting for RX Buffer Config | |
| Buffer | |
| Buffer Number (0 or 1) | |
| Value | |
| Config data byte | |
| Return | |
InitRXFilter
| InitRXFilter | |
| Initialization setting for RX Filter | |
| Filter | |
| Value | |
| Return | |
InitRXMask
| InitRXMask | |
| Initialization setting for RX Mask | |
| Mask | |
| Mask Number (0 or 1) | |
| Value | |
| Return | |
InitTXBuffer
SendBuffer
| SendBuffer | |
| Sends the contents of the buffer previously filled with Set_TX_... calls | |
| Buffer | |
| Send buffer: 0 to,2 | |
| Return | |
SetRxFilter
| SetRxFilter | |
| Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting. | |
| filter | |
| id | |
| Return | |
SetRxFilterExd
SetRxFilterStd
SetRxMask
| SetRxMask | |
| Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting. | |
| mask | |
| id | |
| Return | |
SetRxMaskExd
SetRxMaskStd
SetTxData
SetTxIdent
| SetTxIdent | |
| Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting. | |
| buffer | |
| id | |
| Return | |
SetTxIdentExd
SetTxIdentStd
SetValue
| SetValue | |
| Set the Value of the Named property | |
| Name | |
| Value | |
| Return | |
Uninit
| Uninit | |
| Uninitialises the CAN, freeing its connections for general use | |
| Return | |