Skip to content

Commit a499857

Browse files
committed
Update core to support H7
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent cdcac7d commit a499857

File tree

9 files changed

+140
-38
lines changed

9 files changed

+140
-38
lines changed

cores/arduino/stm32/analog.c

+39-19
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,26 @@
6969
/** @addtogroup STM32F4xx_System_Private_Defines
7070
* @{
7171
*/
72-
#if defined(ADC_SAMPLETIME_15CYCLES)
73-
#define SAMPLINGTIME ADC_SAMPLETIME_15CYCLES;
72+
#if defined(ADC_SAMPLETIME_8CYCLES_5)
73+
#define SAMPLINGTIME ADC_SAMPLETIME_8CYCLES_5;
74+
#elif defined(ADC_SAMPLETIME_12CYCLES_5)
75+
#define SAMPLINGTIME ADC_SAMPLETIME_12CYCLES_5;
7476
#elif defined(ADC_SAMPLETIME_13CYCLES_5)
7577
#define SAMPLINGTIME ADC_SAMPLETIME_13CYCLES_5;
76-
#elif defined(ADC_SAMPLETIME_19CYCLES_5)
77-
#define SAMPLINGTIME ADC_SAMPLETIME_19CYCLES_5;
78+
#elif defined(ADC_SAMPLETIME_15CYCLES)
79+
#define SAMPLINGTIME ADC_SAMPLETIME_15CYCLES;
7880
#elif defined(ADC_SAMPLETIME_16CYCLES)
7981
#define SAMPLINGTIME ADC_SAMPLETIME_16CYCLES;
80-
#elif defined(ADC_SAMPLETIME_12CYCLES_5)
81-
#define SAMPLINGTIME ADC_SAMPLETIME_12CYCLES_5;
82+
#elif defined(ADC_SAMPLETIME_19CYCLES_5)
83+
#define SAMPLINGTIME ADC_SAMPLETIME_19CYCLES_5;
8284
#else
8385
#error "ADC SAMPLINGTIME could not be defined"
8486
#endif
8587

8688
#ifndef STM32F1xx
87-
#ifdef ADC_CLOCK_SYNC_PCLK_DIV2
89+
#ifdef ADC_CLOCK_SYNC_PCLK_DIV4
90+
#define ADC_CLOCK_DIV ADC_CLOCK_SYNC_PCLK_DIV4
91+
#elif ADC_CLOCK_SYNC_PCLK_DIV2
8892
#define ADC_CLOCK_DIV ADC_CLOCK_SYNC_PCLK_DIV2
8993
#elif defined(ADC_CLOCK_ASYNC_DIV1)
9094
#define ADC_CLOCK_DIV ADC_CLOCK_ASYNC_DIV1
@@ -265,6 +269,9 @@ void HAL_DAC_MspInit(DAC_HandleTypeDef *hdac)
265269
#endif
266270
#ifdef __HAL_RCC_DAC_CLK_ENABLE
267271
__HAL_RCC_DAC_CLK_ENABLE();
272+
#endif
273+
#ifdef __HAL_RCC_DAC12_CLK_ENABLE
274+
__HAL_RCC_DAC12_CLK_ENABLE();
268275
#endif
269276
/* Configure DAC GPIO pins */
270277
pinmap_pinout(g_current_pin, PinMap_DAC);
@@ -422,8 +429,9 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc)
422429
#ifdef __HAL_RCC_ADC_CLK_ENABLE
423430
__HAL_RCC_ADC_CLK_ENABLE();
424431
#endif
425-
/* For STM32F1xx, ADC prescaler is confgured in SystemClock_Config (variant.cpp) */
426-
#if defined(__HAL_RCC_ADC_CONFIG) && !defined(STM32F1xx)
432+
/* For STM32F1xx and STM32H7xx, ADC prescaler is configured in
433+
SystemClock_Config (variant.cpp) */
434+
#if defined(__HAL_RCC_ADC_CONFIG) && !defined(STM32F1xx) && !defined(STM32H7xx)
427435
/* ADC Periph interface clock configuration */
428436
__HAL_RCC_ADC_CONFIG(RCC_ADCCLKSOURCE_SYSCLK);
429437
#endif
@@ -538,13 +546,19 @@ uint16_t adc_read_value(PinName pin)
538546
if (AdcHandle.Instance == NP) return 0;
539547

