Explorar el Código

modified apm32f10x.h and apm32f10x_i2c.c

luobeihai hace 2 años
padre
commit
e68ec3a539

+ 2 - 2
libraries/APM32F10x_StdPeriphDriver/src/apm32f10x_i2c.c

@@ -75,7 +75,7 @@ void I2C_Config(I2C_T* i2c, I2C_Config_T* i2cConfig)
     uint32_t PCLK1 = 8000000, PCLK2 = 0;
     uint16_t result = 0x04;
 
-    i2c->SWITCH = 0;
+    i2c->I2C_SWITCH = 0;
 
     /* I2C CTRL2 Configuration */
     RCM_ReadPCLKFreq(&PCLK1, &PCLK2);
@@ -399,7 +399,7 @@ uint16_t I2C_ReadRegister(I2C_T* i2c, I2C_REGISTER_T i2cRegister)
         case I2C_REGISTER_RISETMAX:
             return i2c->RISETMAX;
         case I2C_REGISTER_SWITCH:
-            return i2c->SWITCH;
+            return i2c->I2C_SWITCH;
         default:
             return 0;
     }

+ 4 - 4
libraries/CMSIS/Device/Geehy/APM32F10x/Include/apm32f10x.h

@@ -3351,11 +3351,11 @@ typedef struct
     /* @brief I2C Switching register */
     union
     {
-        __IOM uint32_t SWITCH;
+        __IOM uint32_t I2C_SWITCH;
 
         struct
         {
-            __IOM uint32_t SWITCH          : 1;
+            __IOM uint32_t I2C_SWITCH          : 1;
             __IM uint32_t RESERVED1        : 31;
         } SWITCH_B;
     };
@@ -6111,11 +6111,11 @@ typedef struct
     /* @brief Buffer table address register  */
     union
     {
-        __IOM uint32_t SWITCH;
+        __IOM uint32_t USB_SWITCH;
 
         struct
         {
-            __IOM uint32_t SWITCH           : 1;
+            __IOM uint32_t USB_SWITCH           : 1;
             __IM  uint32_t RESERVED         : 31;
         } SWITCH_B;
     };