f303_h_p1 1

Dependencies:   mbed

Committer:
caa45040
Date:
Sun Nov 21 21:53:56 2021 +0000
Revision:
8:1099c3102bf7
LCD_HELLO_010_1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
caa45040 8:1099c3102bf7 1 /* USER CODE BEGIN Header */
caa45040 8:1099c3102bf7 2 /**
caa45040 8:1099c3102bf7 3 ******************************************************************************
caa45040 8:1099c3102bf7 4 * @file : main.c
caa45040 8:1099c3102bf7 5 * @brief : Main program body
caa45040 8:1099c3102bf7 6 ******************************************************************************
caa45040 8:1099c3102bf7 7 * @attention
caa45040 8:1099c3102bf7 8 *
caa45040 8:1099c3102bf7 9 * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
caa45040 8:1099c3102bf7 10 * All rights reserved.</center></h2>
caa45040 8:1099c3102bf7 11 *
caa45040 8:1099c3102bf7 12 * This software component is licensed by ST under BSD 3-Clause license,
caa45040 8:1099c3102bf7 13 * the "License"; You may not use this file except in compliance with the
caa45040 8:1099c3102bf7 14 * License. You may obtain a copy of the License at:
caa45040 8:1099c3102bf7 15 * opensource.org/licenses/BSD-3-Clause
caa45040 8:1099c3102bf7 16 *
caa45040 8:1099c3102bf7 17 ******************************************************************************
caa45040 8:1099c3102bf7 18 */
caa45040 8:1099c3102bf7 19 /* USER CODE END Header */
caa45040 8:1099c3102bf7 20 /* Includes ------------------------------------------------------------------*/
caa45040 8:1099c3102bf7 21 #include "main.h"
caa45040 8:1099c3102bf7 22
caa45040 8:1099c3102bf7 23 /* Private includes ----------------------------------------------------------*/
caa45040 8:1099c3102bf7 24 /* USER CODE BEGIN Includes */
caa45040 8:1099c3102bf7 25
caa45040 8:1099c3102bf7 26 /* USER CODE END Includes */
caa45040 8:1099c3102bf7 27
caa45040 8:1099c3102bf7 28 /* Private typedef -----------------------------------------------------------*/
caa45040 8:1099c3102bf7 29 /* USER CODE BEGIN PTD */
caa45040 8:1099c3102bf7 30
caa45040 8:1099c3102bf7 31 /* USER CODE END PTD */
caa45040 8:1099c3102bf7 32
caa45040 8:1099c3102bf7 33 /* Private define ------------------------------------------------------------*/
caa45040 8:1099c3102bf7 34 /* USER CODE BEGIN PD */
caa45040 8:1099c3102bf7 35 /* USER CODE END PD */
caa45040 8:1099c3102bf7 36
caa45040 8:1099c3102bf7 37 /* Private macro -------------------------------------------------------------*/
caa45040 8:1099c3102bf7 38 /* USER CODE BEGIN PM */
caa45040 8:1099c3102bf7 39
caa45040 8:1099c3102bf7 40 /* USER CODE END PM */
caa45040 8:1099c3102bf7 41
caa45040 8:1099c3102bf7 42 /* Private variables ---------------------------------------------------------*/
caa45040 8:1099c3102bf7 43 I2C_HandleTypeDef hi2c1;
caa45040 8:1099c3102bf7 44
caa45040 8:1099c3102bf7 45 UART_HandleTypeDef huart2;
caa45040 8:1099c3102bf7 46
caa45040 8:1099c3102bf7 47 /* USER CODE BEGIN PV */
caa45040 8:1099c3102bf7 48
caa45040 8:1099c3102bf7 49 /* USER CODE END PV */
caa45040 8:1099c3102bf7 50
caa45040 8:1099c3102bf7 51 /* Private function prototypes -----------------------------------------------*/
caa45040 8:1099c3102bf7 52 void SystemClock_Config(void);
caa45040 8:1099c3102bf7 53 static void MX_GPIO_Init(void);
caa45040 8:1099c3102bf7 54 static void MX_I2C1_Init(void);
caa45040 8:1099c3102bf7 55 static void MX_USART2_UART_Init(void);
caa45040 8:1099c3102bf7 56 /* USER CODE BEGIN PFP */
caa45040 8:1099c3102bf7 57
caa45040 8:1099c3102bf7 58 /* USER CODE END PFP */
caa45040 8:1099c3102bf7 59
caa45040 8:1099c3102bf7 60 /* Private user code ---------------------------------------------------------*/
caa45040 8:1099c3102bf7 61 /* USER CODE BEGIN 0 */
caa45040 8:1099c3102bf7 62
caa45040 8:1099c3102bf7 63 /* USER CODE END 0 */
caa45040 8:1099c3102bf7 64
caa45040 8:1099c3102bf7 65 /**
caa45040 8:1099c3102bf7 66 * @brief The application entry point.
caa45040 8:1099c3102bf7 67 * @retval int
caa45040 8:1099c3102bf7 68 */
caa45040 8:1099c3102bf7 69 int main(void)
caa45040 8:1099c3102bf7 70 {
caa45040 8:1099c3102bf7 71 /* USER CODE BEGIN 1 */
caa45040 8:1099c3102bf7 72
caa45040 8:1099c3102bf7 73 /* USER CODE END 1 */
caa45040 8:1099c3102bf7 74
caa45040 8:1099c3102bf7 75 /* MCU Configuration--------------------------------------------------------*/
caa45040 8:1099c3102bf7 76
caa45040 8:1099c3102bf7 77 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
caa45040 8:1099c3102bf7 78 HAL_Init();
caa45040 8:1099c3102bf7 79
caa45040 8:1099c3102bf7 80 /* USER CODE BEGIN Init */
caa45040 8:1099c3102bf7 81
caa45040 8:1099c3102bf7 82 /* USER CODE END Init */
caa45040 8:1099c3102bf7 83
caa45040 8:1099c3102bf7 84 /* Configure the system clock */
caa45040 8:1099c3102bf7 85 SystemClock_Config();
caa45040 8:1099c3102bf7 86
caa45040 8:1099c3102bf7 87 /* USER CODE BEGIN SysInit */
caa45040 8:1099c3102bf7 88
caa45040 8:1099c3102bf7 89 /* USER CODE END SysInit */
caa45040 8:1099c3102bf7 90
caa45040 8:1099c3102bf7 91 /* Initialize all configured peripherals */
caa45040 8:1099c3102bf7 92 MX_GPIO_Init();
caa45040 8:1099c3102bf7 93 MX_I2C1_Init();
caa45040 8:1099c3102bf7 94 MX_USART2_UART_Init();
caa45040 8:1099c3102bf7 95 /* USER CODE BEGIN 2 */
caa45040 8:1099c3102bf7 96
caa45040 8:1099c3102bf7 97 #define ADDR_LCD (0x7C) // address
caa45040 8:1099c3102bf7 98
caa45040 8:1099c3102bf7 99 uint8_t INIT_com[]={
caa45040 8:1099c3102bf7 100 0x0,0x38,
caa45040 8:1099c3102bf7 101 0x0,0x39,
caa45040 8:1099c3102bf7 102 0x0,0x4,
caa45040 8:1099c3102bf7 103 0x0,0x14,
caa45040 8:1099c3102bf7 104 0x0,0x70,
caa45040 8:1099c3102bf7 105 0x0,0x56,
caa45040 8:1099c3102bf7 106 0x0,0x6C,
caa45040 8:1099c3102bf7 107 0x0,0x38,
caa45040 8:1099c3102bf7 108 0x0,0xC,
caa45040 8:1099c3102bf7 109 0x0,0x1,
caa45040 8:1099c3102bf7 110 0x40,0x41};
caa45040 8:1099c3102bf7 111
caa45040 8:1099c3102bf7 112 uint8_t INIT_cls[]={0x0,0x1};
caa45040 8:1099c3102bf7 113
caa45040 8:1099c3102bf7 114
caa45040 8:1099c3102bf7 115
caa45040 8:1099c3102bf7 116 //液晶の初期化
caa45040 8:1099c3102bf7 117 HAL_Delay(200);
caa45040 8:1099c3102bf7 118 for(int ii=0;ii<11;ii++){
caa45040 8:1099c3102bf7 119 HAL_I2C_Master_Transmit(&hi2c1, ADDR_LCD, &INIT_com[ii*2], 2, 3000);
caa45040 8:1099c3102bf7 120 HAL_Delay(3);
caa45040 8:1099c3102bf7 121 } //for
caa45040 8:1099c3102bf7 122
caa45040 8:1099c3102bf7 123
caa45040 8:1099c3102bf7 124
caa45040 8:1099c3102bf7 125
caa45040 8:1099c3102bf7 126 /* USER CODE END 2 */
caa45040 8:1099c3102bf7 127
caa45040 8:1099c3102bf7 128 /* Infinite loop */
caa45040 8:1099c3102bf7 129 /* USER CODE BEGIN WHILE */
caa45040 8:1099c3102bf7 130 while (1)
caa45040 8:1099c3102bf7 131 {
caa45040 8:1099c3102bf7 132 /* USER CODE END WHILE */
caa45040 8:1099c3102bf7 133
caa45040 8:1099c3102bf7 134
caa45040 8:1099c3102bf7 135
caa45040 8:1099c3102bf7 136 //液晶のクリア
caa45040 8:1099c3102bf7 137 HAL_I2C_Master_Transmit(&hi2c1, ADDR_LCD, INIT_cls, 2, 3000);
caa45040 8:1099c3102bf7 138 HAL_Delay(3);
caa45040 8:1099c3102bf7 139
caa45040 8:1099c3102bf7 140 //液晶に出力 xなぜか連続送信するとバグる為に個別送信
caa45040 8:1099c3102bf7 141 uint8_t a[]="HELLO",b[]="@A";
caa45040 8:1099c3102bf7 142 for(int ii=0;ii< sizeof(a) ;ii++){
caa45040 8:1099c3102bf7 143 b[1]=a[ii];
caa45040 8:1099c3102bf7 144 HAL_I2C_Master_Transmit(&hi2c1, ADDR_LCD, b , 2 , 3000);
caa45040 8:1099c3102bf7 145 HAL_Delay(1);
caa45040 8:1099c3102bf7 146 }//for
caa45040 8:1099c3102bf7 147
caa45040 8:1099c3102bf7 148 //1秒待つ
caa45040 8:1099c3102bf7 149 HAL_Delay(1000);
caa45040 8:1099c3102bf7 150
caa45040 8:1099c3102bf7 151
caa45040 8:1099c3102bf7 152
caa45040 8:1099c3102bf7 153 /* USER CODE BEGIN 3 */
caa45040 8:1099c3102bf7 154 }
caa45040 8:1099c3102bf7 155 /* USER CODE END 3 */
caa45040 8:1099c3102bf7 156 }
caa45040 8:1099c3102bf7 157
caa45040 8:1099c3102bf7 158 /**
caa45040 8:1099c3102bf7 159 * @brief System Clock Configuration
caa45040 8:1099c3102bf7 160 * @retval None
caa45040 8:1099c3102bf7 161 */
caa45040 8:1099c3102bf7 162 void SystemClock_Config(void)
caa45040 8:1099c3102bf7 163 {
caa45040 8:1099c3102bf7 164 RCC_OscInitTypeDef RCC_OscInitStruct = {0};
caa45040 8:1099c3102bf7 165 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
caa45040 8:1099c3102bf7 166 RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
caa45040 8:1099c3102bf7 167
caa45040 8:1099c3102bf7 168 /** Configure the main internal regulator output voltage
caa45040 8:1099c3102bf7 169 */
caa45040 8:1099c3102bf7 170 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
caa45040 8:1099c3102bf7 171 /** Initializes the RCC Oscillators according to the specified parameters
caa45040 8:1099c3102bf7 172 * in the RCC_OscInitTypeDef structure.
caa45040 8:1099c3102bf7 173 */
caa45040 8:1099c3102bf7 174 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
caa45040 8:1099c3102bf7 175 RCC_OscInitStruct.HSIState = RCC_HSI_ON;
caa45040 8:1099c3102bf7 176 RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
caa45040 8:1099c3102bf7 177 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
caa45040 8:1099c3102bf7 178 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
caa45040 8:1099c3102bf7 179 RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_4;
caa45040 8:1099c3102bf7 180 RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_2;
caa45040 8:1099c3102bf7 181 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
caa45040 8:1099c3102bf7 182 {
caa45040 8:1099c3102bf7 183 Error_Handler();
caa45040 8:1099c3102bf7 184 }
caa45040 8:1099c3102bf7 185 /** Initializes the CPU, AHB and APB buses clocks
caa45040 8:1099c3102bf7 186 */
caa45040 8:1099c3102bf7 187 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
caa45040 8:1099c3102bf7 188 |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
caa45040 8:1099c3102bf7 189 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
caa45040 8:1099c3102bf7 190 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
caa45040 8:1099c3102bf7 191 RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
caa45040 8:1099c3102bf7 192 RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
caa45040 8:1099c3102bf7 193
caa45040 8:1099c3102bf7 194 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
caa45040 8:1099c3102bf7 195 {
caa45040 8:1099c3102bf7 196 Error_Handler();
caa45040 8:1099c3102bf7 197 }
caa45040 8:1099c3102bf7 198 PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_I2C1;
caa45040 8:1099c3102bf7 199 PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
caa45040 8:1099c3102bf7 200 PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
caa45040 8:1099c3102bf7 201 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
caa45040 8:1099c3102bf7 202 {
caa45040 8:1099c3102bf7 203 Error_Handler();
caa45040 8:1099c3102bf7 204 }
caa45040 8:1099c3102bf7 205 }
caa45040 8:1099c3102bf7 206
caa45040 8:1099c3102bf7 207 /**
caa45040 8:1099c3102bf7 208 * @brief I2C1 Initialization Function
caa45040 8:1099c3102bf7 209 * @param None
caa45040 8:1099c3102bf7 210 * @retval None
caa45040 8:1099c3102bf7 211 */
caa45040 8:1099c3102bf7 212 static void MX_I2C1_Init(void)
caa45040 8:1099c3102bf7 213 {
caa45040 8:1099c3102bf7 214
caa45040 8:1099c3102bf7 215 /* USER CODE BEGIN I2C1_Init 0 */
caa45040 8:1099c3102bf7 216
caa45040 8:1099c3102bf7 217 /* USER CODE END I2C1_Init 0 */
caa45040 8:1099c3102bf7 218
caa45040 8:1099c3102bf7 219 /* USER CODE BEGIN I2C1_Init 1 */
caa45040 8:1099c3102bf7 220
caa45040 8:1099c3102bf7 221 /* USER CODE END I2C1_Init 1 */
caa45040 8:1099c3102bf7 222 hi2c1.Instance = I2C1;
caa45040 8:1099c3102bf7 223 hi2c1.Init.Timing = 0x00707CBB;
caa45040 8:1099c3102bf7 224 hi2c1.Init.OwnAddress1 = 0;
caa45040 8:1099c3102bf7 225 hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
caa45040 8:1099c3102bf7 226 hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
caa45040 8:1099c3102bf7 227 hi2c1.Init.OwnAddress2 = 0;
caa45040 8:1099c3102bf7 228 hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
caa45040 8:1099c3102bf7 229 hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
caa45040 8:1099c3102bf7 230 hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
caa45040 8:1099c3102bf7 231 if (HAL_I2C_Init(&hi2c1) != HAL_OK)
caa45040 8:1099c3102bf7 232 {
caa45040 8:1099c3102bf7 233 Error_Handler();
caa45040 8:1099c3102bf7 234 }
caa45040 8:1099c3102bf7 235 /** Configure Analogue filter
caa45040 8:1099c3102bf7 236 */
caa45040 8:1099c3102bf7 237 if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
caa45040 8:1099c3102bf7 238 {
caa45040 8:1099c3102bf7 239 Error_Handler();
caa45040 8:1099c3102bf7 240 }
caa45040 8:1099c3102bf7 241 /** Configure Digital filter
caa45040 8:1099c3102bf7 242 */
caa45040 8:1099c3102bf7 243 if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK)
caa45040 8:1099c3102bf7 244 {
caa45040 8:1099c3102bf7 245 Error_Handler();
caa45040 8:1099c3102bf7 246 }
caa45040 8:1099c3102bf7 247 /* USER CODE BEGIN I2C1_Init 2 */
caa45040 8:1099c3102bf7 248
caa45040 8:1099c3102bf7 249 /* USER CODE END I2C1_Init 2 */
caa45040 8:1099c3102bf7 250
caa45040 8:1099c3102bf7 251 }
caa45040 8:1099c3102bf7 252
caa45040 8:1099c3102bf7 253 /**
caa45040 8:1099c3102bf7 254 * @brief USART2 Initialization Function
caa45040 8:1099c3102bf7 255 * @param None
caa45040 8:1099c3102bf7 256 * @retval None
caa45040 8:1099c3102bf7 257 */
caa45040 8:1099c3102bf7 258 static void MX_USART2_UART_Init(void)
caa45040 8:1099c3102bf7 259 {
caa45040 8:1099c3102bf7 260
caa45040 8:1099c3102bf7 261 /* USER CODE BEGIN USART2_Init 0 */
caa45040 8:1099c3102bf7 262
caa45040 8:1099c3102bf7 263 /* USER CODE END USART2_Init 0 */
caa45040 8:1099c3102bf7 264
caa45040 8:1099c3102bf7 265 /* USER CODE BEGIN USART2_Init 1 */
caa45040 8:1099c3102bf7 266
caa45040 8:1099c3102bf7 267 /* USER CODE END USART2_Init 1 */
caa45040 8:1099c3102bf7 268 huart2.Instance = USART2;
caa45040 8:1099c3102bf7 269 huart2.Init.BaudRate = 115200;
caa45040 8:1099c3102bf7 270 huart2.Init.WordLength = UART_WORDLENGTH_8B;
caa45040 8:1099c3102bf7 271 huart2.Init.StopBits = UART_STOPBITS_1;
caa45040 8:1099c3102bf7 272 huart2.Init.Parity = UART_PARITY_NONE;
caa45040 8:1099c3102bf7 273 huart2.Init.Mode = UART_MODE_TX_RX;
caa45040 8:1099c3102bf7 274 huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
caa45040 8:1099c3102bf7 275 huart2.Init.OverSampling = UART_OVERSAMPLING_16;
caa45040 8:1099c3102bf7 276 huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
caa45040 8:1099c3102bf7 277 huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
caa45040 8:1099c3102bf7 278 if (HAL_UART_Init(&huart2) != HAL_OK)
caa45040 8:1099c3102bf7 279 {
caa45040 8:1099c3102bf7 280 Error_Handler();
caa45040 8:1099c3102bf7 281 }
caa45040 8:1099c3102bf7 282 /* USER CODE BEGIN USART2_Init 2 */
caa45040 8:1099c3102bf7 283
caa45040 8:1099c3102bf7 284 /* USER CODE END USART2_Init 2 */
caa45040 8:1099c3102bf7 285
caa45040 8:1099c3102bf7 286 }
caa45040 8:1099c3102bf7 287
caa45040 8:1099c3102bf7 288 /**
caa45040 8:1099c3102bf7 289 * @brief GPIO Initialization Function
caa45040 8:1099c3102bf7 290 * @param None
caa45040 8:1099c3102bf7 291 * @retval None
caa45040 8:1099c3102bf7 292 */
caa45040 8:1099c3102bf7 293 static void MX_GPIO_Init(void)
caa45040 8:1099c3102bf7 294 {
caa45040 8:1099c3102bf7 295 GPIO_InitTypeDef GPIO_InitStruct = {0};
caa45040 8:1099c3102bf7 296
caa45040 8:1099c3102bf7 297 /* GPIO Ports Clock Enable */
caa45040 8:1099c3102bf7 298 __HAL_RCC_GPIOC_CLK_ENABLE();
caa45040 8:1099c3102bf7 299 __HAL_RCC_GPIOA_CLK_ENABLE();
caa45040 8:1099c3102bf7 300 __HAL_RCC_GPIOB_CLK_ENABLE();
caa45040 8:1099c3102bf7 301
caa45040 8:1099c3102bf7 302 /*Configure GPIO pin Output Level */
caa45040 8:1099c3102bf7 303 HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_RESET);
caa45040 8:1099c3102bf7 304
caa45040 8:1099c3102bf7 305 /*Configure GPIO pin : LD3_Pin */
caa45040 8:1099c3102bf7 306 GPIO_InitStruct.Pin = LD3_Pin;
caa45040 8:1099c3102bf7 307 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
caa45040 8:1099c3102bf7 308 GPIO_InitStruct.Pull = GPIO_NOPULL;
caa45040 8:1099c3102bf7 309 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
caa45040 8:1099c3102bf7 310 HAL_GPIO_Init(LD3_GPIO_Port, &GPIO_InitStruct);
caa45040 8:1099c3102bf7 311
caa45040 8:1099c3102bf7 312 }
caa45040 8:1099c3102bf7 313
caa45040 8:1099c3102bf7 314 /* USER CODE BEGIN 4 */
caa45040 8:1099c3102bf7 315
caa45040 8:1099c3102bf7 316 /* USER CODE END 4 */
caa45040 8:1099c3102bf7 317
caa45040 8:1099c3102bf7 318 /**
caa45040 8:1099c3102bf7 319 * @brief This function is executed in case of error occurrence.
caa45040 8:1099c3102bf7 320 * @retval None
caa45040 8:1099c3102bf7 321 */
caa45040 8:1099c3102bf7 322 void Error_Handler(void)
caa45040 8:1099c3102bf7 323 {
caa45040 8:1099c3102bf7 324 /* USER CODE BEGIN Error_Handler_Debug */
caa45040 8:1099c3102bf7 325 /* User can add his own implementation to report the HAL error return state */
caa45040 8:1099c3102bf7 326 __disable_irq();
caa45040 8:1099c3102bf7 327 while (1)
caa45040 8:1099c3102bf7 328 {
caa45040 8:1099c3102bf7 329 }
caa45040 8:1099c3102bf7 330 /* USER CODE END Error_Handler_Debug */
caa45040 8:1099c3102bf7 331 }
caa45040 8:1099c3102bf7 332
caa45040 8:1099c3102bf7 333 #ifdef USE_FULL_ASSERT
caa45040 8:1099c3102bf7 334 /**
caa45040 8:1099c3102bf7 335 * @brief Reports the name of the source file and the source line number
caa45040 8:1099c3102bf7 336 * where the assert_param error has occurred.
caa45040 8:1099c3102bf7 337 * @param file: pointer to the source file name
caa45040 8:1099c3102bf7 338 * @param line: assert_param error line source number
caa45040 8:1099c3102bf7 339 * @retval None
caa45040 8:1099c3102bf7 340 */
caa45040 8:1099c3102bf7 341 void assert_failed(uint8_t *file, uint32_t line)
caa45040 8:1099c3102bf7 342 {
caa45040 8:1099c3102bf7 343 /* USER CODE BEGIN 6 */
caa45040 8:1099c3102bf7 344 /* User can add his own implementation to report the file name and line number,
caa45040 8:1099c3102bf7 345 ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
caa45040 8:1099c3102bf7 346 /* USER CODE END 6 */
caa45040 8:1099c3102bf7 347 }
caa45040 8:1099c3102bf7 348 #endif /* USE_FULL_ASSERT */
caa45040 8:1099c3102bf7 349
caa45040 8:1099c3102bf7 350 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
caa45040 8:1099c3102bf7 351