I am currently tinkering away with setting up my own CAN implementation, but I had found that the CAN_LPC18xx source has all the functionality that I would need. I would love to use the functions within that source, as - from what I gather - they perform the operations that I need and I assume the standard de-facto API. While this question may seem rather odd - as I instantly think that I should just include the header file "CAN_LPC18xx.h" and I have access to those functions, but the problem is - all of the functions that are declared in the source are all static. As such, I cannot access those functions OUTSIDE from the CAN_LPC18xx.c transportation unit. Is there any way I can access and use the functions within that API\Driver?
I was able to find the source online via GitHub to demonstrate that the functions are not accessible from the outside of the source.
CAN_LPC18xx.c - from GitHub Uploaded by Joachim Krech
To provide further, I would like to access these functions in the CAN_LPC18xx.c:
static int32_t CAN0_Uninitialize (...) {...} static int32_t CAN1_Uninitialize (...) {...} static int32_t CAN0_PowerControl (...) {...} static int32_t CAN1_PowerControl (...) {...} static int32_t CAN0_SetBitrate (...) {...} static int32_t CAN1_SetBitrate (...) {...} static int32_t CAN0_SetMode (...) {...} static int32_t CAN1_SetMode (...) {...} ... etc
How can I access these functions properly and utilize them in my project?
Thanks
Hi Nicholas,
API in this driver is exposed through a structure(s) containing function pointers (those static functions are exposed through the structure).
For example structure:
ARM_DRIVER_CAN Driver_CAN0
You can also check API documentation with usage examples on the following link: www.keil.com/.../group__can__interface__gr.html
Best regards, Milorad
Thank you for sharing! This is a clever way of programming that I didn't realize was possible. Learn something new everyday! ;)
Thank you again