刚开始学DSP 想来想去 还是从他的英文手册 慢慢的啃吧 凭借百度&各种翻译软件 总算 懂了 一点 现在为了 更好的理解也算加深一下套路记忆吧 把配置IO一个 小步骤 翻译一下 哟很多都是绝逼不通顺 的 不喜勿喷 纯粹为了学习!!!
To plan configuration of the GPIO module, consider the following steps:
Step 1. Plan the device pin-out:
Through a pin multiplexing scheme, a lot of flexibility is provided for assigning functionality to the GPIO-capable pins. Before getting started, look at the peripheral options available for each pin, and plan pin-out for your specific system. Will the pin be used as a general purpose input or output (GPIO) or as one of up to three available peripheral functions? Knowing this information will help determine how to further configure the pin.
To enable or disable the internal pullup resistors, write to the respective bits in the GPIO pullup disable(GPAPUD, GPBPUD, and GPCPUD) registers. For pins that can function as ePWM output pins(GPIO0-GPIO11), the internal pullup resistors are disabled by default. All other GPIO-capable pins have the pullup enabled by default.
步骤2:使能或者禁止内部上拉电阻
If the pin will be used as an input, specify the required input qualification, if any. The input qualification is specified in the GPACTRL, GPBCTRL, GPAQSEL1, GPAQSEL2, GPBQSEL1, and GPBQSEL2 registers. By default, all of the input signals are synchronized to SYSCLKOUT only
步骤3:选择输入限定
Configure the GPxMUXn registers such that the pin is a GPIO or one of three available peripheral functions. By default, all GPIO-capable pins are configured at reset as general purpose input pins.
步骤4:选择引脚功能
If the pin is configured as an GPIO, specify the direction of the pin as either input or output in the GPADIR, GPBDIR, and GPCDIR registers. By default, all GPIO pins are inputs. To change the pin from input to output, first load the output latch with the value to be driven by writing the appropriate value to the GPxCLEAR, GPxSET, or GPxTOGGLE registers. Once the output latch is loaded, change the pin direction from input to output via the GPxDIR registers. The output latch for all pins is cleared at
Specify which pins, if any, will be able to wake the device from HALT and STANDBY low power modes. The pins are specified in the GPIOLPMSEL register.
Specify the source for the XINT1 - XINT7, and XNMI interrupts. For each interrupt you can specify one of the port A signals (for XINT1/2/3) or port B signals (XINT4/5/6/7) as the source. This is done by specifying the source in the GPIOXINTnSEL, and GPIOXNMISEL registers. The polarity of the interrupts can be configured in the XINTnCR, and the registers as described inSection 8.6.
GPxMUXn and GPxQSELn occurs to when the action is valid