⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtxcan.h

📁 it is a automotive application of CAN protocol one microcontroller.
💻 H
字号:
/************************************************************************
*                                                                       *
*       RTX-51 / CAN  DECLARATIONS FOR C-51 LANGUAGE                    *
*                                                                       *
*       11-OCT-1991/tf                                                  *
*                                                                       *
************************************************************************/


/* Message-Structur for receive and send */
struct can_message_struct {
          unsigned int identifier;
          unsigned char c_data[8];
       };


/* System functions returns */
#define C_OK                 0
#define C_NOT_STARTED        1
#define C_CONF_ERROR         2
#define C_OBJ_ERROR          3
#define C_TOO_LONG           4
#define C_INVALID_TYPE       5
#define C_MEM_FULL           6
#define C_NOT_STOPPED        7
#define C_OBJ_REBIND         8
#define C_TIMEOUT            9
#define C_CAN_FAILURE       10
#define C_ERR_ACTIVE        11
#define C_ERR_PASSIVE       12
#define C_BUS_OFF           13
#define C_SEND_ERROR        14


/* Object types for can_def_obj */
#define D_REC           0
#define D_SEND          1
#define D_REC_R_SEND    2
#define D_SEND_R_REC    3


/* System functions */
#pragma SAVE
#pragma REGPARMS

unsigned char can_task_create (void);

/* the meanig of can_hw_init parameters are :                            */
/*          82527             81C92                       others         */
/*          --------------    ----------------------      ------------   */
/* par_1    bus_t0_reg        bit_length_1_reg            bus_timing_0   */
/* par_2    bus_t1_reg        bit_length_2_reg            bus_timing_1   */
/* par_3    bus_config_reg    out_control_reg             out_control    */
/* par_4    cpu_interface     sleep_and_br_prescale       syncon         */
/* par_5    dummy             clock_control_reg           sleep_mode     */

unsigned char can_hw_init (unsigned char par_1,
                           unsigned char par_2,
                           unsigned char par_3,
                           unsigned char par_4,
                           unsigned char par_5) large;

unsigned char can_def_obj (unsigned int identifier,
                            unsigned char data_length,
                            unsigned char object_typ);

/* only for 82527 */
unsigned char can_def_obj_ext (unsigned long identifier,
                           unsigned char data_length,
                           unsigned char object_typ);

unsigned char can_stop (void);
unsigned char can_start (void);
unsigned char can_send (void xdata *msg_ptr);
unsigned char can_write (void xdata *msg_ptr);
unsigned char can_receive (unsigned char timeout,
                           void xdata *buffer_ptr);
unsigned char can_bind_obj (unsigned int identifier);
unsigned char can_unbind_obj (unsigned int identifier);
unsigned char can_wait (unsigned char timeout,
                        void xdata *buffer_ptr);
unsigned char can_request (unsigned int identifier);
unsigned char can_read (unsigned int identifier,
                        void xdata *buffer_ptr);
unsigned char can_get_status (void);

#pragma RESTORE
/* End of include */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -