STM32 求帮助

2019-03-23 19:28发布

我用STM32写的一个简单的IO操作   出现如下错误  工具是IAR5.5     麻烦各位大神看哈

Warning[Pe223]: function "GPIO_ReadIuputData" declared implicitly E:YZXMAKEIAR FOR STM321usermain.c 11
Error[Pe029]: expected an expression E:YZXMAKEIAR FOR STM321usermain.c 12
Error while running C/C++ Compiler

Total number of errors: 1
Total number of warnings: 1
  1. #include "stm32f10x_lib.h"
  2. unsigned short temp;
  3. void RCC_Configuration(void);
  4. void GPIO_Configuration(void);
  5. int main(void)
  6. {
  7.     RCC_Configuration();
  8.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
  9.     while(1)
  10.     {
  11.         temp = GPIO_ReadIuputData(GPIOA);
  12.         temp & = 0x07;
  13.         if(temp==0x06)
  14.         {
  15.             GPIO_SetBits(GPIOA,GPIO_Pin_4);   
  16.         }
  17.         else if(temp==0x05)
  18.         {
  19.             GPIO_SetBits(GPIOA,GPIO_Pin_5);
  20.         }else if(temp==0x03)
  21.         {
  22.             GPIO_SetBits(GPIOA,GPIO_Pin_6);
  23.         }
  24.         else
  25.             GPIO_SetBits(GPIOA,GPIO_Pin_7);
  26.     }
  27. }
  28. void RCC_Configuration(void)
  29. {
  30.     ErrorStatus HSEStartUpStatus;   
  31.     RCC_DeInit();
  32.     RCC_HSEConfig(RCC_HSE_ON);
  33.     HSEStartUpStatus = RCC_WaitForHSEStartUp();
  34.     if(HSEStartUpStatus == SUCCESS)
  35.     {
  36.         FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
  37.         FLASH_SetLatency(FLASH_Latency_2);
  38.         RCC_HCLKConfig(RCC_SYSCLK_Div1);
  39.         RCC_PCLK2Config(RCC_HCLK_Div1);
  40.         RCC_PCLK1Config(RCC_HCLK_Div2);
  41.         RCC_PLLConfig(RCC_PLLSource_HSE_Div1,RCC_PLLMul_9);
  42.         RCC_PLLCmd(ENABLE);
  43.         while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY)==RESET);
  44.         RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
  45.         while(RCC_GetSYSCLKSource() != 0x08);
  46.     }
  47. }
  48. void GPIO_Configuration(void)
  49. {   
  50.     GPIO_InitTypeDef GPIO_InitStructure;
  51.     GPIO_InitStructure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2;
  52.     GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
  53.     GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  54.     GPIO_Init(GPIOA,&GPIO_InitStructure);
  55.     GPIO_InitStructure.GPIO_Pin=GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;
  56.     GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
  57.     GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  58.     GPIO_Init(GPIOA,&GPIO_InitStructure);
  59. }
复制代码 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
4条回答
wudayongnb
1楼-- · 2019-03-24 01:25
 精彩回答 2  元偷偷看……
CDU
2楼-- · 2019-03-24 05:48
unsigned short temp;    temp是16位   readinputdata这个函数返回的数据也是16位
wudayongnb
3楼-- · 2019-03-24 10:13
&和=中间不能有空格
CDU
4楼-- · 2019-03-24 14:54
 精彩回答 2  元偷偷看……

一周热门 更多>