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

📄 embedded systems device driver development - page 7 of 9.htm

📁 嵌入实时系统中驱动程序的开发教程
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0067)http://www.microcontroller.com/wp/DeviceDrivers/device_drivers7.htm -->
<HTML><HEAD><TITLE>Embedded Systems Device Driver Development - page 7 of 9</TITLE>
<META content=text/html;charset=iso-8859-1 http-equiv=content-type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<SCRIPT language=JavaScript>

  var browser = navigator.appName
  var version = navigator.appVersion
  var ver1 = version.substring(0, 1)

  if (((browser == "Netscape") || (browser == "Mozilla")) && (ver1 >= 4) && (ver1 < 5)){
    document.write('<link rel=stylesheet href="./DeviceDrivers_Files/nn7.css" type="text/css">')
  } else{
    document.write('<link rel=stylesheet href="./DeviceDrivers_Files/ie7.css" type="text/css">')
  }

</SCRIPT>
<NOSCRIPT><LINK 
href="Embedded Systems Device Driver Development - page 7 of 9.files/ie7.css" 
rel=stylesheet type=text/css></NOSCRIPT></HEAD>
<BODY bgColor=#ffffff link=#0000ff text=#000000 vLink=#660099>
<TABLE width=694>
  <TBODY>
  <TR>
    <TD><A name=top></A>
      <DIV class=nb><IMG alt="Navigation bar" height=37 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/navbar.gif" 
      width=694></DIV>
      <DIV class=nbe><IMG alt="" height=37 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/navbarend.gif" 
      width=12></DIV>
      <DIV class=styleNavBarTop>
      <TABLE border=0 cellSpacing=0 height=32 width=692>
        <TBODY>
        <TR align=left>
          <TD width=20>&nbsp;</TD>
          <TD width=18><A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers.htm"><IMG 
            alt=Start border=0 height=14 
            src="Embedded Systems Device Driver Development - page 7 of 9.files/start.gif" 
            width=18></A></TD>
          <TD width=14><A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers6.htm"><IMG 
            alt="Previous page" border=0 height=14 
            src="Embedded Systems Device Driver Development - page 7 of 9.files/back.gif" 
            width=14></A></TD>
          <TD align=middle width=80>&nbsp;7 of 9&nbsp;</TD>
          <TD width=14><A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers8.htm"><IMG 
            alt="Next page" border=0 height=14 
            src="Embedded Systems Device Driver Development - page 7 of 9.files/forward.gif" 
            width=14></A></TD>
          <TD width=18><A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers9.htm"><IMG 
            alt=End border=0 height=14 
            src="Embedded Systems Device Driver Development - page 7 of 9.files/end.gif" 
            width=18></A></TD>
          <TD align=right width=50><A 
            href="http://microcontroller.com/wp"><IMG alt=Home border=0 
            height=14 
            src="Embedded Systems Device Driver Development - page 7 of 9.files/home.gif" 
            width=34></A></TD>
          <TD width=30>&nbsp;</TD>
          <TD align=left width=160><A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers.htm">1</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers2.htm">2</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers3.htm">3</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers4.htm">4</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers5.htm">5</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers6.htm">6</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers7.htm">7</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers8.htm">8</A> 
            <A 
            href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers9.htm">9</A> 
          </TD>
          <TD width=290>&nbsp;</TD></TR></TBODY></TABLE>
      <P></P></DIV><NOBR>
      <DIV class=styleBackground7><IMG alt="" border=0 height=425 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/background7.png" 
      width=654></DIV>
      <DIV class=ts7p0><SPAN class=ft0p7></SPAN></DIV>
      <DIV class=ts7p1><SPAN class=ft0p7></SPAN></DIV>
      <DIV class=ts7p2><SPAN class=ft0p7>IAR Aug 2000 </SPAN></DIV>
      <DIV class=ts7p4><SPAN class=ft1p7></SPAN></DIV>
      <DIV class=ts7p5><SPAN class=ft1p7>For the configurations made earlier in 
      the simple example project above, the device </SPAN></DIV>
      <DIV class=ts7p7><SPAN class=ft1p7>driver functions listed in table 1 will 
      be generated by default. The drivers are generated </SPAN></DIV>
      <DIV class=ts7p8><SPAN class=ft1p7>as one *.c file and one *.h file for 
      each peripheral module, and contain both initialization, </SPAN></DIV>
      <DIV class=ts7p9><SPAN class=ft1p7>run-time control, and interrupt handler 
      functions. </SPAN></DIV>
      <DIV class=ts7p14><SPAN class=ft1p7></SPAN></DIV>
      <DIV class=ts7p15><SPAN class=ft2p7>Bus controller driver functions 
      </SPAN></DIV>
      <DIV class=ts7p17><SPAN class=ft2p7>Purpose </SPAN></DIV>
      <DIV class=ts7p19><SPAN class=ft2p7>MA_Init_CPU() </SPAN></DIV>
      <DIV class=ts7p21><SPAN class=ft2p7>Initialize the bus controller 
      according to the dialog box. </SPAN></DIV>
      <DIV class=ts7p23><SPAN class=ft2p7>MA_Wait_CPU() </SPAN></DIV>
      <DIV class=ts7p25><SPAN class=ft2p7>Cause transition to wait mode. 
      </SPAN></DIV>
      <DIV class=ts7p27><SPAN class=ft2p7>MA_Stop_CPU() </SPAN></DIV>
      <DIV class=ts7p29><SPAN class=ft2p7>Cause transition to stop mode. 
      </SPAN></DIV>
      <DIV class=ts7p31><SPAN class=ft2p7>MA_PowerControl_CPU() </SPAN></DIV>
      <DIV class=ts7p33><SPAN class=ft2p7>Change clocking/power consumption. 
      </SPAN></DIV>
      <DIV class=ts7p36><SPAN class=ft2p7>MA_SoftwareReset_CPU() </SPAN></DIV>
      <DIV class=ts7p38><SPAN class=ft2p7>Reset the chip. </SPAN></DIV>
      <DIV class=ts7p40><SPAN class=ft2p7>MA_TrigWDT_CPU() </SPAN></DIV>
      <DIV class=ts7p42><SPAN class=ft2p7>Trig the watchdog timer. </SPAN></DIV>
      <DIV class=ts7p44><SPAN class=ft2p7>MA_CRC_CPU() </SPAN></DIV>
      <DIV class=ts7p46><SPAN class=ft2p7>Calculate checksum. </SPAN></DIV>
      <DIV class=ts7p48><SPAN class=ft2p7>MA_IntHandler_WDT_CPU() </SPAN></DIV>
      <DIV class=ts7p50><SPAN class=ft2p7>Interrupt handler for the watchdog 
      interrupt. </SPAN></DIV>
      <DIV class=ts7p52><SPAN class=ft2p7>MA_IntHandler_NMI_CPU() </SPAN></DIV>
      <DIV class=ts7p54><SPAN class=ft2p7>Interrupt handler for the NMI 
      interrupt. </SPAN></DIV>
      <DIV class=ts7p57><SPAN class=ft2p7>Interrupt controller driver 
      </SPAN></DIV>
      <DIV class=ts7p58><SPAN class=ft2p7>functions </SPAN></DIV>
      <DIV class=ts7p60><SPAN class=ft2p7>Purpose </SPAN></DIV>
      <DIV class=ts7p62><SPAN class=ft2p7>MA_Init_INT() </SPAN></DIV>
      <DIV class=ts7p64><SPAN class=ft2p7>Initialize the interrupt controller 
      according to the dialog box. </SPAN></DIV>
      <DIV class=ts7p66><SPAN class=ft2p7>MA_SetPriorityMask_INT() </SPAN></DIV>
      <DIV class=ts7p68><SPAN class=ft2p7>Change the priority mask for interrupt 
      filtering. </SPAN></DIV>
      <DIV class=ts7p70><SPAN class=ft2p7>MA_IntHandler_INT1_INT() </SPAN></DIV>
      <DIV class=ts7p72><SPAN class=ft2p7>Interrupt handler for the external 
      INT1 interrupt. </SPAN></DIV>
      <DIV class=ts7p75><SPAN class=ft2p7>MA_IntHandler_INT2_INT() </SPAN></DIV>
      <DIV class=ts7p77><SPAN class=ft2p7>Interrupt handler for the external 
      INT2 interrupt. </SPAN></DIV>
      <DIV class=ts7p79><SPAN class=ft2p7>Serial communications driver 
      </SPAN></DIV>
      <DIV class=ts7p80><SPAN class=ft2p7>functions </SPAN></DIV>
      <DIV class=ts7p82><SPAN class=ft2p7>Purpose </SPAN></DIV>
      <DIV class=ts7p84><SPAN class=ft2p7>MA_InitCh1_SCI() </SPAN></DIV>
      <DIV class=ts7p86><SPAN class=ft2p7>Initialize the UART channel 1 
      according to the dialog box. </SPAN></DIV>
      <DIV class=ts7p88><SPAN class=ft2p7>MA_PutCharCh1_SCI() </SPAN></DIV>
      <DIV class=ts7p91><SPAN class=ft2p7>Send a character on channel 1. 
      </SPAN></DIV>
      <DIV class=ts7p93><SPAN class=ft2p7>MA_PutStringCh1_SCI() </SPAN></DIV>
      <DIV class=ts7p95><SPAN class=ft2p7>Send a character string on channel 1. 
      </SPAN></DIV>
      <DIV class=ts7p97><SPAN class=ft2p7>MA_GetCharCh1_SCI() </SPAN></DIV>
      <DIV class=ts7p99><SPAN class=ft2p7>Receive a character from channel 1. 
      </SPAN></DIV>
      <DIV class=ts7p101><SPAN class=ft2p7>MA_GetStringCh1_SCI() </SPAN></DIV>
      <DIV class=ts7p103><SPAN class=ft2p7>Receive a character string from 
      channel 1. </SPAN></DIV>
      <DIV class=ts7p105><SPAN class=ft2p7>MA_IntHandler_TXI1_SCI() 
