STM32H7xx_Nucleo BSP User Manual: STM32H7xx_Nucleo BSP Drivers

STM32H7xx_Nucleo BSP User Manual
  • Main Page
  • Modules
  • Files
  • Directories
STM32H7xx_Nucleo BSP Drivers

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32H7xx_Nucleo BSP peripheral Firmware drivers.

Document tabsheets description:

  • "Modules" : List the different modules.
  • "Files" : List all the files and globals.
  • "Directories" : Firmware Directory hierarchy.

Revision History:

Date | Revision | Author | Development Platform
11/29/2019 | V1.0 | boudinar | STM32H7xx_Nucleo Board
Generated on Fri Nov 29 2019 14:29:32 for STM32H7xx_Nucleo BSP User Manual by doxygen 1.7.6.1


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Private Defines

  • Files
  • Directories
LOW LEVEL Private Defines
LOW LEVEL


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Private Typedef

Typedefs
LOW LEVEL Private Typedef
LOW LEVEL

Typedefs

typedef void(* BSP_EXTI_LineCallback )(void)

Typedef Documentation

typedef void(* BSP_EXTI_LineCallback)(void)

Definition at line 50 of file stm32h7xx_nucleo.c.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Exported Variables

Variables
LOW LEVEL Exported Variables
LOW LEVEL

Variables

EXTI_HandleTypeDef | hpb_exti [BUTTONn]
EXTI_HandleTypeDef | hpb_exti []

Variable Documentation

EXTI_HandleTypeDef hpb_exti[BUTTONn]

Definition at line 58 of file stm32h7xx_nucleo.c.

Referenced by BSP_PB_Init(), and BSP_PB_IRQHandler().

EXTI_HandleTypeDef hpb_exti[]

Definition at line 58 of file stm32h7xx_nucleo.c.

Referenced by BSP_PB_Init(), and BSP_PB_IRQHandler().


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Private Variables

Variables
LOW LEVEL Private Variables
LOW LEVEL

Variables

static GPIO_TypeDef * | LED_PORT [LEDn]
static const uint16_t | LED_PIN [LEDn]
static GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {BUTTON_USER_GPIO_PORT}
static const uint16_t | BUTTON_PIN [BUTTONn] = {BUTTON_USER_PIN}
static const IRQn_Type | BUTTON_IRQn [BUTTONn] = {BUTTON_USER_EXTI_IRQn}

Variable Documentation

const IRQn_Type BUTTON_IRQn[BUTTONn] = {BUTTON_USER_EXTI_IRQn} [static]

Definition at line 79 of file stm32h7xx_nucleo.c.

Referenced by BSP_PB_DeInit(), and BSP_PB_Init().

const uint16_t BUTTON_PIN[BUTTONn] = {BUTTON_USER_PIN} [static]

Definition at line 78 of file stm32h7xx_nucleo.c.

Referenced by BSP_PB_DeInit(), BSP_PB_GetState(), and BSP_PB_Init().

GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {BUTTON_USER_GPIO_PORT} [static]

Definition at line 77 of file stm32h7xx_nucleo.c.

Referenced by BSP_PB_DeInit(), BSP_PB_GetState(), and BSP_PB_Init().

const uint16_t LED_PIN[LEDn] [static]
Initial value:
 {LED1_PIN,
                                       LED2_PIN,
                                       LED3_PIN}

Definition at line 73 of file stm32h7xx_nucleo.c.

Referenced by BSP_LED_DeInit(), BSP_LED_GetState(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and BSP_LED_Toggle().

GPIO_TypeDef* LED_PORT[LEDn] [static]
Initial value:
 {LED1_GPIO_PORT,
                                       LED2_GPIO_PORT,
                                       LED3_GPIO_PORT}

Definition at line 69 of file stm32h7xx_nucleo.c.

Referenced by BSP_LED_DeInit(), BSP_LED_GetState(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and BSP_LED_Toggle().


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Private functions Prototypes

LOW LEVEL Private functions Prototypes
LOW LEVEL


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Exported Functions

Functions
LOW LEVEL Exported Functions
LOW LEVEL

Functions

int32_t | BSP_GetVersion (void)
This method returns the STM32H7XX NUCLEO BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
int32_t | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
int32_t | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
int32_t | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
int32_t | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
int32_t | BSP_LED_GetState (Led_TypeDef Led)
Get the state of the selected LED.
int32_t | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
int32_t | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
int32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
BSP Button IRQ handler.
__weak void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.

Function Documentation

int32_t BSP_GetVersion ( void )

This method returns the STM32H7XX NUCLEO BSP Driver revision.

Return values:
version,: 0xXYZR (8bits for each decimal, R for RC)

Definition at line 116 of file stm32h7xx_nucleo.c.

References STM32H7XX_NUCLEO_BSP_VERSION.

int32_t BSP_LED_DeInit ( Led_TypeDef Led )

DeInit LEDs.

Parameters:
Led LED to be de-init. This parameter can be one of the following values:
  • LED1
  • LED2
  • LED3
Note:
Led DeInit does not disable the GPIO clock nor disable the Mfx
Return values:
BSP status

Definition at line 177 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_GetState ( Led_TypeDef Led )

Get the state of the selected LED.

Parameters:
Led LED to get its state This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
LED status

Definition at line 282 of file stm32h7xx_nucleo.c.

References BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

Parameters:
Led Specifies the Led to be configured. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 130 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED1_GPIO_CLK_ENABLE, LED2, LED2_GPIO_CLK_ENABLE, LED3, LED3_GPIO_CLK_ENABLE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

Parameters:
Led,: Specifies the Led to be set off. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 232 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

Parameters:
Led Specifies the Led to be set on. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 207 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

Parameters:
Led Specifies the Led to be toggled. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 257 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

__weak void BSP_PB_Callback ( Button_TypeDef Button )

BSP Push Button callback.

Parameters:
Button Specifies the pin connected EXTI line
Return values:
None

Definition at line 392 of file stm32h7xx_nucleo.c.

Referenced by BUTTON_USER_EXTI_Callback().

int32_t BSP_PB_DeInit ( Button_TypeDef Button )

Push Button DeInit.

Parameters:
Button Button to be configured This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
Note:
PB DeInit does not disable the GPIO clock

Definition at line 354 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

int32_t BSP_PB_GetState ( Button_TypeDef Button )

Returns the selected button state.

Parameters:
Button Button to be checked This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
Return values:
The Button GPIO pin value (GPIO_PIN_RESET = button pressed)

Definition at line 372 of file stm32h7xx_nucleo.c.

References BUTTON_PIN, and BUTTON_PORT.

int32_t BSP_PB_Init | ( | Button_TypeDef | Button,
 |  | ButtonMode_TypeDef | ButtonMode
 | ) |  |

Configures button GPIO and EXTI Line.

Parameters:
Button Button to be configured This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
ButtonMode Button mode This parameter can be one of the following values:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability

Definition at line 309 of file stm32h7xx_nucleo.c.

References BSP_BUTTON_USER_IT_PRIORITY, BSP_ERROR_NONE, BUTTON_IRQn, BUTTON_MODE_GPIO, BUTTON_PIN, BUTTON_PORT, BUTTON_USER_EXTI_Callback(), BUTTON_USER_EXTI_LINE, BUTTON_USER_GPIO_CLK_ENABLE, BUTTONn, and hpb_exti.

void BSP_PB_IRQHandler ( Button_TypeDef Button )

BSP Button IRQ handler.

Parameters:
Button Can only be BUTTON_USER
Return values:
None

Definition at line 382 of file stm32h7xx_nucleo.c.

References hpb_exti.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Private functions

Functions
LOW LEVEL Private functions
LOW LEVEL

Functions

static void BUTTON_USER_EXTI_Callback (void)
Key EXTI line detection callbacks.

Function Documentation

static void BUTTON_USER_EXTI_Callback ( void ) [static]

Key EXTI line detection callbacks.

Return values:
BSP status

Definition at line 614 of file stm32h7xx_nucleo.c.

References BSP_PB_Callback(), and BUTTON_USER.

Referenced by BSP_PB_Init().


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Exported Types

Enumerations
LOW LEVEL Exported Types
LOW LEVEL

Define for STM32H7XX_NUCLEO board. More...

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_BLUE = LED2,
LED3 = 2, LED_RED = LED3, LEDn
}
enum | Button_TypeDef { BUTTON_USER = 0U, BUTTONn }
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }

Detailed Description

Define for STM32H7XX_NUCLEO board.

Enumeration Type Documentation

enum Button_TypeDef
Enumerator:
BUTTON_USER
BUTTONn

Definition at line 98 of file stm32h7xx_nucleo.h.

enum ButtonMode_TypeDef
Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 104 of file stm32h7xx_nucleo.h.

enum Led_TypeDef
Enumerator:
LED1
LED_GREEN
LED2
LED_BLUE
LED3
LED_RED
LEDn

Definition at line 86 of file stm32h7xx_nucleo.h.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL LED

Defines
LOW LEVEL LED
LOW LEVEL Exported Constants

Defines

#define | LED1_PIN GPIO_PIN_0
#define | LED1_GPIO_PORT GPIOB
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED2_PIN GPIO_PIN_7
#define | LED2_GPIO_PORT GPIOB
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED3_PIN GPIO_PIN_14
#define | LED3_GPIO_PORT GPIOB
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()

Define Documentation

#define LED1_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 192 of file stm32h7xx_nucleo.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 191 of file stm32h7xx_nucleo.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT GPIOB

Definition at line 190 of file stm32h7xx_nucleo.h.

