加入eeprom驱动,用于保存屏幕触控的校准数据
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
[PreviousLibFiles]
|
||||
LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_armv8mbl.h;
|
||||
LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_armv8mbl.h;
|
||||
|
||||
[PreviousUsedCubeIDEFiles]
|
||||
SourceFiles=Core/Src/main.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;;
|
||||
SourceFiles=Core/Src/main.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;;
|
||||
HeaderPath=Drivers/STM32F1xx_HAL_Driver/Inc;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F1xx/Include;Drivers/CMSIS/Include;Core/Inc;
|
||||
CDefines=USE_HAL_DRIVER;STM32F103xE;USE_HAL_DRIVER;USE_HAL_DRIVER;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/*#define HAL_ETH_MODULE_ENABLED */
|
||||
/*#define HAL_FLASH_MODULE_ENABLED */
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
/*#define HAL_I2C_MODULE_ENABLED */
|
||||
#define HAL_I2C_MODULE_ENABLED
|
||||
/*#define HAL_I2S_MODULE_ENABLED */
|
||||
/*#define HAL_IRDA_MODULE_ENABLED */
|
||||
/*#define HAL_IWDG_MODULE_ENABLED */
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
I2C_HandleTypeDef hi2c2;
|
||||
|
||||
SRAM_HandleTypeDef hsram1;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
@@ -50,6 +52,7 @@ SRAM_HandleTypeDef hsram1;
|
||||
void SystemClock_Config(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_FSMC_Init(void);
|
||||
static void MX_I2C2_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@@ -88,6 +91,7 @@ int main(void)
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_FSMC_Init();
|
||||
MX_I2C2_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
main_app();
|
||||
/* USER CODE END 2 */
|
||||
@@ -141,6 +145,40 @@ void SystemClock_Config(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C2 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_I2C2_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN I2C2_Init 0 */
|
||||
|
||||
/* USER CODE END I2C2_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN I2C2_Init 1 */
|
||||
|
||||
/* USER CODE END I2C2_Init 1 */
|
||||
hi2c2.Instance = I2C2;
|
||||
hi2c2.Init.ClockSpeed = 100000;
|
||||
hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||
hi2c2.Init.OwnAddress1 = 0;
|
||||
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
hi2c2.Init.OwnAddress2 = 0;
|
||||
hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
||||
hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
||||
if (HAL_I2C_Init(&hi2c2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN I2C2_Init 2 */
|
||||
|
||||
/* USER CODE END I2C2_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GPIO Initialization Function
|
||||
* @param None
|
||||
|
||||
@@ -81,6 +81,71 @@ void HAL_MspInit(void)
|
||||
/* USER CODE END MspInit 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
* @param hi2c: I2C handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(hi2c->Instance==I2C2)
|
||||
{
|
||||
/* USER CODE BEGIN I2C2_MspInit 0 */
|
||||
|
||||
/* USER CODE END I2C2_MspInit 0 */
|
||||
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**I2C2 GPIO Configuration
|
||||
PB10 ------> I2C2_SCL
|
||||
PB11 ------> I2C2_SDA
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_I2C2_CLK_ENABLE();
|
||||
/* USER CODE BEGIN I2C2_MspInit 1 */
|
||||
|
||||
/* USER CODE END I2C2_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
* @param hi2c: I2C handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
|
||||
{
|
||||
if(hi2c->Instance==I2C2)
|
||||
{
|
||||
/* USER CODE BEGIN I2C2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END I2C2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_I2C2_CLK_DISABLE();
|
||||
|
||||
/**I2C2 GPIO Configuration
|
||||
PB10 ------> I2C2_SCL
|
||||
PB11 ------> I2C2_SDA
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_11);
|
||||
|
||||
/* USER CODE BEGIN I2C2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END I2C2_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static uint32_t FSMC_Initialized = 0;
|
||||
|
||||
static void HAL_FSMC_MspInit(void){
|
||||
|
||||
@@ -22,6 +22,7 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/main.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/SW_APPs/Main_APP.h
|
||||
|
||||
@@ -73,6 +74,8 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/main.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/SW_APPs/Main_APP.h:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
main.c:66:5:main 8 static
|
||||
main.c:110:6:SystemClock_Config 72 static
|
||||
main.c:149:13:MX_GPIO_Init 48 static
|
||||
main.c:199:13:MX_FSMC_Init 40 static
|
||||
main.c:263:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
main.c:69:5:main 8 static
|
||||
main.c:114:6:SystemClock_Config 72 static
|
||||
main.c:153:13:MX_I2C2_Init 8 static
|
||||
main.c:187:13:MX_GPIO_Init 48 static
|
||||
main.c:237:13:MX_FSMC_Init 40 static
|
||||
main.c:301:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
||||
@@ -22,6 +22,7 @@ Core/Src/stm32f1xx_hal_msp.o: ../Core/Src/stm32f1xx_hal_msp.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Core/Inc/main.h:
|
||||
@@ -72,4 +73,6 @@ Core/Src/stm32f1xx_hal_msp.o: ../Core/Src/stm32f1xx_hal_msp.c \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
stm32f1xx_hal_msp.c:64:6:HAL_MspInit 24 static
|
||||
stm32f1xx_hal_msp.c:86:13:HAL_FSMC_MspInit 32 static
|
||||
stm32f1xx_hal_msp.c:145:6:HAL_SRAM_MspInit 16 static
|
||||
stm32f1xx_hal_msp.c:157:13:HAL_FSMC_MspDeInit 8 static
|
||||
stm32f1xx_hal_msp.c:205:6:HAL_SRAM_MspDeInit 16 static
|
||||
stm32f1xx_hal_msp.c:90:6:HAL_I2C_MspInit 40 static
|
||||
stm32f1xx_hal_msp.c:124:6:HAL_I2C_MspDeInit 16 static
|
||||
stm32f1xx_hal_msp.c:151:13:HAL_FSMC_MspInit 32 static
|
||||
stm32f1xx_hal_msp.c:210:6:HAL_SRAM_MspInit 16 static
|
||||
stm32f1xx_hal_msp.c:222:13:HAL_FSMC_MspDeInit 8 static
|
||||
stm32f1xx_hal_msp.c:270:6:HAL_SRAM_MspDeInit 16 static
|
||||
|
||||
@@ -22,6 +22,7 @@ Core/Src/stm32f1xx_it.o: ../Core/Src/stm32f1xx_it.c ../Core/Inc/main.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
../Core/Inc/stm32f1xx_it.h
|
||||
|
||||
@@ -73,6 +74,8 @@ Core/Src/stm32f1xx_it.o: ../Core/Src/stm32f1xx_it.c ../Core/Inc/main.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../Core/Inc/stm32f1xx_it.h:
|
||||
|
||||
@@ -22,6 +22,7 @@ Core/Src/system_stm32f1xx.o: ../Core/Src/system_stm32f1xx.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
|
||||
@@ -70,4 +71,6 @@ Core/Src/system_stm32f1xx.o: ../Core/Src/system_stm32f1xx.c \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h \
|
||||
../Core/Inc/stm32f1xx_hal_conf.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h \
|
||||
../Drivers/CMSIS/Include/core_cm3.h \
|
||||
../Drivers/CMSIS/Include/cmsis_version.h \
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h \
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
|
||||
../Core/Inc/stm32f1xx_hal_conf.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h:
|
||||
|
||||
../Drivers/CMSIS/Include/core_cm3.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_version.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
@@ -0,0 +1,81 @@
|
||||
stm32f1xx_hal_i2c.c:453:19:HAL_I2C_Init 24 static
|
||||
stm32f1xx_hal_i2c.c:568:19:HAL_I2C_DeInit 16 static
|
||||
stm32f1xx_hal_i2c.c:614:13:HAL_I2C_MspInit 16 static
|
||||
stm32f1xx_hal_i2c.c:630:13:HAL_I2C_MspDeInit 16 static
|
||||
stm32f1xx_hal_i2c.c:1050:19:HAL_I2C_Master_Transmit 40 static
|
||||
stm32f1xx_hal_i2c.c:1171:19:HAL_I2C_Master_Receive 56 static,ignoring_inline_asm
|
||||
stm32f1xx_hal_i2c.c:1462:19:HAL_I2C_Slave_Transmit 48 static
|
||||
stm32f1xx_hal_i2c.c:1592:19:HAL_I2C_Slave_Receive 48 static
|
||||
stm32f1xx_hal_i2c.c:1713:19:HAL_I2C_Master_Transmit_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:1793:19:HAL_I2C_Master_Receive_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:1876:19:HAL_I2C_Slave_Transmit_IT 24 static
|
||||
stm32f1xx_hal_i2c.c:1938:19:HAL_I2C_Slave_Receive_IT 24 static
|
||||
stm32f1xx_hal_i2c.c:2002:19:HAL_I2C_Master_Transmit_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:2158:19:HAL_I2C_Master_Receive_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:2312:19:HAL_I2C_Slave_Transmit_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:2424:19:HAL_I2C_Slave_Receive_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:2541:19:HAL_I2C_Mem_Write 40 static
|
||||
stm32f1xx_hal_i2c.c:2664:19:HAL_I2C_Mem_Read 56 static,ignoring_inline_asm
|
||||
stm32f1xx_hal_i2c.c:2960:19:HAL_I2C_Mem_Write_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:3048:19:HAL_I2C_Mem_Read_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:3142:19:HAL_I2C_Mem_Write_DMA 48 static
|
||||
stm32f1xx_hal_i2c.c:3321:19:HAL_I2C_Mem_Read_DMA 56 static
|
||||
stm32f1xx_hal_i2c.c:3514:19:HAL_I2C_IsDeviceReady 48 static
|
||||
stm32f1xx_hal_i2c.c:3650:19:HAL_I2C_Master_Seq_Transmit_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:3748:19:HAL_I2C_Master_Seq_Transmit_DMA 40 static
|
||||
stm32f1xx_hal_i2c.c:3931:19:HAL_I2C_Master_Seq_Receive_IT 40 static
|
||||
stm32f1xx_hal_i2c.c:4055:19:HAL_I2C_Master_Seq_Receive_DMA 40 static
|
||||
stm32f1xx_hal_i2c.c:4273:19:HAL_I2C_Slave_Seq_Transmit_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:4339:19:HAL_I2C_Slave_Seq_Transmit_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:4513:19:HAL_I2C_Slave_Seq_Receive_IT 32 static
|
||||
stm32f1xx_hal_i2c.c:4579:19:HAL_I2C_Slave_Seq_Receive_DMA 32 static
|
||||
stm32f1xx_hal_i2c.c:4749:19:HAL_I2C_EnableListen_IT 16 static
|
||||
stm32f1xx_hal_i2c.c:4782:19:HAL_I2C_DisableListen_IT 24 static
|
||||
stm32f1xx_hal_i2c.c:4817:19:HAL_I2C_Master_Abort_IT 24 static
|
||||
stm32f1xx_hal_i2c.c:4876:6:HAL_I2C_EV_IRQHandler 40 static
|
||||
stm32f1xx_hal_i2c.c:5045:6:HAL_I2C_ER_IRQHandler 48 static
|
||||
stm32f1xx_hal_i2c.c:5128:13:HAL_I2C_MasterTxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5144:13:HAL_I2C_MasterRxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5159:13:HAL_I2C_SlaveTxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5175:13:HAL_I2C_SlaveRxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5193:13:HAL_I2C_AddrCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5211:13:HAL_I2C_ListenCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5227:13:HAL_I2C_MemTxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5243:13:HAL_I2C_MemRxCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5259:13:HAL_I2C_ErrorCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5275:13:HAL_I2C_AbortCpltCallback 16 static
|
||||
stm32f1xx_hal_i2c.c:5310:22:HAL_I2C_GetState 16 static
|
||||
stm32f1xx_hal_i2c.c:5322:21:HAL_I2C_GetMode 16 static
|
||||
stm32f1xx_hal_i2c.c:5333:10:HAL_I2C_GetError 16 static
|
||||
stm32f1xx_hal_i2c.c:5356:13:I2C_MasterTransmit_TXE 24 static
|
||||
stm32f1xx_hal_i2c.c:5450:13:I2C_MasterTransmit_BTF 24 static
|
||||
stm32f1xx_hal_i2c.c:5529:13:I2C_MemoryTransmit_TXE_BTF 24 static
|
||||
stm32f1xx_hal_i2c.c:5615:13:I2C_MasterReceive_RXNE 24 static
|
||||
stm32f1xx_hal_i2c.c:5723:13:I2C_MasterReceive_BTF 24 static
|
||||
stm32f1xx_hal_i2c.c:5849:13:I2C_Master_SB 16 static
|
||||
stm32f1xx_hal_i2c.c:5910:13:I2C_Master_ADD10 16 static
|
||||
stm32f1xx_hal_i2c.c:5929:13:I2C_Master_ADDR 72 static
|
||||
stm32f1xx_hal_i2c.c:6077:13:I2C_SlaveTransmit_TXE 24 static
|
||||
stm32f1xx_hal_i2c.c:6118:13:I2C_SlaveTransmit_BTF 16 static
|
||||
stm32f1xx_hal_i2c.c:6139:13:I2C_SlaveReceive_RXNE 24 static
|
||||
stm32f1xx_hal_i2c.c:6180:13:I2C_SlaveReceive_BTF 16 static
|
||||
stm32f1xx_hal_i2c.c:6202:13:I2C_Slave_ADDR 24 static
|
||||
stm32f1xx_hal_i2c.c:6253:13:I2C_Slave_STOPF 24 static
|
||||
stm32f1xx_hal_i2c.c:6422:13:I2C_Slave_AF 24 static
|
||||
stm32f1xx_hal_i2c.c:6488:13:I2C_ITError 24 static
|
||||
stm32f1xx_hal_i2c.c:6654:26:I2C_MasterRequestWrite 40 static
|
||||
stm32f1xx_hal_i2c.c:6724:26:I2C_MasterRequestRead 40 static
|
||||
stm32f1xx_hal_i2c.c:6824:26:I2C_RequestMemoryWrite 40 static
|
||||
stm32f1xx_hal_i2c.c:6904:26:I2C_RequestMemoryRead 40 static
|
||||
stm32f1xx_hal_i2c.c:7013:13:I2C_DMAXferCplt 32 static
|
||||
stm32f1xx_hal_i2c.c:7151:13:I2C_DMAError 24 static
|
||||
stm32f1xx_hal_i2c.c:7186:13:I2C_DMAAbort 32 static
|
||||
stm32f1xx_hal_i2c.c:7289:26:I2C_WaitOnFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7323:26:I2C_WaitOnMasterAddressFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7374:26:I2C_WaitOnTXEFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7412:26:I2C_WaitOnBTFFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7450:26:I2C_WaitOnSTOPFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7483:26:I2C_WaitOnSTOPRequestThroughIT 24 static
|
||||
stm32f1xx_hal_i2c.c:7512:26:I2C_WaitOnRXNEFlagUntilTimeout 24 static
|
||||
stm32f1xx_hal_i2c.c:7557:26:I2C_IsAcknowledgeFailed 16 static
|
||||
stm32f1xx_hal_i2c.c:7582:13:I2C_ConvertOtherXferOptions 16 static
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -23,6 +23,7 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.o: \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
@@ -71,4 +72,6 @@ Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.o: \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -13,6 +13,7 @@ C_SRCS += \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
|
||||
@@ -30,6 +31,7 @@ OBJS += \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o \
|
||||
@@ -47,6 +49,7 @@ C_DEPS += \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.d \
|
||||
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.d \
|
||||
|
||||
@@ -22,6 +22,7 @@ HW_Devices/LCD.o: ../HW_Devices/LCD.c ../HW_Devices/LCD.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../HW_Devices/LCD.h:
|
||||
@@ -74,4 +75,6 @@ HW_Devices/LCD.o: ../HW_Devices/LCD.c ../HW_Devices/LCD.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
HW_Devices/eeprom.o: ../HW_Devices/eeprom.c ../HW_Devices/eeprom.h \
|
||||
../Core/Inc/main.h ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h \
|
||||
../Core/Inc/stm32f1xx_hal_conf.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h \
|
||||
../Drivers/CMSIS/Include/core_cm3.h \
|
||||
../Drivers/CMSIS/Include/cmsis_version.h \
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h \
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../HW_Devices/eeprom.h:
|
||||
|
||||
../Core/Inc/main.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
|
||||
../Core/Inc/stm32f1xx_hal_conf.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h:
|
||||
|
||||
../Drivers/CMSIS/Include/core_cm3.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_version.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
@@ -0,0 +1,6 @@
|
||||
eeprom.c:12:6:IIC_SAND_DATE 40 static
|
||||
eeprom.c:17:6:IIC_READ_DATE 40 static
|
||||
eeprom.c:23:6:EPPROM_SLOWWRITE_INIT 4 static
|
||||
eeprom.c:32:6:EEPROM_SLOWWRITE_SERVER 16 static
|
||||
eeprom.c:58:6:EEPROM_READ_BATY 16 static
|
||||
eeprom.c:63:6:EEPROM_WRITE_BATY 32 static
|
||||
@@ -6,14 +6,17 @@
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../HW_Devices/LCD.c \
|
||||
../HW_Devices/eeprom.c \
|
||||
../HW_Devices/touch.c
|
||||
|
||||
OBJS += \
|
||||
./HW_Devices/LCD.o \
|
||||
./HW_Devices/eeprom.o \
|
||||
./HW_Devices/touch.o
|
||||
|
||||
C_DEPS += \
|
||||
./HW_Devices/LCD.d \
|
||||
./HW_Devices/eeprom.d \
|
||||
./HW_Devices/touch.d
|
||||
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@ HW_Devices/touch.o: ../HW_Devices/touch.c ../HW_Devices/touch.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
../HW_Devices/LCD.h
|
||||
../HW_Devices/LCD.h ../HW_Devices/eeprom.h
|
||||
|
||||
../HW_Devices/touch.h:
|
||||
|
||||
@@ -75,6 +76,10 @@ HW_Devices/touch.o: ../HW_Devices/touch.c ../HW_Devices/touch.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../HW_Devices/LCD.h:
|
||||
|
||||
../HW_Devices/eeprom.h:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
touch.c:18:6:TP_Write_Byte 24 static
|
||||
touch.c:34:10:TP_Read_AD 24 static
|
||||
touch.c:68:10:TP_Read_XOY 48 static
|
||||
touch.c:95:6:TP_Read_XY_ADC 24 static
|
||||
touch.c:109:9:TP_Read_XY2 24 static
|
||||
touch.c:129:6:TP_Server 16 static
|
||||
touch.c:140:6:TP_DrwaTrage 40 static
|
||||
touch.c:150:6:TP_adjustment 160 static
|
||||
touch.c:20:6:TP_Write_Byte 24 static
|
||||
touch.c:36:10:TP_Read_AD 24 static
|
||||
touch.c:70:10:TP_Read_XOY 48 static
|
||||
touch.c:97:6:TP_Read_XY_ADC 24 static
|
||||
touch.c:111:9:TP_Read_XY2 24 static
|
||||
touch.c:131:6:TP_Server 16 static
|
||||
touch.c:142:6:TP_DrwaTrage 40 static
|
||||
touch.c:152:6:TP_adjustment 160 static
|
||||
|
||||
@@ -23,10 +23,12 @@ SW_APPs/Main_APP.o: ../SW_APPs/Main_APP.c ../SW_APPs/Main_APP.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
../SW_APPs/windows.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/touch.h
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/touch.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/eeprom.h
|
||||
|
||||
../SW_APPs/Main_APP.h:
|
||||
|
||||
@@ -80,6 +82,8 @@ SW_APPs/Main_APP.o: ../SW_APPs/Main_APP.c ../SW_APPs/Main_APP.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../SW_APPs/windows.h:
|
||||
@@ -87,3 +91,5 @@ SW_APPs/Main_APP.o: ../SW_APPs/Main_APP.c ../SW_APPs/Main_APP.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/touch.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/eeprom.h:
|
||||
|
||||
@@ -1 +1 @@
|
||||
Main_APP.c:16:6:main_app 32 static
|
||||
Main_APP.c:17:6:main_app 32 static
|
||||
|
||||
@@ -22,6 +22,7 @@ SW_APPs/windows.o: ../SW_APPs/windows.c ../SW_APPs/windows.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h
|
||||
|
||||
@@ -75,6 +76,8 @@ SW_APPs/windows.o: ../SW_APPs/windows.c ../SW_APPs/windows.h \
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h:
|
||||
|
||||
Binary file not shown.
+13529
-10187
File diff suppressed because it is too large
Load Diff
+1355
-925
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o"
|
||||
@@ -21,6 +22,7 @@
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o"
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.o"
|
||||
"./HW_Devices/LCD.o"
|
||||
"./HW_Devices/eeprom.o"
|
||||
"./HW_Devices/touch.o"
|
||||
"./SW_APPs/Main_APP.o"
|
||||
"./SW_APPs/windows.o"
|
||||
|
||||
@@ -0,0 +1,740 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f1xx_hal_i2c.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header file of I2C HAL module.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F1xx_HAL_I2C_H
|
||||
#define __STM32F1xx_HAL_I2C_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f1xx_hal_def.h"
|
||||
|
||||
/** @addtogroup STM32F1xx_HAL_Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup I2C_Exported_Types I2C Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_Configuration_Structure_definition I2C Configuration Structure definition
|
||||
* @brief I2C Configuration Structure definition
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t ClockSpeed; /*!< Specifies the clock frequency.
|
||||
This parameter must be set to a value lower than 400kHz */
|
||||
|
||||
uint32_t DutyCycle; /*!< Specifies the I2C fast mode duty cycle.
|
||||
This parameter can be a value of @ref I2C_duty_cycle_in_fast_mode */
|
||||
|
||||
uint32_t OwnAddress1; /*!< Specifies the first device own address.
|
||||
This parameter can be a 7-bit or 10-bit address. */
|
||||
|
||||
uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode is selected.
|
||||
This parameter can be a value of @ref I2C_addressing_mode */
|
||||
|
||||
uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected.
|
||||
This parameter can be a value of @ref I2C_dual_addressing_mode */
|
||||
|
||||
uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected
|
||||
This parameter can be a 7-bit address. */
|
||||
|
||||
uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected.
|
||||
This parameter can be a value of @ref I2C_general_call_addressing_mode */
|
||||
|
||||
uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected.
|
||||
This parameter can be a value of @ref I2C_nostretch_mode */
|
||||
|
||||
} I2C_InitTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HAL_state_structure_definition HAL state structure definition
|
||||
* @brief HAL State structure definition
|
||||
* @note HAL I2C State value coding follow below described bitmap :
|
||||
* b7-b6 Error information
|
||||
* 00 : No Error
|
||||
* 01 : Abort (Abort user request on going)
|
||||
* 10 : Timeout
|
||||
* 11 : Error
|
||||
* b5 Peripheral initialization status
|
||||
* 0 : Reset (Peripheral not initialized)
|
||||
* 1 : Init done (Peripheral initialized and ready to use. HAL I2C Init function called)
|
||||
* b4 (not used)
|
||||
* x : Should be set to 0
|
||||
* b3
|
||||
* 0 : Ready or Busy (No Listen mode ongoing)
|
||||
* 1 : Listen (Peripheral in Address Listen Mode)
|
||||
* b2 Intrinsic process state
|
||||
* 0 : Ready
|
||||
* 1 : Busy (Peripheral busy with some configuration or internal operations)
|
||||
* b1 Rx state
|
||||
* 0 : Ready (no Rx operation ongoing)
|
||||
* 1 : Busy (Rx operation ongoing)
|
||||
* b0 Tx state
|
||||
* 0 : Ready (no Tx operation ongoing)
|
||||
* 1 : Busy (Tx operation ongoing)
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_I2C_STATE_RESET = 0x00U, /*!< Peripheral is not yet Initialized */
|
||||
HAL_I2C_STATE_READY = 0x20U, /*!< Peripheral Initialized and ready for use */
|
||||
HAL_I2C_STATE_BUSY = 0x24U, /*!< An internal process is ongoing */
|
||||
HAL_I2C_STATE_BUSY_TX = 0x21U, /*!< Data Transmission process is ongoing */
|
||||
HAL_I2C_STATE_BUSY_RX = 0x22U, /*!< Data Reception process is ongoing */
|
||||
HAL_I2C_STATE_LISTEN = 0x28U, /*!< Address Listen Mode is ongoing */
|
||||
HAL_I2C_STATE_BUSY_TX_LISTEN = 0x29U, /*!< Address Listen Mode and Data Transmission
|
||||
process is ongoing */
|
||||
HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU, /*!< Address Listen Mode and Data Reception
|
||||
process is ongoing */
|
||||
HAL_I2C_STATE_ABORT = 0x60U, /*!< Abort user request ongoing */
|
||||
HAL_I2C_STATE_TIMEOUT = 0xA0U, /*!< Timeout state */
|
||||
HAL_I2C_STATE_ERROR = 0xE0U /*!< Error */
|
||||
|
||||
} HAL_I2C_StateTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HAL_mode_structure_definition HAL mode structure definition
|
||||
* @brief HAL Mode structure definition
|
||||
* @note HAL I2C Mode value coding follow below described bitmap :\n
|
||||
* b7 (not used)\n
|
||||
* x : Should be set to 0\n
|
||||
* b6\n
|
||||
* 0 : None\n
|
||||
* 1 : Memory (HAL I2C communication is in Memory Mode)\n
|
||||
* b5\n
|
||||
* 0 : None\n
|
||||
* 1 : Slave (HAL I2C communication is in Slave Mode)\n
|
||||
* b4\n
|
||||
* 0 : None\n
|
||||
* 1 : Master (HAL I2C communication is in Master Mode)\n
|
||||
* b3-b2-b1-b0 (not used)\n
|
||||
* xxxx : Should be set to 0000
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_I2C_MODE_NONE = 0x00U, /*!< No I2C communication on going */
|
||||
HAL_I2C_MODE_MASTER = 0x10U, /*!< I2C communication is in Master Mode */
|
||||
HAL_I2C_MODE_SLAVE = 0x20U, /*!< I2C communication is in Slave Mode */
|
||||
HAL_I2C_MODE_MEM = 0x40U /*!< I2C communication is in Memory Mode */
|
||||
|
||||
} HAL_I2C_ModeTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_Error_Code_definition I2C Error Code definition
|
||||
* @brief I2C Error Code definition
|
||||
* @{
|
||||
*/
|
||||
#define HAL_I2C_ERROR_NONE 0x00000000U /*!< No error */
|
||||
#define HAL_I2C_ERROR_BERR 0x00000001U /*!< BERR error */
|
||||
#define HAL_I2C_ERROR_ARLO 0x00000002U /*!< ARLO error */
|
||||
#define HAL_I2C_ERROR_AF 0x00000004U /*!< AF error */
|
||||
#define HAL_I2C_ERROR_OVR 0x00000008U /*!< OVR error */
|
||||
#define HAL_I2C_ERROR_DMA 0x00000010U /*!< DMA transfer error */
|
||||
#define HAL_I2C_ERROR_TIMEOUT 0x00000020U /*!< Timeout Error */
|
||||
#define HAL_I2C_ERROR_SIZE 0x00000040U /*!< Size Management error */
|
||||
#define HAL_I2C_ERROR_DMA_PARAM 0x00000080U /*!< DMA Parameter Error */
|
||||
#define HAL_I2C_WRONG_START 0x00000200U /*!< Wrong start Error */
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
#define HAL_I2C_ERROR_INVALID_CALLBACK 0x00000100U /*!< Invalid Callback error */
|
||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_handle_Structure_definition I2C handle Structure definition
|
||||
* @brief I2C handle Structure definition
|
||||
* @{
|
||||
*/
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
typedef struct __I2C_HandleTypeDef
|
||||
#else
|
||||
typedef struct
|
||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
||||
{
|
||||
I2C_TypeDef *Instance; /*!< I2C registers base address */
|
||||
|
||||
I2C_InitTypeDef Init; /*!< I2C communication parameters */
|
||||
|
||||
uint8_t *pBuffPtr; /*!< Pointer to I2C transfer buffer */
|
||||
|
||||
uint16_t XferSize; /*!< I2C transfer size */
|
||||
|
||||
__IO uint16_t XferCount; /*!< I2C transfer counter */
|
||||
|
||||
__IO uint32_t XferOptions; /*!< I2C transfer options */
|
||||
|
||||
__IO uint32_t PreviousState; /*!< I2C communication Previous state and mode
|
||||
context for internal usage */
|
||||
|
||||
DMA_HandleTypeDef *hdmatx; /*!< I2C Tx DMA handle parameters */
|
||||
|
||||
DMA_HandleTypeDef *hdmarx; /*!< I2C Rx DMA handle parameters */
|
||||
|
||||
HAL_LockTypeDef Lock; /*!< I2C locking object */
|
||||
|
||||
__IO HAL_I2C_StateTypeDef State; /*!< I2C communication state */
|
||||
|
||||
__IO HAL_I2C_ModeTypeDef Mode; /*!< I2C communication mode */
|
||||
|
||||
__IO uint32_t ErrorCode; /*!< I2C Error code */
|
||||
|
||||
__IO uint32_t Devaddress; /*!< I2C Target device address */
|
||||
|
||||
__IO uint32_t Memaddress; /*!< I2C Target memory address */
|
||||
|
||||
__IO uint32_t MemaddSize; /*!< I2C Target memory address size */
|
||||
|
||||
__IO uint32_t EventCount; /*!< I2C Event counter */
|
||||
|
||||
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
void (* MasterTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Master Tx Transfer completed callback */
|
||||
void (* MasterRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Master Rx Transfer completed callback */
|
||||
void (* SlaveTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Slave Tx Transfer completed callback */
|
||||
void (* SlaveRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Slave Rx Transfer completed callback */
|
||||
void (* ListenCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Listen Complete callback */
|
||||
void (* MemTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Memory Tx Transfer completed callback */
|
||||
void (* MemRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Memory Rx Transfer completed callback */
|
||||
void (* ErrorCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Error callback */
|
||||
void (* AbortCpltCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Abort callback */
|
||||
|
||||
void (* AddrCallback)(struct __I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< I2C Slave Address Match callback */
|
||||
|
||||
void (* MspInitCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Msp Init callback */
|
||||
void (* MspDeInitCallback)(struct __I2C_HandleTypeDef *hi2c); /*!< I2C Msp DeInit callback */
|
||||
|
||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
||||
} I2C_HandleTypeDef;
|
||||
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
/**
|
||||
* @brief HAL I2C Callback ID enumeration definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_I2C_MASTER_TX_COMPLETE_CB_ID = 0x00U, /*!< I2C Master Tx Transfer completed callback ID */
|
||||
HAL_I2C_MASTER_RX_COMPLETE_CB_ID = 0x01U, /*!< I2C Master Rx Transfer completed callback ID */
|
||||
HAL_I2C_SLAVE_TX_COMPLETE_CB_ID = 0x02U, /*!< I2C Slave Tx Transfer completed callback ID */
|
||||
HAL_I2C_SLAVE_RX_COMPLETE_CB_ID = 0x03U, /*!< I2C Slave Rx Transfer completed callback ID */
|
||||
HAL_I2C_LISTEN_COMPLETE_CB_ID = 0x04U, /*!< I2C Listen Complete callback ID */
|
||||
HAL_I2C_MEM_TX_COMPLETE_CB_ID = 0x05U, /*!< I2C Memory Tx Transfer callback ID */
|
||||
HAL_I2C_MEM_RX_COMPLETE_CB_ID = 0x06U, /*!< I2C Memory Rx Transfer completed callback ID */
|
||||
HAL_I2C_ERROR_CB_ID = 0x07U, /*!< I2C Error callback ID */
|
||||
HAL_I2C_ABORT_CB_ID = 0x08U, /*!< I2C Abort callback ID */
|
||||
|
||||
HAL_I2C_MSPINIT_CB_ID = 0x09U, /*!< I2C Msp Init callback ID */
|
||||
HAL_I2C_MSPDEINIT_CB_ID = 0x0AU /*!< I2C Msp DeInit callback ID */
|
||||
|
||||
} HAL_I2C_CallbackIDTypeDef;
|
||||
|
||||
/**
|
||||
* @brief HAL I2C Callback pointer definition
|
||||
*/
|
||||
typedef void (*pI2C_CallbackTypeDef)(I2C_HandleTypeDef *hi2c); /*!< pointer to an I2C callback function */
|
||||
typedef void (*pI2C_AddrCallbackTypeDef)(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< pointer to an I2C Address Match callback function */
|
||||
|
||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup I2C_Exported_Constants I2C Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_duty_cycle_in_fast_mode I2C duty cycle in fast mode
|
||||
* @{
|
||||
*/
|
||||
#define I2C_DUTYCYCLE_2 0x00000000U
|
||||
#define I2C_DUTYCYCLE_16_9 I2C_CCR_DUTY
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_addressing_mode I2C addressing mode
|
||||
* @{
|
||||
*/
|
||||
#define I2C_ADDRESSINGMODE_7BIT 0x00004000U
|
||||
#define I2C_ADDRESSINGMODE_10BIT (I2C_OAR1_ADDMODE | 0x00004000U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_dual_addressing_mode I2C dual addressing mode
|
||||
* @{
|
||||
*/
|
||||
#define I2C_DUALADDRESS_DISABLE 0x00000000U
|
||||
#define I2C_DUALADDRESS_ENABLE I2C_OAR2_ENDUAL
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_general_call_addressing_mode I2C general call addressing mode
|
||||
* @{
|
||||
*/
|
||||
#define I2C_GENERALCALL_DISABLE 0x00000000U
|
||||
#define I2C_GENERALCALL_ENABLE I2C_CR1_ENGC
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_nostretch_mode I2C nostretch mode
|
||||
* @{
|
||||
*/
|
||||
#define I2C_NOSTRETCH_DISABLE 0x00000000U
|
||||
#define I2C_NOSTRETCH_ENABLE I2C_CR1_NOSTRETCH
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_Memory_Address_Size I2C Memory Address Size
|
||||
* @{
|
||||
*/
|
||||
#define I2C_MEMADD_SIZE_8BIT 0x00000001U
|
||||
#define I2C_MEMADD_SIZE_16BIT 0x00000010U
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_XferDirection_definition I2C XferDirection definition
|
||||
* @{
|
||||
*/
|
||||
#define I2C_DIRECTION_RECEIVE 0x00000000U
|
||||
#define I2C_DIRECTION_TRANSMIT 0x00000001U
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_XferOptions_definition I2C XferOptions definition
|
||||
* @{
|
||||
*/
|
||||
#define I2C_FIRST_FRAME 0x00000001U
|
||||
#define I2C_FIRST_AND_NEXT_FRAME 0x00000002U
|
||||
#define I2C_NEXT_FRAME 0x00000004U
|
||||
#define I2C_FIRST_AND_LAST_FRAME 0x00000008U
|
||||
#define I2C_LAST_FRAME_NO_STOP 0x00000010U
|
||||
#define I2C_LAST_FRAME 0x00000020U
|
||||
|
||||
/* List of XferOptions in usage of :
|
||||
* 1- Restart condition in all use cases (direction change or not)
|
||||
*/
|
||||
#define I2C_OTHER_FRAME (0x00AA0000U)
|
||||
#define I2C_OTHER_AND_LAST_FRAME (0xAA000000U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition
|
||||
* @brief I2C Interrupt definition
|
||||
* Elements values convention: 0xXXXXXXXX
|
||||
* - XXXXXXXX : Interrupt control mask
|
||||
* @{
|
||||
*/
|
||||
#define I2C_IT_BUF I2C_CR2_ITBUFEN
|
||||
#define I2C_IT_EVT I2C_CR2_ITEVTEN
|
||||
#define I2C_IT_ERR I2C_CR2_ITERREN
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup I2C_Flag_definition I2C Flag definition
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define I2C_FLAG_OVR 0x00010800U
|
||||
#define I2C_FLAG_AF 0x00010400U
|
||||
#define I2C_FLAG_ARLO 0x00010200U
|
||||
#define I2C_FLAG_BERR 0x00010100U
|
||||
#define I2C_FLAG_TXE 0x00010080U
|
||||
#define I2C_FLAG_RXNE 0x00010040U
|
||||
#define I2C_FLAG_STOPF 0x00010010U
|
||||
#define I2C_FLAG_ADD10 0x00010008U
|
||||
#define I2C_FLAG_BTF 0x00010004U
|
||||
#define I2C_FLAG_ADDR 0x00010002U
|
||||
#define I2C_FLAG_SB 0x00010001U
|
||||
#define I2C_FLAG_DUALF 0x00100080U
|
||||
#define I2C_FLAG_GENCALL 0x00100010U
|
||||
#define I2C_FLAG_TRA 0x00100004U
|
||||
#define I2C_FLAG_BUSY 0x00100002U
|
||||
#define I2C_FLAG_MSL 0x00100001U
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macros -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup I2C_Exported_Macros I2C Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief Reset I2C handle state.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) do{ \
|
||||
(__HANDLE__)->State = HAL_I2C_STATE_RESET; \
|
||||
(__HANDLE__)->MspInitCallback = NULL; \
|
||||
(__HANDLE__)->MspDeInitCallback = NULL; \
|
||||
} while(0)
|
||||
#else
|
||||
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2C_STATE_RESET)
|
||||
#endif
|
||||
|
||||
/** @brief Enable or disable the specified I2C interrupts.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @param __INTERRUPT__ specifies the interrupt source to enable or disable.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg I2C_IT_BUF: Buffer interrupt enable
|
||||
* @arg I2C_IT_EVT: Event interrupt enable
|
||||
* @arg I2C_IT_ERR: Error interrupt enable
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR2,(__INTERRUPT__))
|
||||
#define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
|
||||
|
||||
/** @brief Checks if the specified I2C interrupt source is enabled or disabled.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @param __INTERRUPT__ specifies the I2C interrupt source to check.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg I2C_IT_BUF: Buffer interrupt enable
|
||||
* @arg I2C_IT_EVT: Event interrupt enable
|
||||
* @arg I2C_IT_ERR: Error interrupt enable
|
||||
* @retval The new state of __INTERRUPT__ (TRUE or FALSE).
|
||||
*/
|
||||
#define __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
|
||||
|
||||
/** @brief Checks whether the specified I2C flag is set or not.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @param __FLAG__ specifies the flag to check.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg I2C_FLAG_OVR: Overrun/Underrun flag
|
||||
* @arg I2C_FLAG_AF: Acknowledge failure flag
|
||||
* @arg I2C_FLAG_ARLO: Arbitration lost flag
|
||||
* @arg I2C_FLAG_BERR: Bus error flag
|
||||
* @arg I2C_FLAG_TXE: Data register empty flag
|
||||
* @arg I2C_FLAG_RXNE: Data register not empty flag
|
||||
* @arg I2C_FLAG_STOPF: Stop detection flag
|
||||
* @arg I2C_FLAG_ADD10: 10-bit header sent flag
|
||||
* @arg I2C_FLAG_BTF: Byte transfer finished flag
|
||||
* @arg I2C_FLAG_ADDR: Address sent flag
|
||||
* Address matched flag
|
||||
* @arg I2C_FLAG_SB: Start bit flag
|
||||
* @arg I2C_FLAG_DUALF: Dual flag
|
||||
* @arg I2C_FLAG_GENCALL: General call header flag
|
||||
* @arg I2C_FLAG_TRA: Transmitter/Receiver flag
|
||||
* @arg I2C_FLAG_BUSY: Bus busy flag
|
||||
* @arg I2C_FLAG_MSL: Master/Slave flag
|
||||
* @retval The new state of __FLAG__ (TRUE or FALSE).
|
||||
*/
|
||||
#define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) ((((uint8_t)((__FLAG__) >> 16U)) == 0x01U) ? \
|
||||
(((((__HANDLE__)->Instance->SR1) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET) : \
|
||||
(((((__HANDLE__)->Instance->SR2) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET))
|
||||
|
||||
/** @brief Clears the I2C pending flags which are cleared by writing 0 in a specific bit.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @param __FLAG__ specifies the flag to clear.
|
||||
* This parameter can be any combination of the following values:
|
||||
* @arg I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode)
|
||||
* @arg I2C_FLAG_AF: Acknowledge failure flag
|
||||
* @arg I2C_FLAG_ARLO: Arbitration lost flag (Master mode)
|
||||
* @arg I2C_FLAG_BERR: Bus error flag
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR1 = ~((__FLAG__) & I2C_FLAG_MASK))
|
||||
|
||||
/** @brief Clears the I2C ADDR pending flag.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_CLEAR_ADDRFLAG(__HANDLE__) \
|
||||
do{ \
|
||||
__IO uint32_t tmpreg = 0x00U; \
|
||||
tmpreg = (__HANDLE__)->Instance->SR1; \
|
||||
tmpreg = (__HANDLE__)->Instance->SR2; \
|
||||
UNUSED(tmpreg); \
|
||||
} while(0)
|
||||
|
||||
/** @brief Clears the I2C STOPF pending flag.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_CLEAR_STOPFLAG(__HANDLE__) \
|
||||
do{ \
|
||||
__IO uint32_t tmpreg = 0x00U; \
|
||||
tmpreg = (__HANDLE__)->Instance->SR1; \
|
||||
SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE); \
|
||||
UNUSED(tmpreg); \
|
||||
} while(0)
|
||||
|
||||
/** @brief Enable the specified I2C peripheral.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)
|
||||
|
||||
/** @brief Disable the specified I2C peripheral.
|
||||
* @param __HANDLE__ specifies the I2C Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_I2C_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @addtogroup I2C_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions
|
||||
* @{
|
||||
*/
|
||||
/* Initialization and de-initialization functions******************************/
|
||||
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c);
|
||||
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c);
|
||||
|
||||
/* Callbacks Register/UnRegister functions ***********************************/
|
||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
||||
HAL_StatusTypeDef HAL_I2C_RegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID, pI2C_CallbackTypeDef pCallback);
|
||||
HAL_StatusTypeDef HAL_I2C_UnRegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID);
|
||||
|
||||
HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback(I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback);
|
||||
HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback(I2C_HandleTypeDef *hi2c);
|
||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C_Exported_Functions_Group2 Input and Output operation functions
|
||||
* @{
|
||||
*/
|
||||
/* IO operation functions ****************************************************/
|
||||
/******* Blocking mode: Polling */
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout);
|
||||
|
||||
/******* Non-Blocking mode: Interrupt */
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
||||
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c);
|
||||
HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);
|
||||
|
||||
/******* Non-Blocking mode: DMA */
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
||||
HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
||||
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
|
||||
* @{
|
||||
*/
|
||||
/******* I2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
|
||||
void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);
|
||||
void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C_Exported_Functions_Group3 Peripheral State, Mode and Error functions
|
||||
* @{
|
||||
*/
|
||||
/* Peripheral State, Mode and Error functions *********************************/
|
||||
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c);
|
||||
HAL_I2C_ModeTypeDef HAL_I2C_GetMode(I2C_HandleTypeDef *hi2c);
|
||||
uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup I2C_Private_Constants I2C Private Constants
|
||||
* @{
|
||||
*/
|
||||
#define I2C_FLAG_MASK 0x0000FFFFU
|
||||
#define I2C_MIN_PCLK_FREQ_STANDARD 2000000U /*!< 2 MHz */
|
||||
#define I2C_MIN_PCLK_FREQ_FAST 4000000U /*!< 4 MHz */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/** @defgroup I2C_Private_Macros I2C Private Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
|
||||
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__) (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
|
||||
#define I2C_FREQRANGE(__PCLK__) ((__PCLK__)/1000000U)
|
||||
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
|
||||
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__) ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
|
||||
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
|
||||
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
|
||||
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
|
||||
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))
|
||||
|
||||
#define I2C_7BIT_ADD_WRITE(__ADDRESS__) ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))
|
||||
#define I2C_7BIT_ADD_READ(__ADDRESS__) ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
|
||||
|
||||
#define I2C_10BIT_ADDRESS(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
|
||||
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))
|
||||
#define I2C_10BIT_HEADER_READ(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))
|
||||
|
||||
#define I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))
|
||||
#define I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
|
||||
|
||||
/** @defgroup I2C_IS_RTC_Definitions I2C Private macros to check input parameters
|
||||
* @{
|
||||
*/
|
||||
#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DUTYCYCLE_2) || \
|
||||
((CYCLE) == I2C_DUTYCYCLE_16_9))
|
||||
#define IS_I2C_ADDRESSING_MODE(ADDRESS) (((ADDRESS) == I2C_ADDRESSINGMODE_7BIT) || \
|
||||
((ADDRESS) == I2C_ADDRESSINGMODE_10BIT))
|
||||
#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \
|
||||
((ADDRESS) == I2C_DUALADDRESS_ENABLE))
|
||||
#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLE) || \
|
||||
((CALL) == I2C_GENERALCALL_ENABLE))
|
||||
#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLE) || \
|
||||
((STRETCH) == I2C_NOSTRETCH_ENABLE))
|
||||
#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \
|
||||
((SIZE) == I2C_MEMADD_SIZE_16BIT))
|
||||
#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) > 0U) && ((SPEED) <= 400000U))
|
||||
#define IS_I2C_OWN_ADDRESS1(ADDRESS1) (((ADDRESS1) & 0xFFFFFC00U) == 0U)
|
||||
#define IS_I2C_OWN_ADDRESS2(ADDRESS2) (((ADDRESS2) & 0xFFFFFF01U) == 0U)
|
||||
#define IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_FIRST_FRAME) || \
|
||||
((REQUEST) == I2C_FIRST_AND_NEXT_FRAME) || \
|
||||
((REQUEST) == I2C_NEXT_FRAME) || \
|
||||
((REQUEST) == I2C_FIRST_AND_LAST_FRAME) || \
|
||||
((REQUEST) == I2C_LAST_FRAME) || \
|
||||
((REQUEST) == I2C_LAST_FRAME_NO_STOP) || \
|
||||
IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST))
|
||||
|
||||
#define IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_OTHER_FRAME) || \
|
||||
((REQUEST) == I2C_OTHER_AND_LAST_FRAME))
|
||||
|
||||
#define I2C_CHECK_FLAG(__ISR__, __FLAG__) ((((__ISR__) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET)
|
||||
#define I2C_CHECK_IT_SOURCE(__CR1__, __IT__) ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
/** @defgroup I2C_Private_Functions I2C Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __STM32F1xx_HAL_I2C_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* eeprom.c
|
||||
*
|
||||
* Created on: Aug 8, 2021
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#include "eeprom.h"
|
||||
|
||||
extern I2C_HandleTypeDef hi2c2;
|
||||
|
||||
void IIC_SAND_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Write(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
|
||||
void IIC_READ_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Read(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
|
||||
eeprom_write_buff_info eeprom_write_buffer;
|
||||
void EPPROM_SLOWWRITE_INIT()
|
||||
{
|
||||
eeprom_write_buffer.buff=NULL;
|
||||
eeprom_write_buffer.end=NULL;
|
||||
eeprom_write_buffer.head=NULL;
|
||||
eeprom_write_buffer.save_timeout=5;
|
||||
eeprom_write_buffer.save_busy=0;
|
||||
}
|
||||
|
||||
void EEPROM_SLOWWRITE_SERVER()
|
||||
{
|
||||
eeprom_write_buff *buff;
|
||||
char data;
|
||||
if(eeprom_write_buffer.save_busy)
|
||||
{
|
||||
if(HAL_GetTick()>eeprom_write_buffer.save_time)
|
||||
{
|
||||
eeprom_write_buffer.save_busy=0;
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(eeprom_write_buffer.head!=NULL)
|
||||
{
|
||||
eeprom_write_buffer.save_busy=1;
|
||||
eeprom_write_buffer.save_time=HAL_GetTick()+eeprom_write_buffer.save_timeout;
|
||||
buff=eeprom_write_buffer.head->next;
|
||||
data=eeprom_write_buffer.head->date;
|
||||
IIC_SAND_DATE(EEPROM_ADDRESS,eeprom_write_buffer.head->add,&data,1);
|
||||
free(eeprom_write_buffer.head);
|
||||
eeprom_write_buffer.head=buff;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void EEPROM_READ_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
IIC_READ_DATE(EEPROM_ADDRESS,IN_DEVICE_ADD,DATAS,LONG);
|
||||
}
|
||||
|
||||
void EEPROM_WRITE_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
//IIC_SAND_DATE(EEPROM_ADDRESS,IN_DEVICE_ADD,DATAS,LONG);
|
||||
uint16_t addoffset=0;
|
||||
|
||||
|
||||
eeprom_write_buff *buff;
|
||||
eeprom_write_buff *buff2;
|
||||
while(LONG--)
|
||||
{
|
||||
buff =(eeprom_write_buff*)malloc(sizeof(eeprom_write_buff));
|
||||
if(buff!=NULL)
|
||||
{
|
||||
buff->add=IN_DEVICE_ADD+addoffset;
|
||||
buff->date=DATAS[addoffset];
|
||||
buff->next=NULL;
|
||||
}else{return ;}
|
||||
if(eeprom_write_buffer.head==NULL)
|
||||
{
|
||||
eeprom_write_buffer.head=buff;
|
||||
eeprom_write_buffer.end=buff;
|
||||
}else
|
||||
{
|
||||
buff2=eeprom_write_buffer.end;
|
||||
buff2->next=buff;
|
||||
eeprom_write_buffer.end=buff;
|
||||
}
|
||||
addoffset++;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* eeprom.h
|
||||
*
|
||||
* Created on: Aug 8, 2021
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#ifndef EEPROM_H_
|
||||
#define EEPROM_H_
|
||||
#include "main.h"
|
||||
|
||||
#define EEPROM_ADDRESS 0xa0
|
||||
|
||||
typedef struct eeprom_write_buff
|
||||
{
|
||||
struct eeprom_write_buff *next;
|
||||
uint16_t add;
|
||||
char date;
|
||||
}eeprom_write_buff;
|
||||
|
||||
typedef struct eeprom_write_buff_info
|
||||
{
|
||||
eeprom_write_buff *buff;
|
||||
eeprom_write_buff *head;
|
||||
eeprom_write_buff *end;
|
||||
uint32_t save_time;
|
||||
uint8_t save_timeout;
|
||||
uint8_t save_busy:1;
|
||||
|
||||
}eeprom_write_buff_info;
|
||||
|
||||
void EPPROM_SLOWWRITE_INIT();
|
||||
void EEPROM_SLOWWRITE_SERVER();
|
||||
|
||||
void EEPROM_READ_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
|
||||
void EEPROM_WRITE_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
|
||||
|
||||
#endif /* EEPROM_H_ */
|
||||
+14
-1
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "touch.h"
|
||||
#include "LCD.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
//默认为touchtype=0的数据.
|
||||
#define CMD_RDX 0X90
|
||||
#define CMD_RDY 0XD0
|
||||
@@ -149,6 +151,13 @@ void TP_DrwaTrage(int x,int y,int r)
|
||||
|
||||
void TP_adjustment()
|
||||
{
|
||||
//判断是否需要校准,从eeprom获取数据
|
||||
EEPROM_READ_BATY(16,(char *)&tconfig,sizeof(touch_config));
|
||||
if(tconfig.begin==0xab&&tconfig.end==0xcd)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
char str[64];
|
||||
uint16_t y_adc,x_adc,step=0,r=10;
|
||||
uint16_t y1,y2,y3,y4,x1,x2,x3,x4;
|
||||
@@ -286,13 +295,17 @@ void TP_adjustment()
|
||||
tconfig.y_acc=acc_y;
|
||||
tconfig.y_offset=offset_y;
|
||||
|
||||
tconfig.begin=0xab;
|
||||
tconfig.end=0xcd;
|
||||
|
||||
|
||||
sprintf(str,"x_acc=%f y_acc=%f",acc_x,acc_y);
|
||||
LCD_ShowString(0,66+16+16+16+16,str,16,RED,RED);
|
||||
sprintf(str,"x_offset=%d y_offset=%d",offset_x,offset_y);
|
||||
LCD_ShowString(0,66+16+16+16+16+16,str,16,RED,RED);
|
||||
|
||||
}
|
||||
|
||||
EEPROM_WRITE_BATY(16,(char *)&tconfig,sizeof(touch_config));
|
||||
HAL_Delay(1000);
|
||||
return;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "LCD.h"
|
||||
#include "windows.h"
|
||||
#include "touch.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
extern touch_device t0;
|
||||
|
||||
@@ -16,8 +17,11 @@ task run_loop;//
|
||||
void main_app()
|
||||
{
|
||||
LCDx_Init();
|
||||
EPPROM_SLOWWRITE_INIT();
|
||||
|
||||
TP_adjustment();
|
||||
|
||||
|
||||
UI *ui=UI_Init(BLACK);
|
||||
|
||||
New_Window(ui,10,10,100,100,WHITE,"WHITE");
|
||||
@@ -44,6 +48,7 @@ void main_app()
|
||||
|
||||
}
|
||||
TP_Server();
|
||||
EEPROM_SLOWWRITE_SERVER();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@ File.Version=6
|
||||
KeepUserPlacement=false
|
||||
Mcu.Family=STM32F1
|
||||
Mcu.IP0=FSMC
|
||||
Mcu.IP1=NVIC
|
||||
Mcu.IP2=RCC
|
||||
Mcu.IP3=SYS
|
||||
Mcu.IPNb=4
|
||||
Mcu.IP1=I2C2
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=SYS
|
||||
Mcu.IPNb=5
|
||||
Mcu.Name=STM32F103Z(C-D-E)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PF8
|
||||
@@ -23,27 +24,29 @@ Mcu.Pin14=PE12
|
||||
Mcu.Pin15=PE13
|
||||
Mcu.Pin16=PE14
|
||||
Mcu.Pin17=PE15
|
||||
Mcu.Pin18=PD8
|
||||
Mcu.Pin19=PD9
|
||||
Mcu.Pin18=PB10
|
||||
Mcu.Pin19=PB11
|
||||
Mcu.Pin2=PF10
|
||||
Mcu.Pin20=PD10
|
||||
Mcu.Pin21=PD14
|
||||
Mcu.Pin22=PD15
|
||||
Mcu.Pin23=PD0
|
||||
Mcu.Pin24=PD1
|
||||
Mcu.Pin25=PD4
|
||||
Mcu.Pin26=PD5
|
||||
Mcu.Pin27=PG12
|
||||
Mcu.Pin28=VP_SYS_VS_ND
|
||||
Mcu.Pin29=VP_SYS_VS_Systick
|
||||
Mcu.Pin20=PD8
|
||||
Mcu.Pin21=PD9
|
||||
Mcu.Pin22=PD10
|
||||
Mcu.Pin23=PD14
|
||||
Mcu.Pin24=PD15
|
||||
Mcu.Pin25=PD0
|
||||
Mcu.Pin26=PD1
|
||||
Mcu.Pin27=PD4
|
||||
Mcu.Pin28=PD5
|
||||
Mcu.Pin29=PG12
|
||||
Mcu.Pin3=OSC_IN
|
||||
Mcu.Pin30=VP_SYS_VS_ND
|
||||
Mcu.Pin31=VP_SYS_VS_Systick
|
||||
Mcu.Pin4=OSC_OUT
|
||||
Mcu.Pin5=PB0
|
||||
Mcu.Pin6=PB1
|
||||
Mcu.Pin7=PB2
|
||||
Mcu.Pin8=PG0
|
||||
Mcu.Pin9=PE7
|
||||
Mcu.PinsNb=30
|
||||
Mcu.PinsNb=32
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103ZETx
|
||||
@@ -74,6 +77,10 @@ PB1.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PB1.Locked=true
|
||||
PB1.PinState=GPIO_PIN_SET
|
||||
PB1.Signal=GPIO_Output
|
||||
PB10.Mode=I2C
|
||||
PB10.Signal=I2C2_SCL
|
||||
PB11.Mode=I2C
|
||||
PB11.Signal=I2C2_SDA
|
||||
PB2.GPIOParameters=GPIO_Speed,PinState,GPIO_Label
|
||||
PB2.GPIO_Label=TCS
|
||||
PB2.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
|
||||
Reference in New Issue
Block a user