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

📄 lin_master.cfg

📁 freescale最新的16位单片机
💻 CFG
字号:
#ifndef LINCFG_H
#define LINCFG_H

/******************************************************************************		
*                                                                                   
*       Copyright (C) 2005 Freescale Semiconductor, Inc.                            
*       All Rights Reserved								              				
*														              				
* Filename:     master.cfg                											
*														              				
* Functions:    LIN Driver static configuration file for LINS12X				
*               LINKits Master sample			     	 							
*												                            		
* Description:	Example file that can be modified by the user.						
*																					
* Notes:        																	
*																					
******************************************************************************/		
#if 1
																					
/* CPU bus freq  = 24 MHz */
/* SCI (LIN) freq = 9.6 Kbit */

/* This definition set the number of user-defined timer clocks
   (LIN_IdleClock service calls), recognized as "no-bus-activity"
   condition. This number shall not be greater than 0xFFFF. */

#define LIN_IDLETIMEOUT         100u

/* This definition configures the LIN bus baud rate.
   This value shall be set according to target MCU
   SCI register usage.
   LIN_BAUDRATE = BUSCLK / ( Baud Rate*16)
   156 = 24 MHz /(9600 * 16) */

#define LIN_BAUDRATE    156u   /* 9600 baudrate -> 1/9600 = Tbit = 104us*/

/* This definition configures the priority level of the SCI interrupt
   The level 1 - 7 are possible */

#define LIN_SCIINTPRIORITY 6


#if defined(USEZEROPAGE)
/* This definition configures the location of the zero page*/

#define ZEROPAGE_ADDRESS 0x20			   /* zero page 0x2000 to 0x20FF */
#endif /* defined(USEZEROPAGE) */


#if defined(MASTER)

/* This definition configures the time of the wake up  delimiter.
   The LIN specification v.1.3 specifiy this time min 4 Tbit and max 64 Tbit */

#define LIN_TO_WAKEUPDEL 10


/* This definition configures the tick duration of PIT channel counter.
   Tpit tick = LIN_PITMICROCOUNTER /BUSCLK
   LIN_PITMICROCOUNTER = Tpit tick * BUSCLK =1us* 24MHz = 24
   Master node only*/

#define LIN_PITMICROCOUNTER 24


/* This definition configures the priority level of the PIT channel interrupt
   The level 1 - 7 are possible */

#define LIN_PITINTPRIORITY 5



/* This definition set the length of one bit transmission period on the target MCU.
   Due to 16-bit counters on target MCU this value shall not be greater than 0xFFFF.
   For correct timeouts computation this value shall have qualificator 'l'.
   Master node only*/

#define LIN_BITTIME   104ul  /*LIN_BITTIME *timer clock = Tbit -> 104 * 1us = 104us */

#endif /* defined(MASTER) */

																					
#else

/* CPU bus freq  = 2 MHz */
/* SCI (LIN) freq = 9.6 Kbit */

/* This definition set the number of user-defined timer clocks
   (LIN_IdleClock service calls), recognized as "no-bus-activity"
   condition. This number shall not be greater than 0xFFFF. */

#define LIN_IDLETIMEOUT         100u



/* This definition configures the LIN bus baud rate.
   This value shall be set according to target MCU
   SCI register usage.
   LIN_BAUDRATE = BUSCLK / ( Baud Rate*16)
   13 = 2 MHz /(9600 * 16) */

#define LIN_BAUDRATE    13u   /* 9600 baudrate -> 1/9600 = Tbit = 104us*/



/* This definition configures the priority level of the SCI interrupt
   The level 1 - 7 are possible */

#define LIN_SCIINTPRIORITY 6


#if defined(USEZEROPAGE)
/* This definition configures the location of the zero page*/

#define ZEROPAGE_ADDRESS 0x20			   /* zero page 0x2000 to 0x20FF */
#endif /* defined(USEZEROPAGE) */


#if defined(MASTER)

/* This definition configures the time of the wake up  delimiter.
   The LIN specification v.1.3 specifiy this time min 4 Tbit and max 64 Tbit */

#define LIN_TO_WAKEUPDEL 10


/* This definition configures the tick duration of PIT channel counter.
   Tpit tick = LIN_PITMICROCOUNTER /BUSCLK
   LIN_PITMICROCOUNTER = Tpit tick * BUSCLK =1us* 2MHz = 2
   Master node only*/

#define LIN_PITMICROCOUNTER 2


/* This definition configures the priority level of the PIT channel interrupt
   The level 1 - 7 are possible */

#define LIN_PITINTPRIORITY 5



/* This definition set the length of one bit transmission period on the target MCU.
   Due to 16-bit counters on target MCU this value shall not be greater than 0xFFFF.
   For correct timeouts computation this value shall have qualificator 'l'.
   Master node only*/

#define LIN_BITTIME   104ul  /*LIN_BITTIME *timer clock = Tbit -> 104 * 1us = 104us */

#endif /* defined(MASTER) */

#endif /* Select 2 MHz or 24MHz bus clock */
#endif /* !define (LINCFG_H) */

⌨️ 快捷键说明

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