540548
#ifndef STM32F1xx
541-
AdcHandle.Init.ClockPrescaler = ADC_CLOCK_DIV; /* Asynchronous clock mode, input ADC clock divided */
549+
AdcHandle.Init.ClockPrescaler = ADC_CLOCK_DIV; /* Asynchronous clock mode, input ADC clock divided */
542550
AdcHandle.Init.Resolution = ADC_RESOLUTION_12B; /* 12-bit resolution for converted data */
543551
AdcHandle.Init.EOCSelection = ADC_EOC_SINGLE_CONV; /* EOC flag picked-up to indicate conversion end */
544552
AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; /* Parameter discarded because software trigger chosen */
553+
#ifdef STM32H7xx
554+
AdcHandle.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR; /* Regular Conversion data stored in DR register only */
555+
#else
545556
AdcHandle.Init.DMAContinuousRequests = DISABLE; /* DMA one-shot mode selected (not applied to this example) */
546-
#endif
557+
#endif /* STM32H7xx */
558+
#endif /* STM32F1xx */
559+
#ifndef STM32H7xx
547560
AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT; /* Right-alignment for converted data */
561+
#endif /* !STM32H7xx */
548562
AdcHandle.Init.ScanConvMode = DISABLE; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
549563
AdcHandle.Init.ContinuousConvMode = DISABLE; /* Continuous mode disabled to have only 1 conversion at each conversion trig */
550564
AdcHandle.Init.DiscontinuousConvMode = DISABLE; /* Parameter discarded because sequencer is disabled */
@@ -556,17 +570,20 @@ uint16_t adc_read_value(PinName pin)
556570
AdcHandle.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; /* DR register is overwritten with the last conversion result in case of overrun */
557571
#ifdef STM32F0xx
558572
AdcHandle.Init.SamplingTimeCommon = SAMPLINGTIME;
559-
#else // STM32L0
573+
#else /* STM32L0 */
560574
//LowPowerFrequencyMode to enable if clk freq < 2.8Mhz
561575
AdcHandle.Init.SamplingTime = SAMPLINGTIME;
562-
#endif
576+
#endif /* STM32F0xx */
563577
#else
564-
#ifdef STM32F3xx
578+
#if defined (STM32F3xx) || defined (STM32H7xx)
565579
AdcHandle.Init.LowPowerAutoWait = DISABLE; /* Auto-delayed conversion feature disabled */
566-
#endif
580+
#ifndef STM32H7xx
581+
AdcHandle.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; /* DR register is overwritten with the last conversion result in case of overrun */
582+
#endif /* !STM32H7xx */
583+
#endif /* STM32F3xx || STM32H7xx */
567584
AdcHandle.Init.NbrOfConversion = 1; /* Specifies the number of ranks that will be converted within the regular group sequencer. */
568585
AdcHandle.Init.NbrOfDiscConversion = 0; /* Parameter discarded because sequencer is disabled */
569-
#endif
586+
#endif /* STM32F0xx || STM32L0xx */
570587

571588
g_current_pin = pin; /* Needed for HAL_ADC_MspInit*/
572589

@@ -579,12 +596,12 @@ uint16_t adc_read_value(PinName pin)
579596
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) return 0;
580597
#else
581598
if (!IS_ADC_CHANNEL(AdcChannelConf.Channel)) return 0;
582-
#endif
599+
#endif /* STM32L4xx */
583600
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
584601
#ifndef STM32L0xx
585602
AdcChannelConf.SamplingTime = SAMPLINGTIME; /* Sampling time value to be set for the selected channel */
586603
#endif
587-
#if defined (STM32F3xx) || defined (STM32L4xx)
604+
#if defined (STM32F3xx) || defined (STM32L4xx) || defined (STM32H7xx)
588605
AdcChannelConf.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
589606
AdcChannelConf.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
590607
AdcChannelConf.Offset = 0; /* Parameter discarded because offset correction is disabled */
@@ -596,10 +613,13 @@ uint16_t adc_read_value(PinName pin)
596613
return 0;
597614
}
598615

