Read CAN Tx Mailbox ID

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaRe_2236336
Level 3
Level 3
First like given

Is there a way to read a CAN bus mailbox ID that has been set in the configuration window? I know I can use

   

CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID << 21u));

   

to write a mailbox ID but I cannot find a way to read the ID in the API or seem to locate where its stored in the generated code. Basically trying to read the ID so that I can then modify it based on external inputs. 

0 Likes
2 Replies
harshadap_76
Employee
Employee
First like received

Hi Regand,

   

You can use CY_GET_REG32 ((reg32 *)&CAN_TX[mailbox].txid).

   

Could you please try once and let me know?

   

Please feel free to update for any clarification.

   

Thanks and Regards

   

Harshada

0 Likes
DaRe_2236336
Level 3
Level 3
First like given

Hey thanks for your response, I actually just found what I had been looking for which is exactly what you recommended, and came here to close this issue. I found it at http://www.cypress.com/file/185351/download on age 46, tons of useful stuff. Thanks again, this works perfectly for what I was attempting to do.

0 Likes