#define LED1_PIN GPIO_PIN_0

Definition at line 189 of file stm32h7xx_nucleo.h.

#define LED2_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 203 of file stm32h7xx_nucleo.h.

#define LED2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 202 of file stm32h7xx_nucleo.h.

Referenced by BSP_LED_Init().

#define LED2_GPIO_PORT GPIOB

Definition at line 201 of file stm32h7xx_nucleo.h.

#define LED2_PIN GPIO_PIN_7

Definition at line 200 of file stm32h7xx_nucleo.h.

#define LED3_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 209 of file stm32h7xx_nucleo.h.

#define LED3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 208 of file stm32h7xx_nucleo.h.

Referenced by BSP_LED_Init().

#define LED3_GPIO_PORT GPIOB

Definition at line 207 of file stm32h7xx_nucleo.h.

#define LED3_PIN GPIO_PIN_14

Definition at line 206 of file stm32h7xx_nucleo.h.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL BUTTON

Defines
LOW LEVEL BUTTON
LOW LEVEL Exported Constants

Defines

#define | BUTTON_RELEASED 0U
#define | BUTTON_PRESSED 1U
#define | BUTTON_USER_PIN GPIO_PIN_13
Key push-button.
#define | BUTTON_USER_GPIO_PORT GPIOC
#define | BUTTON_USER_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | BUTTON_USER_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | BUTTON_USER_EXTI_IRQn EXTI15_10_IRQn
#define | BUTTON_USER_EXTI_LINE EXTI_LINE_13

Define Documentation

#define BUTTON_PRESSED 1U

Definition at line 220 of file stm32h7xx_nucleo.h.

#define BUTTON_RELEASED 0U

Definition at line 219 of file stm32h7xx_nucleo.h.

#define BUTTON_USER_EXTI_IRQn EXTI15_10_IRQn

Definition at line 229 of file stm32h7xx_nucleo.h.

#define BUTTON_USER_EXTI_LINE EXTI_LINE_13

Definition at line 230 of file stm32h7xx_nucleo.h.

Referenced by BSP_PB_Init().

#define BUTTON_USER_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 228 of file stm32h7xx_nucleo.h.

#define BUTTON_USER_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 227 of file stm32h7xx_nucleo.h.

Referenced by BSP_PB_Init().

#define BUTTON_USER_GPIO_PORT GPIOC

Definition at line 226 of file stm32h7xx_nucleo.h.

#define BUTTON_USER_PIN GPIO_PIN_13

Key push-button.

Definition at line 225 of file stm32h7xx_nucleo.h.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL COM

LOW LEVEL COM
LOW LEVEL Exported Constants


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Exported Constants

Modules | Defines
LOW LEVEL Exported Constants
LOW LEVEL

Modules

LOW LEVEL LED
LOW LEVEL BUTTON
LOW LEVEL COM

Defines

#define | STM32H7XX_NUCLEO_BSP_VERSION_MAIN (0x01U)
STM32H7XX NUCLEO BSP Driver version number V1.0.0.
#define | STM32H7XX_NUCLEO_BSP_VERSION_SUB1 (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION_SUB2 (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION_RC (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION

Define Documentation

#define STM32H7XX_NUCLEO_BSP_VERSION
Value:
((STM32H7XX_NUCLEO_BSP_VERSION_MAIN << 24)\
                                            |(STM32H7XX_NUCLEO_BSP_VERSION_SUB1 << 16)\
                                            |(STM32H7XX_NUCLEO_BSP_VERSION_SUB2 << 8 )\
                                            |(STM32H7XX_NUCLEO_BSP_VERSION_RC))

Definition at line 181 of file stm32h7xx_nucleo.h.

Referenced by BSP_GetVersion().

#define STM32H7XX_NUCLEO_BSP_VERSION_MAIN (0x01U)

STM32H7XX NUCLEO BSP Driver version number V1.0.0.

[31:24] main version

Definition at line 177 of file stm32h7xx_nucleo.h.

#define STM32H7XX_NUCLEO_BSP_VERSION_RC (0x00U)

[7:0] release candidate

Definition at line 180 of file stm32h7xx_nucleo.h.

#define STM32H7XX_NUCLEO_BSP_VERSION_SUB1 (0x00U)

[23:16] sub1 version

Definition at line 178 of file stm32h7xx_nucleo.h.

#define STM32H7XX_NUCLEO_BSP_VERSION_SUB2 (0x00U)

[15:8] sub2 version

Definition at line 179 of file stm32h7xx_nucleo.h.


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL Exported Functions Prototypes

Functions
LOW LEVEL Exported Functions Prototypes
LOW LEVEL

Functions

int32_t | BSP_GetVersion (void)
This method returns the STM32H7XX NUCLEO BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
int32_t | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
int32_t | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
int32_t | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
int32_t | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
int32_t | BSP_LED_GetState (Led_TypeDef Led)
Get the state of the selected LED.
int32_t | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
int32_t | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
int32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
BSP Button IRQ handler.
void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.

Function Documentation

int32_t BSP_GetVersion ( void )

This method returns the STM32H7XX NUCLEO BSP Driver revision.

Return values:
version,: 0xXYZR (8bits for each decimal, R for RC)

Definition at line 116 of file stm32h7xx_nucleo.c.

References STM32H7XX_NUCLEO_BSP_VERSION.

int32_t BSP_LED_DeInit ( Led_TypeDef Led )

DeInit LEDs.

Parameters:
Led LED to be de-init. This parameter can be one of the following values:
  • LED1
  • LED2
  • LED3
Note:
Led DeInit does not disable the GPIO clock nor disable the Mfx
Return values:
BSP status

Definition at line 177 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_GetState ( Led_TypeDef Led )

Get the state of the selected LED.

Parameters:
Led LED to get its state This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
LED status

Definition at line 282 of file stm32h7xx_nucleo.c.

References BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

Parameters:
Led Specifies the Led to be configured. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 130 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED1_GPIO_CLK_ENABLE, LED2, LED2_GPIO_CLK_ENABLE, LED3, LED3_GPIO_CLK_ENABLE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

Parameters:
Led,: Specifies the Led to be set off. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 232 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

Parameters:
Led Specifies the Led to be set on. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 207 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

int32_t BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

Parameters:
Led Specifies the Led to be toggled. This parameter can be one of following parameters:
  • LED1
  • LED2
  • LED3
Return values:
BSP status

Definition at line 257 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LED1, LED2, LED3, LED_PIN, and LED_PORT.

void BSP_PB_Callback ( Button_TypeDef Button )

BSP Push Button callback.

Parameters:
Button Specifies the pin connected EXTI line
Return values:
None

Definition at line 392 of file stm32h7xx_nucleo.c.

Referenced by BUTTON_USER_EXTI_Callback().

int32_t BSP_PB_DeInit ( Button_TypeDef Button )

Push Button DeInit.

Parameters:
Button Button to be configured This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
Note:
PB DeInit does not disable the GPIO clock

Definition at line 354 of file stm32h7xx_nucleo.c.

References BSP_ERROR_NONE, BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

int32_t BSP_PB_GetState ( Button_TypeDef Button )

Returns the selected button state.

Parameters:
Button Button to be checked This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
Return values:
The Button GPIO pin value (GPIO_PIN_RESET = button pressed)

Definition at line 372 of file stm32h7xx_nucleo.c.

References BUTTON_PIN, and BUTTON_PORT.

int32_t BSP_PB_Init | ( | Button_TypeDef | Button,
 |  | ButtonMode_TypeDef | ButtonMode
 | ) |  |

Configures button GPIO and EXTI Line.

Parameters:
Button Button to be configured This parameter can be one of the following values:
  • BUTTON_USER: Wakeup Push Button
ButtonMode Button mode This parameter can be one of the following values:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability

Definition at line 309 of file stm32h7xx_nucleo.c.

References BSP_BUTTON_USER_IT_PRIORITY, BSP_ERROR_NONE, BUTTON_IRQn, BUTTON_MODE_GPIO, BUTTON_PIN, BUTTON_PORT, BUTTON_USER_EXTI_Callback(), BUTTON_USER_EXTI_LINE, BUTTON_USER_GPIO_CLK_ENABLE, BUTTONn, and hpb_exti.

void BSP_PB_IRQHandler ( Button_TypeDef Button )

BSP Button IRQ handler.

Parameters:
Button Can only be BUTTON_USER
Return values:
None

Definition at line 382 of file stm32h7xx_nucleo.c.

References hpb_exti.


STM32H7xx_Nucleo BSP User Manual: Exported Constants

Defines
Exported Constants
Config

Defines

#define | USE_NUCLEO_144
#define | USE_NUCLEO_H7A3ZI_Q
#define | USE_COM_LOG 0U
#define | USE_BSP_COM_FEATURE 0U
#define | BSP_BUTTON_USER_IT_PRIORITY 15U
#define | BUS_SPI1_BAUDRATE 18000000

Define Documentation

#define BSP_BUTTON_USER_IT_PRIORITY 15U

Definition at line 55 of file stm32h7xx_nucleo_conf_template.h.

Referenced by BSP_PB_Init().

#define BUS_SPI1_BAUDRATE 18000000

Definition at line 57 of file stm32h7xx_nucleo_conf_template.h.

#define USE_BSP_COM_FEATURE 0U

Definition at line 52 of file stm32h7xx_nucleo_conf_template.h.

#define USE_COM_LOG 0U

Definition at line 51 of file stm32h7xx_nucleo_conf_template.h.

#define USE_NUCLEO_144

