include/none/canfestival.h
author edouard
Wed, 09 Dec 2009 15:46:35 +0100
changeset 618 564a4a9862b1
child 619 96f84395154f
permissions -rw-r--r--
added 'none' taget for building standalone library
618
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     1
#ifndef CANFESTIVAL_H_
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     2
#define CANFESTIVAL_H_
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     3
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     4
#include "timerscfg.h"
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     5
#include "can_driver.h"
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     6
#include "data.h"
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     7
#include "timers_driver.h"
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     8
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
     9
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    10
/** @defgroup userapi User API */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    11
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    12
/** @defgroup can CAN management
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    13
 *  @ingroup userapi
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    14
 */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    15
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    16
/**
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    17
 * @brief Send a CAN message
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    18
 * @param port CanFestival file descriptor
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    19
 * @param *m The CAN message to send
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    20
 * @return 0 if succes
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    21
 */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    22
UNS8 canSend(CAN_PORT port, Message *m);
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    23
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    24
/**
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    25
 * @ingroup can
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    26
 * @brief Open a CANOpen device
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    27
 * @param *board Pointer to the board structure that contains busname and baudrate 
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    28
 * @param *d Pointer to the CAN object data structure
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    29
 * @return
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    30
 *       - CanFestival file descriptor is returned upon success.
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    31
 *       - NULL is returned if the CANOpen board can't be opened.
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    32
 */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    33
CAN_PORT canOpen(s_BOARD *board, CO_Data * d);
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    34
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    35
/**
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    36
 * @ingroup can
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    37
 * @brief Close a CANOpen device
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    38
 * @param *d Pointer to the CAN object data structure
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    39
 * @return
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    40
 *       - 0 is returned upon success.
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    41
 *       - errorcode if error. (if implemented)  
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    42
 */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    43
int canClose(CO_Data * d);
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    44
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    45
/**
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    46
 * @ingroup can
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    47
 * @brief Change the CANOpen device baudrate 
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    48
 * @param port CanFestival file descriptor 
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    49
 * @param *baud The new baudrate to assign
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    50
 * @return
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    51
 *       - 0 is returned upon success or if not supported by the CAN driver.
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    52
 *       - errorcode from the CAN driver is returned if an error occurs. (if implemented in the CAN driver)
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    53
 */
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    54
UNS8 canChangeBaudRate(CAN_PORT port, char* baud);
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    55
564a4a9862b1 added 'none' taget for building standalone library
edouard
parents:
diff changeset
    56
#endif