Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SDC21XX_Motor SDC21XX_Motor
CANopen.h@0:0f99b1d63054, 2016-05-30 (annotated)
- Committer:
- kkoichy
- Date:
- Mon May 30 11:28:35 2016 +0000
- Revision:
- 0:0f99b1d63054
- Child:
- 2:3a8e39e5e13f
V1.0; First Upload; Class CANopen created, allows to send command through CAN bus using CANopen protocol; 2 instructions created : Initiate SDO Down- & Upload
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kkoichy | 0:0f99b1d63054 | 1 | #ifndef CANOPEN_H |
| kkoichy | 0:0f99b1d63054 | 2 | #define CANOPEN_H |
| kkoichy | 0:0f99b1d63054 | 3 | |
| kkoichy | 0:0f99b1d63054 | 4 | #include "mbed.h" |
| kkoichy | 0:0f99b1d63054 | 5 | #include "CAN.h" |
| kkoichy | 0:0f99b1d63054 | 6 | |
| kkoichy | 0:0f99b1d63054 | 7 | |
| kkoichy | 0:0f99b1d63054 | 8 | namespace mbed { |
| kkoichy | 0:0f99b1d63054 | 9 | class CANopen { |
| kkoichy | 0:0f99b1d63054 | 10 | |
| kkoichy | 0:0f99b1d63054 | 11 | public : |
| kkoichy | 0:0f99b1d63054 | 12 | |
| kkoichy | 0:0f99b1d63054 | 13 | CANopen(short _id, CAN * _can); |
| kkoichy | 0:0f99b1d63054 | 14 | CANopen(short _id, CAN * _can, int _baud); |
| kkoichy | 0:0f99b1d63054 | 15 | int Send_Initiate_SDO_Download(short index, short subindex, long data); |
| kkoichy | 0:0f99b1d63054 | 16 | int Send_Initiate_SDO_Upload(short index, short subindex); |
| kkoichy | 0:0f99b1d63054 | 17 | short GetNodeID(void); |
| kkoichy | 0:0f99b1d63054 | 18 | void SetNodeID(short _id); |
| kkoichy | 0:0f99b1d63054 | 19 | |
| kkoichy | 0:0f99b1d63054 | 20 | private : |
| kkoichy | 0:0f99b1d63054 | 21 | |
| kkoichy | 0:0f99b1d63054 | 22 | |
| kkoichy | 0:0f99b1d63054 | 23 | protected : |
| kkoichy | 0:0f99b1d63054 | 24 | |
| kkoichy | 0:0f99b1d63054 | 25 | short node_id; |
| kkoichy | 0:0f99b1d63054 | 26 | CAN * can; |
| kkoichy | 0:0f99b1d63054 | 27 | |
| kkoichy | 0:0f99b1d63054 | 28 | |
| kkoichy | 0:0f99b1d63054 | 29 | |
| kkoichy | 0:0f99b1d63054 | 30 | };//end class |
| kkoichy | 0:0f99b1d63054 | 31 | |
| kkoichy | 0:0f99b1d63054 | 32 | |
| kkoichy | 0:0f99b1d63054 | 33 | |
| kkoichy | 0:0f99b1d63054 | 34 | }//end namespace |
| kkoichy | 0:0f99b1d63054 | 35 | |
| kkoichy | 0:0f99b1d63054 | 36 | #endif |