library for C++ CANOpen implementation. mbed independant, but is easy to attach into with mbed.
Dependents: ppCANOpen_Example DISCO-F746NG_rtos_test
Example:
Import programppCANOpen_Example
I am no longer actively working on the ppCANOpen library, however, I want to publish this project so that anyone who wants to pick up any of the pieces can have a good example. This is a a project I was working on using the ppCANOpen library. It has a pretty in deep use of the object dictionary structure. And a number of functions to control high voltage pinball drivers, if you're into that sort of thing.
include/canopen_api.h@5:22a337cdc0e3, 2016-02-13 (annotated)
- Committer:
- ptpaterson
- Date:
- Sat Feb 13 20:22:59 2016 +0000
- Revision:
- 5:22a337cdc0e3
- Parent:
- 4:2034b04c86d2
PDO receive complete
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ptpaterson | 0:1865da4a634c | 1 | /** |
ptpaterson | 0:1865da4a634c | 2 | ****************************************************************************** |
ptpaterson | 1:666f30541db5 | 3 | * @file |
ptpaterson | 0:1865da4a634c | 4 | * @author Paul Paterson |
ptpaterson | 1:666f30541db5 | 5 | * @version |
ptpaterson | 0:1865da4a634c | 6 | * @date 2015-12-14 |
ptpaterson | 0:1865da4a634c | 7 | * @brief CANOpen implementation library |
ptpaterson | 0:1865da4a634c | 8 | ****************************************************************************** |
ptpaterson | 0:1865da4a634c | 9 | * @attention |
ptpaterson | 0:1865da4a634c | 10 | * |
ptpaterson | 0:1865da4a634c | 11 | * <h2><center>© COPYRIGHT(c) 2015 Paul Paterson |
ptpaterson | 0:1865da4a634c | 12 | * |
ptpaterson | 0:1865da4a634c | 13 | * All rights reserved. |
ptpaterson | 1:666f30541db5 | 14 | |
ptpaterson | 0:1865da4a634c | 15 | This program is free software: you can redistribute it and/or modify |
ptpaterson | 0:1865da4a634c | 16 | it under the terms of the GNU General Public License as published by |
ptpaterson | 0:1865da4a634c | 17 | the Free Software Foundation, either version 3 of the License, or |
ptpaterson | 0:1865da4a634c | 18 | (at your option) any later version. |
ptpaterson | 1:666f30541db5 | 19 | |
ptpaterson | 0:1865da4a634c | 20 | This program is distributed in the hope that it will be useful, |
ptpaterson | 0:1865da4a634c | 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
ptpaterson | 0:1865da4a634c | 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ptpaterson | 0:1865da4a634c | 23 | GNU General Public License for more details. |
ptpaterson | 1:666f30541db5 | 24 | |
ptpaterson | 0:1865da4a634c | 25 | You should have received a copy of the GNU General Public License |
ptpaterson | 0:1865da4a634c | 26 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
ptpaterson | 0:1865da4a634c | 27 | */ |
ptpaterson | 1:666f30541db5 | 28 | |
ptpaterson | 3:12b3c25bdeba | 29 | #ifndef PPCAN_CANOPEN_API_H |
ptpaterson | 3:12b3c25bdeba | 30 | #define PPCAN_CANOPEN_API_H |
ptpaterson | 1:666f30541db5 | 31 | |
ptpaterson | 5:22a337cdc0e3 | 32 | #include "stdint.h" |
ptpaterson | 5:22a337cdc0e3 | 33 | |
ptpaterson | 0:1865da4a634c | 34 | #ifdef __cplusplus |
ptpaterson | 0:1865da4a634c | 35 | extern "C" { |
ptpaterson | 0:1865da4a634c | 36 | #endif |
ptpaterson | 0:1865da4a634c | 37 | |
ptpaterson | 4:2034b04c86d2 | 38 | /*========================================================================= |
ptpaterson | 4:2034b04c86d2 | 39 | * Forward declarations |
ptpaterson | 4:2034b04c86d2 | 40 | *========================================================================= |
ptpaterson | 5:22a337cdc0e3 | 41 | */ |
ptpaterson | 4:2034b04c86d2 | 42 | struct CanOpenMessage; |
ptpaterson | 4:2034b04c86d2 | 43 | |
ptpaterson | 4:2034b04c86d2 | 44 | /*========================================================================= |
ptpaterson | 4:2034b04c86d2 | 45 | * API functions |
ptpaterson | 4:2034b04c86d2 | 46 | *========================================================================= |
ptpaterson | 4:2034b04c86d2 | 47 | */ |
ptpaterson | 4:2034b04c86d2 | 48 | |
ptpaterson | 5:22a337cdc0e3 | 49 | typedef void (* ServiceProviderRxInterruptCallback)(void *pServiceObject); |
ptpaterson | 5:22a337cdc0e3 | 50 | typedef void (* ServiceProviderTickCallback) (void *pServiceObject); |
ptpaterson | 5:22a337cdc0e3 | 51 | |
ptpaterson | 5:22a337cdc0e3 | 52 | int CanOpenApiInit (void *object, ServiceProviderRxInterruptCallback rxCallback, ServiceProviderTickCallback tickCallback); |
ptpaterson | 2:c724ff3a4e4d | 53 | |
ptpaterson | 5:22a337cdc0e3 | 54 | int CanOpenApiRead (CanOpenMessage * canOpenMsg); |
ptpaterson | 5:22a337cdc0e3 | 55 | int CanOpenApiWrite (CanOpenMessage * canOpenMsg); |
ptpaterson | 5:22a337cdc0e3 | 56 | |
ptpaterson | 5:22a337cdc0e3 | 57 | uint32_t CanOpenApiGetHardwareTime (void); |
ptpaterson | 0:1865da4a634c | 58 | |
ptpaterson | 0:1865da4a634c | 59 | #ifdef __cplusplus |
ptpaterson | 0:1865da4a634c | 60 | }; |
ptpaterson | 0:1865da4a634c | 61 | #endif |
ptpaterson | 1:666f30541db5 | 62 | |
ptpaterson | 3:12b3c25bdeba | 63 | #endif /* PPCAN_CANOPEN_API_H */ |