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

📄 l_gen.c

📁 MC68HC908GR60A LIN-BUS源码(编译环境:CodeWarriorV3.1)
💻 C
字号:
/* LIN configuration File */
/* Automatically generated - DO NOT EDIT THIS FILE! */
/* (c) VCT 2002-2003 */

#include "l_gen.h"

/**** These calls shall be provided by the application ****/
extern L_LIB_PREFIX void l_sys_irq_restore(l_irqmask previous);
extern L_LIB_PREFIX l_irqmask l_sys_irq_disable(void);

/* RAM buffer for the flags */
L_RAM l_u8 l_flag_buffer[1] = {
	0u
};

/* Flag list for frame 'demo_net.resolving' */
L_ROM l_flag l_flag_resolving[2] = {
	{ &l_flag_buffer[0], 0x01u },
	{(l_u8*) 0, 0u}
};

/* Subscribed frame 'demo_net.MasterReq_demo_net' */
L_RAM l_u8 l_frame_MasterReq_demo_net_buf[8] = {
	0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u
};
L_ROM l_slave_frame l_frame_MasterReq_demo_net = {
	l_frame_MasterReq_demo_net_buf,
	(l_flag *) 0,
	L_DRX,
	L_CLASSIC,
	8u
};

/* Subscribed frame 'demo_net.global_info' */
L_RAM l_u8 l_frame_global_info_buf[1] = {
	0x00u
};
L_ROM l_slave_frame l_frame_global_info = {
	l_frame_global_info_buf,
	(l_flag *) 0,
	L_RX,
	L_ENHANCED,
	1u
};

/* Subscribed frame 'demo_net.resolving' */
L_RAM l_u8 l_frame_resolving_buf[1] = {
	0x00u
};
L_ROM l_slave_frame l_frame_resolving = {
	l_frame_resolving_buf,
	l_flag_resolving,
	L_RX,
	L_ENHANCED,
	1u
};

/* Published frame 'demo_net.SlaveResp_demo_net' */
L_RAM l_u8 l_frame_SlaveResp_demo_net_buf[8] = {
	0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u
};
L_ROM l_slave_frame l_frame_SlaveResp_demo_net = {
	l_frame_SlaveResp_demo_net_buf,
	(l_flag *) 0,
	L_DTX,
	L_CLASSIC,
	8
};

/* Published frame 'demo_net.GR60A_28' */
L_RAM l_u8 l_frame_GR60A_28_buf[2] = {
	0x00u, 0x00u
};
L_ROM l_slave_frame l_frame_GR60A_28 = {
	l_frame_GR60A_28_buf,
	(l_flag *) 0,
	L_TX,
	L_ENHANCED,
	2
};

/* Message id map for interface i1*/
L_ROM l_u16 l_MID_list_i1[3] = {
	0x50u, 0x60u, 0x1030u
};

L_RAM l_u8 l_PID_list_i1[3];


/* Interface 'i1' connected to network 'demo_net' */
L_RAM l_ifc_slave i1;
/* Library has a shared interface */

L_ROM l_uart_descriptor i1_uart_desc = {
	(l_UART_handle) 0x0009,
	(l_reg8*) 0x000c,
	(l_reg8*) 0x0008,
	0x02u,
	0x01u,
	0x40c0u,
	0x6bc0u
};

L_ROM l_slave_rom i1_rom = {
	&l_frame_GR60A_28_buf[1],
	&l_frame_GR60A_28,
	0x43u,
	0x02u,
};

/* Reconfiguration related properties */
L_RAM ld2_ram_slave ld2_ram_ld2_ifc_i1;
L_ROM ld2_ifc_slave ld2_ifc_i1 = {
	&i1,
	&ld2_ram_ld2_ifc_i1,
	&l_frame_SlaveResp_demo_net_buf[0],
	&l_PID_list_i1[0],
	(l_u16 *) &l_MID_list_i1[0],
	0x000bu,
	0x0023u,
	{&l_flag_buffer[0], 0x02u},
	0x01u,
	0x03u,
};

/* Callout routines for giving processing time to layered support products*/
void l_callout_init_slave (l_ifc_slave_handle ifc)
{
	ld2_init_slave (&ld2_ifc_i1);
}

void l_callout_header_slave (l_ifc_slave_handle ifc)
{
	(void) ld2_header_slave (&ld2_ifc_i1);
}

void l_callout_response_slave (l_ifc_slave_handle ifc, l_bool success)
{
	(void) ld2_response_slave (&ld2_ifc_i1, success);
}

/* Search function for UART type 'hc08esci' */
l_slave_frame* l_header_to_frame_hc08esci(l_ifc_slave_handle ifc, l_u8 hdr)
{
	int i;
	l_u8 *pid = ld2_ifc_i1.PID_list;

	if(hdr == 0x3cu)
	{
		return(&l_frame_MasterReq_demo_net);
	}
	else if (hdr == 0x7du)
	{
		if((l_flag_buffer[0] & 0x02u))
		{
			l_flag_buffer[0] &= ~0x02u;
			return &l_frame_SlaveResp_demo_net;
		} else { return (l_slave_frame *) 0; }
	}

	for (i = 0; i < 3; i++, pid++)
	{
		if (*pid == hdr)
		{
			switch (*(ld2_ifc_i1.MID_list+i))
			{
			case 0x0050u: /*global_info*/
				return &l_frame_global_info;
			case 0x0060u: /*resolving*/
				return &l_frame_resolving;
			case 0x1030u: /*GR60A_28*/
				return &l_frame_GR60A_28;

			default:
				break;    /* To avoid unreached statement warning */
			}
			break;
		}
	}

	ifc = ifc;        /* prevent compiler warning, since ifc is not used */
	return (l_slave_frame *) 0;
}

/* end of l_gen.c */

⌨️ 快捷键说明

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