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

📄 lin_api.h

📁 针对日本瑞莎单片机r8c/23 开发的LIN网络通讯程序包括主节点和从节点
💻 H
字号:
/******************************************************************************/
/*             Renesas Technology America, Inc. Legal Disclaimer              */
/******************************************************************************/
/* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      */
/* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE        */
/* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR      */
/* PURPOSE.                                                                   */
/*                                                                            */
/* BY USING THE SOFTWARE HEREIN, YOU (AND YOUR COMPANY) AGREE TO BE BOUND BY  */
/* THE TERMS AND CONDITIONS OF RENESAS TECHNOLOGY AMERICA, INC.'S SOURCE CODE */
/* LICENSE AGREEMENT. PLEASE READ THIS AGREEMENT CAREFULLY. IF YOU (OR YOUR   */
/* COMPANY) DO NOT AGREE TO ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT,   */
/* DO NOT INSTALL OR USE THIS SOFTWARE AND ASSOCIATED DOCUMENTATION.          */
/*                                                                            */
/*  Copyright (c) 2003, 2004, 2005 and 2006 Renesas Technology America, Inc.  */
/******************************************************************************/
/**********************************************************************
   Title                      : lin_api.h

   Module Description         : This file contains the system defines for the
                                the LIN 2.0 API functions.

   MCU Family                 : R8C

   Author                     : Bob Chamberlain

   Version                    : LIN API 2.0 Version 1.1

 *********************************************************************/
#ifndef  LIN_API_H
#define  LIN_API_H

/**********************************************************************
 * Include files
 *********************************************************************/
#include "lin_hdw.h"

/**********************************************************************
 * Include User Header file
 *********************************************************************/

/**********************************************************************
 * Constant and Macro Definitions using #define
 *********************************************************************/
/* Defines for "l_ifc_read_status()" return values.  */
#define LIN_ID_NOTSET         0xFF
#define LIN_IFC_GOTOSLEEP     0x08
#define LIN_IFC_OVERRUN       0x04
#define LIN_IFC_COMPLETE      0x02
#define LIN_IFC_ERROR         0x01

/* Defines for "ld_check_response()" return values.  */
#define  LD_SUCCESS        0x00
#define  LD_NEGATIVE       0x01
#define  LD_NO_RESPONSE    0x02
#define  LD_OVERWRITTEN    0x04

/* Defines for the Node Configuration "wildcards".  */
#define  LD_BROADCAST      0x7F     /* Any NAD.  */
#define  LD_ANY_SUPPLIER   0x7FFF
#define  LD_ANY_FUNCTION   0xFFFF
#define  LD_ANY_MESSAGE    0xFFFF

/* Defines for "ld_raw_tx_status()" and "ld_raw_rx_status()" return values.  */
#define  LD_QUEUE_FULL        0x01     /* "ld_raw_tx_status()" only.  */
#define  LD_QUEUE_EMPTY       0x02     /* "ld_raw_tx_status()" only.  */
#define  LD_DATA_AVAILABLE    0x02     /* "ld_raw_rx_status()" only.  */
#define  LD_TRANSFER_ERROR    0x04

/* Defines for "ld_tx_status()" and "ld_rx_status()" return values.  */
#define  LD_COMPLETED      0x00
#define  LD_IN_PROGRESS    0x01
#define  LD_FAILED         0x02

/* Following defines "enumerate" the flags in the "LIN_flags[]" array.
 * The two flag routines, "l_flg_tst()" and "l_flg_clr()", subtract 252
 * from these values before indexing the "LIN_flags[]" array.  */
#define LIN_TX_END_FLG      252
#define LIN_RX_END_FLG      253
#define LIN_AWAKE_FLG       254
#define LIN_DIAG_RESP_FLG   255

/**********************************************************************
 * Enumerations, Structures and Typedefs
 *********************************************************************/
/* The following typedefs are used in the LIN API function prototypes and
 * function definitions.  It is not required that these same types be used
 * in the application code, as long as equivalent types are used.  */