Definition at line 47 of file stm32h7xx_nucleo_conf_template.h.

#define USE_NUCLEO_H7A3ZI_Q

Definition at line 48 of file stm32h7xx_nucleo_conf_template.h.


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo_errno.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
Defines
stm32h7xx_nucleo_errno.h File Reference

Error Code. More...

Go to the source code of this file.

Defines

#define | BSP_ERROR_NONE 0
#define | BSP_ERROR_NO_INIT -1
#define | BSP_ERROR_WRONG_PARAM -2
#define | BSP_ERROR_BUSY -3
#define | BSP_ERROR_PERIPH_FAILURE -4
#define | BSP_ERROR_COMPONENT_FAILURE -5
#define | BSP_ERROR_UNKNOWN_FAILURE -6
#define | BSP_ERROR_UNKNOWN_COMPONENT -7
#define | BSP_ERROR_BUS_FAILURE -8
#define | BSP_ERROR_CLOCK_FAILURE -9
#define | BSP_ERROR_MSP_FAILURE -10
#define | BSP_ERROR_FEATURE_NOT_SUPPORTED -11

Detailed Description

Error Code.

Author:
MCD Application Team
Attention:

© Copyright (c) 2019 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

Definition in file stm32h7xx_nucleo_errno.h.

Define Documentation

#define BSP_ERROR_BUS_FAILURE -8

Definition at line 37 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_BUSY -3

Definition at line 32 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_CLOCK_FAILURE -9

Definition at line 38 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_COMPONENT_FAILURE -5

Definition at line 34 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_FEATURE_NOT_SUPPORTED -11

Definition at line 40 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_MSP_FAILURE -10

Definition at line 39 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_NO_INIT -1

Definition at line 30 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_NONE 0

Definition at line 29 of file stm32h7xx_nucleo_errno.h.

Referenced by BSP_LED_DeInit(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), BSP_LED_Toggle(), BSP_PB_DeInit(), and BSP_PB_Init().

#define BSP_ERROR_PERIPH_FAILURE -4

Definition at line 33 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_UNKNOWN_COMPONENT -7

Definition at line 36 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_UNKNOWN_FAILURE -6

Definition at line 35 of file stm32h7xx_nucleo_errno.h.

#define BSP_ERROR_WRONG_PARAM -2

Definition at line 31 of file stm32h7xx_nucleo_errno.h.

Referenced by BSP_LED_DeInit(), BSP_LED_GetState(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and BSP_LED_Toggle().


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • h
  • l
  • s
  • u
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • BSP_BUTTON_USER_IT_PRIORITY : stm32h7xx_nucleo_conf_template.h
  • BSP_ERROR_BUS_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_BUSY : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_CLOCK_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_COMPONENT_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_FEATURE_NOT_SUPPORTED : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_MSP_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_NO_INIT : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_NONE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_PERIPH_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_UNKNOWN_COMPONENT : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_UNKNOWN_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_WRONG_PARAM : stm32h7xx_nucleo_errno.h
  • BSP_EXTI_LineCallback : stm32h7xx_nucleo.c
  • BSP_GetVersion() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_LED_DeInit() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_GetState() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_Init() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_Off() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_On() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_Toggle() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_Callback() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_DeInit() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_PB_GetState() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_Init() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_IRQHandler() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BUS_SPI1_BAUDRATE : stm32h7xx_nucleo_conf_template.h
  • BUTTON_IRQn : stm32h7xx_nucleo.c
  • BUTTON_MODE_EXTI : stm32h7xx_nucleo.h
  • BUTTON_MODE_GPIO : stm32h7xx_nucleo.h
  • BUTTON_PIN : stm32h7xx_nucleo.c
  • BUTTON_PORT : stm32h7xx_nucleo.c
  • BUTTON_PRESSED : stm32h7xx_nucleo.h
  • BUTTON_RELEASED : stm32h7xx_nucleo.h
  • Button_TypeDef : stm32h7xx_nucleo.h
  • BUTTON_USER : stm32h7xx_nucleo.h
  • BUTTON_USER_EXTI_Callback() : stm32h7xx_nucleo.c
  • BUTTON_USER_EXTI_IRQn : stm32h7xx_nucleo.h
  • BUTTON_USER_EXTI_LINE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_PORT : stm32h7xx_nucleo.h
  • BUTTON_USER_PIN : stm32h7xx_nucleo.h
  • ButtonMode_TypeDef : stm32h7xx_nucleo.h
  • BUTTONn : stm32h7xx_nucleo.h

- h -

  • hpb_exti : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h

- l -

  • LED1 : stm32h7xx_nucleo.h
  • LED1_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED1_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED1_GPIO_PORT : stm32h7xx_nucleo.h
  • LED1_PIN : stm32h7xx_nucleo.h
  • LED2 : stm32h7xx_nucleo.h
  • LED2_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED2_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED2_GPIO_PORT : stm32h7xx_nucleo.h
  • LED2_PIN : stm32h7xx_nucleo.h
  • LED3 : stm32h7xx_nucleo.h
  • LED3_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED3_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED3_GPIO_PORT : stm32h7xx_nucleo.h
  • LED3_PIN : stm32h7xx_nucleo.h
  • LED_BLUE : stm32h7xx_nucleo.h
  • LED_GREEN : stm32h7xx_nucleo.h
  • LED_PIN : stm32h7xx_nucleo.c
  • LED_PORT : stm32h7xx_nucleo.c
  • LED_RED : stm32h7xx_nucleo.h
  • Led_TypeDef : stm32h7xx_nucleo.h
  • LEDn : stm32h7xx_nucleo.h

- s -

  • STM32H7XX_NUCLEO_BSP_VERSION : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_MAIN : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_RC : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_SUB1 : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_SUB2 : stm32h7xx_nucleo.h

- u -

  • USE_BSP_COM_FEATURE : stm32h7xx_nucleo_conf_template.h
  • USE_COM_LOG : stm32h7xx_nucleo_conf_template.h
  • USE_NUCLEO_144 : stm32h7xx_nucleo_conf_template.h
  • USE_NUCLEO_H7A3ZI_Q : stm32h7xx_nucleo_conf_template.h


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_GetVersion() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_DeInit() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_LED_GetState() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_Init() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_LED_Off() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_On() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_LED_Toggle() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_Callback() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_PB_DeInit() : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • BSP_PB_GetState() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_PB_Init() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BSP_PB_IRQHandler() : stm32h7xx_nucleo.h , stm32h7xx_nucleo.c
  • BUTTON_USER_EXTI_Callback() : stm32h7xx_nucleo.c


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BUTTON_IRQn : stm32h7xx_nucleo.c
  • BUTTON_PIN : stm32h7xx_nucleo.c
  • BUTTON_PORT : stm32h7xx_nucleo.c
  • hpb_exti : stm32h7xx_nucleo.c , stm32h7xx_nucleo.h
  • LED_PIN : stm32h7xx_nucleo.c
  • LED_PORT : stm32h7xx_nucleo.c


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_EXTI_LineCallback : stm32h7xx_nucleo.c


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Button_TypeDef : stm32h7xx_nucleo.h
  • ButtonMode_TypeDef : stm32h7xx_nucleo.h
  • Led_TypeDef : stm32h7xx_nucleo.h


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BUTTON_MODE_EXTI : stm32h7xx_nucleo.h
  • BUTTON_MODE_GPIO : stm32h7xx_nucleo.h
  • BUTTON_USER : stm32h7xx_nucleo.h
  • BUTTONn : stm32h7xx_nucleo.h
  • LED1 : stm32h7xx_nucleo.h
  • LED2 : stm32h7xx_nucleo.h
  • LED3 : stm32h7xx_nucleo.h
  • LED_BLUE : stm32h7xx_nucleo.h
  • LED_GREEN : stm32h7xx_nucleo.h
  • LED_RED : stm32h7xx_nucleo.h
  • LEDn : stm32h7xx_nucleo.h


STM32H7xx_Nucleo BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • l
  • s
  • u

- b -

  • BSP_BUTTON_USER_IT_PRIORITY : stm32h7xx_nucleo_conf_template.h
  • BSP_ERROR_BUS_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_BUSY : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_CLOCK_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_COMPONENT_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_FEATURE_NOT_SUPPORTED : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_MSP_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_NO_INIT : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_NONE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_PERIPH_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_UNKNOWN_COMPONENT : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_UNKNOWN_FAILURE : stm32h7xx_nucleo_errno.h
  • BSP_ERROR_WRONG_PARAM : stm32h7xx_nucleo_errno.h
  • BUS_SPI1_BAUDRATE : stm32h7xx_nucleo_conf_template.h
  • BUTTON_PRESSED : stm32h7xx_nucleo.h
  • BUTTON_RELEASED : stm32h7xx_nucleo.h
  • BUTTON_USER_EXTI_IRQn : stm32h7xx_nucleo.h
  • BUTTON_USER_EXTI_LINE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • BUTTON_USER_GPIO_PORT : stm32h7xx_nucleo.h
  • BUTTON_USER_PIN : stm32h7xx_nucleo.h

- l -

  • LED1_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED1_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED1_GPIO_PORT : stm32h7xx_nucleo.h
  • LED1_PIN : stm32h7xx_nucleo.h
  • LED2_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED2_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED2_GPIO_PORT : stm32h7xx_nucleo.h
  • LED2_PIN : stm32h7xx_nucleo.h
  • LED3_GPIO_CLK_DISABLE : stm32h7xx_nucleo.h
  • LED3_GPIO_CLK_ENABLE : stm32h7xx_nucleo.h
  • LED3_GPIO_PORT : stm32h7xx_nucleo.h
  • LED3_PIN : stm32h7xx_nucleo.h

- s -

  • STM32H7XX_NUCLEO_BSP_VERSION : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_MAIN : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_RC : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_SUB1 : stm32h7xx_nucleo.h
  • STM32H7XX_NUCLEO_BSP_VERSION_SUB2 : stm32h7xx_nucleo.h

- u -

  • USE_BSP_COM_FEATURE : stm32h7xx_nucleo_conf_template.h
  • USE_COM_LOG : stm32h7xx_nucleo_conf_template.h
  • USE_NUCLEO_144 : stm32h7xx_nucleo_conf_template.h
  • USE_NUCLEO_H7A3ZI_Q : stm32h7xx_nucleo_conf_template.h


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
Typedefs | Functions | Variables
stm32h7xx_nucleo.c File Reference

This file provides set of firmware functions to manage: More...

#include "stm32h7xx_nucleo.h"

Go to the source code of this file.

Typedefs

typedef void(* | BSP_EXTI_LineCallback )(void)

Functions

static void | BUTTON_USER_EXTI_Callback (void)
Key EXTI line detection callbacks.
int32_t | BSP_GetVersion (void)
This method returns the STM32H7XX NUCLEO BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
int32_t | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
int32_t | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
int32_t | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
int32_t | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
int32_t | BSP_LED_GetState (Led_TypeDef Led)
Get the state of the selected LED.
int32_t | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
int32_t | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
int32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
BSP Button IRQ handler.
__weak void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.

Variables

EXTI_HandleTypeDef | hpb_exti [BUTTONn]
static GPIO_TypeDef * | LED_PORT [LEDn]
static const uint16_t | LED_PIN [LEDn]
static GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {BUTTON_USER_GPIO_PORT}
static const uint16_t | BUTTON_PIN [BUTTONn] = {BUTTON_USER_PIN}
static const IRQn_Type | BUTTON_IRQn [BUTTONn] = {BUTTON_USER_EXTI_IRQn}

Detailed Description

This file provides set of firmware functions to manage:

Author:
MCD Application Team
  • LEDs and push-button available on STM32H7xx-Nucleo Kit from STMicroelectronics
Attention:

© Copyright (c) 2018 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

Definition in file stm32h7xx_nucleo.c.


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
Defines | Enumerations | Functions | Variables
stm32h7xx_nucleo.h File Reference

This file contains definitions for: More...

#include "stm32h7xx_nucleo_conf.h"
#include "stm32h7xx_nucleo_errno.h"

Go to the source code of this file.

Defines

#define | STM32H7XX_NUCLEO_BSP_VERSION_MAIN (0x01U)
STM32H7XX NUCLEO BSP Driver version number V1.0.0.
#define | STM32H7XX_NUCLEO_BSP_VERSION_SUB1 (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION_SUB2 (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION_RC (0x00U)
#define | STM32H7XX_NUCLEO_BSP_VERSION
#define | LED1_PIN GPIO_PIN_0
#define | LED1_GPIO_PORT GPIOB
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED2_PIN GPIO_PIN_7
#define | LED2_GPIO_PORT GPIOB
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED3_PIN GPIO_PIN_14
#define | LED3_GPIO_PORT GPIOB
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | BUTTON_RELEASED 0U
#define | BUTTON_PRESSED 1U
#define | BUTTON_USER_PIN GPIO_PIN_13
Key push-button.
#define | BUTTON_USER_GPIO_PORT GPIOC
#define | BUTTON_USER_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | BUTTON_USER_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | BUTTON_USER_EXTI_IRQn EXTI15_10_IRQn
#define | BUTTON_USER_EXTI_LINE EXTI_LINE_13

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_BLUE = LED2,
LED3 = 2, LED_RED = LED3, LEDn
}
enum | Button_TypeDef { BUTTON_USER = 0U, BUTTONn }
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }

