|
truck-code
|
#include "das_clt.h"#include "sja1000.h"#include <sys/iomsg.h>#include <sys/iofunc.h>#include "utils/common.h"#include "utils/buffer.h"

Go to the source code of this file.
Classes | |
| struct | can_msg_t |
| struct | can_filter_t |
| struct | can_dev_handle_t |
| struct | can_info_t |
| struct | can_err_count_t |
| struct | can_ocb_t |
| class | CANDeviceManager |
| struct | can_attr_t |
Macros | |
| #define | MAX_MSG_BUF 1000 |
| #define | PATH_CAN_ID(j) |
| #define | PATH_CAN_PRIORITY(j) (((j) >> 26) & 0x7) |
| #define | PATH_CAN_PF(j) (((j) >> 16) & 0xff) |
| #define | PATH_CAN_PS(j) (((j) >> 8) & 0xff) |
| #define | PATH_CAN_SA(j) ((j) & 0xff) |
| #define | IS_EXTENDED_FRAME(MSG) ((MSG).id & 0x80000000) |
| #define | SET_EXTENDED_FRAME(MSG) ((MSG).id |= 0x80000000) |
| #define | CAN_ID(MSG) ((MSG).id & ~0x80000000) |
| #define | DEFAULT_CONFIG "realtime.ini" |
| #define | DEFAULT_DEVICE "/dev/can1" |
| #define | INI_IRQ_ENTRY "Irq" |
| #define | INI_PORT_ENTRY "Port" |
| #define | INI_EXT_ENTRY "Ext" |
| #define | DEFAULT_IRQ 0 |
| #define | DEFAULT_PORT 0x210 |
| #define | DEFAULT_QSIZE 150 |
| #define | IOFUNC_OCB_T can_ocb_t |
| #define | IOFUNC_ATTR_T can_attr_t |
Functions | |
| int | can_dev_arm (resmgr_context_t *ctp, iofunc_ocb_t *io_ocb, sigevent event) |
| void | pulse_init (dispatch_t *dpp, IOFUNC_ATTR_T *pattr) |
| int | io_devctl (resmgr_context_t *ctp, io_devctl_t *msg, RESMGR_OCB_T *io_ocb) |
| int | io_open (resmgr_context_t *ctp, io_open_t *msg, RESMGR_HANDLE_T *handle, void *extra) |
Structures, definitions, and prototypes for the CAN driver.
| #define CAN_ID | ( | MSG | ) | ((MSG).id & ~0x80000000) |
Get CAN identity number.
| #define DEFAULT_CONFIG "realtime.ini" |
Path to the default configuration file.
This is used when initializing the CAN connection. A typical configuration file is text, and might contain lines like:
[first_section_name]
MoreData=TRUE
AnotherVariable=1.2345
[windows_section]
ScreenSaveActive=1
DoubleClickSpeed=452
[last_section]
MoreData=FALSE
| #define DEFAULT_DEVICE "/dev/can1" |
Directory of the CAN device connection.
| #define DEFAULT_IRQ 0 |
Default Interrupt Request Line. By default, set to no interrupt.
| #define DEFAULT_PORT 0x210 |
Default address of the CAN adapter.
| #define DEFAULT_QSIZE 150 |
Default size of the buffers for the input and output buffers, stored under attr.in_buff and attr.out_buff, respectively.
| #define INI_EXT_ENTRY "Ext" |
TODO
| #define INI_IRQ_ENTRY "Irq" |
TODO
| #define INI_PORT_ENTRY "Port" |
TODO
| #define IS_EXTENDED_FRAME | ( | MSG | ) | ((MSG).id & 0x80000000) |
Checks if identifier is 29 or 11 bit.
| #define MAX_MSG_BUF 1000 |
Largest number of element allows in the CAN Rx buffers
| #define PATH_CAN_ID | ( | j | ) |
Get pdu identifier.
| #define PATH_CAN_PF | ( | j | ) | (((j) >> 16) & 0xff) |
Get pdu format value.
| #define PATH_CAN_PRIORITY | ( | j | ) | (((j) >> 26) & 0x7) |
Get priority value.
| #define PATH_CAN_PS | ( | j | ) | (((j) >> 8) & 0xff) |
Get pdu specific value.
| #define PATH_CAN_SA | ( | j | ) | ((j) & 0xff) |
Get source address value
| #define SET_EXTENDED_FRAME | ( | MSG | ) | ((MSG).id |= 0x80000000) |
Set the 29 bit identifier.
| int can_dev_arm | ( | resmgr_context_t * | ctp, |
| iofunc_ocb_t * | io_ocb, | ||
| sigevent | event | ||
| ) |
Arm the CAN device manager.
Attach the hardware interrupt, and save the event to be used to notify the client in the ocb structure.
| ctp | A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions. |
| io_ocb | Open control block (usually embedded within file system ocb) |
| event | CAN signal event structure, used to receive and process pulses |
| int io_devctl | ( | resmgr_context_t * | ctp, |
| io_devctl_t * | msg, | ||
| RESMGR_OCB_T * | io_ocb | ||
| ) |
Handler for _IO_DEVCTL CAN messages.
This is used to initialize resource manager function tables with CAN specific function for devctl. It is responsible for handling the DCMD_* functionality.
| ctp | A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions. |
| msg | A pointer to the io_open_t structure that contains the message that the resource manager received. For more information, see the documentation for iofunc_open(). |
| io_ocb | A pointer to the iofunc_ocb_t structure for the Open Control Block that was created when the client opened the resource. |
| int io_open | ( | resmgr_context_t * | ctp, |
| io_open_t * | msg, | ||
| RESMGR_HANDLE_T * | handle, | ||
| void * | extra | ||
| ) |
Handler for _IO_CONNECT of CAN messages.
This is used to initialize resource manager function tables with CAN specific function for open().
| ctp | A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions. |
| msg | A pointer to the io_open_t structure that contains the message that the resource manager received. For more information, see the documentation for iofunc_open(). |
| handle | A pointer to the iofunc_attr_t structure that defines the characteristics of the device that the resource manager is controlling. |
| extra | Extra information from the library. If you're calling iofunc_open_default() from a resource manager's open() function (see resmgr_connect_funcs_t), simply pass the extra argument that's passed to open(). |
| void pulse_init | ( | dispatch_t * | dpp, |
| IOFUNC_ATTR_T * | pattr | ||
| ) |
Attach pulses and interrupt events.
Attach pulse to be sent by interrupt handler to event that will connected to the interrupt by InterruptAttachEvent in can_dev->arm.
| dpp | The dispatch handle, as returned by dispatch_create(). |
| pattr | pointer to information per device manager |
1.8.13