打印
[CC3200]

CC3200 MCU 实验

[复制链接]
702|8
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
设备的所有数字针可以用作通用输入/输出(GPIO),GPIO 可用于各种目的, GPIO 模块由
4 部分组成,它们分别是:
 GPIO A0
 GPIO A1
 GPIO A2
 GPIO A3
GPIO 的每个部分包括 8 个 GPIO。 GPIO 模块支持 30 个可编程的 GPIO 引脚,用于外围设
备的使用。  

使用特权

评论回复
评论
dirtwillfly 2019-7-31 21:04 回复TA
感谢分享 

相关帖子

沙发
gaoke231|  楼主 | 2019-7-31 15:36 | 只看该作者
应用说明
这个应用程序的目的是展示通过调用 Driverlib 库中的 API 实现对 GPIO 控制, LED 灯
连接在 GPIO 管脚表示 GPIO 的输出,通过周期性的给 GPIO 引脚高低电平来实现 LED 灯的亮
灭。 在原理图中可以看出 LED 低电平点亮,即引脚输出低电平, LED 点亮,引脚输出高电
平, LED 熄灭。

使用特权

评论回复
板凳
gaoke231|  楼主 | 2019-7-31 15:39 | 只看该作者
原理图如下:

使用特权

评论回复
地板
gaoke231|  楼主 | 2019-7-31 16:38 | 只看该作者
void LEDBlinkyRoutine()
{
    //
    // Toggle the lines initially to turn off the LEDs.
    // The values driven are as required by the LEDs on the LP.
    //
    GPIO_IF_LedOff(MCU_ALL_LED_IND);
    while(1)
    {
        //
        // Alternately toggle hi-low each of the GPIOs
        // to switch the corresponding LED on/off.
        //
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOn(MCU_RED_LED_GPIO);
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOff(MCU_RED_LED_GPIO);
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOn(MCU_BLUE_LED_GPIO);
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOff(MCU_BLUE_LED_GPIO);
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOn(MCU_GREEN_LED_GPIO);
        MAP_UtilsDelay(8000000);
        GPIO_IF_LedOff(MCU_GREEN_LED_GPIO);
    }

}

使用特权

评论回复
5
gaoke231|  楼主 | 2019-7-31 16:39 | 只看该作者
static void
BoardInit(void)
{
/* In case of TI-RTOS vector table is initialize by OS itself */
#ifndef USE_TIRTOS
    //
    // Set vector table base
    //
#if defined(ccs)
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);
#endif
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
#endif
   
    //
    // Enable Processor
    //
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();
}

使用特权

评论回复
6
gaoke231|  楼主 | 2019-7-31 16:39 | 只看该作者
int
main()
{
    //
    // Initialize Board configurations
    //
    BoardInit();
   
    //
    // Power on the corresponding GPIO port B for 9,10,11.
    // Set up the GPIO lines to mode 0 (GPIO)
    //
    PinMuxConfig();
    GPIO_IF_LedConfigure(LED1|LED2|LED3);

    GPIO_IF_LedOff(MCU_ALL_LED_IND);
   
    //
    // Start the LEDBlinkyRoutine
    //
    LEDBlinkyRoutine();
    return 0;
}

使用特权

评论回复
7
gaoke231|  楼主 | 2019-7-31 16:41 | 只看该作者
void PinMuxConfig(void)
{
        //
    // Enable Peripheral Clocks
    //
        PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);
        PRCMPeripheralClkEnable(PRCM_GPIOA3, PRCM_RUN_MODE_CLK);

        //
    // Configure PIN_15 for GPIO Output
    //
        PinTypeGPIO(PIN_15, PIN_MODE_0, false);
        GPIODirModeSet(GPIOA2_BASE, 0x40, GPIO_DIR_MODE_OUT);

        //
    // Configure PIN_18 for GPIO Output
    //
        PinTypeGPIO(PIN_18, PIN_MODE_0, false);
        GPIODirModeSet(GPIOA3_BASE, 0x10, GPIO_DIR_MODE_OUT);

        //
    // Configure PIN_53 for GPIO Output
    //
        PinTypeGPIO(PIN_53, PIN_MODE_0, false);
        GPIODirModeSet(GPIOA3_BASE, 0x40, GPIO_DIR_MODE_OUT);
}

使用特权

评论回复
8
xinxianshi| | 2019-7-31 22:28 | 只看该作者
有点小费劲。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

54

主题

1310

帖子

5

粉丝