Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of RTR and others #55

Open
fkaraokur opened this issue Feb 9, 2021 · 4 comments
Open

Use of RTR and others #55

fkaraokur opened this issue Feb 9, 2021 · 4 comments

Comments

@fkaraokur
Copy link

When I examine the details, the following statement goes!

/ * 32 bit CAN_ID + EFF / RTR / ERR flags * /

So how do we express this in code?

@fkaraokur
Copy link
Author

Please check this line https://github.com/jxltom/micropython-mcp2515/blob/8d2415f368de271d3b2ba7dea2e7cf9fb2c076cf/demo.py#L57

I am using mcp2515 with arduino. this is probably the python code.

Actually I don't use RTR. But how should I express this? How to write a statement like this "CAN_no_RTR"?

tx_frame.FIR.B.FF = CAN_frame_ext;
second I need to convert this expression. This is taken from another library.

@fkaraokur
Copy link
Author

fkaraokur commented Feb 10, 2021

CAN_frame_t tx_frame;
    tx_frame.FIR.B.FF = CAN_frame_ext;
    tx_frame.MsgID = 0x01100033;
    tx_frame.FIR.B.DLC = 8;
    tx_frame.FIR.B.RTR = CAN_no_RTR;
    tx_frame.data.u8[0] = 0x01;
    tx_frame.data.u8[1] = 0x00;
    tx_frame.data.u8[2] = 0x00;
    tx_frame.data.u8[3] = 0x00;
    tx_frame.data.u8[4] = 0x00;
    tx_frame.data.u8[5] = 0x00;
    tx_frame.data.u8[6] = 0x00;
    tx_frame.data.u8[7] = 0x00;
    ESP32Can.CANWriteFrame(&tx_frame);

In summary, I need to convert the above codes. These codes belong to another library. But RTR and EXT are also specified. In this library it is written together. I could not convert these codes.

@fkaraokur
Copy link
Author

prepareIdKutu kimliğinde RTR'yi ayarlamak için yöntemi kullanabilirsiniz.

example code pls thanks

@fkaraokur
Copy link
Author

prepareIdKutu kimliğinde RTR'yi ayarlamak için yöntemi kullanabilirsiniz.

example code pls thanks

void MCP2515::prepareId(uint8_t *buffer, const bool ext, const uint32_t id)

very complicated. And won't the ext and RTR be prepaired at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant