Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

API Description

This section explains the application programming interface of the CANopen stack in detail. Before explaining the API functions in detail, the overall philosophy of the CANopen implementation may help to understand the naming conventions and data to function relationship.

The CANopen stack is implemented in an object oriented way:

  1. The data is strictly separated from the function. The data of a module is collected within a C structure and is called: class.
  2. The CANopen stack allocates no memory. The memory must be allocated within the device configuration or within the application. The allocated memory of a class is called: object
  3. The function of a class needs at least the reference to an object of that class type. As a convention, the functions expects this reference as first parameter. This reference is in most object oriented literature the this-pointer. Within the CANopen stack the name of this reference is an abbreviation of the class to highlight the membership of the function.

The following example source explains the principle implementation of a hypothetical module in this object oriented philosophy.all functions of µC/CAN in detail.