Skip to content

Commit

Permalink
support for amc: stm32hal v1B1 (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoaccame authored Oct 26, 2023
1 parent ad9c63e commit 4d0babc
Show file tree
Hide file tree
Showing 711 changed files with 1,032,862 additions and 30,614 deletions.
15 changes: 13 additions & 2 deletions emBODY/eBcode/arch-arm/libs/lowlevel/stm32hal/api/stm32hal_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ extern void stm32hal_board_init(void);

#elif defined(STM32HAL_BOARD_AMC)

// one case: v1A0
// two cases: v1A0 and v1B1
#if (STM32HAL_DRIVER_VERSION == 0x1A0)

#include "../src/config/stm32hal_driver_cfg_of_amc_v1A0.h"
Expand All @@ -453,7 +453,18 @@ extern void stm32hal_board_init(void);
//#include "../src/board/amc/v1A0/inc/fdcan.h"

#include "../src/board/amc/v1A0/inc/stm32h7xx_it.h"


#elif (STM32HAL_DRIVER_VERSION == 0x1B1)

#include "../src/config/stm32hal_driver_cfg_of_amc_v1B1.h"

#include "../src/board/amc/v1B1/inc/gpio.h"
#include "../src/board/amc/v1B1/inc/main.h"
#include "../src/board/amc/v1B1/inc/eth.h"
#include "../src/board/amc/v1B1/inc/spi.h"
#include "../src/board/amc/v1B1/inc/fdcan.h"

#include "../src/board/amc/v1B1/inc/stm32h7xx_it.h"
#else
#error unsupported driver version for amc
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,16 @@ extern "C" {

#elif defined(STM32HAL_BOARD_AMC)

// one drive only: v1A0.
#if !defined(STM32HAL_DRIVER_V1A0)
#define STM32HAL_DRIVER_V1A0
#endif
#define STM32HAL_DRIVER_VERSION 0x1A0
// two possible drivers: v1A0 and v1B1. default is the 1B1 ...
#if defined(STM32HAL_DRIVER_V1A0)
#define STM32HAL_DRIVER_VERSION 0x1A0
#else
#if !defined(STM32HAL_DRIVER_V1B1)
#define STM32HAL_DRIVER_V1B1
#endif
#define STM32HAL_DRIVER_VERSION 0x1B1
#endif


#elif defined(STM32HAL_BOARD_AMC2C)

Expand Down Expand Up @@ -258,10 +263,12 @@ extern "C" {
#if defined(STM32HAL_DRIVER_V180)
#include "../src/driver/stm32h7-v180/inc/stm32h7xx_hal.h"
#elif defined(STM32HAL_DRIVER_V190)
#include "../src/driver/stm32h7-v190/inc/stm32h7xx_hal.h"
#include "../src/driver/stm32h7-v190/inc/stm32h7xx_hal.hx"
#elif defined(STM32HAL_DRIVER_V1A0)
#include "../src/driver/stm32h7-v1A0/inc/stm32h7xx_hal.h"
#else
#elif defined(STM32HAL_DRIVER_V1B1)
#include "../src/driver/stm32h7-v1B1/inc/stm32h7xx_hal.h"
#else
#error STM32HAL: the STM32HAL_DRIVER_${V} is not managed
#endif

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file adc.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __ADC_H__
#define __ADC_H__
Expand All @@ -34,6 +35,7 @@ extern "C" {
/* USER CODE END Includes */

extern ADC_HandleTypeDef hadc1;

extern ADC_HandleTypeDef hadc2;

/* USER CODE BEGIN Private defines */
Expand All @@ -53,4 +55,3 @@ void MX_ADC2_Init(void);

#endif /* __ADC_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file crc.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CRC_H__
#define __CRC_H__
Expand Down Expand Up @@ -51,4 +52,3 @@ void MX_CRC_Init(void);

#endif /* __CRC_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file dac.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DAC_H__
#define __DAC_H__
Expand Down Expand Up @@ -51,4 +52,3 @@ void MX_DAC1_Init(void);

#endif /* __DAC_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file dma.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DMA_H__
#define __DMA_H__
Expand Down Expand Up @@ -49,4 +50,3 @@ void MX_DMA_Init(void);

#endif /* __DMA_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file gpio.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GPIO_H__
#define __GPIO_H__
Expand Down Expand Up @@ -46,4 +47,3 @@ void MX_GPIO_Init(void);
#endif
#endif /*__ GPIO_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file i2c.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __I2C_H__
#define __I2C_H__
Expand All @@ -34,8 +35,11 @@ extern "C" {
/* USER CODE END Includes */

extern I2C_HandleTypeDef hi2c1;

extern I2C_HandleTypeDef hi2c2;

extern I2C_HandleTypeDef hi2c3;

extern I2C_HandleTypeDef hi2c4;

/* USER CODE BEGIN Private defines */
Expand All @@ -57,4 +61,3 @@ void MX_I2C4_Init(void);

#endif /* __I2C_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void Error_Handler(void);
#define I2C4_SCL_GPIO_Port GPIOF
#define MOT_PWM1_Pin GPIO_PIN_9
#define MOT_PWM1_GPIO_Port GPIOE

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */
Expand All @@ -228,5 +229,3 @@ void Error_Handler(void);
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ void MX_RESMGR_UTILITY_Callback(uint32_t id, uint32_t msg);
* @}
*/

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file rng.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __RNG_H__
#define __RNG_H__
Expand Down Expand Up @@ -51,4 +52,3 @@ void MX_RNG_Init(void);

#endif /* __RNG_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file rtc.h
Expand All @@ -6,16 +7,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
* All rights reserved.</center></h2>
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* 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
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __RTC_H__
#define __RTC_H__
Expand Down Expand Up @@ -51,4 +52,3 @@ void MX_RTC_Init(void);

#endif /* __RTC_H__ */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Loading

0 comments on commit 4d0babc

Please sign in to comment.