【MPC5744P】S32DS配置gpio

DEVKIT-mpc5744p配置gpio

软件:S32 Design Studio for Power Architecture Version 2.1
本文工程下载

  1. 新建工程
    在这里插入图片描述
  2. 搜索选择芯片
    在这里插入图片描述
  3. 选择SDK,新建
    在这里插入图片描述
  4. 先编译一下, 双击Componentspin_mux打开引脚配置, 没有这个窗口的话: Window->Show View->Other->Processor Expert
    在这里插入图片描述
  5. 配置LED所在引脚PC13为输出
    在这里插入图片描述
  6. ctrl+s保存, 点击生成代码
    在这里插入图片描述
  7. 添加初始化和业务代码
    PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr); // 初始化所有引脚
    while(1)
    {
        /* Insert a small delay to make the blinking visible */
        delay(720000);
        /* Toggle output value LED1 */
        PINS_DRV_TogglePins(PTC, (1<<13));  // PTC13闪烁
    }
    
    在main函数前加一个延时函数
    void delay(volatile int cycles)
    {
        /* Delay function - do nothing for a number of cycles */
        while(cycles--);
    }
    
  8. 编译, Debug, 成功!
  9. SDK/platform/drivers/src/pins/siul2/pins_siul2_driver.c中可以找到其他gpio置位,复位等函数

猜你喜欢

转载自blog.csdn.net/weixin_46143152/article/details/125563870