Functions

int32_t | BSP_GetVersion (void)
This method returns the STM32H7XX NUCLEO BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
int32_t | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
int32_t | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
int32_t | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
int32_t | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
int32_t | BSP_LED_GetState (Led_TypeDef Led)
Get the state of the selected LED.
int32_t | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures button GPIO and EXTI Line.
int32_t | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
int32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
BSP Button IRQ handler.
void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.

Variables

EXTI_HandleTypeDef | hpb_exti []

Detailed Description

This file contains definitions for:

Author:
MCD Application Team
  • LEDs and push-button available on STM32H7xx-Nucleo Kit from STMicroelectronics
Attention:

© Copyright (c) 2019 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

Definition in file stm32h7xx_nucleo.h.


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo_conf_template.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
Defines
stm32h7xx_nucleo_conf_template.h File Reference
#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define | USE_NUCLEO_144
#define | USE_NUCLEO_H7A3ZI_Q
#define | USE_COM_LOG 0U
#define | USE_BSP_COM_FEATURE 0U
#define | BSP_BUTTON_USER_IT_PRIORITY 15U
#define | BUS_SPI1_BAUDRATE 18000000


STM32H7xx_Nucleo BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/ Directory Reference

  • Firmware
  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32H7xx_Nucleo


STM32H7xx_Nucleo BSP User Manual: C:/git/h7_master/Firmware/ Directory Reference

  • Firmware
Firmware Directory Reference

Directories

directory Drivers


STM32H7xx_Nucleo BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/STM32H7xx_Nucleo/ Directory Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
STM32H7xx_Nucleo Directory Reference

Files

file | stm32h7xx_nucleo.c [code]

This file provides set of firmware functions to manage:

file | stm32h7xx_nucleo.h [code]

This file contains definitions for:

file | stm32h7xx_nucleo_conf_template.h [code]
file | stm32h7xx_nucleo_errno.h [code]

Error Code.


STM32H7xx_Nucleo BSP User Manual: C:/git/h7_master/Firmware/Drivers/ Directory Reference

  • Firmware
  • Drivers
Drivers Directory Reference

Directories

directory BSP


STM32H7xx_Nucleo BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Firmware
    • Drivers
      • BSP
        • STM32H7xx_Nucleo


STM32H7xx_Nucleo BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32h7xx_nucleo.c [code] | This file provides set of firmware functions to manage:
stm32h7xx_nucleo.h [code] | This file contains definitions for:
stm32h7xx_nucleo_conf_template.h [code] |
stm32h7xx_nucleo_errno.h [code] | Error Code


STM32H7xx_Nucleo BSP User Manual: BSP

Modules
BSP

Modules

STM32H7XX_NUCLEO


STM32H7xx_Nucleo BSP User Manual: STM32H7XX_NUCLEO

Modules
STM32H7XX_NUCLEO
BSP

Modules

LOW LEVEL

This file provides set of firmware functions to manage Leds and push-button available on STM32H7xx-Nucleo Kit from STMicroelectronics.

Config


STM32H7xx_Nucleo BSP User Manual: Config

Modules
Config
STM32H7XX_NUCLEO

Modules

Exported Constants


STM32H7xx_Nucleo BSP User Manual: LOW LEVEL

Modules
LOW LEVEL
STM32H7XX_NUCLEO

This file provides set of firmware functions to manage Leds and push-button available on STM32H7xx-Nucleo Kit from STMicroelectronics. More...

Modules

LOW LEVEL Private Defines
LOW LEVEL Private Typedef
LOW LEVEL Exported Variables
LOW LEVEL Private Variables
LOW LEVEL Private functions Prototypes
LOW LEVEL Exported Functions
LOW LEVEL Private functions
LOW LEVEL Exported Types

Define for STM32H7XX_NUCLEO board.

LOW LEVEL Exported Constants
LOW LEVEL Exported Functions Prototypes

Detailed Description

This file provides set of firmware functions to manage Leds and push-button available on STM32H7xx-Nucleo Kit from STMicroelectronics.


