在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > LM3S9B96的EPI總線的HB8模式配置

            LM3S9B96的EPI總線的HB8模式配置

            作者: 時間:2016-11-11 來源:網絡 收藏
            下面是EPI的HB8模式的例子:

            本文引用地址:http://www.biyoush.com/article/201611/317014.htm

            /* Includes -----------------------------------------*/

            #include"inc/hw_memmap.h"
            #include"inc/hw_types.h"
            #include"driverlib/gpio.h"
            #include"driverlib/sysctl.h"
            #include"driverlib/epi.h"
            /* Private variables ------------------------------*/
            unsignedchartemp;
            /*********************************************
            *
            * Use the following to specify the GPIO pins used by the HB8 EPI bus.
            *
            ***********************************************/
            #defineEPI_PORTC_PINS(GPIO_PIN_7|GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4)
            #defineEPI_PORTD_PINS(GPIO_PIN_3|GPIO_PIN_2)
            #defineEPI_PORTE_PINS(GPIO_PIN_1|GPIO_PIN_0)
            #defineEPI_PORTF_PINS(GPIO_PIN_5|GPIO_PIN_4)
            #defineEPI_PORTG_PINS(GPIO_PIN_7|GPIO_PIN_1|GPIO_PIN_0)
            #defineEPI_PORTH_PINS(GPIO_PIN_5|GPIO_PIN_4|GPIO_PIN_3|GPIO_PIN_2|
            GPIO_PIN_1|GPIO_PIN_0)
            #defineEPI_PORTJ_PINS(GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4|GPIO_PIN_3|
            GPIO_PIN_2|GPIO_PIN_1|GPIO_PIN_0)
            /********************************************************
            *
            * A pointer to the EPI Peripheral. Note that g_pusEPIPER is declared
            * as volatile so the compiler should not optimize reads out of the image.
            *
            **********************************************************/
            staticvolatileunsignedshort*g_pusEPIPER;
            /**********************************************************
            * Function Name : main
            * Description : Main program.
            * Input : None
            * Output : None
            * Return : None
            ***********************************************************/
            intmain(void)
            {
            // Set the clocking to run directly from the external crystal/oscillator
            SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
            SYSCTL_XTAL_16MHZ);
            // The EPI0 peripheral must be enabled for use
            SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);
            // For this example EPI0 is used with multiple pins on PortC, E, F, G, H, and J
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
            SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
            // configures the internal pin muxes to set the EPI pins for use with EPI
            GPIOPinConfigure(GPIO_PH3_EPI0S0);
            GPIOPinConfigure(GPIO_PH2_EPI0S1);
            GPIOPinConfigure(GPIO_PC4_EPI0S2);
            GPIOPinConfigure(GPIO_PC5_EPI0S3);
            GPIOPinConfigure(GPIO_PC6_EPI0S4);
            GPIOPinConfigure(GPIO_PC7_EPI0S5);
            GPIOPinConfigure(GPIO_PH0_EPI0S6);
            GPIOPinConfigure(GPIO_PH1_EPI0S7);
            GPIOPinConfigure(GPIO_PE0_EPI0S8);
            GPIOPinConfigure(GPIO_PE1_EPI0S9);
            GPIOPinConfigure(GPIO_PH4_EPI0S10);
            GPIOPinConfigure(GPIO_PH5_EPI0S11);
            GPIOPinConfigure(GPIO_PF4_EPI0S12);
            GPIOPinConfigure(GPIO_PG0_EPI0S13);
            GPIOPinConfigure(GPIO_PG1_EPI0S14);
            GPIOPinConfigure(GPIO_PF5_EPI0S15);
            GPIOPinConfigure(GPIO_PJ0_EPI0S16);
            GPIOPinConfigure(GPIO_PJ1_EPI0S17);
            GPIOPinConfigure(GPIO_PJ2_EPI0S18);
            GPIOPinConfigure(GPIO_PJ3_EPI0S19);
            // GPIOPinConfigure(GPIO_PD2_EPI0S20);
            // GPIOPinConfigure(GPIO_PD3_EPI0S21);
            // GPIOPinConfigure(GPIO_PB5_EPI0S22);
            // GPIOPinConfigure(GPIO_PB4_EPI0S23);
            GPIOPinConfigure(GPIO_PE2_EPI0S24);
            GPIOPinConfigure(GPIO_PE3_EPI0S25);
            GPIOPinConfigure(GPIO_PJ4_EPI0S28);
            GPIOPinConfigure(GPIO_PJ5_EPI0S29);
            GPIOPinConfigure(GPIO_PJ6_EPI0S30);
            GPIOPinConfigure(GPIO_PG7_EPI0S31);
            // Configure the GPIO pins for EPI mode
            GPIOPinTypeEPI(GPIO_PORTC_BASE, EPI_PORTC_PINS);
            GPIOPinTypeEPI(GPIO_PORTE_BASE, EPI_PORTE_PINS);
            GPIOPinTypeEPI(GPIO_PORTF_BASE, EPI_PORTF_PINS);
            GPIOPinTypeEPI(GPIO_PORTG_BASE, EPI_PORTG_PINS);
            GPIOPinTypeEPI(GPIO_PORTH_BASE, EPI_PORTH_PINS);
            GPIOPinTypeEPI(GPIO_PORTJ_BASE, EPI_PORTJ_PINS);
            // Sets the clock divider for the EPI module. In this case set the
            // divider to 0, making the EPIClock = SysClk.
            EPIDividerSet(EPI0_BASE, 0);
            // Sets the usage mode of the EPI module. EPI_MODE_HB8
            EPIModeSet(EPI0_BASE, EPI_MODE_HB8);
            // 使用相同波特率 地址數據不復用 cs信號 字節(jié)讀取
            EPIConfigHB8Set(EPI0_BASE, EPI_HB8_MODE_ADDEMUX | EPI_HB8_WRWAIT_1 |
            EPI_HB8_RDWAIT_1 | EPI_HB8_CSCFG_CS, 0);
            // 映射到片外外設地址0xA000 0000
            EPIAddressMapSet(EPI0_BASE, EPI_ADDR_PER_SIZE_256B | EPI_ADDR_PER_BASE_A);
            g_pusEPIPER = (unsigned short *)0xA0000000;
            // 初始化完畢,就可以使用讀寫數據了
            g_pusEPIPER[0] = 0xff; // 表示向外設地址0處寫ff
            temp = g_pusEPIPER[0]; // 表示讀地址0處的值
            }

            僅供參考!


            評論


            技術專區(qū)

            關閉