</SPAN></DIV>
      <DIV class=ts7p107><SPAN class=ft2p7>Interrupt handler for the channel 1 
      transmit empty interrupt. </SPAN></DIV>
      <DIV class=ts7p110><SPAN class=ft2p7>MA_IntHandler_RXI1_SCI() 
</SPAN></DIV>
      <DIV class=ts7p112><SPAN class=ft2p7>Interrupt handler for the channel 1 
      receive full interrupt. </SPAN></DIV>
      <DIV class=ts7p114><SPAN class=ft2p7>Table 1: Device driver functions 
      generated from the example project<SPAN class=ft1p7> </SPAN></SPAN></DIV>
      <DIV class=ts7p116><SPAN class=ft1p7></SPAN></DIV>
      <DIV class=ts7p117><SPAN class=ft3p7>Figure 5<SPAN class=ft1p7> shows an 
      example of how unnecessary d</SPAN><SPAN class=ft1p7>river functions can 
      be removed from </SPAN></SPAN></DIV>
      <DIV class=ts7p120><SPAN class=ft1p7>code generation; the functions for 
      sending and receiving character strings are removed </SPAN></DIV>
      <DIV class=ts7p121><SPAN class=ft1p7>in this case.&nbsp; </SPAN></DIV>
      <DIV class=ts7p123><SPAN 
class=ft1p7></SPAN></DIV></NOBR></TD></TR></TBODY></TABLE>
<DIV class=styleNavBarBot>
<TABLE border=0 cellSpacing=2 width=694>
  <TBODY>
  <TR></TR>
  <TR>
    <TD><A href="http://microcontroller.com/wp"><IMG 
      alt="Microcontroller.com White Papers" border=0 height=30 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/micrologoSmall.gif" 
      width=291></A></TD>
    <TD></TD>
    <TD width=14><A 
      href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers6.htm"><IMG 
      alt="Previous page" border=0 height=14 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/back.gif" 
      width=14></A></TD>
    <TD width=14><A 
      href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers7.htm#top"><IMG 
      alt=Top border=0 height=14 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/top.gif" 
      width=14></A></TD>
    <TD width=14><A 
      href="http://www.microcontroller.com/wp/DeviceDrivers/device_drivers8.htm"><IMG 
      alt="Next page" border=0 height=14 
      src="Embedded Systems Device Driver Development - page 7 of 9.files/forward.gif" 
      width=14></A></TD>
    <TD></TD></TR></TBODY></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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