599-
#if defined (STM32F0xx) || defined (STM32F1xx) || defined (STM32F3xx) || defined (STM32L0xx) || defined (STM32L4xx)
616+
#if defined (STM32F0xx) || defined (STM32F1xx) || defined (STM32F3xx) ||\
617+
defined (STM32H7xx) || defined (STM32L0xx) || defined (STM32L4xx)
600618
/*##-2.1- Calibrate ADC then Start the conversion process ####################*/
601619
#if defined (STM32F0xx) || defined (STM32F1xx)
602620
if (HAL_ADCEx_Calibration_Start(&AdcHandle) != HAL_OK)
621+
#elif defined (STM32H7xx)
622+
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
603623
#else
604624
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED) != HAL_OK)
605625
#endif

cores/arduino/stm32/clock.c

+2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ void enableClock(sourceClock_t source)
113113
break;
114114
case LSE_CLOCK:
115115
/* Enable Power Clock */
116+
#ifndef STM32H7xx
116117
if(__HAL_RCC_PWR_IS_CLK_DISABLED()) {
117118
__HAL_RCC_PWR_CLK_ENABLE();
118119
}
120+
#endif
119121
#ifdef HAL_PWR_MODULE_ENABLED
120122
/* Allow access to Backup domain */
121123
HAL_PWR_EnableBkUpAccess();

cores/arduino/stm32/low_power.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ static void (*WakeUpUartCb)( void ) = NULL;
5858
* @retval None
5959
*/
6060
void LowPower_init(){
61+
#ifndef STM32H7xx
6162
/* Enable Power Clock */
6263
__HAL_RCC_PWR_CLK_ENABLE();
63-
64+
#endif
6465
/* Allow access to Backup domain */
6566
HAL_PWR_EnableBkUpAccess();
6667

cores/arduino/stm32/rtc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void RTC_initClock(sourceClock_t source)
141141
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_HSE_DIV16;
142142
HSEDiv = 16;
143143
}
144-
#elif defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx)
144+
#elif defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx)
145145
/* Not defined for STM32F2xx */
146146
#ifndef RCC_RTCCLKSOURCE_HSE_DIVX
147147
#define RCC_RTCCLKSOURCE_HSE_DIVX 0x00000300U
@@ -308,9 +308,9 @@ void RTC_init(hourFormat_t format, sourceClock_t source)
308308
}
309309
RtcHandle.Init.OutPut = RTC_OUTPUT_DISABLE;
310310
RTC_getPrediv((int8_t*)&(RtcHandle.Init.AsynchPrediv), (int16_t*)&(RtcHandle.Init.SynchPrediv));
311-
#if defined(STM32L0xx) || defined(STM32L4xx)
311+
#if defined(STM32H7xx) || defined(STM32L0xx) || defined(STM32L4xx)
312312
RtcHandle.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
313-
#endif /* STM32L0xx || STM32L4xx */
313+
#endif /* STM32H7xx || STM32L0xx || STM32L4xx */
314314
RtcHandle.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
315315
RtcHandle.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
316316
#endif /* STM32F1xx */

cores/arduino/stm32/stm32_eeprom.c

+22-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
/* Be able to change FLASH_BANK_NUMBER to use if relevant */
4343
#if !defined(FLASH_BANK_NUMBER) &&\
44-
(defined(STM32F0xx) || defined(STM32F1xx) ||\
44+
(defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32H7xx) ||\
4545
defined(STM32L1xx) || defined(STM32L4xx))
4646
/* Fo STM32F0xx, FLASH_BANK_1 is not defined only FLASH_BANK1_END is defined */
4747
#if defined(STM32F0xx)
@@ -58,7 +58,8 @@
5858
#endif /* !FLASH_BANK_NUMBER */
5959