typedef unsigned char   l_bool;
typedef unsigned char   l_ioctl_op;
typedef unsigned char   l_irqmask;
typedef unsigned char   l_u8;
typedef unsigned int    l_u16;
typedef unsigned char   l_signal_handle;
typedef unsigned char   l_flag_handle;
typedef unsigned char   l_ifc_handle;
typedef unsigned char   l_schedule_handle;

/**********************************************************************
 * Global Variable extern Declarations
 *********************************************************************/

/**********************************************************************
 * Function Prototypes
 *********************************************************************/
l_irqmask l_sys_irq_disable(void);
void l_sys_irq_restore(l_irqmask flag_state);
l_bool l_sys_init(void);
void l_ifc_init(l_ifc_handle ifc_name);
l_bool l_ifc_connect(l_ifc_handle ifc_name);
l_bool l_ifc_disconnect(l_ifc_handle ifc_name);
l_bool l_flg_tst(l_flag_handle flg);
void l_flg_clr(l_flag_handle flg);
l_u16 l_ifc_read_status(l_ifc_handle ifc_name);
void l_ifc_goto_sleep(l_ifc_handle ifc_name);
void l_ifc_wake_up(l_ifc_handle ifc_name);
void l_sch_set(l_ifc_handle ifc_name, l_schedule_handle schedule, l_u8 entry);
l_u8 l_sch_tick(l_ifc_handle ifc_name);
l_bool l_bool_rd(l_signal_handle signal_name);
l_u8 l_u8_rd(l_signal_handle signal_name);
l_u16 l_u16_rd(l_signal_handle signal_name);
void l_bool_wr(l_signal_handle signal_name, l_bool write_data);
void l_u8_wr(l_signal_handle signal_name, l_u8 write_data);
void l_u16_wr(l_signal_handle signal_name, l_u16 write_data);
void l_bytes_rd(l_signal_handle signal_name, l_u8 start, l_u8 count, l_u8 *data);
void l_bytes_wr(l_signal_handle signal_name, l_u8 start, l_u8 count, l_u8 *data);
void l_ifc_rx(l_ifc_handle ifc_name);
void l_ifc_tx(l_ifc_handle ifc_name);
void l_ifc_aux(l_ifc_handle ifc_name);
l_u16 l_ifc_ioctl(l_ifc_handle ifc_name, l_ioctl_op op, void *pv);
l_bool ld_is_ready(l_ifc_handle ifc_name);
l_u8 ld_check_response(l_ifc_handle ifc_name, l_u8 *RSID, l_u8 *error_code);
void ld_assign_NAD(l_ifc_handle ifc_name, l_u8 NAD, l_u16 supplier_id, l_u16 function_id, l_u8 new_NAD);
void ld_assign_frame_id(l_ifc_handle ifc_name, l_u8 NAD, l_u16 supplier_id, l_u16 message_id, l_u8 PID);
void ld_read_by_id(l_ifc_handle ifc_name, l_u8 NAD, l_u16 supplier_id, l_u16 function_id, l_u8 id, l_u8 *data);
void ld_conditional_change_NAD(l_ifc_handle ifc_name, l_u8 NAD, l_u8 id, l_u8 byte, l_u8 mask, l_u8 invert, l_u8 new_NAD);
void ld_put_raw(l_ifc_handle ifc_name, l_u8 *data);
void ld_get_raw(l_ifc_handle ifc_name, l_u8 *data);
l_u8 ld_raw_tx_status(l_ifc_handle ifc_name);
l_u8 ld_raw_rx_status(l_ifc_handle ifc_name);
void ld_send_message(l_ifc_handle ifc_name, l_u16 length, l_u8 NAD, l_u8 *data);
void ld_receive_message(l_ifc_handle ifc_name, l_u16 *length, l_u8 *NAD, l_u8 *data);
l_u8 ld_tx_status(l_ifc_handle ifc_name);
l_u8 ld_rx_status(l_ifc_handle ifc_name);

/**********************************************************************
 *
 * Modification Record
 *
 **********************************************************************
 *
 *    Version 1.1 for R8C 16 Mar 2006   Bob Chamberlain
 *
 *********************************************************************/

#endif   /* LIN_API_H  */

⌨️ 快捷键说明

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