plt_init.c

来自「澳洲人写的Cortex,包括uC_IP协议栈」· C语言 代码 · 共 126 行

C
126
字号
<HTML><HEAD><TITLE>/home/asysweb/public_html/cortex/exbsp/tmsevm/src/plt_init.c</TITLE></HEAD><BODY><pre><font color="#6920ac">/*************************************************************************/</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/*     Copyright (c) 1997-1999 Australian Real Time Embedded Systems     */</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/* PROPRIETARY RIGHTS of Australian Real Time Embedded Systems           */</font><font color="#6920ac">/* are involved in the subject matter of this material. All reproduction,*/</font><font color="#6920ac">/* manufacturing, use, and sales rights pertaining to this subject matter*/</font><font color="#6920ac">/* are governed by the license agreement. The recipient of this software */</font><font color="#6920ac">/* implicitly accepts the terms of the license.                          */</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/*************************************************************************/</font><b><font color='DarkGreen'>#include</font></b> <a href="crt_defs.h.FIND-INC"><font color="blue">"crt_defs.h"</font></a><b><font color='DarkGreen'>#include</font></b> <a href="hwi_defs.h.FIND-INC"><font color="blue">"hwi_defs.h"</font></a><b><font color='DarkGreen'>#include</font></b> <a href="sdr_defs.h.FIND-INC"><font color="blue">"sdr_defs.h"</font></a><b><font color='DarkGreen'># include</font></b> <a href="552_defs.h.FIND-INC"><font color="blue">"552_defs.h"</font></a><b><font color='DarkGreen'>#include</font></b> <a href="plt_defs.h.FIND-INC"><font color="blue">"plt_defs.h"</font></a><i>static</i> <i>crtx_Char_t</i> pltf_InpBuffer[ <a href="PLTF_INP_BUFFER_SIZE.FIND-DEF">PLTF_INP_BUFFER_SIZE</a> ];<i>static</i> <i>crtx_Char_t</i> pltf_OutBuffer[ <a href="PLTF_OUT_BUFFER_SIZE.FIND-DEF">PLTF_OUT_BUFFER_SIZE</a> ];<i>static</i> <i>crtx_Char_t</i> pltf_ConvCodes[] = { 2, <font color="DarkGreen">'\n'</font>, 012, 015, 0};<i>sdrv_Desc_t</i> pltf_SdrvDesc = {    0,    0,    -1,    -1,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    <a href="NULL.FIND-DEF">NULL</a>,    pltf_InpBuffer,    <i>sizeof</i>(pltf_InpBuffer)/<i>sizeof</i>(pltf_InpBuffer[0]),    pltf_OutBuffer,    <i>sizeof</i>(pltf_OutBuffer)/<i>sizeof</i>(pltf_OutBuffer[0]),    pltf_ConvCodes,    <font color="#6920ac">/* values for other fields are not important here */</font>};<font size="+1"><i>static</i> <i>crtx_Void_t</i> <b><font color="azure1"><a name="pltf_delay">pltf_delay</a></font></b>(<i>crtx_Uint32_t</i> del_a){</font>    <b>while</b> (del_a != 0)    {        del_a-=1;    }}<font size="+1"><i>crtx_Void_t</i> <b><font color="azure1"><a name="pltf_Init">pltf_Init</a></font></b>(    <i>crtx_Int_t</i>    ArgC_a __attribute__((__unused__)),    <i>crtx_Void_t</i>   *pArgV_a __attribute__((__unused__)),    <i>crtx_Void_t</i>   *pEnvV_a __attribute__((__unused__))){</font>    <i>int</i> i;    <a href="hrdi_GlobalForbid.FIND-FUNC">hrdi_GlobalForbid</a>();    <font color="#6920ac">/* init timer which is needed for chosen kind of output device */</font>    *(<i>long</i> *)0x808038 = 0;    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    *(<i>long</i> *)0x808030 = 0;    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    *(<i>long</i> *)0x808030 = 0x203;    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    *(<i>long</i> *)0x808030 = 0x303;    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    *(<i>long</i> *)0x808030 = 0x3c3;    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    *(<i>long</i> *)0x808064 = 0x1018;    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    OR 0800h,ST"</font>);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    OR 020h,IOF"</font>);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    XOR 040h,IOF"</font>); <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    XOR 040h,IOF"</font>);    <a href="#pltf_delay">pltf_delay</a>(0x150e20l);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    XOR 040h,IOF"</font>); <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    XOR 040h,IOF"</font>);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    OR 2,IOF"</font>);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    OR 4,IOF"</font>);    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    ANDN 4,IOF"</font>);    <a href="#pltf_delay">pltf_delay</a>(0x1000l);    <a href="asm.FIND-FUNC">asm</a>(<font color="DarkGreen">"    OR 4,IOF"</font>);    {        <i>D552_Desc_t</i> Desc552 =        {            (<i>void</i> *)0xe00000,            <a href="D552_BAUD_9600.FIND-DEF">D552_BAUD_9600</a>,            <a href="D552_BIT_8.FIND-DEF">D552_BIT_8</a>,            <a href="D552_STOPBIT_2.FIND-DEF">D552_STOPBIT_2</a>,            <a href="CRYSTAL_FREQ.FIND-DEF">CRYSTAL_FREQ</a>,            1        };        <b>if</b> (!<a href="CreateTms552Port.FIND-FUNC">CreateTms552Port</a>(&amp;Desc552, &amp;pltf_SdrvDesc))        {            <a href="syst_Fatal.FIND-FUNC">syst_Fatal</a>(<font color="DarkGreen">"Cannot create 552 output"</font>);        }        <b>else</b> <b>if</b> (!<a href="sdrv_Create.FIND-FUNC">sdrv_Create</a>(&amp;pltf_SdrvDesc))        {            <a href="syst_Fatal.FIND-FUNC">syst_Fatal</a>(<font color="DarkGreen">"Cannot create serial output"</font>);        }    }    <a href="hrdi_GlobalPermit.FIND-FUNC">hrdi_GlobalPermit</a>();    <b>return</b>;}</pre></BODY></HTML>

⌨️ 快捷键说明

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