6060
/* Be able to change FLASH_DATA_SECTOR to use if relevant */
61-
#if defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx)
61+
#if defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx) ||\
62+
defined(STM32H7xx)
6263
#if !defined(FLASH_DATA_SECTOR)
6364
#define FLASH_DATA_SECTOR ((uint32_t)(FLASH_SECTOR_TOTAL - 1))
6465
#else
@@ -232,10 +233,10 @@ void eeprom_buffer_flush(void) {
232233
if(HAL_FLASHEx_Erase(&EraseInitStruct, &pageError) == HAL_OK) {
233234
while(address <= address_end) {
234235
#if defined(STM32L0xx) || defined(STM32L1xx)
235-
memcpy(&data, eeprom_buffer + offset, sizeof(uint32_t));
236-
if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data) == HAL_OK) {
237-
address += 4;
238-
offset += 4;
236+
memcpy(&data, eeprom_buffer + offset, sizeof(uint32_t));
237+
if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data) == HAL_OK) {
238+
address += 4;
239+
offset += 4;
239240
#else
240241
data = *((uint64_t*)((uint8_t*)eeprom_buffer + offset));
241242

@@ -252,10 +253,17 @@ void eeprom_buffer_flush(void) {
252253
}
253254
#else
254255
uint32_t SectorError = 0;
256+
#if defined(STM32H7xx)
257+
uint64_t data[4] = {0x0000};
258+
#else
255259
uint32_t data = 0;
260+
#endif
256261

257262
/* ERASING page */
258263
EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
264+
#if defined(STM32H7xx)
265+
EraseInitStruct.Banks = FLASH_BANK_NUMBER;
266+
#endif
259267
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
260268
EraseInitStruct.Sector = FLASH_DATA_SECTOR;
261269
EraseInitStruct.NbSectors = 1;
@@ -264,10 +272,18 @@ void eeprom_buffer_flush(void) {
264272

265273
if(HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) == HAL_OK) {
266274
while(address <= address_end) {
275+
#if defined(STM32H7xx)
276+
/* 256 bits */
277+
memcpy(&data, eeprom_buffer + offset, 8 *sizeof(uint32_t));
278+
if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, address, (uint32_t)data) == HAL_OK) {
279+
address += 32;
280+
offset += 32;
281+
#else
267282
memcpy(&data, eeprom_buffer + offset, sizeof(uint32_t));
268283
if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data) == HAL_OK) {
269284
address += 4;
270285
offset += 4;
286+
#endif
271287
} else {
272288
address = address_end+1;
273289
}

cores/arduino/stm32/timer.c

+53-1
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,62 @@ uint32_t getTimerClkFreq(TIM_TypeDef* tim)
690690
core_debug("TIM: Unknown clock source");
691691
break;
692692
}
693+
694+
#if defined(STM32H7xx)
695+
/* When TIMPRE bit of the RCC_CFGR register is reset,
696+
* if APBx prescaler is 1 or 2 then TIMxCLK = HCLK,
697+
* otherwise TIMxCLK = 2x PCLKx.
698+
* When TIMPRE bit in the RCC_CFGR register is set,
699+
* if APBx prescaler is 1,2 or 4, then TIMxCLK = HCLK,
700+
* otherwise TIMxCLK = 4x PCLKx
701+
*/
702+
RCC_PeriphCLKInitTypeDef PeriphClkConfig = {};
703+
HAL_RCCEx_GetPeriphCLKConfig(&PeriphClkConfig);
704+
705+
if (PeriphClkConfig.TIMPresSelection == RCC_TIMPRES_ACTIVATED) {
706+
switch (uwAPBxPrescaler) {
707+
default:
708+
case RCC_APB1_DIV1:
709+
case RCC_APB1_DIV2:
710+
case RCC_APB1_DIV4:
711+
/* case RCC_APB2_DIV1: */
712+
case RCC_APB2_DIV2:
713+
case RCC_APB2_DIV4:
714+
uwTimclock=HAL_RCC_GetHCLKFreq();
715+
break;
716+
case RCC_APB1_DIV8:
717+
case RCC_APB1_DIV16:
718+
case RCC_APB2_DIV8:
719+
case RCC_APB2_DIV16:
720+
uwTimclock*=4;
721+
break;
722+
}
723+
} else {
724+
switch (uwAPBxPrescaler) {
725+
default:
726+
case RCC_APB1_DIV1:
727+
case RCC_APB1_DIV2:
728+
/* case RCC_APB2_DIV1: */
729+
case RCC_APB2_DIV2:
730+
// uwTimclock*=1;
731+
uwTimclock=HAL_RCC_GetHCLKFreq();
732+
break;
733+
case RCC_APB1_DIV4:
734+
case RCC_APB1_DIV8:
735+
case RCC_APB1_DIV16:
736+
case RCC_APB2_DIV4:
737+
case RCC_APB2_DIV8:
738+
case RCC_APB2_DIV16:
739+
uwTimclock*=2;
740+
break;
741+
}
742+
}
743+
#else
693744
/* When TIMPRE bit of the RCC_DCKCFGR register is reset,
694745
* if APBx prescaler is 1, then TIMxCLK = PCLKx,
695746
* otherwise TIMxCLK = 2x PCLKx.
696747
* When TIMPRE bit in the RCC_DCKCFGR register is set,
697-
* if APBx prescaler is 1,2 or 4, then TIMxCLK =HCLK,
748+
* if APBx prescaler is 1,2 or 4, then TIMxCLK = HCLK,
698749
* otherwise TIMxCLK = 4x PCLKx
699750
*/
700751
#if defined(STM32F4xx) || defined(STM32F7xx)
@@ -731,6 +782,7 @@ uint32_t getTimerClkFreq(TIM_TypeDef* tim)
731782
uwTimclock*=2;
732783
break;
733784
}
785+
#endif /* STM32H7xx */
734786
return uwTimclock;
735787
}
736788

