edouard@618: #ifndef CANFESTIVAL_H_ edouard@618: #define CANFESTIVAL_H_ edouard@618: edouard@618: #include "timerscfg.h" edouard@618: #include "can_driver.h" edouard@618: #include "data.h" edouard@618: #include "timers_driver.h" edouard@618: edouard@618: edouard@618: /** @defgroup userapi User API */ edouard@618: edouard@618: /** @defgroup can CAN management edouard@618: * @ingroup userapi edouard@618: */ edouard@618: edouard@618: /** edouard@618: * @brief Send a CAN message edouard@618: * @param port CanFestival file descriptor edouard@618: * @param *m The CAN message to send edouard@618: * @return 0 if succes edouard@618: */ edouard@618: UNS8 canSend(CAN_PORT port, Message *m); edouard@618: edouard@618: /** edouard@618: * @ingroup can edouard@618: * @brief Open a CANOpen device edouard@618: * @param *board Pointer to the board structure that contains busname and baudrate edouard@618: * @param *d Pointer to the CAN object data structure edouard@618: * @return edouard@618: * - CanFestival file descriptor is returned upon success. edouard@618: * - NULL is returned if the CANOpen board can't be opened. edouard@618: */ edouard@618: CAN_PORT canOpen(s_BOARD *board, CO_Data * d); edouard@618: edouard@618: /** edouard@618: * @ingroup can edouard@618: * @brief Close a CANOpen device edouard@618: * @param *d Pointer to the CAN object data structure edouard@618: * @return edouard@618: * - 0 is returned upon success. edouard@618: * - errorcode if error. (if implemented) edouard@618: */ edouard@618: int canClose(CO_Data * d); edouard@618: edouard@618: /** edouard@618: * @ingroup can edouard@618: * @brief Change the CANOpen device baudrate edouard@618: * @param port CanFestival file descriptor edouard@618: * @param *baud The new baudrate to assign edouard@618: * @return edouard@618: * - 0 is returned upon success or if not supported by the CAN driver. edouard@618: * - errorcode from the CAN driver is returned if an error occurs. (if implemented in the CAN driver) edouard@618: */ edouard@618: UNS8 canChangeBaudRate(CAN_PORT port, char* baud); edouard@618: edouard@618: #endif