Jump to content

CANpie: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Dolores88 (talk | contribs)
Fixed link to reference 2
Dolores88 (talk | contribs)
Added some references and added CiA 603 spec. (time-stamping)
Line 7: Line 7:


[[Image:CANpieFD_Logo.png|right|thumb|300px|CANpie FD logo]]
[[Image:CANpieFD_Logo.png|right|thumb|300px|CANpie FD logo]]
The project was established in 2003 by MicroControl and is licensed under [[GNU Lesser General Public License|LGPL version 3]]. The current version of the CANpie API<ref>http://www.microcontrol.net/download/canpie/canpie_user_v3r00.pdf</ref> covers both classical CAN frames as well as [[CAN FD|ISO CAN FD]] <ref>https://www.can-cia.org/fileadmin/resources/documents/proceedings/2012_hartwich.pdf</ref> frames. The API is designed for embedded control applications as well as for PC interface boards: embedded microcontrollers are programmed in C, a C++ API is provided for OS independent access to interface boards. The API provides ISO/OSI Layer-2 (Data Link Layer) functionality. It is not the intention of CANpie to incorporate higher layer functionality (e.g. CANopen, J1939).
The project was established in 2001<ref>https://sourceforge.net/projects/canpie/files/?source=navbar</ref> by MicroControl and is licensed under [[GNU Lesser General Public License|LGPL version 3]]. The current version of the CANpie API<ref>http://www.microcontrol.net/download/canpie/canpie_user_v3r00.pdf</ref> covers both classical CAN frames as well as [[CAN FD|ISO CAN FD]]<ref>https://www.can-cia.org/fileadmin/resources/documents/proceedings/2012_hartwich.pdf</ref> frames. The API is designed for embedded control applications as well as for PC interface boards: embedded microcontrollers are programmed in C, a C++ API is provided for OS independent access to interface boards. The API provides ISO/OSI Layer-2 (Data Link Layer) functionality. It is not the intention of CANpie to incorporate higher layer functionality (e.g. [[CANopen]], [[SAE J1939]]).


==Driver Priciple==
==Driver Priciple==
The CANpie API supports the concept of hardware message buffers (mailboxes) with a total limit of 255 buffers. A message buffer has a unique direction (receive or transmit). As an option it is possible to connect a [[FIFO (computing and electronics)|FIFO]] with arbitrary size to a message buffer for both transfer directions. The total number of CAN channels is limited to 255, the API provides a method to gather information about the features of each CAN hardware channel. This is especially important for an application designer who wants to write the code only once.
The CANpie API supports the concept of hardware message buffers (mailboxes) with a total limit of 255 buffers. A message buffer has a unique direction (receive or transmit). As an option it is possible to connect a [[FIFO (computing and electronics)|FIFO]] with arbitrary size to a message buffer for both transfer directions. The total number of CAN channels is limited to 255, the API provides a method to gather information about the features of each CAN hardware channel. This is especially important for an application designer who wants to write the code only once. The CAN frame time-stamping (specified by [[CAN in Automation|CiA]] 603, CAN Frame time-stamping – Requirements for network time management<ref>https://www.can-cia.org/standardization/specifications/</ref>) is supported with a resolution of 1 nano-second.


==Usage==
==Usage==
Line 53: Line 53:
* [https://github.com/canpie/CANpie CANpie project site]
* [https://github.com/canpie/CANpie CANpie project site]
* [https://can-newsletter.org/software/software-miscellaneous/nr_canpie_micro-control_140225 CAN newsletter 2014-02-25]
* [https://can-newsletter.org/software/software-miscellaneous/nr_canpie_micro-control_140225 CAN newsletter 2014-02-25]
* [http://www2.parc.com/spl/projects/modrobots/publications/pdf/IROS01.pdf Software Architecture for Modular Self-Reconfigurable Robots, Xerox Palo Alto Research Center]
* [http://autosar.org/ AUTOSAR website]
* [http://autosar.org/ AUTOSAR website]
* [http://sourceforge.net/projects/can4linux/ can4linux project site]
* [http://sourceforge.net/projects/can4linux/ can4linux project site]
* [https://github.com/linux-can/ SocketCAN project site]
* [https://github.com/linux-can/ SocketCAN project site]
* [https://register.dpma.de/DPMAregister/pat/register?AKZ=1020040208808 Patent applied for SocketCAN (German language)]


[[Category:CAN bus]]
[[Category:CAN bus]]

Revision as of 10:27, 23 April 2017

CANpie (CAN Programming Interface Environment) is an open source project and pursues the objective of creating and establishing an open and standardized software API for access to the CAN bus.

CANpie FD logo

The project was established in 2001[1] by MicroControl and is licensed under LGPL version 3. The current version of the CANpie API[2] covers both classical CAN frames as well as ISO CAN FD[3] frames. The API is designed for embedded control applications as well as for PC interface boards: embedded microcontrollers are programmed in C, a C++ API is provided for OS independent access to interface boards. The API provides ISO/OSI Layer-2 (Data Link Layer) functionality. It is not the intention of CANpie to incorporate higher layer functionality (e.g. CANopen, SAE J1939).

Driver Priciple

The CANpie API supports the concept of hardware message buffers (mailboxes) with a total limit of 255 buffers. A message buffer has a unique direction (receive or transmit). As an option it is possible to connect a FIFO with arbitrary size to a message buffer for both transfer directions. The total number of CAN channels is limited to 255, the API provides a method to gather information about the features of each CAN hardware channel. This is especially important for an application designer who wants to write the code only once. The CAN frame time-stamping (specified by CiA 603, CAN Frame time-stamping – Requirements for network time management[4]) is supported with a resolution of 1 nano-second.

Usage

CANpie Structure

The following code snippet shows the initialisation of a microcontroller.

#include "cp_core.h"  // CANpie core functions

void MyCanInit(void)
{
   CpPort_ts  tsCanPortT;   // logical CAN port
   //---------------------------------------------------
   // setup the CAN controller / open a physical CAN
   // port
   //
   memset(&tsCanPortT, 0, sizeof(CpPort_ts));
   CpCoreDriverInit(eCP_CHANNEL_1, &tsCanPortT, 0);
   //---------------------------------------------------
   // setup 500 kBit/s
   //
   CpCoreBitrate(&tsCanPortT,
                 eCP_BITRATE_500K,
                 eCP_BITRATE_NONE);
   //---------------------------------------------------
   // start CAN operation
   //
   CpCoreCanMode(&tsCanPortT, eCP_MODE_OPERATION);
   //.. now we are operational
}

Similar projects

For the Linux operating system the projects can4linux and SocketCAN provide support for Classical CAN and ISO CAN FD. The commercial AUTOSAR specification supports CAN FD since version 4.3 and is available only for AUTOSAR partners.

References