cores/arduino/stm32/timer.h

+11-4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ struct timer_s{
9292
#elif defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx)
9393
#define TIM1_IRQn TIM1_UP_TIM10_IRQn
9494
#define TIM1_IRQHandler TIM1_UP_TIM10_IRQHandler
95+
#elif defined(STM32H7xx)
96+
#define TIM1_IRQn TIM1_UP_IRQn
97+
#define TIM1_IRQHandler TIM1_UP_IRQHandler
9598
#endif
9699
#endif
97100
#if defined(TIM6_BASE) && !defined(TIM6_IRQn)
@@ -101,7 +104,8 @@ struct timer_s{
101104
#endif
102105
#endif
103106
#if defined(TIM8_BASE) && !defined(TIM8_IRQn)
104-
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
107+
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)\
108+
|| defined(STM32H7xx)
105109
#define TIM8_IRQn TIM8_UP_TIM13_IRQn
106110
#define TIM8_IRQHandler TIM8_UP_TIM13_IRQHandler
107111
#elif defined(STM32F3xx) || defined(STM32L4xx)
@@ -128,18 +132,21 @@ struct timer_s{
128132
#endif
129133
#endif
130134
#if defined(TIM12_BASE) && !defined(TIM12_IRQn)
131-
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
135+
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)\
136+
|| defined(STM32H7xx)
132137
#define TIM12_IRQn TIM8_BRK_TIM12_IRQn
133138
#define TIM12_IRQHandler TIM8_BRK_TIM12_IRQHandler
134139
#endif
135140
#endif
136141
#if defined(TIM13_BASE) && !defined(TIM13_IRQn)
137-
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
142+
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)\
143+
|| defined(STM32H7xx)
138144
#define TIM13_IRQn TIM8_UP_TIM13_IRQn
139145
#endif
140146
#endif
141147
#if defined(TIM14_BASE) && !defined(TIM14_IRQn)
142-
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
148+
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)\
149+
|| defined(STM32H7xx)
143150
#define TIM14_IRQn TIM8_TRG_COM_TIM14_IRQn
144151
#define TIM14_IRQHandler TIM8_TRG_COM_TIM14_IRQHandler
145152
#endif

cores/arduino/stm32/twi.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
*/
105105

106106
/* Family specific description for I2C */
107-
#if defined(STM32F7xx) || defined(STM32L4xx)
107+
#if defined(STM32F7xx) || defined(STM32H7xx) || defined(STM32L4xx)
108108
#define I2C_NUM (4)
109109
#elif defined(STM32F2xx) || defined(STM32F3xx) || defined(STM32F4xx) || defined(STM32L0xx)
110110
#define I2C_NUM (3)
@@ -236,7 +236,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
236236

237237
handle->Instance = obj->i2c;
238238
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32F7xx) ||\
239-
defined (STM32L0xx) || defined (STM32L4xx)
239+
defined (STM32H7xx) || defined (STM32L0xx) || defined (STM32L4xx)
240240
handle->Init.Timing = timing;
241241
#else
242242
handle->Init.ClockSpeed = timing;
@@ -309,7 +309,7 @@ void i2c_setTiming(i2c_t *obj, uint32_t frequency)
309309
f = I2C_400KHz;
310310

311311
#if defined (STM32F0xx) || defined (STM32F3xx) || defined (STM32F7xx) ||\
312-
defined (STM32L0xx) || defined (STM32L4xx)
312+
defined (STM32H7xx) || defined (STM32L0xx) || defined (STM32L4xx)
313313
obj->handle.Init.Timing = f;
314314
#else
315315
obj->handle.Init.ClockSpeed = f;

0 commit comments

Comments
 (0)