etisserant@145: #ifndef UNIX_H_ etisserant@145: #define UNIX_H_ etisserant@145: etisserant@251: #ifdef __cplusplus etisserant@251: extern "C" { etisserant@251: #endif etisserant@251: etisserant@145: #include "timerscfg.h" etisserant@145: #include "can_driver.h" etisserant@145: #include "data.h" etisserant@167: #include "timers_driver.h" greg@329: etisserant@391: #ifndef __KERNEL__ etisserant@145: #include etisserant@391: #endif etisserant@391: etisserant@145: typedef void* LIB_HANDLE; etisserant@145: greg@528: /** @defgroup userapi User API */ greg@528: greg@528: /** @defgroup can CAN management greg@528: * @ingroup userapi greg@528: */ greg@528: greg@528: /** greg@528: * @ingroup can greg@528: * @brief Unload CAN driver interface greg@528: * @param handle The library handle greg@561: * @return greg@561: * - 0 is returned upon success. greg@561: * - -1 is returned if the CAN driver interface can't be unloaded. greg@528: */ etisserant@145: UNS8 UnLoadCanDriver(LIB_HANDLE handle); greg@528: greg@528: /** greg@528: * @ingroup can greg@561: * @brief Load CAN driver interface. greg@528: * @param *driver_name The location of the library to load greg@561: * @return greg@561: * - handle of the CAN driver interface is returned upon success. greg@561: * - NULL is returned if the CAN driver interface can't be loaded. greg@528: */ etisserant@480: LIB_HANDLE LoadCanDriver(const char* driver_name); greg@528: greg@528: /** greg@528: * @brief Send a CAN message greg@528: * @param port CanFestival file descriptor greg@561: * @param *m The CAN message to send greg@528: * @return 0 if succes greg@528: */ etisserant@145: UNS8 canSend(CAN_PORT port, Message *m); greg@528: greg@528: /** greg@528: * @ingroup can greg@561: * @brief Open a CANOpen device greg@561: * @param *board Pointer to the board structure that contains busname and baudrate greg@561: * @param *d Pointer to the CAN object data structure greg@561: * @return greg@561: * - CanFestival file descriptor is returned upon success. greg@561: * - NULL is returned if the CANOpen board can't be opened. greg@528: */ etisserant@145: CAN_PORT canOpen(s_BOARD *board, CO_Data * d); greg@528: greg@528: /** greg@528: * @ingroup can greg@561: * @brief Close a CANOpen device greg@561: * @param *d Pointer to the CAN object data structure greg@561: * @return greg@561: * - 0 is returned upon success. greg@561: * - errorcode if error. (if implemented) greg@528: */ etisserant@149: int canClose(CO_Data * d); greg@528: greg@528: /** greg@528: * @ingroup can greg@561: * @brief Change the CANOpen device baudrate greg@528: * @param port CanFestival file descriptor greg@528: * @param *baud The new baudrate to assign greg@561: * @return greg@561: * - 0 is returned upon success or if not supported by the CAN driver. greg@561: * - errorcode from the CAN driver is returned if an error occurs. (if implemented in the CAN driver) greg@528: */ groke6@384: UNS8 canChangeBaudRate(CAN_PORT port, char* baud); greg@561: greg@528: etisserant@145: etisserant@251: #ifdef __cplusplus etisserant@251: }; etisserant@251: #endif etisserant@251: etisserant@145: #endif /*UNIX_H_*/