STM32H7xx_Nucleo BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • STM32H7XX_NUCLEO
      • LOW LEVEL
        • LOW LEVEL Private Defines
        • LOW LEVEL Private Typedef
        • LOW LEVEL Exported Variables
        • LOW LEVEL Private Variables
        • LOW LEVEL Private functions Prototypes
        • LOW LEVEL Exported Functions
        • LOW LEVEL Private functions
        • LOW LEVEL Exported Types
        • LOW LEVEL Exported Constants
          • LOW LEVEL LED
          • LOW LEVEL BUTTON
          • LOW LEVEL COM
        • LOW LEVEL Exported Functions Prototypes
      • Config
        • Exported Constants


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
stm32h7xx_nucleo.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_nucleo.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides set of firmware functions to manage:
00006   *          - LEDs and push-button available on STM32H7xx-Nucleo Kit
00007   *            from STMicroelectronics
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00012   * All rights reserved.</center></h2>
00013   *
00014   * This software component is licensed by ST under BSD 3-Clause license,
00015   * the "License"; You may not use this file except in compliance with the
00016   * License. You may obtain a copy of the License at:
00017   *                        opensource.org/licenses/BSD-3-Clause
00018   *
00019   ******************************************************************************
00020   */
00021
00022 /* Includes ------------------------------------------------------------------*/
00023 #include "stm32h7xx_nucleo.h"
00024
00025 /** @addtogroup BSP
00026   * @{
00027   */
00028
00029 /** @addtogroup STM32H7XX_NUCLEO
00030   * @{
00031   */
00032
00033 /** @addtogroup STM32H7XX_NUCLEO_LOW_LEVEL
00034   * @brief This file provides set of firmware functions to manage Leds and push-button
00035   *        available on STM32H7xx-Nucleo Kit from STMicroelectronics.
00036   * @{
00037   */
00038
00039 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Private_Defines LOW LEVEL Private Defines
00040   * @{
00041   */
00042
00043 /**
00044   * @}
00045   */
00046
00047 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Private_TypesDefinitions LOW LEVEL Private Typedef
00048   * @{
00049   */
00050 typedef void (* BSP_EXTI_LineCallback) (void);
00051 /**
00052   * @}
00053   */
00054
00055 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_Variables LOW LEVEL Exported Variables
00056   * @{
00057   */
00058 EXTI_HandleTypeDef hpb_exti[BUTTONn];
00059 #if (USE_BSP_COM_FEATURE > 0)
00060 UART_HandleTypeDef hcom_uart[COMn];
00061 USART_TypeDef* COM_USART[COMn]   = {COM1_UART};
00062 #endif
00063 /**
00064   * @}
00065   */
00066 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Private_Variables LOW LEVEL Private Variables
00067   * @{
00068   */
00069 static GPIO_TypeDef* LED_PORT[LEDn] = {LED1_GPIO_PORT,
00070                                        LED2_GPIO_PORT,
00071                                        LED3_GPIO_PORT};
00072
00073 static const uint16_t LED_PIN[LEDn] = {LED1_PIN,
00074                                        LED2_PIN,
00075                                        LED3_PIN};
00076
00077 static GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {BUTTON_USER_GPIO_PORT};
00078 static const uint16_t BUTTON_PIN[BUTTONn] = {BUTTON_USER_PIN};
00079 static const IRQn_Type BUTTON_IRQn[BUTTONn] = {BUTTON_USER_EXTI_IRQn};
00080
00081
00082
00083 #if (USE_BSP_COM_FEATURE > 0)
00084   #if (USE_COM_LOG > 0)
00085      static COM_TypeDef COM_ActiveLogPort = COM1;
00086   #endif
00087   #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00088      static uint32_t IsComMspCbValid[COMn] = {0};
00089   #endif
00090 #endif
00091
00092 /**
00093   * @}
00094   */
00095
00096 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Private_FunctionPrototypes LOW LEVEL Private functions Prototypes
00097   * @{
00098   */
00099 static void BUTTON_USER_EXTI_Callback(void);
00100 #if (USE_BSP_COM_FEATURE > 0)
00101 static void COM1_MspInit(UART_HandleTypeDef *huart);
00102 static void COM1_MspDeInit(UART_HandleTypeDef *huart);
00103 #endif
00104 /**
00105   * @}
00106   */
00107
00108 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_Functions LOW LEVEL Exported Functions
00109   * @{
00110   */
00111
00112 /**
00113   * @brief  This method returns the STM32H7XX NUCLEO BSP Driver revision
00114   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00115   */
00116 int32_t BSP_GetVersion(void)
00117 {
00118   return (int32_t)STM32H7XX_NUCLEO_BSP_VERSION;
00119 }
00120
00121 /**
00122   * @brief  Configures LED GPIO.
00123   * @param  Led Specifies the Led to be configured.
00124   *   This parameter can be one of following parameters:
00125   *     @arg  LED1
00126   *     @arg  LED2
00127   *     @arg  LED3
00128   * @retval BSP status
00129   */
00130 int32_t BSP_LED_Init(Led_TypeDef Led)
00131 {
00132   int32_t ret = BSP_ERROR_NONE;
00133   GPIO_InitTypeDef  gpio_init_structure;
00134
00135   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00136   {
00137     ret = BSP_ERROR_WRONG_PARAM;
00138   }
00139   else
00140   {
00141     /* Enable the GPIO LED Clock */
00142     if(Led == LED1)
00143     {
00144       LED1_GPIO_CLK_ENABLE();
00145     }
00146     else if(Led == LED2)
00147     {
00148       LED2_GPIO_CLK_ENABLE();
00149     }
00150     else
00151     {
00152       LED3_GPIO_CLK_ENABLE();
00153     }
00154     /* Configure the GPIO_LED pin */
00155     gpio_init_structure.Pin   = LED_PIN[Led];
00156     gpio_init_structure.Mode  = GPIO_MODE_OUTPUT_PP;
00157     gpio_init_structure.Pull  = GPIO_NOPULL;
00158     gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00159
00160     HAL_GPIO_Init(LED_PORT[Led], &gpio_init_structure);
00161     HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
00162   }
00163
00164   return ret;
00165 }
00166
00167 /**
00168   * @brief  DeInit LEDs.
00169   * @param  Led LED to be de-init.
00170   *   This parameter can be one of the following values:
00171   *     @arg  LED1
00172   *     @arg  LED2
00173   *     @arg  LED3
00174   * @note Led DeInit does not disable the GPIO clock nor disable the Mfx
00175   * @retval BSP status
00176   */
00177 int32_t BSP_LED_DeInit(Led_TypeDef Led)
00178 {
00179   int32_t ret = BSP_ERROR_NONE;
00180   GPIO_InitTypeDef  gpio_init_structure;
00181
00182   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00183   {
00184     ret = BSP_ERROR_WRONG_PARAM;
00185   }
00186   else
00187   {
00188     /* Turn off LED */
00189     HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
00190     /* DeInit the GPIO_LED pin */
00191     gpio_init_structure.Pin = LED_PIN[Led];
00192     HAL_GPIO_DeInit(LED_PORT[Led], gpio_init_structure.Pin);
00193   }
00194
00195   return ret;
00196 }
00197
00198 /**
00199   * @brief  Turns selected LED On.
00200   * @param  Led Specifies the Led to be set on.
00201   *   This parameter can be one of following parameters:
00202   *     @arg  LED1
00203   *     @arg  LED2
00204   *     @arg  LED3
00205   * @retval BSP status
00206   */
00207 int32_t BSP_LED_On(Led_TypeDef Led)
00208 {
00209   int32_t ret = BSP_ERROR_NONE;
00210
00211   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00212   {
00213     ret = BSP_ERROR_WRONG_PARAM;
00214   }
00215   else
00216   {
00217     HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_SET);
00218   }
00219
00220   return ret;
00221 }
00222
00223 /**
00224   * @brief  Turns selected LED Off.
00225   * @param  Led: Specifies the Led to be set off.
00226   *   This parameter can be one of following parameters:
00227   *     @arg  LED1
00228   *     @arg  LED2
00229   *     @arg  LED3
00230   * @retval BSP status
00231   */
00232 int32_t BSP_LED_Off(Led_TypeDef Led)
00233 {
00234   int32_t ret = BSP_ERROR_NONE;
00235
00236   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00237   {
00238     ret = BSP_ERROR_WRONG_PARAM;
00239   }
00240   else
00241   {
00242     HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
00243   }
00244
00245   return ret;
00246 }
00247
00248 /**
00249   * @brief  Toggles the selected LED.
00250   * @param  Led Specifies the Led to be toggled.
00251   *   This parameter can be one of following parameters:
00252   *     @arg  LED1
00253   *     @arg  LED2
00254   *     @arg  LED3
00255   * @retval BSP status
00256   */
00257 int32_t BSP_LED_Toggle(Led_TypeDef Led)
00258 {
00259   int32_t ret = BSP_ERROR_NONE;
00260
00261   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00262   {
00263     ret = BSP_ERROR_WRONG_PARAM;
00264   }
00265   else
00266   {
00267     HAL_GPIO_TogglePin(LED_PORT[Led], LED_PIN[Led]);
00268   }
00269
00270   return ret;
00271 }
00272
00273 /**
00274   * @brief  Get the state of the selected LED.
00275   * @param  Led LED to get its state
00276   *   This parameter can be one of following parameters:
00277   *     @arg  LED1
00278   *     @arg  LED2
00279   *     @arg  LED3
00280   * @retval LED status
00281   */
00282 int32_t BSP_LED_GetState (Led_TypeDef Led)
00283 {
00284   int32_t ret;
00285
00286   if((Led != LED1) && (Led != LED2) && (Led != LED3))
00287   {
00288     ret = BSP_ERROR_WRONG_PARAM;
00289   }
00290   else
00291   {
00292     ret = (int32_t)HAL_GPIO_ReadPin (LED_PORT [Led], LED_PIN [Led]);
00293   }
00294
00295   return ret;
00296 }
00297
00298 /**
00299   * @brief  Configures button GPIO and EXTI Line.
00300   * @param  Button Button to be configured
00301   *          This parameter can be one of the following values:
00302   *            @arg  BUTTON_USER: Wakeup Push Button
00303   * @param  ButtonMode Button mode
00304   *          This parameter can be one of the following values:
00305   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00306   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00307   *                                    with interrupt generation capability
00308   */
00309 int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
00310 {
00311   GPIO_InitTypeDef gpio_init_structure;
00312   static BSP_EXTI_LineCallback ButtonCallback[BUTTONn] = {BUTTON_USER_EXTI_Callback};
00313   static uint32_t  BSP_BUTTON_PRIO [BUTTONn] = {BSP_BUTTON_USER_IT_PRIORITY};
00314   static const uint32_t BUTTON_EXTI_LINE[BUTTONn] = {BUTTON_USER_EXTI_LINE};
00315
00316   /* Enable the BUTTON clock */
00317   BUTTON_USER_GPIO_CLK_ENABLE();
00318
00319   gpio_init_structure.Pin = BUTTON_PIN [Button];
00320   gpio_init_structure.Pull = GPIO_PULLDOWN;
00321   gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00322
00323   if(ButtonMode == BUTTON_MODE_GPIO)
00324   {
00325     /* Configure Button pin as input */
00326     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00327     HAL_GPIO_Init(BUTTON_PORT [Button], &gpio_init_structure);
00328   }
00329   else /* (ButtonMode == BUTTON_MODE_EXTI) */
00330   {
00331     /* Configure Button pin as input with External interrupt */
00332     gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00333
00334     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00335
00336     (void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]);
00337     (void)HAL_EXTI_RegisterCallback(&hpb_exti[Button],  HAL_EXTI_COMMON_CB_ID, ButtonCallback[Button]);
00338
00339     /* Enable and set Button EXTI Interrupt to the lowest priority */
00340     HAL_NVIC_SetPriority((BUTTON_IRQn[Button]), BSP_BUTTON_PRIO[Button], 0x00);
00341     HAL_NVIC_EnableIRQ((BUTTON_IRQn[Button]));
00342   }
00343
00344   return BSP_ERROR_NONE;
00345 }
00346
00347 /**
00348   * @brief  Push Button DeInit.
00349   * @param  Button Button to be configured
00350   *          This parameter can be one of the following values:
00351   *            @arg  BUTTON_USER: Wakeup Push Button
00352   * @note PB DeInit does not disable the GPIO clock
00353   */
00354 int32_t BSP_PB_DeInit(Button_TypeDef Button)
00355 {
00356   GPIO_InitTypeDef gpio_init_structure;
00357
00358   gpio_init_structure.Pin = BUTTON_PIN[Button];
00359   HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00360   HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00361
00362   return BSP_ERROR_NONE;
00363 }
00364
00365 /**
00366   * @brief  Returns the selected button state.
00367   * @param  Button Button to be checked
00368   *          This parameter can be one of the following values:
00369   *            @arg  BUTTON_USER: Wakeup Push Button
00370   * @retval The Button GPIO pin value (GPIO_PIN_RESET = button pressed)
00371   */
00372 int32_t BSP_PB_GetState(Button_TypeDef Button)
00373 {
00374   return (int32_t)HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00375 }
00376
00377 /**
00378   * @brief  BSP Button IRQ handler
00379   * @param  Button Can only be BUTTON_USER
00380   * @retval None
00381   */
00382 void BSP_PB_IRQHandler(Button_TypeDef Button)
00383 {
00384   HAL_EXTI_IRQHandler(&hpb_exti[Button]);
00385 }
00386
00387 /**
00388   * @brief  BSP Push Button callback
00389   * @param  Button Specifies the pin connected EXTI line
00390   * @retval None
00391   */
00392 __weak void BSP_PB_Callback(Button_TypeDef Button)
00393 {
00394   /* Prevent unused argument(s) compilation warning */
00395   UNUSED(Button);
00396
00397   /* This function should be implemented by the user application.
00398      It is called into this driver when an event on Button is triggered. */
00399 }
00400
00401 #if (USE_BSP_COM_FEATURE > 0)
00402 /**
00403   * @brief  Configures COM port.
00404   * @param  COM COM port to be configured.
00405   *          This parameter can be COM1
00406   * @param  COM_Init Pointer to a UART_HandleTypeDef structure that contains the
00407   *                  configuration information for the specified USART peripheral.
00408   * @retval BSP error code
00409   */
00410 int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)
00411 {
00412   int32_t ret = BSP_ERROR_NONE;
00413
00414   if(COM >= COMn)
00415   {
00416     ret = BSP_ERROR_WRONG_PARAM;
00417   }
00418   else
00419   {
00420 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
00421     /* Init the UART Msp */
00422     COM1_MspInit(&hcom_uart[COM]);
00423 #else
00424     if(IsComMspCbValid[COM] == 0U)
00425     {
00426       if(BSP_COM_RegisterDefaultMspCallbacks(COM) != BSP_ERROR_NONE)
00427       {
00428         return BSP_ERROR_MSP_FAILURE;
00429       }
00430     }
00431 #endif
00432
00433     if(MX_USART3_Init(&hcom_uart[COM], COM_Init) != HAL_OK)
00434     {
00435       ret = BSP_ERROR_PERIPH_FAILURE;
00436     }
00437   }
00438
00439   return ret;
00440 }
00441
00442 /**
00443   * @brief  DeInit COM port.
00444   * @param  COM COM port to be configured.
00445   *          This parameter can be COM1
00446   * @retval BSP status
00447   */
00448 int32_t BSP_COM_DeInit(COM_TypeDef COM)
00449 {
00450   int32_t ret = BSP_ERROR_NONE;
00451
00452   if(COM >= COMn)
00453   {
00454     ret = BSP_ERROR_WRONG_PARAM;
00455   }
00456   else
00457   {
00458     /* USART configuration */
00459     hcom_uart[COM].Instance = COM_USART[COM];
00460
00461 #if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
00462     COM1_MspDeInit(&hcom_uart[COM]);
00463 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 0) */
00464
00465     if(HAL_UART_DeInit(&hcom_uart[COM]) != HAL_OK)
00466     {
00467       ret = BSP_ERROR_PERIPH_FAILURE;
00468     }
00469   }
00470
00471   return ret;
00472 }
00473
00474 /**
00475   * @brief  Configures COM port.
00476   * @param  huart USART handle
00477   * @param  COM_Init Pointer to a UART_HandleTypeDef structure that contains the
00478   *                  configuration information for the specified USART peripheral.
00479   * @retval HAL error code
00480   */
00481 __weak HAL_StatusTypeDef MX_USART3_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init)
00482 {
00483   /* USART configuration */
00484  huart->Instance          = COM_USART[COM1];
00485  huart->Init.BaudRate     = COM_Init->BaudRate;
00486  huart->Init.Mode         = UART_MODE_TX_RX;
00487  huart->Init.Parity       = (uint32_t)COM_Init->Parity;
00488  huart->Init.WordLength   = (uint32_t)COM_Init->WordLength;
00489  huart->Init.StopBits     = (uint32_t)COM_Init->StopBits;
00490  huart->Init.HwFlowCtl    = (uint32_t)COM_Init->HwFlowCtl;
00491  huart->Init.OverSampling = UART_OVERSAMPLING_8;
00492
00493  return HAL_UART_Init(huart);
00494 }
00495
00496 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00497 /**
00498   * @brief Register Default COM Msp Callbacks
00499   * @param  COM COM port to be configured.
00500   *          This parameter can be COM1
00501   * @retval BSP status
00502   */
00503 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM)
00504 {
00505   int32_t ret = BSP_ERROR_NONE;
00506
00507   if(COM >= COMn)
00508   {
00509     ret = BSP_ERROR_WRONG_PARAM;
00510   }
00511   else
00512   {
00513     __HAL_UART_RESET_HANDLE_STATE(&hcom_uart[COM]);
00514
00515     /* Register default MspInit/MspDeInit Callback */
00516     if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, COM1_MspInit) != HAL_OK)
00517     {
00518       ret = BSP_ERROR_PERIPH_FAILURE;
00519     }
00520     else if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, COM1_MspDeInit) != HAL_OK)
00521     {
00522       ret = BSP_ERROR_PERIPH_FAILURE;
00523     }
00524     else
00525     {
00526       IsComMspCbValid[COM] = 1U;
00527     }
00528   }
00529
00530   /* BSP status */
00531   return ret;
00532 }
00533
00534 /**
00535   * @brief Register COM Msp Callback registering
00536   * @param  COM COM port to be configured.
00537   *          This parameter can be COM1
00538   * @param Callbacks     pointer to COM1 MspInit/MspDeInit callback functions
00539   * @retval BSP status
00540   */
00541 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM , BSP_COM_Cb_t *Callback)
00542 {
00543   int32_t ret = BSP_ERROR_NONE;
00544
00545   if(COM >= COMn)
00546   {
00547     ret = BSP_ERROR_WRONG_PARAM;
00548   }
00549   else
00550   {
00551     __HAL_UART_RESET_HANDLE_STATE(&hcom_uart[COM]);
00552
00553     /* Register MspInit/MspDeInit Callbacks */
00554     if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, Callback->pMspInitCb) != HAL_OK)
00555     {
00556       ret = BSP_ERROR_PERIPH_FAILURE;
00557     }
00558     else if(HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, Callback->pMspDeInitCb) != HAL_OK)
00559     {
00560       ret = BSP_ERROR_PERIPH_FAILURE;
00561     }
00562     else
00563     {
00564       IsComMspCbValid[COM] = 1U;
00565     }
00566   }
00567   /* BSP status */
00568   return ret;
00569 }
00570 #endif /* USE_HAL_UART_REGISTER_CALLBACKS */
00571
00572 #if (USE_COM_LOG > 0)
00573 /**
00574   * @brief  Select the active COM port.
00575   * @param  COM COM port to be activated.
00576   *          This parameter can be COM1
00577   * @retval BSP status
00578   */
00579 int32_t BSP_COM_SelectLogPort(COM_TypeDef COM)
00580 {
00581   if(COM_ActiveLogPort != COM)
00582   {
00583     COM_ActiveLogPort = COM;
00584   }
00585   return BSP_ERROR_NONE;
00586 }
00587
00588 /**
00589   * @brief  Redirect console output to COM
00590   */
00591  #ifdef __GNUC__
00592  int __io_putchar (int ch)
00593  #else
00594  int fputc (int ch, FILE *f)
00595  #endif /* __GNUC__ */
00596 {
00597   HAL_UART_Transmit (&hcom_uart [COM_ActiveLogPort], (uint8_t *) &ch, 1, COM_POLL_TIMEOUT);
00598   return ch;
00599 }
00600 #endif /* USE_COM_LOG */
00601 #endif /* USE_BSP_COM_FEATURE */
00602
00603 /**
00604   * @}
00605   */
00606
00607 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Private_Functions LOW LEVEL Private functions
00608   * @{
00609   */
00610 /**
00611   * @brief  Key EXTI line detection callbacks.
00612   * @retval BSP status
00613   */
00614 static void BUTTON_USER_EXTI_Callback(void)
00615 {
00616   BSP_PB_Callback(BUTTON_USER);
00617 }
00618
00619 #if (USE_BSP_COM_FEATURE > 0)
00620 /**
00621   * @brief  Initializes UART MSP.
00622   * @param  huart UART handle
00623   * @retval BSP status
00624   */
00625 static void COM1_MspInit(UART_HandleTypeDef *huart)
00626 {
00627   GPIO_InitTypeDef gpio_init_structure;
00628
00629   /* Prevent unused argument(s) compilation warning */
00630   UNUSED(huart);
00631
00632   /* Enable GPIO clock */
00633   COM1_TX_GPIO_CLK_ENABLE();
00634   COM1_RX_GPIO_CLK_ENABLE();
00635
00636   /* Enable USART clock */
00637   COM1_CLK_ENABLE();
00638
00639   /* Configure USART Tx as alternate function */
00640   gpio_init_structure.Pin = COM1_TX_PIN;
00641   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00642   gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00643   gpio_init_structure.Pull = GPIO_PULLUP;
00644   gpio_init_structure.Alternate = COM1_TX_AF;
00645   HAL_GPIO_Init(COM1_TX_GPIO_PORT, &gpio_init_structure);
00646
00647   /* Configure USART Rx as alternate function */
00648   gpio_init_structure.Pin = COM1_RX_PIN;
00649   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00650   gpio_init_structure.Alternate = COM1_RX_AF;
00651   HAL_GPIO_Init(COM1_RX_GPIO_PORT, &gpio_init_structure);
00652 }
00653
00654 /**
00655   * @brief  Initialize USART3 Msp part
00656   * @param  huart UART handle
00657   * @retval BSP status
00658   */
00659 static void COM1_MspDeInit(UART_HandleTypeDef *huart)
00660 {
00661   GPIO_InitTypeDef          gpio_init_structure;
00662
00663   /* Prevent unused argument(s) compilation warning */
00664   UNUSED(huart);
00665
00666   /* COM GPIO pin configuration */
00667   gpio_init_structure.Pin  = COM1_TX_PIN;
00668   HAL_GPIO_DeInit(COM1_TX_GPIO_PORT, gpio_init_structure.Pin);
00669
00670   gpio_init_structure.Pin  = COM1_RX_PIN;
00671   HAL_GPIO_DeInit(COM1_RX_GPIO_PORT, gpio_init_structure.Pin);
00672
00673   /* Disable USART clock */
00674   COM1_CLK_DISABLE();
00675 }
00676 #endif /* USE_BSP_COM_FEATURE */
00677 /**
00678   * @}
00679   */
00680
00681 /**
00682   * @}
00683   */
00684
00685 /**
00686   * @}
00687   */
00688
00689 /**
00690   * @}
00691   */
00692
00693 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
stm32h7xx_nucleo.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_nucleo.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for:
00006   *          - LEDs and push-button available on STM32H7xx-Nucleo Kit
00007   *            from STMicroelectronics
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
00012   * All rights reserved.</center></h2>
00013   *
00014   * This software component is licensed by ST under BSD 3-Clause license,
00015   * the "License"; You may not use this file except in compliance with the
00016   * License. You may obtain a copy of the License at:
00017   *                        opensource.org/licenses/BSD-3-Clause
00018   *
00019   ******************************************************************************
00020   */
00021
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef STM32H7XX_NUCLEO_H
00024 #define STM32H7XX_NUCLEO_H
00025
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32h7xx_nucleo_conf.h"
00032 #include "stm32h7xx_nucleo_errno.h"
00033
00034 #if (USE_BSP_COM_FEATURE > 0)
00035   #if (USE_COM_LOG > 0)
00036     #ifndef __GNUC__
00037       #include <stdio.h>
00038     #endif
00039   #endif
00040 #endif
00041
00042 /** @addtogroup BSP
00043   * @{
00044   */
00045
00046 /** @defgroup STM32H7XX_NUCLEO STM32H7XX_NUCLEO
00047   * @{
00048   */
00049
00050 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL LOW LEVEL
00051   * @{
00052   */
00053
00054 /**
00055   * @brief Define for STM32H7XX_NUCLEO board
00056   */
00057 #if !defined (USE_STM32H7XX_NUCLEO)
00058  #define USE_STM32H7XX_NUCLEO
00059 #endif
00060
00061 #if !defined (USE_NUCLEO_144)
00062  #error "Board Pin number not defined!! Add USE_NUCLEO_144 define within stm32h7xx_nucleo_conf.h file"
00063 #endif
00064
00065 #if !defined (USE_NUCLEO_H745ZI_Q) && !defined (USE_NUCLEO_H743ZI) && !defined (USE_NUCLEO_H743ZI2) &&\
00066     !defined (USE_NUCLEO_H7A3ZI_Q)
00067  #error "Board Part number not defined!! Add one of the following define within stm32h7xx_nucleo_conf.h file:\
00068          USE_NUCLEO_H745ZI_Q, USE_NUCLEO_H743ZI, USE_NUCLEO_H743ZI2, USE_NUCLEO_H7A3ZI_Q"
00069 #endif
00070
00071 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_Types LOW LEVEL Exported Types
00072   * @{
00073   */
00074 #if defined (USE_NUCLEO_H745ZI_Q) || defined (USE_NUCLEO_H743ZI2) || defined (USE_NUCLEO_H7A3ZI_Q)
00075 typedef enum
00076 {
00077   LED1 = 0,
00078   LED_GREEN = LED1,
00079   LED2 = 1,
00080   LED_YELLOW = LED2,
00081   LED3 = 2,
00082   LED_RED = LED3,
00083   LEDn
00084 }Led_TypeDef;
00085 #else /* USE_NUCLEO_H743ZI */
00086 typedef enum
00087 {
00088   LED1 = 0,
00089   LED_GREEN = LED1,
00090   LED2 = 1,
00091   LED_BLUE = LED2,
00092   LED3 = 2,
00093   LED_RED = LED3,
00094   LEDn
00095 }Led_TypeDef;
00096 #endif
00097
00098 typedef enum
00099 {
00100   BUTTON_USER = 0U,
00101   BUTTONn
00102 }Button_TypeDef;
00103
00104 typedef enum
00105 {
00106   BUTTON_MODE_GPIO = 0,
00107   BUTTON_MODE_EXTI = 1
00108 }ButtonMode_TypeDef;
00109
00110 #if (USE_BSP_COM_FEATURE > 0)
00111 typedef enum
00112 {
00113   COM1 = 0U,
00114   COMn
00115 }COM_TypeDef;
00116
00117 typedef enum
00118 {
00119  COM_STOPBITS_1     =   UART_STOPBITS_1,
00120  COM_STOPBITS_2     =   UART_STOPBITS_2,
00121 }COM_StopBitsTypeDef;
00122
00123 typedef enum
00124 {
00125  COM_PARITY_NONE     =  UART_PARITY_NONE,
00126  COM_PARITY_EVEN     =  UART_PARITY_EVEN,
00127  COM_PARITY_ODD      =  UART_PARITY_ODD,
00128 }COM_ParityTypeDef;
00129
00130 typedef enum
00131 {
00132  COM_HWCONTROL_NONE    =  UART_HWCONTROL_NONE,
00133  COM_HWCONTROL_RTS     =  UART_HWCONTROL_RTS,
00134  COM_HWCONTROL_CTS     =  UART_HWCONTROL_CTS,
00135  COM_HWCONTROL_RTS_CTS =  UART_HWCONTROL_RTS_CTS,
00136 }COM_HwFlowCtlTypeDef;
00137
00138 typedef enum
00139 {
00140   COM_WORDLENGTH_7B = UART_WORDLENGTH_7B,
00141   COM_WORDLENGTH_8B = UART_WORDLENGTH_8B,
00142   COM_WORDLENGTH_9B = UART_WORDLENGTH_9B,
00143 }COM_WordLengthTypeDef;
00144
00145 typedef struct
00146 {
00147   uint32_t               BaudRate;
00148   COM_WordLengthTypeDef  WordLength;
00149   COM_StopBitsTypeDef    StopBits;
00150   COM_ParityTypeDef      Parity;
00151   COM_HwFlowCtlTypeDef   HwFlowCtl;
00152 }COM_InitTypeDef;
00153
00154 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00155 typedef struct
00156 {
00157   void (* pMspInitCb)(UART_HandleTypeDef *);
00158   void (* pMspDeInitCb)(UART_HandleTypeDef *);
00159 }BSP_COM_Cb_t;
00160 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 1) */
00161
00162 #define MX_UART_InitTypeDef COM_InitTypeDef
00163
00164 #endif
00165
00166 /**
00167   * @}
00168   */
00169
00170 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants
00171   * @{
00172   */
00173
00174 /**
00175   * @brief STM32H7XX NUCLEO BSP Driver version number V1.0.0
00176   */
00177 #define STM32H7XX_NUCLEO_BSP_VERSION_MAIN   (0x01U) /*!< [31:24] main version */
00178 #define STM32H7XX_NUCLEO_BSP_VERSION_SUB1   (0x00U) /*!< [23:16] sub1 version */
00179 #define STM32H7XX_NUCLEO_BSP_VERSION_SUB2   (0x00U) /*!< [15:8]  sub2 version */
00180 #define STM32H7XX_NUCLEO_BSP_VERSION_RC     (0x00U) /*!< [7:0]  release candidate */
00181 #define STM32H7XX_NUCLEO_BSP_VERSION        ((STM32H7XX_NUCLEO_BSP_VERSION_MAIN << 24)\
00182                                             |(STM32H7XX_NUCLEO_BSP_VERSION_SUB1 << 16)\
00183                                             |(STM32H7XX_NUCLEO_BSP_VERSION_SUB2 << 8 )\
00184                                             |(STM32H7XX_NUCLEO_BSP_VERSION_RC))
00185
00186 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_LED LOW LEVEL LED
00187   * @{
00188   */
00189 #define LED1_PIN                                GPIO_PIN_0
00190 #define LED1_GPIO_PORT                          GPIOB
00191 #define LED1_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOB_CLK_ENABLE()
00192 #define LED1_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOB_CLK_DISABLE()
00193
00194 #if defined (USE_NUCLEO_H745ZI_Q) || defined (USE_NUCLEO_H743ZI2) || defined (USE_NUCLEO_H7A3ZI_Q)
00195 #define LED2_PIN                                GPIO_PIN_1
00196 #define LED2_GPIO_PORT                          GPIOE
00197 #define LED2_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOE_CLK_ENABLE()
00198 #define LED2_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOE_CLK_DISABLE()
00199 #else /* USE_NUCLEO_H743ZI */
00200 #define LED2_PIN                                GPIO_PIN_7
00201 #define LED2_GPIO_PORT                          GPIOB
00202 #define LED2_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOB_CLK_ENABLE()
00203 #define LED2_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOB_CLK_DISABLE()
00204 #endif
00205
00206 #define LED3_PIN                                GPIO_PIN_14
00207 #define LED3_GPIO_PORT                          GPIOB
00208 #define LED3_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOB_CLK_ENABLE()
00209 #define LED3_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOB_CLK_DISABLE()
00210
00211 /**
00212   * @}
00213   */
00214
00215 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_BUTTON LOW LEVEL BUTTON
00216   * @{
00217   */
00218 /* Button state */
00219 #define BUTTON_RELEASED                    0U
00220 #define BUTTON_PRESSED                     1U
00221
00222 /**
00223  * @brief Key push-button
00224  */
00225 #define BUTTON_USER_PIN                       GPIO_PIN_13
00226 #define BUTTON_USER_GPIO_PORT                 GPIOC
00227 #define BUTTON_USER_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00228 #define BUTTON_USER_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00229 #define BUTTON_USER_EXTI_IRQn                 EXTI15_10_IRQn
00230 #define BUTTON_USER_EXTI_LINE                 EXTI_LINE_13
00231
00232 /**
00233   * @}
00234   */
00235
00236 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_COM LOW LEVEL COM
00237   * @{
00238   */
00239 /**
00240  * @brief Definition for COM port1, connected to USART3
00241  */
00242 #if (USE_BSP_COM_FEATURE > 0)
00243 #define COM1_UART                     USART3
00244 #define COM1_CLK_ENABLE()             __HAL_RCC_USART3_CLK_ENABLE()
00245 #define COM1_CLK_DISABLE()            __HAL_RCC_USART3_CLK_DISABLE()
00246
00247 #define COM1_TX_PIN                   GPIO_PIN_8
00248 #define COM1_TX_GPIO_PORT             GPIOD
00249 #define COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00250 #define COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00251 #define COM1_TX_AF                    GPIO_AF7_USART3
00252
00253 #define COM1_RX_PIN                   GPIO_PIN_9
00254 #define COM1_RX_GPIO_PORT             GPIOD
00255 #define COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00256 #define COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00257 #define COM1_RX_AF                    GPIO_AF7_USART3
00258 #define COM_POLL_TIMEOUT             1000
00259 #endif
00260
00261 /**
00262   * @}
00263   */
00264
00265 /**
00266   * @}
00267   */
00268
00269 /** @addtogroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_Variables
00270   * @{
00271   */
00272 extern EXTI_HandleTypeDef hpb_exti[];
00273 #if (USE_BSP_COM_FEATURE > 0)
00274 extern UART_HandleTypeDef hcom_uart[];
00275 extern USART_TypeDef* COM_USART[];
00276 #endif
00277
00278 /**
00279   * @}
00280   */
00281
00282 /** @defgroup STM32H7XX_NUCLEO_LOW_LEVEL_Exported_FunctionsPrototypes LOW LEVEL Exported Functions Prototypes
00283   * @{
00284   */
00285 int32_t  BSP_GetVersion(void);
00286 int32_t  BSP_LED_Init(Led_TypeDef Led);
00287 int32_t  BSP_LED_DeInit(Led_TypeDef Led);
00288 int32_t  BSP_LED_On(Led_TypeDef Led);
00289 int32_t  BSP_LED_Off(Led_TypeDef Led);
00290 int32_t  BSP_LED_Toggle(Led_TypeDef Led);
00291 int32_t  BSP_LED_GetState (Led_TypeDef Led);
00292 int32_t  BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00293 int32_t  BSP_PB_DeInit(Button_TypeDef Button);
00294 int32_t  BSP_PB_GetState(Button_TypeDef Button);
00295 void     BSP_PB_IRQHandler(Button_TypeDef Button);
00296 void     BSP_PB_Callback(Button_TypeDef Button);
00297
00298 #if (USE_BSP_COM_FEATURE > 0)
00299 int32_t  BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init);
00300 int32_t  BSP_COM_DeInit(COM_TypeDef COM);
00301 #if (USE_COM_LOG > 0)
00302 int32_t  BSP_COM_SelectLogPort (COM_TypeDef COM);
00303 #endif
00304
00305 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00306 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM);
00307 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM , BSP_COM_Cb_t *Callback);
00308 #endif /* USE_HAL_UART_REGISTER_CALLBACKS */
00309 HAL_StatusTypeDef MX_USART3_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init);
00310 #endif /* USE_BSP_COM_FEATURE */
00311
00312 /**
00313   * @}
00314   */
00315
00316 /**
00317   * @}
00318   */
00319
00320 /**
00321   * @}
00322   */
00323
00324 /**
00325   * @}
00326   */
00327
00328 #ifdef __cplusplus
00329 }
00330 #endif
00331
00332 #endif /* STM32H7XX_NUCLEO_H */
00333
00334 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo_conf_template.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
stm32h7xx_nucleo_conf_template.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_nucleo_conf.h
00004   * @author  MCD Application Team
00005   * @brief   STM32H7xx_Nuleo board configuration file.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H7XX_NUCLEO_CONF_H
00022 #define STM32H7XX_NUCLEO_CONF_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h7xx_hal.h"
00030
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034
00035 /** @addtogroup STM32H7XX_NUCLEO
00036   * @{
00037   */
00038
00039 /** @defgroup STM32H7XX_NUCLEO_CONFIG Config
00040   * @{
00041   */
00042
00043 /** @defgroup STM32H7XX_NUCLEO_CONFIG_Exported_Constants Exported Constants
00044   * @{
00045   */
00046 /* Nucleo pin and part number defines */
00047 #define USE_NUCLEO_144
00048 #define USE_NUCLEO_H7A3ZI_Q
00049
00050 /* COM define */
00051 #define USE_COM_LOG                         0U
00052 #define USE_BSP_COM_FEATURE                 0U
00053
00054 /* IRQ priorities */
00055 #define BSP_BUTTON_USER_IT_PRIORITY         15U
00056
00057 #define BUS_SPI1_BAUDRATE                   18000000
00058 /**
00059   * @}
00060   */
00061
00062 /**
00063   * @}
00064   */
00065
00066 /**
00067   * @}
00068   */
00069
00070 /**
00071   * @}
00072   */
00073
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077
00078 #endif /* STM32H7XX_NUCLEO_CONF_H */
00079
00080 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H7xx_Nucleo BSP User Manual: stm32h7xx_nucleo_errno.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H7xx_Nucleo
stm32h7xx_nucleo_errno.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_nucleo_errno.h
00004   * @author  MCD Application Team
00005   * @brief   Error Code.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H7XX_NUCLEO_ERRNO_H
00022 #define STM32H7XX_NUCLEO_ERRNO_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Common Error codes */
00029 #define BSP_ERROR_NONE                    0
00030 #define BSP_ERROR_NO_INIT                -1
00031 #define BSP_ERROR_WRONG_PARAM            -2
00032 #define BSP_ERROR_BUSY                   -3
00033 #define BSP_ERROR_PERIPH_FAILURE         -4
00034 #define BSP_ERROR_COMPONENT_FAILURE      -5
00035 #define BSP_ERROR_UNKNOWN_FAILURE        -6
00036 #define BSP_ERROR_UNKNOWN_COMPONENT      -7
00037 #define BSP_ERROR_BUS_FAILURE            -8
00038 #define BSP_ERROR_CLOCK_FAILURE          -9
00039 #define BSP_ERROR_MSP_FAILURE            -10
00040 #define BSP_ERROR_FEATURE_NOT_SUPPORTED  -11
00041
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045
00046 #endif /* STM32H7XX_NUCLEO_ERRNO_H */
00047
00048 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H7xx_Nucleo BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference