22 * @ingroup userapi |
22 * @ingroup userapi |
23 */ |
23 */ |
24 |
24 |
25 /** |
25 /** |
26 * @ingroup can |
26 * @ingroup can |
27 * @{ |
|
28 */ |
|
29 |
|
30 /** |
|
31 * @ingroup can |
|
32 * @brief Unload CAN driver interface |
27 * @brief Unload CAN driver interface |
33 * @param handle The library handle |
28 * @param handle The library handle |
34 * @return 0 if succes |
29 * @return |
|
30 * - 0 is returned upon success. |
|
31 * - -1 is returned if the CAN driver interface can't be unloaded. |
35 */ |
32 */ |
36 UNS8 UnLoadCanDriver(LIB_HANDLE handle); |
33 UNS8 UnLoadCanDriver(LIB_HANDLE handle); |
37 |
34 |
38 /** |
35 /** |
39 * @ingroup can |
36 * @ingroup can |
40 * @brief Load CAN driver interface |
37 * @brief Load CAN driver interface. |
41 * @param *driver_name The location of the library to load |
38 * @param *driver_name The location of the library to load |
42 * @return handle The library handle |
39 * @return |
|
40 * - handle of the CAN driver interface is returned upon success. |
|
41 * - NULL is returned if the CAN driver interface can't be loaded. |
43 */ |
42 */ |
44 LIB_HANDLE LoadCanDriver(const char* driver_name); |
43 LIB_HANDLE LoadCanDriver(const char* driver_name); |
45 |
44 |
46 /** |
45 /** |
47 * @brief Send a CAN message |
46 * @brief Send a CAN message |
48 * @param port CanFestival file descriptor |
47 * @param port CanFestival file descriptor |
49 * @param *m The message to send |
48 * @param *m The CAN message to send |
50 * @return 0 if succes |
49 * @return 0 if succes |
51 */ |
50 */ |
52 UNS8 canSend(CAN_PORT port, Message *m); |
51 UNS8 canSend(CAN_PORT port, Message *m); |
53 |
52 |
54 /** |
53 /** |
55 * @ingroup can |
54 * @ingroup can |
56 * @brief Open a CANopen device |
55 * @brief Open a CANOpen device |
57 * @param *board Pointer on the board structure that contains busname and baudrate |
56 * @param *board Pointer to the board structure that contains busname and baudrate |
58 * @param *d Pointer on the CAN object data structure |
57 * @param *d Pointer to the CAN object data structure |
59 * @return port CanFestival file descriptor |
58 * @return |
|
59 * - CanFestival file descriptor is returned upon success. |
|
60 * - NULL is returned if the CANOpen board can't be opened. |
60 */ |
61 */ |
61 CAN_PORT canOpen(s_BOARD *board, CO_Data * d); |
62 CAN_PORT canOpen(s_BOARD *board, CO_Data * d); |
62 |
63 |
63 /** |
64 /** |
64 * @ingroup can |
65 * @ingroup can |
65 * @brief Close a CANopen device |
66 * @brief Close a CANOpen device |
66 * @param *d Pointer on the CAN object data structure |
67 * @param *d Pointer to the CAN object data structure |
67 * @return 0 if succes |
68 * @return |
|
69 * - 0 is returned upon success. |
|
70 * - errorcode if error. (if implemented) |
68 */ |
71 */ |
69 int canClose(CO_Data * d); |
72 int canClose(CO_Data * d); |
70 |
73 |
71 /** |
74 /** |
72 * @ingroup can |
75 * @ingroup can |
73 * @brief Change the CANopen device baudrate |
76 * @brief Change the CANOpen device baudrate |
74 * @param port CanFestival file descriptor |
77 * @param port CanFestival file descriptor |
75 * @param *baud The new baudrate to assign |
78 * @param *baud The new baudrate to assign |
76 * @return 0 if succes |
79 * @return |
|
80 * - 0 is returned upon success or if not supported by the CAN driver. |
|
81 * - errorcode from the CAN driver is returned if an error occurs. (if implemented in the CAN driver) |
77 */ |
82 */ |
78 UNS8 canChangeBaudRate(CAN_PORT port, char* baud); |
83 UNS8 canChangeBaudRate(CAN_PORT port, char* baud); |
79 /** @} */ |
84 |
80 |
85 |
81 |
86 |
82 #ifdef __cplusplus |
87 #ifdef __cplusplus |
83 }; |
88 }; |
84 #endif |
89 #endif |