📄 knlcfg.h
字号:
/*============================================================================
____________________________________________________________________________
______________________________________________
SSSS M M CCCC Standard Microsystems Corporation
S MM MM SSSS C Austin Design Center
SSS M M M S C 11000 N. Mopac Expressway
S M M SSS C Stonelake Bldg. 6, Suite 500
SSSS M M S CCCC Austin, Texas 78759
SSSS ______________________________________________
____________________________________________________________________________
Copyright(C) 1999, Standard Microsystems Corporation
All Rights Reserved.
This program code listing is proprietary to SMSC and may not be copied,
distributed, or used without a license to do so. Such license may have
Limited or Restricted Rights. Please refer to the license for further
clarification.
____________________________________________________________________________
Notice: The program contained in this listing is a proprietary trade
secret of SMSC, Hauppauge, New York, and is copyrighted
under the United States Copyright Act of 1976 as an unpublished work,
pursuant to Section 104 and Section 408 of Title XVII of the United
States code. Unauthorized copying, adaption, distribution, use, or
display is prohibited by this law.
____________________________________________________________________________
Use, duplication, or disclosure by the Government is subject to
restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
in Technical Data and Computer Software clause at DFARS 52.227-7013.
Contractor/Manufacturer is Standard Microsystems Corporation,
80 Arkay Drive, Hauppauge, New York, 1178-8847.
____________________________________________________________________________
____________________________________________________________________________
knlcfg.h - fmc project specific kernel definitions for minimOS
____________________________________________________________________________
comments tbd
____________________________________________________________________________
Revision History
Date Who Comment
________ ___ _____________________________________________________________
05/31/00 tbh initial version
07/27/01 tbh tweak port for 20x family
11/15/01 tbh added k_external_phy
11/26/01 tbh added k_yop_gpio0
04/05/02 tbh changed kbm_yop_gpio0 to k_ix_yop_gpio to specify bitix
04/24/02 tbh added k_support_otprom
06/25/02 cds added k_support_nand & k_support_nvram
08/06/02 tbh turned all of the k_support_xxx into k_opt_xxx and removed
from this file (this is the wrong place for application settings)
and they are now specified in the build scripts as $(OPTn) flags.
08/20/02 cds had to have the suspend option be dependent on the k_mcu_xxx... the 210
should be 20x style, and the 242 needs to be NIL style for now. In order
to have a single version, the file must switch between the two.
There's gotta be a better way to do this... this could get ugly.
09/05/02 tbh/ds changed k_ticks_per_usec into k_t0_ticks_per_usec and
k_t1_ticks_per_usec since the timers can run on clk/12 or clk/4
independently.
09/20/02 tbh the 211 doesn't yop.
09/25/02 rcc the 242 FPGA supports suspend now so we don't need NIL suspend for it. Lines commented out.
as a default we want the yop turned off
10/31/02 ds changed the clksel bitmask to suit the new nomenclature in minimos
============================================================================*/
//------------------------------------------------------------------------------
// NOTE:
// this file is included by the MInimOS kernel when it is built.
// this allow a custom kernel to be built to these specifications.
// this file should not contain *any* application configuration settings.
// it should contail only MinimOS kernel configuration settings.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// comment out to ignore vbus state during attach, leave in to only attach when vbus is present
#define k_vbus_sense
//------------------------------------------------------------------------------
// define k_auto_attach if you want the kernel to attach to the usb during initialization.
// undefine it if you need to wait and init a drive or something and then attach yourself.
//#define k_auto_attach //(shouldnt need to use this, use k_vbus_sense, or attach manually)
//------------------------------------------------------------------------------
// define this if you want to use an external phy
//#define k_external_phy //(dont need to enable on fpga?, bit doesnt work on fpga?, always uses external phy?)
//------------------------------------------------------------------------------
//Pick which rev external KLSI phy to use.
//comment out below to use rev a
#define k_rev_c_klsi_phy
//------------------------------------------------------------------------------
// suspend
// use one of
// k_NIL_style_suspend_handling - do not process suspend/resume, always on
// k_100_style_suspend_handling - the 100 counts missing sof
// k_102_style_suspend_handling - the 102 uses irq's because missing sofs increment the frame count
// note however, that the 10d hdw does not work properly...
// k_20x_style_suspend_handling - the 20x family uses irq's
//#ifdef k_mcu_97242
//#define k_NIL_style_suspend_handling
//#else
#define k_20x_style_suspend_handling
//#endif
//------------------------------------------------------------------------------
// define k_ix_yop_gpio to the bit index of the gpio to use.
// valid values are 0..7
// any value > 7 means 'no yop led'
#ifdef k_mcu_97211
#define k_ix_yop_gpio 8
#else
#define k_ix_yop_gpio 8
#endif
//------------------------------------------------------------------------------
// configure the kernel - array bounds of usb entities
#define k_dev_max_configuration 1 // number of configurations this device supports
#define k_dev_max_interface 1 // max number of ifc's for any configuration
#define k_dev_max_endpoint 3 // the number of endpoints required by this device
#define k_dev_max_string 4 // the number of strings exported by this device
//------------------------------------------------------------------------------
// configure the kernel - array bounds of thread table
#define k_dev_max_thread 2 // number of threads required by this device
//------------------------------------------------------------------------------
// configure the kernel - depth bounds of nested state machines
#define k_dev_max_dfa_depth 6 // maximum depth of dfa nesting
//------------------------------------------------------------------------------
// where do you want the major kernel data structures stored?
// if you use xdata, then startup.a51, init.a51, and makefile must all match.
//------------------------------------------------------------------------------
// where do you want the thread table?
#define seg_knl_table idata
// where should the system modules' large data structs go? (specifically, g_interface and g_endpoint)
#define seg_knl_manager idata
//------------------------------------------------------------------------------
// specify timer 0 ticks per microsecond required for an interval of 1msec.
// (the timer0 interval must be 1msec.)
// using timer mode 1 (16 bit timer) timer load = 0xFFFF - (1000 * ticks_per_usec)
//
// by this equation:
// M osc | |
// million | | instr | instr
// cycles | sec | cycle | cycle
// ---------|---------|--------| = --------
// sec | million | N osc | usec
// | usec | cycle |
//
// we get the results:
// standard 8051 M=12 N=12 ==> 1 usec / instruction cycle
// standard 8051 M=24 N=12 ==> 500 nsec / instruction cycle
// enhanced 8051 M=30 N=12 ==> 400 nsec / instruction cycle
// enhanced 8051 M=30 N= 4 ==> 133 nsec / instruction cycle
//
// so
// k_ticks_per_usec = 1 ic / (1000 * X nsec )
//
// notes:
// standard 8051 timer counts once per instruction cycle.
// enhanced 8051, use the CKCON register to choose 12 or 4 osc cycles / timer cycle
//------------------------------------------------------------------------------
#ifdef k_20x_family
#define k_dev_clock kbm_clksel_mcu_clk_30dot0_mhz
// note - the timer 0 ticks per usec are historically incorrect.
// they were originally computed based on clk/4, but code mods
// resulted in an actual setting of clk/12 unwittingly.
// now, the t0 timer is 3 times slower than it should be.
// but, its too late to fix it because too much has been fine
// tuned to the current values. so, for "accurate" timing
// use timer1, as it has the correct number for clk/12.
// if CKCON is set for 12 clocks per tick then
//#define k_t0_tick_per_usec 2.5
// if CKCON is set for 4 clocks per tick then
#define k_t0_tick_per_usec 7.5
// if CKCON is set for 12 clocks per tick then
#define k_t1_tick_per_usec 2.5
// if CKCON is set for 4 clocks per tick then
//#define k_t1_tick_per_usec 7.5
#endif
//---eof------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -