Arduino-STM32-CAN icon indicating copy to clipboard operation
Arduino-STM32-CAN copied to clipboard

convert to user-friendly library

Open s54b32julian opened this issue 4 years ago • 5 comments
trafficstars

hello, first thanks for your work! Maybe for usability and to simplify the code for the enduser, convert to a library? So that the main code dont get overload with background tasks. Only include the lib, init the CAN and call constructors like ReadCan or SendCan in the loop.

s54b32julian avatar Apr 03 '21 15:04 s54b32julian

As you can see from the source, the usage of the BxCan register is different for each model. The code I provide doesn't work properly on other models.

Even if it is converted to a library, it will be a library for each model. Perhaps such a library is awkward to use.

We need A generic library that can be used on all models. This can only be created with ST-Micro.

nopnop2002 avatar Apr 03 '21 22:04 nopnop2002

Maybe you could merge all in one library and the user make config with #define at the begin of the sketch.

like ` #define MCU F40x //MCU variant

#define Channels 1 //1 or 2 available channels

#define RX1 PA10 //RX pin Channel 1

#define TX1 PA9 //TX pin Channel 2 `

s54b32julian avatar Apr 04 '21 07:04 s54b32julian

as far as I know F103 and others are too different. They are almost different code. Check with my code. Almost impossible to merge,

nopnop2002 avatar Apr 04 '21 07:04 nopnop2002

hi, are you able to create an example arduino program for one IC, then just change the included .h file? I am struggling to understand how to use your code

phoenixs3 avatar May 08 '22 19:05 phoenixs3

are you able to create an example arduino program for one IC

What is one IC?

nopnop2002 avatar May 08 '22 22:05 nopnop2002

I've ported the code to a number of STM32s.

As a result, it turned out that it is completely impossible to support many boards with one library.

nopnop2002 avatar Sep 10 '23 08:09 nopnop2002