#include "can_drv.h"
Go to the source code of this file.
Data Structures | |
union | can_id_t |
This union defines a CAN identifier and allows to access it in mode standart, extended or throught a table. More... | |
struct | can_ctrl_t |
This structure defines some specific information as rtr bit and ide bit. More... | |
struct | st_cmd_t |
This structure allows to define a specific action on CAN network. handle: manage by the library. More... | |
Defines | |
#define | CAN_CMD_REFUSED 0xFF |
This constant is used as return value for the function can_cmd. | |
#define | CAN_CMD_ACCEPTED 0x00 |
This constant is used as return value for the function can_cmd. | |
#define | CAN_STATUS_COMPLETED 0x00 |
This constant is used as return value for the function can_getstatus. | |
#define | CAN_STATUS_NOT_COMPLETED 0x01 |
This constant is used as return value for the function can_getstatus. | |
#define | CAN_STATUS_DISABLED 0x02 |
This constant is used as return value for the function can_getstatus. | |
Enumerations | |
enum | can_cmd_t { CMD_TX, CMD_TX_REMOTE, CMD_RX, CMD_ABORT } |
This enum is used to select an action for a specific message declare on structure st_cmd_t. More... | |
Functions | |
void | can_init (void) |
This function configures the bit timing of the CAN controller following the constant definition of CAN_BAUDRATE; clears the Mailbox content and enables the CAN controller. | |
Uchar | can_cmd (st_cmd_t *) |
This function allows to select an action on the CAN bus and to define the CAN message to send or to receive. This function returns a status if the action is accepted or refused. in this case the must be retry by the application. | |
Uchar | can_getstatus (st_cmd_t *) |
This function allows to return if the command is performed or not. In an reception case, all the CAN message is stored in the structure. |
|
This constant is used as return value for the function can_cmd.
Definition at line 35 of file can_lib.h. Referenced by can_cmd(). |
|
This constant is used as return value for the function can_cmd.
Definition at line 30 of file can_lib.h. Referenced by can_cmd(). |
|
This constant is used as return value for the function can_getstatus.
Definition at line 41 of file can_lib.h. Referenced by can_getstatus(). |
|
This constant is used as return value for the function can_getstatus.
Definition at line 51 of file can_lib.h. Referenced by can_getstatus(). |
|
This constant is used as return value for the function can_getstatus.
|
|
This enum is used to select an action for a specific message declare on structure st_cmd_t.
|
|
This function allows to select an action on the CAN bus and to define the CAN message to send or to receive. This function returns a status if the action is accepted or refused. in this case the must be retry by the application.
Definition at line 40 of file can_lib.c. References CAN_CMD_ACCEPTED, CAN_CMD_REFUSED, st_cmd_t::cmd, CMD_ABORT, CMD_RX, CMD_TX, CMD_TX_REMOTE, st_cmd_t::ctrl, st_cmd_t::dlc, can_id_t::ext, st_cmd_t::handle, st_cmd_t::id, can_ctrl_t::ide, st_cmd_t::pt_data, st_cmd_t::status, STATUS_MOB_AVAILABLE, STATUS_MOB_USED, and can_id_t::std. |
|
This function allows to return if the command is performed or not. In an reception case, all the CAN message is stored in the structure.
Definition at line 94 of file can_lib.c. References CAN_STATUS_COMPLETED, CAN_STATUS_DISABLED, st_cmd_t::ctrl, st_cmd_t::dlc, can_id_t::ext, st_cmd_t::handle, st_cmd_t::id, can_ctrl_t::ide, st_cmd_t::pt_data, can_ctrl_t::rtr, st_cmd_t::status, STATUS_MOB_AVAILABLE, and can_id_t::std. |
|
This function configures the bit timing of the CAN controller following the constant definition of CAN_BAUDRATE; clears the Mailbox content and enables the CAN controller.
|