求各位大神帮帮忙啊, 我到网上买了一个GPS模块 NEO6M的模块 ,我想实现的东西是通过STM32开发它,解析出经纬度,再显示在OLED显示屏上,它里面有用STM32开发的例程,其实写得很详细了,但是它使用的显示屏是SPI通信的显示屏,但是我现在只能用2管脚的I2C通信的显示屏,求各位帮帮忙啊,通俗一点就是再它的原程序上加上IIC OLED(SSD1306)的驱动,只用SCL SDA显示,求各位大神帮帮忙啊 附件里有GPS模块和IIC OLED的详细例程 希望大家帮帮忙啊 感激不尽 附件中的IIC OLED已经有IIC的驱动了 附件中的GPS模块也很详细了 如果还需要其他的资料 还可以向我要啊 我还有这些东西的技术手册 IIC OLED的技术资料 在这https://pan.baidu.com/share/link? ... 1&uk=2302102993 GPS模块解析出经纬度的 技术资料 https://pan.baidu.com/s/1pJLqhtT |
SSD1306 是这个 方案的啊 谢谢了
但是他的例程使用的是用显示屏幕不是IIC OLED 我现在想用0.96OLED IIC 通信 显示出来 不知道怎么移植IIC驱动
帮你顶下吧。
怎么改啊 驱动加上去 编译老出错
谢谢了啊 大哥 我现在改了 IIC的驱动用这个了 http://yun.baidu.com/s/1bn2HK4Z 希望你下载来看看 这个更方便 我编译上去 错误是这样的
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(312): error: #256: invalid redeclaration of type name "s32" (declared at line 23 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef int32_t s32;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(316): error: #256: invalid redeclaration of type name "sc32" (declared at line 27 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef const int32_t sc32; /*!< Read Only */
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(320): error: #256: invalid redeclaration of type name "vs32" (declared at line 31 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef __IO int32_t vs32;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(324): error: #256: invalid redeclaration of type name "vsc32" (declared at line 35 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef __I int32_t vsc32; /*!< Read Only */
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(328): error: #256: invalid redeclaration of type name "u32" (declared at line 39 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef uint32_t u32;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(332): error: #256: invalid redeclaration of type name "uc32" (declared at line 43 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef const uint32_t uc32; /*!< Read Only */
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(336): error: #256: invalid redeclaration of type name "vu32" (declared at line 47 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef __IO uint32_t vu32;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(340): error: #256: invalid redeclaration of type name "vuc32" (declared at line 51 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef __I uint32_t vuc32; /*!< Read Only */
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error: #101: "FALSE" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {FALSE = 0, TRUE = !FALSE} bool;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error: #101: "TRUE" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {FALSE = 0, TRUE = !FALSE} bool;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error: #256: invalid redeclaration of type name "bool" (declared at line 55 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {FALSE = 0, TRUE = !FALSE} bool;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error: #101: "RESET" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error: #101: "SET" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error: #256: invalid redeclaration of type name "FlagStatus" (declared at line 57 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error: #256: invalid redeclaration of type name "ITStatus" (declared at line 57 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error: #101: "DISABLE" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error: #101: "ENABLE" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error: #256: invalid redeclaration of type name "FunctionalState" (declared at line 59 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error: #101: "ERROR" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error: #101: "SUCCESS" has already been declared in the current scope
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error: #256: invalid redeclaration of type name "ErrorStatus" (declared at line 62 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(389): error: #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 58 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } ADC_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(488): error: #256: invalid redeclaration of type name "BKP_TypeDef" (declared at line 154 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } BKP_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(500): error: #256: invalid redeclaration of type name "CAN_TxMailBox_TypeDef" (declared at line 163 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } CAN_TxMailBox_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(512): error: #256: invalid redeclaration of type name "CAN_FIFOMailBox_TypeDef" (declared at line 171 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } CAN_FIFOMailBox_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(522): error: #256: invalid redeclaration of type name "CAN_FilterRegister_TypeDef" (declared at line 177 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } CAN_FilterRegister_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(556): error: #256: invalid redeclaration of type name "CAN_TypeDef" (declared at line 203 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } CAN_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(569): error: #256: invalid redeclaration of type name "CRC_TypeDef" (declared at line 213 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } CRC_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(590): error: #256: invalid redeclaration of type name "DAC_TypeDef" (declared at line 232 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: } DAC_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(600): error: #256: invalid redeclaration of type name "DBGMCU_TypeDef" (declared at line 239 of "F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: }DBGMCU_TypeDef;
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: ^
F:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: test.c: 0 warnings, 30 errors
compiling oled.c...
..\HARDWARE\OLED\oled.c(40): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Set();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(40): error: #20: identifier "GPIO_Pin_6" is undefined
..\HARDWARE\OLED\oled.c: OLED_SCLK_Set();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(41): error: #20: identifier "GPIO_Pin_7" is undefined
..\HARDWARE\OLED\oled.c: OLED_SDIN_Set();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(42): warning: #223-D: function "GPIO_ResetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SDIN_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(52): warning: #223-D: function "GPIO_ResetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(52): error: #20: identifier "GPIO_Pin_6" is undefined
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(53): error: #20: identifier "GPIO_Pin_7" is undefined
..\HARDWARE\OLED\oled.c: OLED_SDIN_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(54): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SDIN_Set();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(69): warning: #223-D: function "GPIO_ResetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(69): error: #20: identifier "GPIO_Pin_6" is undefined
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(72): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: {OLED_SDIN_Set();}
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(72): error: #20: identifier "GPIO_Pin_7" is undefined
..\HARDWARE\OLED\oled.c: {OLED_SDIN_Set();}
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(73): error: #20: identifier "GPIO_Pin_7" is undefined
..\HARDWARE\OLED\oled.c: else OLED_SDIN_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(75): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Set();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(78): warning: #223-D: function "GPIO_ResetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(78): error: #20: identifier "GPIO_Pin_6" is undefined
..\HARDWARE\OLED\oled.c: OLED_SCLK_Clr();
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(79): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: OLED_SCLK_Set() ;
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(238): error: #20: identifier "GPIO_InitTypeDef" is undefined
..\HARDWARE\OLED\oled.c: GPIO_InitTypeDef GPIO_InitStructure;
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(239): warning: #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
..\HARDWARE\OLED\oled.c: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); //使能PC,D,G端口时钟
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(239): error: #20: identifier "RCC_APB2Periph_GPIOC" is undefined
..\HARDWARE\OLED\oled.c: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); //使能PC,D,G端口时钟
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(240): error: #20: identifier "GPIO_Pin_6" is undefined
..\HARDWARE\OLED\oled.c: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6|GPIO_Pin_7; //PD3,PD6推挽输出
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(240): error: #20: identifier "GPIO_Pin_7" is undefined
..\HARDWARE\OLED\oled.c: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6|GPIO_Pin_7; //PD3,PD6推挽输出
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(241): error: #20: identifier "GPIO_Mode_Out_PP" is undefined
..\HARDWARE\OLED\oled.c: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(242): error: #20: identifier "GPIO_Speed_50MHz" is undefined
..\HARDWARE\OLED\oled.c: GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//速度50MHz
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(243): warning: #223-D: function "GPIO_Init" declared implicitly
..\HARDWARE\OLED\oled.c: GPIO_Init(GPIOC, &GPIO_InitStructure); //初始化GPIOD3,6
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c(244): warning: #223-D: function "GPIO_SetBits" declared implicitly
..\HARDWARE\OLED\oled.c: GPIO_SetBits(GPIOC,GPIO_Pin_6|GPIO_Pin_7); //PD3,PD6 输出高
..\HARDWARE\OLED\oled.c: ^
..\HARDWARE\OLED\oled.c: ..\HARDWARE\OLED\oled.c: 12 warnings, 14 errors
Target not created