STM32H735G-DK BSP User Manual: STM32H735G-DK BSP Drivers

STM32H735G-DK BSP User Manual
  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories
STM32H735G-DK BSP Drivers

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32H735G-DK 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
02/19/2024 | V1.0 |  | STM32H735G-DK Board
Generated on Mon Feb 19 2024 11:27:14 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: OSPI_RAM Private Functions

  • Data Structures
  • Files
  • Directories
Functions
OSPI_RAM Private Functions

Functions

static void | OSPI_RAM_MspInit (OSPI_HandleTypeDef *hospi)
Initializes the OSPI MSP.
static void | OSPI_RAM_MspDeInit (OSPI_HandleTypeDef *hospi)
De-Initializes the OSPI MSP.

Function Documentation

static void OSPI_RAM_MspDeInit ( OSPI_HandleTypeDef * hospi ) [static]

De-Initializes the OSPI MSP.

Parameters:
hospi OSPI handle
Return values:
None

Definition at line 2099 of file stm32h735g_discovery_ospi.c.

References OSPI_RAM_CLK_DISABLE, OSPI_RAM_CLK_GPIO_PORT, OSPI_RAM_CLK_PIN, OSPI_RAM_CS_GPIO_PORT, OSPI_RAM_CS_PIN, OSPI_RAM_D0_GPIO_PORT, OSPI_RAM_D0_PIN, OSPI_RAM_D1_GPIO_PORT, OSPI_RAM_D1_PIN, OSPI_RAM_D2_GPIO_PORT, OSPI_RAM_D2_PIN, OSPI_RAM_D3_GPIO_PORT, OSPI_RAM_D3_PIN, OSPI_RAM_D4_GPIO_PORT, OSPI_RAM_D4_PIN, OSPI_RAM_D5_GPIO_PORT, OSPI_RAM_D5_PIN, OSPI_RAM_D6_GPIO_PORT, OSPI_RAM_D6_PIN, OSPI_RAM_D7_GPIO_PORT, OSPI_RAM_D7_PIN, OSPI_RAM_DQS_GPIO_PORT, OSPI_RAM_DQS_PIN, OSPI_RAM_FORCE_RESET, OSPI_RAM_MDMAx_CHANNEL, OSPI_RAM_MDMAx_IRQn, and OSPI_RAM_RELEASE_RESET.

Referenced by BSP_OSPI_RAM_DeInit().

static void OSPI_RAM_MspInit ( OSPI_HandleTypeDef * hospi ) [static]

Initializes the OSPI MSP.

Parameters:
hospi OSPI handle
Return values:
None

Definition at line 1982 of file stm32h735g_discovery_ospi.c.

References BSP_OSPI_RAM_DMA_IT_PRIORITY, BSP_OSPI_RAM_IT_PRIORITY, OSPI_RAM_CLK_ENABLE, OSPI_RAM_CLK_GPIO_CLK_ENABLE, OSPI_RAM_CLK_GPIO_PORT, OSPI_RAM_CLK_PIN, OSPI_RAM_CLK_PIN_AF, OSPI_RAM_CS_GPIO_CLK_ENABLE, OSPI_RAM_CS_GPIO_PORT, OSPI_RAM_CS_PIN, OSPI_RAM_CS_PIN_AF, OSPI_RAM_D0_GPIO_CLK_ENABLE, OSPI_RAM_D0_GPIO_PORT, OSPI_RAM_D0_PIN, OSPI_RAM_D0_PIN_AF, OSPI_RAM_D1_GPIO_CLK_ENABLE, OSPI_RAM_D1_GPIO_PORT, OSPI_RAM_D1_PIN, OSPI_RAM_D1_PIN_AF, OSPI_RAM_D2_GPIO_CLK_ENABLE, OSPI_RAM_D2_GPIO_PORT, OSPI_RAM_D2_PIN, OSPI_RAM_D2_PIN_AF, OSPI_RAM_D3_GPIO_CLK_ENABLE, OSPI_RAM_D3_GPIO_PORT, OSPI_RAM_D3_PIN, OSPI_RAM_D3_PIN_AF, OSPI_RAM_D4_GPIO_CLK_ENABLE, OSPI_RAM_D4_GPIO_PORT, OSPI_RAM_D4_PIN, OSPI_RAM_D4_PIN_AF, OSPI_RAM_D5_GPIO_CLK_ENABLE, OSPI_RAM_D5_GPIO_PORT, OSPI_RAM_D5_PIN, OSPI_RAM_D5_PIN_AF, OSPI_RAM_D6_GPIO_CLK_ENABLE, OSPI_RAM_D6_GPIO_PORT, OSPI_RAM_D6_PIN, OSPI_RAM_D6_PIN_AF, OSPI_RAM_D7_GPIO_CLK_ENABLE, OSPI_RAM_D7_GPIO_PORT, OSPI_RAM_D7_PIN, OSPI_RAM_D7_PIN_AF, OSPI_RAM_DQS_GPIO_CLK_ENABLE, OSPI_RAM_DQS_GPIO_PORT, OSPI_RAM_DQS_PIN, OSPI_RAM_DQS_PIN_AF, OSPI_RAM_FORCE_RESET, OSPI_RAM_MDMAx_CHANNEL, OSPI_RAM_MDMAx_CLK_ENABLE, OSPI_RAM_MDMAx_IRQn, and OSPI_RAM_RELEASE_RESET.

Referenced by BSP_OSPI_RAM_Init().


STM32H735G-DK BSP User Manual: Private Types Definitions

Typedefs
Private Types Definitions
LOW LEVEL

Typedefs

typedef void(* BSP_EXTI_LineCallback )(void)

Typedef Documentation

typedef void(* BSP_EXTI_LineCallback)(void)

Definition at line 42 of file stm32h735g_discovery.c.


STM32H735G-DK BSP User Manual: Private Function Prototypes

Private Function Prototypes
LOW LEVEL


STM32H735G-DK BSP User Manual: Exported Variables

Variables
Exported Variables
LOW LEVEL

Variables

EXTI_HandleTypeDef hpb_exti [BUTTONn]
STM32H735G_DK_LOW_LEVEL_Exported_Variables

Variable Documentation

EXTI_HandleTypeDef hpb_exti[BUTTONn]

STM32H735G_DK_LOW_LEVEL_Exported_Variables

Definition at line 63 of file stm32h735g_discovery.c.

Referenced by BSP_PB_Init(), and BSP_PB_IRQHandler().


STM32H735G-DK BSP User Manual: Private Variables

Variables
Private Variables
LOW LEVEL

Variables

static GPIO_TypeDef * | LED_PORT [LEDn]
static const uint32_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 84 of file stm32h735g_discovery.c.

Referenced by BSP_PB_DeInit(), and BSP_PB_Init().

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

Definition at line 83 of file stm32h735g_discovery.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 82 of file stm32h735g_discovery.c.

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

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

Definition at line 79 of file stm32h735g_discovery.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
                                      }

Definition at line 75 of file stm32h735g_discovery.c.

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


STM32H735G-DK BSP User Manual: Exported Functions

Functions
Exported Functions
LOW LEVEL

Functions

int32_t | BSP_GetVersion (void)
This method returns the STM32H735G_DK BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 selected LED state.
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)
This function handles Push-Button interrupt requests.
__weak void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.
static void | BUTTON_USER_EXTI_Callback (void)
KEY EXTI line detection callbacks.

Function Documentation

int32_t BSP_GetVersion ( void )

This method returns the STM32H735G_DK BSP Driver revision.

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

Definition at line 105 of file stm32h735g_discovery.c.

References STM32H735G_DK_BSP_VERSION.

int32_t BSP_LED_DeInit ( Led_TypeDef Led )

DeInit LEDs.

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

Definition at line 158 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_GetState ( Led_TypeDef Led )

Get the selected LED state.

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

Definition at line 225 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Init ( Led_TypeDef Led )

Configures LED on GPIO.

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

Definition at line 118 of file stm32h735g_discovery.c.

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

int32_t BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

Parameters:
Led LED to be set off This parameter can be one of the following values:
  • LED1
  • LED2
Return values:
BSP status

Definition at line 195 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

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

Definition at line 179 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

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

Definition at line 210 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, 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 334 of file stm32h735g_discovery.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: User Push Button
Note:
PB DeInit does not disable the GPIO clock
Return values:
BSP status

Definition at line 287 of file stm32h735g_discovery.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: User Push Button
Return values:
The Button GPIO pin value

Definition at line 305 of file stm32h735g_discovery.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: User 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
Return values:
BSP status

Definition at line 244 of file stm32h735g_discovery.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 )

This function handles Push-Button interrupt requests.

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

Definition at line 315 of file stm32h735g_discovery.c.

References hpb_exti.

static void BUTTON_USER_EXTI_Callback ( void ) [static]

KEY EXTI line detection callbacks.

Return values:
None

Definition at line 324 of file stm32h735g_discovery.c.

References BSP_PB_Callback(), and BUTTON_USER.

Referenced by BSP_PB_Init().


STM32H735G-DK BSP User Manual: LOW LEVEL Exported Types

Enumerations
LOW LEVEL Exported Types
LOW LEVEL

Enumerations

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

Enumeration Type Documentation

enum Button_TypeDef
Enumerator:
BUTTON_USER
BUTTONn

Definition at line 61 of file stm32h735g_discovery.h.

enum ButtonMode_TypeDef
Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 67 of file stm32h735g_discovery.h.

enum Led_TypeDef
Enumerator:
LED1
LED_GREEN
LED2
LED_RED
LEDn

Definition at line 51 of file stm32h735g_discovery.h.


STM32H735G-DK BSP User Manual: EVAL LOW LEVEL LED

Defines
EVAL LOW LEVEL LED
LOW LEVEL Exported Constants

Defines

#define | LED1_GPIO_PORT GPIOC
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_3
#define | LED2_GPIO_PORT GPIOC
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | LED2_PIN GPIO_PIN_2

Define Documentation

#define LED1_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 160 of file stm32h735g_discovery.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 159 of file stm32h735g_discovery.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT GPIOC

Definition at line 158 of file stm32h735g_discovery.h.

#define LED1_PIN GPIO_PIN_3

Definition at line 161 of file stm32h735g_discovery.h.

#define LED2_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 165 of file stm32h735g_discovery.h.

#define LED2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 164 of file stm32h735g_discovery.h.

Referenced by BSP_LED_Init().

#define LED2_GPIO_PORT GPIOC

Definition at line 163 of file stm32h735g_discovery.h.

#define LED2_PIN GPIO_PIN_2

Definition at line 166 of file stm32h735g_discovery.h.


STM32H735G-DK 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
User-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 176 of file stm32h735g_discovery.h.

#define BUTTON_RELEASED 0U

Definition at line 175 of file stm32h735g_discovery.h.

#define BUTTON_USER_EXTI_IRQn EXTI15_10_IRQn

Definition at line 185 of file stm32h735g_discovery.h.

#define BUTTON_USER_EXTI_LINE EXTI_LINE_13

Definition at line 186 of file stm32h735g_discovery.h.

Referenced by BSP_PB_Init().

#define BUTTON_USER_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 184 of file stm32h735g_discovery.h.

#define BUTTON_USER_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 183 of file stm32h735g_discovery.h.

Referenced by BSP_PB_Init().

#define BUTTON_USER_GPIO_PORT GPIOC

Definition at line 182 of file stm32h735g_discovery.h.

#define BUTTON_USER_PIN GPIO_PIN_13

User-button.

Definition at line 181 of file stm32h735g_discovery.h.


STM32H735G-DK BSP User Manual: LOW LEVEL COM

LOW LEVEL COM
LOW LEVEL Exported Constants


STM32H735G-DK BSP User Manual: LOW LEVEL Exported Constants

Modules | Defines
LOW LEVEL Exported Constants
LOW LEVEL

Modules

EVAL LOW LEVEL LED
LOW LEVEL BUTTON
LOW LEVEL COM

Defines

#define | STM32H735G_DK_BSP_VERSION_MAIN (uint32_t)(0x01)
Define for STM32H735G_DK board.
#define | STM32H735G_DK_BSP_VERSION_SUB1 (uint32_t)(0x02)
#define | STM32H735G_DK_BSP_VERSION_SUB2 (uint32_t)(0x01)
#define | STM32H735G_DK_BSP_VERSION_RC (uint32_t)(0x00)
#define | STM32H735G_DK_BSP_VERSION

Define Documentation

#define STM32H735G_DK_BSP_VERSION
Value:
((STM32H735G_DK_BSP_VERSION_MAIN << 24)\
                                                |(STM32H735G_DK_BSP_VERSION_SUB1 << 16)\
                                                |(STM32H735G_DK_BSP_VERSION_SUB2 << 8 )\
                                                |(STM32H735G_DK_BSP_VERSION_RC))

Definition at line 148 of file stm32h735g_discovery.h.

Referenced by BSP_GetVersion().

#define STM32H735G_DK_BSP_VERSION_MAIN (uint32_t)(0x01)

Define for STM32H735G_DK board.

STM32H735G_DK BSP Driver version number V1.2.1 [31:24] main version

Definition at line 144 of file stm32h735g_discovery.h.

#define STM32H735G_DK_BSP_VERSION_RC (uint32_t)(0x00)

[7:0] release candidate

Definition at line 147 of file stm32h735g_discovery.h.

#define STM32H735G_DK_BSP_VERSION_SUB1 (uint32_t)(0x02)

[23:16] sub1 version

Definition at line 145 of file stm32h735g_discovery.h.

#define STM32H735G_DK_BSP_VERSION_SUB2 (uint32_t)(0x01)

[15:8] sub2 version

Definition at line 146 of file stm32h735g_discovery.h.


STM32H735G-DK 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 STM32H735G_DK BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 selected LED state.
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_Callback (Button_TypeDef Button)
BSP Push Button callback.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
This function handles Push-Button interrupt requests.

Function Documentation

int32_t BSP_GetVersion ( void )

This method returns the STM32H735G_DK BSP Driver revision.

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

Definition at line 105 of file stm32h735g_discovery.c.

References STM32H735G_DK_BSP_VERSION.

int32_t BSP_LED_DeInit ( Led_TypeDef Led )

DeInit LEDs.

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

Definition at line 158 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_GetState ( Led_TypeDef Led )

Get the selected LED state.

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

Definition at line 225 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Init ( Led_TypeDef Led )

Configures LED on GPIO.

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

Definition at line 118 of file stm32h735g_discovery.c.

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

int32_t BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

Parameters:
Led LED to be set off This parameter can be one of the following values:
  • LED1
  • LED2
Return values:
BSP status

Definition at line 195 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

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

Definition at line 179 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, LED_PIN, and LED_PORT.

int32_t BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

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

Definition at line 210 of file stm32h735g_discovery.c.

References BSP_ERROR_NONE, 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 334 of file stm32h735g_discovery.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: User Push Button
Note:
PB DeInit does not disable the GPIO clock
Return values:
BSP status

Definition at line 287 of file stm32h735g_discovery.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: User Push Button
Return values:
The Button GPIO pin value

Definition at line 305 of file stm32h735g_discovery.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: User 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
Return values:
BSP status

Definition at line 244 of file stm32h735g_discovery.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 )

This function handles Push-Button interrupt requests.

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

Definition at line 315 of file stm32h735g_discovery.c.

References hpb_exti.


STM32H735G-DK BSP User Manual: LOW LEVEL

Modules
LOW LEVEL
STM32H735G_DK

Modules

Private Types Definitions
Private Function Prototypes
Exported Variables
Private Variables
Exported Functions
LOW LEVEL Exported Types
LOW LEVEL Exported Constants
LOW LEVEL Exported Functions Prototypes
EXTI_HandleTypeDef hpb_exti []
STM32H735G_DK_LOW_LEVEL_Exported_Variables

Variable Documentation

EXTI_HandleTypeDef hpb_exti[]

STM32H735G_DK_LOW_LEVEL_Exported_Variables

Definition at line 63 of file stm32h735g_discovery.c.

Referenced by BSP_PB_Init(), and BSP_PB_IRQHandler().


STM32H735G-DK BSP User Manual: Private Marcos

Defines
Private Marcos
BUS

Defines

#define DIV_ROUND_CLOSEST(x, d) (((x) + ((d) / 2U)) / (d))

Define Documentation

#define DIV_ROUND_CLOSEST | ( | x,
 |  | d
 | ) | (((x) + ((d) / 2U)) / (d))

Definition at line 40 of file stm32h735g_discovery_bus.c.


STM32H735G-DK BSP User Manual: Private Constants

Defines | Variables
Private Constants
BUS

Defines

#define | I2C_VALID_TIMING_NBR 128U
#define | I2C_SPEED_FREQ_STANDARD 0U /* 100 kHz */
#define | I2C_SPEED_FREQ_FAST 1U /* 400 kHz */
#define | I2C_SPEED_FREQ_FAST_PLUS 2U /* 1 MHz */
#define | I2C_ANALOG_FILTER_DELAY_MIN 50U /* ns */
#define | I2C_ANALOG_FILTER_DELAY_MAX 260U /* ns */
#define | I2C_USE_ANALOG_FILTER 1U
#define | I2C_DIGITAL_FILTER_COEF 0U
#define | I2C_PRESC_MAX 16U
#define | I2C_SCLDEL_MAX 16U
#define | I2C_SDADEL_MAX 16U
#define | I2C_SCLH_MAX 256U
#define | I2C_SCLL_MAX 256U
#define | SEC2NSEC 1000000000UL

Variables

static const I2C_Charac_t | I2C_Charac []

Define Documentation

#define I2C_ANALOG_FILTER_DELAY_MAX 260U /* ns */

Definition at line 54 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

#define I2C_ANALOG_FILTER_DELAY_MIN 50U /* ns */

Definition at line 53 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_Compute_SCLL_SCLH().

#define I2C_DIGITAL_FILTER_COEF 0U

Definition at line 56 of file stm32h735g_discovery_bus.c.

Referenced by MX_I2C4_Init().

#define I2C_PRESC_MAX 16U

Definition at line 57 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

#define I2C_SCLDEL_MAX 16U

Definition at line 58 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

#define I2C_SCLH_MAX 256U

Definition at line 60 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

#define I2C_SCLL_MAX 256U

Definition at line 61 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

#define I2C_SDADEL_MAX 16U

Definition at line 59 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

#define I2C_SPEED_FREQ_FAST 1U /* 400 kHz */

Definition at line 51 of file stm32h735g_discovery_bus.c.

#define I2C_SPEED_FREQ_FAST_PLUS 2U /* 1 MHz */

Definition at line 52 of file stm32h735g_discovery_bus.c.

Referenced by I2C_GetTiming().

#define I2C_SPEED_FREQ_STANDARD 0U /* 100 kHz */

Definition at line 50 of file stm32h735g_discovery_bus.c.

#define I2C_USE_ANALOG_FILTER 1U

Definition at line 55 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), I2C_Compute_SCLL_SCLH(), and MX_I2C4_Init().

#define I2C_VALID_TIMING_NBR 128U

Definition at line 48 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_GetTiming().

#define SEC2NSEC 1000000000UL

Definition at line 62 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_Compute_SCLL_SCLH().

Variable Documentation

const I2C_Charac_t I2C_Charac[] [static]

Definition at line 100 of file stm32h735g_discovery_bus.c.


STM32H735G-DK BSP User Manual: I2C_Charac_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
I2C_Charac_t Struct Reference
Private Types

Data Fields

uint32_t | freq
uint32_t | freq_min
uint32_t | freq_max
uint32_t | hddat_min
uint32_t | vddat_max
uint32_t | sudat_min
uint32_t | lscl_min
uint32_t | hscl_min
uint32_t | trise
uint32_t | tfall
uint32_t | dnf

Detailed Description

Definition at line 70 of file stm32h735g_discovery_bus.c.

Field Documentation

uint32_t I2C_Charac_t::dnf

Definition at line 82 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::freq

Definition at line 72 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::freq_max

Definition at line 74 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH(), and I2C_GetTiming().

uint32_t I2C_Charac_t::freq_min

Definition at line 73 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::hddat_min

Definition at line 75 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

uint32_t I2C_Charac_t::hscl_min

Definition at line 79 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::lscl_min

Definition at line 78 of file stm32h735g_discovery_bus.c.

uint32_t I2C_Charac_t::sudat_min

Definition at line 77 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL().

uint32_t I2C_Charac_t::tfall

Definition at line 81 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::trise

Definition at line 80 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_Compute_SCLL_SCLH().

uint32_t I2C_Charac_t::vddat_max

Definition at line 76 of file stm32h735g_discovery_bus.c.

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_bus.c


STM32H735G-DK BSP User Manual: I2C_Timings_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
I2C_Timings_t Struct Reference
Private Types

Data Fields

uint32_t | presc
uint32_t | tscldel
uint32_t | tsdadel
uint32_t | sclh
uint32_t | scll

Detailed Description

Definition at line 85 of file stm32h735g_discovery_bus.c.

Field Documentation

uint32_t I2C_Timings_t::presc

Definition at line 87 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), I2C_Compute_SCLL_SCLH(), and I2C_GetTiming().

uint32_t I2C_Timings_t::sclh

Definition at line 90 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH(), and I2C_GetTiming().

uint32_t I2C_Timings_t::scll

Definition at line 91 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_SCLL_SCLH(), and I2C_GetTiming().

uint32_t I2C_Timings_t::tscldel

Definition at line 88 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_GetTiming().

uint32_t I2C_Timings_t::tsdadel

Definition at line 89 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_GetTiming().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_bus.c


STM32H735G-DK BSP User Manual: Exported Variables

Variables
Exported Variables
BUS

Variables

I2C_HandleTypeDef hbus_i2c4

Variable Documentation

I2C_HandleTypeDef hbus_i2c4

Definition at line 152 of file stm32h735g_discovery_bus.c.

Referenced by BSP_I2C4_DeInit(), BSP_I2C4_Init(), BSP_I2C4_IsReady(), BSP_I2C4_ReadReg(), BSP_I2C4_ReadReg16(), BSP_I2C4_WriteReg(), BSP_I2C4_WriteReg16(), I2C4_ReadReg(), and I2C4_WriteReg().


STM32H735G-DK BSP User Manual: Private Variables

Variables
Private Variables
BUS

Variables

static uint32_t | I2c4InitCounter = 0
static I2C_Timings_t | I2c_valid_timing [I2C_VALID_TIMING_NBR]
static uint32_t | I2c_valid_timing_nbr = 0
I2C_HandleTypeDef | hbus_i2c4

Variable Documentation

I2C_HandleTypeDef hbus_i2c4

Definition at line 152 of file stm32h735g_discovery_bus.c.

Referenced by BSP_I2C4_DeInit(), BSP_I2C4_Init(), BSP_I2C4_IsReady(), BSP_I2C4_ReadReg(), BSP_I2C4_ReadReg16(), BSP_I2C4_WriteReg(), BSP_I2C4_WriteReg16(), I2C4_ReadReg(), and I2C4_WriteReg().

uint32_t I2c4InitCounter = 0 [static]

Definition at line 163 of file stm32h735g_discovery_bus.c.

Referenced by BSP_I2C4_DeInit(), and BSP_I2C4_Init().

I2C_Timings_t I2c_valid_timing[I2C_VALID_TIMING_NBR] [static]

Definition at line 164 of file stm32h735g_discovery_bus.c.

uint32_t I2c_valid_timing_nbr = 0 [static]

Definition at line 165 of file stm32h735g_discovery_bus.c.

Referenced by I2C_Compute_PRESC_SCLDEL_SDADEL(), and I2C_Compute_SCLL_SCLH().


STM32H735G-DK BSP User Manual: Private FunctionPrototypes

Private FunctionPrototypes
BUS


STM32H735G-DK BSP User Manual: Exported Functions

Functions
Exported Functions
BUS

Functions

int32_t | BSP_I2C4_Init (void)
Initializes I2C HAL.
int32_t | BSP_I2C4_DeInit (void)
DeInitializes I2C HAL.
__weak HAL_StatusTypeDef | MX_I2C4_Init (I2C_HandleTypeDef *hI2c, uint32_t timing)
MX I2C4 initialization.
int32_t | BSP_I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 8bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 8bit register of the device through BUS.
int32_t | BSP_I2C4_WriteReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
int32_t | BSP_I2C4_IsReady (uint16_t DevAddr, uint32_t Trials)
Checks if target device is ready for communication.
int32_t | BSP_GetTick (void)
Delay function.

Function Documentation

int32_t BSP_GetTick ( void )

Delay function.

Return values:
Tick value

Definition at line 487 of file stm32h735g_discovery_bus.c.

Referenced by FT5336_Probe().

int32_t BSP_I2C4_DeInit ( void )

DeInitializes I2C HAL.

Return values:
None

Definition at line 243 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_NONE, hbus_i2c4, I2C4_MspDeInit(), and I2c4InitCounter.

Referenced by FT5336_Probe().

int32_t BSP_I2C4_Init ( void )

Initializes I2C HAL.

Return values:
BSP status

Definition at line 196 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_MSP_FAILURE, BSP_ERROR_NONE, BUS_I2C4, hbus_i2c4, I2C4_MspInit(), I2c4InitCounter, I2C_GetTiming(), and MX_I2C4_Init().

Referenced by BSP_LCD_InitEx(), and FT5336_Probe().

int32_t BSP_I2C4_IsReady | ( | uint16_t | DevAddr,
 |  | uint32_t | Trials
 | ) |  |

Checks if target device is ready for communication.

Note:
This function is used with Memory devices
Parameters:
DevAddr | Target device address
Trials | Number of trials
Return values:
BSP status

Definition at line 465 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUSY, BSP_ERROR_NONE, and hbus_i2c4.

int32_t BSP_I2C4_ReadReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Read a 8bit register of the device through BUS.

Parameters:
DevAddr | Device address on BUS
Reg | The target register address to read
pData | Pointer to data buffer
Length | Length of the data
Return values:
BSP status

Definition at line 355 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_ReadReg().

Referenced by BSP_LCD_InitEx(), and FT5336_Probe().

int32_t BSP_I2C4_ReadReg16 | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Read a 16bit register of the device through BUS.

Parameters:
DevAddr | Device address on BUS
Reg | The target register address to read
pData | Pointer to data buffer
Length | Length of the data
Return values:
BSP status

Definition at line 429 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_ReadReg().

int32_t BSP_I2C4_WriteReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Write a 8bit value in a register of the device through BUS.

Parameters:
DevAddr | Device address on Bus.
Reg | The target register address to write
pData | The target register value to be written
Length | buffer size to be written
Return values:
BSP status

Definition at line 318 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_WriteReg().

Referenced by FT5336_Probe().

int32_t BSP_I2C4_WriteReg16 | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Write a 16bit value in a register of the device through BUS.

Parameters:
DevAddr | Device address on Bus.
Reg | The target register address to write
pData | The target register value to be written
Length | buffer size to be written
Return values:
BSP status

Definition at line 392 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_WriteReg().

__weak HAL_StatusTypeDef MX_I2C4_Init | ( | I2C_HandleTypeDef * | hI2c,
 |  | uint32_t | timing
 | ) |  |

MX I2C4 initialization.

Parameters:
hI2c | I2C handle
timing | I2C timing
Return values:
HAL status

Definition at line 272 of file stm32h735g_discovery_bus.c.

References I2C_DIGITAL_FILTER_COEF, and I2C_USE_ANALOG_FILTER.

Referenced by BSP_I2C4_Init().


STM32H735G-DK BSP User Manual: Private Functions

Functions
Private Functions
BUS

Functions

static uint32_t | I2C_GetTiming (uint32_t clock_src_freq, uint32_t i2c_freq)
Compute I2C timing according current I2C clock source and required I2C clock.
static void | I2C_Compute_PRESC_SCLDEL_SDADEL (uint32_t clock_src_freq, uint32_t I2C_speed)
Compute PRESC, SCLDEL and SDADEL.
static uint32_t | I2C_Compute_SCLL_SCLH (uint32_t clock_src_freq, uint32_t I2C_speed)
Calculate SCLL and SCLH and find best configuration.
static void | I2C4_MspInit (I2C_HandleTypeDef *phi2c)
Initializes I2C MSP.
static void | I2C4_MspDeInit (I2C_HandleTypeDef *phi2c)
DeInitializes I2C MSP.
static int32_t | I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
Write a value in a register of the device through BUS.
static int32_t | I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
Read a register of the device through BUS.

Function Documentation

static void I2C4_MspDeInit ( I2C_HandleTypeDef * phi2c ) [static]

DeInitializes I2C MSP.

Parameters:
phi2c I2C handler
Return values:
None

Definition at line 814 of file stm32h735g_discovery_bus.c.

References BUS_I2C4_CLK_DISABLE, BUS_I2C4_SCL_GPIO_PORT, BUS_I2C4_SCL_PIN, BUS_I2C4_SDA_GPIO_PORT, and BUS_I2C4_SDA_PIN.

Referenced by BSP_I2C4_DeInit().

static void I2C4_MspInit ( I2C_HandleTypeDef * phi2c ) [static]

Initializes I2C MSP.

Parameters:
phi2c I2C handler
Return values:
None

Definition at line 772 of file stm32h735g_discovery_bus.c.

References BUS_I2C4_CLK_ENABLE, BUS_I2C4_FORCE_RESET, BUS_I2C4_RELEASE_RESET, BUS_I2C4_SCL_AF, BUS_I2C4_SCL_GPIO_CLK_ENABLE, BUS_I2C4_SCL_GPIO_PORT, BUS_I2C4_SCL_PIN, BUS_I2C4_SDA_AF, BUS_I2C4_SDA_GPIO_CLK_ENABLE, BUS_I2C4_SDA_GPIO_PORT, and BUS_I2C4_SDA_PIN.

Referenced by BSP_I2C4_Init().

static int32_t I2C4_ReadReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  | [static]

Read a register of the device through BUS.

Parameters:
DevAddr | Device address on BUS
MemAddSize | Size of internal memory address
Reg | The target register address to read
Return values:
BSP status

Definition at line 857 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_NONE, and hbus_i2c4.

Referenced by BSP_I2C4_ReadReg(), and BSP_I2C4_ReadReg16().

static int32_t I2C4_WriteReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  | [static]

Write a value in a register of the device through BUS.

Parameters:
Addr | Device address on Bus.
MemAddSize | Size of internal memory address
Reg | The target register address to write
pData | The target register value to be written
Length | data length in bytes
Return values:
BSP status

Definition at line 840 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_NONE, and hbus_i2c4.

Referenced by BSP_I2C4_WriteReg(), and BSP_I2C4_WriteReg16().

static void I2C_Compute_PRESC_SCLDEL_SDADEL | ( | uint32_t | clock_src_freq,
 |  | uint32_t | I2C_speed
 | ) |  | [static]

Compute PRESC, SCLDEL and SDADEL.

Parameters:
clock_src_freq | I2C source clock in HZ.
I2C_speed | I2C frequency (index).
Return values:
None.

Definition at line 613 of file stm32h735g_discovery_bus.c.

References I2C_Charac_t::hddat_min, I2C_ANALOG_FILTER_DELAY_MAX, I2C_ANALOG_FILTER_DELAY_MIN, I2C_PRESC_MAX, I2C_SCLDEL_MAX, I2C_SDADEL_MAX, I2C_USE_ANALOG_FILTER, I2C_VALID_TIMING_NBR, I2c_valid_timing_nbr, I2C_Timings_t::presc, SEC2NSEC, I2C_Charac_t::sudat_min, I2C_Charac_t::trise, I2C_Timings_t::tscldel, and I2C_Timings_t::tsdadel.

Referenced by I2C_GetTiming().

static uint32_t I2C_Compute_SCLL_SCLH | ( | uint32_t | clock_src_freq,
 |  | uint32_t | I2C_speed
 | ) |  | [static]

Calculate SCLL and SCLH and find best configuration.

Parameters:
clock_src_freq | I2C source clock in HZ.
I2C_speed | I2C frequency (index).
Return values:
config index (0 to I2C_VALID_TIMING_NBR], 0xFFFFFFFF for no valid config.

Definition at line 694 of file stm32h735g_discovery_bus.c.

References I2C_Charac_t::dnf, I2C_Charac_t::freq, I2C_Charac_t::freq_max, I2C_Charac_t::freq_min, I2C_Charac_t::hscl_min, I2C_ANALOG_FILTER_DELAY_MIN, I2C_SCLH_MAX, I2C_SCLL_MAX, I2C_USE_ANALOG_FILTER, I2c_valid_timing_nbr, I2C_Timings_t::presc, I2C_Timings_t::sclh, I2C_Timings_t::scll, SEC2NSEC, I2C_Charac_t::tfall, and I2C_Charac_t::trise.

Referenced by I2C_GetTiming().

static uint32_t I2C_GetTiming | ( | uint32_t | clock_src_freq,
 |  | uint32_t | i2c_freq
 | ) |  | [static]

Compute I2C timing according current I2C clock source and required I2C clock.

Parameters:
clock_src_freq | I2C clock source in Hz.
i2c_freq | Required I2C clock in Hz.
Return values:
I2C timing or 0 in case of error.

Definition at line 575 of file stm32h735g_discovery_bus.c.

References I2C_Charac_t::freq_max, I2C_Compute_PRESC_SCLDEL_SDADEL(), I2C_Compute_SCLL_SCLH(), I2C_SPEED_FREQ_FAST_PLUS, I2C_VALID_TIMING_NBR, I2C_Timings_t::presc, I2C_Timings_t::sclh, I2C_Timings_t::scll, I2C_Timings_t::tscldel, and I2C_Timings_t::tsdadel.

Referenced by BSP_I2C4_Init().


STM32H735G-DK BSP User Manual: Exported Types

Exported Types
BUS


STM32H735G-DK BSP User Manual: Exported Constants

Defines
Exported Constants
BUS

Defines

#define | BUS_I2C4 I2C4
#define | BUS_I2C4_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
#define | BUS_I2C4_CLK_DISABLE() __HAL_RCC_I2C4_CLK_DISABLE()
#define | BUS_I2C4_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | BUS_I2C4_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | BUS_I2C4_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | BUS_I2C4_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | BUS_I2C4_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
#define | BUS_I2C4_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
#define | BUS_I2C4_SCL_PIN GPIO_PIN_14
#define | BUS_I2C4_SDA_PIN GPIO_PIN_15
#define | BUS_I2C4_SCL_GPIO_PORT GPIOF
#define | BUS_I2C4_SDA_GPIO_PORT GPIOF
#define | BUS_I2C4_SCL_AF GPIO_AF4_I2C4
#define | BUS_I2C4_SDA_AF GPIO_AF4_I2C4

Define Documentation

#define BUS_I2C4 I2C4

Definition at line 66 of file stm32h735g_discovery_bus.h.

Referenced by BSP_I2C4_Init().

#define BUS_I2C4_CLK_DISABLE ( ) __HAL_RCC_I2C4_CLK_DISABLE()

Definition at line 68 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspDeInit().

#define BUS_I2C4_CLK_ENABLE ( ) __HAL_RCC_I2C4_CLK_ENABLE()

Definition at line 67 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_FORCE_RESET ( ) __HAL_RCC_I2C4_FORCE_RESET()

Definition at line 74 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_RELEASE_RESET ( ) __HAL_RCC_I2C4_RELEASE_RESET()

Definition at line 75 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_SCL_AF GPIO_AF4_I2C4

Definition at line 82 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_SCL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 70 of file stm32h735g_discovery_bus.h.

#define BUS_I2C4_SCL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 69 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_SCL_GPIO_PORT GPIOF

Definition at line 80 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspDeInit(), and I2C4_MspInit().

#define BUS_I2C4_SCL_PIN GPIO_PIN_14

Definition at line 78 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspDeInit(), and I2C4_MspInit().

#define BUS_I2C4_SDA_AF GPIO_AF4_I2C4

Definition at line 83 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_SDA_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 72 of file stm32h735g_discovery_bus.h.

#define BUS_I2C4_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 71 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspInit().

#define BUS_I2C4_SDA_GPIO_PORT GPIOF

Definition at line 81 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspDeInit(), and I2C4_MspInit().

#define BUS_I2C4_SDA_PIN GPIO_PIN_15

Definition at line 79 of file stm32h735g_discovery_bus.h.

Referenced by I2C4_MspDeInit(), and I2C4_MspInit().


STM32H735G-DK BSP User Manual: Exported Functions Prototypes

Functions
Exported Functions Prototypes
BUS

Functions

int32_t | BSP_I2C4_Init (void)
Initializes I2C HAL.
int32_t | BSP_I2C4_DeInit (void)
DeInitializes I2C HAL.
int32_t | BSP_I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 8bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 8bit register of the device through BUS.
int32_t | BSP_I2C4_WriteReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
int32_t | BSP_I2C4_Recv (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
int32_t | BSP_I2C4_Send (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
int32_t | BSP_I2C4_IsReady (uint16_t DevAddr, uint32_t Trials)
Checks if target device is ready for communication.
int32_t | BSP_GetTick (void)
Delay function.
HAL_StatusTypeDef | MX_I2C4_Init (I2C_HandleTypeDef *phi2c, uint32_t timing)
MX I2C4 initialization.

Function Documentation

int32_t BSP_GetTick ( void )

Delay function.

Return values:
Tick value

Definition at line 487 of file stm32h735g_discovery_bus.c.

Referenced by FT5336_Probe().

int32_t BSP_I2C4_DeInit ( void )

DeInitializes I2C HAL.

Return values:
None

Definition at line 243 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_NONE, hbus_i2c4, I2C4_MspDeInit(), and I2c4InitCounter.

Referenced by FT5336_Probe().

int32_t BSP_I2C4_Init ( void )

Initializes I2C HAL.

Return values:
BSP status

Definition at line 196 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_MSP_FAILURE, BSP_ERROR_NONE, BUS_I2C4, hbus_i2c4, I2C4_MspInit(), I2c4InitCounter, I2C_GetTiming(), and MX_I2C4_Init().

Referenced by BSP_LCD_InitEx(), and FT5336_Probe().

int32_t BSP_I2C4_IsReady | ( | uint16_t | DevAddr,
 |  | uint32_t | Trials
 | ) |  |

Checks if target device is ready for communication.

Note:
This function is used with Memory devices
Parameters:
DevAddr | Target device address
Trials | Number of trials
Return values:
BSP status

Definition at line 465 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUSY, BSP_ERROR_NONE, and hbus_i2c4.

int32_t BSP_I2C4_ReadReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Read a 8bit register of the device through BUS.

Parameters:
DevAddr | Device address on BUS
Reg | The target register address to read
pData | Pointer to data buffer
Length | Length of the data
Return values:
BSP status

Definition at line 355 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_ReadReg().

Referenced by BSP_LCD_InitEx(), and FT5336_Probe().

int32_t BSP_I2C4_ReadReg16 | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Read a 16bit register of the device through BUS.

Parameters:
DevAddr | Device address on BUS
Reg | The target register address to read
pData | Pointer to data buffer
Length | Length of the data
Return values:
BSP status

Definition at line 429 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_ReadReg().

int32_t BSP_I2C4_Recv | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |
int32_t BSP_I2C4_Send | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |
int32_t BSP_I2C4_WriteReg | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Write a 8bit value in a register of the device through BUS.

Parameters:
DevAddr | Device address on Bus.
Reg | The target register address to write
pData | The target register value to be written
Length | buffer size to be written
Return values:
BSP status

Definition at line 318 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_WriteReg().

Referenced by FT5336_Probe().

int32_t BSP_I2C4_WriteReg16 | ( | uint16_t | DevAddr,
 |  | uint16_t | Reg,
 |  | uint8_t * | pData,
 |  | uint16_t | Length
 | ) |  |

Write a 16bit value in a register of the device through BUS.

Parameters:
DevAddr | Device address on Bus.
Reg | The target register address to write
pData | The target register value to be written
Length | buffer size to be written
Return values:
BSP status

Definition at line 392 of file stm32h735g_discovery_bus.c.

References BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, hbus_i2c4, and I2C4_WriteReg().

HAL_StatusTypeDef MX_I2C4_Init | ( | I2C_HandleTypeDef * | hI2c,
 |  | uint32_t | timing
 | ) |  |

MX I2C4 initialization.

Parameters:
hI2c | I2C handle
timing | I2C timing
Return values:
HAL status

Definition at line 272 of file stm32h735g_discovery_bus.c.

References I2C_DIGITAL_FILTER_COEF, and I2C_USE_ANALOG_FILTER.

Referenced by BSP_I2C4_Init().


STM32H735G-DK BSP User Manual: OSPI_NOR Private Functions

Functions
OSPI_NOR Private Functions
STM32H735G_DK OSPI

Functions

static void | OSPI_NOR_MspInit (OSPI_HandleTypeDef *hospi)
Initializes the OSPI MSP.
static void | OSPI_NOR_MspDeInit (OSPI_HandleTypeDef *hospi)
De-Initializes the OSPI MSP.
static int32_t | OSPI_NOR_ResetMemory (uint32_t Instance)
This function reset the OSPI memory.
static int32_t | OSPI_NOR_EnterDOPIMode (uint32_t Instance)
This function enables the octal DTR mode of the memory.
static int32_t | OSPI_NOR_EnterSOPIMode (uint32_t Instance)
This function enables the octal STR mode of the memory.
static int32_t | OSPI_NOR_ExitOPIMode (uint32_t Instance)
This function disables the octal DTR or STR mode of the memory.

Function Documentation

static int32_t OSPI_NOR_EnterDOPIMode ( uint32_t Instance ) [static]

This function enables the octal DTR mode of the memory.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1769 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_DTR_TRANSFER, BSP_OSPI_NOR_OPI_MODE, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

Referenced by BSP_OSPI_NOR_ConfigFlash().

static int32_t OSPI_NOR_EnterSOPIMode ( uint32_t Instance ) [static]

This function enables the octal STR mode of the memory.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1840 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

Referenced by BSP_OSPI_NOR_ConfigFlash().

static int32_t OSPI_NOR_ExitOPIMode ( uint32_t Instance ) [static]

This function disables the octal DTR or STR mode of the memory.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1904 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_DTR_TRANSFER, BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

Referenced by BSP_OSPI_NOR_ConfigFlash().

static void OSPI_NOR_MspDeInit ( OSPI_HandleTypeDef * hospi ) [static]

De-Initializes the OSPI MSP.

Parameters:
hospi OSPI handle
Return values:
None

Definition at line 1686 of file stm32h735g_discovery_ospi.c.

References OSPI_NOR_CLK_DISABLE, OSPI_NOR_CLK_GPIO_PORT, OSPI_NOR_CLK_PIN, OSPI_NOR_CS_GPIO_PORT, OSPI_NOR_CS_PIN, OSPI_NOR_D0_GPIO_PORT, OSPI_NOR_D0_PIN, OSPI_NOR_D1_GPIO_PORT, OSPI_NOR_D1_PIN, OSPI_NOR_D2_GPIO_PORT, OSPI_NOR_D2_PIN, OSPI_NOR_D3_GPIO_PORT, OSPI_NOR_D3_PIN, OSPI_NOR_D4_GPIO_PORT, OSPI_NOR_D4_PIN, OSPI_NOR_D5_GPIO_PORT, OSPI_NOR_D5_PIN, OSPI_NOR_D6_GPIO_PORT, OSPI_NOR_D6_PIN, OSPI_NOR_D7_GPIO_PORT, OSPI_NOR_D7_PIN, OSPI_NOR_DQS_GPIO_PORT, OSPI_NOR_DQS_PIN, OSPI_NOR_FORCE_RESET, and OSPI_NOR_RELEASE_RESET.

Referenced by BSP_OSPI_NOR_DeInit().

static void OSPI_NOR_MspInit ( OSPI_HandleTypeDef * hospi ) [static]

Initializes the OSPI MSP.

Parameters:
hospi OSPI handle
Return values:
None

Definition at line 1593 of file stm32h735g_discovery_ospi.c.

References OSPI_NOR_CLK_ENABLE, OSPI_NOR_CLK_GPIO_CLK_ENABLE, OSPI_NOR_CLK_GPIO_PORT, OSPI_NOR_CLK_PIN, OSPI_NOR_CLK_PIN_AF, OSPI_NOR_CS_GPIO_CLK_ENABLE, OSPI_NOR_CS_GPIO_PORT, OSPI_NOR_CS_PIN, OSPI_NOR_CS_PIN_AF, OSPI_NOR_D0_GPIO_CLK_ENABLE, OSPI_NOR_D0_GPIO_PORT, OSPI_NOR_D0_PIN, OSPI_NOR_D0_PIN_AF, OSPI_NOR_D1_GPIO_CLK_ENABLE, OSPI_NOR_D1_GPIO_PORT, OSPI_NOR_D1_PIN, OSPI_NOR_D1_PIN_AF, OSPI_NOR_D2_GPIO_CLK_ENABLE, OSPI_NOR_D2_GPIO_PORT, OSPI_NOR_D2_PIN, OSPI_NOR_D2_PIN_AF, OSPI_NOR_D3_GPIO_CLK_ENABLE, OSPI_NOR_D3_GPIO_PORT, OSPI_NOR_D3_PIN, OSPI_NOR_D3_PIN_AF, OSPI_NOR_D4_GPIO_CLK_ENABLE, OSPI_NOR_D4_GPIO_PORT, OSPI_NOR_D4_PIN, OSPI_NOR_D4_PIN_AF, OSPI_NOR_D5_GPIO_CLK_ENABLE, OSPI_NOR_D5_GPIO_PORT, OSPI_NOR_D5_PIN, OSPI_NOR_D5_PIN_AF, OSPI_NOR_D6_GPIO_CLK_ENABLE, OSPI_NOR_D6_GPIO_PORT, OSPI_NOR_D6_PIN, OSPI_NOR_D6_PIN_AF, OSPI_NOR_D7_GPIO_CLK_ENABLE, OSPI_NOR_D7_GPIO_PORT, OSPI_NOR_D7_PIN, OSPI_NOR_D7_PIN_AF, OSPI_NOR_DQS_GPIO_CLK_ENABLE, OSPI_NOR_DQS_GPIO_PORT, OSPI_NOR_DQS_PIN, OSPI_NOR_DQS_PIN_AF, OSPI_NOR_FORCE_RESET, and OSPI_NOR_RELEASE_RESET.

Referenced by BSP_OSPI_NOR_Init().

static int32_t OSPI_NOR_ResetMemory ( uint32_t Instance ) [static]

This function reset the OSPI memory.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1717 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_DTR_TRANSFER, BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, OSPI_NOR_Ctx_t::InterfaceMode, OSPI_NOR_Ctx_t::IsInitialized, OSPI_ACCESS_INDIRECT, OSPI_NOR_INSTANCES_NUMBER, and OSPI_NOR_Ctx_t::TransferRate.

Referenced by BSP_OSPI_NOR_Init().


STM32H735G-DK BSP User Manual: OSPI_RAM Private Functions

OSPI_RAM Private Functions
STM32H735G_DK OSPI


STM32H735G-DK BSP User Manual: OSPI_NOR Exported Functions

Functions
OSPI_NOR Exported Functions
STM32H735G_DK OSPI

Functions

int32_t | BSP_OSPI_NOR_Init (uint32_t Instance, BSP_OSPI_NOR_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
__weak HAL_StatusTypeDef | MX_OSPI_NOR_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Config)
Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the OSPI memory.
int32_t | BSP_OSPI_NOR_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Block (uint32_t Instance, uint32_t BlockAddress, BSP_OSPI_NOR_Erase_t BlockSize)
Erases the specified block of the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Chip (uint32_t Instance)
Erases the entire OSPI memory.
int32_t | BSP_OSPI_NOR_GetStatus (uint32_t Instance)
Reads current status of the OSPI memory.
int32_t | BSP_OSPI_NOR_GetInfo (uint32_t Instance, BSP_OSPI_NOR_Info_t *pInfo)
Return the configuration of the OSPI memory.
int32_t | BSP_OSPI_NOR_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_NOR_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_NOR_ReadID (uint32_t Instance, uint8_t *Id)
Get flash ID 3 Bytes: Manufacturer ID, Memory type, Memory density.
int32_t | BSP_OSPI_NOR_ConfigFlash (uint32_t Instance, BSP_OSPI_NOR_Interface_t Mode, BSP_OSPI_NOR_Transfer_t Rate)
Set Flash to desired Interface mode.
int32_t | BSP_OSPI_NOR_SuspendErase (uint32_t Instance)
This function suspends an ongoing erase command.
int32_t | BSP_OSPI_NOR_ResumeErase (uint32_t Instance)
This function resumes a paused erase command.

Function Documentation

int32_t BSP_OSPI_NOR_ConfigFlash | ( | uint32_t | Instance,
 |  | BSP_OSPI_NOR_Interface_t | Mode,
 |  | BSP_OSPI_NOR_Transfer_t | Rate
 | ) |  |

Set Flash to desired Interface mode.

And this instance becomes current instance. If current instance running at MMP mode then this function doesn't work. Indirect -> Indirect

Parameters:
Instance | OSPI instance
Mode | OSPI mode
Rate | OSPI transfer rate
Return values:
BSP status

Definition at line 793 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_LOCK_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, OSPI_NOR_Ctx_t::InterfaceMode, OSPI_NOR_Ctx_t::IsInitialized, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), OSPI_NOR_INSTANCES_NUMBER, and OSPI_NOR_Ctx_t::TransferRate.

Referenced by BSP_OSPI_NOR_Init().

int32_t BSP_OSPI_NOR_DeInit ( uint32_t Instance )

De-Initializes the OSPI interface.

Parameters:
Instance OSPI Instance
Return values:
BSP status

Definition at line 243 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, OSPI_NOR_Ctx_t::InterfaceMode, OSPI_NOR_Ctx_t::IsInitialized, OSPI_ACCESS_MMP, OSPI_ACCESS_NONE, OSPI_NOR_INSTANCES_NUMBER, OSPI_NOR_MspDeInit(), and OSPI_NOR_Ctx_t::TransferRate.

int32_t BSP_OSPI_NOR_DisableMemoryMappedMode ( uint32_t Instance )

Exit form memory-mapped mode Only 1 Instance can running MMP mode.

And it will lock system at this mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 725 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hospi_nor, OSPI_NOR_Ctx_t::IsInitialized, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, and OSPI_NOR_INSTANCES_NUMBER.

Referenced by BSP_OSPI_NOR_DeInit().

int32_t BSP_OSPI_NOR_EnableMemoryMappedMode ( uint32_t Instance )

Configure the OSPI in memory-mapped mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 680 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, OSPI_NOR_Ctx_t::IsInitialized, OSPI_ACCESS_MMP, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_Erase_Block | ( | uint32_t | Instance,
 |  | uint32_t | BlockAddress,
 |  | BSP_OSPI_NOR_Erase_t | BlockSize
 | ) |  |

Erases the specified block of the OSPI memory.

Parameters:
Instance | OSPI instance
BlockAddress | Block address to erase
BlockSize | Erase Block size
Return values:
BSP status

Definition at line 527 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_Erase_Chip ( uint32_t Instance )

Erases the entire OSPI memory.

Parameters:
Instance QSPI instance
Return values:
BSP status

Definition at line 570 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_GetInfo | ( | uint32_t | Instance,
 |  | BSP_OSPI_NOR_Info_t * | pInfo
 | ) |  |

Return the configuration of the OSPI memory.

Parameters:
Instance | OSPI instance
pInfo | pointer on the configuration structure
Return values:
BSP status

Definition at line 657 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_GetStatus ( uint32_t Instance )

Reads current status of the OSPI memory.

Parameters:
Instance QSPI instance
Return values:
OSPI memory status: whether busy or not

Definition at line 609 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_OSPI_SUSPENDED, BSP_ERROR_WRONG_PARAM, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

Referenced by BSP_OSPI_NOR_ResumeErase(), and BSP_OSPI_NOR_SuspendErase().

int32_t BSP_OSPI_NOR_Init | ( | uint32_t | Instance,
 |  | BSP_OSPI_NOR_Init_t * | Init
 | ) |  |

Initializes the OSPI interface.

Parameters:
Instance | OSPI Instance
Init | OSPI Init structure
Return values:
BSP status

Definition at line 159 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_Info_t, MX_OSPI_InitTypeDef::ClockPrescaler, hospi_nor, BSP_OSPI_NOR_Init_t::InterfaceMode, MX_OSPI_InitTypeDef::MemorySize, MX_OSPI_ClockConfig(), MX_OSPI_NOR_Init(), OSPI_ACCESS_NONE, OSPI_NOR_INSTANCES_NUMBER, OSPI_NOR_MspInit(), OSPI_NOR_ResetMemory(), MX_OSPI_InitTypeDef::SampleShifting, MX_OSPI_InitTypeDef::TransferRate, and BSP_OSPI_NOR_Init_t::TransferRate.

int32_t BSP_OSPI_NOR_Read | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the OSPI memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be read
ReadAddr | Read start address
Size | Size of data to read
Return values:
BSP status

Definition at line 400 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_ReadID | ( | uint32_t | Instance,
 |  | uint8_t * | Id
 | ) |  |

Get flash ID 3 Bytes: Manufacturer ID, Memory type, Memory density.

Parameters:
Instance | OSPI instance
Id | Pointer to flash ID bytes
Return values:
BSP status

Definition at line 762 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_ResumeErase ( uint32_t Instance )

This function resumes a paused erase command.

Parameters:
Instance QSPI instance
Return values:
BSP status

Definition at line 911 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_OSPI_SUSPENDED, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_GetStatus(), hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_SuspendErase ( uint32_t Instance )

This function suspends an ongoing erase command.

Parameters:
Instance QSPI instance
Return values:
BSP status

Definition at line 875 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_OSPI_SUSPENDED, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_GetStatus(), hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

int32_t BSP_OSPI_NOR_Write | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the OSPI memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be written
WriteAddr | Write start address
Size | Size of data to write
Return values:
BSP status

Definition at line 439 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_NOR_STR_TRANSFER, hospi_nor, and OSPI_NOR_INSTANCES_NUMBER.

HAL_StatusTypeDef MX_OSPI_NOR_Init | ( | OSPI_HandleTypeDef * | hospi,
 |  | MX_OSPI_InitTypeDef * | Config
 | ) |  |

Initializes the OSPI interface.

Parameters:
hospi | OSPI handle
Config | OSPI config structure
Return values:
BSP status

Definition at line 289 of file stm32h735g_discovery_ospi.c.

References BSP_OSPI_NOR_DTR_TRANSFER, MX_OSPI_InitTypeDef::ClockPrescaler, MX_OSPI_InitTypeDef::MemorySize, MX_OSPI_InitTypeDef::SampleShifting, and MX_OSPI_InitTypeDef::TransferRate.

Referenced by BSP_OSPI_NOR_Init().


STM32H735G-DK BSP User Manual: Exported Types

Data Structures | Enumerations
Exported Types
STM32H735G_DK OSPI

Data Structures

struct | MX_OSPI_InitTypeDef

Enumerations

enum | OSPI_Access_t { OSPI_ACCESS_NONE = 0, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP }

Enumeration Type Documentation

enum OSPI_Access_t
Enumerator:
OSPI_ACCESS_NONE

Instance not initialized,

OSPI_ACCESS_INDIRECT

Instance use indirect mode access

OSPI_ACCESS_MMP

Instance use Memory Mapped Mode read

Definition at line 50 of file stm32h735g_discovery_ospi.h.


STM32H735G-DK BSP User Manual: MX_OSPI_InitTypeDef Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MX_OSPI_InitTypeDef Struct Reference
Exported Types

#include <stm32h735g_discovery_ospi.h>

Data Fields

uint32_t | MemorySize
uint32_t | ClockPrescaler
uint32_t | SampleShifting
uint32_t | TransferRate

Detailed Description

Definition at line 64 of file stm32h735g_discovery_ospi.h.

Field Documentation

uint32_t MX_OSPI_InitTypeDef::ClockPrescaler

Definition at line 67 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init(), BSP_OSPI_RAM_Init(), MX_OSPI_NOR_Init(), and MX_OSPI_RAM_Init().

uint32_t MX_OSPI_InitTypeDef::MemorySize

Definition at line 66 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init(), BSP_OSPI_RAM_Init(), MX_OSPI_NOR_Init(), and MX_OSPI_RAM_Init().

uint32_t MX_OSPI_InitTypeDef::SampleShifting

Definition at line 68 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init(), BSP_OSPI_RAM_Init(), MX_OSPI_NOR_Init(), and MX_OSPI_RAM_Init().

uint32_t MX_OSPI_InitTypeDef::TransferRate

Definition at line 69 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init(), and MX_OSPI_NOR_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: OSPI_NOR Exported Types

Data Structures | Defines
OSPI_NOR Exported Types
STM32H735G_DK OSPI

Data Structures

struct | OSPI_NOR_Ctx_t
struct | BSP_OSPI_NOR_Init_t

Defines

#define | BSP_OSPI_NOR_Info_t MX25LM51245G_Info_t
#define | BSP_OSPI_NOR_Interface_t MX25LM51245G_Interface_t
#define | BSP_OSPI_NOR_Transfer_t MX25LM51245G_Transfer_t
#define | BSP_OSPI_NOR_Erase_t MX25LM51245G_Erase_t

Define Documentation

#define BSP_OSPI_NOR_Erase_t MX25LM51245G_Erase_t

Definition at line 81 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_Info_t MX25LM51245G_Info_t

Definition at line 78 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init().

#define BSP_OSPI_NOR_Interface_t MX25LM51245G_Interface_t

Definition at line 79 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_Transfer_t MX25LM51245G_Transfer_t

Definition at line 80 of file stm32h735g_discovery_ospi.h.


STM32H735G-DK BSP User Manual: OSPI_NOR_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
OSPI_NOR_Ctx_t Struct Reference
OSPI_NOR Exported Types

#include <stm32h735g_discovery_ospi.h>

Data Fields

OSPI_Access_t IsInitialized
BSP_OSPI_NOR_Interface_t InterfaceMode
BSP_OSPI_NOR_Transfer_t TransferRate
uint32_t IsMspCallbacksValid

Detailed Description

Definition at line 83 of file stm32h735g_discovery_ospi.h.

Field Documentation

BSP_OSPI_NOR_Interface_t OSPI_NOR_Ctx_t::InterfaceMode

Flash Interface mode of Instance

Definition at line 86 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), and OSPI_NOR_ResetMemory().

OSPI_Access_t OSPI_NOR_Ctx_t::IsInitialized

Instance access Flash method

Definition at line 85 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), and OSPI_NOR_ResetMemory().

uint32_t OSPI_NOR_Ctx_t::IsMspCallbacksValid

Definition at line 88 of file stm32h735g_discovery_ospi.h.

BSP_OSPI_NOR_Transfer_t OSPI_NOR_Ctx_t::TransferRate

Flash Transfer mode of Instance

Definition at line 87 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), and OSPI_NOR_ResetMemory().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: BSP_OSPI_NOR_Init_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
BSP_OSPI_NOR_Init_t Struct Reference
OSPI_NOR Exported Types

#include <stm32h735g_discovery_ospi.h>

Data Fields

BSP_OSPI_NOR_Interface_t InterfaceMode
BSP_OSPI_NOR_Transfer_t TransferRate

Detailed Description

Definition at line 91 of file stm32h735g_discovery_ospi.h.

Field Documentation

BSP_OSPI_NOR_Interface_t BSP_OSPI_NOR_Init_t::InterfaceMode

Current Flash Interface mode

Definition at line 93 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init().

BSP_OSPI_NOR_Transfer_t BSP_OSPI_NOR_Init_t::TransferRate

Current Flash Transfer rate

Definition at line 94 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: OSPI_RAM Exported Types

Data Structures | Defines | Enumerations
OSPI_RAM Exported Types
STM32H735G_DK OSPI

Data Structures

struct | OSPI_RAM_Ctx_t
struct | BSP_OSPI_RAM_Init_t

Defines

#define | BSP_OSPI_RAM_BurstLength_t S70KL1281_BurstLength_t

Enumerations

enum | BSP_OSPI_RAM_Latency_t { BSP_OSPI_RAM_VARIABLE_LATENCY = HAL_OSPI_VARIABLE_LATENCY, BSP_OSPI_RAM_FIXED_LATENCY = HAL_OSPI_FIXED_LATENCY }
enum | BSP_OSPI_RAM_BurstType_t { BSP_OSPI_RAM_HYBRID_BURST = 0, BSP_OSPI_RAM_LINEAR_BURST }

Define Documentation

#define BSP_OSPI_RAM_BurstLength_t S70KL1281_BurstLength_t

Definition at line 102 of file stm32h735g_discovery_ospi.h.

Enumeration Type Documentation

enum BSP_OSPI_RAM_BurstType_t
Enumerator:
BSP_OSPI_RAM_HYBRID_BURST
BSP_OSPI_RAM_LINEAR_BURST

Definition at line 109 of file stm32h735g_discovery_ospi.h.

enum BSP_OSPI_RAM_Latency_t
Enumerator:
BSP_OSPI_RAM_VARIABLE_LATENCY
BSP_OSPI_RAM_FIXED_LATENCY

Definition at line 104 of file stm32h735g_discovery_ospi.h.


STM32H735G-DK BSP User Manual: OSPI_RAM_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
OSPI_RAM_Ctx_t Struct Reference
OSPI_RAM Exported Types

#include <stm32h735g_discovery_ospi.h>

Data Fields

OSPI_Access_t IsInitialized
BSP_OSPI_RAM_Latency_t LatencyType
BSP_OSPI_RAM_BurstType_t BurstType
BSP_OSPI_RAM_BurstLength_t BurstLength
uint32_t IsMspCallbacksValid

Detailed Description

Definition at line 114 of file stm32h735g_discovery_ospi.h.

Field Documentation

BSP_OSPI_RAM_BurstLength_t OSPI_RAM_Ctx_t::BurstLength

Burst Length of Instance

Definition at line 119 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), and BSP_OSPI_RAM_DeInit().

BSP_OSPI_RAM_BurstType_t OSPI_RAM_Ctx_t::BurstType

Burst Type of Instance

Definition at line 118 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), and BSP_OSPI_RAM_DeInit().

OSPI_Access_t OSPI_RAM_Ctx_t::IsInitialized

Instance access Flash method

Definition at line 116 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), and BSP_OSPI_RAM_EnableMemoryMappedMode().

uint32_t OSPI_RAM_Ctx_t::IsMspCallbacksValid

Definition at line 120 of file stm32h735g_discovery_ospi.h.

BSP_OSPI_RAM_Latency_t OSPI_RAM_Ctx_t::LatencyType

Latency Type of Instance

Definition at line 117 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), and BSP_OSPI_RAM_DeInit().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: BSP_OSPI_RAM_Init_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
BSP_OSPI_RAM_Init_t Struct Reference
OSPI_RAM Exported Types

#include <stm32h735g_discovery_ospi.h>

Data Fields

BSP_OSPI_RAM_Latency_t LatencyType
BSP_OSPI_RAM_BurstType_t BurstType
BSP_OSPI_RAM_BurstLength_t BurstLength

Detailed Description

Definition at line 123 of file stm32h735g_discovery_ospi.h.

Field Documentation

BSP_OSPI_RAM_BurstLength_t BSP_OSPI_RAM_Init_t::BurstLength

Current HyperRAM Burst Length

Definition at line 127 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_LCD_InitEx(), and BSP_OSPI_RAM_Init().

BSP_OSPI_RAM_BurstType_t BSP_OSPI_RAM_Init_t::BurstType

Current HyperRAM Burst Type

Definition at line 126 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_LCD_InitEx(), and BSP_OSPI_RAM_Init().

BSP_OSPI_RAM_Latency_t BSP_OSPI_RAM_Init_t::LatencyType

Current HyperRAM Latency Type

Definition at line 125 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_LCD_InitEx(), and BSP_OSPI_RAM_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: OSPI_NOR Exported Constants

Defines
OSPI_NOR Exported Constants
STM32H735G_DK OSPI

Defines

#define | OSPI_NOR_INSTANCES_NUMBER 1U
#define | BSP_OSPI_NOR_SPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_SPI_MODE /* 1 Cmd Line, 1 Address Line and 1 Data Line */
#define | BSP_OSPI_NOR_OPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_OPI_MODE /* 8 Cmd Lines, 8 Address Lines and 8 Data Lines */
#define | BSP_OSPI_NOR_STR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_STR_TRANSFER /* Single Transfer Rate */
#define | BSP_OSPI_NOR_DTR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_DTR_TRANSFER /* Double Transfer Rate */
#define | BSP_OSPI_NOR_ERASE_4K MX25LM51245G_ERASE_4K
#define | BSP_OSPI_NOR_ERASE_64K MX25LM51245G_ERASE_64K
#define | BSP_OSPI_NOR_ERASE_CHIP MX25LM51245G_ERASE_BULK
#define | BSP_OSPI_NOR_BLOCK_4K MX25LM51245G_SUBSECTOR_4K
#define | BSP_OSPI_NOR_BLOCK_64K MX25LM51245G_SECTOR_64K
#define | OSPI_NOR_CLK_ENABLE() __HAL_RCC_OSPI1_CLK_ENABLE()
#define | OSPI_NOR_CLK_DISABLE() __HAL_RCC_OSPI1_CLK_DISABLE()
#define | OSPI_NOR_FORCE_RESET() __HAL_RCC_OSPI1_FORCE_RESET()
#define | OSPI_NOR_RELEASE_RESET() __HAL_RCC_OSPI1_RELEASE_RESET()
#define | OSPI_NOR_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_NOR_CS_PIN GPIO_PIN_6
#define | OSPI_NOR_CS_GPIO_PORT GPIOG
#define | OSPI_NOR_CS_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_NOR_CLK_PIN GPIO_PIN_10
#define | OSPI_NOR_CLK_GPIO_PORT GPIOF
#define | OSPI_NOR_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_DQS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OSPI_NOR_DQS_PIN GPIO_PIN_2
#define | OSPI_NOR_DQS_GPIO_PORT GPIOB
#define | OSPI_NOR_DQS_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D0_PIN GPIO_PIN_11
#define | OSPI_NOR_D0_GPIO_PORT GPIOD
#define | OSPI_NOR_D0_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D1_PIN GPIO_PIN_12
#define | OSPI_NOR_D1_GPIO_PORT GPIOD
#define | OSPI_NOR_D1_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | OSPI_NOR_D2_PIN GPIO_PIN_2
#define | OSPI_NOR_D2_GPIO_PORT GPIOE
#define | OSPI_NOR_D2_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D3_PIN GPIO_PIN_13
#define | OSPI_NOR_D3_GPIO_PORT GPIOD
#define | OSPI_NOR_D3_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D4_PIN GPIO_PIN_4
#define | OSPI_NOR_D4_GPIO_PORT GPIOD
#define | OSPI_NOR_D4_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D5_PIN GPIO_PIN_5
#define | OSPI_NOR_D5_GPIO_PORT GPIOD
#define | OSPI_NOR_D5_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_NOR_D6_PIN GPIO_PIN_9
#define | OSPI_NOR_D6_GPIO_PORT GPIOG
#define | OSPI_NOR_D6_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D7_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D7_PIN GPIO_PIN_7
#define | OSPI_NOR_D7_GPIO_PORT GPIOD
#define | OSPI_NOR_D7_PIN_AF GPIO_AF10_OCTOSPIM_P1

Define Documentation

#define BSP_OSPI_NOR_BLOCK_4K MX25LM51245G_SUBSECTOR_4K

Definition at line 153 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_BLOCK_64K MX25LM51245G_SECTOR_64K

Definition at line 154 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_DTR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_DTR_TRANSFER /* Double Transfer Rate */

Definition at line 145 of file stm32h735g_discovery_ospi.h.

Referenced by MX_OSPI_NOR_Init(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define BSP_OSPI_NOR_ERASE_4K MX25LM51245G_ERASE_4K

Definition at line 148 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_ERASE_64K MX25LM51245G_ERASE_64K

Definition at line 149 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_ERASE_CHIP MX25LM51245G_ERASE_BULK

Definition at line 150 of file stm32h735g_discovery_ospi.h.

#define BSP_OSPI_NOR_OPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_OPI_MODE /* 8 Cmd Lines, 8 Address Lines and 8 Data Lines */

Definition at line 141 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), and OSPI_NOR_ResetMemory().

#define BSP_OSPI_NOR_SPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_SPI_MODE /* 1 Cmd Line, 1 Address Line and 1 Data Line */

Definition at line 140 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define BSP_OSPI_NOR_STR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_STR_TRANSFER /* Single Transfer Rate */

Definition at line 144 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_Write(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define OSPI_NOR_CLK_DISABLE ( ) __HAL_RCC_OSPI1_CLK_DISABLE()

Definition at line 158 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit().

#define OSPI_NOR_CLK_ENABLE ( ) __HAL_RCC_OSPI1_CLK_ENABLE()

Definition at line 157 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 169 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_CLK_GPIO_PORT GPIOF

Definition at line 171 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_CLK_PIN GPIO_PIN_10

Definition at line 170 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 172 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 164 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_CS_GPIO_PORT GPIOG

Definition at line 166 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_CS_PIN GPIO_PIN_6

Definition at line 165 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_CS_PIN_AF GPIO_AF10_OCTOSPIM_P1

Definition at line 167 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 179 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D0_GPIO_PORT GPIOD

Definition at line 181 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D0_PIN GPIO_PIN_11

Definition at line 180 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D0_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 182 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 184 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D1_GPIO_PORT GPIOD

Definition at line 186 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D1_PIN GPIO_PIN_12

Definition at line 185 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D1_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 187 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 189 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D2_GPIO_PORT GPIOE

Definition at line 191 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D2_PIN GPIO_PIN_2

Definition at line 190 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D2_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 192 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 194 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D3_GPIO_PORT GPIOD

Definition at line 196 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D3_PIN GPIO_PIN_13

Definition at line 195 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D3_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 197 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D4_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 199 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D4_GPIO_PORT GPIOD

Definition at line 201 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D4_PIN GPIO_PIN_4

Definition at line 200 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D4_PIN_AF GPIO_AF10_OCTOSPIM_P1

Definition at line 202 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D5_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 204 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D5_GPIO_PORT GPIOD

Definition at line 206 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D5_PIN GPIO_PIN_5

Definition at line 205 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D5_PIN_AF GPIO_AF10_OCTOSPIM_P1

Definition at line 207 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D6_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 209 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D6_GPIO_PORT GPIOG

Definition at line 211 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D6_PIN GPIO_PIN_9

Definition at line 210 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D6_PIN_AF GPIO_AF9_OCTOSPIM_P1

Definition at line 212 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D7_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 214 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_D7_GPIO_PORT GPIOD

Definition at line 216 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D7_PIN GPIO_PIN_7

Definition at line 215 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_D7_PIN_AF GPIO_AF10_OCTOSPIM_P1

Definition at line 217 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_DQS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 174 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_DQS_GPIO_PORT GPIOB

Definition at line 176 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_DQS_PIN GPIO_PIN_2

Definition at line 175 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_DQS_PIN_AF GPIO_AF10_OCTOSPIM_P1

Definition at line 177 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspInit().

#define OSPI_NOR_FORCE_RESET ( ) __HAL_RCC_OSPI1_FORCE_RESET()

Definition at line 160 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().

#define OSPI_NOR_INSTANCES_NUMBER 1U

Definition at line 137 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetInfo(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define OSPI_NOR_RELEASE_RESET ( ) __HAL_RCC_OSPI1_RELEASE_RESET()

Definition at line 161 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_NOR_MspDeInit(), and OSPI_NOR_MspInit().


STM32H735G-DK BSP User Manual: OSPI_RAM Exported Constants

Defines
OSPI_RAM Exported Constants
STM32H735G_DK OSPI

Defines

#define | OSPI_RAM_INSTANCES_NUMBER 1U
#define | BSP_OSPI_RAM_BURST_16_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_16_BYTES
#define | BSP_OSPI_RAM_BURST_32_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_32_BYTES
#define | BSP_OSPI_RAM_BURST_64_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_64_BYTES
#define | BSP_OSPI_RAM_BURST_128_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_128_BYTES
#define | OSPI_RAM_MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE
#define | OSPI_RAM_MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE
#define | OSPI_RAM_MDMAx_CHANNEL MDMA_Channel0
#define | OSPI_RAM_MDMAx_IRQn MDMA_IRQn
#define | OPSI_RAM_MDMA_IRQHandler MDMA_IRQHandler
#define | OSPI_RAM_CLK_ENABLE() __HAL_RCC_OSPI2_CLK_ENABLE()
#define | OSPI_RAM_CLK_DISABLE() __HAL_RCC_OSPI2_CLK_DISABLE()
#define | OSPI_RAM_FORCE_RESET() __HAL_RCC_OSPI2_FORCE_RESET()
#define | OSPI_RAM_RELEASE_RESET() __HAL_RCC_OSPI2_RELEASE_RESET()
#define | OSPI_RAM_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_CS_PIN GPIO_PIN_12
#define | OSPI_RAM_CS_GPIO_PORT GPIOG
#define | OSPI_RAM_CS_PIN_AF GPIO_AF3_OCTOSPIM_P2
#define | OSPI_RAM_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_CLK_PIN GPIO_PIN_4
#define | OSPI_RAM_CLK_GPIO_PORT GPIOF
#define | OSPI_RAM_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_DQS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_DQS_PIN GPIO_PIN_12
#define | OSPI_RAM_DQS_GPIO_PORT GPIOF
#define | OSPI_RAM_DQS_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D0_PIN GPIO_PIN_0
#define | OSPI_RAM_D0_GPIO_PORT GPIOF
#define | OSPI_RAM_D0_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D1_PIN GPIO_PIN_1
#define | OSPI_RAM_D1_GPIO_PORT GPIOF
#define | OSPI_RAM_D1_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D2_PIN GPIO_PIN_2
#define | OSPI_RAM_D2_GPIO_PORT GPIOF
#define | OSPI_RAM_D2_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D3_PIN GPIO_PIN_3
#define | OSPI_RAM_D3_GPIO_PORT GPIOF
#define | OSPI_RAM_D3_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D4_PIN GPIO_PIN_0
#define | OSPI_RAM_D4_GPIO_PORT GPIOG
#define | OSPI_RAM_D4_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D5_PIN GPIO_PIN_1
#define | OSPI_RAM_D5_GPIO_PORT GPIOG
#define | OSPI_RAM_D5_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D6_PIN GPIO_PIN_10
#define | OSPI_RAM_D6_GPIO_PORT GPIOG
#define | OSPI_RAM_D6_PIN_AF GPIO_AF3_OCTOSPIM_P2
#define | OSPI_RAM_D7_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D7_PIN GPIO_PIN_11
#define | OSPI_RAM_D7_GPIO_PORT GPIOG
#define | OSPI_RAM_D7_PIN_AF GPIO_AF9_OCTOSPIM_P2

Define Documentation

#define BSP_OSPI_RAM_BURST_128_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_128_BYTES

Definition at line 231 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM().

#define BSP_OSPI_RAM_BURST_16_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_16_BYTES

Definition at line 228 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM().

#define BSP_OSPI_RAM_BURST_32_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_32_BYTES

Definition at line 229 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_LCD_InitEx(), BSP_OSPI_RAM_ConfigHyperRAM(), and BSP_OSPI_RAM_DeInit().

#define BSP_OSPI_RAM_BURST_64_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_64_BYTES

Definition at line 230 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM().

#define OPSI_RAM_MDMA_IRQHandler MDMA_IRQHandler

Definition at line 238 of file stm32h735g_discovery_ospi.h.

#define OSPI_RAM_CLK_DISABLE ( ) __HAL_RCC_OSPI2_CLK_DISABLE()

Definition at line 242 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit().

#define OSPI_RAM_CLK_ENABLE ( ) __HAL_RCC_OSPI2_CLK_ENABLE()

Definition at line 241 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 253 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_CLK_GPIO_PORT GPIOF

Definition at line 255 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_CLK_PIN GPIO_PIN_4

Definition at line 254 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 256 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 248 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_CS_GPIO_PORT GPIOG

Definition at line 250 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_CS_PIN GPIO_PIN_12

Definition at line 249 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_CS_PIN_AF GPIO_AF3_OCTOSPIM_P2

Definition at line 251 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 263 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D0_GPIO_PORT GPIOF

Definition at line 265 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D0_PIN GPIO_PIN_0

Definition at line 264 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D0_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 266 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 268 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D1_GPIO_PORT GPIOF

Definition at line 270 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D1_PIN GPIO_PIN_1

Definition at line 269 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D1_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 271 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 273 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D2_GPIO_PORT GPIOF

Definition at line 275 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D2_PIN GPIO_PIN_2

Definition at line 274 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D2_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 276 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 278 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D3_GPIO_PORT GPIOF

Definition at line 280 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D3_PIN GPIO_PIN_3

Definition at line 279 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D3_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 281 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D4_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 283 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D4_GPIO_PORT GPIOG

Definition at line 285 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D4_PIN GPIO_PIN_0

Definition at line 284 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D4_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 286 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D5_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 288 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D5_GPIO_PORT GPIOG

Definition at line 290 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D5_PIN GPIO_PIN_1

Definition at line 289 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D5_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 291 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D6_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 293 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D6_GPIO_PORT GPIOG

Definition at line 295 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D6_PIN GPIO_PIN_10

Definition at line 294 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D6_PIN_AF GPIO_AF3_OCTOSPIM_P2

Definition at line 296 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D7_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 298 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_D7_GPIO_PORT GPIOG

Definition at line 300 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D7_PIN GPIO_PIN_11

Definition at line 299 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_D7_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 301 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_DQS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 258 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_DQS_GPIO_PORT GPIOF

Definition at line 260 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_DQS_PIN GPIO_PIN_12

Definition at line 259 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_DQS_PIN_AF GPIO_AF9_OCTOSPIM_P2

Definition at line 261 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_FORCE_RESET ( ) __HAL_RCC_OSPI2_FORCE_RESET()

Definition at line 244 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_INSTANCES_NUMBER 1U

Definition at line 225 of file stm32h735g_discovery_ospi.h.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_Read(), BSP_OSPI_RAM_Read_DMA(), BSP_OSPI_RAM_Write(), and BSP_OSPI_RAM_Write_DMA().

#define OSPI_RAM_MDMAx_CHANNEL MDMA_Channel0

Definition at line 236 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE

Definition at line 235 of file stm32h735g_discovery_ospi.h.

#define OSPI_RAM_MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE

Definition at line 234 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspInit().

#define OSPI_RAM_MDMAx_IRQn MDMA_IRQn

Definition at line 237 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().

#define OSPI_RAM_RELEASE_RESET ( ) __HAL_RCC_OSPI2_RELEASE_RESET()

Definition at line 245 of file stm32h735g_discovery_ospi.h.

Referenced by OSPI_RAM_MspDeInit(), and OSPI_RAM_MspInit().


STM32H735G-DK BSP User Manual: OSPI_RAM Exported Functions Prototypes

Functions
OSPI_RAM Exported Functions Prototypes
STM32H735G_DK OSPI

Functions

int32_t | BSP_OSPI_RAM_Init (uint32_t Instance, BSP_OSPI_RAM_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Read_DMA (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Write_DMA (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_RAM_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_RAM_ConfigHyperRAM (uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength)
Set HyperRAM to desired configuration.
void | BSP_OSPI_RAM_DMA_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM DMA transfer interrupt request.
void | BSP_OSPI_RAM_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM interrupt request.
HAL_StatusTypeDef | MX_OSPI_RAM_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init)
Initializes the OSPI interface.
HAL_StatusTypeDef | MX_OSPI_ClockConfig (OSPI_HandleTypeDef *hospi)
OSPI Clock Config for OSPI Memories .

Function Documentation

int32_t BSP_OSPI_RAM_ConfigHyperRAM | ( | uint32_t | Instance,
 |  | BSP_OSPI_RAM_Latency_t | Latency,
 |  | BSP_OSPI_RAM_BurstType_t | BurstType,
 |  | BSP_OSPI_RAM_BurstLength_t | BurstLength
 | ) |  |

Set HyperRAM to desired configuration.

And this instance becomes current instance. If current instance running at MMP mode then this function doesn't work. Indirect -> Indirect

Parameters:
Instance | OSPI instance
Latency | OSPI latency mode
BurstType | OSPI burst type
BurstLength | OSPI burst length
Return values:
BSP status

Definition at line 1429 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_LOCK_FAILURE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_BURST_128_BYTES, BSP_OSPI_RAM_BURST_16_BYTES, BSP_OSPI_RAM_BURST_32_BYTES, BSP_OSPI_RAM_BURST_64_BYTES, BSP_OSPI_RAM_FIXED_LATENCY, BSP_OSPI_RAM_HYBRID_BURST, OSPI_RAM_Ctx_t::BurstLength, OSPI_RAM_Ctx_t::BurstType, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_RAM_Ctx_t::LatencyType, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, OSPI_ACCESS_NONE, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_OSPI_RAM_Init().

int32_t BSP_OSPI_RAM_DeInit ( uint32_t Instance )

De-Initializes the OSPI interface.

Parameters:
Instance OSPI Instance
Return values:
BSP status

Definition at line 1030 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_BURST_32_BYTES, BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_FIXED_LATENCY, BSP_OSPI_RAM_LINEAR_BURST, OSPI_RAM_Ctx_t::BurstLength, OSPI_RAM_Ctx_t::BurstType, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_RAM_Ctx_t::LatencyType, OSPI_ACCESS_MMP, OSPI_ACCESS_NONE, OSPI_RAM_INSTANCES_NUMBER, and OSPI_RAM_MspDeInit().

int32_t BSP_OSPI_RAM_DisableMemoryMappedMode ( uint32_t Instance )

Exit form memory-mapped mode Only 1 Instance can running MMP mode.

And it will lock system at this mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1388 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_OSPI_RAM_DeInit().

void BSP_OSPI_RAM_DMA_IRQHandler ( uint32_t Instance )

Handles OctoSPI HyperRAM DMA transfer interrupt request.

Parameters:
Instance OSPI instance
Return values:
None

Definition at line 1566 of file stm32h735g_discovery_ospi.c.

References hospi_ram.

int32_t BSP_OSPI_RAM_EnableMemoryMappedMode ( uint32_t Instance )

Configure the OSPI in memory-mapped mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1357 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_ACCESS_MMP, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_LCD_InitEx().

int32_t BSP_OSPI_RAM_Init | ( | uint32_t | Instance,
 |  | BSP_OSPI_RAM_Init_t * | Init
 | ) |  |

Initializes the OSPI interface.

Parameters:
Instance | OSPI Instance
Init | OSPI Init structure
Return values:
BSP status

Definition at line 961 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_Init_t::BurstLength, BSP_OSPI_RAM_Init_t::BurstType, MX_OSPI_InitTypeDef::ClockPrescaler, hospi_ram, BSP_OSPI_RAM_Init_t::LatencyType, MX_OSPI_InitTypeDef::MemorySize, MX_OSPI_ClockConfig(), MX_OSPI_RAM_Init(), OSPI_ACCESS_NONE, OSPI_RAM_INSTANCES_NUMBER, OSPI_RAM_MspInit(), and MX_OSPI_InitTypeDef::SampleShifting.

Referenced by BSP_LCD_InitEx().

void BSP_OSPI_RAM_IRQHandler ( uint32_t Instance )

Handles OctoSPI HyperRAM interrupt request.

Parameters:
Instance OSPI instance
Return values:
None

Definition at line 1576 of file stm32h735g_discovery_ospi.c.

References hospi_ram.

int32_t BSP_OSPI_RAM_Read | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the HyperRAM memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be read
ReadAddr | Read start address
Size | Size of data to read
Return values:
BSP status

Definition at line 1228 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Read_DMA | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the HyperRAM memory in DMA mode.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be read
ReadAddr | Read start address
Size | Size of data to read
Return values:
BSP status

Definition at line 1261 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Write | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the HyperRAM memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be written
WriteAddr | Write start address
Size | Size of data to write
Return values:
BSP status

Definition at line 1294 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Write_DMA | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the HyperRAM memory in DMA mode.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be written
WriteAddr | Write start address
Size | Size of data to write
Return values:
BSP status

Definition at line 1327 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

HAL_StatusTypeDef MX_OSPI_ClockConfig ( OSPI_HandleTypeDef * hospi )

OSPI Clock Config for OSPI Memories .

Parameters:
hospi OSPI Handle Being __weak it can be overwritten by the application
Return values:
HAL_status

Definition at line 1081 of file stm32h735g_discovery_ospi.c.

Referenced by BSP_OSPI_NOR_Init(), and BSP_OSPI_RAM_Init().

HAL_StatusTypeDef MX_OSPI_RAM_Init | ( | OSPI_HandleTypeDef * | hospi,
 |  | MX_OSPI_InitTypeDef * | Init
 | ) |  |

Initializes the OSPI interface.

Parameters:
hospi | OSPI handle
Init | OSPI config structure
Return values:
BSP status

Definition at line 1111 of file stm32h735g_discovery_ospi.c.

References MX_OSPI_InitTypeDef::ClockPrescaler, MX_OSPI_InitTypeDef::MemorySize, and MX_OSPI_InitTypeDef::SampleShifting.

Referenced by BSP_OSPI_RAM_Init().


STM32H735G-DK BSP User Manual: OSPI_NOR Exported Variables

Variables
OSPI_NOR Exported Variables
STM32H735G_DK OSPI

Variables

OSPI_HandleTypeDef | hospi_nor [OSPI_NOR_INSTANCES_NUMBER] = {0}
OSPI_NOR_Ctx_t Ospi_Nor_Ctx [OSPI_NOR_INSTANCES_NUMBER]
OSPI_HandleTypeDef | hospi_nor []
OSPI_NOR_Ctx_t OSPINORCtx []

Variable Documentation

OSPI_HandleTypeDef hospi_nor[OSPI_NOR_INSTANCES_NUMBER] = {0}

Definition at line 106 of file stm32h735g_discovery_ospi.c.

Referenced by BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

OSPI_HandleTypeDef hospi_nor[]

Definition at line 106 of file stm32h735g_discovery_ospi.c.

Referenced by BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

OSPI_NOR_Ctx_t Ospi_Nor_Ctx[OSPI_NOR_INSTANCES_NUMBER]
Initial value:
 {{OSPI_ACCESS_NONE,
                                                           MX25LM51245G_SPI_MODE,
                                                           MX25LM51245G_STR_TRANSFER}}

Definition at line 107 of file stm32h735g_discovery_ospi.c.

OSPI_NOR_Ctx_t OSPINORCtx[]


STM32H735G-DK BSP User Manual: OSPI_RAM Exported Variables

Variables
OSPI_RAM Exported Variables
STM32H735G_DK OSPI

Variables

OSPI_HandleTypeDef hospi_ram [OSPI_RAM_INSTANCES_NUMBER] = {0}
OSPI_RAM_Ctx_t Ospi_Ram_Ctx [OSPI_RAM_INSTANCES_NUMBER]

Variable Documentation

OSPI_HandleTypeDef hospi_ram[OSPI_RAM_INSTANCES_NUMBER] = {0}

Definition at line 116 of file stm32h735g_discovery_ospi.c.

Referenced by BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_DMA_IRQHandler(), BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_IRQHandler(), BSP_OSPI_RAM_Read(), BSP_OSPI_RAM_Read_DMA(), BSP_OSPI_RAM_Write(), and BSP_OSPI_RAM_Write_DMA().

OSPI_RAM_Ctx_t Ospi_Ram_Ctx[OSPI_RAM_INSTANCES_NUMBER]
Initial value:
 {{OSPI_ACCESS_NONE,
                                                           BSP_OSPI_RAM_FIXED_LATENCY,
                                                           BSP_OSPI_RAM_HYBRID_BURST,
                                                           BSP_OSPI_RAM_BURST_16_BYTES}}

Definition at line 117 of file stm32h735g_discovery_ospi.c.


STM32H735G-DK BSP User Manual: STM32H735G_DK_OSPI_RAM_Exported_Functions

Functions
STM32H735G_DK_OSPI_RAM_Exported_Functions
STM32H735G_DK OSPI

Functions

int32_t | BSP_OSPI_RAM_Init (uint32_t Instance, BSP_OSPI_RAM_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
__weak HAL_StatusTypeDef | MX_OSPI_ClockConfig (OSPI_HandleTypeDef *hospi)
OSPI Clock Config for OSPI Memories .
__weak HAL_StatusTypeDef | MX_OSPI_RAM_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Read_DMA (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Write_DMA (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_RAM_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_RAM_ConfigHyperRAM (uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength)
Set HyperRAM to desired configuration.
void | BSP_OSPI_RAM_DMA_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM DMA transfer interrupt request.
void | BSP_OSPI_RAM_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM interrupt request.

Function Documentation

int32_t BSP_OSPI_RAM_ConfigHyperRAM | ( | uint32_t | Instance,
 |  | BSP_OSPI_RAM_Latency_t | Latency,
 |  | BSP_OSPI_RAM_BurstType_t | BurstType,
 |  | BSP_OSPI_RAM_BurstLength_t | BurstLength
 | ) |  |

Set HyperRAM to desired configuration.

And this instance becomes current instance. If current instance running at MMP mode then this function doesn't work. Indirect -> Indirect

Parameters:
Instance | OSPI instance
Latency | OSPI latency mode
BurstType | OSPI burst type
BurstLength | OSPI burst length
Return values:
BSP status

Definition at line 1429 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_LOCK_FAILURE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_BURST_128_BYTES, BSP_OSPI_RAM_BURST_16_BYTES, BSP_OSPI_RAM_BURST_32_BYTES, BSP_OSPI_RAM_BURST_64_BYTES, BSP_OSPI_RAM_FIXED_LATENCY, BSP_OSPI_RAM_HYBRID_BURST, OSPI_RAM_Ctx_t::BurstLength, OSPI_RAM_Ctx_t::BurstType, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_RAM_Ctx_t::LatencyType, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, OSPI_ACCESS_NONE, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_OSPI_RAM_Init().

int32_t BSP_OSPI_RAM_DeInit ( uint32_t Instance )

De-Initializes the OSPI interface.

Parameters:
Instance OSPI Instance
Return values:
BSP status

Definition at line 1030 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_BURST_32_BYTES, BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_FIXED_LATENCY, BSP_OSPI_RAM_LINEAR_BURST, OSPI_RAM_Ctx_t::BurstLength, OSPI_RAM_Ctx_t::BurstType, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_RAM_Ctx_t::LatencyType, OSPI_ACCESS_MMP, OSPI_ACCESS_NONE, OSPI_RAM_INSTANCES_NUMBER, and OSPI_RAM_MspDeInit().

int32_t BSP_OSPI_RAM_DisableMemoryMappedMode ( uint32_t Instance )

Exit form memory-mapped mode Only 1 Instance can running MMP mode.

And it will lock system at this mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1388 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_NONE, BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_OSPI_RAM_DeInit().

void BSP_OSPI_RAM_DMA_IRQHandler ( uint32_t Instance )

Handles OctoSPI HyperRAM DMA transfer interrupt request.

Parameters:
Instance OSPI instance
Return values:
None

Definition at line 1566 of file stm32h735g_discovery_ospi.c.

References hospi_ram.

int32_t BSP_OSPI_RAM_EnableMemoryMappedMode ( uint32_t Instance )

Configure the OSPI in memory-mapped mode.

Parameters:
Instance OSPI instance
Return values:
BSP status

Definition at line 1357 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, OSPI_RAM_Ctx_t::IsInitialized, OSPI_ACCESS_MMP, and OSPI_RAM_INSTANCES_NUMBER.

Referenced by BSP_LCD_InitEx().

int32_t BSP_OSPI_RAM_Init | ( | uint32_t | Instance,
 |  | BSP_OSPI_RAM_Init_t * | Init
 | ) |  |

Initializes the OSPI interface.

Parameters:
Instance | OSPI Instance
Init | OSPI Init structure
Return values:
BSP status

Definition at line 961 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_Init_t::BurstLength, BSP_OSPI_RAM_Init_t::BurstType, MX_OSPI_InitTypeDef::ClockPrescaler, hospi_ram, BSP_OSPI_RAM_Init_t::LatencyType, MX_OSPI_InitTypeDef::MemorySize, MX_OSPI_ClockConfig(), MX_OSPI_RAM_Init(), OSPI_ACCESS_NONE, OSPI_RAM_INSTANCES_NUMBER, OSPI_RAM_MspInit(), and MX_OSPI_InitTypeDef::SampleShifting.

Referenced by BSP_LCD_InitEx().

void BSP_OSPI_RAM_IRQHandler ( uint32_t Instance )

Handles OctoSPI HyperRAM interrupt request.

Parameters:
Instance OSPI instance
Return values:
None

Definition at line 1576 of file stm32h735g_discovery_ospi.c.

References hospi_ram.

int32_t BSP_OSPI_RAM_Read | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the HyperRAM memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be read
ReadAddr | Read start address
Size | Size of data to read
Return values:
BSP status

Definition at line 1228 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Read_DMA | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the HyperRAM memory in DMA mode.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be read
ReadAddr | Read start address
Size | Size of data to read
Return values:
BSP status

Definition at line 1261 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Write | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the HyperRAM memory.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be written
WriteAddr | Write start address
Size | Size of data to write
Return values:
BSP status

Definition at line 1294 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

int32_t BSP_OSPI_RAM_Write_DMA | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the HyperRAM memory in DMA mode.

Parameters:
Instance | OSPI instance
pData | Pointer to data to be written
WriteAddr | Write start address
Size | Size of data to write
Return values:
BSP status

Definition at line 1327 of file stm32h735g_discovery_ospi.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hospi_ram, and OSPI_RAM_INSTANCES_NUMBER.

__weak HAL_StatusTypeDef MX_OSPI_ClockConfig ( OSPI_HandleTypeDef * hospi )

OSPI Clock Config for OSPI Memories .

Parameters:
hospi OSPI Handle Being __weak it can be overwritten by the application
Return values:
HAL_status

Definition at line 1081 of file stm32h735g_discovery_ospi.c.

Referenced by BSP_OSPI_NOR_Init(), and BSP_OSPI_RAM_Init().

__weak HAL_StatusTypeDef MX_OSPI_RAM_Init | ( | OSPI_HandleTypeDef * | hospi,
 |  | MX_OSPI_InitTypeDef * | Init
 | ) |  |

Initializes the OSPI interface.

Parameters:
hospi | OSPI handle
Init | OSPI config structure
Return values:
BSP status

Definition at line 1111 of file stm32h735g_discovery_ospi.c.

References MX_OSPI_InitTypeDef::ClockPrescaler, MX_OSPI_InitTypeDef::MemorySize, and MX_OSPI_InitTypeDef::SampleShifting.

Referenced by BSP_OSPI_RAM_Init().


STM32H735G-DK BSP User Manual: STM32H735G_DKVERY_OSPI_NOR_Private_Functions

STM32H735G_DKVERY_OSPI_NOR_Private_Functions
STM32H735G_DK OSPI


STM32H735G-DK BSP User Manual: Private TypesDefinitions

Typedefs
Private TypesDefinitions
SD

Typedefs

typedef void(* BSP_EXTI_LineCallback )(void)

Typedef Documentation

typedef void(* BSP_EXTI_LineCallback)(void)

Definition at line 89 of file stm32h735g_discovery_sd.c.


STM32H735G-DK BSP User Manual: Private Variables

Variables
Private Variables
SD

Variables

static uint32_t | PinDetect [SD_INSTANCES_NBR] = {SD_DETECT_PIN}
static GPIO_TypeDef * | SD_GPIO_PORT [SD_INSTANCES_NBR] = {SD_DETECT_GPIO_PORT}
static IRQn_Type | SD_EXTI_IRQn [SD_INSTANCES_NBR] = {SD_DETECT_EXTI_IRQn}

Variable Documentation

uint32_t PinDetect[SD_INSTANCES_NBR] = {SD_DETECT_PIN} [static]

Definition at line 97 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DetectITConfig(), BSP_SD_Init(), BSP_SD_IsDetected(), and SD_EXTI_Callback().

IRQn_Type SD_EXTI_IRQn[SD_INSTANCES_NBR] = {SD_DETECT_EXTI_IRQn} [static]

Definition at line 99 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DetectITConfig().

GPIO_TypeDef* SD_GPIO_PORT[SD_INSTANCES_NBR] = {SD_DETECT_GPIO_PORT} [static]

Definition at line 98 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DetectITConfig(), BSP_SD_Init(), BSP_SD_IsDetected(), and SD_EXTI_Callback().


STM32H735G-DK BSP User Manual: Exported Variables

Variables
Exported Variables
SD

Variables

SD_HandleTypeDef | hsd_sdmmc [SD_INSTANCES_NBR]
EXTI_HandleTypeDef | hsd_exti [SD_INSTANCES_NBR]
SD_HandleTypeDef | hsd_sdmmc []
EXTI_HandleTypeDef | hsd_exti []

Variable Documentation

EXTI_HandleTypeDef hsd_exti[SD_INSTANCES_NBR]

Definition at line 109 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DETECT_IRQHandler(), and BSP_SD_DetectITConfig().

EXTI_HandleTypeDef hsd_exti[]

Definition at line 109 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DETECT_IRQHandler(), and BSP_SD_DetectITConfig().

SD_HandleTypeDef hsd_sdmmc[SD_INSTANCES_NBR]

Definition at line 108 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DeInit(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_GetCardState(), BSP_SD_Init(), BSP_SD_IRQHandler(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), BSP_SD_WriteBlocks_IT(), HAL_SD_AbortCallback(), HAL_SD_RxCpltCallback(), HAL_SD_TxCpltCallback(), and SD_MspDeInit().

SD_HandleTypeDef hsd_sdmmc[]

Definition at line 108 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_DeInit(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_GetCardState(), BSP_SD_Init(), BSP_SD_IRQHandler(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), BSP_SD_WriteBlocks_IT(), HAL_SD_AbortCallback(), HAL_SD_RxCpltCallback(), HAL_SD_TxCpltCallback(), and SD_MspDeInit().


STM32H735G-DK BSP User Manual: Private Functions Prototypes

Private Functions Prototypes
SD


STM32H735G-DK BSP User Manual: Private Functions

Functions
Private Functions
SD

Functions

void | HAL_SD_AbortCallback (SD_HandleTypeDef *hsd)
SD Abort callbacks.
void | HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd)
Tx Transfer completed callbacks.
void | HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd)
Rx Transfer completed callbacks.
__weak void | BSP_SD_AbortCallback (uint32_t Instance)
BSP SD Abort callbacks.
__weak void | BSP_SD_WriteCpltCallback (uint32_t Instance)
BSP Tx Transfer completed callbacks.
__weak void | BSP_SD_ReadCpltCallback (uint32_t Instance)
BSP Rx Transfer completed callbacks.
static void | SD_EXTI_Callback (void)
SD EXTI line detection callbacks.
static void | SD_MspInit (SD_HandleTypeDef *hsd)
Initializes the SD MSP.
static void | SD_MspDeInit (SD_HandleTypeDef *hsd)
DeInitializes the SD MSP.

Function Documentation

__weak void BSP_SD_AbortCallback ( uint32_t Instance )

BSP SD Abort callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 764 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

__weak void BSP_SD_ReadCpltCallback ( uint32_t Instance )

BSP Rx Transfer completed callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 786 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_RxCpltCallback().

__weak void BSP_SD_WriteCpltCallback ( uint32_t Instance )

BSP Tx Transfer completed callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 775 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_TxCpltCallback().

void HAL_SD_AbortCallback ( SD_HandleTypeDef * hsd )

SD Abort callbacks.

Parameters:
hsd SD handle
Return values:
None

Definition at line 733 of file stm32h735g_discovery_sd.c.

References BSP_SD_AbortCallback(), and hsd_sdmmc.

void HAL_SD_RxCpltCallback ( SD_HandleTypeDef * hsd )

Rx Transfer completed callbacks.

Parameters:
hsd SD handle
Return values:
None

Definition at line 753 of file stm32h735g_discovery_sd.c.

References BSP_SD_ReadCpltCallback(), and hsd_sdmmc.

void HAL_SD_TxCpltCallback ( SD_HandleTypeDef * hsd )

Tx Transfer completed callbacks.

Parameters:
hsd SD handle
Return values:
None

Definition at line 743 of file stm32h735g_discovery_sd.c.

References BSP_SD_WriteCpltCallback(), and hsd_sdmmc.

static void SD_EXTI_Callback ( void ) [static]

SD EXTI line detection callbacks.

Return values:
None

Definition at line 796 of file stm32h735g_discovery_sd.c.

References BSP_SD_DetectCallback(), PinDetect, SD_GPIO_PORT, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_DetectITConfig().

static void SD_MspDeInit ( SD_HandleTypeDef * hsd ) [static]

DeInitializes the SD MSP.

Parameters:
hsd SD handle
Return values:
None

Definition at line 854 of file stm32h735g_discovery_sd.c.

References hsd_sdmmc.

Referenced by BSP_SD_DeInit().

static void SD_MspInit ( SD_HandleTypeDef * hsd ) [static]

Initializes the SD MSP.

Parameters:
hsd SD handle
Return values:
None

Definition at line 817 of file stm32h735g_discovery_sd.c.

References BSP_SD_IT_PRIORITY.

Referenced by BSP_SD_Init().


STM32H735G-DK BSP User Manual: Exported Types

Defines
Exported Types
SD

Defines

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.

Define Documentation

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef

SD Card information structure.

Definition at line 51 of file stm32h735g_discovery_sd.h.


STM32H735G-DK BSP User Manual: Exported Constants

Defines
Exported Constants
SD

Defines

#define | SD_INSTANCES_NBR 1UL
#define | SD_TRANSFER_OK 0U
SD transfer state definition.
#define | SD_TRANSFER_BUSY 1U
#define | SD_PRESENT 1UL
SD-detect signal.
#define | SD_NOT_PRESENT 0UL
#define | SD_DETECT_PIN GPIO_PIN_5
#define | SD_DETECT_GPIO_PORT GPIOF
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI9_5_IRQn
#define | SD_DETECT_EXTI_LINE EXTI_LINE_5
#define | SD1_DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD1_SDMMC1_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD1_SDMMC1_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD1_SDMMC1_DMAx_Tx_STREAM DMA2_Stream6
#define | SD1_SDMMC1_DMAx_Rx_STREAM DMA2_Stream3
#define | SD1_SDMMC1_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD1_SDMMC1_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | SD1_SDMMC1_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | SD1_SDMMC1_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler
#define | SD1_SDMMC1_IRQHandler SDMMC1_IRQHandler

Define Documentation

#define SD1_DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 97 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 105 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 104 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Rx_CHANNEL DMA_CHANNEL_4

Definition at line 99 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Rx_IRQn DMA2_Stream3_IRQn

Definition at line 103 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Rx_STREAM DMA2_Stream3

Definition at line 101 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Tx_CHANNEL DMA_CHANNEL_4

Definition at line 98 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Tx_IRQn DMA2_Stream6_IRQn

Definition at line 102 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_DMAx_Tx_STREAM DMA2_Stream6

Definition at line 100 of file stm32h735g_discovery_sd.h.

#define SD1_SDMMC1_IRQHandler SDMMC1_IRQHandler

Definition at line 106 of file stm32h735g_discovery_sd.h.

#define SD_DETECT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 93 of file stm32h735g_discovery_sd.h.

#define SD_DETECT_EXTI_LINE EXTI_LINE_5

Definition at line 94 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_DetectITConfig().

#define SD_DETECT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 92 of file stm32h735g_discovery_sd.h.

#define SD_DETECT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 91 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_DetectITConfig(), and BSP_SD_Init().

#define SD_DETECT_GPIO_PORT GPIOF

Definition at line 90 of file stm32h735g_discovery_sd.h.

#define SD_DETECT_PIN GPIO_PIN_5

Definition at line 89 of file stm32h735g_discovery_sd.h.

#define SD_INSTANCES_NBR 1UL

Definition at line 67 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_DeInit(), BSP_SD_DetectITConfig(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_Init(), BSP_SD_IsDetected(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), and BSP_SD_WriteBlocks_IT().

#define SD_NOT_PRESENT 0UL

Definition at line 87 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_IsDetected(), and SD_EXTI_Callback().

#define SD_PRESENT 1UL

SD-detect signal.

Definition at line 86 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_Init(), BSP_SD_IsDetected(), and SD_EXTI_Callback().

#define SD_TRANSFER_BUSY 1U

Definition at line 81 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK 0U

SD transfer state definition.

Definition at line 80 of file stm32h735g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().


STM32H735G-DK BSP User Manual: Exported Functions Prototypes

Functions
Exported Functions Prototypes
SD

Functions

int32_t | BSP_SD_Init (uint32_t Instance)
STM32H735G_DK_SD_Exported_Functions Exported Functions
int32_t | BSP_SD_DeInit (uint32_t Instance)
DeInitializes the SD card device.
int32_t | BSP_SD_DetectITConfig (uint32_t Instance)
Configures Interrupt mode for SD detection pin.
int32_t | BSP_SD_ReadBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in polling mode.
int32_t | BSP_SD_WriteBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in polling mode.
int32_t | BSP_SD_ReadBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_ReadBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_Erase (uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr)
Erases the specified memory area of the given SD card.
int32_t | BSP_SD_GetCardState (uint32_t Instance)
Gets the current SD card data status.
int32_t | BSP_SD_GetCardInfo (uint32_t Instance, BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
int32_t | BSP_SD_IsDetected (uint32_t Instance)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_AbortCallback (uint32_t Instance)
BSP SD Abort callbacks.
void | BSP_SD_WriteCpltCallback (uint32_t Instance)
BSP Tx Transfer completed callbacks.
void | BSP_SD_ReadCpltCallback (uint32_t Instance)
BSP Rx Transfer completed callbacks.
HAL_StatusTypeDef | MX_SDMMC1_SD_Init (SD_HandleTypeDef *hsd)
Initializes the SDMMC1 peripheral.
void | BSP_SD_DetectCallback (uint32_t Instance, uint32_t Status)
BSP SD Callback.
void | BSP_SD_DETECT_IRQHandler (uint32_t Instance)
This function handles SD interrupt request.
void | BSP_SD_IRQHandler (uint32_t Instance)
This function handles SDMMC interrupt requests.

Function Documentation

void BSP_SD_AbortCallback ( uint32_t Instance )

BSP SD Abort callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 764 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

int32_t BSP_SD_DeInit ( uint32_t Instance )

DeInitializes the SD card device.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 226 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, SD_INSTANCES_NBR, and SD_MspDeInit().

void BSP_SD_DETECT_IRQHandler ( uint32_t Instance )

This function handles SD interrupt request.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 675 of file stm32h735g_discovery_sd.c.

References hsd_exti.

void BSP_SD_DetectCallback | ( | uint32_t | Instance,
 |  | uint32_t | Status
 | ) |  |

BSP SD Callback.

Parameters:
Instance | SD Instance
Status | Pin status
Return values:
None.

Definition at line 395 of file stm32h735g_discovery_sd.c.

Referenced by SD_EXTI_Callback().

int32_t BSP_SD_DetectITConfig ( uint32_t Instance )

Configures Interrupt mode for SD detection pin.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 349 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_SD_IT_PRIORITY, hsd_exti, PinDetect, SD_DETECT_EXTI_LINE, SD_DETECT_GPIO_CLK_ENABLE, SD_EXTI_Callback(), SD_EXTI_IRQn, SD_GPIO_PORT, and SD_INSTANCES_NBR.

int32_t BSP_SD_Erase | ( | uint32_t | Instance,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Erases the specified memory area of the given SD card.

Parameters:
Instance | SD Instance
BlockIdx | Block index from where data is to be
BlocksNbr | Number of SD blocks to erase
Return values:
SD status

Definition at line 611 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_GetCardInfo | ( | uint32_t | Instance,
 |  | BSP_SD_CardInfo * | CardInfo
 | ) |  |

Get SD information about specific SD card.

Parameters:
Instance | SD Instance
CardInfo | Pointer to HAL_SD_CardInfoTypedef structure
Return values:
BSP status

Definition at line 650 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_GetCardState ( uint32_t Instance )

Gets the current SD card data status.

Parameters:
Instance SD Instance
Return values:
Data transfer state. This value can be one of the following values:
  • SD_TRANSFER_OK: No data transfer is acting
  • SD_TRANSFER_BUSY: Data transfer is acting

Definition at line 639 of file stm32h735g_discovery_sd.c.

References hsd_sdmmc, SD_TRANSFER_BUSY, and SD_TRANSFER_OK.

int32_t BSP_SD_Init ( uint32_t Instance )

STM32H735G_DK_SD_Exported_Functions Exported Functions

Initializes the SD card device.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 139 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_UNKNOWN_COMPONENT, BSP_ERROR_WRONG_PARAM, BSP_SD_IsDetected(), hsd_sdmmc, MX_SDMMC1_SD_Init(), PinDetect, SD_DETECT_GPIO_CLK_ENABLE, SD_GPIO_PORT, SD_INSTANCES_NBR, SD_MspInit(), and SD_PRESENT.

void BSP_SD_IRQHandler ( uint32_t Instance )

This function handles SDMMC interrupt requests.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 685 of file stm32h735g_discovery_sd.c.

References hsd_sdmmc.

int32_t BSP_SD_IsDetected ( uint32_t Instance )

Detects if SD card is correctly plugged in the memory slot or not.

Parameters:
Instance SD Instance
Return values:
Returns if SD is detected or not

Definition at line 410 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_WRONG_PARAM, PinDetect, SD_GPIO_PORT, SD_INSTANCES_NBR, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_Init().

int32_t BSP_SD_ReadBlocks | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in polling mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
BSP status

Definition at line 441 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_ReadBlocks_DMA | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
BSP status

Definition at line 499 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_ReadBlocks_IT | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
SD status

Definition at line 555 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

void BSP_SD_ReadCpltCallback ( uint32_t Instance )

BSP Rx Transfer completed callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 786 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_RxCpltCallback().

int32_t BSP_SD_WriteBlocks | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in polling mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
BSP status

Definition at line 470 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_WriteBlocks_DMA | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
BSP status

Definition at line 527 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_WriteBlocks_IT | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
SD status

Definition at line 583 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

void BSP_SD_WriteCpltCallback ( uint32_t Instance )

BSP Tx Transfer completed callbacks.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 775 of file stm32h735g_discovery_sd.c.

Referenced by HAL_SD_TxCpltCallback().

HAL_StatusTypeDef MX_SDMMC1_SD_Init ( SD_HandleTypeDef * hsd )

Initializes the SDMMC1 peripheral.

Parameters:
hsd SD handle
Return values:
HAL status

Definition at line 254 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_Init().


STM32H735G-DK BSP User Manual: SD

Modules
SD
STM32H735G_DK

Modules

Private TypesDefinitions
Private Variables
Exported Variables
Private Functions Prototypes
Private Functions
Exported Types
Exported Constants
Exported Functions Prototypes
int32_t | BSP_SD_Init (uint32_t Instance)
STM32H735G_DK_SD_Exported_Functions Exported Functions
int32_t | BSP_SD_DeInit (uint32_t Instance)
DeInitializes the SD card device.
__weak HAL_StatusTypeDef | MX_SDMMC1_SD_Init (SD_HandleTypeDef *hsd)
Initializes the SDMMC1 peripheral.
int32_t | BSP_SD_DetectITConfig (uint32_t Instance)
Configures Interrupt mode for SD detection pin.
__weak void | BSP_SD_DetectCallback (uint32_t Instance, uint32_t Status)
BSP SD Callback.
int32_t | BSP_SD_IsDetected (uint32_t Instance)
Detects if SD card is correctly plugged in the memory slot or not.
int32_t | BSP_SD_ReadBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in polling mode.
int32_t | BSP_SD_WriteBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in polling mode.
int32_t | BSP_SD_ReadBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_ReadBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_Erase (uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr)
Erases the specified memory area of the given SD card.
int32_t | BSP_SD_GetCardState (uint32_t Instance)
Gets the current SD card data status.
int32_t | BSP_SD_GetCardInfo (uint32_t Instance, BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
void | BSP_SD_DETECT_IRQHandler (uint32_t Instance)
This function handles SD interrupt request.
void | BSP_SD_IRQHandler (uint32_t Instance)
This function handles SDMMC interrupt requests.

Function Documentation

int32_t BSP_SD_DeInit ( uint32_t Instance )

DeInitializes the SD card device.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 226 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, SD_INSTANCES_NBR, and SD_MspDeInit().

void BSP_SD_DETECT_IRQHandler ( uint32_t Instance )

This function handles SD interrupt request.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 675 of file stm32h735g_discovery_sd.c.

References hsd_exti.

__weak void BSP_SD_DetectCallback | ( | uint32_t | Instance,
 |  | uint32_t | Status
 | ) |  |

BSP SD Callback.

Parameters:
Instance | SD Instance
Status | Pin status
Return values:
None.

Definition at line 395 of file stm32h735g_discovery_sd.c.

Referenced by SD_EXTI_Callback().

int32_t BSP_SD_DetectITConfig ( uint32_t Instance )

Configures Interrupt mode for SD detection pin.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 349 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_SD_IT_PRIORITY, hsd_exti, PinDetect, SD_DETECT_EXTI_LINE, SD_DETECT_GPIO_CLK_ENABLE, SD_EXTI_Callback(), SD_EXTI_IRQn, SD_GPIO_PORT, and SD_INSTANCES_NBR.

int32_t BSP_SD_Erase | ( | uint32_t | Instance,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Erases the specified memory area of the given SD card.

Parameters:
Instance | SD Instance
BlockIdx | Block index from where data is to be
BlocksNbr | Number of SD blocks to erase
Return values:
SD status

Definition at line 611 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_GetCardInfo | ( | uint32_t | Instance,
 |  | BSP_SD_CardInfo * | CardInfo
 | ) |  |

Get SD information about specific SD card.

Parameters:
Instance | SD Instance
CardInfo | Pointer to HAL_SD_CardInfoTypedef structure
Return values:
BSP status

Definition at line 650 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_GetCardState ( uint32_t Instance )

Gets the current SD card data status.

Parameters:
Instance SD Instance
Return values:
Data transfer state. This value can be one of the following values:
  • SD_TRANSFER_OK: No data transfer is acting
  • SD_TRANSFER_BUSY: Data transfer is acting

Definition at line 639 of file stm32h735g_discovery_sd.c.

References hsd_sdmmc, SD_TRANSFER_BUSY, and SD_TRANSFER_OK.

int32_t BSP_SD_Init ( uint32_t Instance )

STM32H735G_DK_SD_Exported_Functions Exported Functions

Initializes the SD card device.

Parameters:
Instance SD Instance
Return values:
BSP status

Definition at line 139 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_UNKNOWN_COMPONENT, BSP_ERROR_WRONG_PARAM, BSP_SD_IsDetected(), hsd_sdmmc, MX_SDMMC1_SD_Init(), PinDetect, SD_DETECT_GPIO_CLK_ENABLE, SD_GPIO_PORT, SD_INSTANCES_NBR, SD_MspInit(), and SD_PRESENT.

void BSP_SD_IRQHandler ( uint32_t Instance )

This function handles SDMMC interrupt requests.

Parameters:
Instance SD Instance
Return values:
None

Definition at line 685 of file stm32h735g_discovery_sd.c.

References hsd_sdmmc.

int32_t BSP_SD_IsDetected ( uint32_t Instance )

Detects if SD card is correctly plugged in the memory slot or not.

Parameters:
Instance SD Instance
Return values:
Returns if SD is detected or not

Definition at line 410 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_WRONG_PARAM, PinDetect, SD_GPIO_PORT, SD_INSTANCES_NBR, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_Init().

int32_t BSP_SD_ReadBlocks | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in polling mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
BSP status

Definition at line 441 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_ReadBlocks_DMA | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
BSP status

Definition at line 499 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_ReadBlocks_IT | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Reads block(s) from a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be read
BlocksNbr | Number of SD blocks to read
Return values:
SD status

Definition at line 555 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_WriteBlocks | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in polling mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
BSP status

Definition at line 470 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_WriteBlocks_DMA | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
BSP status

Definition at line 527 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

int32_t BSP_SD_WriteBlocks_IT | ( | uint32_t | Instance,
 |  | uint32_t * | pData,
 |  | uint32_t | BlockIdx,
 |  | uint32_t | BlocksNbr
 | ) |  |

Writes block(s) to a specified address in an SD card, in DMA mode.

Parameters:
Instance | SD Instance
pData | Pointer to the buffer that will contain the data to transmit
BlockIdx | Block index from where data is to be written
BlocksNbr | Number of SD blocks to write
Return values:
SD status

Definition at line 583 of file stm32h735g_discovery_sd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hsd_sdmmc, and SD_INSTANCES_NBR.

__weak HAL_StatusTypeDef MX_SDMMC1_SD_Init ( SD_HandleTypeDef * hsd )

Initializes the SDMMC1 peripheral.

Parameters:
hsd SD handle
Return values:
HAL status

Definition at line 254 of file stm32h735g_discovery_sd.c.

Referenced by BSP_SD_Init().


STM32H735G-DK BSP User Manual: TS Private Types Definitions

Typedefs
TS Private Types Definitions
STM32H735G_DK TS

Typedefs

typedef void(* BSP_EXTI_LineCallback )(void)

Typedef Documentation

typedef void(* BSP_EXTI_LineCallback)(void)

Definition at line 69 of file stm32h735g_discovery_ts.c.


STM32H735G-DK BSP User Manual: TS Private Types Defines

TS Private Types Defines
STM32H735G_DK TS


STM32H735G-DK BSP User Manual: TS Private Macros

Defines
TS Private Macros
STM32H735G_DK TS

Defines

#define TS_MIN(a, b) ((a > b) ? b : a)

Define Documentation

#define TS_MIN | ( | a,
 |  | b
 | ) | ((a > b) ? b : a)

Definition at line 84 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_Init().


STM32H735G-DK BSP User Manual: TS Private Function Prototypes

TS Private Function Prototypes
STM32H735G_DK TS


STM32H735G-DK BSP User Manual: TS Privates Variables

Variables
TS Privates Variables
STM32H735G_DK TS

Variables

static TS_Drv_t * Ts_Drv = NULL

Variable Documentation

TS_Drv_t* Ts_Drv = NULL [static]

Definition at line 100 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), FT5336_Probe(), and TS_EXTI_Callback().


STM32H735G-DK BSP User Manual: TS Exported Variables

Variables
TS Exported Variables
STM32H735G_DK TS

Variables

EXTI_HandleTypeDef | hts_exti [TS_INSTANCES_NBR] = {0}
void * | Ts_CompObj [TS_INSTANCES_NBR] = {0}
TS_Ctx_t | Ts_Ctx [TS_INSTANCES_NBR] = {0}
void * | Ts_CompObj []
EXTI_HandleTypeDef | hts_exti []
TS_Ctx_t Ts_Ctx []

Variable Documentation

EXTI_HandleTypeDef hts_exti[TS_INSTANCES_NBR] = {0}

Definition at line 108 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_EnableIT(), and BSP_TS_IRQHandler().

EXTI_HandleTypeDef hts_exti[]

Definition at line 108 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_EnableIT(), and BSP_TS_IRQHandler().

void* Ts_CompObj[TS_INSTANCES_NBR] = {0}

Definition at line 109 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), FT5336_Probe(), and TS_EXTI_Callback().

void* Ts_CompObj[]

Definition at line 109 of file stm32h735g_discovery_ts.c.

Referenced by BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), FT5336_Probe(), and TS_EXTI_Callback().

TS_Ctx_t Ts_Ctx[TS_INSTANCES_NBR] = {0}

Definition at line 110 of file stm32h735g_discovery_ts.c.

TS_Ctx_t Ts_Ctx[]

Definition at line 110 of file stm32h735g_discovery_ts.c.


STM32H735G-DK BSP User Manual: TS Private Functions

Functions
TS Private Functions
STM32H735G_DK TS

Functions

static int32_t | FT5336_Probe (uint32_t Instance)
Register Bus IOs if component ID is OK.
static void | TS_EXTI_Callback (void)
TS EXTI touch detection callbacks.

Function Documentation

static int32_t FT5336_Probe ( uint32_t Instance ) [static]

Register Bus IOs if component ID is OK.

Parameters:
Instance TS instance. Could be only 0.
Return values:
BSP status

Definition at line 622 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_BUS_FAILURE, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_UNKNOWN_COMPONENT, BSP_GetTick(), BSP_I2C4_DeInit(), BSP_I2C4_Init(), BSP_I2C4_ReadReg(), BSP_I2C4_WriteReg(), Ts_CompObj, Ts_Drv, and TS_I2C_ADDRESS.

Referenced by BSP_TS_Init().

static void TS_EXTI_Callback ( void ) [static]

TS EXTI touch detection callbacks.

Return values:
None

Definition at line 667 of file stm32h735g_discovery_ts.c.

References BSP_TS_Callback(), Ts_CompObj, and Ts_Drv.

Referenced by BSP_TS_EnableIT().


STM32H735G-DK BSP User Manual: TS Exported Constants

Defines
TS Exported Constants
STM32H735G_DK TS

Defines

#define | TS_INSTANCES_NBR 1
#define | TS_MAX_WIDTH 480U /* Touchscreen pad max width */
#define | TS_MAX_HEIGHT 272U /* Touchscreen pad max height */
#define | TS_SWAP_NONE 0x01U
#define | TS_SWAP_X 0x02U
#define | TS_SWAP_Y 0x04U
#define | TS_SWAP_XY 0x08U
#define | TS_I2C_ADDRESS 0x70U
TouchScreen Slave I2C address 1.
#define | TS_INT_PIN GPIO_PIN_2
Touch screen interrupt signal.
#define | TS_INT_GPIO_PORT GPIOG
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI2_IRQn
#define | TS_EXTI_LINE EXTI_LINE_2

Define Documentation

#define TS_EXTI_LINE EXTI_LINE_2

Definition at line 85 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_EnableIT().

#define TS_I2C_ADDRESS 0x70U

TouchScreen Slave I2C address 1.

Definition at line 75 of file stm32h735g_discovery_ts.h.

Referenced by BSP_LCD_InitEx(), and FT5336_Probe().

#define TS_INSTANCES_NBR 1

Definition at line 61 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), and BSP_TS_Init().

#define TS_INT_EXTI_IRQn EXTI2_IRQn

Definition at line 84 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_EnableIT().

#define TS_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 83 of file stm32h735g_discovery_ts.h.

#define TS_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 82 of file stm32h735g_discovery_ts.h.

#define TS_INT_GPIO_PORT GPIOG

Definition at line 81 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_DisableIT(), and BSP_TS_EnableIT().

#define TS_INT_PIN GPIO_PIN_2

Touch screen interrupt signal.

Definition at line 80 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_DisableIT(), and BSP_TS_EnableIT().

#define TS_MAX_HEIGHT 272U /* Touchscreen pad max height */

Definition at line 65 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

#define TS_MAX_WIDTH 480U /* Touchscreen pad max width */

Definition at line 64 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

#define TS_SWAP_NONE 0x01U

Definition at line 67 of file stm32h735g_discovery_ts.h.

#define TS_SWAP_X 0x02U

Definition at line 68 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), and BSP_TS_GetState().

#define TS_SWAP_XY 0x08U

Definition at line 70 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), and BSP_TS_GetState().

#define TS_SWAP_Y 0x04U

Definition at line 69 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), and BSP_TS_GetState().


STM32H735G-DK BSP User Manual: TS Exported Types

Data Structures | Defines | Enumerations
TS Exported Types
STM32H735G_DK TS

Data Structures

struct | TS_Init_t
struct | TS_Ctx_t
struct | TS_Capabilities_t
struct | TS_State_t
struct | TS_MultiTouch_State_t
struct | TS_Gesture_Config_t

Defines

#define | GESTURE_ID_NO_GESTURE 0x00U
TS_Gesture_Id_t Define Possible managed gesture identification values returned by touch screen driver.
#define | GESTURE_ID_MOVE_UP 0x01U
#define | GESTURE_ID_MOVE_RIGHT 0x02U
#define | GESTURE_ID_MOVE_DOWN 0x03U
#define | GESTURE_ID_MOVE_LEFT 0x04U
#define | GESTURE_ID_ZOOM_IN 0x05U
#define | GESTURE_ID_ZOOM_OUT 0x06U
#define | GESTURE_ID_NB_MAX 0x07U

Enumerations

enum TS_TouchEventTypeDef {
TOUCH_EVENT_NO_EVT = 0x00, TOUCH_EVENT_PRESS_DOWN = 0x01, TOUCH_EVENT_LIFT_UP = 0x02, TOUCH_EVENT_CONTACT = 0x03,
TOUCH_EVENT_NB_MAX = 0x04
}
TS_TouchEventTypeDef Define Possible touch events kind as returned values by touch screen IC Driver. More...

Define Documentation

#define GESTURE_ID_MOVE_DOWN 0x03U

Gesture Move Down

Definition at line 150 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_MOVE_LEFT 0x04U

Gesture Move Left

Definition at line 151 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_MOVE_RIGHT 0x02U

Gesture Move Right

Definition at line 149 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_MOVE_UP 0x01U

Gesture Move Up

Definition at line 148 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_NB_MAX 0x07U

max number of gesture id

Definition at line 154 of file stm32h735g_discovery_ts.h.

#define GESTURE_ID_NO_GESTURE 0x00U

TS_Gesture_Id_t Define Possible managed gesture identification values returned by touch screen driver.

Gesture not defined / recognized

Definition at line 147 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_ZOOM_IN 0x05U

Gesture Zoom In

Definition at line 152 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

#define GESTURE_ID_ZOOM_OUT 0x06U

Gesture Zoom Out

Definition at line 153 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetGestureId().

Enumeration Type Documentation

enum TS_TouchEventTypeDef

TS_TouchEventTypeDef Define Possible touch events kind as returned values by touch screen IC Driver.

Enumerator:
TOUCH_EVENT_NO_EVT

Touch Event : undetermined

TOUCH_EVENT_PRESS_DOWN

Touch Event Press Down

TOUCH_EVENT_LIFT_UP

Touch Event Lift Up

TOUCH_EVENT_CONTACT

Touch Event Contact

TOUCH_EVENT_NB_MAX

max number of touch events kind

Definition at line 173 of file stm32h735g_discovery_ts.h.


STM32H735G-DK BSP User Manual: TS_Init_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_Init_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint32_t | Width
uint32_t | Height
uint32_t | Orientation
uint32_t | Accuracy

Detailed Description

Definition at line 94 of file stm32h735g_discovery_ts.h.

Field Documentation

uint32_t TS_Init_t::Accuracy

Definition at line 99 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

uint32_t TS_Init_t::Height

Definition at line 97 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

uint32_t TS_Init_t::Orientation

Definition at line 98 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

uint32_t TS_Init_t::Width

Definition at line 96 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_Ctx_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint32_t | Width
uint32_t | Height
uint32_t | Orientation
uint32_t | Accuracy
uint32_t | MaxX
uint32_t | MaxY
uint32_t | PreviousX [TS_TOUCH_NBR]
uint32_t | PreviousY [TS_TOUCH_NBR]

Detailed Description

Definition at line 103 of file stm32h735g_discovery_ts.h.

Field Documentation

uint32_t TS_Ctx_t::Accuracy

Definition at line 108 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::Height

Definition at line 106 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::MaxX

Definition at line 109 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::MaxY

Definition at line 110 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::Orientation

Definition at line 107 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_Orientation(), BSP_TS_Init(), and BSP_TS_Set_Orientation().

uint32_t TS_Ctx_t::PreviousX[TS_TOUCH_NBR]

Definition at line 111 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::PreviousY[TS_TOUCH_NBR]

Definition at line 112 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

uint32_t TS_Ctx_t::Width

Definition at line 105 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState(), BSP_TS_GetState(), and BSP_TS_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS_Capabilities_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_Capabilities_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint8_t | MultiTouch
uint8_t | Gesture
uint8_t | MaxTouch
uint32_t | MaxXl
uint32_t | MaxYl

Detailed Description

Definition at line 115 of file stm32h735g_discovery_ts.h.

Field Documentation

uint8_t TS_Capabilities_t::Gesture

Definition at line 118 of file stm32h735g_discovery_ts.h.

uint8_t TS_Capabilities_t::MaxTouch

Definition at line 119 of file stm32h735g_discovery_ts.h.

uint32_t TS_Capabilities_t::MaxXl

Definition at line 120 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

uint32_t TS_Capabilities_t::MaxYl

Definition at line 121 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Init().

uint8_t TS_Capabilities_t::MultiTouch

Definition at line 117 of file stm32h735g_discovery_ts.h.

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS_State_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_State_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint32_t | TouchDetected
uint32_t | TouchX
uint32_t | TouchY

Detailed Description

Definition at line 124 of file stm32h735g_discovery_ts.h.

Field Documentation

uint32_t TS_State_t::TouchDetected

Definition at line 126 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint32_t TS_State_t::TouchX

Definition at line 127 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint32_t TS_State_t::TouchY

Definition at line 128 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_GetState().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS_MultiTouch_State_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_MultiTouch_State_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint32_t | TouchDetected
uint32_t | TouchX [TS_TOUCH_NBR]
uint32_t | TouchY [TS_TOUCH_NBR]
uint32_t | TouchWeight [TS_TOUCH_NBR]
uint32_t | TouchEvent [TS_TOUCH_NBR]
uint32_t | TouchArea [TS_TOUCH_NBR]

Detailed Description

Definition at line 131 of file stm32h735g_discovery_ts.h.

Field Documentation

uint32_t TS_MultiTouch_State_t::TouchArea[TS_TOUCH_NBR]

Definition at line 138 of file stm32h735g_discovery_ts.h.

uint32_t TS_MultiTouch_State_t::TouchDetected

Definition at line 133 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState().

uint32_t TS_MultiTouch_State_t::TouchEvent[TS_TOUCH_NBR]

Definition at line 137 of file stm32h735g_discovery_ts.h.

uint32_t TS_MultiTouch_State_t::TouchWeight[TS_TOUCH_NBR]

Definition at line 136 of file stm32h735g_discovery_ts.h.

uint32_t TS_MultiTouch_State_t::TouchX[TS_TOUCH_NBR]

Definition at line 134 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState().

uint32_t TS_MultiTouch_State_t::TouchY[TS_TOUCH_NBR]

Definition at line 135 of file stm32h735g_discovery_ts.h.

Referenced by BSP_TS_Get_MultiTouchState().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS_Gesture_Config_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
TS_Gesture_Config_t Struct Reference
TS Exported Types

#include <stm32h735g_discovery_ts.h>

Data Fields

uint32_t | Radian
uint32_t | OffsetLeftRight
uint32_t | OffsetUpDown
uint32_t | DistanceLeftRight
uint32_t | DistanceUpDown
uint32_t | DistanceZoom

Detailed Description

Definition at line 156 of file stm32h735g_discovery_ts.h.

Field Documentation

uint32_t TS_Gesture_Config_t::DistanceLeftRight

Definition at line 161 of file stm32h735g_discovery_ts.h.

uint32_t TS_Gesture_Config_t::DistanceUpDown

Definition at line 162 of file stm32h735g_discovery_ts.h.

uint32_t TS_Gesture_Config_t::DistanceZoom

Definition at line 163 of file stm32h735g_discovery_ts.h.

uint32_t TS_Gesture_Config_t::OffsetLeftRight

Definition at line 159 of file stm32h735g_discovery_ts.h.

uint32_t TS_Gesture_Config_t::OffsetUpDown

Definition at line 160 of file stm32h735g_discovery_ts.h.

uint32_t TS_Gesture_Config_t::Radian

Definition at line 158 of file stm32h735g_discovery_ts.h.

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: TS Exported Functions

Functions
TS Exported Functions
STM32H735G_DK TS

Functions

int32_t | BSP_TS_Init (uint32_t Instance, TS_Init_t *TS_Init)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
int32_t | BSP_TS_DeInit (uint32_t Instance)
De-Initializes the touch screen functionalities.
int32_t | BSP_TS_GetCapabilities (uint32_t Instance, TS_Capabilities_t *Capabilities)
Get Touch Screen instance capabilities.
int32_t | BSP_TS_EnableIT (uint32_t Instance)
Configures and enables the touch screen interrupts.
int32_t | BSP_TS_DisableIT (uint32_t Instance)
Disables the touch screen interrupts.
void | BSP_TS_IRQHandler (uint32_t Instance)
This function handles TS interrupt request.
__weak void | BSP_TS_Callback (uint32_t Instance)
BSP TS Callback.
int32_t | BSP_TS_GetState (uint32_t Instance, TS_State_t *TS_State)
Returns positions of a single touch screen.
int32_t | BSP_TS_Get_MultiTouchState (uint32_t Instance, TS_MultiTouch_State_t *TS_State)
Returns positions of multi touch screen.
int32_t | BSP_TS_GestureConfig (uint32_t Instance, TS_Gesture_Config_t *GestureConfig)
Update gesture Id following a touch detected.
int32_t | BSP_TS_GetGestureId (uint32_t Instance, uint32_t *GestureId)
Update gesture Id following a touch detected.
int32_t | BSP_TS_Set_Orientation (uint32_t Instance, uint32_t Orientation)
Set TS orientation.
int32_t | BSP_TS_Get_Orientation (uint32_t Instance, uint32_t *Orientation)
Get TS orientation.

Function Documentation

void BSP_TS_Callback ( uint32_t Instance )

BSP TS Callback.

Return values:
None.

Definition at line 316 of file stm32h735g_discovery_ts.c.

Referenced by TS_EXTI_Callback().

int32_t BSP_TS_DeInit ( uint32_t Instance )

De-Initializes the touch screen functionalities.

Parameters:
Instance TS instance. Could be only 0.
Return values:
BSP status

Definition at line 179 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, Ts_CompObj, Ts_Drv, and TS_INSTANCES_NBR.

int32_t BSP_TS_DisableIT ( uint32_t Instance )

Disables the touch screen interrupts.

Parameters:
Instance TS instance. Could be only 0.
Return values:
BSP status

Definition at line 275 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, Ts_CompObj, Ts_Drv, TS_INSTANCES_NBR, TS_INT_GPIO_PORT, and TS_INT_PIN.

int32_t BSP_TS_EnableIT ( uint32_t Instance )

Configures and enables the touch screen interrupts.

Parameters:
Instance TS instance. Could be only 0.
Return values:
BSP status

Definition at line 225 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_TS_IT_PRIORITY, hts_exti, Ts_CompObj, Ts_Drv, TS_EXTI_Callback(), TS_EXTI_LINE, TS_INSTANCES_NBR, TS_INT_EXTI_IRQn, TS_INT_GPIO_PORT, and TS_INT_PIN.

int32_t BSP_TS_GestureConfig | ( | uint32_t | Instance,
 |  | TS_Gesture_Config_t * | GestureConfig
 | ) |  |

Update gesture Id following a touch detected.

Parameters:
Instance | TS instance. Could be only 0.
GestureConfig | Pointer to gesture configuration structure
Return values:
BSP status

Definition at line 512 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, Ts_CompObj, Ts_Drv, and TS_INSTANCES_NBR.

int32_t BSP_TS_Get_MultiTouchState | ( | uint32_t | Instance,
 |  | TS_MultiTouch_State_t * | TS_State
 | ) |  |

Returns positions of multi touch screen.

Parameters:
Instance | TS instance. Could be only 0.
TS_State | Pointer to touch screen current state structure
Return values:
BSP status

Definition at line 414 of file stm32h735g_discovery_ts.c.

References TS_Ctx_t::Accuracy, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, TS_Ctx_t::Height, TS_Ctx_t::MaxX, TS_Ctx_t::MaxY, TS_Ctx_t::PreviousX, TS_Ctx_t::PreviousY, TS_MultiTouch_State_t::TouchDetected, TS_MultiTouch_State_t::TouchX, TS_MultiTouch_State_t::TouchY, Ts_CompObj, Ts_Drv, TS_INSTANCES_NBR, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, TS_TOUCH_NBR, and TS_Ctx_t::Width.

int32_t BSP_TS_Get_Orientation | ( | uint32_t | Instance,
 |  | uint32_t * | Orientation
 | ) |  |

Get TS orientation.

Parameters:
Instance | TS instance. Could be only 0.
Orientation | Current Orientation to be returned
Return values:
BSP status

Definition at line 604 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_NONE, and TS_Ctx_t::Orientation.

int32_t BSP_TS_GetCapabilities | ( | uint32_t | Instance,
 |  | TS_Capabilities_t * | Capabilities
 | ) |  |

Get Touch Screen instance capabilities.

Parameters:
Instance | Touch Screen instance
Capabilities | pointer to Touch Screen capabilities
Return values:
BSP status

Definition at line 204 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, Ts_CompObj, Ts_Drv, and TS_INSTANCES_NBR.

int32_t BSP_TS_GetGestureId | ( | uint32_t | Instance,
 |  | uint32_t * | GestureId
 | ) |  |

Update gesture Id following a touch detected.

Parameters:
Instance | TS instance. Could be only 0.
GestureId | Pointer to gesture ID
Return values:
BSP status

Definition at line 537 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, GESTURE_ID_MOVE_DOWN, GESTURE_ID_MOVE_LEFT, GESTURE_ID_MOVE_RIGHT, GESTURE_ID_MOVE_UP, GESTURE_ID_NO_GESTURE, GESTURE_ID_ZOOM_IN, GESTURE_ID_ZOOM_OUT, Ts_CompObj, Ts_Drv, and TS_INSTANCES_NBR.

int32_t BSP_TS_GetState | ( | uint32_t | Instance,
 |  | TS_State_t * | TS_State
 | ) |  |

Returns positions of a single touch screen.

Parameters:
Instance | TS instance. Could be only 0.
TS_State | Pointer to touch screen current state structure
Return values:
BSP status

Definition at line 328 of file stm32h735g_discovery_ts.c.

References TS_Ctx_t::Accuracy, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, TS_Ctx_t::Height, TS_Ctx_t::MaxX, TS_Ctx_t::MaxY, TS_Ctx_t::PreviousX, TS_Ctx_t::PreviousY, TS_State_t::TouchDetected, TS_State_t::TouchX, TS_State_t::TouchY, Ts_CompObj, Ts_Drv, TS_INSTANCES_NBR, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, and TS_Ctx_t::Width.

int32_t BSP_TS_Init | ( | uint32_t | Instance,
 |  | TS_Init_t * | TS_Init
 | ) |  |

Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).

Parameters:
Instance | TS instance. Could be only 0.
TS_Init | TS Init structure
Return values:
BSP status

Definition at line 126 of file stm32h735g_discovery_ts.c.

References TS_Init_t::Accuracy, TS_Ctx_t::Accuracy, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, FT5336_Probe(), TS_Init_t::Height, TS_Ctx_t::Height, TS_Ctx_t::MaxX, TS_Capabilities_t::MaxXl, TS_Ctx_t::MaxY, TS_Capabilities_t::MaxYl, TS_Init_t::Orientation, TS_Ctx_t::Orientation, TS_Ctx_t::PreviousX, TS_Ctx_t::PreviousY, Ts_CompObj, Ts_Drv, TS_INSTANCES_NBR, TS_MAX_HEIGHT, TS_MAX_WIDTH, TS_MIN, TS_TOUCH_NBR, TS_Init_t::Width, and TS_Ctx_t::Width.

void BSP_TS_IRQHandler ( uint32_t Instance )

This function handles TS interrupt request.

Parameters:
Instance TS instance
Return values:
None

Definition at line 307 of file stm32h735g_discovery_ts.c.

References hts_exti.

int32_t BSP_TS_Set_Orientation | ( | uint32_t | Instance,
 |  | uint32_t | Orientation
 | ) |  |

Set TS orientation.

Parameters:
Instance | TS instance. Could be only 0.
Orientation | Orientation to be set
Return values:
BSP status

Definition at line 592 of file stm32h735g_discovery_ts.c.

References BSP_ERROR_NONE, and TS_Ctx_t::Orientation.


STM32H735G-DK BSP User Manual: STM32H735G_DISCO_AUDIO Private Defines

STM32H735G_DISCO_AUDIO Private Defines
AUDIO


STM32H735G-DK BSP User Manual: AUDIO Private Macros

Defines
AUDIO Private Macros
AUDIO

Defines

#define | DFSDM_OVER_SAMPLING(__FREQUENCY__)
#define | DFSDM_CLOCK_DIVIDER(__FREQUENCY__)
#define | DFSDM_FILTER_ORDER(__FREQUENCY__)
#define | DFSDM_MIC_BIT_SHIFT(__FREQUENCY__)
#define | SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Define Documentation

#define DFSDM_CLOCK_DIVIDER ( __FREQUENCY__ )
Value:
((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (24U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (4U)  \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (24U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (4U)  \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (24U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (4U)  \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (32U) : (32U)

Definition at line 180 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

#define DFSDM_FILTER_ORDER ( __FREQUENCY__ )
Value:
((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (DFSDM_FILTER_SINC3_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (DFSDM_FILTER_SINC3_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (DFSDM_FILTER_SINC3_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (DFSDM_FILTER_SINC3_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (DFSDM_FILTER_SINC4_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (DFSDM_FILTER_SINC3_ORDER) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (DFSDM_FILTER_SINC4_ORDER) : (DFSDM_FILTER_SINC5_ORDER)

Definition at line 189 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

#define DFSDM_MIC_BIT_SHIFT ( __FREQUENCY__ )
Value:
((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (5U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (6U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (3U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (3U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (6U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (0U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (2U) : (2U)

Definition at line 198 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

#define DFSDM_OVER_SAMPLING ( __FREQUENCY__ )
Value:
((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (256U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (256U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (128U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (128U) \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (64U)  \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (64U)  \
      : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (32U) : (16U)

Definition at line 171 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

#define SaturaLH | ( | N,
 |  | L,
 |  | H
 | ) | (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Definition at line 208 of file stm32h735g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().


STM32H735G-DK BSP User Manual: AUDIO Exported Variables

Variables
AUDIO Exported Variables
AUDIO | AUDIO

Variables

void * | Audio_CompObj = NULL
SAI_HandleTypeDef | haudio_out_sai = {0}
AUDIO_OUT_Ctx_t Audio_Out_Ctx [AUDIO_OUT_INSTANCES_NBR]
DFSDM_Filter_HandleTypeDef | haudio_in_dfsdm_filter [DFSDM_MIC_NUMBER]
DFSDM_Channel_HandleTypeDef | haudio_in_dfsdm_channel [DFSDM_MIC_NUMBER]
SAI_HandleTypeDef | haudio_in_sai [2] = {0}
AUDIO_IN_Ctx_t Audio_In_Ctx [AUDIO_IN_INSTANCES_NBR]
void * | AudioCompObj
SAI_HandleTypeDef | haudio_out_sai
AUDIO_OUT_Ctx_t Audio_Out_Ctx []
DFSDM_Filter_HandleTypeDef | haudio_in_dfsdm_filter []
DFSDM_Channel_HandleTypeDef | haudio_in_dfsdm_channel []
SAI_HandleTypeDef | haudio_in_sai []
AUDIO_IN_Ctx_t Audio_In_Ctx []

Variable Documentation

void* Audio_CompObj = NULL

Definition at line 218 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), and BSP_AUDIO_OUT_UnMute().

AUDIO_IN_Ctx_t Audio_In_Ctx[AUDIO_IN_INSTANCES_NBR]

Definition at line 227 of file stm32h735g_discovery_audio.c.

AUDIO_IN_Ctx_t Audio_In_Ctx[]

Definition at line 227 of file stm32h735g_discovery_audio.c.

AUDIO_OUT_Ctx_t Audio_Out_Ctx[AUDIO_OUT_INSTANCES_NBR]

Definition at line 221 of file stm32h735g_discovery_audio.c.

AUDIO_OUT_Ctx_t Audio_Out_Ctx[]

Definition at line 221 of file stm32h735g_discovery_audio.c.

void* AudioCompObj
DFSDM_Channel_HandleTypeDef haudio_in_dfsdm_channel[DFSDM_MIC_NUMBER]

Definition at line 225 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

DFSDM_Channel_HandleTypeDef haudio_in_dfsdm_channel[]

Definition at line 225 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

DFSDM_Filter_HandleTypeDef haudio_in_dfsdm_filter[DFSDM_MIC_NUMBER]

Definition at line 224 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

DFSDM_Filter_HandleTypeDef haudio_in_dfsdm_filter[]

Definition at line 224 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

SAI_HandleTypeDef haudio_in_sai[2] = {0}

Definition at line 226 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordPDM(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), MX_DFSDM1_ClockConfig(), and SAI_MspInit().

SAI_HandleTypeDef haudio_in_sai[]

Definition at line 226 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordPDM(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), MX_DFSDM1_ClockConfig(), and SAI_MspInit().

SAI_HandleTypeDef haudio_out_sai = {0}

Definition at line 220 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IRQHandler(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetSampleRate(), and BSP_AUDIO_OUT_Stop().

SAI_HandleTypeDef haudio_out_sai

Definition at line 220 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IRQHandler(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetSampleRate(), and BSP_AUDIO_OUT_Stop().


STM32H735G-DK BSP User Manual: AUDIO Private Variables

Functions | Variables
AUDIO Private Variables
AUDIO

Functions

ALIGN_32BYTES (static int32_t MicRecBuff[2][DEFAULT_AUDIO_IN_BUFFER_SIZE])

Variables

static AUDIO_Drv_t * | Audio_Drv = NULL
static DMA_HandleTypeDef | hDmaDfsdm [DFSDM_MIC_NUMBER]
static __IO uint32_t | RecBuffTrigger = 0
static __IO uint32_t | RecBuffHalf = 0
static __IO uint32_t | MicBuffIndex [DFSDM_MIC_NUMBER]

Function Documentation

ALIGN_32BYTES ( static int32_t MicRecBuff[2][DEFAULT_AUDIO_IN_BUFFER_SIZE] )

Variable Documentation

AUDIO_Drv_t* Audio_Drv = NULL [static]

Definition at line 236 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), and BSP_AUDIO_OUT_UnMute().

DMA_HandleTypeDef hDmaDfsdm[DFSDM_MIC_NUMBER] [static]

Definition at line 239 of file stm32h735g_discovery_audio.c.

Referenced by DFSDM_FilterMspDeInit(), and DFSDM_FilterMspInit().

__IO uint32_t MicBuffIndex[DFSDM_MIC_NUMBER] [static]

Definition at line 246 of file stm32h735g_discovery_audio.c.

__IO uint32_t RecBuffHalf = 0 [static]

Definition at line 243 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

__IO uint32_t RecBuffTrigger = 0 [static]

Definition at line 242 of file stm32h735g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().


STM32H735G-DK BSP User Manual: AUDIO Private Function Prototypes

AUDIO Private Function Prototypes
AUDIO


STM32H735G-DK BSP User Manual: AUDIO OUT Exported Functions

Functions
AUDIO OUT Exported Functions
AUDIO | AUDIO

Functions

int32_t | BSP_AUDIO_OUT_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Configures the audio peripherals.
int32_t | BSP_AUDIO_OUT_DeInit (uint32_t Instance)
De-initializes the audio out peripheral.
__weak HAL_StatusTypeDef | MX_SAI1_Block_B_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio out instance (SAI).
__weak HAL_StatusTypeDef | MX_SAI1_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
int32_t | BSP_AUDIO_OUT_Play (uint32_t Instance, uint8_t *pData, uint32_t NbrOfBytes)
Starts playing audio stream from a data buffer for a determined size.
int32_t | BSP_AUDIO_OUT_Pause (uint32_t Instance)
This function Pauses the audio file stream.
int32_t | BSP_AUDIO_OUT_Resume (uint32_t Instance)
Resumes the audio file stream.
int32_t | BSP_AUDIO_OUT_Stop (uint32_t Instance)
Stops audio playing and Power down the Audio Codec.
int32_t | BSP_AUDIO_OUT_SetVolume (uint32_t Instance, uint32_t Volume)
Controls the current audio volume level.
int32_t | BSP_AUDIO_OUT_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio volume level.
int32_t | BSP_AUDIO_OUT_Mute (uint32_t Instance)
Enables the MUTE.
int32_t | BSP_AUDIO_OUT_UnMute (uint32_t Instance)
Disables the MUTE mode.
int32_t | BSP_AUDIO_OUT_IsMute (uint32_t Instance, uint32_t *IsMute)
Check whether the MUTE mode is enabled or not.
int32_t | BSP_AUDIO_OUT_SetDevice (uint32_t Instance, uint32_t Device)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
int32_t | BSP_AUDIO_OUT_GetDevice (uint32_t Instance, uint32_t *Device)
Get the Output Device.
int32_t | BSP_AUDIO_OUT_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Updates the audio frequency.
int32_t | BSP_AUDIO_OUT_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get the audio frequency.
int32_t | BSP_AUDIO_OUT_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set the audio Channels number.
int32_t | BSP_AUDIO_OUT_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get the audio Channels number.
int32_t | BSP_AUDIO_OUT_GetState (uint32_t Instance, uint32_t *State)
Get Audio Out state.
void | BSP_AUDIO_OUT_IRQHandler (uint32_t Instance)
This function handles Audio Out DMA interrupt requests.
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance)
Manages the DMA FIFO error event.
HAL_StatusTypeDef | MX_SAI1_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
HAL_StatusTypeDef | MX_I2S6_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t SampleRate)
HAL_StatusTypeDef | MX_I2S6_Init (I2S_HandleTypeDef *hi2s, MX_I2S_Config *MXConfig)

Function Documentation

int32_t BSP_AUDIO_OUT_DeInit ( uint32_t Instance )

De-initializes the audio out peripheral.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
None

Definition at line 471 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_SAIx, AUDIO_OUT_STATE_RESET, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, SAI_MspDeInit(), and AUDIO_OUT_Ctx_t::State.

void BSP_AUDIO_OUT_Error_CallBack ( uint32_t Instance )

Manages the DMA FIFO error event.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
None

Definition at line 1475 of file stm32h735g_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

int32_t BSP_AUDIO_OUT_GetBitsPerSample | ( | uint32_t | Instance,
 |  | uint32_t * | BitsPerSample
 | ) |  |

Get the audio Resolution.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
BitsPerSample | Audio Resolution used to play the audio stream.
Return values:
BSP status

Definition at line 1257 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, AUDIO_OUT_Ctx_t::BitsPerSample, BSP_ERROR_BUSY, BSP_ERROR_NONE, and BSP_ERROR_WRONG_PARAM.

int32_t BSP_AUDIO_OUT_GetChannelsNbr | ( | uint32_t | Instance,
 |  | uint32_t * | ChannelNbr
 | ) |  |

Get the audio Channels number.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
ChannelNbr | Audio Channels number used to play the audio stream.
Return values:
BSP status

Definition at line 1341 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::ChannelsNbr.

int32_t BSP_AUDIO_OUT_GetDevice | ( | uint32_t | Instance,
 |  | uint32_t * | Device
 | ) |  |

Get the Output Device.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
Device | The audio output device
Return values:
BSP status

Definition at line 1051 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::Device.

int32_t BSP_AUDIO_OUT_GetSampleRate | ( | uint32_t | Instance,
 |  | uint32_t * | SampleRate
 | ) |  |

Get the audio frequency.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
SampleRate | Audio frequency used to play the audio stream.
Return values:
BSP status

Definition at line 1149 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::SampleRate.

int32_t BSP_AUDIO_OUT_GetState | ( | uint32_t | Instance,
 |  | uint32_t * | State
 | ) |  |

Get Audio Out state.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
State | Audio Out state
Return values:
BSP status

Definition at line 1369 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::State.

int32_t BSP_AUDIO_OUT_GetVolume | ( | uint32_t | Instance,
 |  | uint32_t * | Volume
 | ) |  |

Get the current audio volume level.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
Volume | pointer to volume to be returned
Return values:
BSP status

Definition at line 891 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::Volume.

void BSP_AUDIO_OUT_HalfTransfer_CallBack ( uint32_t Instance )

Manages the DMA Half Transfer complete event.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
None

Definition at line 1464 of file stm32h735g_discovery_audio.c.

Referenced by HAL_SAI_TxHalfCpltCallback().

int32_t BSP_AUDIO_OUT_Init | ( | uint32_t | Instance,
 |  | BSP_AUDIO_Init_t * | AudioInit
 | ) |  |

Configures the audio peripherals.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
AudioInit | AUDIO OUT init Structure
Return values:
BSP status

Definition at line 305 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, Audio_CompObj, Audio_Drv, AUDIO_IN_STATE_RESET, AUDIO_OUT_DEVICE_AUTO, AUDIO_OUT_DEVICE_HEADPHONE, AUDIO_OUT_DEVICE_SPEAKER, AUDIO_OUT_DEVICE_SPK_HP, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_SAIx, AUDIO_OUT_STATE_RESET, AUDIO_OUT_STATE_STOP, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, BSP_AUDIO_Init_t::BitsPerSample, AUDIO_OUT_Ctx_t::BitsPerSample, BSP_ERROR_CLOCK_FAILURE, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_AUDIO_Init_t::ChannelsNbr, AUDIO_OUT_Ctx_t::ChannelsNbr, MX_SAI_Config::ClockStrobing, CODEC_AUDIOFRAME_SLOT_0123, CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, MX_SAI_Config::DataSize, BSP_AUDIO_Init_t::Device, AUDIO_OUT_Ctx_t::Device, MX_SAI_Config::FrameLength, haudio_out_sai, AUDIO_OUT_Ctx_t::Instance, MX_SAI_Config::MonoStereoMode, MX_SAI1_Block_B_Init(), MX_SAI1_ClockConfig(), MX_SAI_Config::OutputDrive, SAI_MspInit(), BSP_AUDIO_Init_t::SampleRate, AUDIO_OUT_Ctx_t::SampleRate, MX_SAI_Config::SlotActive, AUDIO_IN_Ctx_t::State, AUDIO_OUT_Ctx_t::State, MX_SAI_Config::Synchro, MX_SAI_Config::SynchroExt, BSP_AUDIO_Init_t::Volume, AUDIO_OUT_Ctx_t::Volume, and VOLUME_OUT_CONVERT.

void BSP_AUDIO_OUT_IRQHandler ( uint32_t Instance )

This function handles Audio Out DMA interrupt requests.

Parameters:
Instance Audio OUT instance
Return values:
None

Definition at line 1392 of file stm32h735g_discovery_audio.c.

References haudio_out_sai.

int32_t BSP_AUDIO_OUT_IsMute | ( | uint32_t | Instance,
 |  | uint32_t * | IsMute
 | ) |  |

Check whether the MUTE mode is enabled or not.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
IsMute | pointer to mute state
Return values:
Mute status

Definition at line 993 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_OUT_Ctx_t::IsMute.

int32_t BSP_AUDIO_OUT_Mute ( uint32_t Instance )

Enables the MUTE.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
BSP status

Definition at line 916 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, CODEC_MUTE_ON, and AUDIO_OUT_Ctx_t::IsMute.

int32_t BSP_AUDIO_OUT_Pause ( uint32_t Instance )

This function Pauses the audio file stream.

In case of using DMA, the DMA Pause feature is used.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values:
BSP status

Definition at line 732 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_PAUSE, AUDIO_OUT_STATE_PLAYING, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, and AUDIO_OUT_Ctx_t::State.

int32_t BSP_AUDIO_OUT_Play | ( | uint32_t | Instance,
 |  | uint8_t * | pData,
 |  | uint32_t | NbrOfBytes
 | ) |  |

Starts playing audio stream from a data buffer for a determined size.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
pData | pointer on data address
NbrOfBytes | Size of total samples in bytes BitsPerSample: 16 or 32
Return values:
BSP status

Definition at line 693 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_PLAYING, AUDIO_OUT_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, and AUDIO_OUT_Ctx_t::State.

int32_t BSP_AUDIO_OUT_Resume ( uint32_t Instance )

Resumes the audio file stream.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values:
BSP status

Definition at line 772 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_PAUSE, AUDIO_OUT_STATE_PLAYING, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, and AUDIO_OUT_Ctx_t::State.

int32_t BSP_AUDIO_OUT_SetBitsPerSample | ( | uint32_t | Instance,
 |  | uint32_t | BitsPerSample
 | ) |  |

Get the audio Resolution.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
BitsPerSample | Audio Resolution used to play the audio stream.
Return values:
BSP status

Definition at line 1175 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_STATE_RESET, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_STOP, AUDIO_RESOLUTION_24B, AUDIO_RESOLUTION_32B, AUDIO_RESOLUTION_8B, AUDIO_OUT_Ctx_t::BitsPerSample, BSP_ERROR_BUSY, BSP_ERROR_FEATURE_NOT_SUPPORTED, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, and SAI_MspInit().

int32_t BSP_AUDIO_OUT_SetChannelsNbr | ( | uint32_t | Instance,
 |  | uint32_t | ChannelNbr
 | ) |  |

Set the audio Channels number.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
ChannelNbr | Audio Channels number used to play the audio stream (It can only be 2U for I2S Instance)
Return values:
BSP status

Definition at line 1285 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, AUDIO_OUT_Ctx_t::ChannelsNbr, and haudio_out_sai.

int32_t BSP_AUDIO_OUT_SetDevice | ( | uint32_t | Instance,
 |  | uint32_t | Device
 | ) |  |

Switch dynamically (while audio file is played) the output target (speaker or headphone).

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
Device | The audio output device
Return values:
BSP status

Definition at line 1020 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_NONE, and BSP_ERROR_WRONG_PARAM.

int32_t BSP_AUDIO_OUT_SetSampleRate | ( | uint32_t | Instance,
 |  | uint32_t | SampleRate
 | ) |  |

Updates the audio frequency.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
SampleRate | Audio frequency used to play the audio stream.
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frequency.
Return values:
BSP status

Definition at line 1080 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_STATE_RESET, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_FEATURE_NOT_SUPPORTED, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_out_sai, MX_SAI1_ClockConfig(), and AUDIO_OUT_Ctx_t::SampleRate.

int32_t BSP_AUDIO_OUT_SetVolume | ( | uint32_t | Instance,
 |  | uint32_t | Volume
 | ) |  |

Controls the current audio volume level.

Parameters:
Instance | AUDIO OUT Instance. It can only be 0 (SAI)
Volume | Volume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
Return values:
BSP status

Definition at line 853 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_VOLUME_OUTPUT, BSP_AUDIO_MUTE_DISABLED, BSP_AUDIO_MUTE_ENABLED, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, AUDIO_OUT_Ctx_t::IsMute, and AUDIO_OUT_Ctx_t::Volume.

int32_t BSP_AUDIO_OUT_Stop ( uint32_t Instance )

Stops audio playing and Power down the Audio Codec.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
BSP status

Definition at line 809 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_PAUSE, AUDIO_OUT_STATE_PLAYING, AUDIO_OUT_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, CODEC_PDWN_SW, haudio_out_sai, and AUDIO_OUT_Ctx_t::State.

void BSP_AUDIO_OUT_TransferComplete_CallBack ( uint32_t Instance )

Manages the DMA full Transfer complete event.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
None

Definition at line 1453 of file stm32h735g_discovery_audio.c.

Referenced by HAL_SAI_TxCpltCallback().

int32_t BSP_AUDIO_OUT_UnMute ( uint32_t Instance )

Disables the MUTE mode.

Parameters:
Instance AUDIO OUT Instance. It can only be 0 (SAI)
Return values:
BSP status

Definition at line 954 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_OUT_INSTANCES_NBR, AUDIO_OUT_STATE_RESET, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, CODEC_MUTE_OFF, and AUDIO_OUT_Ctx_t::IsMute.

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai SAI handle
Return values:
None

Definition at line 1436 of file stm32h735g_discovery_audio.c.

References AUDIO_OUT_SAIx, BSP_AUDIO_IN_Error_CallBack(), and BSP_AUDIO_OUT_Error_CallBack().

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Transfer completed callbacks.

Parameters:
hsai SAI handle
Return values:
None

Definition at line 1406 of file stm32h735g_discovery_audio.c.

References BSP_AUDIO_OUT_TransferComplete_CallBack().

void HAL_SAI_TxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Half Transfer completed callbacks.

Parameters:
hsai SAI handle
Return values:
None

Definition at line 1421 of file stm32h735g_discovery_audio.c.

References BSP_AUDIO_OUT_HalfTransfer_CallBack().

HAL_StatusTypeDef MX_I2S6_ClockConfig | ( | I2S_HandleTypeDef * | hi2s,
 |  | uint32_t | SampleRate
 | ) |  |
HAL_StatusTypeDef MX_I2S6_Init | ( | I2S_HandleTypeDef * | hi2s,
 |  | MX_I2S_Config * | MXConfig
 | ) |  |
HAL_StatusTypeDef MX_SAI1_Block_A_Init | ( | SAI_HandleTypeDef * | hsai,
 |  | MX_SAI_Config * | MXConfig
 | ) |  |

Initializes the Audio Codec audio in instance (SAI).

Parameters:
hsai | SAI handle
MXConfig | SAI configuration structure
Note:
Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 2380 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, AUDIO_RESOLUTION_24B, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, MX_SAI_Config::FrameLength, MX_SAI_Config::MonoStereoMode, MX_SAI_Config::OutputDrive, MX_SAI_Config::SlotActive, MX_SAI_Config::Synchro, and MX_SAI_Config::SynchroExt.

Referenced by BSP_AUDIO_IN_Init().

__weak HAL_StatusTypeDef MX_SAI1_Block_B_Init | ( | SAI_HandleTypeDef * | hsai,
 |  | MX_SAI_Config * | MXConfig
 | ) |  |

Initializes the Audio Codec audio out instance (SAI).

Parameters:
hsai | SAI handle
MXConfig | SAI confiruration structure
Note:
Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 512 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, AUDIO_RESOLUTION_24B, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, MX_SAI_Config::FrameLength, MX_SAI_Config::MonoStereoMode, MX_SAI_Config::OutputDrive, MX_SAI_Config::SlotActive, MX_SAI_Config::Synchro, and MX_SAI_Config::SynchroExt.

Referenced by BSP_AUDIO_IN_Init(), and BSP_AUDIO_OUT_Init().

HAL_StatusTypeDef MX_SAI1_ClockConfig | ( | SAI_HandleTypeDef * | hsai,
 |  | uint32_t | SampleRate
 | ) |  |

SAI clock Config.

Parameters:
hsai | SAI handle
SampleRate | Audio frequency used to play the audio stream.
Note:
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 576 of file stm32h735g_discovery_audio.c.

References AUDIO_FREQUENCY_11K, AUDIO_FREQUENCY_22K, and AUDIO_FREQUENCY_44K.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_SetSampleRate(), and MX_DFSDM1_ClockConfig().


STM32H735G-DK BSP User Manual: AUDIO OUT Private Functions

Functions
AUDIO OUT Private Functions
AUDIO

Functions

static void | SAI_MspInit (SAI_HandleTypeDef *hsai)
Initialize BSP_AUDIO_OUT MSP.
static void | SAI_MspDeInit (SAI_HandleTypeDef *hsai)
Deinitializes SAI MSP.

Function Documentation

static void SAI_MspDeInit ( SAI_HandleTypeDef * hsai ) [static]

Deinitializes SAI MSP.

Parameters:
hsai SAI handle
Return values:
HAL status

Definition at line 1750 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_SAIx, AUDIO_IN_SAIx_CLK_DISABLE, AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_SAIx_SD_GPIO_PORT, AUDIO_IN_SAIx_SD_PIN, AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_SAIx_FS_GPIO_PORT, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_GPIO_PORT, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SD_GPIO_PORT, and AUDIO_OUT_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_OUT_DeInit().

static void SAI_MspInit ( SAI_HandleTypeDef * hsai ) [static]

Initialize BSP_AUDIO_OUT MSP.

Parameters:
hsai SAI handle
Return values:
None

Definition at line 1542 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_SAI_PDMx, AUDIO_IN_SAI_PDMx_CLK_ENABLE, AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE, AUDIO_IN_SAI_PDMx_CLK_IN_PIN, AUDIO_IN_SAI_PDMx_CLK_IN_PORT, AUDIO_IN_SAI_PDMx_DATA_CLK_AF, AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE, AUDIO_IN_SAI_PDMx_DATA_IN_PIN, AUDIO_IN_SAI_PDMx_DATA_IN_PORT, AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE, AUDIO_IN_SAI_PDMx_DMAx_IRQ, AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE, AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE, AUDIO_IN_SAI_PDMx_DMAx_REQUEST, AUDIO_IN_SAI_PDMx_DMAx_STREAM, AUDIO_IN_SAI_PDMx_FS_PIN, AUDIO_IN_SAI_PDMx_FS_SCK_AF, AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE, AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT, AUDIO_IN_SAI_PDMx_SCK_PIN, AUDIO_IN_SAIx, AUDIO_IN_SAIx_AF, AUDIO_IN_SAIx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_SAIx_DMAx_REQUEST, AUDIO_IN_SAIx_DMAx_STREAM, AUDIO_IN_SAIx_SD_ENABLE, AUDIO_IN_SAIx_SD_GPIO_PORT, AUDIO_IN_SAIx_SD_PIN, AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_CLK_ENABLE, AUDIO_OUT_SAIx_DMAx_CLK_ENABLE, AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_SAIx_DMAx_REQUEST, AUDIO_OUT_SAIx_DMAx_STREAM, AUDIO_OUT_SAIx_FS_AF, AUDIO_OUT_SAIx_FS_ENABLE, AUDIO_OUT_SAIx_FS_GPIO_PORT, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_MCLK_AF, AUDIO_OUT_SAIx_MCLK_ENABLE, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_AF, AUDIO_OUT_SAIx_SCK_ENABLE, AUDIO_OUT_SAIx_SCK_GPIO_PORT, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SD_AF, AUDIO_OUT_SAIx_SD_ENABLE, AUDIO_OUT_SAIx_SD_GPIO_PORT, AUDIO_OUT_SAIx_SD_PIN, AUDIO_RESOLUTION_16B, BSP_AUDIO_IN_IT_PRIORITY, BSP_AUDIO_OUT_IT_PRIORITY, and haudio_in_sai.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetBitsPerSample().


STM32H735G-DK BSP User Manual: STM32H735G_DISCO_AUDIO_IN Exported Functions

Functions
STM32H735G_DISCO_AUDIO_IN Exported Functions
AUDIO | AUDIO

Functions

int32_t | BSP_AUDIO_IN_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Initialize wave recording.
int32_t | BSP_AUDIO_IN_DeInit (uint32_t Instance)
Deinit the audio IN peripherals.
__weak HAL_StatusTypeDef | MX_DFSDM1_ClockConfig (DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
Clock Config.
__weak HAL_StatusTypeDef | MX_SAI4_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
__weak HAL_StatusTypeDef | MX_DFSDM1_Init (DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
Initializes the Audio instance (DFSDM).
__weak HAL_StatusTypeDef | MX_SAI1_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
__weak HAL_StatusTypeDef | MX_SAI4_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
int32_t | BSP_AUDIO_IN_Record (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t | BSP_AUDIO_IN_Stop (uint32_t Instance)
Stop audio recording.
int32_t | BSP_AUDIO_IN_Pause (uint32_t Instance)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_Resume (uint32_t Instance)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_RecordChannels (uint32_t Instance, uint8_t **pBuf, uint32_t NbrOfBytes)
Starts audio recording.
int32_t | BSP_AUDIO_IN_StopChannels (uint32_t Instance, uint32_t Device)
Stop audio recording.
int32_t | BSP_AUDIO_IN_PauseChannels (uint32_t Instance, uint32_t Device)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_ResumeChannels (uint32_t Instance, uint32_t Device)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_RecordPDM (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t | BSP_AUDIO_IN_SetDevice (uint32_t Instance, uint32_t Device)
Set Audio In device.
int32_t | BSP_AUDIO_IN_GetDevice (uint32_t Instance, uint32_t *Device)
Get Audio In device.
int32_t | BSP_AUDIO_IN_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Set Audio In frequency.
int32_t | BSP_AUDIO_IN_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get Audio In frequency.
int32_t | BSP_AUDIO_IN_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Set Audio In Resolution.
int32_t | BSP_AUDIO_IN_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get Audio In Resolution.
int32_t | BSP_AUDIO_IN_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set Audio In Channel number.
int32_t | BSP_AUDIO_IN_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get Audio In Channel number.
int32_t | BSP_AUDIO_IN_SetVolume (uint32_t Instance, uint32_t Volume)
Set the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetState (uint32_t Instance, uint32_t *State)
Get Audio In device.
void | BSP_AUDIO_IN_IRQHandler (uint32_t Instance, uint32_t InputDevice)
This function handles Audio Out DMA interrupt requests.
void | HAL_DFSDM_FilterRegConvCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
void | HAL_DFSDM_FilterRegConvHalfCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Half reception complete callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Reception complete callback.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (uint32_t Instance)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_Error_CallBack (uint32_t Instance)
Audio IN Error callback function.
HAL_StatusTypeDef | MX_DFSDM2_ClockConfig (DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
HAL_StatusTypeDef | MX_DFSDM2_Init (DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
HAL_StatusTypeDef | MX_SAI1_Block_B_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio out instance (SAI).

Function Documentation

int32_t BSP_AUDIO_IN_DeInit ( uint32_t Instance )

Deinit the audio IN peripherals.

Parameters:
Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Return values:
BSP status

Definition at line 2138 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_SAI_PDMx, AUDIO_IN_SAIx, AUDIO_IN_STATE_RESET, AUDIO_OUT_SAIx, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DFSDM_ChannelMspDeInit(), DFSDM_FilterMspDeInit(), DFSDM_MIC_NUMBER, haudio_in_dfsdm_channel, haudio_in_dfsdm_filter, haudio_in_sai, haudio_out_sai, AUDIO_IN_Ctx_t::IsMultiBuff, SAI_MspDeInit(), and AUDIO_IN_Ctx_t::State.

void BSP_AUDIO_IN_Error_CallBack ( uint32_t Instance )

Audio IN Error callback function.

Return values:
None

Definition at line 3829 of file stm32h735g_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

int32_t BSP_AUDIO_IN_GetBitsPerSample | ( | uint32_t | Instance,
 |  | uint32_t * | BitsPerSample
 | ) |  |

Get Audio In Resolution.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
BitsPerSample | Input resolution to be returned
Return values:
BSP status

Definition at line 3432 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, AUDIO_IN_Ctx_t::BitsPerSample, BSP_ERROR_NONE, and BSP_ERROR_WRONG_PARAM.

int32_t BSP_AUDIO_IN_GetChannelsNbr | ( | uint32_t | Instance,
 |  | uint32_t * | ChannelNbr
 | ) |  |

Get Audio In Channel number.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
ChannelNbr | Channel number to be used
Return values:
BSP status

Definition at line 3477 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_IN_Ctx_t::ChannelsNbr.

int32_t BSP_AUDIO_IN_GetDevice | ( | uint32_t | Instance,
 |  | uint32_t * | Device
 | ) |  |

Get Audio In device.

Parameters:
Instance | AUDIO IN Instance. It can be 0 when SAI is used 1 when I2S is used or 2 if DFSDM is used
Device | The audio input device used
Return values:
BSP status

Definition at line 3233 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_IN_Ctx_t::Device.

int32_t BSP_AUDIO_IN_GetSampleRate | ( | uint32_t | Instance,
 |  | uint32_t * | SampleRate
 | ) |  |

Get Audio In frequency.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
SampleRate | Audio Input frequency to be returned
Return values:
BSP status

Definition at line 3358 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_IN_Ctx_t::SampleRate.

int32_t BSP_AUDIO_IN_GetState | ( | uint32_t | Instance,
 |  | uint32_t * | State
 | ) |  |

Get Audio In device.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
State | Audio Out state
Return values:
BSP status

Definition at line 3549 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_GetVolume | ( | uint32_t | Instance,
 |  | uint32_t * | Volume
 | ) |  |

Get the current audio in volume level.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Volume | Volume level to be returned
Return values:
BSP status

Definition at line 3523 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_FEATURE_NOT_SUPPORTED, and BSP_ERROR_WRONG_PARAM.

void BSP_AUDIO_IN_HalfTransfer_CallBack ( uint32_t Instance )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 3815 of file stm32h735g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterRegConvCpltCallback(), HAL_DFSDM_FilterRegConvHalfCpltCallback(), and HAL_SAI_RxHalfCpltCallback().

int32_t BSP_AUDIO_IN_Init | ( | uint32_t | Instance,
 |  | BSP_AUDIO_Init_t * | AudioInit
 | ) |  |

Initialize wave recording.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
AudioInit | Init structure
Return values:
BSP status

Definition at line 1844 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, Audio_CompObj, AUDIO_DFSDMx_MIC1_CHANNEL, AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER, AUDIO_DFSDMx_MIC1_FILTER, AUDIO_DFSDMx_MIC2_CHANNEL, AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER, AUDIO_DFSDMx_MIC2_FILTER, AUDIO_DFSDMx_MIC3_CHANNEL, AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER, AUDIO_DFSDMx_MIC3_FILTER, AUDIO_DFSDMx_MIC4_CHANNEL, AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER, AUDIO_DFSDMx_MIC4_FILTER, Audio_Drv, AUDIO_IN_DEVICE_ANALOG_MIC, AUDIO_IN_DEVICE_DIGITAL_MIC1, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_SAI_PDMx, AUDIO_IN_SAIx, AUDIO_IN_STATE_RESET, AUDIO_IN_STATE_STOP, AUDIO_OUT_SAIx, AUDIO_OUT_STATE_RESET, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, BSP_AUDIO_Init_t::BitsPerSample, AUDIO_IN_Ctx_t::BitsPerSample, BSP_ERROR_CLOCK_FAILURE, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, MX_DFSDM_Config::Channel4Filter, MX_DFSDM_Config::ChannelInstance, BSP_AUDIO_Init_t::ChannelsNbr, AUDIO_IN_Ctx_t::ChannelsNbr, MX_DFSDM_Config::ClockDivider, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, BSP_AUDIO_Init_t::Device, AUDIO_IN_Ctx_t::Device, DFSDM_ChannelMspInit(), DFSDM_CLOCK_DIVIDER, DFSDM_FILTER_ORDER, DFSDM_FilterMspInit(), DFSDM_MIC_BIT_SHIFT, DFSDM_MIC_NUMBER, DFSDM_OVER_SAMPLING, MX_DFSDM_Config::DigitalMicPins, MX_DFSDM_Config::DigitalMicType, MX_DFSDM_Config::FilterInstance, MX_SAI_Config::FrameLength, haudio_in_dfsdm_channel, haudio_in_dfsdm_filter, haudio_in_sai, haudio_out_sai, MX_SAI_Config::MonoStereoMode, MX_DFSDM1_ClockConfig(), MX_DFSDM1_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), MX_SAI1_ClockConfig(), MX_SAI4_Block_A_Init(), MX_SAI4_ClockConfig(), MX_SAI_Config::OutputDrive, MX_DFSDM_Config::Oversampling, MX_DFSDM_Config::RegularTrigger, MX_DFSDM_Config::RightBitShift, SAI_MspInit(), BSP_AUDIO_Init_t::SampleRate, AUDIO_IN_Ctx_t::SampleRate, MX_DFSDM_Config::SincOrder, MX_SAI_Config::SlotActive, AUDIO_IN_Ctx_t::State, AUDIO_OUT_Ctx_t::State, MX_SAI_Config::Synchro, MX_SAI_Config::SynchroExt, BSP_AUDIO_Init_t::Volume, AUDIO_IN_Ctx_t::Volume, and VOLUME_IN_CONVERT.

Referenced by BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

void BSP_AUDIO_IN_IRQHandler | ( | uint32_t | Instance,
 |  | uint32_t | InputDevice
 | ) |  |

This function handles Audio Out DMA interrupt requests.

Parameters:
Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
InputDevice Can be:
  • AUDIO_IN_DEVICE_ANALOG_MIC
  • AUDIO_IN_DEVICE_DIGITAL_MIC1
  • AUDIO_IN_DEVICE_DIGITAL_MIC2
  • AUDIO_IN_DEVICE_DIGITAL_MIC3
  • AUDIO_IN_DEVICE_DIGITAL_MIC4
Return values:
None

Definition at line 3576 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_ANALOG_MIC, AUDIO_IN_DEVICE_DIGITAL_MIC_LAST, haudio_in_dfsdm_filter, haudio_in_sai, and POS_VAL.

int32_t BSP_AUDIO_IN_Pause ( uint32_t Instance )

Pause the audio file stream.

Parameters:
Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Return values:
BSP status

Definition at line 2864 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_IN_DEVICE_DIGITAL_MIC2, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_PAUSE, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, haudio_in_dfsdm_filter, haudio_in_sai, POS_VAL, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_PauseChannels | ( | uint32_t | Instance,
 |  | uint32_t | Device
 | ) |  |

Pause the audio file stream.

Parameters:
Instance | AUDIO IN Instance. It can be 1(DFSDM used)
Device | Digital mic to be paused
Return values:
BSP status

Definition at line 3066 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_DIGITAL_MIC1, AUDIO_IN_DEVICE_DIGITAL_MIC_LAST, AUDIO_IN_STATE_PAUSE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, POS_VAL, and AUDIO_IN_Ctx_t::State.

Referenced by BSP_AUDIO_IN_StopChannels().

int32_t BSP_AUDIO_IN_Record | ( | uint32_t | Instance,
 |  | uint8_t * | pBuf,
 |  | uint32_t | NbrOfBytes
 | ) |  |

Start audio recording.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
pBuf | Main buffer pointer for the recorded data storing
NbrOfBytes | Size of the record buffer in bytes
Return values:
BSP status

Definition at line 2732 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_IN_DEVICE_DIGITAL_MIC2, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_RECORDING, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DEFAULT_AUDIO_IN_BUFFER_SIZE, haudio_in_dfsdm_filter, haudio_in_sai, haudio_out_sai, AUDIO_IN_Ctx_t::pBuff, POS_VAL, RecBuffHalf, RecBuffTrigger, AUDIO_IN_Ctx_t::Size, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_RecordChannels | ( | uint32_t | Instance,
 |  | uint8_t ** | pBuf,
 |  | uint32_t | NbrOfBytes
 | ) |  |

Starts audio recording.

Parameters:
Instance | AUDIO IN Instance. It can be 2(DFSDM used)
pBuf | Main buffer pointer for the recorded data storing
NbrOfBytes | Size of the recorded buffer in bytes
Return values:
BSP status

Definition at line 2983 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_DIGITAL_MIC1, AUDIO_IN_DEVICE_DIGITAL_MIC_LAST, AUDIO_IN_STATE_RECORDING, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, AUDIO_IN_Ctx_t::IsMultiBuff, AUDIO_IN_Ctx_t::pMultiBuff, POS_VAL, AUDIO_IN_Ctx_t::Size, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_RecordPDM | ( | uint32_t | Instance,
 |  | uint8_t * | pBuf,
 |  | uint32_t | NbrOfBytes
 | ) |  |

Start audio recording.

Parameters:
Instance | AUDIO IN SAI PDM Instance. It can be only 2
pbuf | Main buffer pointer for the recorded data storing
Size | Size of the record buffer
Return values:
BSP status

Definition at line 3151 of file stm32h735g_discovery_audio.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, and haudio_in_sai.

int32_t BSP_AUDIO_IN_Resume ( uint32_t Instance )

Resume the audio file stream.

Parameters:
Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Return values:
BSP status

Definition at line 2921 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_IN_DEVICE_DIGITAL_MIC2, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_RECORDING, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DEFAULT_AUDIO_IN_BUFFER_SIZE, haudio_in_dfsdm_filter, haudio_in_sai, POS_VAL, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_ResumeChannels | ( | uint32_t | Instance,
 |  | uint32_t | Device
 | ) |  |

Resume the audio file stream.

Parameters:
Instance | AUDIO IN Instance. It can be 1(DFSDM used)
Device | Digital mic to be resumed
Return values:
BSP status

Definition at line 3108 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_DIGITAL_MIC_LAST, AUDIO_IN_STATE_RECORDING, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, POS_VAL, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_SetBitsPerSample | ( | uint32_t | Instance,
 |  | uint32_t | BitsPerSample
 | ) |  |

Set Audio In Resolution.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
BitsPerSample | Input resolution to be set
Return values:
BSP status

Definition at line 3382 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_STOP, BSP_AUDIO_Init_t::BitsPerSample, BSP_AUDIO_IN_Init(), BSP_ERROR_BUSY, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_AUDIO_Init_t::ChannelsNbr, AUDIO_IN_Ctx_t::ChannelsNbr, BSP_AUDIO_Init_t::Device, AUDIO_IN_Ctx_t::Device, DFSDM_MIC_NUMBER, haudio_in_dfsdm_channel, BSP_AUDIO_Init_t::SampleRate, AUDIO_IN_Ctx_t::SampleRate, BSP_AUDIO_Init_t::Volume, and AUDIO_IN_Ctx_t::Volume.

int32_t BSP_AUDIO_IN_SetChannelsNbr | ( | uint32_t | Instance,
 |  | uint32_t | ChannelNbr
 | ) |  |

Set Audio In Channel number.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
ChannelNbr | Channel number to be used
Return values:
BSP status

Definition at line 3454 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and AUDIO_IN_Ctx_t::ChannelsNbr.

int32_t BSP_AUDIO_IN_SetDevice | ( | uint32_t | Instance,
 |  | uint32_t | Device
 | ) |  |

Set Audio In device.

Parameters:
Instance | AUDIO IN Instance. It can be 0 when SAI is used or 2 if DFSDM is used
Device | The audio input device to be used
Return values:
BSP status

Definition at line 3178 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_ANALOG_LINE1, AUDIO_IN_DEVICE_DIGITAL_MIC_LAST, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_STOP, BSP_AUDIO_Init_t::BitsPerSample, AUDIO_IN_Ctx_t::BitsPerSample, BSP_AUDIO_IN_Init(), BSP_ERROR_BUSY, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_AUDIO_Init_t::ChannelsNbr, AUDIO_IN_Ctx_t::ChannelsNbr, BSP_AUDIO_Init_t::Device, DFSDM_MIC_NUMBER, haudio_in_dfsdm_channel, BSP_AUDIO_Init_t::SampleRate, AUDIO_IN_Ctx_t::SampleRate, BSP_AUDIO_Init_t::Volume, and AUDIO_IN_Ctx_t::Volume.

int32_t BSP_AUDIO_IN_SetSampleRate | ( | uint32_t | Instance,
 |  | uint32_t | SampleRate
 | ) |  |

Set Audio In frequency.

Parameters:
Instance | Audio IN instance
SampleRate | Input frequency to be set
Return values:
BSP status

Definition at line 3255 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_STOP, AUDIO_OUT_STATE_RESET, BSP_AUDIO_Init_t::BitsPerSample, AUDIO_IN_Ctx_t::BitsPerSample, BSP_AUDIO_IN_Init(), BSP_ERROR_BUSY, BSP_ERROR_CLOCK_FAILURE, BSP_ERROR_FEATURE_NOT_SUPPORTED, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_AUDIO_Init_t::ChannelsNbr, AUDIO_IN_Ctx_t::ChannelsNbr, BSP_AUDIO_Init_t::Device, AUDIO_IN_Ctx_t::Device, DFSDM_MIC_NUMBER, haudio_in_dfsdm_channel, haudio_in_dfsdm_filter, haudio_in_sai, haudio_out_sai, MX_SAI1_ClockConfig(), BSP_AUDIO_Init_t::SampleRate, AUDIO_IN_Ctx_t::SampleRate, BSP_AUDIO_Init_t::Volume, and AUDIO_IN_Ctx_t::Volume.

int32_t BSP_AUDIO_IN_SetVolume | ( | uint32_t | Instance,
 |  | uint32_t | Volume
 | ) |  |

Set the current audio in volume level.

Parameters:
Instance | Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Volume | Volume level to be returned
Return values:
BSP status

Definition at line 3499 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_INSTANCES_NBR, BSP_ERROR_FEATURE_NOT_SUPPORTED, and BSP_ERROR_WRONG_PARAM.

int32_t BSP_AUDIO_IN_Stop ( uint32_t Instance )

Stop audio recording.

Parameters:
Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
Return values:
BSP status

Definition at line 2797 of file stm32h735g_discovery_audio.c.

References Audio_CompObj, Audio_Drv, AUDIO_IN_DEVICE_DIGITAL_MIC2, AUDIO_IN_INSTANCES_NBR, AUDIO_IN_STATE_PAUSE, AUDIO_IN_STATE_RECORDING, AUDIO_IN_STATE_STOP, BSP_ERROR_BUSY, BSP_ERROR_COMPONENT_FAILURE, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, CODEC_PDWN_SW, haudio_in_dfsdm_filter, haudio_in_sai, POS_VAL, and AUDIO_IN_Ctx_t::State.

int32_t BSP_AUDIO_IN_StopChannels | ( | uint32_t | Instance,
 |  | uint32_t | Device
 | ) |  |

Stop audio recording.

Parameters:
Instance | AUDIO IN Instance. It can be 1(DFSDM used)
Device | Digital input device to be stopped
Return values:
BSP status

Definition at line 3043 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_STATE_STOP, BSP_AUDIO_IN_PauseChannels(), BSP_ERROR_NONE, and AUDIO_IN_Ctx_t::State.

void BSP_AUDIO_IN_TransferComplete_CallBack ( uint32_t Instance )

User callback when record buffer is filled.

Return values:
None

Definition at line 3801 of file stm32h735g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterRegConvCpltCallback(), HAL_DFSDM_FilterRegConvHalfCpltCallback(), and HAL_SAI_RxCpltCallback().

void HAL_DFSDM_FilterRegConvCpltCallback ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Regular conversion complete callback.

Note:
In interrupt mode, user has to read conversion value in this function using HAL_DFSDM_FilterGetRegularValue.
Parameters:
hdfsdm_filter DFSDM filter handle.
Return values:
None

Definition at line 3602 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_DIGITAL_MIC2, BSP_AUDIO_IN_HalfTransfer_CallBack(), BSP_AUDIO_IN_TransferComplete_CallBack(), DEFAULT_AUDIO_IN_BUFFER_SIZE, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, AUDIO_IN_Ctx_t::pBuff, POS_VAL, RecBuffHalf, RecBuffTrigger, and SaturaLH.

void HAL_DFSDM_FilterRegConvHalfCpltCallback ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Half regular conversion complete callback.

Parameters:
hdfsdm_filter DFSDM filter handle.
Return values:
None

Definition at line 3687 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_DEVICE_DIGITAL_MIC2, BSP_AUDIO_IN_HalfTransfer_CallBack(), BSP_AUDIO_IN_TransferComplete_CallBack(), DEFAULT_AUDIO_IN_BUFFER_SIZE, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, AUDIO_IN_Ctx_t::pBuff, POS_VAL, RecBuffHalf, RecBuffTrigger, and SaturaLH.

void HAL_SAI_RxCpltCallback ( SAI_HandleTypeDef * hsai )

Reception complete callback.

Parameters:
hsai SAI handle.
Return values:
None

Definition at line 3787 of file stm32h735g_discovery_audio.c.

References BSP_AUDIO_IN_TransferComplete_CallBack().

void HAL_SAI_RxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

Half reception complete callback.

Parameters:
hsai SAI handle.
Return values:
None

Definition at line 3773 of file stm32h735g_discovery_audio.c.

References BSP_AUDIO_IN_HalfTransfer_CallBack().

HAL_StatusTypeDef MX_DFSDM1_ClockConfig | ( | DFSDM_Channel_HandleTypeDef * | hDfsdmChannel,
 |  | uint32_t | SampleRate
 | ) |  |

Clock Config.

Parameters:
hDfsdmChannel | DFSDM Channel Handle
SampleRate | Audio frequency to be configured for the DFSDM Channel.
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application
Return values:
HAL_status

Definition at line 2249 of file stm32h735g_discovery_audio.c.

References AUDIO_IN_STATE_RESET, AUDIO_OUT_STATE_RESET, haudio_in_sai, and MX_SAI1_ClockConfig().

Referenced by BSP_AUDIO_IN_Init().

HAL_StatusTypeDef MX_DFSDM1_Init | ( | DFSDM_Filter_HandleTypeDef * | hDfsdmFilter,
 |  | DFSDM_Channel_HandleTypeDef * | hDfsdmChannel,
 |  | MX_DFSDM_Config * | MXConfig
 | ) |  |

Initializes the Audio instance (DFSDM).

Parameters:
hDfsdmFilter | DFSDM Filter Handle
hDfsdmChannel | DFSDM Channel Handle
MXConfig | DFSDM configuration structure
Note:
Being __weak it can be overwritten by the application
Channel output Clock Divider and Filter Oversampling are calculated as follow:
  • Clock_Divider = CLK(input DFSDM)/CLK(micro) with 1MHZ < CLK(micro) < 3.2MHZ (TYP 2.4MHZ for MP34DT01TR)
  • Oversampling = CLK(input DFSDM)/(Clock_Divider * AudioFreq)
Return values:
HAL_status

Definition at line 2323 of file stm32h735g_discovery_audio.c.

References MX_DFSDM_Config::Channel4Filter, MX_DFSDM_Config::ChannelInstance, MX_DFSDM_Config::ClockDivider, MX_DFSDM_Config::DigitalMicPins, MX_DFSDM_Config::DigitalMicType, MX_DFSDM_Config::FilterInstance, MX_DFSDM_Config::Oversampling, MX_DFSDM_Config::RegularTrigger, MX_DFSDM_Config::RightBitShift, and MX_DFSDM_Config::SincOrder.

Referenced by BSP_AUDIO_IN_Init().

HAL_StatusTypeDef MX_DFSDM2_ClockConfig | ( | DFSDM_Channel_HandleTypeDef * | hDfsdmChannel,
 |  | uint32_t | SampleRate
 | ) |  |
HAL_StatusTypeDef MX_DFSDM2_Init | ( | DFSDM_Filter_HandleTypeDef * | hDfsdmFilter,
 |  | DFSDM_Channel_HandleTypeDef * | hDfsdmChannel,
 |  | MX_DFSDM_Config * | MXConfig
 | ) |  |
__weak HAL_StatusTypeDef MX_SAI1_Block_A_Init | ( | SAI_HandleTypeDef * | hsai,
 |  | MX_SAI_Config * | MXConfig
 | ) |  |

Initializes the Audio Codec audio in instance (SAI).

Parameters:
hsai | SAI handle
MXConfig | SAI configuration structure
Note:
Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 2380 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, AUDIO_RESOLUTION_24B, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, MX_SAI_Config::FrameLength, MX_SAI_Config::MonoStereoMode, MX_SAI_Config::OutputDrive, MX_SAI_Config::SlotActive, MX_SAI_Config::Synchro, and MX_SAI_Config::SynchroExt.

Referenced by BSP_AUDIO_IN_Init().

HAL_StatusTypeDef MX_SAI1_Block_B_Init | ( | SAI_HandleTypeDef * | hsai,
 |  | MX_SAI_Config * | MXConfig
 | ) |  |

Initializes the Audio Codec audio out instance (SAI).

Parameters:
hsai | SAI handle
MXConfig | SAI confiruration structure
Note:
Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 512 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, AUDIO_RESOLUTION_24B, AUDIO_RESOLUTION_32B, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, MX_SAI_Config::FrameLength, MX_SAI_Config::MonoStereoMode, MX_SAI_Config::OutputDrive, MX_SAI_Config::SlotActive, MX_SAI_Config::Synchro, and MX_SAI_Config::SynchroExt.

Referenced by BSP_AUDIO_IN_Init(), and BSP_AUDIO_OUT_Init().

HAL_StatusTypeDef MX_SAI4_Block_A_Init | ( | SAI_HandleTypeDef * | hsai,
 |  | MX_SAI_Config * | MXConfig
 | ) |  |

Initializes the Audio Codec audio in instance (SAI).

Parameters:
MXConfig SAI configuration structure
Note:
Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 2441 of file stm32h735g_discovery_audio.c.

References MX_SAI_Config::ActiveFrameLength, MX_SAI_Config::AudioFrequency, MX_SAI_Config::AudioMode, MX_SAI_Config::ClockStrobing, MX_SAI_Config::DataSize, MX_SAI_Config::FrameLength, MX_SAI_Config::MonoStereoMode, MX_SAI_Config::OutputDrive, MX_SAI_Config::SlotActive, MX_SAI_Config::Synchro, and MX_SAI_Config::SynchroExt.

Referenced by BSP_AUDIO_IN_Init().

HAL_StatusTypeDef MX_SAI4_ClockConfig | ( | SAI_HandleTypeDef * | hsai,
 |  | uint32_t | SampleRate
 | ) |  |

SAI clock Config.

Parameters:
hsai | SAI handle
SampleRate | Audio frequency used to play the audio stream.
Note:
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Return values:
HAL status

Definition at line 2276 of file stm32h735g_discovery_audio.c.

References AUDIO_FREQUENCY_11K, AUDIO_FREQUENCY_22K, and AUDIO_FREQUENCY_44K.

Referenced by BSP_AUDIO_IN_Init().


STM32H735G-DK BSP User Manual: AUDIO IN Private Functions

Functions
AUDIO IN Private Functions
AUDIO

Functions

static void | DFSDM_ChannelMspInit (DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
Initialize the DFSDM channel MSP.
static void | DFSDM_ChannelMspDeInit (DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
DeInitialize the DFSDM channel MSP.
static void | DFSDM_FilterMspInit (DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
Initialize the DFSDM filter MSP.
static void | DFSDM_FilterMspDeInit (DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
DeInitialize the DFSDM filter MSP.

Function Documentation

static void DFSDM_ChannelMspDeInit ( DFSDM_Channel_HandleTypeDef * hDfsdmChannel ) [static]

DeInitialize the DFSDM channel MSP.

Parameters:
hDfsdmChannel DFSDM Channel handle
Return values:
None

Definition at line 4101 of file stm32h735g_discovery_audio.c.

References AUDIO_DFSDM1_CKOUT_GPIO_PORT, AUDIO_DFSDM1_CKOUT_PIN, AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC1_PIN, AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC2_PIN, AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC3_PIN, AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT, and AUDIO_DFSDMx_DATIN_MIC4_PIN.

Referenced by BSP_AUDIO_IN_DeInit().

static void DFSDM_ChannelMspInit ( DFSDM_Channel_HandleTypeDef * hDfsdmChannel ) [static]

Initialize the DFSDM channel MSP.

Parameters:
hDfsdmChannel DFSDM Channel handle
Return values:
None

Definition at line 4055 of file stm32h735g_discovery_audio.c.

References AUDIO_DFSDM1_CKOUT_AF, AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE, AUDIO_DFSDM1_CKOUT_GPIO_PORT, AUDIO_DFSDM1_CKOUT_PIN, AUDIO_DFSDM1_CLK_ENABLE, AUDIO_DFSDMx_DATIN_MIC1_AF, AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE, AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC1_PIN, AUDIO_DFSDMx_DATIN_MIC2_AF, AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE, AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC2_PIN, AUDIO_DFSDMx_DATIN_MIC3_AF, AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE, AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT, AUDIO_DFSDMx_DATIN_MIC3_PIN, AUDIO_DFSDMx_DATIN_MIC4_AF, AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE, AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT, and AUDIO_DFSDMx_DATIN_MIC4_PIN.

Referenced by BSP_AUDIO_IN_Init().

static void DFSDM_FilterMspDeInit ( DFSDM_Filter_HandleTypeDef * hDfsdmFilter ) [static]

DeInitialize the DFSDM filter MSP.

Parameters:
hDfsdmFilter DFSDM Filter handle
Return values:
None

Definition at line 4204 of file stm32h735g_discovery_audio.c.

References DFSDM_MIC_NUMBER, and hDmaDfsdm.

Referenced by BSP_AUDIO_IN_DeInit().

static void DFSDM_FilterMspInit ( DFSDM_Filter_HandleTypeDef * hDfsdmFilter ) [static]

Initialize the DFSDM filter MSP.

Parameters:
hDfsdmFilter DFSDM Filter handle
Return values:
None

Definition at line 4127 of file stm32h735g_discovery_audio.c.

References AUDIO_DFSDM1_CLK_ENABLE, AUDIO_DFSDM1_DMAx_CLK_ENABLE, AUDIO_DFSDMx_DMAx_MIC1_IRQ, AUDIO_DFSDMx_DMAx_MIC1_REQUEST, AUDIO_DFSDMx_DMAx_MIC1_STREAM, AUDIO_DFSDMx_DMAx_MIC2_IRQ, AUDIO_DFSDMx_DMAx_MIC2_REQUEST, AUDIO_DFSDMx_DMAx_MIC2_STREAM, AUDIO_DFSDMx_DMAx_MIC3_IRQ, AUDIO_DFSDMx_DMAx_MIC3_REQUEST, AUDIO_DFSDMx_DMAx_MIC3_STREAM, AUDIO_DFSDMx_DMAx_MIC4_IRQ, AUDIO_DFSDMx_DMAx_MIC4_REQUEST, AUDIO_DFSDMx_DMAx_MIC4_STREAM, AUDIO_IN_DEVICE_DIGITAL_MIC2, AUDIO_IN_DEVICE_DIGITAL_MIC3, AUDIO_IN_DEVICE_DIGITAL_MIC4, BSP_AUDIO_IN_IT_PRIORITY, DFSDM_MIC_NUMBER, haudio_in_dfsdm_filter, hDmaDfsdm, and POS_VAL.

Referenced by BSP_AUDIO_IN_Init().


STM32H735G-DK BSP User Manual: LCD Private Variables

Variables
LCD Private Variables
STM32H735G_DISCO LCD

Variables

static uint32_t PixelFormatFactor

Variable Documentation

uint32_t PixelFormatFactor [static]

Definition at line 108 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_FillRGBRect(), and BSP_LCD_InitEx().


STM32H735G-DK BSP User Manual: LCD Private TypesDefinitions

Variables
LCD Private TypesDefinitions
STM32H735G_DISCO LCD

Variables

const LCD_UTILS_Drv_t LCD_Driver

Variable Documentation

const LCD_UTILS_Drv_t LCD_Driver
Initial value:
{
  BSP_LCD_DrawBitmap,
  BSP_LCD_FillRGBRect,
  BSP_LCD_DrawHLine,
  BSP_LCD_DrawVLine,
  BSP_LCD_FillRect,
  BSP_LCD_ReadPixel,
  BSP_LCD_WritePixel,
  BSP_LCD_GetXSize,
  BSP_LCD_GetYSize,
  BSP_LCD_SetActiveLayer,
  BSP_LCD_GetPixelFormat
}

Definition at line 116 of file stm32h735g_discovery_lcd.c.


STM32H735G-DK BSP User Manual: Exported Variables

Variables
Exported Variables
STM32H735G_DISCO LCD

Variables

DMA2D_HandleTypeDef | hlcd_dma2d
LTDC_HandleTypeDef | hlcd_ltdc
BSP_LCD_Ctx_t Lcd_Ctx [LCD_INSTANCES_NBR]
const LCD_UTILS_Drv_t | LCD_Driver
DMA2D_HandleTypeDef | hlcd_dma2d
LTDC_HandleTypeDef | hlcd_ltdc
BSP_LCD_Ctx_t LcdCtx []

Variable Documentation

DMA2D_HandleTypeDef hlcd_dma2d

Definition at line 138 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit(), BSP_LCD_InitEx(), LL_ConvertLineToRGB(), and LL_FillBuffer().

DMA2D_HandleTypeDef hlcd_dma2d

Definition at line 138 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit(), BSP_LCD_InitEx(), LL_ConvertLineToRGB(), and LL_FillBuffer().

LTDC_HandleTypeDef hlcd_ltdc

Definition at line 139 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_FillRGBRect(), BSP_LCD_InitEx(), BSP_LCD_ReadPixel(), BSP_LCD_Relaod(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetTransparency(), and BSP_LCD_WritePixel().

LTDC_HandleTypeDef hlcd_ltdc

Definition at line 139 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_FillRGBRect(), BSP_LCD_InitEx(), BSP_LCD_ReadPixel(), BSP_LCD_Relaod(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetTransparency(), and BSP_LCD_WritePixel().

BSP_LCD_Ctx_t Lcd_Ctx[LCD_INSTANCES_NBR]

Definition at line 140 of file stm32h735g_discovery_lcd.c.

const LCD_UTILS_Drv_t LCD_Driver

Definition at line 116 of file stm32h735g_discovery_lcd.c.

BSP_LCD_Ctx_t LcdCtx[]


STM32H735G-DK BSP User Manual: LCD Private FunctionPrototypes

LCD Private FunctionPrototypes
STM32H735G_DISCO LCD


STM32H735G-DK BSP User Manual: Private Macros

Defines
Private Macros
STM32H735G_DISCO LCD

Defines

#define CONVERTRGB5652ARGB8888(Color)

Define Documentation

#define CONVERTRGB5652ARGB8888 ( Color )
Value:
(((((((Color >> 11) & 0x1FU) * 527) + 23) >> 6) << 16) |\
                                     ((((((Color >> 5) & 0x3FU) * 259) + 33) >> 6) << 8) |\
                                     ((((Color & 0x1FU) * 527) + 23) >> 6) | 0xFF000000)

Definition at line 162 of file stm32h735g_discovery_lcd.c.

Referenced by LL_FillBuffer().


STM32H735G-DK BSP User Manual: LCD Exported Functions

Functions
LCD Exported Functions
STM32H735G_DISCO LCD

Functions

int32_t | BSP_LCD_Init (uint32_t Instance, uint32_t Orientation)
Initializes the LCD in default mode.
int32_t | BSP_LCD_InitEx (uint32_t Instance, uint32_t Orientation, uint32_t PixelFormat, uint32_t Width, uint32_t Height)
Initializes the LCD.
int32_t | BSP_LCD_DeInit (uint32_t Instance)
De-Initializes the LCD resources.
__weak HAL_StatusTypeDef | MX_LTDC_Init (LTDC_HandleTypeDef *hltdc, uint32_t Width, uint32_t Height)
Initializes the LTDC.
__weak HAL_StatusTypeDef | MX_LTDC_ConfigLayer (LTDC_HandleTypeDef *hltdc, uint32_t LayerIndex, MX_LTDC_LayerConfig_t *Config)
MX LTDC layer configuration.
__weak HAL_StatusTypeDef | MX_LTDC_ClockConfig (LTDC_HandleTypeDef *hltdc)
LTDC Clock Config for LCD DPI display.
int32_t | BSP_LCD_ConfigLayer (uint32_t Instance, uint32_t LayerIndex, BSP_LCD_LayerConfig_t *Config)
LTDC layer configuration.
int32_t | BSP_LCD_GetPixelFormat (uint32_t Instance, uint32_t *PixelFormat)
Gets the LCD Active LCD Pixel Format.
int32_t | BSP_LCD_SetActiveLayer (uint32_t Instance, uint32_t LayerIndex)
Set the LCD Active Layer.
int32_t | BSP_LCD_Relaod (uint32_t Instance, uint32_t ReloadType)
Control the LTDC reload.
int32_t | BSP_LCD_SetLayerVisible (uint32_t Instance, uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
int32_t | BSP_LCD_SetTransparency (uint32_t Instance, uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
int32_t | BSP_LCD_SetLayerAddress (uint32_t Instance, uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
int32_t | BSP_LCD_SetLayerWindow (uint32_t Instance, uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
int32_t | BSP_LCD_SetColorKeying (uint32_t Instance, uint32_t LayerIndex, uint32_t Color)
Configures and sets the color keying.
int32_t | BSP_LCD_ResetColorKeying (uint32_t Instance, uint32_t LayerIndex)
Disables the color keying.
int32_t | BSP_LCD_GetXSize (uint32_t Instance, uint32_t *XSize)
Gets the LCD X size.
int32_t | BSP_LCD_GetYSize (uint32_t Instance, uint32_t *YSize)
Gets the LCD Y size.
int32_t | BSP_LCD_DisplayOn (uint32_t Instance)
Switch On the display.
int32_t | BSP_LCD_DisplayOff (uint32_t Instance)
Switch Off the display.
int32_t | BSP_LCD_SetBrightness (uint32_t Instance, uint32_t Brightness)
Set the brightness value.
int32_t | BSP_LCD_GetBrightness (uint32_t Instance, uint32_t *Brightness)
Set the brightness value.
int32_t | BSP_LCD_DrawBitmap (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
Draws a bitmap picture loaded in the internal Flash in currently active layer.
int32_t | BSP_LCD_FillRGBRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
Draw a horizontal line on LCD.
int32_t | BSP_LCD_DrawHLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws an horizontal line in currently active layer.
int32_t | BSP_LCD_DrawVLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws a vertical line in currently active layer.
int32_t | BSP_LCD_FillRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
Draws a full rectangle in currently active layer.
int32_t | BSP_LCD_ReadPixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
Reads an LCD pixel.
int32_t | BSP_LCD_WritePixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
Draws a pixel on LCD.
void | BSP_LCD_Reset (uint32_t Instance)
HAL_StatusTypeDef | MX_LTDC_ClockConfig2 (LTDC_HandleTypeDef *hltdc)

Function Documentation

int32_t BSP_LCD_ConfigLayer | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | BSP_LCD_LayerConfig_t * | Config
 | ) |  |

LTDC layer configuration.

Parameters:
Instance | LCD instance
LayerIndex | Layer 0 or 1
Config | Layer configuration
Return values:
HAL status

Definition at line 526 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, LCD_INSTANCES_NBR, and MX_LTDC_ConfigLayer().

int32_t BSP_LCD_DeInit ( uint32_t Instance )

De-Initializes the LCD resources.

Parameters:
Instance LCD Instance
Return values:
BSP status

Definition at line 324 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, DMA2D_MspDeInit(), hlcd_dma2d, hlcd_ltdc, BSP_LCD_Ctx_t::IsMspCallbacksValid, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, LCD_INSTANCES_NBR, and LTDC_MspDeInit().

int32_t BSP_LCD_DisplayOff ( uint32_t Instance )

Switch Off the display.

Parameters:
Instance LCD Instance
Return values:
BSP status

Definition at line 901 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_DisplayOn ( uint32_t Instance )

Switch On the display.

Parameters:
Instance LCD Instance
Return values:
BSP status

Definition at line 874 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_DrawBitmap | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint8_t * | pBmp
 | ) |  |

Draws a bitmap picture loaded in the internal Flash in currently active layer.

Parameters:
Instance | LCD Instance
Xpos | Bmp X position in the LCD
Ypos | Bmp Y position in the LCD
pbmp | Pointer to Bmp picture address in the internal Flash.
Return values:
BSP status

Definition at line 975 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, LL_ConvertLineToRGB(), PixelFormatFactor, and BSP_LCD_Ctx_t::XSize.

int32_t BSP_LCD_DrawHLine | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint32_t | Length,
 |  | uint32_t | Color
 | ) |  |

Draws an horizontal line in currently active layer.

Parameters:
Instance | LCD Instance
Xpos | X position
Ypos | Y position
Length | Line length

Definition at line 1087 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, LL_FillBuffer(), PixelFormatFactor, and BSP_LCD_Ctx_t::XSize.

int32_t BSP_LCD_DrawVLine | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint32_t | Length,
 |  | uint32_t | Color
 | ) |  |

Draws a vertical line in currently active layer.

Parameters:
Instance | LCD Instance
Xpos | X position
Ypos | Y position
Length | Line length

Definition at line 1107 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, LL_FillBuffer(), and PixelFormatFactor.

int32_t BSP_LCD_FillRect | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint32_t | Width,
 |  | uint32_t | Height,
 |  | uint32_t | Color
 | ) |  |

Draws a full rectangle in currently active layer.

Parameters:
Instance | LCD Instance
Xpos | X position
Ypos | Y position
Width | Rectangle width
Height | Rectangle height

Definition at line 1128 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, LL_FillBuffer(), and PixelFormatFactor.

int32_t BSP_LCD_FillRGBRect | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint8_t * | pData,
 |  | uint32_t | Width,
 |  | uint32_t | Height
 | ) |  |

Draw a horizontal line on LCD.

Parameters:
Instance | LCD Instance.
Xpos | X position.
Ypos | Y position.
pData | Pointer to RGB line data
Width | Rectangle width.
Height | Rectangle Height.
Return values:
BSP status.

Definition at line 1039 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, BSP_LCD_WritePixel(), hlcd_ltdc, LL_ConvertLineToRGB(), PixelFormatFactor, and BSP_LCD_Ctx_t::XSize.

int32_t BSP_LCD_GetBrightness | ( | uint32_t | Instance,
 |  | uint32_t * | Brightness
 | ) |  |

Set the brightness value.

Parameters:
Instance | LCD Instance
Brightness | [00: Min (black), 100 Max]
Return values:
BSP status

Definition at line 951 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_FEATURE_NOT_SUPPORTED, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_GetPixelFormat | ( | uint32_t | Instance,
 |  | uint32_t * | PixelFormat
 | ) |  |

Gets the LCD Active LCD Pixel Format.

Parameters:
Instance | LCD Instance
PixelFormat | Active LCD Pixel Format
Return values:
BSP status

Definition at line 549 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LCD_INSTANCES_NBR, and BSP_LCD_Ctx_t::PixelFormat.

int32_t BSP_LCD_GetXSize | ( | uint32_t | Instance,
 |  | uint32_t * | XSize
 | ) |  |

Gets the LCD X size.

Parameters:
Instance | LCD Instance
XSize | LCD width
Return values:
BSP status

Definition at line 831 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LCD_INSTANCES_NBR, and BSP_LCD_Ctx_t::XSize.

int32_t BSP_LCD_GetYSize | ( | uint32_t | Instance,
 |  | uint32_t * | YSize
 | ) |  |

Gets the LCD Y size.

Parameters:
Instance | LCD Instance
YSize | LCD Height
Return values:
BSP status

Definition at line 853 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, LCD_INSTANCES_NBR, and BSP_LCD_Ctx_t::YSize.

int32_t BSP_LCD_Init | ( | uint32_t | Instance,
 |  | uint32_t | Orientation
 | ) |  |

Initializes the LCD in default mode.

Parameters:
Instance | LCD Instance
Orientation | LCD_ORIENTATION_LANDSCAPE
Return values:
BSP status

Definition at line 179 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_InitEx(), LCD_DEFAULT_HEIGHT, and LCD_DEFAULT_WIDTH.

int32_t BSP_LCD_InitEx | ( | uint32_t | Instance,
 |  | uint32_t | Orientation,
 |  | uint32_t | PixelFormat,
 |  | uint32_t | Width,
 |  | uint32_t | Height
 | ) |  |

Initializes the LCD.

Parameters:
Instance | LCD Instance
Orientation | LCD_ORIENTATION_LANDSCAPE
PixelFormat | LCD_PIXEL_FORMAT_RGB565 or LCD_PIXEL_FORMAT_RGB888
Width | Display width
Height | Display height
Return values:
BSP status

Definition at line 193 of file stm32h735g_discovery_lcd.c.

References MX_LTDC_LayerConfig_t::Address, BSP_ERROR_NO_INIT, BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_UNKNOWN_COMPONENT, BSP_ERROR_WRONG_PARAM, BSP_I2C4_Init(), BSP_I2C4_ReadReg(), BSP_OSPI_RAM_BURST_32_BYTES, BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_FIXED_LATENCY, BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_LINEAR_BURST, BSP_OSPI_RAM_Init_t::BurstLength, BSP_OSPI_RAM_Init_t::BurstType, DMA2D_MspInit(), hlcd_dma2d, hlcd_ltdc, BSP_OSPI_RAM_Init_t::LatencyType, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, LCD_DISP_EN_GPIO_PORT, LCD_DISP_EN_PIN, LCD_INSTANCES_NBR, LCD_LAYER_0_ADDRESS, LCD_ORIENTATION_LANDSCAPE, LTDC_MspInit(), MX_LTDC_ClockConfig(), MX_LTDC_ConfigLayer(), MX_LTDC_Init(), BSP_LCD_Ctx_t::PixelFormat, MX_LTDC_LayerConfig_t::PixelFormat, PixelFormatFactor, BSP_LCD_Ctx_t::ReloadEnable, TS_I2C_ADDRESS, MX_LTDC_LayerConfig_t::X0, MX_LTDC_LayerConfig_t::X1, BSP_LCD_Ctx_t::XSize, MX_LTDC_LayerConfig_t::Y0, MX_LTDC_LayerConfig_t::Y1, and BSP_LCD_Ctx_t::YSize.

Referenced by BSP_LCD_Init().

int32_t BSP_LCD_ReadPixel | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint32_t * | Color
 | ) |  |

Reads an LCD pixel.

Parameters:
Instance | LCD Instance
Xpos | X position
Ypos | Y position
Color | RGB pixel color
Return values:
Value pixel color

Definition at line 1149 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, and BSP_LCD_Ctx_t::XSize.

int32_t BSP_LCD_Relaod | ( | uint32_t | Instance,
 |  | uint32_t | ReloadType
 | ) |  |

Control the LTDC reload.

Parameters:
Instance LCD Instance
ReloadType can be one of the following values
  • BSP_LCD_RELOAD_NONE
  • BSP_LCD_RELOAD_IMMEDIATE
  • BSP_LCD_RELOAD_VERTICAL_BLANKING
Return values:
BSP status

Definition at line 597 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_PERIPH_FAILURE, BSP_ERROR_WRONG_PARAM, BSP_LCD_RELOAD_NONE, hlcd_ltdc, LCD_INSTANCES_NBR, and BSP_LCD_Ctx_t::ReloadEnable.

void BSP_LCD_Reset ( uint32_t Instance )
int32_t BSP_LCD_ResetColorKeying | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex
 | ) |  |

Disables the color keying.

Parameters:
Instance | LCD Instance
LayerIndex | Layer foreground or background
Return values:
BSP status

Definition at line 800 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetActiveLayer | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex
 | ) |  |

Set the LCD Active Layer.

Parameters:
Instance | LCD Instance
LayerIndex | LCD layer index
Return values:
BSP status

Definition at line 572 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetBrightness | ( | uint32_t | Instance,
 |  | uint32_t | Brightness
 | ) |  |

Set the brightness value.

Parameters:
Instance | LCD Instance
Brightness | [00: Min (black), 100 Max]
Return values:
BSP status

Definition at line 929 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_FEATURE_NOT_SUPPORTED, BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetColorKeying | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | uint32_t | Color
 | ) |  |

Configures and sets the color keying.

Parameters:
Instance | LCD Instance
LayerIndex | Layer foreground or background
Color | Color reference
Return values:
BSP status

Definition at line 767 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetLayerAddress | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | uint32_t | Address
 | ) |  |

Sets an LCD layer frame buffer address.

Parameters:
Instance | LCD Instance
LayerIndex | Layer foreground or background
Address | New LCD frame buffer value
Return values:
BSP status

Definition at line 697 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetLayerVisible | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | FunctionalState | State
 | ) |  |

Sets an LCD Layer visible.

Parameters:
Instance | LCD Instance
LayerIndex | Visible Layer
State New state of the specified layer This parameter can be one of the following values:
  • ENABLE
  • DISABLE
Return values:
BSP status

Definition at line 631 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_SetLayerWindow | ( | uint32_t | Instance,
 |  | uint16_t | LayerIndex,
 |  | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Width,
 |  | uint16_t | Height
 | ) |  |

Sets display window.

Parameters:
Instance | LCD Instance
LayerIndex | Layer index
Xpos | LCD X position
Ypos | LCD Y position
Width | LCD window width
Height | LCD window height
Return values:
BSP status

Definition at line 730 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, LCD_INSTANCES_NBR, BSP_LCD_Ctx_t::XSize, and BSP_LCD_Ctx_t::YSize.

int32_t BSP_LCD_SetTransparency | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | uint8_t | Transparency
 | ) |  |

Configures the transparency.

Parameters:
Instance | LCD Instance
LayerIndex | Layer foreground or background.
Transparency | Transparency This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
Return values:
BSP status

Definition at line 667 of file stm32h735g_discovery_lcd.c.

References BSP_ERROR_NONE, BSP_ERROR_WRONG_PARAM, hlcd_ltdc, and LCD_INSTANCES_NBR.

int32_t BSP_LCD_WritePixel | ( | uint32_t | Instance,
 |  | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint32_t | Color
 | ) |  |

Draws a pixel on LCD.

Parameters:
Instance | LCD Instance
Xpos | X position
Ypos | Y position
Color | Pixel color
Return values:
BSP status

Definition at line 1173 of file stm32h735g_discovery_lcd.c.

References BSP_LCD_Ctx_t::ActiveLayer, BSP_ERROR_NONE, hlcd_ltdc, and BSP_LCD_Ctx_t::XSize.

Referenced by BSP_LCD_FillRGBRect().

HAL_StatusTypeDef MX_LTDC_ClockConfig ( LTDC_HandleTypeDef * hltdc )

LTDC Clock Config for LCD DPI display.

Parameters:
hltdc LTDC Handle Being __weak it can be overwritten by the application
Return values:
HAL_status

Definition at line 426 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

HAL_StatusTypeDef MX_LTDC_ClockConfig2 ( LTDC_HandleTypeDef * hltdc )
HAL_StatusTypeDef MX_LTDC_ConfigLayer | ( | LTDC_HandleTypeDef * | hltdc,
 |  | uint32_t | LayerIndex,
 |  | MX_LTDC_LayerConfig_t * | Config
 | ) |  |

MX LTDC layer configuration.

Parameters:
hltdc | LTDC handle
LayerIndex | Layer 0 or 1
Config | Layer configuration
Return values:
HAL status

Definition at line 398 of file stm32h735g_discovery_lcd.c.

References MX_LTDC_LayerConfig_t::Address, MX_LTDC_LayerConfig_t::PixelFormat, MX_LTDC_LayerConfig_t::X0, MX_LTDC_LayerConfig_t::X1, MX_LTDC_LayerConfig_t::Y0, and MX_LTDC_LayerConfig_t::Y1.

Referenced by BSP_LCD_ConfigLayer(), and BSP_LCD_InitEx().

HAL_StatusTypeDef MX_LTDC_Init | ( | LTDC_HandleTypeDef * | hltdc,
 |  | uint32_t | Width,
 |  | uint32_t | Height
 | ) |  |

Initializes the LTDC.

Parameters:
hltdc | LTDC handle
Width | LTDC width
Height | LTDC height
Return values:
HAL status

Definition at line 367 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().


STM32H735G-DK BSP User Manual: LCD Private Functions

Functions
LCD Private Functions
STM32H735G_DISCO LCD

Functions

static void | LL_FillBuffer (uint32_t Instance, uint32_t LayerIndex, uint32_t *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t Color)
Fills a buffer.
static void | LL_ConvertLineToRGB (uint32_t Instance, uint32_t *pSrc, uint32_t *pDst, uint32_t xSize, uint32_t ColorMode)
Converts a line to an RGB pixel format.
static void | LTDC_MspInit (LTDC_HandleTypeDef *hltdc)
Initialize the BSP LTDC Msp.
static void | LTDC_MspDeInit (LTDC_HandleTypeDef *hltdc)
De-Initializes the BSP LTDC Msp.
static void | DMA2D_MspInit (DMA2D_HandleTypeDef *hdma2d)
Initialize the BSP DMA2D Msp.
static void | DMA2D_MspDeInit (DMA2D_HandleTypeDef *hdma2d)
De-Initializes the BSP DMA2D Msp.

Function Documentation

static void DMA2D_MspDeInit ( DMA2D_HandleTypeDef * hdma2d ) [static]

De-Initializes the BSP DMA2D Msp.

Parameters:
hdma2d DMA2D handle
Return values:
None

Disable IRQ of DMA2D IP

Force and let in reset state DMA2D

Disable the DMA2D

Definition at line 1451 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit().

static void DMA2D_MspInit ( DMA2D_HandleTypeDef * hdma2d ) [static]

Initialize the BSP DMA2D Msp.

Parameters:
hdma2d DMA2D handle
Return values:
None

Enable the DMA2D clock

Toggle Sw reset of DMA2D IP

Definition at line 1433 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

static void LL_ConvertLineToRGB | ( | uint32_t | Instance,
 |  | uint32_t * | pSrc,
 |  | uint32_t * | pDst,
 |  | uint32_t | xSize,
 |  | uint32_t | ColorMode
 | ) |  | [static]

Converts a line to an RGB pixel format.

Parameters:
Instance | LCD Instance
pSrc | Pointer to source buffer
pDst | Output color
xSize | Buffer width
ColorMode | Input color mode

Definition at line 1248 of file stm32h735g_discovery_lcd.c.

References hlcd_dma2d.

Referenced by BSP_LCD_DrawBitmap(), and BSP_LCD_FillRGBRect().

static void LL_FillBuffer | ( | uint32_t | Instance,
 |  | uint32_t | LayerIndex,
 |  | uint32_t * | pDst,
 |  | uint32_t | xSize,
 |  | uint32_t | ySize,
 |  | uint32_t | OffLine,
 |  | uint32_t | Color
 | ) |  | [static]

Fills a buffer.

Parameters:
Instance | LCD Instance
LayerIndex | Layer index
pDst | Pointer to destination buffer
xSize | Buffer width
ySize | Buffer height
OffLine | Offset
Color | Color index

Definition at line 1206 of file stm32h735g_discovery_lcd.c.

References CONVERTRGB5652ARGB8888, and hlcd_dma2d.

Referenced by BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), and BSP_LCD_FillRect().

static void LTDC_MspDeInit ( LTDC_HandleTypeDef * hltdc ) [static]

De-Initializes the BSP LTDC Msp.

Parameters:
hltdc LTDC handle
Return values:
None

Force and let in reset state LTDC

Disable the LTDC

Definition at line 1385 of file stm32h735g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit().

static void LTDC_MspInit ( LTDC_HandleTypeDef * hltdc ) [static]

Initialize the BSP LTDC Msp.

Parameters:
hltdc LTDC handle
Return values:
None

Toggle Sw reset of LTDC peripheral

Definition at line 1300 of file stm32h735g_discovery_lcd.c.

References LCD_BL_CTRL_GPIO_CLK_ENABLE, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_CTRL_GPIO_CLK_ENABLE, LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, LCD_DISP_EN_GPIO_CLK_ENABLE, LCD_DISP_EN_GPIO_PORT, and LCD_DISP_EN_PIN.

Referenced by BSP_LCD_InitEx().


STM32H735G-DK BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H735G_DISCO LCD

Defines

#define | LCD_INSTANCES_NBR 1U
#define | LCD_ORIENTATION_LANDSCAPE 0x01U /* Landscape orientation choice of LCD screen */
#define | LCD_DEFAULT_WIDTH 480U
#define | LCD_DEFAULT_HEIGHT 272U
#define | BSP_LCD_RELOAD_NONE 0U /* No reload executed */
#define | BSP_LCD_RELOAD_IMMEDIATE LTDC_RELOAD_IMMEDIATE /* Immediate Reload */
#define | BSP_LCD_RELOAD_VERTICAL_BLANKING LTDC_RELOAD_VERTICAL_BLANKING /* Vertical Blanking Reload */
#define | LCD_DISP_CTRL_PIN GPIO_PIN_10
LCD special pins.
#define | LCD_DISP_CTRL_PULL GPIO_NOPULL
#define | LCD_DISP_CTRL_GPIO_PORT GPIOD
#define | LCD_DISP_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LCD_DISP_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LCD_DISP_EN_PIN GPIO_PIN_13
#define | LCD_DISP_EN_PULL GPIO_NOPULL
#define | LCD_DISP_EN_GPIO_PORT GPIOE
#define | LCD_DISP_EN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | LCD_DISP_EN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_15
#define | LCD_BL_CTRL_GPIO_PORT GPIOG
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | LCD_COLOR_RGB565_BLUE 0x001FU
#define | LCD_COLOR_RGB565_GREEN 0x07E0U
#define | LCD_COLOR_RGB565_RED 0xF800U
#define | LCD_COLOR_RGB565_CYAN 0x07FFU
#define | LCD_COLOR_RGB565_MAGENTA 0xF81FU
#define | LCD_COLOR_RGB565_YELLOW 0xFFE0U
#define | LCD_COLOR_RGB565_LIGHTBLUE 0x841FU
#define | LCD_COLOR_RGB565_LIGHTGREEN 0x87F0U
#define | LCD_COLOR_RGB565_LIGHTRED 0xFC10U
#define | LCD_COLOR_RGB565_LIGHTCYAN 0x87FFU
#define | LCD_COLOR_RGB565_LIGHTMAGENTA 0xFC1FU
#define | LCD_COLOR_RGB565_LIGHTYELLOW 0xFFF0U
#define | LCD_COLOR_RGB565_DARKBLUE 0x0010U
#define | LCD_COLOR_RGB565_DARKGREEN 0x0400U
#define | LCD_COLOR_RGB565_DARKRED 0x8000U
#define | LCD_COLOR_RGB565_DARKCYAN 0x0410U
#define | LCD_COLOR_RGB565_DARKMAGENTA 0x8010U
#define | LCD_COLOR_RGB565_DARKYELLOW 0x8400U
#define | LCD_COLOR_RGB565_WHITE 0xFFFFU
#define | LCD_COLOR_RGB565_LIGHTGRAY 0xD69AU
#define | LCD_COLOR_RGB565_GRAY 0x8410U
#define | LCD_COLOR_RGB565_DARKGRAY 0x4208U
#define | LCD_COLOR_RGB565_BLACK 0x0000U
#define | LCD_COLOR_RGB565_BROWN 0xA145U
#define | LCD_COLOR_RGB565_ORANGE 0xFD20U
#define | LCD_COLOR_RGB565_ST_BLUE_DARK 0x0001U
#define | LCD_COLOR_RGB565_ST_BLUE 0x01EBU
#define | LCD_COLOR_RGB565_ST_BLUE_LIGHT 0x06A7U
#define | LCD_COLOR_RGB565_ST_GREEN_LIGHT 0x05ECU
#define | LCD_COLOR_RGB565_ST_GREEN_DARK 0x001CU
#define | LCD_COLOR_RGB565_ST_YELLOW 0x07F0U
#define | LCD_COLOR_RGB565_ST_BROWN 0x02C8U
#define | LCD_COLOR_RGB565_ST_PINK 0x0681U
#define | LCD_COLOR_RGB565_ST_PURPLE 0x02CDU
#define | LCD_COLOR_RGB565_ST_GRAY_DARK 0x0251U
#define | LCD_COLOR_RGB565_ST_GRAY 0x04BAU
#define | LCD_COLOR_RGB565_ST_GRAY_LIGHT 0x05E7U
#define | LCD_COLOR_ARGB8888_BLUE 0xFF0000FFUL
#define | LCD_COLOR_ARGB8888_GREEN 0xFF00FF00UL
#define | LCD_COLOR_ARGB8888_RED 0xFFFF0000UL
#define | LCD_COLOR_ARGB8888_CYAN 0xFF00FFFFUL
#define | LCD_COLOR_ARGB8888_MAGENTA 0xFFFF00FFUL
#define | LCD_COLOR_ARGB8888_YELLOW 0xFFFFFF00UL
#define | LCD_COLOR_ARGB8888_LIGHTBLUE 0xFF8080FFUL
#define | LCD_COLOR_ARGB8888_LIGHTGREEN 0xFF80FF80UL
#define | LCD_COLOR_ARGB8888_LIGHTRED 0xFFFF8080UL
#define | LCD_COLOR_ARGB8888_LIGHTCYAN 0xFF80FFFFUL
#define | LCD_COLOR_ARGB8888_LIGHTMAGENTA 0xFFFF80FFUL
#define | LCD_COLOR_ARGB8888_LIGHTYELLOW 0xFFFFFF80UL
#define | LCD_COLOR_ARGB8888_DARKBLUE 0xFF000080UL
#define | LCD_COLOR_ARGB8888_DARKGREEN 0xFF008000UL
#define | LCD_COLOR_ARGB8888_DARKRED 0xFF800000UL
#define | LCD_COLOR_ARGB8888_DARKCYAN 0xFF008080UL
#define | LCD_COLOR_ARGB8888_DARKMAGENTA 0xFF800080UL
#define | LCD_COLOR_ARGB8888_DARKYELLOW 0xFF808000UL
#define | LCD_COLOR_ARGB8888_WHITE 0xFFFFFFFFUL
#define | LCD_COLOR_ARGB8888_LIGHTGRAY 0xFFD3D3D3UL
#define | LCD_COLOR_ARGB8888_GRAY 0xFF808080UL
#define | LCD_COLOR_ARGB8888_DARKGRAY 0xFF404040UL
#define | LCD_COLOR_ARGB8888_BLACK 0xFF000000UL
#define | LCD_COLOR_ARGB8888_BROWN 0xFFA52A2AUL
#define | LCD_COLOR_ARGB8888_ORANGE 0xFFFFA500UL
#define | LCD_COLOR_ARGB8888_ST_BLUE_DARK 0xFF002052UL
#define | LCD_COLOR_ARGB8888_ST_BLUE 0xFF39A9DCUL
#define | LCD_COLOR_ARGB8888_ST_BLUE_LIGHT 0xFFD1E4F3UL
#define | LCD_COLOR_ARGB8888_ST_GREEN_LIGHT 0xFFBBCC01UL
#define | LCD_COLOR_ARGB8888_ST_GREEN_DARK 0xFF003D14UL
#define | LCD_COLOR_ARGB8888_ST_YELLOW 0xFFFFD300UL
#define | LCD_COLOR_ARGB8888_ST_BROWN 0xFF5C0915UL
#define | LCD_COLOR_ARGB8888_ST_PINK 0xFFD4007AUL
#define | LCD_COLOR_ARGB8888_ST_PURPLE 0xFF590D58UL
#define | LCD_COLOR_ARGB8888_ST_GRAY_DARK 0xFF4F5251UL
#define | LCD_COLOR_ARGB8888_ST_GRAY 0xFF90989EUL
#define | LCD_COLOR_ARGB8888_ST_GRAY_LIGHT 0xFFB9C4CAUL

Define Documentation

#define BSP_LCD_RELOAD_IMMEDIATE LTDC_RELOAD_IMMEDIATE /* Immediate Reload */

Definition at line 63 of file stm32h735g_discovery_lcd.h.

#define BSP_LCD_RELOAD_NONE 0U /* No reload executed */

Definition at line 62 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_Relaod().

#define BSP_LCD_RELOAD_VERTICAL_BLANKING LTDC_RELOAD_VERTICAL_BLANKING /* Vertical Blanking Reload */

Definition at line 64 of file stm32h735g_discovery_lcd.h.

#define LCD_BL_CTRL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 86 of file stm32h735g_discovery_lcd.h.

#define LCD_BL_CTRL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 85 of file stm32h735g_discovery_lcd.h.

Referenced by LTDC_MspInit().

#define LCD_BL_CTRL_GPIO_PORT GPIOG

Definition at line 84 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_BL_CTRL_PIN GPIO_PIN_15

Definition at line 83 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_COLOR_ARGB8888_BLACK 0xFF000000UL

Definition at line 151 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_BLUE 0xFF0000FFUL

Definition at line 129 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_BROWN 0xFFA52A2AUL

Definition at line 152 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_CYAN 0xFF00FFFFUL

Definition at line 132 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKBLUE 0xFF000080UL

Definition at line 141 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKCYAN 0xFF008080UL

Definition at line 144 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKGRAY 0xFF404040UL

Definition at line 150 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKGREEN 0xFF008000UL

Definition at line 142 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKMAGENTA 0xFF800080UL

Definition at line 145 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKRED 0xFF800000UL

Definition at line 143 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_DARKYELLOW 0xFF808000UL

Definition at line 146 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_GRAY 0xFF808080UL

Definition at line 149 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_GREEN 0xFF00FF00UL

Definition at line 130 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTBLUE 0xFF8080FFUL

Definition at line 135 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTCYAN 0xFF80FFFFUL

Definition at line 138 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTGRAY 0xFFD3D3D3UL

Definition at line 148 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTGREEN 0xFF80FF80UL

Definition at line 136 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTMAGENTA 0xFFFF80FFUL

Definition at line 139 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTRED 0xFFFF8080UL

Definition at line 137 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_LIGHTYELLOW 0xFFFFFF80UL

Definition at line 140 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_MAGENTA 0xFFFF00FFUL

Definition at line 133 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ORANGE 0xFFFFA500UL

Definition at line 153 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_RED 0xFFFF0000UL

Definition at line 131 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_BLUE 0xFF39A9DCUL

Definition at line 156 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_BLUE_DARK 0xFF002052UL

Definition at line 155 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_BLUE_LIGHT 0xFFD1E4F3UL

Definition at line 157 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_BROWN 0xFF5C0915UL

Definition at line 161 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_GRAY 0xFF90989EUL

Definition at line 165 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_GRAY_DARK 0xFF4F5251UL

Definition at line 164 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_GRAY_LIGHT 0xFFB9C4CAUL

Definition at line 166 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_GREEN_DARK 0xFF003D14UL

Definition at line 159 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_GREEN_LIGHT 0xFFBBCC01UL

Definition at line 158 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_PINK 0xFFD4007AUL

Definition at line 162 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_PURPLE 0xFF590D58UL

Definition at line 163 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_ST_YELLOW 0xFFFFD300UL

Definition at line 160 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_WHITE 0xFFFFFFFFUL

Definition at line 147 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_ARGB8888_YELLOW 0xFFFFFF00UL

Definition at line 134 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_BLACK 0x0000U

Definition at line 111 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_BLUE 0x001FU

Definition at line 89 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_BROWN 0xA145U

Definition at line 112 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_CYAN 0x07FFU

Definition at line 92 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKBLUE 0x0010U

Definition at line 101 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKCYAN 0x0410U

Definition at line 104 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKGRAY 0x4208U

Definition at line 110 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKGREEN 0x0400U

Definition at line 102 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKMAGENTA 0x8010U

Definition at line 105 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKRED 0x8000U

Definition at line 103 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_DARKYELLOW 0x8400U

Definition at line 106 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_GRAY 0x8410U

Definition at line 109 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_GREEN 0x07E0U

Definition at line 90 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTBLUE 0x841FU

Definition at line 95 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTCYAN 0x87FFU

Definition at line 98 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTGRAY 0xD69AU

Definition at line 108 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTGREEN 0x87F0U

Definition at line 96 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTMAGENTA 0xFC1FU

Definition at line 99 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTRED 0xFC10U

Definition at line 97 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_LIGHTYELLOW 0xFFF0U

Definition at line 100 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_MAGENTA 0xF81FU

Definition at line 93 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ORANGE 0xFD20U

Definition at line 113 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_RED 0xF800U

Definition at line 91 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_BLUE 0x01EBU

Definition at line 116 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_BLUE_DARK 0x0001U

Definition at line 115 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_BLUE_LIGHT 0x06A7U

Definition at line 117 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_BROWN 0x02C8U

Definition at line 121 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_GRAY 0x04BAU

Definition at line 125 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_GRAY_DARK 0x0251U

Definition at line 124 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_GRAY_LIGHT 0x05E7U

Definition at line 126 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_GREEN_DARK 0x001CU

Definition at line 119 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_GREEN_LIGHT 0x05ECU

Definition at line 118 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_PINK 0x0681U

Definition at line 122 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_PURPLE 0x02CDU

Definition at line 123 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_ST_YELLOW 0x07F0U

Definition at line 120 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_WHITE 0xFFFFU

Definition at line 107 of file stm32h735g_discovery_lcd.h.

#define LCD_COLOR_RGB565_YELLOW 0xFFE0U

Definition at line 94 of file stm32h735g_discovery_lcd.h.

#define LCD_DEFAULT_HEIGHT 272U

Definition at line 60 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_Init().

#define LCD_DEFAULT_WIDTH 480U

Definition at line 59 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_Init().

#define LCD_DISP_CTRL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 73 of file stm32h735g_discovery_lcd.h.

#define LCD_DISP_CTRL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 72 of file stm32h735g_discovery_lcd.h.

Referenced by LTDC_MspInit().

#define LCD_DISP_CTRL_GPIO_PORT GPIOD

Definition at line 71 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_DISP_CTRL_PIN GPIO_PIN_10

LCD special pins.

Definition at line 69 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_DISP_CTRL_PULL GPIO_NOPULL

Definition at line 70 of file stm32h735g_discovery_lcd.h.

#define LCD_DISP_EN_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOE_CLK_DISABLE()

Definition at line 80 of file stm32h735g_discovery_lcd.h.

#define LCD_DISP_EN_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 79 of file stm32h735g_discovery_lcd.h.

Referenced by LTDC_MspInit().

#define LCD_DISP_EN_GPIO_PORT GPIOE

Definition at line 78 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_DISP_EN_PIN GPIO_PIN_13

Definition at line 76 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and LTDC_MspInit().

#define LCD_DISP_EN_PULL GPIO_NOPULL

Definition at line 77 of file stm32h735g_discovery_lcd.h.

#define LCD_INSTANCES_NBR 1U

Definition at line 55 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_GetBrightness(), BSP_LCD_GetPixelFormat(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_InitEx(), BSP_LCD_Relaod(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetActiveLayer(), BSP_LCD_SetBrightness(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), and BSP_LCD_SetTransparency().

#define LCD_ORIENTATION_LANDSCAPE 0x01U /* Landscape orientation choice of LCD screen */

Definition at line 57 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().


STM32H735G-DK BSP User Manual: Exported Types

Data Structures | Defines | Typedefs
Exported Types
STM32H735G_DISCO LCD

Data Structures

struct | BSP_LCD_Ctx_t
struct | MX_LTDC_LayerConfig_t

Defines

#define | BSP_LCD_LayerConfig_t MX_LTDC_LayerConfig_t

Typedefs

typedef uint32_t(* | ConvertColor_Func )(uint32_t)

Define Documentation

#define BSP_LCD_LayerConfig_t MX_LTDC_LayerConfig_t

Definition at line 205 of file stm32h735g_discovery_lcd.h.

Typedef Documentation

typedef uint32_t(* ConvertColor_Func)(uint32_t)

Definition at line 183 of file stm32h735g_discovery_lcd.h.


STM32H735G-DK BSP User Manual: BSP_LCD_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
BSP_LCD_Ctx_t Struct Reference
Exported Types

#include <stm32h735g_discovery_lcd.h>

Data Fields

uint32_t | XSize
uint32_t | YSize
uint32_t | ActiveLayer
uint32_t | PixelFormat
uint32_t | IsMspCallbacksValid
uint32_t | ReloadEnable

Detailed Description

Definition at line 185 of file stm32h735g_discovery_lcd.h.

Field Documentation

uint32_t BSP_LCD_Ctx_t::ActiveLayer

Definition at line 189 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_FillRGBRect(), BSP_LCD_ReadPixel(), BSP_LCD_SetActiveLayer(), and BSP_LCD_WritePixel().

uint32_t BSP_LCD_Ctx_t::IsMspCallbacksValid

Definition at line 191 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit().

uint32_t BSP_LCD_Ctx_t::PixelFormat

Definition at line 190 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_GetPixelFormat(), and BSP_LCD_InitEx().

uint32_t BSP_LCD_Ctx_t::ReloadEnable

Definition at line 192 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and BSP_LCD_Relaod().

uint32_t BSP_LCD_Ctx_t::XSize

Definition at line 187 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_FillRGBRect(), BSP_LCD_GetXSize(), BSP_LCD_InitEx(), BSP_LCD_ReadPixel(), BSP_LCD_SetLayerWindow(), and BSP_LCD_WritePixel().

uint32_t BSP_LCD_Ctx_t::YSize

Definition at line 188 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_GetYSize(), BSP_LCD_InitEx(), and BSP_LCD_SetLayerWindow().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_lcd.h


STM32H735G-DK BSP User Manual: MX_LTDC_LayerConfig_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MX_LTDC_LayerConfig_t Struct Reference
Exported Types

#include <stm32h735g_discovery_lcd.h>

Data Fields

uint32_t | X0
uint32_t | X1
uint32_t | Y0
uint32_t | Y1
uint32_t | PixelFormat
uint32_t | Address

Detailed Description

Definition at line 195 of file stm32h735g_discovery_lcd.h.

Field Documentation

uint32_t MX_LTDC_LayerConfig_t::Address

Definition at line 202 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

uint32_t MX_LTDC_LayerConfig_t::PixelFormat

Definition at line 201 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

uint32_t MX_LTDC_LayerConfig_t::X0

Definition at line 197 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

uint32_t MX_LTDC_LayerConfig_t::X1

Definition at line 198 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

uint32_t MX_LTDC_LayerConfig_t::Y0

Definition at line 199 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

uint32_t MX_LTDC_LayerConfig_t::Y1

Definition at line 200 of file stm32h735g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and MX_LTDC_ConfigLayer().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_lcd.h


STM32H735G-DK BSP User Manual: Private Constants

Defines
Private Constants
STM32H735G_DISCO LCD

Defines

#define LCD_ORIENTATION_PORTRAIT 0x00U /* Portrait orientation choice of LCD screen */

Define Documentation

#define LCD_ORIENTATION_PORTRAIT 0x00U /* Portrait orientation choice of LCD screen */

Definition at line 288 of file stm32h735g_discovery_lcd.h.


STM32H735G-DK BSP User Manual: BSP_AUDIO_Init_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
BSP_AUDIO_Init_t Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

uint32_t | Device
uint32_t | SampleRate
uint32_t | BitsPerSample
uint32_t | ChannelsNbr
uint32_t | Volume

Detailed Description

Definition at line 56 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t BSP_AUDIO_Init_t::BitsPerSample

Definition at line 60 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

uint32_t BSP_AUDIO_Init_t::ChannelsNbr

Definition at line 61 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

uint32_t BSP_AUDIO_Init_t::Device

Definition at line 58 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

uint32_t BSP_AUDIO_Init_t::SampleRate

Definition at line 59 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

uint32_t BSP_AUDIO_Init_t::Volume

Definition at line 62 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: AUDIO_IN_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
AUDIO_IN_Ctx_t Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

uint32_t | Instance
uint32_t | Device
uint32_t | SampleRate
uint32_t | BitsPerSample
uint32_t | ChannelsNbr
uint16_t * | pBuff
uint8_t ** | pMultiBuff
uint32_t | Size
uint32_t | Volume
uint32_t | State
uint32_t | IsMultiBuff
uint32_t | IsMspCallbacksValid

Detailed Description

Definition at line 65 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t AUDIO_IN_Ctx_t::BitsPerSample

Definition at line 70 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_GetBitsPerSample(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

uint32_t AUDIO_IN_Ctx_t::ChannelsNbr

Definition at line 71 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_GetChannelsNbr(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetChannelsNbr(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

uint32_t AUDIO_IN_Ctx_t::Device

Definition at line 68 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_GetDevice(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), and BSP_AUDIO_IN_SetSampleRate().

uint32_t AUDIO_IN_Ctx_t::Instance

Definition at line 67 of file stm32h735g_discovery_audio.h.

uint32_t AUDIO_IN_Ctx_t::IsMspCallbacksValid

Definition at line 78 of file stm32h735g_discovery_audio.h.

uint32_t AUDIO_IN_Ctx_t::IsMultiBuff

Definition at line 77 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_IN_RecordChannels().

uint16_t* AUDIO_IN_Ctx_t::pBuff

Definition at line 72 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Record(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

uint8_t** AUDIO_IN_Ctx_t::pMultiBuff

Definition at line 73 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_RecordChannels().

uint32_t AUDIO_IN_Ctx_t::SampleRate

Definition at line 69 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_GetSampleRate(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

uint32_t AUDIO_IN_Ctx_t::Size

Definition at line 74 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Record(), and BSP_AUDIO_IN_RecordChannels().

uint32_t AUDIO_IN_Ctx_t::State

Definition at line 76 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_GetState(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_IN_StopChannels(), and BSP_AUDIO_OUT_Init().

uint32_t AUDIO_IN_Ctx_t::Volume

Definition at line 75 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), and BSP_AUDIO_IN_SetSampleRate().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: AUDIO_OUT_Ctx_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
AUDIO_OUT_Ctx_t Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

uint32_t | Instance
uint32_t | Device
uint32_t | SampleRate
uint32_t | BitsPerSample
uint32_t | Volume
uint32_t | ChannelsNbr
uint32_t | IsMute
uint32_t | State
uint32_t | IsMspCallbacksValid

Detailed Description

Definition at line 81 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t AUDIO_OUT_Ctx_t::BitsPerSample

Definition at line 86 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetBitsPerSample().

uint32_t AUDIO_OUT_Ctx_t::ChannelsNbr

Definition at line 88 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetChannelsNbr().

uint32_t AUDIO_OUT_Ctx_t::Device

Definition at line 84 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_GetDevice(), and BSP_AUDIO_OUT_Init().

uint32_t AUDIO_OUT_Ctx_t::Instance

Definition at line 83 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

uint32_t AUDIO_OUT_Ctx_t::IsMspCallbacksValid

Definition at line 91 of file stm32h735g_discovery_audio.h.

uint32_t AUDIO_OUT_Ctx_t::IsMute

Definition at line 89 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_UnMute().

uint32_t AUDIO_OUT_Ctx_t::SampleRate

Definition at line 85 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetSampleRate().

uint32_t AUDIO_OUT_Ctx_t::State

Definition at line 90 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_GetState(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), and BSP_AUDIO_OUT_Stop().

uint32_t AUDIO_OUT_Ctx_t::Volume

Definition at line 87 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetVolume().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: MX_SAI_Config Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MX_SAI_Config Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

uint32_t | AudioFrequency
uint32_t | AudioMode
uint32_t | DataSize
uint32_t | MonoStereoMode
uint32_t | ClockStrobing
uint32_t | Synchro
uint32_t | OutputDrive
uint32_t | SynchroExt
uint32_t | FrameLength
uint32_t | ActiveFrameLength
uint32_t | SlotActive

Detailed Description

Definition at line 94 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t MX_SAI_Config::ActiveFrameLength

Definition at line 105 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::AudioFrequency

Definition at line 96 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::AudioMode

Definition at line 97 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::ClockStrobing

Definition at line 100 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::DataSize

Definition at line 98 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::FrameLength

Definition at line 104 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::MonoStereoMode

Definition at line 99 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::OutputDrive

Definition at line 102 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::SlotActive

Definition at line 106 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::Synchro

Definition at line 101 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

uint32_t MX_SAI_Config::SynchroExt

Definition at line 103 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), MX_SAI1_Block_A_Init(), MX_SAI1_Block_B_Init(), and MX_SAI4_Block_A_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: MX_I2S_Config Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MX_I2S_Config Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

uint32_t | SampleRate
uint32_t | AudioMode
uint32_t | FullDuplexMode

Detailed Description

Definition at line 109 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t MX_I2S_Config::AudioMode

Definition at line 112 of file stm32h735g_discovery_audio.h.

uint32_t MX_I2S_Config::FullDuplexMode

Definition at line 113 of file stm32h735g_discovery_audio.h.

uint32_t MX_I2S_Config::SampleRate

Definition at line 111 of file stm32h735g_discovery_audio.h.

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: MX_DFSDM_Config Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
MX_DFSDM_Config Struct Reference
AUDIO Exported Types

#include <stm32h735g_discovery_audio.h>

Data Fields

DFSDM_Filter_TypeDef * | FilterInstance
uint32_t | RegularTrigger
uint32_t | SincOrder
uint32_t | Oversampling
DFSDM_Channel_TypeDef * | ChannelInstance
uint32_t | DigitalMicPins
uint32_t | DigitalMicType
uint32_t | Channel4Filter
uint32_t | ClockDivider
uint32_t | RightBitShift

Detailed Description

Definition at line 131 of file stm32h735g_discovery_audio.h.

Field Documentation

uint32_t MX_DFSDM_Config::Channel4Filter

Definition at line 142 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

DFSDM_Channel_TypeDef* MX_DFSDM_Config::ChannelInstance

Definition at line 139 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::ClockDivider

Definition at line 143 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::DigitalMicPins

Definition at line 140 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::DigitalMicType

Definition at line 141 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

DFSDM_Filter_TypeDef* MX_DFSDM_Config::FilterInstance

Definition at line 134 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::Oversampling

Definition at line 137 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::RegularTrigger

Definition at line 135 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::RightBitShift

Definition at line 144 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

uint32_t MX_DFSDM_Config::SincOrder

Definition at line 136 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and MX_DFSDM1_Init().

The documentation for this struct was generated from the following file:
  • stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: AUDIO Exported Constants

Defines
AUDIO Exported Constants
AUDIO

Defines

#define | AUDIO_I2C_ADDRESS 0x34U
#define | AUDIO_FREQUENCY_192K 192000U
#define | AUDIO_FREQUENCY_176K 176400U
#define | AUDIO_FREQUENCY_96K 96000U
#define | AUDIO_FREQUENCY_88K 88200U
#define | AUDIO_FREQUENCY_48K 48000U
#define | AUDIO_FREQUENCY_44K 44100U
#define | AUDIO_FREQUENCY_32K 32000U
#define | AUDIO_FREQUENCY_22K 22050U
#define | AUDIO_FREQUENCY_16K 16000U
#define | AUDIO_FREQUENCY_11K 11025U
#define | AUDIO_FREQUENCY_8K 8000U
#define | AUDIO_RESOLUTION_8B 8U
#define | AUDIO_RESOLUTION_16B 16U
#define | AUDIO_RESOLUTION_24B 24U
#define | AUDIO_RESOLUTION_32B 32U
#define | AUDIO_OUT_DEVICE_NONE 0U
#define | AUDIO_OUT_DEVICE_SPEAKER 1U
#define | AUDIO_OUT_DEVICE_HEADPHONE 2U
#define | AUDIO_OUT_DEVICE_SPK_HP 3U
#define | AUDIO_OUT_DEVICE_AUTO 4U
#define | AUDIO_OUT_DEVICE_HDMI 5U
#define | BSP_AUDIO_MUTE_DISABLED 0U
#define | BSP_AUDIO_MUTE_ENABLED 1U
#define | AUDIO_OUT_STATE_RESET 0U
#define | AUDIO_OUT_STATE_PLAYING 1U
#define | AUDIO_OUT_STATE_STOP 2U
#define | AUDIO_OUT_STATE_PAUSE 3U
#define | AUDIO_VOLUME_INPUT 0U
#define | AUDIO_VOLUME_OUTPUT 1U
#define | CODEC_PDWN_SW 1U
#define | CODEC_MUTE_ON 1U
#define | CODEC_MUTE_OFF 0U
#define | AUDIO_OUT_INSTANCES_NBR 1U
#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode TDM format : +------------------|------------------|--------------------|-------------------+ | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | +------------------------------------------------------------------------------+.
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_OUT_SAIx SAI1_Block_B
#define | AUDIO_OUT_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_MCLK_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_SCK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SCK_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_8
#define | AUDIO_OUT_SAIx_SCK_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_SD_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SD_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_SD_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_FS_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_9
#define | AUDIO_OUT_SAIx_FS_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream6
#define | AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_B
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream6_IRQn
#define | AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler
#define | AUDIO_IN_SAIx SAI1_Block_A
#define | AUDIO_IN_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_IN_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_IN_SAIx_AF GPIO_AF6_SAI1
#define | AUDIO_IN_SAIx_SD_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAIx_SD_GPIO_PORT GPIOE
#define | AUDIO_IN_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_IN_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream4
#define | AUDIO_IN_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A
#define | AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream4_IRQn
#define | AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler
#define | AUDIO_IN_SAI_PDMx SAI4_Block_A
#define | AUDIO_IN_SAI_PDMx_CLK_ENABLE() __HAL_RCC_SAI4_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_CLK_DISABLE() __HAL_RCC_SAI4_CLK_DISABLE()
#define | AUDIO_IN_SAI_PDMx_FS_SCK_AF GPIO_AF8_SAI4
#define | AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT GPIOE
#define | AUDIO_IN_SAI_PDMx_FS_PIN GPIO_PIN_4
#define | AUDIO_IN_SAI_PDMx_SCK_PIN GPIO_PIN_5
#define | AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_CLK_IN_PIN GPIO_PIN_2
#define | AUDIO_IN_SAI_PDMx_CLK_IN_PORT GPIOE
#define | AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_DATA_IN_PIN GPIO_PIN_1
#define | AUDIO_IN_SAI_PDMx_DATA_IN_PORT GPIOC
#define | AUDIO_IN_SAI_PDMx_DATA_CLK_AF GPIO_AF10_SAI4
#define | AUDIO_IN_SAI_PDMx_IRQHandler SAI4_IRQHandler
#define | AUDIO_IN_SAI_PDMx_IRQ SAI4_IRQn
#define | AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE() __HAL_RCC_BDMA_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_DMAx_STREAM BDMA_Channel1
#define | AUDIO_IN_SAI_PDMx_DMAx_REQUEST BDMA_REQUEST_SAI4_A
#define | AUDIO_IN_SAI_PDMx_DMAx_IRQ BDMA_Channel1_IRQn
#define | AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_IN_SAI_PDMx_DMAx_IRQHandler BDMA_Channel1_IRQHandler
#define | AUDIO_DFSDMx_MIC1_CHANNEL DFSDM1_Channel2
#define | AUDIO_DFSDMx_MIC2_CHANNEL DFSDM1_Channel1
#define | AUDIO_DFSDMx_MIC3_CHANNEL DFSDM1_Channel6
#define | AUDIO_DFSDMx_MIC4_CHANNEL DFSDM1_Channel5
#define | AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER DFSDM_CHANNEL_2
#define | AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER DFSDM_CHANNEL_1
#define | AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER DFSDM_CHANNEL_6
#define | AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER DFSDM_CHANNEL_5
#define | AUDIO_DFSDMx_MIC1_FILTER DFSDM1_Filter0
#define | AUDIO_DFSDMx_MIC2_FILTER DFSDM1_Filter1
#define | AUDIO_DFSDMx_MIC3_FILTER DFSDM1_Filter2
#define | AUDIO_DFSDMx_MIC4_FILTER DFSDM1_Filter3
#define | AUDIO_DFSDM1_CLK_ENABLE() __HAL_RCC_DFSDM1_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC1_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_DATIN_MIC1_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC2_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_DATIN_MIC2_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC3_PIN GPIO_PIN_13
#define | AUDIO_DFSDMx_DATIN_MIC3_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT GPIOF
#define | AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC4_PIN GPIO_PIN_13
#define | AUDIO_DFSDMx_DATIN_MIC4_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT GPIOF
#define | AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_DFSDM1_CKOUT_PIN GPIO_PIN_9
#define | AUDIO_DFSDM1_CKOUT_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDM1_CKOUT_GPIO_PORT GPIOE
#define | AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DMAx_MIC1_STREAM DMA2_Stream7
#define | AUDIO_DFSDMx_DMAx_MIC1_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT0
#define | AUDIO_DFSDMx_DMAx_MIC1_IRQ DMA2_Stream7_IRQn
#define | AUDIO_DFSDM_DMAx_MIC1_IRQHandler DMA2_Stream7_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC2_STREAM DMA2_Stream0
#define | AUDIO_DFSDMx_DMAx_MIC2_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT1
#define | AUDIO_DFSDMx_DMAx_MIC2_IRQ DMA2_Stream0_IRQn
#define | AUDIO_DFSDM_DMAx_MIC2_IRQHandler DMA2_Stream0_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC3_STREAM DMA2_Stream3
#define | AUDIO_DFSDMx_DMAx_MIC3_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT2
#define | AUDIO_DFSDMx_DMAx_MIC3_IRQ DMA2_Stream3_IRQn
#define | AUDIO_DFSDM_DMAx_MIC3_IRQHandler DMA2_Stream3_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC4_STREAM DMA2_Stream2
#define | AUDIO_DFSDMx_DMAx_MIC4_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT3
#define | AUDIO_DFSDMx_DMAx_MIC4_IRQ DMA2_Stream2_IRQn
#define | AUDIO_DFSDM_DMAx_MIC4_IRQHandler DMA2_Stream2_IRQHandler
#define | AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD
#define | AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD
#define | AUDIO_DFSDM1_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_DEVICE_ANALOG_MIC 0x00U
#define | AUDIO_IN_DEVICE_ANALOG_LINE1 0x01U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC1 0x010U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC2 0x020U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC3 0x040U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC4 0x080U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC_LAST AUDIO_IN_DEVICE_DIGITAL_MIC4
#define | AUDIO_IN_DEVICE_DIGITAL_MIC (AUDIO_IN_DEVICE_DIGITAL_MIC1 | AUDIO_IN_DEVICE_DIGITAL_MIC2)
#define | DFSDM_MIC_NUMBER 4U
#define | AUDIO_IN_STATE_RESET 0U
#define | AUDIO_IN_STATE_RECORDING 1U
#define | AUDIO_IN_STATE_STOP 2U
#define | AUDIO_IN_STATE_PAUSE 3U
#define | AUDIO_IN_INSTANCES_NBR 3U

Define Documentation

#define AUDIO_DFSDM1_CKOUT_AF GPIO_AF3_DFSDM1

Definition at line 362 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 364 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDM1_CKOUT_GPIO_PORT GPIOE

Definition at line 363 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDM1_CKOUT_PIN GPIO_PIN_9

Definition at line 361 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDM1_CLK_ENABLE ( ) __HAL_RCC_DFSDM1_CLK_ENABLE()

Definition at line 334 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit(), and DFSDM_FilterMspInit().

#define AUDIO_DFSDM1_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 389 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDM_DMAx_MIC1_IRQHandler DMA2_Stream7_IRQHandler

Definition at line 370 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDM_DMAx_MIC2_IRQHandler DMA2_Stream0_IRQHandler

Definition at line 375 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDM_DMAx_MIC3_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 380 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDM_DMAx_MIC4_IRQHandler DMA2_Stream2_IRQHandler

Definition at line 385 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDMx_DATIN_MIC1_AF GPIO_AF3_DFSDM1

Definition at line 338 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 340 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT GPIOE

Definition at line 339 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC1_PIN GPIO_PIN_7

Definition at line 337 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC2_AF GPIO_AF3_DFSDM1

Definition at line 344 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 346 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT GPIOE

Definition at line 345 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC2_PIN GPIO_PIN_7

Definition at line 343 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC3_AF GPIO_AF3_DFSDM1

Definition at line 350 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 352 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT GPIOF

Definition at line 351 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC3_PIN GPIO_PIN_13

Definition at line 349 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC4_AF GPIO_AF3_DFSDM1

Definition at line 356 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 358 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT GPIOF

Definition at line 357 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DATIN_MIC4_PIN GPIO_PIN_13

Definition at line 355 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_ChannelMspDeInit(), and DFSDM_ChannelMspInit().

#define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD

Definition at line 388 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_MIC1_IRQ DMA2_Stream7_IRQn

Definition at line 369 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC1_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT0

Definition at line 368 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC1_STREAM DMA2_Stream7

Definition at line 367 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC2_IRQ DMA2_Stream0_IRQn

Definition at line 374 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC2_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT1

Definition at line 373 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC2_STREAM DMA2_Stream0

Definition at line 372 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC3_IRQ DMA2_Stream3_IRQn

Definition at line 379 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC3_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT2

Definition at line 378 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC3_STREAM DMA2_Stream3

Definition at line 377 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC4_IRQ DMA2_Stream2_IRQn

Definition at line 384 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC4_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT3

Definition at line 383 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_MIC4_STREAM DMA2_Stream2

Definition at line 382 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD

Definition at line 387 of file stm32h735g_discovery_audio.h.

#define AUDIO_DFSDMx_MIC1_CHANNEL DFSDM1_Channel2

Definition at line 319 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER DFSDM_CHANNEL_2

Definition at line 324 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC1_FILTER DFSDM1_Filter0

Definition at line 329 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC2_CHANNEL DFSDM1_Channel1

Definition at line 320 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER DFSDM_CHANNEL_1

Definition at line 325 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC2_FILTER DFSDM1_Filter1

Definition at line 330 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC3_CHANNEL DFSDM1_Channel6

Definition at line 321 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER DFSDM_CHANNEL_6

Definition at line 326 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC3_FILTER DFSDM1_Filter2

Definition at line 331 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC4_CHANNEL DFSDM1_Channel5

Definition at line 322 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER DFSDM_CHANNEL_5

Definition at line 327 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_DFSDMx_MIC4_FILTER DFSDM1_Filter3

Definition at line 332 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define AUDIO_FREQUENCY_11K 11025U

Definition at line 182 of file stm32h735g_discovery_audio.h.

Referenced by MX_SAI1_ClockConfig(), and MX_SAI4_ClockConfig().

#define AUDIO_FREQUENCY_16K 16000U

Definition at line 181 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_176K 176400U

Definition at line 174 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_192K 192000U

Definition at line 173 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_22K 22050U

Definition at line 180 of file stm32h735g_discovery_audio.h.

Referenced by MX_SAI1_ClockConfig(), and MX_SAI4_ClockConfig().

#define AUDIO_FREQUENCY_32K 32000U

Definition at line 179 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_44K 44100U

Definition at line 178 of file stm32h735g_discovery_audio.h.

Referenced by MX_SAI1_ClockConfig(), and MX_SAI4_ClockConfig().

#define AUDIO_FREQUENCY_48K 48000U

Definition at line 177 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_88K 88200U

Definition at line 176 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_8K 8000U

Definition at line 183 of file stm32h735g_discovery_audio.h.

#define AUDIO_FREQUENCY_96K 96000U

Definition at line 175 of file stm32h735g_discovery_audio.h.

#define AUDIO_I2C_ADDRESS 0x34U

Definition at line 170 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_DEVICE_ANALOG_LINE1 0x01U

Definition at line 394 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_SetDevice().

#define AUDIO_IN_DEVICE_ANALOG_MIC 0x00U

Definition at line 393 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and BSP_AUDIO_IN_IRQHandler().

#define AUDIO_IN_DEVICE_DIGITAL_MIC (AUDIO_IN_DEVICE_DIGITAL_MIC1 | AUDIO_IN_DEVICE_DIGITAL_MIC2)

Definition at line 402 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_DEVICE_DIGITAL_MIC1 0x010U

Definition at line 397 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_PauseChannels(), and BSP_AUDIO_IN_RecordChannels().

#define AUDIO_IN_DEVICE_DIGITAL_MIC2 0x020U

Definition at line 398 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

#define AUDIO_IN_DEVICE_DIGITAL_MIC3 0x040U

Definition at line 399 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_IN_DEVICE_DIGITAL_MIC4 0x080U

Definition at line 400 of file stm32h735g_discovery_audio.h.

Referenced by DFSDM_FilterMspInit().

#define AUDIO_IN_DEVICE_DIGITAL_MIC_LAST AUDIO_IN_DEVICE_DIGITAL_MIC4

Definition at line 401 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_ResumeChannels(), and BSP_AUDIO_IN_SetDevice().

#define AUDIO_IN_INSTANCES_NBR 3U

Definition at line 413 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_GetBitsPerSample(), BSP_AUDIO_IN_GetChannelsNbr(), BSP_AUDIO_IN_GetDevice(), BSP_AUDIO_IN_GetSampleRate(), BSP_AUDIO_IN_GetState(), BSP_AUDIO_IN_GetVolume(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetChannelsNbr(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_SetVolume(), and BSP_AUDIO_IN_Stop().

#define AUDIO_IN_SAI_PDMx SAI4_Block_A

Definition at line 290 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), and SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_DISABLE ( ) __HAL_RCC_SAI4_CLK_DISABLE()

Definition at line 292 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_CLK_ENABLE ( ) __HAL_RCC_SAI4_CLK_ENABLE()

Definition at line 291 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 299 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_PIN GPIO_PIN_2

Definition at line 300 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_PORT GPIOE

Definition at line 301 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_CLK_AF GPIO_AF10_SAI4

Definition at line 305 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 302 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_PIN GPIO_PIN_1

Definition at line 303 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_PORT GPIOC

Definition at line 304 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE ( ) __HAL_RCC_BDMA_CLK_ENABLE()

Definition at line 310 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_IRQ BDMA_Channel1_IRQn

Definition at line 313 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_IRQHandler BDMA_Channel1_IRQHandler

Definition at line 316 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 315 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 314 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_REQUEST BDMA_REQUEST_SAI4_A

Definition at line 312 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_STREAM BDMA_Channel1

Definition at line 311 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_PIN GPIO_PIN_4

Definition at line 296 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_AF GPIO_AF8_SAI4

Definition at line 293 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 294 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT GPIOE

Definition at line 295 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAI_PDMx_IRQ SAI4_IRQn

Definition at line 307 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_IRQHandler SAI4_IRQHandler

Definition at line 306 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_SCK_PIN GPIO_PIN_5

Definition at line 297 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx SAI1_Block_A

Definition at line 272 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_IN_SAIx_AF GPIO_AF6_SAI1

Definition at line 275 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI1_CLK_DISABLE()

Definition at line 274 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit().

#define AUDIO_IN_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 273 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 281 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream4_IRQn

Definition at line 284 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler

Definition at line 287 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 286 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 285 of file stm32h735g_discovery_audio.h.

#define AUDIO_IN_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A

Definition at line 283 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream4

Definition at line 282 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_SD_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 276 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_IN_SAIx_SD_GPIO_PORT GPIOE

Definition at line 277 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_IN_SAIx_SD_PIN GPIO_PIN_6

Definition at line 278 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_IN_STATE_PAUSE 3U

Definition at line 410 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), and BSP_AUDIO_IN_Stop().

#define AUDIO_IN_STATE_RECORDING 1U

Definition at line 408 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), and BSP_AUDIO_IN_Stop().

#define AUDIO_IN_STATE_RESET 0U

Definition at line 407 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetSampleRate(), and MX_DFSDM1_ClockConfig().

#define AUDIO_IN_STATE_STOP 2U

Definition at line 409 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), and BSP_AUDIO_IN_StopChannels().

#define AUDIO_OUT_DEVICE_AUTO 4U

Definition at line 196 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define AUDIO_OUT_DEVICE_HDMI 5U

Definition at line 197 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_DEVICE_HEADPHONE 2U

Definition at line 194 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define AUDIO_OUT_DEVICE_NONE 0U

Definition at line 192 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_DEVICE_SPEAKER 1U

Definition at line 193 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define AUDIO_OUT_DEVICE_SPK_HP 3U

Definition at line 195 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define AUDIO_OUT_INSTANCES_NBR 1U

Definition at line 220 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_GetDevice(), BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_GetState(), BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), and BSP_AUDIO_OUT_UnMute().

#define AUDIO_OUT_SAIx SAI1_Block_B

Definition at line 235 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), HAL_SAI_ErrorCallback(), SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI1_CLK_DISABLE()

Definition at line 237 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 236 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 260 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream6_IRQn

Definition at line 263 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 266 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 265 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 264 of file stm32h735g_discovery_audio.h.

#define AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_B

Definition at line 262 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream6

Definition at line 261 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_FS_AF GPIO_AF6_SAI1

Definition at line 257 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_FS_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 254 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOF

Definition at line 255 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_9

Definition at line 256 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_MCLK_AF GPIO_AF6_SAI1

Definition at line 242 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_MCLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 239 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOF

Definition at line 240 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7

Definition at line 241 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_SCK_AF GPIO_AF6_SAI1

Definition at line 247 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_SCK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 244 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_SCK_GPIO_PORT GPIOF

Definition at line 245 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_8

Definition at line 246 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_SD_AF GPIO_AF6_SAI1

Definition at line 252 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_SD_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 249 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_OUT_SAIx_SD_GPIO_PORT GPIOF

Definition at line 250 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6

Definition at line 251 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspDeInit(), and SAI_MspInit().

#define AUDIO_OUT_STATE_PAUSE 3U

Definition at line 207 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Resume(), and BSP_AUDIO_OUT_Stop().

#define AUDIO_OUT_STATE_PLAYING 1U

Definition at line 205 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), and BSP_AUDIO_OUT_Stop().

#define AUDIO_OUT_STATE_RESET 0U

Definition at line 204 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_GetDevice(), BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_UnMute(), and MX_DFSDM1_ClockConfig().

#define AUDIO_OUT_STATE_STOP 2U

Definition at line 206 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), and BSP_AUDIO_OUT_Stop().

#define AUDIO_RESOLUTION_16B 16U

Definition at line 187 of file stm32h735g_discovery_audio.h.

Referenced by SAI_MspInit().

#define AUDIO_RESOLUTION_24B 24U

Definition at line 188 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_SetBitsPerSample(), MX_SAI1_Block_A_Init(), and MX_SAI1_Block_B_Init().

#define AUDIO_RESOLUTION_32B 32U

Definition at line 189 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_SetBitsPerSample(), MX_SAI1_Block_A_Init(), and MX_SAI1_Block_B_Init().

#define AUDIO_RESOLUTION_8B 8U

Definition at line 186 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_SetBitsPerSample().

#define AUDIO_VOLUME_INPUT 0U

Definition at line 211 of file stm32h735g_discovery_audio.h.

#define AUDIO_VOLUME_OUTPUT 1U

Definition at line 212 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_SetVolume().

#define BSP_AUDIO_MUTE_DISABLED 0U

Definition at line 200 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_SetVolume().

#define BSP_AUDIO_MUTE_ENABLED 1U

Definition at line 201 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_SetVolume().

#define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode TDM format : +------------------|------------------|--------------------|-------------------+ | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | +------------------------------------------------------------------------------+.

Definition at line 229 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 231 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 233 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define CODEC_MUTE_OFF 0U

Definition at line 217 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_UnMute().

#define CODEC_MUTE_ON 1U

Definition at line 216 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Mute().

#define CODEC_PDWN_SW 1U

Definition at line 215 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Stop(), and BSP_AUDIO_OUT_Stop().

#define DFSDM_MIC_NUMBER 4U

Definition at line 404 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), DFSDM_FilterMspDeInit(), DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().


STM32H735G-DK BSP User Manual: AUDIO Exported Macros

Defines
AUDIO Exported Macros
AUDIO

Defines

#define | POS_VAL(VAL) (POSITION_VAL(VAL) - 4U)
#define | VOLUME_OUT_CONVERT(Volume) (((Volume) > 100)? 63:((uint8_t)(((Volume) * 63) / 100)))
#define | VOLUME_IN_CONVERT(Volume) (((Volume) >= 100)? 239:((uint8_t)(((Volume) * 239) / 100)))

Define Documentation

#define POS_VAL ( VAL ) (POSITION_VAL(VAL) - 4U)

Definition at line 421 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_IRQHandler(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_Stop(), DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

#define VOLUME_IN_CONVERT ( Volume ) (((Volume) >= 100)? 239:((uint8_t)(((Volume) * 239) / 100)))

Definition at line 423 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init().

#define VOLUME_OUT_CONVERT ( Volume ) (((Volume) > 100)? 63:((uint8_t)(((Volume) * 63) / 100)))

Definition at line 422 of file stm32h735g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().


STM32H735G-DK BSP User Manual: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • v
  • w
  • x
  • y
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • Accuracy : TS_Init_t , TS_Ctx_t
  • ActiveFrameLength : MX_SAI_Config
  • ActiveLayer : BSP_LCD_Ctx_t
  • Address : MX_LTDC_LayerConfig_t
  • AudioFrequency : MX_SAI_Config
  • AudioMode : MX_I2S_Config , MX_SAI_Config

- b -

  • BitsPerSample : BSP_AUDIO_Init_t , AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • BurstLength : BSP_OSPI_RAM_Init_t , OSPI_RAM_Ctx_t
  • BurstType : OSPI_RAM_Ctx_t , BSP_OSPI_RAM_Init_t

- c -

  • Channel4Filter : MX_DFSDM_Config
  • ChannelInstance : MX_DFSDM_Config
  • ChannelsNbr : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t , BSP_AUDIO_Init_t
  • ClockDivider : MX_DFSDM_Config
  • ClockPrescaler : MX_OSPI_InitTypeDef
  • ClockStrobing : MX_SAI_Config

- d -

  • DataSize : MX_SAI_Config
  • Device : BSP_AUDIO_Init_t , AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t
  • DigitalMicPins : MX_DFSDM_Config
  • DigitalMicType : MX_DFSDM_Config
  • DistanceLeftRight : TS_Gesture_Config_t
  • DistanceUpDown : TS_Gesture_Config_t
  • DistanceZoom : TS_Gesture_Config_t
  • dnf : I2C_Charac_t

- f -

  • FilterInstance : MX_DFSDM_Config
  • FrameLength : MX_SAI_Config
  • freq : I2C_Charac_t
  • freq_max : I2C_Charac_t
  • freq_min : I2C_Charac_t
  • FullDuplexMode : MX_I2S_Config

- g -

  • Gesture : TS_Capabilities_t

- h -

  • hddat_min : I2C_Charac_t
  • Height : TS_Init_t , TS_Ctx_t
  • hscl_min : I2C_Charac_t

- i -

  • Instance : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • InterfaceMode : BSP_OSPI_NOR_Init_t , OSPI_NOR_Ctx_t
  • IsInitialized : OSPI_NOR_Ctx_t , OSPI_RAM_Ctx_t
  • IsMspCallbacksValid : AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t , BSP_LCD_Ctx_t , OSPI_NOR_Ctx_t , OSPI_RAM_Ctx_t
  • IsMultiBuff : AUDIO_IN_Ctx_t
  • IsMute : AUDIO_OUT_Ctx_t

- l -

  • LatencyType : OSPI_RAM_Ctx_t , BSP_OSPI_RAM_Init_t
  • lscl_min : I2C_Charac_t

- m -

  • MaxTouch : TS_Capabilities_t
  • MaxX : TS_Ctx_t
  • MaxXl : TS_Capabilities_t
  • MaxY : TS_Ctx_t
  • MaxYl : TS_Capabilities_t
  • MemorySize : MX_OSPI_InitTypeDef
  • MonoStereoMode : MX_SAI_Config
  • MultiTouch : TS_Capabilities_t

- o -

  • OffsetLeftRight : TS_Gesture_Config_t
  • OffsetUpDown : TS_Gesture_Config_t
  • Orientation : TS_Ctx_t , TS_Init_t
  • OutputDrive : MX_SAI_Config
  • Oversampling : MX_DFSDM_Config

- p -

  • pBuff : AUDIO_IN_Ctx_t
  • PixelFormat : BSP_LCD_Ctx_t , MX_LTDC_LayerConfig_t
  • pMultiBuff : AUDIO_IN_Ctx_t
  • presc : I2C_Timings_t
  • PreviousX : TS_Ctx_t
  • PreviousY : TS_Ctx_t

- r -

  • Radian : TS_Gesture_Config_t
  • RegularTrigger : MX_DFSDM_Config
  • ReloadEnable : BSP_LCD_Ctx_t
  • RightBitShift : MX_DFSDM_Config

- s -

  • SampleRate : BSP_AUDIO_Init_t , AUDIO_IN_Ctx_t , MX_I2S_Config , AUDIO_OUT_Ctx_t
  • SampleShifting : MX_OSPI_InitTypeDef
  • sclh : I2C_Timings_t
  • scll : I2C_Timings_t
  • SincOrder : MX_DFSDM_Config
  • Size : AUDIO_IN_Ctx_t
  • SlotActive : MX_SAI_Config
  • State : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • sudat_min : I2C_Charac_t
  • Synchro : MX_SAI_Config
  • SynchroExt : MX_SAI_Config

- t -

  • tfall : I2C_Charac_t
  • TouchArea : TS_MultiTouch_State_t
  • TouchDetected : TS_MultiTouch_State_t , TS_State_t
  • TouchEvent : TS_MultiTouch_State_t
  • TouchWeight : TS_MultiTouch_State_t
  • TouchX : TS_MultiTouch_State_t , TS_State_t
  • TouchY : TS_State_t , TS_MultiTouch_State_t
  • TransferRate : MX_OSPI_InitTypeDef , BSP_OSPI_NOR_Init_t , OSPI_NOR_Ctx_t
  • trise : I2C_Charac_t
  • tscldel : I2C_Timings_t
  • tsdadel : I2C_Timings_t

- v -

  • vddat_max : I2C_Charac_t
  • Volume : AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t , BSP_AUDIO_Init_t

- w -

  • Width : TS_Init_t , TS_Ctx_t

- x -

  • X0 : MX_LTDC_LayerConfig_t
  • X1 : MX_LTDC_LayerConfig_t
  • XSize : BSP_LCD_Ctx_t

- y -

  • Y0 : MX_LTDC_LayerConfig_t
  • Y1 : MX_LTDC_LayerConfig_t
  • YSize : BSP_LCD_Ctx_t


STM32H735G-DK BSP User Manual: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • v
  • w
  • x
  • y

- a -

  • Accuracy : TS_Init_t , TS_Ctx_t
  • ActiveFrameLength : MX_SAI_Config
  • ActiveLayer : BSP_LCD_Ctx_t
  • Address : MX_LTDC_LayerConfig_t
  • AudioFrequency : MX_SAI_Config
  • AudioMode : MX_I2S_Config , MX_SAI_Config

- b -

  • BitsPerSample : BSP_AUDIO_Init_t , AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • BurstLength : BSP_OSPI_RAM_Init_t , OSPI_RAM_Ctx_t
  • BurstType : OSPI_RAM_Ctx_t , BSP_OSPI_RAM_Init_t

- c -

  • Channel4Filter : MX_DFSDM_Config
  • ChannelInstance : MX_DFSDM_Config
  • ChannelsNbr : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t , BSP_AUDIO_Init_t
  • ClockDivider : MX_DFSDM_Config
  • ClockPrescaler : MX_OSPI_InitTypeDef
  • ClockStrobing : MX_SAI_Config

- d -

  • DataSize : MX_SAI_Config
  • Device : BSP_AUDIO_Init_t , AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t
  • DigitalMicPins : MX_DFSDM_Config
  • DigitalMicType : MX_DFSDM_Config
  • DistanceLeftRight : TS_Gesture_Config_t
  • DistanceUpDown : TS_Gesture_Config_t
  • DistanceZoom : TS_Gesture_Config_t
  • dnf : I2C_Charac_t

- f -

  • FilterInstance : MX_DFSDM_Config
  • FrameLength : MX_SAI_Config
  • freq : I2C_Charac_t
  • freq_max : I2C_Charac_t
  • freq_min : I2C_Charac_t
  • FullDuplexMode : MX_I2S_Config

- g -

  • Gesture : TS_Capabilities_t

- h -

  • hddat_min : I2C_Charac_t
  • Height : TS_Init_t , TS_Ctx_t
  • hscl_min : I2C_Charac_t

- i -

  • Instance : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • InterfaceMode : BSP_OSPI_NOR_Init_t , OSPI_NOR_Ctx_t
  • IsInitialized : OSPI_NOR_Ctx_t , OSPI_RAM_Ctx_t
  • IsMspCallbacksValid : AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t , BSP_LCD_Ctx_t , OSPI_NOR_Ctx_t , OSPI_RAM_Ctx_t
  • IsMultiBuff : AUDIO_IN_Ctx_t
  • IsMute : AUDIO_OUT_Ctx_t

- l -

  • LatencyType : OSPI_RAM_Ctx_t , BSP_OSPI_RAM_Init_t
  • lscl_min : I2C_Charac_t

- m -

  • MaxTouch : TS_Capabilities_t
  • MaxX : TS_Ctx_t
  • MaxXl : TS_Capabilities_t
  • MaxY : TS_Ctx_t
  • MaxYl : TS_Capabilities_t
  • MemorySize : MX_OSPI_InitTypeDef
  • MonoStereoMode : MX_SAI_Config
  • MultiTouch : TS_Capabilities_t

- o -

  • OffsetLeftRight : TS_Gesture_Config_t
  • OffsetUpDown : TS_Gesture_Config_t
  • Orientation : TS_Ctx_t , TS_Init_t
  • OutputDrive : MX_SAI_Config
  • Oversampling : MX_DFSDM_Config

- p -

  • pBuff : AUDIO_IN_Ctx_t
  • PixelFormat : BSP_LCD_Ctx_t , MX_LTDC_LayerConfig_t
  • pMultiBuff : AUDIO_IN_Ctx_t
  • presc : I2C_Timings_t
  • PreviousX : TS_Ctx_t
  • PreviousY : TS_Ctx_t

- r -

  • Radian : TS_Gesture_Config_t
  • RegularTrigger : MX_DFSDM_Config
  • ReloadEnable : BSP_LCD_Ctx_t
  • RightBitShift : MX_DFSDM_Config

- s -

  • SampleRate : BSP_AUDIO_Init_t , AUDIO_IN_Ctx_t , MX_I2S_Config , AUDIO_OUT_Ctx_t
  • SampleShifting : MX_OSPI_InitTypeDef
  • sclh : I2C_Timings_t
  • scll : I2C_Timings_t
  • SincOrder : MX_DFSDM_Config
  • Size : AUDIO_IN_Ctx_t
  • SlotActive : MX_SAI_Config
  • State : AUDIO_IN_Ctx_t , AUDIO_OUT_Ctx_t
  • sudat_min : I2C_Charac_t
  • Synchro : MX_SAI_Config
  • SynchroExt : MX_SAI_Config

- t -

  • tfall : I2C_Charac_t
  • TouchArea : TS_MultiTouch_State_t
  • TouchDetected : TS_MultiTouch_State_t , TS_State_t
  • TouchEvent : TS_MultiTouch_State_t
  • TouchWeight : TS_MultiTouch_State_t
  • TouchX : TS_MultiTouch_State_t , TS_State_t
  • TouchY : TS_State_t , TS_MultiTouch_State_t
  • TransferRate : MX_OSPI_InitTypeDef , BSP_OSPI_NOR_Init_t , OSPI_NOR_Ctx_t
  • trise : I2C_Charac_t
  • tscldel : I2C_Timings_t
  • tsdadel : I2C_Timings_t

- v -

  • vddat_max : I2C_Charac_t
  • Volume : AUDIO_OUT_Ctx_t , AUDIO_IN_Ctx_t , BSP_AUDIO_Init_t

- w -

  • Width : TS_Init_t , TS_Ctx_t

- x -

  • X0 : MX_LTDC_LayerConfig_t
  • X1 : MX_LTDC_LayerConfig_t
  • XSize : BSP_LCD_Ctx_t

- y -

  • Y0 : MX_LTDC_LayerConfig_t
  • Y1 : MX_LTDC_LayerConfig_t
  • YSize : BSP_LCD_Ctx_t


STM32H735G-DK BSP User Manual: stm32h735g_discovery_conf_template.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines
stm32h735g_discovery_conf_template.h File Reference
#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define | USE_COM_LOG 0U
#define | USE_BSP_COM_FEATURE 0U
#define | I2C_VALID_TIMING_NBR 128U
#define | USE_AUDIO_CODEC_WM8994 1U
#define | USE_BSP_PDM_LIB_FEATURE 1U
#define | DEFAULT_AUDIO_IN_BUFFER_SIZE 2048U
#define | USE_BSP_CPU_CACHE_MAINTENANCE 1U
#define | LCD_LAYER_0_ADDRESS 0x70000000U
#define | LCD_LAYER_1_ADDRESS 0x70200000U
#define | USE_DMA2D_TO_FILL_RGB_RECT 0U
#define | USE_LCD_CTRL_RK043FN48H 1U
#define | USE_TS_GESTURE 1U
#define | USE_TS_MULTI_TOUCH 1U
#define | TS_TOUCH_NBR 2U
#define | BSP_OSPI_RAM_IT_PRIORITY 0x07UL
#define | BSP_OSPI_RAM_DMA_IT_PRIORITY 0x07UL
#define | BSP_BUTTON_USER_IT_PRIORITY 15U
#define | BSP_AUDIO_OUT_IT_PRIORITY 14U
#define | BSP_AUDIO_IN_IT_PRIORITY 15U
#define | BSP_SD_IT_PRIORITY 14U
#define | BSP_SD_RX_IT_PRIORITY 14U
#define | BSP_SD_TX_IT_PRIORITY 15U
#define | BSP_TS_IT_PRIORITY 15U

Define Documentation

#define BSP_AUDIO_IN_IT_PRIORITY 15U

Definition at line 63 of file stm32h735g_discovery_conf_template.h.

Referenced by DFSDM_FilterMspInit(), and SAI_MspInit().

#define BSP_AUDIO_OUT_IT_PRIORITY 14U

Definition at line 62 of file stm32h735g_discovery_conf_template.h.

Referenced by SAI_MspInit().

#define BSP_BUTTON_USER_IT_PRIORITY 15U

Definition at line 61 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_PB_Init().

#define BSP_OSPI_RAM_DMA_IT_PRIORITY 0x07UL

Definition at line 58 of file stm32h735g_discovery_conf_template.h.

Referenced by OSPI_RAM_MspInit().

#define BSP_OSPI_RAM_IT_PRIORITY 0x07UL

Definition at line 57 of file stm32h735g_discovery_conf_template.h.

Referenced by OSPI_RAM_MspInit().

#define BSP_SD_IT_PRIORITY 14U

Definition at line 64 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_SD_DetectITConfig(), and SD_MspInit().

#define BSP_SD_RX_IT_PRIORITY 14U

Definition at line 65 of file stm32h735g_discovery_conf_template.h.

#define BSP_SD_TX_IT_PRIORITY 15U

Definition at line 66 of file stm32h735g_discovery_conf_template.h.

#define BSP_TS_IT_PRIORITY 15U

Definition at line 67 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_TS_EnableIT().

#define DEFAULT_AUDIO_IN_BUFFER_SIZE 2048U

Definition at line 42 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

#define I2C_VALID_TIMING_NBR 128U

Definition at line 35 of file stm32h735g_discovery_conf_template.h.

#define LCD_LAYER_0_ADDRESS 0x70000000U

Definition at line 46 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_LCD_InitEx().

#define LCD_LAYER_1_ADDRESS 0x70200000U

Definition at line 47 of file stm32h735g_discovery_conf_template.h.

#define TS_TOUCH_NBR 2U

Definition at line 54 of file stm32h735g_discovery_conf_template.h.

Referenced by BSP_TS_Get_MultiTouchState(), and BSP_TS_Init().

#define USE_AUDIO_CODEC_WM8994 1U

Definition at line 38 of file stm32h735g_discovery_conf_template.h.

#define USE_BSP_COM_FEATURE 0U

Definition at line 32 of file stm32h735g_discovery_conf_template.h.

#define USE_BSP_CPU_CACHE_MAINTENANCE 1U

Definition at line 43 of file stm32h735g_discovery_conf_template.h.

#define USE_BSP_PDM_LIB_FEATURE 1U

Definition at line 39 of file stm32h735g_discovery_conf_template.h.

#define USE_COM_LOG 0U

Definition at line 31 of file stm32h735g_discovery_conf_template.h.

#define USE_DMA2D_TO_FILL_RGB_RECT 0U

Definition at line 48 of file stm32h735g_discovery_conf_template.h.

#define USE_LCD_CTRL_RK043FN48H 1U

Definition at line 49 of file stm32h735g_discovery_conf_template.h.

#define USE_TS_GESTURE 1U

Definition at line 52 of file stm32h735g_discovery_conf_template.h.

#define USE_TS_MULTI_TOUCH 1U

Definition at line 53 of file stm32h735g_discovery_conf_template.h.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_errno.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines
stm32h735g_discovery_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
#define | BSP_ERROR_OSPI_SUSPENDED -20
#define | BSP_ERROR_OSPI_ASSIGN_FAILURE -24
#define | BSP_ERROR_OSPI_SETUP_FAILURE -25
#define | BSP_ERROR_OSPI_MMP_LOCK_FAILURE -26
#define | BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE -27
#define | BSP_ERROR_TS_TOUCH_NOT_DETECTED -30
#define | BSP_ERROR_BUS_TRANSACTION_FAILURE -100
#define | BSP_ERROR_BUS_ARBITRATION_LOSS -101
#define | BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE -102
#define | BSP_ERROR_BUS_PROTOCOL_FAILURE -103
#define | BSP_ERROR_BUS_MODE_FAULT -104
#define | BSP_ERROR_BUS_FRAME_ERROR -105
#define | BSP_ERROR_BUS_CRC_ERROR -106
#define | BSP_ERROR_BUS_DMA_FAILURE -107

Detailed Description

Error Code.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_errno.h.

Define Documentation

#define BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE -102

Definition at line 55 of file stm32h735g_discovery_errno.h.

Referenced by BSP_I2C4_ReadReg(), BSP_I2C4_ReadReg16(), BSP_I2C4_WriteReg(), and BSP_I2C4_WriteReg16().

#define BSP_ERROR_BUS_ARBITRATION_LOSS -101

Definition at line 54 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_CRC_ERROR -106

Definition at line 60 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_DMA_FAILURE -107

Definition at line 61 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_FAILURE -8

Definition at line 37 of file stm32h735g_discovery_errno.h.

Referenced by BSP_I2C4_DeInit(), BSP_I2C4_Init(), FT5336_Probe(), I2C4_ReadReg(), and I2C4_WriteReg().

#define BSP_ERROR_BUS_FRAME_ERROR -105

Definition at line 59 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_MODE_FAULT -104

Definition at line 58 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_PROTOCOL_FAILURE -103

Definition at line 56 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUS_TRANSACTION_FAILURE -100

Definition at line 53 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_BUSY -3

Definition at line 32 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_GetDevice(), BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_Stop(), BSP_AUDIO_OUT_UnMute(), BSP_I2C4_IsReady(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_ResumeErase(), and BSP_OSPI_NOR_SuspendErase().

#define BSP_ERROR_CLOCK_FAILURE -9

Definition at line 38 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetSampleRate(), and BSP_AUDIO_OUT_Init().

#define BSP_ERROR_COMPONENT_FAILURE -5

Definition at line 34 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), BSP_AUDIO_OUT_UnMute(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_Read(), BSP_OSPI_RAM_Read_DMA(), BSP_OSPI_RAM_Write(), BSP_OSPI_RAM_Write_DMA(), BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), FT5336_Probe(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define BSP_ERROR_FEATURE_NOT_SUPPORTED -11

Definition at line 40 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_GetVolume(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_SetVolume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetSampleRate(), BSP_LCD_GetBrightness(), and BSP_LCD_SetBrightness().

#define BSP_ERROR_MSP_FAILURE -10

Definition at line 39 of file stm32h735g_discovery_errno.h.

Referenced by BSP_I2C4_Init().

#define BSP_ERROR_NO_INIT -1

Definition at line 30 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_LCD_InitEx(), and BSP_TS_Init().

#define BSP_ERROR_NONE 0

Definition at line 29 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_GetBitsPerSample(), BSP_AUDIO_IN_GetChannelsNbr(), BSP_AUDIO_IN_GetDevice(), BSP_AUDIO_IN_GetSampleRate(), BSP_AUDIO_IN_GetState(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_RecordPDM(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetChannelsNbr(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_IN_StopChannels(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_GetDevice(), BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_GetState(), BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), BSP_AUDIO_OUT_UnMute(), BSP_I2C4_DeInit(), BSP_I2C4_Init(), BSP_I2C4_IsReady(), BSP_I2C4_ReadReg(), BSP_I2C4_ReadReg16(), BSP_I2C4_WriteReg(), BSP_I2C4_WriteReg16(), BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_FillRGBRect(), BSP_LCD_GetBrightness(), BSP_LCD_GetPixelFormat(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_InitEx(), BSP_LCD_ReadPixel(), BSP_LCD_Relaod(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetActiveLayer(), BSP_LCD_SetBrightness(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetTransparency(), BSP_LCD_WritePixel(), BSP_LED_DeInit(), BSP_LED_GetState(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), BSP_LED_Toggle(), BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetInfo(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_Read(), BSP_OSPI_RAM_Read_DMA(), BSP_OSPI_RAM_Write(), BSP_OSPI_RAM_Write_DMA(), BSP_PB_DeInit(), BSP_PB_Init(), BSP_SD_DeInit(), BSP_SD_DetectITConfig(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_Init(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), BSP_SD_WriteBlocks_IT(), BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_Get_Orientation(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), BSP_TS_Set_Orientation(), FT5336_Probe(), I2C4_ReadReg(), I2C4_WriteReg(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

#define BSP_ERROR_OSPI_ASSIGN_FAILURE -24

Definition at line 44 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_OSPI_MMP_LOCK_FAILURE -26

Definition at line 46 of file stm32h735g_discovery_errno.h.

Referenced by BSP_OSPI_NOR_ConfigFlash(), and BSP_OSPI_RAM_ConfigHyperRAM().

#define BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE -27

Definition at line 47 of file stm32h735g_discovery_errno.h.

Referenced by BSP_OSPI_NOR_DisableMemoryMappedMode(), and BSP_OSPI_RAM_DisableMemoryMappedMode().

#define BSP_ERROR_OSPI_SETUP_FAILURE -25

Definition at line 45 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_OSPI_SUSPENDED -20

Definition at line 43 of file stm32h735g_discovery_errno.h.

Referenced by BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_ResumeErase(), and BSP_OSPI_NOR_SuspendErase().

#define BSP_ERROR_PERIPH_FAILURE -4

Definition at line 33 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_RecordPDM(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_Stop(), BSP_I2C4_ReadReg(), BSP_I2C4_ReadReg16(), BSP_I2C4_WriteReg(), BSP_I2C4_WriteReg16(), BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_InitEx(), BSP_LCD_Relaod(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_Init(), BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_SD_DeInit(), BSP_SD_DetectITConfig(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_Init(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), BSP_SD_WriteBlocks_IT(), BSP_TS_EnableIT(), OSPI_NOR_EnterDOPIMode(), and OSPI_NOR_ExitOPIMode().

#define BSP_ERROR_TS_TOUCH_NOT_DETECTED -30

Definition at line 50 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_UNKNOWN_COMPONENT -7

Definition at line 36 of file stm32h735g_discovery_errno.h.

Referenced by BSP_LCD_InitEx(), BSP_SD_Init(), and FT5336_Probe().

#define BSP_ERROR_UNKNOWN_FAILURE -6

Definition at line 35 of file stm32h735g_discovery_errno.h.

#define BSP_ERROR_WRONG_PARAM -2

Definition at line 31 of file stm32h735g_discovery_errno.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_GetBitsPerSample(), BSP_AUDIO_IN_GetChannelsNbr(), BSP_AUDIO_IN_GetDevice(), BSP_AUDIO_IN_GetSampleRate(), BSP_AUDIO_IN_GetState(), BSP_AUDIO_IN_GetVolume(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PauseChannels(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_RecordChannels(), BSP_AUDIO_IN_RecordPDM(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_ResumeChannels(), BSP_AUDIO_IN_SetBitsPerSample(), BSP_AUDIO_IN_SetChannelsNbr(), BSP_AUDIO_IN_SetDevice(), BSP_AUDIO_IN_SetSampleRate(), BSP_AUDIO_IN_SetVolume(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_GetBitsPerSample(), BSP_AUDIO_OUT_GetChannelsNbr(), BSP_AUDIO_OUT_GetDevice(), BSP_AUDIO_OUT_GetSampleRate(), BSP_AUDIO_OUT_GetState(), BSP_AUDIO_OUT_GetVolume(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_IsMute(), BSP_AUDIO_OUT_Mute(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetBitsPerSample(), BSP_AUDIO_OUT_SetChannelsNbr(), BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_SetVolume(), BSP_AUDIO_OUT_Stop(), BSP_AUDIO_OUT_UnMute(), BSP_LCD_ConfigLayer(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_GetBrightness(), BSP_LCD_GetPixelFormat(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_InitEx(), BSP_LCD_Relaod(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetActiveLayer(), BSP_LCD_SetBrightness(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetTransparency(), BSP_LED_Init(), BSP_OSPI_NOR_ConfigFlash(), BSP_OSPI_NOR_DeInit(), BSP_OSPI_NOR_DisableMemoryMappedMode(), BSP_OSPI_NOR_EnableMemoryMappedMode(), BSP_OSPI_NOR_Erase_Block(), BSP_OSPI_NOR_Erase_Chip(), BSP_OSPI_NOR_GetInfo(), BSP_OSPI_NOR_GetStatus(), BSP_OSPI_NOR_Init(), BSP_OSPI_NOR_Read(), BSP_OSPI_NOR_ReadID(), BSP_OSPI_NOR_ResumeErase(), BSP_OSPI_NOR_SuspendErase(), BSP_OSPI_NOR_Write(), BSP_OSPI_RAM_ConfigHyperRAM(), BSP_OSPI_RAM_DeInit(), BSP_OSPI_RAM_DisableMemoryMappedMode(), BSP_OSPI_RAM_EnableMemoryMappedMode(), BSP_OSPI_RAM_Init(), BSP_OSPI_RAM_Read(), BSP_OSPI_RAM_Read_DMA(), BSP_OSPI_RAM_Write(), BSP_OSPI_RAM_Write_DMA(), BSP_SD_DeInit(), BSP_SD_DetectITConfig(), BSP_SD_Erase(), BSP_SD_GetCardInfo(), BSP_SD_Init(), BSP_SD_IsDetected(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_ReadBlocks_IT(), BSP_SD_WriteBlocks(), BSP_SD_WriteBlocks_DMA(), BSP_SD_WriteBlocks_IT(), BSP_TS_DeInit(), BSP_TS_DisableIT(), BSP_TS_EnableIT(), BSP_TS_GestureConfig(), BSP_TS_Get_MultiTouchState(), BSP_TS_GetCapabilities(), BSP_TS_GetGestureId(), BSP_TS_GetState(), BSP_TS_Init(), OSPI_NOR_EnterDOPIMode(), OSPI_NOR_EnterSOPIMode(), OSPI_NOR_ExitOPIMode(), and OSPI_NOR_ResetMemory().

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- a -

  • ALIGN_32BYTES() : stm32h735g_discovery_audio.c
  • Audio_CompObj : stm32h735g_discovery_audio.c
  • AUDIO_DFSDM1_CKOUT_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC1_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC2_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC3_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC4_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_FILTER : stm32h735g_discovery_audio.h
  • Audio_Drv : stm32h735g_discovery_audio.c
  • AUDIO_FREQUENCY_11K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_16K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_176K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_192K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_22K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_32K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_44K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_48K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_88K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_8K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_96K : stm32h735g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32h735g_discovery_audio.h
  • Audio_In_Ctx : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_ANALOG_LINE1 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_ANALOG_MIC : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC1 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC2 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC3 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC4 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC_LAST : stm32h735g_discovery_audio.h
  • AUDIO_IN_INSTANCES_NBR : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_CLK_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_SCK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_PAUSE : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_RECORDING : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_RESET : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_STOP : stm32h735g_discovery_audio.h
  • Audio_Out_Ctx : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_AUTO : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_HDMI : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_HEADPHONE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_NONE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_SPEAKER : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_SPK_HP : stm32h735g_discovery_audio.h
  • AUDIO_OUT_INSTANCES_NBR : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_PAUSE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_PLAYING : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_RESET : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_STOP : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_16B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_24B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_32B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_8B : stm32h735g_discovery_audio.h
  • AUDIO_VOLUME_INPUT : stm32h735g_discovery_audio.h
  • AUDIO_VOLUME_OUTPUT : stm32h735g_discovery_audio.h
  • AudioCompObj : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • BSP_AUDIO_IN_DeInit() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Error_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetState() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_IRQHandler() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_AUDIO_IN_Pause() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_PauseChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Record() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_RecordChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_RecordPDM() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Resume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_ResumeChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_StopChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_MUTE_DISABLED : stm32h735g_discovery_audio.h
  • BSP_AUDIO_MUTE_ENABLED : stm32h735g_discovery_audio.h
  • BSP_AUDIO_OUT_DeInit() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetState() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_IRQHandler() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_IsMute() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_AUDIO_OUT_Mute() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_UnMute() : stm32h735g_discovery_audio.c
  • BSP_BUTTON_USER_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_ARBITRATION_LOSS : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_CRC_ERROR : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_DMA_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_FRAME_ERROR : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_MODE_FAULT : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_PROTOCOL_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_TRANSACTION_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUSY : stm32h735g_discovery_errno.h
  • BSP_ERROR_CLOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_COMPONENT_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_FEATURE_NOT_SUPPORTED : stm32h735g_discovery_errno.h
  • BSP_ERROR_MSP_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_NO_INIT : stm32h735g_discovery_errno.h
  • BSP_ERROR_NONE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_ASSIGN_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_MMP_LOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_SETUP_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_SUSPENDED : stm32h735g_discovery_errno.h
  • BSP_ERROR_PERIPH_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_TS_TOUCH_NOT_DETECTED : stm32h735g_discovery_errno.h
  • BSP_ERROR_UNKNOWN_COMPONENT : stm32h735g_discovery_errno.h
  • BSP_ERROR_UNKNOWN_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_WRONG_PARAM : stm32h735g_discovery_errno.h
  • BSP_EXTI_LineCallback : stm32h735g_discovery.c , stm32h735g_discovery_sd.c , stm32h735g_discovery_ts.c
  • BSP_GetTick() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_GetVersion() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_I2C4_DeInit() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_Init() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_IsReady() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_ReadReg() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_ReadReg16() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_Recv() : stm32h735g_discovery_bus.h
  • BSP_I2C4_Send() : stm32h735g_discovery_bus.h
  • BSP_I2C4_WriteReg() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_WriteReg16() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_LCD_ConfigLayer() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DeInit() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32h735g_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32h735g_discovery_lcd.c
  • BSP_LCD_FillRGBRect() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetBrightness() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetPixelFormat() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32h735g_discovery_lcd.c
  • BSP_LCD_Init() : stm32h735g_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32h735g_discovery_lcd.c
  • BSP_LCD_LayerConfig_t : stm32h735g_discovery_lcd.h
  • BSP_LCD_ReadPixel() : stm32h735g_discovery_lcd.c
  • BSP_LCD_Relaod() : stm32h735g_discovery_lcd.c
  • BSP_LCD_RELOAD_IMMEDIATE : stm32h735g_discovery_lcd.h
  • BSP_LCD_RELOAD_NONE : stm32h735g_discovery_lcd.h
  • BSP_LCD_RELOAD_VERTICAL_BLANKING : stm32h735g_discovery_lcd.h
  • BSP_LCD_Reset() : stm32h735g_discovery_lcd.h
  • BSP_LCD_ResetColorKeying() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetActiveLayer() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetBrightness() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32h735g_discovery_lcd.c
  • BSP_LCD_WritePixel() : stm32h735g_discovery_lcd.c
  • BSP_LED_DeInit() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_GetState() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_Init() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_Off() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_On() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_Toggle() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_OSPI_NOR_BLOCK_4K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_BLOCK_64K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_ConfigFlash() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_DeInit() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_DisableMemoryMappedMode() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_DTR_TRANSFER : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_EnableMemoryMappedMode() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ERASE_4K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_ERASE_64K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Erase_Block() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Erase_Chip() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ERASE_CHIP : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Erase_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_GetInfo() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_GetStatus() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Info_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Init() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Interface_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_OPI_MODE : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Read() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ReadID() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ResumeErase() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_SPI_MODE : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_STR_TRANSFER : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_SuspendErase() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Transfer_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Write() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_BURST_128_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_16_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_32_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_64_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BurstLength_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BurstType_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_ConfigHyperRAM() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_DeInit() : stm32h735g_discovery_ospi.h , stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_DisableMemoryMappedMode() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_DMA_IRQHandler() : stm32h735g_discovery_ospi.h , stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_DMA_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_OSPI_RAM_EnableMemoryMappedMode() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_FIXED_LATENCY : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_HYBRID_BURST : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Init() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_IRQHandler() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_OSPI_RAM_Latency_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_LINEAR_BURST : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Read() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Read_DMA() : stm32h735g_discovery_ospi.h , stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_VARIABLE_LATENCY : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Write() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Write_DMA() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_PB_Callback() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_PB_DeInit() : stm32h735g_discovery.h , stm32h735g_discovery.c
  • BSP_PB_GetState() : stm32h735g_discovery.h , stm32h735g_discovery.c
  • BSP_PB_Init() : stm32h735g_discovery.h , stm32h735g_discovery.c
  • BSP_PB_IRQHandler() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_SD_AbortCallback() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_CardInfo : stm32h735g_discovery_sd.h
  • BSP_SD_DeInit() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DETECT_IRQHandler() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DetectCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DetectITConfig() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_Erase() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_GetCardInfo() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_GetCardState() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_Init() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_IRQHandler() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_IsDetected() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_ReadBlocks() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_ReadBlocks_IT() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_RX_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_TX_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_WriteBlocks() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_WriteBlocks_IT() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_WriteCpltCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_TS_Callback() : stm32h735g_discovery_ts.c
  • BSP_TS_DeInit() : stm32h735g_discovery_ts.c
  • BSP_TS_DisableIT() : stm32h735g_discovery_ts.c
  • BSP_TS_EnableIT() : stm32h735g_discovery_ts.c
  • BSP_TS_GestureConfig() : stm32h735g_discovery_ts.c
  • BSP_TS_Get_MultiTouchState() : stm32h735g_discovery_ts.c
  • BSP_TS_Get_Orientation() : stm32h735g_discovery_ts.c
  • BSP_TS_GetCapabilities() : stm32h735g_discovery_ts.c
  • BSP_TS_GetGestureId() : stm32h735g_discovery_ts.c
  • BSP_TS_GetState() : stm32h735g_discovery_ts.c
  • BSP_TS_Init() : stm32h735g_discovery_ts.c
  • BSP_TS_IRQHandler() : stm32h735g_discovery_ts.c
  • BSP_TS_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_TS_Set_Orientation() : stm32h735g_discovery_ts.c
  • BUS_I2C4 : stm32h735g_discovery_bus.h
  • BUS_I2C4_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_FORCE_RESET : stm32h735g_discovery_bus.h
  • BUS_I2C4_RELEASE_RESET : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_AF : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_PORT : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_PIN : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_AF : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_PORT : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_PIN : stm32h735g_discovery_bus.h
  • BUTTON_IRQn : stm32h735g_discovery.c
  • BUTTON_MODE_EXTI : stm32h735g_discovery.h
  • BUTTON_MODE_GPIO : stm32h735g_discovery.h
  • BUTTON_PIN : stm32h735g_discovery.c
  • BUTTON_PORT : stm32h735g_discovery.c
  • BUTTON_PRESSED : stm32h735g_discovery.h
  • BUTTON_RELEASED : stm32h735g_discovery.h
  • Button_TypeDef : stm32h735g_discovery.h
  • BUTTON_USER : stm32h735g_discovery.h
  • BUTTON_USER_EXTI_Callback() : stm32h735g_discovery.c
  • BUTTON_USER_EXTI_IRQn : stm32h735g_discovery.h
  • BUTTON_USER_EXTI_LINE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_PORT : stm32h735g_discovery.h
  • BUTTON_USER_PIN : stm32h735g_discovery.h
  • ButtonMode_TypeDef : stm32h735g_discovery.h
  • BUTTONn : stm32h735g_discovery.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • CODEC_AUDIOFRAME_SLOT_0123 : stm32h735g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32h735g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32h735g_discovery_audio.h
  • CODEC_MUTE_OFF : stm32h735g_discovery_audio.h
  • CODEC_MUTE_ON : stm32h735g_discovery_audio.h
  • CODEC_PDWN_SW : stm32h735g_discovery_audio.h
  • ConvertColor_Func : stm32h735g_discovery_lcd.h
  • CONVERTRGB5652ARGB8888 : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- d -

  • DEFAULT_AUDIO_IN_BUFFER_SIZE : stm32h735g_discovery_conf_template.h
  • DFSDM_ChannelMspDeInit() : stm32h735g_discovery_audio.c
  • DFSDM_ChannelMspInit() : stm32h735g_discovery_audio.c
  • DFSDM_CLOCK_DIVIDER : stm32h735g_discovery_audio.c
  • DFSDM_FILTER_ORDER : stm32h735g_discovery_audio.c
  • DFSDM_FilterMspDeInit() : stm32h735g_discovery_audio.c
  • DFSDM_FilterMspInit() : stm32h735g_discovery_audio.c
  • DFSDM_MIC_BIT_SHIFT : stm32h735g_discovery_audio.c
  • DFSDM_MIC_NUMBER : stm32h735g_discovery_audio.h
  • DFSDM_OVER_SAMPLING : stm32h735g_discovery_audio.c
  • DIV_ROUND_CLOSEST : stm32h735g_discovery_bus.c
  • DMA2D_MspDeInit() : stm32h735g_discovery_lcd.c
  • DMA2D_MspInit() : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- f -

  • FT5336_Probe() : stm32h735g_discovery_ts.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- g -

  • GESTURE_ID_MOVE_DOWN : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_LEFT : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_RIGHT : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_UP : stm32h735g_discovery_ts.h
  • GESTURE_ID_NB_MAX : stm32h735g_discovery_ts.h
  • GESTURE_ID_NO_GESTURE : stm32h735g_discovery_ts.h
  • GESTURE_ID_ZOOM_IN : stm32h735g_discovery_ts.h
  • GESTURE_ID_ZOOM_OUT : stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- h -

  • HAL_DFSDM_FilterRegConvCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32h735g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32h735g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32h735g_discovery_sd.c
  • haudio_in_dfsdm_channel : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • haudio_in_dfsdm_filter : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • haudio_in_sai : stm32h735g_discovery_audio.h , stm32h735g_discovery_audio.c
  • haudio_out_sai : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • hbus_i2c4 : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • hDmaDfsdm : stm32h735g_discovery_audio.c
  • hlcd_dma2d : stm32h735g_discovery_lcd.h , stm32h735g_discovery_lcd.c
  • hlcd_ltdc : stm32h735g_discovery_lcd.c , stm32h735g_discovery_lcd.h
  • hospi_nor : stm32h735g_discovery_ospi.h , stm32h735g_discovery_ospi.c
  • hospi_ram : stm32h735g_discovery_ospi.c
  • hpb_exti : stm32h735g_discovery.h , stm32h735g_discovery.c
  • hsd_exti : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • hsd_sdmmc : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • hts_exti : stm32h735g_discovery_ts.h , stm32h735g_discovery_ts.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- i -

  • I2C4_MspDeInit() : stm32h735g_discovery_bus.c
  • I2C4_MspInit() : stm32h735g_discovery_bus.c
  • I2C4_ReadReg() : stm32h735g_discovery_bus.c
  • I2C4_WriteReg() : stm32h735g_discovery_bus.c
  • I2c4InitCounter : stm32h735g_discovery_bus.c
  • I2C_ANALOG_FILTER_DELAY_MAX : stm32h735g_discovery_bus.c
  • I2C_ANALOG_FILTER_DELAY_MIN : stm32h735g_discovery_bus.c
  • I2C_Charac : stm32h735g_discovery_bus.c
  • I2C_Compute_PRESC_SCLDEL_SDADEL() : stm32h735g_discovery_bus.c
  • I2C_Compute_SCLL_SCLH() : stm32h735g_discovery_bus.c
  • I2C_DIGITAL_FILTER_COEF : stm32h735g_discovery_bus.c
  • I2C_GetTiming() : stm32h735g_discovery_bus.c
  • I2C_PRESC_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLDEL_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLH_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLL_MAX : stm32h735g_discovery_bus.c
  • I2C_SDADEL_MAX : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_FAST : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_FAST_PLUS : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_STANDARD : stm32h735g_discovery_bus.c
  • I2C_USE_ANALOG_FILTER : stm32h735g_discovery_bus.c
  • I2c_valid_timing : stm32h735g_discovery_bus.c
  • I2C_VALID_TIMING_NBR : stm32h735g_discovery_conf_template.h
  • I2c_valid_timing_nbr : stm32h735g_discovery_bus.c
  • I2C_VALID_TIMING_NBR : stm32h735g_discovery_bus.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- l -

  • LCD_BL_CTRL_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BLACK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_CYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_GREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_MAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ORANGE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_RED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GREEN_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GREEN_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_PINK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_PURPLE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_WHITE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BLACK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_CYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_GREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_MAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ORANGE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_RED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GREEN_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GREEN_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_PINK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_PURPLE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_WHITE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_YELLOW : stm32h735g_discovery_lcd.h
  • Lcd_Ctx : stm32h735g_discovery_lcd.c
  • LCD_DEFAULT_HEIGHT : stm32h735g_discovery_lcd.h
  • LCD_DEFAULT_WIDTH : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_PIN : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_PULL : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_PIN : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_PULL : stm32h735g_discovery_lcd.h
  • LCD_Driver : stm32h735g_discovery_lcd.c , stm32h735g_discovery_lcd.h
  • LCD_INSTANCES_NBR : stm32h735g_discovery_lcd.h
  • LCD_LAYER_0_ADDRESS : stm32h735g_discovery_conf_template.h
  • LCD_LAYER_1_ADDRESS : stm32h735g_discovery_conf_template.h
  • LCD_ORIENTATION_LANDSCAPE : stm32h735g_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32h735g_discovery_lcd.h
  • LcdCtx : stm32h735g_discovery_lcd.h
  • LED1 : stm32h735g_discovery.h
  • LED1_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • LED1_GPIO_PORT : stm32h735g_discovery.h
  • LED1_PIN : stm32h735g_discovery.h
  • LED2 : stm32h735g_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • LED2_GPIO_PORT : stm32h735g_discovery.h
  • LED2_PIN : stm32h735g_discovery.h
  • LED_GREEN : stm32h735g_discovery.h
  • LED_PIN : stm32h735g_discovery.c
  • LED_PORT : stm32h735g_discovery.c
  • LED_RED : stm32h735g_discovery.h
  • Led_TypeDef : stm32h735g_discovery.h
  • LEDn : stm32h735g_discovery.h
  • LL_ConvertLineToRGB() : stm32h735g_discovery_lcd.c
  • LL_FillBuffer() : stm32h735g_discovery_lcd.c
  • LTDC_MspDeInit() : stm32h735g_discovery_lcd.c
  • LTDC_MspInit() : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- m -

  • MicBuffIndex : stm32h735g_discovery_audio.c
  • MX_DFSDM1_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_DFSDM1_Init() : stm32h735g_discovery_audio.c
  • MX_DFSDM2_ClockConfig() : stm32h735g_discovery_audio.h
  • MX_DFSDM2_Init() : stm32h735g_discovery_audio.h
  • MX_I2C4_Init() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • MX_I2S6_ClockConfig() : stm32h735g_discovery_audio.h
  • MX_I2S6_Init() : stm32h735g_discovery_audio.h
  • MX_LTDC_ClockConfig() : stm32h735g_discovery_lcd.c
  • MX_LTDC_ClockConfig2() : stm32h735g_discovery_lcd.h
  • MX_LTDC_ConfigLayer() : stm32h735g_discovery_lcd.c
  • MX_LTDC_Init() : stm32h735g_discovery_lcd.c
  • MX_OSPI_ClockConfig() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • MX_OSPI_NOR_Init() : stm32h735g_discovery_ospi.c
  • MX_OSPI_RAM_Init() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • MX_SAI1_Block_A_Init() : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • MX_SAI1_Block_B_Init() : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • MX_SAI1_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_SAI4_Block_A_Init() : stm32h735g_discovery_audio.c
  • MX_SAI4_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_SDMMC1_SD_Init() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- o -

  • OPSI_RAM_MDMA_IRQHandler : stm32h735g_discovery_ospi.h
  • OSPI_ACCESS_INDIRECT : stm32h735g_discovery_ospi.h
  • OSPI_ACCESS_MMP : stm32h735g_discovery_ospi.h
  • OSPI_ACCESS_NONE : stm32h735g_discovery_ospi.h
  • OSPI_Access_t : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_PIN_AF : stm32h735g_discovery_ospi.h
  • Ospi_Nor_Ctx : stm32h735g_discovery_ospi.c
  • OSPI_NOR_D0_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_EnterDOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_EnterSOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_ExitOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_FORCE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_NOR_INSTANCES_NUMBER : stm32h735g_discovery_ospi.h
  • OSPI_NOR_MspDeInit() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_MspInit() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_RELEASE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_NOR_ResetMemory() : stm32h735g_discovery_ospi.c
  • OSPI_RAM_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_PIN_AF : stm32h735g_discovery_ospi.h
  • Ospi_Ram_Ctx : stm32h735g_discovery_ospi.c
  • OSPI_RAM_D0_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_FORCE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_RAM_INSTANCES_NUMBER : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CHANNEL : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_IRQn : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MspDeInit() : stm32h735g_discovery_ospi.c
  • OSPI_RAM_MspInit() : stm32h735g_discovery_ospi.c
  • OSPI_RAM_RELEASE_RESET : stm32h735g_discovery_ospi.h
  • OSPINORCtx : stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- p -

  • PinDetect : stm32h735g_discovery_sd.c
  • PixelFormatFactor : stm32h735g_discovery_lcd.c
  • POS_VAL : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- r -

  • RecBuffHalf : stm32h735g_discovery_audio.c
  • RecBuffTrigger : stm32h735g_discovery_audio.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- s -

  • SAI_MspDeInit() : stm32h735g_discovery_audio.c
  • SAI_MspInit() : stm32h735g_discovery_audio.c
  • SaturaLH : stm32h735g_discovery_audio.c
  • SD1_DMAx_TxRx_CLK_ENABLE : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMA_Rx_IRQHandler : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMA_Tx_IRQHandler : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_CHANNEL : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_IRQn : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_STREAM : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_CHANNEL : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_IRQn : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_STREAM : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_IRQHandler : stm32h735g_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32h735g_discovery_sd.h
  • SD_DETECT_EXTI_LINE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_PORT : stm32h735g_discovery_sd.h
  • SD_DETECT_PIN : stm32h735g_discovery_sd.h
  • SD_EXTI_Callback() : stm32h735g_discovery_sd.c
  • SD_EXTI_IRQn : stm32h735g_discovery_sd.c
  • SD_GPIO_PORT : stm32h735g_discovery_sd.c
  • SD_INSTANCES_NBR : stm32h735g_discovery_sd.h
  • SD_MspDeInit() : stm32h735g_discovery_sd.c
  • SD_MspInit() : stm32h735g_discovery_sd.c
  • SD_NOT_PRESENT : stm32h735g_discovery_sd.h
  • SD_PRESENT : stm32h735g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32h735g_discovery_sd.h
  • SD_TRANSFER_OK : stm32h735g_discovery_sd.h
  • SEC2NSEC : stm32h735g_discovery_bus.c
  • STM32H735G_DK_BSP_VERSION : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_MAIN : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_RC : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_SUB1 : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_SUB2 : stm32h735g_discovery.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- t -

  • TOUCH_EVENT_CONTACT : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32h735g_discovery_ts.h
  • Ts_CompObj : stm32h735g_discovery_ts.c , stm32h735g_discovery_ts.h
  • Ts_Ctx : stm32h735g_discovery_ts.c , stm32h735g_discovery_ts.h
  • Ts_Drv : stm32h735g_discovery_ts.c
  • TS_EXTI_Callback() : stm32h735g_discovery_ts.c
  • TS_EXTI_LINE : stm32h735g_discovery_ts.h
  • TS_I2C_ADDRESS : stm32h735g_discovery_ts.h
  • TS_INSTANCES_NBR : stm32h735g_discovery_ts.h
  • TS_INT_EXTI_IRQn : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_CLK_DISABLE : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_CLK_ENABLE : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_PORT : stm32h735g_discovery_ts.h
  • TS_INT_PIN : stm32h735g_discovery_ts.h
  • TS_MAX_HEIGHT : stm32h735g_discovery_ts.h
  • TS_MAX_WIDTH : stm32h735g_discovery_ts.h
  • TS_MIN : stm32h735g_discovery_ts.c
  • TS_SWAP_NONE : stm32h735g_discovery_ts.h
  • TS_SWAP_X : stm32h735g_discovery_ts.h
  • TS_SWAP_XY : stm32h735g_discovery_ts.h
  • TS_SWAP_Y : stm32h735g_discovery_ts.h
  • TS_TOUCH_NBR : stm32h735g_discovery_conf_template.h
  • TS_TouchEventTypeDef : stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- u -

  • USE_AUDIO_CODEC_WM8994 : stm32h735g_discovery_conf_template.h
  • USE_BSP_COM_FEATURE : stm32h735g_discovery_conf_template.h
  • USE_BSP_CPU_CACHE_MAINTENANCE : stm32h735g_discovery_conf_template.h
  • USE_BSP_PDM_LIB_FEATURE : stm32h735g_discovery_conf_template.h
  • USE_COM_LOG : stm32h735g_discovery_conf_template.h
  • USE_DMA2D_TO_FILL_RGB_RECT : stm32h735g_discovery_conf_template.h
  • USE_LCD_CTRL_RK043FN48H : stm32h735g_discovery_conf_template.h
  • USE_TS_GESTURE : stm32h735g_discovery_conf_template.h
  • USE_TS_MULTI_TOUCH : stm32h735g_discovery_conf_template.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- v -

  • VOLUME_IN_CONVERT : stm32h735g_discovery_audio.h
  • VOLUME_OUT_CONVERT : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- a -

  • ALIGN_32BYTES() : stm32h735g_discovery_audio.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- b -

  • BSP_AUDIO_IN_DeInit() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Error_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetState() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_GetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_IRQHandler() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Pause() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_PauseChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Record() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_RecordChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_RecordPDM() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Resume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_ResumeChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_SetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_StopChannels() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetState() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_GetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_IRQHandler() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_IsMute() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Mute() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetBitsPerSample() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetChannelsNbr() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetDevice() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetSampleRate() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32h735g_discovery_audio.c
  • BSP_AUDIO_OUT_UnMute() : stm32h735g_discovery_audio.c
  • BSP_GetTick() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_GetVersion() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_I2C4_DeInit() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_Init() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_IsReady() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_ReadReg() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_ReadReg16() : stm32h735g_discovery_bus.h , stm32h735g_discovery_bus.c
  • BSP_I2C4_Recv() : stm32h735g_discovery_bus.h
  • BSP_I2C4_Send() : stm32h735g_discovery_bus.h
  • BSP_I2C4_WriteReg() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_I2C4_WriteReg16() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • BSP_LCD_ConfigLayer() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DeInit() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32h735g_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32h735g_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32h735g_discovery_lcd.c
  • BSP_LCD_FillRGBRect() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetBrightness() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetPixelFormat() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32h735g_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32h735g_discovery_lcd.c
  • BSP_LCD_Init() : stm32h735g_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32h735g_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32h735g_discovery_lcd.c
  • BSP_LCD_Relaod() : stm32h735g_discovery_lcd.c
  • BSP_LCD_Reset() : stm32h735g_discovery_lcd.h
  • BSP_LCD_ResetColorKeying() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetActiveLayer() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetBrightness() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32h735g_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32h735g_discovery_lcd.c
  • BSP_LCD_WritePixel() : stm32h735g_discovery_lcd.c
  • BSP_LED_DeInit() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_GetState() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_Init() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_Off() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_LED_On() : stm32h735g_discovery.h , stm32h735g_discovery.c
  • BSP_LED_Toggle() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_OSPI_NOR_ConfigFlash() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_DeInit() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_DisableMemoryMappedMode() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_EnableMemoryMappedMode() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Erase_Block() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Erase_Chip() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_GetInfo() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_GetStatus() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Init() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Read() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ReadID() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_ResumeErase() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_SuspendErase() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_NOR_Write() : stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_ConfigHyperRAM() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_DeInit() : stm32h735g_discovery_ospi.h , stm32h735g_discovery_ospi.c
  • BSP_OSPI_RAM_DisableMemoryMappedMode() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_DMA_IRQHandler() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_EnableMemoryMappedMode() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Init() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_IRQHandler() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Read() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Read_DMA() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Write() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Write_DMA() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • BSP_PB_Callback() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_PB_DeInit() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_PB_GetState() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_PB_Init() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_PB_IRQHandler() : stm32h735g_discovery.c , stm32h735g_discovery.h
  • BSP_SD_AbortCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DeInit() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DETECT_IRQHandler() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DetectCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_DetectITConfig() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_Erase() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_GetCardState() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_Init() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_IRQHandler() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_IsDetected() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_ReadBlocks_DMA() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_ReadBlocks_IT() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_ReadCpltCallback() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_WriteBlocks_IT() : stm32h735g_discovery_sd.h , stm32h735g_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • BSP_TS_Callback() : stm32h735g_discovery_ts.c
  • BSP_TS_DeInit() : stm32h735g_discovery_ts.c
  • BSP_TS_DisableIT() : stm32h735g_discovery_ts.c
  • BSP_TS_EnableIT() : stm32h735g_discovery_ts.c
  • BSP_TS_GestureConfig() : stm32h735g_discovery_ts.c
  • BSP_TS_Get_MultiTouchState() : stm32h735g_discovery_ts.c
  • BSP_TS_Get_Orientation() : stm32h735g_discovery_ts.c
  • BSP_TS_GetCapabilities() : stm32h735g_discovery_ts.c
  • BSP_TS_GetGestureId() : stm32h735g_discovery_ts.c
  • BSP_TS_GetState() : stm32h735g_discovery_ts.c
  • BSP_TS_Init() : stm32h735g_discovery_ts.c
  • BSP_TS_IRQHandler() : stm32h735g_discovery_ts.c
  • BSP_TS_Set_Orientation() : stm32h735g_discovery_ts.c
  • BUTTON_USER_EXTI_Callback() : stm32h735g_discovery.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- d -

  • DFSDM_ChannelMspDeInit() : stm32h735g_discovery_audio.c
  • DFSDM_ChannelMspInit() : stm32h735g_discovery_audio.c
  • DFSDM_FilterMspDeInit() : stm32h735g_discovery_audio.c
  • DFSDM_FilterMspInit() : stm32h735g_discovery_audio.c
  • DMA2D_MspDeInit() : stm32h735g_discovery_lcd.c
  • DMA2D_MspInit() : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- f -

  • FT5336_Probe() : stm32h735g_discovery_ts.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- h -

  • HAL_DFSDM_FilterRegConvCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32h735g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32h735g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32h735g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32h735g_discovery_sd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- i -

  • I2C4_MspDeInit() : stm32h735g_discovery_bus.c
  • I2C4_MspInit() : stm32h735g_discovery_bus.c
  • I2C4_ReadReg() : stm32h735g_discovery_bus.c
  • I2C4_WriteReg() : stm32h735g_discovery_bus.c
  • I2C_Compute_PRESC_SCLDEL_SDADEL() : stm32h735g_discovery_bus.c
  • I2C_Compute_SCLL_SCLH() : stm32h735g_discovery_bus.c
  • I2C_GetTiming() : stm32h735g_discovery_bus.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- l -

  • LL_ConvertLineToRGB() : stm32h735g_discovery_lcd.c
  • LL_FillBuffer() : stm32h735g_discovery_lcd.c
  • LTDC_MspDeInit() : stm32h735g_discovery_lcd.c
  • LTDC_MspInit() : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- m -

  • MX_DFSDM1_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_DFSDM1_Init() : stm32h735g_discovery_audio.c
  • MX_DFSDM2_ClockConfig() : stm32h735g_discovery_audio.h
  • MX_DFSDM2_Init() : stm32h735g_discovery_audio.h
  • MX_I2C4_Init() : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • MX_I2S6_ClockConfig() : stm32h735g_discovery_audio.h
  • MX_I2S6_Init() : stm32h735g_discovery_audio.h
  • MX_LTDC_ClockConfig() : stm32h735g_discovery_lcd.c
  • MX_LTDC_ClockConfig2() : stm32h735g_discovery_lcd.h
  • MX_LTDC_ConfigLayer() : stm32h735g_discovery_lcd.c
  • MX_LTDC_Init() : stm32h735g_discovery_lcd.c
  • MX_OSPI_ClockConfig() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • MX_OSPI_NOR_Init() : stm32h735g_discovery_ospi.c
  • MX_OSPI_RAM_Init() : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • MX_SAI1_Block_A_Init() : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • MX_SAI1_Block_B_Init() : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • MX_SAI1_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_SAI4_Block_A_Init() : stm32h735g_discovery_audio.c
  • MX_SAI4_ClockConfig() : stm32h735g_discovery_audio.c
  • MX_SDMMC1_SD_Init() : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- o -

  • OSPI_NOR_EnterDOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_EnterSOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_ExitOPIMode() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_MspDeInit() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_MspInit() : stm32h735g_discovery_ospi.c
  • OSPI_NOR_ResetMemory() : stm32h735g_discovery_ospi.c
  • OSPI_RAM_MspDeInit() : stm32h735g_discovery_ospi.c
  • OSPI_RAM_MspInit() : stm32h735g_discovery_ospi.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- s -

  • SAI_MspDeInit() : stm32h735g_discovery_audio.c
  • SAI_MspInit() : stm32h735g_discovery_audio.c
  • SD_EXTI_Callback() : stm32h735g_discovery_sd.c
  • SD_MspDeInit() : stm32h735g_discovery_sd.c
  • SD_MspInit() : stm32h735g_discovery_sd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • d
  • f
  • h
  • i
  • l
  • m
  • o
  • s
  • t

- t -

  • TS_EXTI_Callback() : stm32h735g_discovery_ts.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • h
  • i
  • l
  • m
  • o
  • p
  • r
  • s
  • t

- a -

  • Audio_CompObj : stm32h735g_discovery_audio.c
  • Audio_Drv : stm32h735g_discovery_audio.c
  • Audio_In_Ctx : stm32h735g_discovery_audio.h , stm32h735g_discovery_audio.c
  • Audio_Out_Ctx : stm32h735g_discovery_audio.h , stm32h735g_discovery_audio.c
  • AudioCompObj : stm32h735g_discovery_audio.h

- b -

  • BUTTON_IRQn : stm32h735g_discovery.c
  • BUTTON_PIN : stm32h735g_discovery.c
  • BUTTON_PORT : stm32h735g_discovery.c

- h -

  • haudio_in_dfsdm_channel : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • haudio_in_dfsdm_filter : stm32h735g_discovery_audio.h , stm32h735g_discovery_audio.c
  • haudio_in_sai : stm32h735g_discovery_audio.c , stm32h735g_discovery_audio.h
  • haudio_out_sai : stm32h735g_discovery_audio.h , stm32h735g_discovery_audio.c
  • hbus_i2c4 : stm32h735g_discovery_bus.c , stm32h735g_discovery_bus.h
  • hDmaDfsdm : stm32h735g_discovery_audio.c
  • hlcd_dma2d : stm32h735g_discovery_lcd.c , stm32h735g_discovery_lcd.h
  • hlcd_ltdc : stm32h735g_discovery_lcd.h , stm32h735g_discovery_lcd.c
  • hospi_nor : stm32h735g_discovery_ospi.c , stm32h735g_discovery_ospi.h
  • hospi_ram : stm32h735g_discovery_ospi.c
  • hpb_exti : stm32h735g_discovery.c , stm32h735g_discovery.h
  • hsd_exti : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • hsd_sdmmc : stm32h735g_discovery_sd.c , stm32h735g_discovery_sd.h
  • hts_exti : stm32h735g_discovery_ts.c , stm32h735g_discovery_ts.h

- i -

  • I2c4InitCounter : stm32h735g_discovery_bus.c
  • I2C_Charac : stm32h735g_discovery_bus.c
  • I2c_valid_timing : stm32h735g_discovery_bus.c
  • I2c_valid_timing_nbr : stm32h735g_discovery_bus.c

- l -

  • Lcd_Ctx : stm32h735g_discovery_lcd.c
  • LCD_Driver : stm32h735g_discovery_lcd.c , stm32h735g_discovery_lcd.h
  • LcdCtx : stm32h735g_discovery_lcd.h
  • LED_PIN : stm32h735g_discovery.c
  • LED_PORT : stm32h735g_discovery.c

- m -

  • MicBuffIndex : stm32h735g_discovery_audio.c

- o -

  • Ospi_Nor_Ctx : stm32h735g_discovery_ospi.c
  • Ospi_Ram_Ctx : stm32h735g_discovery_ospi.c
  • OSPINORCtx : stm32h735g_discovery_ospi.h

- p -

  • PinDetect : stm32h735g_discovery_sd.c
  • PixelFormatFactor : stm32h735g_discovery_lcd.c

- r -

  • RecBuffHalf : stm32h735g_discovery_audio.c
  • RecBuffTrigger : stm32h735g_discovery_audio.c

- s -

  • SD_EXTI_IRQn : stm32h735g_discovery_sd.c
  • SD_GPIO_PORT : stm32h735g_discovery_sd.c

- t -

  • Ts_CompObj : stm32h735g_discovery_ts.c , stm32h735g_discovery_ts.h
  • Ts_Ctx : stm32h735g_discovery_ts.h , stm32h735g_discovery_ts.c
  • Ts_Drv : stm32h735g_discovery_ts.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_EXTI_LineCallback : stm32h735g_discovery.c , stm32h735g_discovery_ts.c , stm32h735g_discovery_sd.c
  • ConvertColor_Func : stm32h735g_discovery_lcd.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_OSPI_RAM_BurstType_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_Latency_t : stm32h735g_discovery_ospi.h
  • Button_TypeDef : stm32h735g_discovery.h
  • ButtonMode_TypeDef : stm32h735g_discovery.h
  • Led_TypeDef : stm32h735g_discovery.h
  • OSPI_Access_t : stm32h735g_discovery_ospi.h
  • TS_TouchEventTypeDef : stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_OSPI_RAM_FIXED_LATENCY : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_HYBRID_BURST : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_LINEAR_BURST : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_VARIABLE_LATENCY : stm32h735g_discovery_ospi.h
  • BUTTON_MODE_EXTI : stm32h735g_discovery.h
  • BUTTON_MODE_GPIO : stm32h735g_discovery.h
  • BUTTON_USER : stm32h735g_discovery.h
  • BUTTONn : stm32h735g_discovery.h
  • LED1 : stm32h735g_discovery.h
  • LED2 : stm32h735g_discovery.h
  • LED_GREEN : stm32h735g_discovery.h
  • LED_RED : stm32h735g_discovery.h
  • LEDn : stm32h735g_discovery.h
  • OSPI_ACCESS_INDIRECT : stm32h735g_discovery_ospi.h
  • OSPI_ACCESS_MMP : stm32h735g_discovery_ospi.h
  • OSPI_ACCESS_NONE : stm32h735g_discovery_ospi.h
  • TOUCH_EVENT_CONTACT : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32h735g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- a -

  • AUDIO_DFSDM1_CKOUT_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CKOUT_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM1_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC1_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC2_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC3_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_MIC4_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC1_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC2_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC3_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_AF : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DATIN_MIC4_PIN : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC1_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC2_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC3_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MIC4_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC1_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC2_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC3_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_CHANNEL : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_DFSDMx_MIC4_FILTER : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_11K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_16K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_176K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_192K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_22K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_32K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_44K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_48K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_88K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_8K : stm32h735g_discovery_audio.h
  • AUDIO_FREQUENCY_96K : stm32h735g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_ANALOG_LINE1 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_ANALOG_MIC : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC1 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC2 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC3 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC4 : stm32h735g_discovery_audio.h
  • AUDIO_IN_DEVICE_DIGITAL_MIC_LAST : stm32h735g_discovery_audio.h
  • AUDIO_IN_INSTANCES_NBR : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_CLK_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_SCK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_AF : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_PAUSE : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_RECORDING : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_RESET : stm32h735g_discovery_audio.h
  • AUDIO_IN_STATE_STOP : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_AUTO : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_HDMI : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_HEADPHONE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_NONE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_SPEAKER : stm32h735g_discovery_audio.h
  • AUDIO_OUT_DEVICE_SPK_HP : stm32h735g_discovery_audio.h
  • AUDIO_OUT_INSTANCES_NBR : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_REQUEST : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_AF : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_ENABLE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_GPIO_PORT : stm32h735g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_PAUSE : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_PLAYING : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_RESET : stm32h735g_discovery_audio.h
  • AUDIO_OUT_STATE_STOP : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_16B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_24B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_32B : stm32h735g_discovery_audio.h
  • AUDIO_RESOLUTION_8B : stm32h735g_discovery_audio.h
  • AUDIO_VOLUME_INPUT : stm32h735g_discovery_audio.h
  • AUDIO_VOLUME_OUTPUT : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- b -

  • BSP_AUDIO_IN_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_AUDIO_MUTE_DISABLED : stm32h735g_discovery_audio.h
  • BSP_AUDIO_MUTE_ENABLED : stm32h735g_discovery_audio.h
  • BSP_AUDIO_OUT_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_BUTTON_USER_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_ARBITRATION_LOSS : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_CRC_ERROR : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_DMA_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_FRAME_ERROR : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_MODE_FAULT : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_PROTOCOL_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUS_TRANSACTION_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_BUSY : stm32h735g_discovery_errno.h
  • BSP_ERROR_CLOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_COMPONENT_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_FEATURE_NOT_SUPPORTED : stm32h735g_discovery_errno.h
  • BSP_ERROR_MSP_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_NO_INIT : stm32h735g_discovery_errno.h
  • BSP_ERROR_NONE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_ASSIGN_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_MMP_LOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_SETUP_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_OSPI_SUSPENDED : stm32h735g_discovery_errno.h
  • BSP_ERROR_PERIPH_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_TS_TOUCH_NOT_DETECTED : stm32h735g_discovery_errno.h
  • BSP_ERROR_UNKNOWN_COMPONENT : stm32h735g_discovery_errno.h
  • BSP_ERROR_UNKNOWN_FAILURE : stm32h735g_discovery_errno.h
  • BSP_ERROR_WRONG_PARAM : stm32h735g_discovery_errno.h
  • BSP_LCD_LayerConfig_t : stm32h735g_discovery_lcd.h
  • BSP_LCD_RELOAD_IMMEDIATE : stm32h735g_discovery_lcd.h
  • BSP_LCD_RELOAD_NONE : stm32h735g_discovery_lcd.h
  • BSP_LCD_RELOAD_VERTICAL_BLANKING : stm32h735g_discovery_lcd.h
  • BSP_OSPI_NOR_BLOCK_4K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_BLOCK_64K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_DTR_TRANSFER : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_ERASE_4K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_ERASE_64K : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_ERASE_CHIP : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Erase_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Info_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Interface_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_OPI_MODE : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_SPI_MODE : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_STR_TRANSFER : stm32h735g_discovery_ospi.h
  • BSP_OSPI_NOR_Transfer_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_128_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_16_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_32_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BURST_64_BYTES : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_BurstLength_t : stm32h735g_discovery_ospi.h
  • BSP_OSPI_RAM_DMA_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_OSPI_RAM_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_CardInfo : stm32h735g_discovery_sd.h
  • BSP_SD_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_RX_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_SD_TX_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BSP_TS_IT_PRIORITY : stm32h735g_discovery_conf_template.h
  • BUS_I2C4 : stm32h735g_discovery_bus.h
  • BUS_I2C4_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_FORCE_RESET : stm32h735g_discovery_bus.h
  • BUS_I2C4_RELEASE_RESET : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_AF : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_GPIO_PORT : stm32h735g_discovery_bus.h
  • BUS_I2C4_SCL_PIN : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_AF : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_CLK_DISABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_CLK_ENABLE : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_GPIO_PORT : stm32h735g_discovery_bus.h
  • BUS_I2C4_SDA_PIN : stm32h735g_discovery_bus.h
  • BUTTON_PRESSED : stm32h735g_discovery.h
  • BUTTON_RELEASED : stm32h735g_discovery.h
  • BUTTON_USER_EXTI_IRQn : stm32h735g_discovery.h
  • BUTTON_USER_EXTI_LINE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • BUTTON_USER_GPIO_PORT : stm32h735g_discovery.h
  • BUTTON_USER_PIN : stm32h735g_discovery.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- c -

  • CODEC_AUDIOFRAME_SLOT_0123 : stm32h735g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32h735g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32h735g_discovery_audio.h
  • CODEC_MUTE_OFF : stm32h735g_discovery_audio.h
  • CODEC_MUTE_ON : stm32h735g_discovery_audio.h
  • CODEC_PDWN_SW : stm32h735g_discovery_audio.h
  • CONVERTRGB5652ARGB8888 : stm32h735g_discovery_lcd.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- d -

  • DEFAULT_AUDIO_IN_BUFFER_SIZE : stm32h735g_discovery_conf_template.h
  • DFSDM_CLOCK_DIVIDER : stm32h735g_discovery_audio.c
  • DFSDM_FILTER_ORDER : stm32h735g_discovery_audio.c
  • DFSDM_MIC_BIT_SHIFT : stm32h735g_discovery_audio.c
  • DFSDM_MIC_NUMBER : stm32h735g_discovery_audio.h
  • DFSDM_OVER_SAMPLING : stm32h735g_discovery_audio.c
  • DIV_ROUND_CLOSEST : stm32h735g_discovery_bus.c


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- g -

  • GESTURE_ID_MOVE_DOWN : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_LEFT : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_RIGHT : stm32h735g_discovery_ts.h
  • GESTURE_ID_MOVE_UP : stm32h735g_discovery_ts.h
  • GESTURE_ID_NB_MAX : stm32h735g_discovery_ts.h
  • GESTURE_ID_NO_GESTURE : stm32h735g_discovery_ts.h
  • GESTURE_ID_ZOOM_IN : stm32h735g_discovery_ts.h
  • GESTURE_ID_ZOOM_OUT : stm32h735g_discovery_ts.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- i -

  • I2C_ANALOG_FILTER_DELAY_MAX : stm32h735g_discovery_bus.c
  • I2C_ANALOG_FILTER_DELAY_MIN : stm32h735g_discovery_bus.c
  • I2C_DIGITAL_FILTER_COEF : stm32h735g_discovery_bus.c
  • I2C_PRESC_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLDEL_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLH_MAX : stm32h735g_discovery_bus.c
  • I2C_SCLL_MAX : stm32h735g_discovery_bus.c
  • I2C_SDADEL_MAX : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_FAST : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_FAST_PLUS : stm32h735g_discovery_bus.c
  • I2C_SPEED_FREQ_STANDARD : stm32h735g_discovery_bus.c
  • I2C_USE_ANALOG_FILTER : stm32h735g_discovery_bus.c
  • I2C_VALID_TIMING_NBR : stm32h735g_discovery_bus.c , stm32h735g_discovery_conf_template.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- l -

  • LCD_BL_CTRL_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BLACK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_CYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_DARKYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_GREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_LIGHTYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_MAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ORANGE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_RED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BLUE_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GRAY_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GREEN_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_GREEN_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_PINK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_PURPLE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_ST_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_WHITE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_ARGB8888_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BLACK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_CYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_DARKYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_GREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTBLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTCYAN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTGRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTGREEN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTMAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTRED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_LIGHTYELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_MAGENTA : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ORANGE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_RED : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BLUE_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_BROWN : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GRAY_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GREEN_DARK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_GREEN_LIGHT : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_PINK : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_PURPLE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_ST_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_WHITE : stm32h735g_discovery_lcd.h
  • LCD_COLOR_RGB565_YELLOW : stm32h735g_discovery_lcd.h
  • LCD_DEFAULT_HEIGHT : stm32h735g_discovery_lcd.h
  • LCD_DEFAULT_WIDTH : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_PIN : stm32h735g_discovery_lcd.h
  • LCD_DISP_CTRL_PULL : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_CLK_DISABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_CLK_ENABLE : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_GPIO_PORT : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_PIN : stm32h735g_discovery_lcd.h
  • LCD_DISP_EN_PULL : stm32h735g_discovery_lcd.h
  • LCD_INSTANCES_NBR : stm32h735g_discovery_lcd.h
  • LCD_LAYER_0_ADDRESS : stm32h735g_discovery_conf_template.h
  • LCD_LAYER_1_ADDRESS : stm32h735g_discovery_conf_template.h
  • LCD_ORIENTATION_LANDSCAPE : stm32h735g_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32h735g_discovery_lcd.h
  • LED1_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • LED1_GPIO_PORT : stm32h735g_discovery.h
  • LED1_PIN : stm32h735g_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32h735g_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32h735g_discovery.h
  • LED2_GPIO_PORT : stm32h735g_discovery.h
  • LED2_PIN : stm32h735g_discovery.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- o -

  • OPSI_RAM_MDMA_IRQHandler : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CLK_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_CS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D0_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D1_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D2_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D3_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D4_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D5_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D6_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_D7_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_NOR_DQS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_NOR_FORCE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_NOR_INSTANCES_NUMBER : stm32h735g_discovery_ospi.h
  • OSPI_NOR_RELEASE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CLK_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_CS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D0_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D1_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D2_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D3_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D4_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D5_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D6_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_D7_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_GPIO_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_GPIO_PORT : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_PIN : stm32h735g_discovery_ospi.h
  • OSPI_RAM_DQS_PIN_AF : stm32h735g_discovery_ospi.h
  • OSPI_RAM_FORCE_RESET : stm32h735g_discovery_ospi.h
  • OSPI_RAM_INSTANCES_NUMBER : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CHANNEL : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CLK_DISABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_CLK_ENABLE : stm32h735g_discovery_ospi.h
  • OSPI_RAM_MDMAx_IRQn : stm32h735g_discovery_ospi.h
  • OSPI_RAM_RELEASE_RESET : stm32h735g_discovery_ospi.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- p -

  • POS_VAL : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- s -

  • SaturaLH : stm32h735g_discovery_audio.c
  • SD1_DMAx_TxRx_CLK_ENABLE : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMA_Rx_IRQHandler : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMA_Tx_IRQHandler : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_CHANNEL : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_IRQn : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Rx_STREAM : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_CHANNEL : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_IRQn : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_DMAx_Tx_STREAM : stm32h735g_discovery_sd.h
  • SD1_SDMMC1_IRQHandler : stm32h735g_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32h735g_discovery_sd.h
  • SD_DETECT_EXTI_LINE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32h735g_discovery_sd.h
  • SD_DETECT_GPIO_PORT : stm32h735g_discovery_sd.h
  • SD_DETECT_PIN : stm32h735g_discovery_sd.h
  • SD_INSTANCES_NBR : stm32h735g_discovery_sd.h
  • SD_NOT_PRESENT : stm32h735g_discovery_sd.h
  • SD_PRESENT : stm32h735g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32h735g_discovery_sd.h
  • SD_TRANSFER_OK : stm32h735g_discovery_sd.h
  • SEC2NSEC : stm32h735g_discovery_bus.c
  • STM32H735G_DK_BSP_VERSION : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_MAIN : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_RC : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_SUB1 : stm32h735g_discovery.h
  • STM32H735G_DK_BSP_VERSION_SUB2 : stm32h735g_discovery.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- t -

  • TS_EXTI_LINE : stm32h735g_discovery_ts.h
  • TS_I2C_ADDRESS : stm32h735g_discovery_ts.h
  • TS_INSTANCES_NBR : stm32h735g_discovery_ts.h
  • TS_INT_EXTI_IRQn : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_CLK_DISABLE : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_CLK_ENABLE : stm32h735g_discovery_ts.h
  • TS_INT_GPIO_PORT : stm32h735g_discovery_ts.h
  • TS_INT_PIN : stm32h735g_discovery_ts.h
  • TS_MAX_HEIGHT : stm32h735g_discovery_ts.h
  • TS_MAX_WIDTH : stm32h735g_discovery_ts.h
  • TS_MIN : stm32h735g_discovery_ts.c
  • TS_SWAP_NONE : stm32h735g_discovery_ts.h
  • TS_SWAP_X : stm32h735g_discovery_ts.h
  • TS_SWAP_XY : stm32h735g_discovery_ts.h
  • TS_SWAP_Y : stm32h735g_discovery_ts.h
  • TS_TOUCH_NBR : stm32h735g_discovery_conf_template.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- u -

  • USE_AUDIO_CODEC_WM8994 : stm32h735g_discovery_conf_template.h
  • USE_BSP_COM_FEATURE : stm32h735g_discovery_conf_template.h
  • USE_BSP_CPU_CACHE_MAINTENANCE : stm32h735g_discovery_conf_template.h
  • USE_BSP_PDM_LIB_FEATURE : stm32h735g_discovery_conf_template.h
  • USE_COM_LOG : stm32h735g_discovery_conf_template.h
  • USE_DMA2D_TO_FILL_RGB_RECT : stm32h735g_discovery_conf_template.h
  • USE_LCD_CTRL_RK043FN48H : stm32h735g_discovery_conf_template.h
  • USE_TS_GESTURE : stm32h735g_discovery_conf_template.h
  • USE_TS_MULTI_TOUCH : stm32h735g_discovery_conf_template.h


STM32H735G-DK BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • i
  • l
  • o
  • p
  • s
  • t
  • u
  • v

- v -

  • VOLUME_IN_CONVERT : stm32h735g_discovery_audio.h
  • VOLUME_OUT_CONVERT : stm32h735g_discovery_audio.h


STM32H735G-DK BSP User Manual: stm32h735g_discovery.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Typedefs | Functions | Variables
stm32h735g_discovery.c File Reference

This file provides a set of firmware functions to manage LEDs push-buttons COM ports available on STM32H735G_DK board(MB1520) from STMicroelectronics. . More...

#include "stm32h735g_discovery.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 STM32H735G_DK BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 selected LED state.
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)
This function handles Push-Button interrupt requests.
__weak void | BSP_PB_Callback (Button_TypeDef Button)
BSP Push Button callback.

Variables

EXTI_HandleTypeDef | hpb_exti [BUTTONn]
STM32H735G_DK_LOW_LEVEL_Exported_Variables
static GPIO_TypeDef * | LED_PORT [LEDn]
static const uint32_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 a set of firmware functions to manage LEDs push-buttons COM ports available on STM32H735G_DK board(MB1520) from STMicroelectronics. .

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery.c.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Enumerations | Functions
stm32h735g_discovery.h File Reference

This file contains definitions for STM32H735G_DK: LEDs push-buttons COM ports hardware resources. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"

Go to the source code of this file.

Defines

#define | STM32H735G_DK_BSP_VERSION_MAIN (uint32_t)(0x01)
Define for STM32H735G_DK board.
#define | STM32H735G_DK_BSP_VERSION_SUB1 (uint32_t)(0x02)
#define | STM32H735G_DK_BSP_VERSION_SUB2 (uint32_t)(0x01)
#define | STM32H735G_DK_BSP_VERSION_RC (uint32_t)(0x00)
#define | STM32H735G_DK_BSP_VERSION
#define | LED1_GPIO_PORT GPIOC
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_3
#define | LED2_GPIO_PORT GPIOC
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | LED2_PIN GPIO_PIN_2
#define | BUTTON_RELEASED 0U
#define | BUTTON_PRESSED 1U
#define | BUTTON_USER_PIN GPIO_PIN_13
User-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 = 0U, LED_GREEN = LED1, LED2 = 1U, LED_RED = LED2,
LEDn
}
enum | Button_TypeDef { BUTTON_USER = 0U, BUTTONn }
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0U, BUTTON_MODE_EXTI = 1U }

Functions

int32_t | BSP_GetVersion (void)
This method returns the STM32H735G_DK BSP Driver revision.
int32_t | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 selected LED state.
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_Callback (Button_TypeDef Button)
BSP Push Button callback.
void | BSP_PB_IRQHandler (Button_TypeDef Button)
This function handles Push-Button interrupt requests.

Variables

EXTI_HandleTypeDef | hpb_exti []
STM32H735G_DK_LOW_LEVEL_Exported_Variables

Detailed Description

This file contains definitions for STM32H735G_DK: LEDs push-buttons COM ports hardware resources.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery.h.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_audio.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Functions | Variables
stm32h735g_discovery_audio.c File Reference

This file provides the Audio driver for the STM32H735G_DISCO board. More...

#include "stm32h735g_discovery_audio.h"
#include "stm32h735g_discovery_bus.h"

Go to the source code of this file.

Defines

#define | DFSDM_OVER_SAMPLING(__FREQUENCY__)
#define | DFSDM_CLOCK_DIVIDER(__FREQUENCY__)
#define | DFSDM_FILTER_ORDER(__FREQUENCY__)
#define | DFSDM_MIC_BIT_SHIFT(__FREQUENCY__)
#define | SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Functions

ALIGN_32BYTES (static int32_t MicRecBuff[2][DEFAULT_AUDIO_IN_BUFFER_SIZE])
static void | SAI_MspInit (SAI_HandleTypeDef *hsai)
Initialize BSP_AUDIO_OUT MSP.
static void | SAI_MspDeInit (SAI_HandleTypeDef *hsai)
Deinitializes SAI MSP.
static void | DFSDM_ChannelMspInit (DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
Initialize the DFSDM channel MSP.
static void | DFSDM_ChannelMspDeInit (DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
DeInitialize the DFSDM channel MSP.
static void | DFSDM_FilterMspInit (DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
Initialize the DFSDM filter MSP.
static void | DFSDM_FilterMspDeInit (DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
DeInitialize the DFSDM filter MSP.
int32_t | BSP_AUDIO_OUT_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Configures the audio peripherals.
int32_t | BSP_AUDIO_OUT_DeInit (uint32_t Instance)
De-initializes the audio out peripheral.
__weak HAL_StatusTypeDef | MX_SAI1_Block_B_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio out instance (SAI).
__weak HAL_StatusTypeDef | MX_SAI1_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
int32_t | BSP_AUDIO_OUT_Play (uint32_t Instance, uint8_t *pData, uint32_t NbrOfBytes)
Starts playing audio stream from a data buffer for a determined size.
int32_t | BSP_AUDIO_OUT_Pause (uint32_t Instance)
This function Pauses the audio file stream.
int32_t | BSP_AUDIO_OUT_Resume (uint32_t Instance)
Resumes the audio file stream.
int32_t | BSP_AUDIO_OUT_Stop (uint32_t Instance)
Stops audio playing and Power down the Audio Codec.
int32_t | BSP_AUDIO_OUT_SetVolume (uint32_t Instance, uint32_t Volume)
Controls the current audio volume level.
int32_t | BSP_AUDIO_OUT_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio volume level.
int32_t | BSP_AUDIO_OUT_Mute (uint32_t Instance)
Enables the MUTE.
int32_t | BSP_AUDIO_OUT_UnMute (uint32_t Instance)
Disables the MUTE mode.
int32_t | BSP_AUDIO_OUT_IsMute (uint32_t Instance, uint32_t *IsMute)
Check whether the MUTE mode is enabled or not.
int32_t | BSP_AUDIO_OUT_SetDevice (uint32_t Instance, uint32_t Device)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
int32_t | BSP_AUDIO_OUT_GetDevice (uint32_t Instance, uint32_t *Device)
Get the Output Device.
int32_t | BSP_AUDIO_OUT_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Updates the audio frequency.
int32_t | BSP_AUDIO_OUT_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get the audio frequency.
int32_t | BSP_AUDIO_OUT_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set the audio Channels number.
int32_t | BSP_AUDIO_OUT_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get the audio Channels number.
int32_t | BSP_AUDIO_OUT_GetState (uint32_t Instance, uint32_t *State)
Get Audio Out state.
void | BSP_AUDIO_OUT_IRQHandler (uint32_t Instance)
This function handles Audio Out DMA interrupt requests.
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance)
Manages the DMA FIFO error event.
int32_t | BSP_AUDIO_IN_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Initialize wave recording.
int32_t | BSP_AUDIO_IN_DeInit (uint32_t Instance)
Deinit the audio IN peripherals.
__weak HAL_StatusTypeDef | MX_DFSDM1_ClockConfig (DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
Clock Config.
__weak HAL_StatusTypeDef | MX_SAI4_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
__weak HAL_StatusTypeDef | MX_DFSDM1_Init (DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
Initializes the Audio instance (DFSDM).
__weak HAL_StatusTypeDef | MX_SAI1_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
__weak HAL_StatusTypeDef | MX_SAI4_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
int32_t | BSP_AUDIO_IN_Record (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t | BSP_AUDIO_IN_Stop (uint32_t Instance)
Stop audio recording.
int32_t | BSP_AUDIO_IN_Pause (uint32_t Instance)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_Resume (uint32_t Instance)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_RecordChannels (uint32_t Instance, uint8_t **pBuf, uint32_t NbrOfBytes)
Starts audio recording.
int32_t | BSP_AUDIO_IN_StopChannels (uint32_t Instance, uint32_t Device)
Stop audio recording.
int32_t | BSP_AUDIO_IN_PauseChannels (uint32_t Instance, uint32_t Device)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_ResumeChannels (uint32_t Instance, uint32_t Device)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_RecordPDM (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t | BSP_AUDIO_IN_SetDevice (uint32_t Instance, uint32_t Device)
Set Audio In device.
int32_t | BSP_AUDIO_IN_GetDevice (uint32_t Instance, uint32_t *Device)
Get Audio In device.
int32_t | BSP_AUDIO_IN_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Set Audio In frequency.
int32_t | BSP_AUDIO_IN_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get Audio In frequency.
int32_t | BSP_AUDIO_IN_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Set Audio In Resolution.
int32_t | BSP_AUDIO_IN_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get Audio In Resolution.
int32_t | BSP_AUDIO_IN_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set Audio In Channel number.
int32_t | BSP_AUDIO_IN_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get Audio In Channel number.
int32_t | BSP_AUDIO_IN_SetVolume (uint32_t Instance, uint32_t Volume)
Set the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetState (uint32_t Instance, uint32_t *State)
Get Audio In device.
void | BSP_AUDIO_IN_IRQHandler (uint32_t Instance, uint32_t InputDevice)
This function handles Audio Out DMA interrupt requests.
void | HAL_DFSDM_FilterRegConvCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
void | HAL_DFSDM_FilterRegConvHalfCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Half reception complete callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Reception complete callback.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (uint32_t Instance)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_Error_CallBack (uint32_t Instance)
Audio IN Error callback function.

Variables

void * | Audio_CompObj = NULL
SAI_HandleTypeDef | haudio_out_sai = {0}
AUDIO_OUT_Ctx_t Audio_Out_Ctx [AUDIO_OUT_INSTANCES_NBR]
DFSDM_Filter_HandleTypeDef | haudio_in_dfsdm_filter [DFSDM_MIC_NUMBER]
DFSDM_Channel_HandleTypeDef | haudio_in_dfsdm_channel [DFSDM_MIC_NUMBER]
SAI_HandleTypeDef | haudio_in_sai [2] = {0}
AUDIO_IN_Ctx_t Audio_In_Ctx [AUDIO_IN_INSTANCES_NBR]
static AUDIO_Drv_t * | Audio_Drv = NULL
static DMA_HandleTypeDef | hDmaDfsdm [DFSDM_MIC_NUMBER]
static __IO uint32_t | RecBuffTrigger = 0
static __IO uint32_t | RecBuffHalf = 0
static __IO uint32_t | MicBuffIndex [DFSDM_MIC_NUMBER]

Detailed Description

This file provides the Audio driver for the STM32H735G_DISCO board.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   + This driver supports stm32h7xx devices on STM32H735G_DISCO (MB1520) boards.
   + Call the function BSP_AUDIO_OUT_Init() for AUDIO OUT initialization:
        Instance:  Select the output instance. It can only be 0 (SAI)
        AudioInit: Audio Out structure to select the following parameters
                   - Device: Select the output device (headphone, speaker, hdmi ..)
                   - SampleRate: Select the output sample rate (8Khz .. 96Khz)
                   - BitsPerSample: Select the output resolution (16 or 32bits per sample)
                   - ChannelsNbr: Select the output channels number(1 for mono, 2 for stereo)
                   - Volume: Select the output volume(0% .. 100%)

      This function configures all the hardware required for the audio application (codec, I2C, I2S ,SAI,
      GPIOs, DMA and interrupt if needed). This function returns BSP_ERROR_NONE if configuration is OK.
      If the returned value is different from BSP_ERROR_NONE or the function is stuck then the communication with
      the codec or the MFX has failed (try to un-plug the power or reset device in this case).

      User can update the I2S/SAI or the clock configurations by overriding the weak MX functions MX_I2S6_Init(),
      MX_I2S6_ClockConfig(),MX_SAI1_Block_B_Init() and  MX_SAI1_ClockConfig()
      User can override the default MSP configuration and register his own MSP callbacks (defined at application level)
      by calling BSP_AUDIO_OUT_RegisterMspCallbacks() function
      User can restore the default MSP configuration by calling BSP_AUDIO_OUT_RegisterDefaultMspCallbacks()
      To use these two functions, user have to enable USE_HAL_I2S_REGISTER_CALLBACKS and USE_HAL_SAI_REGISTER_CALLBACKS
      within stm32h7xx_hal_conf.h file

   + Call the function BSP_AUDIO_OUT_Play() to play audio stream:
        Instance:  Select the output instance. It can only be 0 (SAI)
        pBuf: pointer to the audio data file address
        NbrOfBytes: Total size of the buffer to be sent in Bytes

   + Call the function BSP_AUDIO_OUT_Pause() to pause playing
   + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
       Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
          for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
       Note. This function should be called only when the audio file is played or paused (not stopped).
   + Call the function BSP_AUDIO_OUT_Stop() to stop playing.
   + Call the function BSP_AUDIO_OUT_Mute() to mute the player.
   + Call the function BSP_AUDIO_OUT_UnMute() to unmute the player.
   + Call the function BSP_AUDIO_OUT_IsMute() to get the mute state(BSP_AUDIO_MUTE_ENABLED or BSP_AUDIO_MUTE_DISABLED).
   + Call the function BSP_AUDIO_OUT_SetDevice() to update the AUDIO OUT device.
   + Call the function BSP_AUDIO_OUT_GetDevice() to get the AUDIO OUT device.
   + Call the function BSP_AUDIO_OUT_SetSampleRate() to update the AUDIO OUT sample rate.
   + Call the function BSP_AUDIO_OUT_GetSampleRate() to get the AUDIO OUT sample rate.
   + Call the function BSP_AUDIO_OUT_SetBitsPerSample() to update the AUDIO OUT resolution.
   + Call the function BSP_AUDIO_OUT_GetBitPerSample() to get the AUDIO OUT resolution.
   + Call the function BSP_AUDIO_OUT_SetChannelsNbr() to update the AUDIO OUT number of channels.
   + Call the function BSP_AUDIO_OUT_GetChannelsNbr() to get the AUDIO OUT number of channels.
   + Call the function BSP_AUDIO_OUT_SetVolume() to update the AUDIO OUT volume.
   + Call the function BSP_AUDIO_OUT_GetVolume() to get the AUDIO OUT volume.
   + Call the function BSP_AUDIO_OUT_GetState() to get the AUDIO OUT state.

   + BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_SetBitsPerSample() and
     BSP_AUDIO_OUT_SetChannelsNbr() cannot be called while the state is AUDIO_OUT_STATE_PLAYING.
   + For each mode, you may need to implement the relative callback functions into your code.
      The Callback functions are named AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
      the STM32H735G_DISCO_audio.h file. (refer to the example for more details on the callbacks implementations)

   + Call the function BSP_AUDIO_IN_Init() for AUDIO IN initialization:
          Instance : Select the input instance. Can be 0 (SAI), 1 (I2S) or 2 (DFSDM)
        AudioInit: Audio In structure to select the following parameters
                   - Device: Select the input device (analog, digital micx)
                   - SampleRate: Select the input sample rate (8Khz .. 96Khz)
                   - BitsPerSample: Select the input resolution (16 or 32bits per sample)
                   - ChannelsNbr: Select the input channels number(1 for mono, 2 for stereo)
                   - Volume: Select the input volume(0% .. 100%)

      This function configures all the hardware required for the audio application (codec, I2C, SAI, I2S, DFSDM
      GPIOs, DMA and interrupt if needed). This function returns BSP_ERROR_NONE if configuration is OK.
      If the returned value is different from BSP_ERROR_NONE or the function is stuck then the communication with
      the codec or the MFX has failed (try to un-plug the power or reset device in this case).
      User can update the DFSDM/SAI or the clock configurations by overriding the weak MX functions MX_SAIx_Init(),
      MX_SAIx_ClockConfig(), MX_DFSDMx_Init() and MX_DFSDMx_ClockConfig()
      User can override the default MSP configuration and register his own MSP callbacks (defined at application level)
      by calling BSP_AUDIO_IN_RegisterMspCallbacks() function
      User can restore the default MSP configuration by calling BSP_AUDIO_IN_RegisterDefaultMspCallbacks()
      To use these two functions, user have to enable USE_HAL_SAI_REGISTER_CALLBACKS and/or USE_HAL_DFSDM_REGISTER_CALLBACKS
      within stm32h7xx_hal_conf.h file

   + Call the function BSP_AUDIO_IN_Record() to record audio stream. The recorded data are stored to user buffer in raw
        (L, R, L, R ...)
          Instance : Select the input instance. Can be 0 (SAI), 1 (I2S) or 2 (DFSDM)
        pBuf: pointer to user buffer
        NbrOfBytes: Total size of the buffer to be sent in Bytes

   + Call the function BSP_AUDIO_IN_Pause() to pause recording
   + Call the function BSP_AUDIO_IN_Resume() to resume recording.
   + Call the function BSP_AUDIO_IN_Stop() to stop recording.
   + Call the function BSP_AUDIO_IN_SetDevice() to update the AUDIO IN device.
   + Call the function BSP_AUDIO_IN_GetDevice() to get the AUDIO IN device.
   + Call the function BSP_AUDIO_IN_SetSampleRate() to update the AUDIO IN sample rate.
   + Call the function BSP_AUDIO_IN_GetSampleRate() to get the AUDIO IN sample rate.
   + Call the function BSP_AUDIO_IN_SetBitPerSample() to update the AUDIO IN resolution.
   + Call the function BSP_AUDIO_IN_GetBitPerSample() to get the AUDIO IN resolution.
   + Call the function BSP_AUDIO_IN_SetChannelsNbr() to update the AUDIO IN number of channels.
   + Call the function BSP_AUDIO_IN_GetChannelsNbr() to get the AUDIO IN number of channels.
   + Call the function BSP_AUDIO_IN_SetVolume() to update the AUDIO IN volume.
   + Call the function BSP_AUDIO_IN_GetVolume() to get the AUDIO IN volume.
   + Call the function BSP_AUDIO_IN_GetState() to get the AUDIO IN state.
   + Call the function BSP_AUDIO_IN_RecordChannels() to record audio stream. The recorded data are stored to user buffers separately
        (L, L, ...) (R, R ...). User has to process his data at application level.
        Instance : Select the input instance. Can be 2 (DFSDM)
        pBuf: pointer to user buffers table
        NbrOfBytes: Total size of the buffer to be sent in Bytes
   + Call the function BSP_AUDIO_IN_PauseChannels() to pause recording:
        Instance : Select the input instance. Can be 2 (DFSDM)
        Device: Select the input device (digital micX)
   + Call the function BSP_AUDIO_IN_ResumeChannels() to resume recording.
        Instance : Select the input instance. Can be 2 (DFSDM)
        Device: Select the input device (digital micX)
   + Call the function BSP_AUDIO_IN_StopChannels() to stop recording.
        Instance : Select the input instance. Can be 2 (DFSDM)
        Device: Select the input device (digital micX)
   + For each mode, you may need to implement the relative callback functions into your code.
      The Callback functions are named AUDIO_IN_XXX_CallBack() and only their prototypes are declared in
      the stm32h735g_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)

   + The driver API and the callback functions are at the end of the stm32h735g_discovery_audio.h file.
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_audio.c.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_audio.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Data Structures | Defines | Functions | Variables
stm32h735g_discovery_audio.h File Reference

This file contains the common defines and functions prototypes for the stm32h735g_discovery_audio.c driver. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"
#include "../Components/Common/audio.h"
#include "pdm2pcm_glo.h"

Go to the source code of this file.

Data Structures

struct | BSP_AUDIO_Init_t
struct | AUDIO_IN_Ctx_t
struct | AUDIO_OUT_Ctx_t
struct | MX_SAI_Config
struct | MX_I2S_Config
struct | MX_DFSDM_Config

Defines

#define | AUDIO_I2C_ADDRESS 0x34U
#define | AUDIO_FREQUENCY_192K 192000U
#define | AUDIO_FREQUENCY_176K 176400U
#define | AUDIO_FREQUENCY_96K 96000U
#define | AUDIO_FREQUENCY_88K 88200U
#define | AUDIO_FREQUENCY_48K 48000U
#define | AUDIO_FREQUENCY_44K 44100U
#define | AUDIO_FREQUENCY_32K 32000U
#define | AUDIO_FREQUENCY_22K 22050U
#define | AUDIO_FREQUENCY_16K 16000U
#define | AUDIO_FREQUENCY_11K 11025U
#define | AUDIO_FREQUENCY_8K 8000U
#define | AUDIO_RESOLUTION_8B 8U
#define | AUDIO_RESOLUTION_16B 16U
#define | AUDIO_RESOLUTION_24B 24U
#define | AUDIO_RESOLUTION_32B 32U
#define | AUDIO_OUT_DEVICE_NONE 0U
#define | AUDIO_OUT_DEVICE_SPEAKER 1U
#define | AUDIO_OUT_DEVICE_HEADPHONE 2U
#define | AUDIO_OUT_DEVICE_SPK_HP 3U
#define | AUDIO_OUT_DEVICE_AUTO 4U
#define | AUDIO_OUT_DEVICE_HDMI 5U
#define | BSP_AUDIO_MUTE_DISABLED 0U
#define | BSP_AUDIO_MUTE_ENABLED 1U
#define | AUDIO_OUT_STATE_RESET 0U
#define | AUDIO_OUT_STATE_PLAYING 1U
#define | AUDIO_OUT_STATE_STOP 2U
#define | AUDIO_OUT_STATE_PAUSE 3U
#define | AUDIO_VOLUME_INPUT 0U
#define | AUDIO_VOLUME_OUTPUT 1U
#define | CODEC_PDWN_SW 1U
#define | CODEC_MUTE_ON 1U
#define | CODEC_MUTE_OFF 0U
#define | AUDIO_OUT_INSTANCES_NBR 1U
#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode TDM format : +------------------|------------------|--------------------|-------------------+ | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | +------------------------------------------------------------------------------+.
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_OUT_SAIx SAI1_Block_B
#define | AUDIO_OUT_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_MCLK_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_SCK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SCK_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_8
#define | AUDIO_OUT_SAIx_SCK_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_SD_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SD_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_SD_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_FS_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOF
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_9
#define | AUDIO_OUT_SAIx_FS_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream6
#define | AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_B
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream6_IRQn
#define | AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler
#define | AUDIO_IN_SAIx SAI1_Block_A
#define | AUDIO_IN_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_IN_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_IN_SAIx_AF GPIO_AF6_SAI1
#define | AUDIO_IN_SAIx_SD_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAIx_SD_GPIO_PORT GPIOE
#define | AUDIO_IN_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_IN_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream4
#define | AUDIO_IN_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A
#define | AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream4_IRQn
#define | AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler
#define | AUDIO_IN_SAI_PDMx SAI4_Block_A
#define | AUDIO_IN_SAI_PDMx_CLK_ENABLE() __HAL_RCC_SAI4_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_CLK_DISABLE() __HAL_RCC_SAI4_CLK_DISABLE()
#define | AUDIO_IN_SAI_PDMx_FS_SCK_AF GPIO_AF8_SAI4
#define | AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT GPIOE
#define | AUDIO_IN_SAI_PDMx_FS_PIN GPIO_PIN_4
#define | AUDIO_IN_SAI_PDMx_SCK_PIN GPIO_PIN_5
#define | AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_CLK_IN_PIN GPIO_PIN_2
#define | AUDIO_IN_SAI_PDMx_CLK_IN_PORT GPIOE
#define | AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_DATA_IN_PIN GPIO_PIN_1
#define | AUDIO_IN_SAI_PDMx_DATA_IN_PORT GPIOC
#define | AUDIO_IN_SAI_PDMx_DATA_CLK_AF GPIO_AF10_SAI4
#define | AUDIO_IN_SAI_PDMx_IRQHandler SAI4_IRQHandler
#define | AUDIO_IN_SAI_PDMx_IRQ SAI4_IRQn
#define | AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE() __HAL_RCC_BDMA_CLK_ENABLE()
#define | AUDIO_IN_SAI_PDMx_DMAx_STREAM BDMA_Channel1
#define | AUDIO_IN_SAI_PDMx_DMAx_REQUEST BDMA_REQUEST_SAI4_A
#define | AUDIO_IN_SAI_PDMx_DMAx_IRQ BDMA_Channel1_IRQn
#define | AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_IN_SAI_PDMx_DMAx_IRQHandler BDMA_Channel1_IRQHandler
#define | AUDIO_DFSDMx_MIC1_CHANNEL DFSDM1_Channel2
#define | AUDIO_DFSDMx_MIC2_CHANNEL DFSDM1_Channel1
#define | AUDIO_DFSDMx_MIC3_CHANNEL DFSDM1_Channel6
#define | AUDIO_DFSDMx_MIC4_CHANNEL DFSDM1_Channel5
#define | AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER DFSDM_CHANNEL_2
#define | AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER DFSDM_CHANNEL_1
#define | AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER DFSDM_CHANNEL_6
#define | AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER DFSDM_CHANNEL_5
#define | AUDIO_DFSDMx_MIC1_FILTER DFSDM1_Filter0
#define | AUDIO_DFSDMx_MIC2_FILTER DFSDM1_Filter1
#define | AUDIO_DFSDMx_MIC3_FILTER DFSDM1_Filter2
#define | AUDIO_DFSDMx_MIC4_FILTER DFSDM1_Filter3
#define | AUDIO_DFSDM1_CLK_ENABLE() __HAL_RCC_DFSDM1_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC1_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_DATIN_MIC1_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC2_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_DATIN_MIC2_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC3_PIN GPIO_PIN_13
#define | AUDIO_DFSDMx_DATIN_MIC3_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT GPIOF
#define | AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_DFSDMx_DATIN_MIC4_PIN GPIO_PIN_13
#define | AUDIO_DFSDMx_DATIN_MIC4_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT GPIOF
#define | AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | AUDIO_DFSDM1_CKOUT_PIN GPIO_PIN_9
#define | AUDIO_DFSDM1_CKOUT_AF GPIO_AF3_DFSDM1
#define | AUDIO_DFSDM1_CKOUT_GPIO_PORT GPIOE
#define | AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_DMAx_MIC1_STREAM DMA2_Stream7
#define | AUDIO_DFSDMx_DMAx_MIC1_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT0
#define | AUDIO_DFSDMx_DMAx_MIC1_IRQ DMA2_Stream7_IRQn
#define | AUDIO_DFSDM_DMAx_MIC1_IRQHandler DMA2_Stream7_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC2_STREAM DMA2_Stream0
#define | AUDIO_DFSDMx_DMAx_MIC2_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT1
#define | AUDIO_DFSDMx_DMAx_MIC2_IRQ DMA2_Stream0_IRQn
#define | AUDIO_DFSDM_DMAx_MIC2_IRQHandler DMA2_Stream0_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC3_STREAM DMA2_Stream3
#define | AUDIO_DFSDMx_DMAx_MIC3_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT2
#define | AUDIO_DFSDMx_DMAx_MIC3_IRQ DMA2_Stream3_IRQn
#define | AUDIO_DFSDM_DMAx_MIC3_IRQHandler DMA2_Stream3_IRQHandler
#define | AUDIO_DFSDMx_DMAx_MIC4_STREAM DMA2_Stream2
#define | AUDIO_DFSDMx_DMAx_MIC4_REQUEST (uint32_t)DMA_REQUEST_DFSDM1_FLT3
#define | AUDIO_DFSDMx_DMAx_MIC4_IRQ DMA2_Stream2_IRQn
#define | AUDIO_DFSDM_DMAx_MIC4_IRQHandler DMA2_Stream2_IRQHandler
#define | AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD
#define | AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD
#define | AUDIO_DFSDM1_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_DEVICE_ANALOG_MIC 0x00U
#define | AUDIO_IN_DEVICE_ANALOG_LINE1 0x01U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC1 0x010U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC2 0x020U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC3 0x040U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC4 0x080U
#define | AUDIO_IN_DEVICE_DIGITAL_MIC_LAST AUDIO_IN_DEVICE_DIGITAL_MIC4
#define | AUDIO_IN_DEVICE_DIGITAL_MIC (AUDIO_IN_DEVICE_DIGITAL_MIC1 | AUDIO_IN_DEVICE_DIGITAL_MIC2)
#define | DFSDM_MIC_NUMBER 4U
#define | AUDIO_IN_STATE_RESET 0U
#define | AUDIO_IN_STATE_RECORDING 1U
#define | AUDIO_IN_STATE_STOP 2U
#define | AUDIO_IN_STATE_PAUSE 3U
#define | AUDIO_IN_INSTANCES_NBR 3U
#define | POS_VAL(VAL) (POSITION_VAL(VAL) - 4U)
#define | VOLUME_OUT_CONVERT(Volume) (((Volume) > 100)? 63:((uint8_t)(((Volume) * 63) / 100)))
#define | VOLUME_IN_CONVERT(Volume) (((Volume) >= 100)? 239:((uint8_t)(((Volume) * 239) / 100)))

Functions

int32_t | BSP_AUDIO_OUT_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Configures the audio peripherals.
int32_t | BSP_AUDIO_OUT_DeInit (uint32_t Instance)
De-initializes the audio out peripheral.
int32_t | BSP_AUDIO_OUT_Play (uint32_t Instance, uint8_t *pData, uint32_t NbrOfBytes)
Starts playing audio stream from a data buffer for a determined size.
int32_t | BSP_AUDIO_OUT_Pause (uint32_t Instance)
This function Pauses the audio file stream.
int32_t | BSP_AUDIO_OUT_Resume (uint32_t Instance)
Resumes the audio file stream.
int32_t | BSP_AUDIO_OUT_Stop (uint32_t Instance)
Stops audio playing and Power down the Audio Codec.
int32_t | BSP_AUDIO_OUT_Mute (uint32_t Instance)
Enables the MUTE.
int32_t | BSP_AUDIO_OUT_UnMute (uint32_t Instance)
Disables the MUTE mode.
int32_t | BSP_AUDIO_OUT_IsMute (uint32_t Instance, uint32_t *IsMute)
Check whether the MUTE mode is enabled or not.
int32_t | BSP_AUDIO_OUT_SetDevice (uint32_t Instance, uint32_t Device)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
int32_t | BSP_AUDIO_OUT_GetDevice (uint32_t Instance, uint32_t *Device)
Get the Output Device.
int32_t | BSP_AUDIO_OUT_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Updates the audio frequency.
int32_t | BSP_AUDIO_OUT_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get the audio frequency.
int32_t | BSP_AUDIO_OUT_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get the audio Resolution.
int32_t | BSP_AUDIO_OUT_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set the audio Channels number.
int32_t | BSP_AUDIO_OUT_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get the audio Channels number.
int32_t | BSP_AUDIO_OUT_SetVolume (uint32_t Instance, uint32_t Volume)
Controls the current audio volume level.
int32_t | BSP_AUDIO_OUT_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio volume level.
int32_t | BSP_AUDIO_OUT_GetState (uint32_t Instance, uint32_t *State)
Get Audio Out state.
void | BSP_AUDIO_OUT_IRQHandler (uint32_t Instance)
This function handles Audio Out DMA interrupt requests.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance)
Manages the DMA FIFO error event.
__weak HAL_StatusTypeDef | MX_SAI1_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
HAL_StatusTypeDef | MX_SAI1_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
HAL_StatusTypeDef | MX_I2S6_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t SampleRate)
HAL_StatusTypeDef | MX_I2S6_Init (I2S_HandleTypeDef *hi2s, MX_I2S_Config *MXConfig)
int32_t | BSP_AUDIO_IN_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Initialize wave recording.
int32_t | BSP_AUDIO_IN_DeInit (uint32_t Instance)
Deinit the audio IN peripherals.
int32_t | BSP_AUDIO_IN_Record (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t | BSP_AUDIO_IN_Stop (uint32_t Instance)
Stop audio recording.
int32_t | BSP_AUDIO_IN_Pause (uint32_t Instance)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_Resume (uint32_t Instance)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_RecordChannels (uint32_t Instance, uint8_t **pBuf, uint32_t NbrOfBytes)
Starts audio recording.
int32_t | BSP_AUDIO_IN_StopChannels (uint32_t Instance, uint32_t Device)
Stop audio recording.
int32_t | BSP_AUDIO_IN_PauseChannels (uint32_t Instance, uint32_t Device)
Pause the audio file stream.
int32_t | BSP_AUDIO_IN_ResumeChannels (uint32_t Instance, uint32_t Device)
Resume the audio file stream.
int32_t | BSP_AUDIO_IN_SetDevice (uint32_t Instance, uint32_t Device)
Set Audio In device.
int32_t | BSP_AUDIO_IN_GetDevice (uint32_t Instance, uint32_t *Device)
Get Audio In device.
int32_t | BSP_AUDIO_IN_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
Set Audio In frequency.
int32_t | BSP_AUDIO_IN_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
Get Audio In frequency.
int32_t | BSP_AUDIO_IN_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
Set Audio In Resolution.
int32_t | BSP_AUDIO_IN_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
Get Audio In Resolution.
int32_t | BSP_AUDIO_IN_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
Set Audio In Channel number.
int32_t | BSP_AUDIO_IN_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
Get Audio In Channel number.
int32_t | BSP_AUDIO_IN_SetVolume (uint32_t Instance, uint32_t Volume)
Set the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetVolume (uint32_t Instance, uint32_t *Volume)
Get the current audio in volume level.
int32_t | BSP_AUDIO_IN_GetState (uint32_t Instance, uint32_t *State)
Get Audio In device.
void | BSP_AUDIO_IN_IRQHandler (uint32_t Instance, uint32_t InputDevice)
This function handles Audio Out DMA interrupt requests.
int32_t | BSP_AUDIO_IN_RecordPDM (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (uint32_t Instance)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (uint32_t Instance)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_Error_CallBack (uint32_t Instance)
Audio IN Error callback function.
__weak HAL_StatusTypeDef | MX_DFSDM1_ClockConfig (DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
Clock Config.
__weak HAL_StatusTypeDef | MX_DFSDM1_Init (DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
Initializes the Audio instance (DFSDM).
HAL_StatusTypeDef | MX_DFSDM2_ClockConfig (DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
HAL_StatusTypeDef | MX_DFSDM2_Init (DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
HAL_StatusTypeDef | MX_SAI1_Block_B_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio out instance (SAI).
__weak HAL_StatusTypeDef | MX_SAI4_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
__weak HAL_StatusTypeDef | MX_SAI4_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config *MXConfig)
Initializes the Audio Codec audio in instance (SAI).

Variables

void * | AudioCompObj
SAI_HandleTypeDef | haudio_out_sai
AUDIO_OUT_Ctx_t Audio_Out_Ctx []
DFSDM_Filter_HandleTypeDef | haudio_in_dfsdm_filter []
DFSDM_Channel_HandleTypeDef | haudio_in_dfsdm_channel []
SAI_HandleTypeDef | haudio_in_sai []
AUDIO_IN_Ctx_t Audio_In_Ctx []

Detailed Description

This file contains the common defines and functions prototypes for the stm32h735g_discovery_audio.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_audio.h.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_bus.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Data Structures | Defines | Functions | Variables
stm32h735g_discovery_bus.c File Reference

This file provides a set of firmware functions to communicate with external devices available on STM32H735G-DK board (MB1520) from STMicroelectronics. More...

#include "stm32h735g_discovery_bus.h"
#include "stm32h735g_discovery_errno.h"

Go to the source code of this file.

Data Structures

struct | I2C_Charac_t
struct | I2C_Timings_t

Defines

#define | DIV_ROUND_CLOSEST(x, d) (((x) + ((d) / 2U)) / (d))
#define | I2C_VALID_TIMING_NBR 128U
#define | I2C_SPEED_FREQ_STANDARD 0U /* 100 kHz */
#define | I2C_SPEED_FREQ_FAST 1U /* 400 kHz */
#define | I2C_SPEED_FREQ_FAST_PLUS 2U /* 1 MHz */
#define | I2C_ANALOG_FILTER_DELAY_MIN 50U /* ns */
#define | I2C_ANALOG_FILTER_DELAY_MAX 260U /* ns */
#define | I2C_USE_ANALOG_FILTER 1U
#define | I2C_DIGITAL_FILTER_COEF 0U
#define | I2C_PRESC_MAX 16U
#define | I2C_SCLDEL_MAX 16U
#define | I2C_SDADEL_MAX 16U
#define | I2C_SCLH_MAX 256U
#define | I2C_SCLL_MAX 256U
#define | SEC2NSEC 1000000000UL

Functions

static void | I2C4_MspInit (I2C_HandleTypeDef *phi2c)
Initializes I2C MSP.
static void | I2C4_MspDeInit (I2C_HandleTypeDef *phi2c)
DeInitializes I2C MSP.
static int32_t | I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
Write a value in a register of the device through BUS.
static int32_t | I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
Read a register of the device through BUS.
static uint32_t | I2C_GetTiming (uint32_t clock_src_freq, uint32_t i2c_freq)
Compute I2C timing according current I2C clock source and required I2C clock.
static uint32_t | I2C_Compute_SCLL_SCLH (uint32_t clock_src_freq, uint32_t I2C_speed)
Calculate SCLL and SCLH and find best configuration.
static void | I2C_Compute_PRESC_SCLDEL_SDADEL (uint32_t clock_src_freq, uint32_t I2C_speed)
Compute PRESC, SCLDEL and SDADEL.
int32_t | BSP_I2C4_Init (void)
Initializes I2C HAL.
int32_t | BSP_I2C4_DeInit (void)
DeInitializes I2C HAL.
__weak HAL_StatusTypeDef | MX_I2C4_Init (I2C_HandleTypeDef *hI2c, uint32_t timing)
MX I2C4 initialization.
int32_t | BSP_I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 8bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 8bit register of the device through BUS.
int32_t | BSP_I2C4_WriteReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
int32_t | BSP_I2C4_IsReady (uint16_t DevAddr, uint32_t Trials)
Checks if target device is ready for communication.
int32_t | BSP_GetTick (void)
Delay function.

Variables

static const I2C_Charac_t | I2C_Charac []
I2C_HandleTypeDef | hbus_i2c4
static uint32_t | I2c4InitCounter = 0
static I2C_Timings_t | I2c_valid_timing [I2C_VALID_TIMING_NBR]
static uint32_t | I2c_valid_timing_nbr = 0

Detailed Description

This file provides a set of firmware functions to communicate with external devices available on STM32H735G-DK board (MB1520) from STMicroelectronics.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_bus.c.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_bus.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Functions | Variables
stm32h735g_discovery_bus.h File Reference

This file contains definitions for STM32H735G_DK LEDs, push-buttons hardware resources. More...

#include "stm32h735g_discovery_conf.h"

Go to the source code of this file.

Defines

#define | BUS_I2C4 I2C4
#define | BUS_I2C4_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
#define | BUS_I2C4_CLK_DISABLE() __HAL_RCC_I2C4_CLK_DISABLE()
#define | BUS_I2C4_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | BUS_I2C4_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | BUS_I2C4_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | BUS_I2C4_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | BUS_I2C4_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
#define | BUS_I2C4_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
#define | BUS_I2C4_SCL_PIN GPIO_PIN_14
#define | BUS_I2C4_SDA_PIN GPIO_PIN_15
#define | BUS_I2C4_SCL_GPIO_PORT GPIOF
#define | BUS_I2C4_SDA_GPIO_PORT GPIOF
#define | BUS_I2C4_SCL_AF GPIO_AF4_I2C4
#define | BUS_I2C4_SDA_AF GPIO_AF4_I2C4

Functions

int32_t | BSP_I2C4_Init (void)
Initializes I2C HAL.
int32_t | BSP_I2C4_DeInit (void)
DeInitializes I2C HAL.
int32_t | BSP_I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 8bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 8bit register of the device through BUS.
int32_t | BSP_I2C4_WriteReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
int32_t | BSP_I2C4_ReadReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
int32_t | BSP_I2C4_Recv (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
int32_t | BSP_I2C4_Send (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
int32_t | BSP_I2C4_IsReady (uint16_t DevAddr, uint32_t Trials)
Checks if target device is ready for communication.
int32_t | BSP_GetTick (void)
Delay function.
HAL_StatusTypeDef | MX_I2C4_Init (I2C_HandleTypeDef *phi2c, uint32_t timing)
MX I2C4 initialization.

Variables

I2C_HandleTypeDef | hbus_i2c4

Detailed Description

This file contains definitions for STM32H735G_DK LEDs, push-buttons hardware resources.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_bus.h.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_lcd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Functions | Variables
stm32h735g_discovery_lcd.c File Reference

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H735G_DISCO board. More...

#include "stm32h735g_discovery_lcd.h"
#include "stm32h735g_discovery_bus.h"
#include "stm32h735g_discovery_ts.h"
#include "stm32h735g_discovery_ospi.h"

Go to the source code of this file.

Defines

#define | CONVERTRGB5652ARGB8888(Color)

Functions

static void | LTDC_MspInit (LTDC_HandleTypeDef *hltdc)
Initialize the BSP LTDC Msp.
static void | LTDC_MspDeInit (LTDC_HandleTypeDef *hltdc)
De-Initializes the BSP LTDC Msp.
static void | DMA2D_MspInit (DMA2D_HandleTypeDef *hdma2d)
Initialize the BSP DMA2D Msp.
static void | DMA2D_MspDeInit (DMA2D_HandleTypeDef *hdma2d)
De-Initializes the BSP DMA2D Msp.
static void | LL_FillBuffer (uint32_t Instance, uint32_t LayerIndex, uint32_t *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t Color)
Fills a buffer.
static void | LL_ConvertLineToRGB (uint32_t Instance, uint32_t *pSrc, uint32_t *pDst, uint32_t xSize, uint32_t ColorMode)
Converts a line to an RGB pixel format.
int32_t | BSP_LCD_Init (uint32_t Instance, uint32_t Orientation)
Initializes the LCD in default mode.
int32_t | BSP_LCD_InitEx (uint32_t Instance, uint32_t Orientation, uint32_t PixelFormat, uint32_t Width, uint32_t Height)
Initializes the LCD.
int32_t | BSP_LCD_DeInit (uint32_t Instance)
De-Initializes the LCD resources.
__weak HAL_StatusTypeDef | MX_LTDC_Init (LTDC_HandleTypeDef *hltdc, uint32_t Width, uint32_t Height)
Initializes the LTDC.
__weak HAL_StatusTypeDef | MX_LTDC_ConfigLayer (LTDC_HandleTypeDef *hltdc, uint32_t LayerIndex, MX_LTDC_LayerConfig_t *Config)
MX LTDC layer configuration.
__weak HAL_StatusTypeDef | MX_LTDC_ClockConfig (LTDC_HandleTypeDef *hltdc)
LTDC Clock Config for LCD DPI display.
int32_t | BSP_LCD_ConfigLayer (uint32_t Instance, uint32_t LayerIndex, BSP_LCD_LayerConfig_t *Config)
LTDC layer configuration.
int32_t | BSP_LCD_GetPixelFormat (uint32_t Instance, uint32_t *PixelFormat)
Gets the LCD Active LCD Pixel Format.
int32_t | BSP_LCD_SetActiveLayer (uint32_t Instance, uint32_t LayerIndex)
Set the LCD Active Layer.
int32_t | BSP_LCD_Relaod (uint32_t Instance, uint32_t ReloadType)
Control the LTDC reload.
int32_t | BSP_LCD_SetLayerVisible (uint32_t Instance, uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
int32_t | BSP_LCD_SetTransparency (uint32_t Instance, uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
int32_t | BSP_LCD_SetLayerAddress (uint32_t Instance, uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
int32_t | BSP_LCD_SetLayerWindow (uint32_t Instance, uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
int32_t | BSP_LCD_SetColorKeying (uint32_t Instance, uint32_t LayerIndex, uint32_t Color)
Configures and sets the color keying.
int32_t | BSP_LCD_ResetColorKeying (uint32_t Instance, uint32_t LayerIndex)
Disables the color keying.
int32_t | BSP_LCD_GetXSize (uint32_t Instance, uint32_t *XSize)
Gets the LCD X size.
int32_t | BSP_LCD_GetYSize (uint32_t Instance, uint32_t *YSize)
Gets the LCD Y size.
int32_t | BSP_LCD_DisplayOn (uint32_t Instance)
Switch On the display.
int32_t | BSP_LCD_DisplayOff (uint32_t Instance)
Switch Off the display.
int32_t | BSP_LCD_SetBrightness (uint32_t Instance, uint32_t Brightness)
Set the brightness value.
int32_t | BSP_LCD_GetBrightness (uint32_t Instance, uint32_t *Brightness)
Set the brightness value.
int32_t | BSP_LCD_DrawBitmap (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
Draws a bitmap picture loaded in the internal Flash in currently active layer.
int32_t | BSP_LCD_FillRGBRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
Draw a horizontal line on LCD.
int32_t | BSP_LCD_DrawHLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws an horizontal line in currently active layer.
int32_t | BSP_LCD_DrawVLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws a vertical line in currently active layer.
int32_t | BSP_LCD_FillRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
Draws a full rectangle in currently active layer.
int32_t | BSP_LCD_ReadPixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
Reads an LCD pixel.
int32_t | BSP_LCD_WritePixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
Draws a pixel on LCD.

Variables

static uint32_t | PixelFormatFactor
const LCD_UTILS_Drv_t | LCD_Driver
DMA2D_HandleTypeDef | hlcd_dma2d
LTDC_HandleTypeDef | hlcd_ltdc
BSP_LCD_Ctx_t Lcd_Ctx [LCD_INSTANCES_NBR]

Detailed Description

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H735G_DISCO board.

Author:
MCD Application Team
  How To use this driver:
  --------------------------
   - This driver is used to drive directly a LCD TFT using the LTDC controller.
   - This driver uses the adequate timing and setting for the RK043FN48H LCD component

  Driver description:
  ---------------------
   + Initialization steps:
     o Initialize the LCD in default mode using the BSP_LCD_Init() function with the
       following settings:
        - Pixelformat : LCD_PIXEL_FORMAT_RGB888
        - Orientation : LCD_ORIENTATION_LANDSCAPE.
        - Width       : LCD_DEFAULT_WIDTH (480)
        - Height      : LCD_DEFAULT_HEIGHT(272)
       The default LTDC layer configured is layer 0.
       BSP_LCD_Init() includes LTDC, LTDC Layer and clock configurations by calling:
        - MX_LTDC_ClockConfig()
        - MX_LTDC_Init()
        - MX_LTDC_ConfigLayer()

     o Initialize the LCD with required parameters using the BSP_LCD_InitEx() function.

     o Select the LCD layer to be activated using the BSP_LCD_SetActiveLayer() function.
     o Enable the LCD display using the BSP_LCD_DisplayOn() function.
     o Disable the LCD display using the BSP_LCD_DisplayOff() function.
     o Set the display brightness using the BSP_LCD_SetBrightness() function.
     o Get the display brightness using the BSP_LCD_GetBrightness() function.
     o Write a pixel to the LCD memory using the BSP_LCD_WritePixel() function.
     o Read a pixel from the LCD memory using the BSP_LCD_ReadPixel() function.
     o Draw an horizontal line using the BSP_LCD_DrawHLine() function.
     o Draw a vertical line using the BSP_LCD_DrawVLine() function.
     o Draw a bitmap image using the BSP_LCD_DrawBitmap() function.

   + Options
     o Configure the LTDC reload mode by calling BSP_LCD_Relaod(). By default, the
       reload mode is set to BSP_LCD_RELOAD_IMMEDIATE then LTDC is reloaded immediately.
       To control the reload mode:
         - Call BSP_LCD_Relaod() with ReloadType parameter set to BSP_LCD_RELOAD_NONE
         - Configure LTDC (color keying, transparency ..)
         - Call BSP_LCD_Relaod() with ReloadType parameter set to BSP_LCD_RELOAD_IMMEDIATE
           for immediate reload or BSP_LCD_RELOAD_VERTICAL_BLANKING for LTDC reload
           in the next vertical blanking
     o Configure LTDC layers using BSP_LCD_ConfigLayer()
     o Control layer visibility using BSP_LCD_SetLayerVisible()
     o Configure and enable the color keying functionality using the
       BSP_LCD_SetColorKeying() function.
     o Disable the color keying functionality using the BSP_LCD_ResetColorKeying() function.
     o Modify on the fly the transparency and/or the frame buffer address
       using the following functions:
       - BSP_LCD_SetTransparency()
       - BSP_LCD_SetLayerAddress()

   + Display on LCD
     o To draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
       on LCD and display text, utility basic_gui.c/.h must be called. Once the LCD is initialized,
       user should call GUI_SetFuncDriver() API to link board LCD drivers to BASIC GUI LCD drivers.
       The basic gui services, defined in basic_gui utility, are ready for use.

  Note:
  --------
    Regarding the "Instance" parameter, needed for all functions, it is used to select
    an LCD instance. On the STM32F769I_EVAL board, there's one instance. Then, this
    parameter should be 0.
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_lcd.c.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_lcd.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Data Structures | Defines | Typedefs | Functions | Variables
stm32h735g_discovery_lcd.h File Reference

This file contains the common defines and functions prototypes for the stm32h735g_discovery_lcd.c driver. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"
#include "lcd.h"

Go to the source code of this file.

Data Structures

struct | BSP_LCD_Ctx_t
struct | MX_LTDC_LayerConfig_t

Defines

#define | LCD_INSTANCES_NBR 1U
#define | LCD_ORIENTATION_LANDSCAPE 0x01U /* Landscape orientation choice of LCD screen */
#define | LCD_DEFAULT_WIDTH 480U
#define | LCD_DEFAULT_HEIGHT 272U
#define | BSP_LCD_RELOAD_NONE 0U /* No reload executed */
#define | BSP_LCD_RELOAD_IMMEDIATE LTDC_RELOAD_IMMEDIATE /* Immediate Reload */
#define | BSP_LCD_RELOAD_VERTICAL_BLANKING LTDC_RELOAD_VERTICAL_BLANKING /* Vertical Blanking Reload */
#define | LCD_DISP_CTRL_PIN GPIO_PIN_10
LCD special pins.
#define | LCD_DISP_CTRL_PULL GPIO_NOPULL
#define | LCD_DISP_CTRL_GPIO_PORT GPIOD
#define | LCD_DISP_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LCD_DISP_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LCD_DISP_EN_PIN GPIO_PIN_13
#define | LCD_DISP_EN_PULL GPIO_NOPULL
#define | LCD_DISP_EN_GPIO_PORT GPIOE
#define | LCD_DISP_EN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | LCD_DISP_EN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_15
#define | LCD_BL_CTRL_GPIO_PORT GPIOG
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | LCD_COLOR_RGB565_BLUE 0x001FU
#define | LCD_COLOR_RGB565_GREEN 0x07E0U
#define | LCD_COLOR_RGB565_RED 0xF800U
#define | LCD_COLOR_RGB565_CYAN 0x07FFU
#define | LCD_COLOR_RGB565_MAGENTA 0xF81FU
#define | LCD_COLOR_RGB565_YELLOW 0xFFE0U
#define | LCD_COLOR_RGB565_LIGHTBLUE 0x841FU
#define | LCD_COLOR_RGB565_LIGHTGREEN 0x87F0U
#define | LCD_COLOR_RGB565_LIGHTRED 0xFC10U
#define | LCD_COLOR_RGB565_LIGHTCYAN 0x87FFU
#define | LCD_COLOR_RGB565_LIGHTMAGENTA 0xFC1FU
#define | LCD_COLOR_RGB565_LIGHTYELLOW 0xFFF0U
#define | LCD_COLOR_RGB565_DARKBLUE 0x0010U
#define | LCD_COLOR_RGB565_DARKGREEN 0x0400U
#define | LCD_COLOR_RGB565_DARKRED 0x8000U
#define | LCD_COLOR_RGB565_DARKCYAN 0x0410U
#define | LCD_COLOR_RGB565_DARKMAGENTA 0x8010U
#define | LCD_COLOR_RGB565_DARKYELLOW 0x8400U
#define | LCD_COLOR_RGB565_WHITE 0xFFFFU
#define | LCD_COLOR_RGB565_LIGHTGRAY 0xD69AU
#define | LCD_COLOR_RGB565_GRAY 0x8410U
#define | LCD_COLOR_RGB565_DARKGRAY 0x4208U
#define | LCD_COLOR_RGB565_BLACK 0x0000U
#define | LCD_COLOR_RGB565_BROWN 0xA145U
#define | LCD_COLOR_RGB565_ORANGE 0xFD20U
#define | LCD_COLOR_RGB565_ST_BLUE_DARK 0x0001U
#define | LCD_COLOR_RGB565_ST_BLUE 0x01EBU
#define | LCD_COLOR_RGB565_ST_BLUE_LIGHT 0x06A7U
#define | LCD_COLOR_RGB565_ST_GREEN_LIGHT 0x05ECU
#define | LCD_COLOR_RGB565_ST_GREEN_DARK 0x001CU
#define | LCD_COLOR_RGB565_ST_YELLOW 0x07F0U
#define | LCD_COLOR_RGB565_ST_BROWN 0x02C8U
#define | LCD_COLOR_RGB565_ST_PINK 0x0681U
#define | LCD_COLOR_RGB565_ST_PURPLE 0x02CDU
#define | LCD_COLOR_RGB565_ST_GRAY_DARK 0x0251U
#define | LCD_COLOR_RGB565_ST_GRAY 0x04BAU
#define | LCD_COLOR_RGB565_ST_GRAY_LIGHT 0x05E7U
#define | LCD_COLOR_ARGB8888_BLUE 0xFF0000FFUL
#define | LCD_COLOR_ARGB8888_GREEN 0xFF00FF00UL
#define | LCD_COLOR_ARGB8888_RED 0xFFFF0000UL
#define | LCD_COLOR_ARGB8888_CYAN 0xFF00FFFFUL
#define | LCD_COLOR_ARGB8888_MAGENTA 0xFFFF00FFUL
#define | LCD_COLOR_ARGB8888_YELLOW 0xFFFFFF00UL
#define | LCD_COLOR_ARGB8888_LIGHTBLUE 0xFF8080FFUL
#define | LCD_COLOR_ARGB8888_LIGHTGREEN 0xFF80FF80UL
#define | LCD_COLOR_ARGB8888_LIGHTRED 0xFFFF8080UL
#define | LCD_COLOR_ARGB8888_LIGHTCYAN 0xFF80FFFFUL
#define | LCD_COLOR_ARGB8888_LIGHTMAGENTA 0xFFFF80FFUL
#define | LCD_COLOR_ARGB8888_LIGHTYELLOW 0xFFFFFF80UL
#define | LCD_COLOR_ARGB8888_DARKBLUE 0xFF000080UL
#define | LCD_COLOR_ARGB8888_DARKGREEN 0xFF008000UL
#define | LCD_COLOR_ARGB8888_DARKRED 0xFF800000UL
#define | LCD_COLOR_ARGB8888_DARKCYAN 0xFF008080UL
#define | LCD_COLOR_ARGB8888_DARKMAGENTA 0xFF800080UL
#define | LCD_COLOR_ARGB8888_DARKYELLOW 0xFF808000UL
#define | LCD_COLOR_ARGB8888_WHITE 0xFFFFFFFFUL
#define | LCD_COLOR_ARGB8888_LIGHTGRAY 0xFFD3D3D3UL
#define | LCD_COLOR_ARGB8888_GRAY 0xFF808080UL
#define | LCD_COLOR_ARGB8888_DARKGRAY 0xFF404040UL
#define | LCD_COLOR_ARGB8888_BLACK 0xFF000000UL
#define | LCD_COLOR_ARGB8888_BROWN 0xFFA52A2AUL
#define | LCD_COLOR_ARGB8888_ORANGE 0xFFFFA500UL
#define | LCD_COLOR_ARGB8888_ST_BLUE_DARK 0xFF002052UL
#define | LCD_COLOR_ARGB8888_ST_BLUE 0xFF39A9DCUL
#define | LCD_COLOR_ARGB8888_ST_BLUE_LIGHT 0xFFD1E4F3UL
#define | LCD_COLOR_ARGB8888_ST_GREEN_LIGHT 0xFFBBCC01UL
#define | LCD_COLOR_ARGB8888_ST_GREEN_DARK 0xFF003D14UL
#define | LCD_COLOR_ARGB8888_ST_YELLOW 0xFFFFD300UL
#define | LCD_COLOR_ARGB8888_ST_BROWN 0xFF5C0915UL
#define | LCD_COLOR_ARGB8888_ST_PINK 0xFFD4007AUL
#define | LCD_COLOR_ARGB8888_ST_PURPLE 0xFF590D58UL
#define | LCD_COLOR_ARGB8888_ST_GRAY_DARK 0xFF4F5251UL
#define | LCD_COLOR_ARGB8888_ST_GRAY 0xFF90989EUL
#define | LCD_COLOR_ARGB8888_ST_GRAY_LIGHT 0xFFB9C4CAUL
#define | BSP_LCD_LayerConfig_t MX_LTDC_LayerConfig_t
#define | LCD_ORIENTATION_PORTRAIT 0x00U /* Portrait orientation choice of LCD screen */

Typedefs

typedef uint32_t(* | ConvertColor_Func )(uint32_t)

Functions

int32_t | BSP_LCD_Init (uint32_t Instance, uint32_t Orientation)
Initializes the LCD in default mode.
int32_t | BSP_LCD_InitEx (uint32_t Instance, uint32_t Orientation, uint32_t PixelFormat, uint32_t Width, uint32_t Height)
Initializes the LCD.
int32_t | BSP_LCD_DeInit (uint32_t Instance)
De-Initializes the LCD resources.
int32_t | BSP_LCD_Relaod (uint32_t Instance, uint32_t ReloadType)
Control the LTDC reload.
int32_t | BSP_LCD_ConfigLayer (uint32_t Instance, uint32_t LayerIndex, BSP_LCD_LayerConfig_t *Config)
LTDC layer configuration.
int32_t | BSP_LCD_SetLayerVisible (uint32_t Instance, uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
int32_t | BSP_LCD_SetTransparency (uint32_t Instance, uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
int32_t | BSP_LCD_SetLayerAddress (uint32_t Instance, uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
int32_t | BSP_LCD_SetLayerWindow (uint32_t Instance, uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
int32_t | BSP_LCD_SetColorKeying (uint32_t Instance, uint32_t LayerIndex, uint32_t Color)
Configures and sets the color keying.
int32_t | BSP_LCD_ResetColorKeying (uint32_t Instance, uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_Reset (uint32_t Instance)
int32_t | BSP_LCD_DisplayOn (uint32_t Instance)
Switch On the display.
int32_t | BSP_LCD_DisplayOff (uint32_t Instance)
Switch Off the display.
int32_t | BSP_LCD_SetBrightness (uint32_t Instance, uint32_t Brightness)
Set the brightness value.
int32_t | BSP_LCD_GetBrightness (uint32_t Instance, uint32_t *Brightness)
Set the brightness value.
int32_t | BSP_LCD_GetXSize (uint32_t Instance, uint32_t *XSize)
Gets the LCD X size.
int32_t | BSP_LCD_GetYSize (uint32_t Instance, uint32_t *YSize)
Gets the LCD Y size.
int32_t | BSP_LCD_SetActiveLayer (uint32_t Instance, uint32_t LayerIndex)
Set the LCD Active Layer.
int32_t | BSP_LCD_GetPixelFormat (uint32_t Instance, uint32_t *PixelFormat)
Gets the LCD Active LCD Pixel Format.
int32_t | BSP_LCD_DrawBitmap (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
Draws a bitmap picture loaded in the internal Flash in currently active layer.
int32_t | BSP_LCD_DrawHLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws an horizontal line in currently active layer.
int32_t | BSP_LCD_DrawVLine (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draws a vertical line in currently active layer.
int32_t | BSP_LCD_FillRGBRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
Draw a horizontal line on LCD.
int32_t | BSP_LCD_FillRect (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
Draws a full rectangle in currently active layer.
int32_t | BSP_LCD_ReadPixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
Reads an LCD pixel.
int32_t | BSP_LCD_WritePixel (uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
Draws a pixel on LCD.
__weak HAL_StatusTypeDef | MX_LTDC_ConfigLayer (LTDC_HandleTypeDef *hltdc, uint32_t LayerIndex, MX_LTDC_LayerConfig_t *Config)
MX LTDC layer configuration.
__weak HAL_StatusTypeDef | MX_LTDC_ClockConfig (LTDC_HandleTypeDef *hltdc)
LTDC Clock Config for LCD DPI display.
__weak HAL_StatusTypeDef | MX_LTDC_Init (LTDC_HandleTypeDef *hltdc, uint32_t Width, uint32_t Height)
Initializes the LTDC.
HAL_StatusTypeDef | MX_LTDC_ClockConfig2 (LTDC_HandleTypeDef *hltdc)

Variables

const LCD_UTILS_Drv_t | LCD_Driver
DMA2D_HandleTypeDef | hlcd_dma2d
LTDC_HandleTypeDef | hlcd_ltdc
BSP_LCD_Ctx_t LcdCtx []

Detailed Description

This file contains the common defines and functions prototypes for the stm32h735g_discovery_lcd.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_lcd.h.

Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ospi.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Functions | Variables
stm32h735g_discovery_ospi.c File Reference
#include "stm32h735g_discovery_ospi.h"

Go to the source code of this file.

Functions

static void | OSPI_NOR_MspInit (OSPI_HandleTypeDef *hospi)
Initializes the OSPI MSP.
static void | OSPI_NOR_MspDeInit (OSPI_HandleTypeDef *hospi)
De-Initializes the OSPI MSP.
static int32_t | OSPI_NOR_ResetMemory (uint32_t Instance)
This function reset the OSPI memory.
static int32_t | OSPI_NOR_EnterDOPIMode (uint32_t Instance)
This function enables the octal DTR mode of the memory.
static int32_t | OSPI_NOR_EnterSOPIMode (uint32_t Instance)
This function enables the octal STR mode of the memory.
static int32_t | OSPI_NOR_ExitOPIMode (uint32_t Instance)
This function disables the octal DTR or STR mode of the memory.
static void | OSPI_RAM_MspInit (OSPI_HandleTypeDef *hospi)
Initializes the OSPI MSP.
static void | OSPI_RAM_MspDeInit (OSPI_HandleTypeDef *hospi)
De-Initializes the OSPI MSP.
int32_t | BSP_OSPI_NOR_Init (uint32_t Instance, BSP_OSPI_NOR_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
__weak HAL_StatusTypeDef | MX_OSPI_NOR_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Config)
Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the OSPI memory.
int32_t | BSP_OSPI_NOR_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Block (uint32_t Instance, uint32_t BlockAddress, BSP_OSPI_NOR_Erase_t BlockSize)
Erases the specified block of the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Chip (uint32_t Instance)
Erases the entire OSPI memory.
int32_t | BSP_OSPI_NOR_GetStatus (uint32_t Instance)
Reads current status of the OSPI memory.
int32_t | BSP_OSPI_NOR_GetInfo (uint32_t Instance, BSP_OSPI_NOR_Info_t *pInfo)
Return the configuration of the OSPI memory.
int32_t | BSP_OSPI_NOR_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_NOR_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_NOR_ReadID (uint32_t Instance, uint8_t *Id)
Get flash ID 3 Bytes: Manufacturer ID, Memory type, Memory density.
int32_t | BSP_OSPI_NOR_ConfigFlash (uint32_t Instance, BSP_OSPI_NOR_Interface_t Mode, BSP_OSPI_NOR_Transfer_t Rate)
Set Flash to desired Interface mode.
int32_t | BSP_OSPI_NOR_SuspendErase (uint32_t Instance)
This function suspends an ongoing erase command.
int32_t | BSP_OSPI_NOR_ResumeErase (uint32_t Instance)
This function resumes a paused erase command.
int32_t | BSP_OSPI_RAM_Init (uint32_t Instance, BSP_OSPI_RAM_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
__weak HAL_StatusTypeDef | MX_OSPI_ClockConfig (OSPI_HandleTypeDef *hospi)
OSPI Clock Config for OSPI Memories .
__weak HAL_StatusTypeDef | MX_OSPI_RAM_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Read_DMA (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Write_DMA (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_RAM_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_RAM_ConfigHyperRAM (uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength)
Set HyperRAM to desired configuration.
void | BSP_OSPI_RAM_DMA_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM DMA transfer interrupt request.
void | BSP_OSPI_RAM_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM interrupt request.

Variables

OSPI_HandleTypeDef | hospi_nor [OSPI_NOR_INSTANCES_NUMBER] = {0}
OSPI_NOR_Ctx_t Ospi_Nor_Ctx [OSPI_NOR_INSTANCES_NUMBER]
OSPI_HandleTypeDef | hospi_ram [OSPI_RAM_INSTANCES_NUMBER] = {0}
OSPI_RAM_Ctx_t Ospi_Ram_Ctx [OSPI_RAM_INSTANCES_NUMBER]
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ospi.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Data Structures | Defines | Enumerations | Functions | Variables
stm32h735g_discovery_ospi.h File Reference

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ospi.c driver. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"
#include "../Components/mx25lm51245g/mx25lm51245g.h"
#include "../Components/s70kl1281/s70kl1281.h"

Go to the source code of this file.

Data Structures

struct | MX_OSPI_InitTypeDef
struct | OSPI_NOR_Ctx_t
struct | BSP_OSPI_NOR_Init_t
struct | OSPI_RAM_Ctx_t
struct | BSP_OSPI_RAM_Init_t

Defines

#define | BSP_OSPI_NOR_Info_t MX25LM51245G_Info_t
#define | BSP_OSPI_NOR_Interface_t MX25LM51245G_Interface_t
#define | BSP_OSPI_NOR_Transfer_t MX25LM51245G_Transfer_t
#define | BSP_OSPI_NOR_Erase_t MX25LM51245G_Erase_t
#define | BSP_OSPI_RAM_BurstLength_t S70KL1281_BurstLength_t
#define | OSPI_NOR_INSTANCES_NUMBER 1U
#define | BSP_OSPI_NOR_SPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_SPI_MODE /* 1 Cmd Line, 1 Address Line and 1 Data Line */
#define | BSP_OSPI_NOR_OPI_MODE (BSP_OSPI_NOR_Interface_t)MX25LM51245G_OPI_MODE /* 8 Cmd Lines, 8 Address Lines and 8 Data Lines */
#define | BSP_OSPI_NOR_STR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_STR_TRANSFER /* Single Transfer Rate */
#define | BSP_OSPI_NOR_DTR_TRANSFER (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_DTR_TRANSFER /* Double Transfer Rate */
#define | BSP_OSPI_NOR_ERASE_4K MX25LM51245G_ERASE_4K
#define | BSP_OSPI_NOR_ERASE_64K MX25LM51245G_ERASE_64K
#define | BSP_OSPI_NOR_ERASE_CHIP MX25LM51245G_ERASE_BULK
#define | BSP_OSPI_NOR_BLOCK_4K MX25LM51245G_SUBSECTOR_4K
#define | BSP_OSPI_NOR_BLOCK_64K MX25LM51245G_SECTOR_64K
#define | OSPI_NOR_CLK_ENABLE() __HAL_RCC_OSPI1_CLK_ENABLE()
#define | OSPI_NOR_CLK_DISABLE() __HAL_RCC_OSPI1_CLK_DISABLE()
#define | OSPI_NOR_FORCE_RESET() __HAL_RCC_OSPI1_FORCE_RESET()
#define | OSPI_NOR_RELEASE_RESET() __HAL_RCC_OSPI1_RELEASE_RESET()
#define | OSPI_NOR_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_NOR_CS_PIN GPIO_PIN_6
#define | OSPI_NOR_CS_GPIO_PORT GPIOG
#define | OSPI_NOR_CS_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_NOR_CLK_PIN GPIO_PIN_10
#define | OSPI_NOR_CLK_GPIO_PORT GPIOF
#define | OSPI_NOR_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_DQS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OSPI_NOR_DQS_PIN GPIO_PIN_2
#define | OSPI_NOR_DQS_GPIO_PORT GPIOB
#define | OSPI_NOR_DQS_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D0_PIN GPIO_PIN_11
#define | OSPI_NOR_D0_GPIO_PORT GPIOD
#define | OSPI_NOR_D0_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D1_PIN GPIO_PIN_12
#define | OSPI_NOR_D1_GPIO_PORT GPIOD
#define | OSPI_NOR_D1_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | OSPI_NOR_D2_PIN GPIO_PIN_2
#define | OSPI_NOR_D2_GPIO_PORT GPIOE
#define | OSPI_NOR_D2_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D3_PIN GPIO_PIN_13
#define | OSPI_NOR_D3_GPIO_PORT GPIOD
#define | OSPI_NOR_D3_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D4_PIN GPIO_PIN_4
#define | OSPI_NOR_D4_GPIO_PORT GPIOD
#define | OSPI_NOR_D4_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D5_PIN GPIO_PIN_5
#define | OSPI_NOR_D5_GPIO_PORT GPIOD
#define | OSPI_NOR_D5_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_NOR_D6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_NOR_D6_PIN GPIO_PIN_9
#define | OSPI_NOR_D6_GPIO_PORT GPIOG
#define | OSPI_NOR_D6_PIN_AF GPIO_AF9_OCTOSPIM_P1
#define | OSPI_NOR_D7_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | OSPI_NOR_D7_PIN GPIO_PIN_7
#define | OSPI_NOR_D7_GPIO_PORT GPIOD
#define | OSPI_NOR_D7_PIN_AF GPIO_AF10_OCTOSPIM_P1
#define | OSPI_RAM_INSTANCES_NUMBER 1U
#define | BSP_OSPI_RAM_BURST_16_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_16_BYTES
#define | BSP_OSPI_RAM_BURST_32_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_32_BYTES
#define | BSP_OSPI_RAM_BURST_64_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_64_BYTES
#define | BSP_OSPI_RAM_BURST_128_BYTES (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_128_BYTES
#define | OSPI_RAM_MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE
#define | OSPI_RAM_MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE
#define | OSPI_RAM_MDMAx_CHANNEL MDMA_Channel0
#define | OSPI_RAM_MDMAx_IRQn MDMA_IRQn
#define | OPSI_RAM_MDMA_IRQHandler MDMA_IRQHandler
#define | OSPI_RAM_CLK_ENABLE() __HAL_RCC_OSPI2_CLK_ENABLE()
#define | OSPI_RAM_CLK_DISABLE() __HAL_RCC_OSPI2_CLK_DISABLE()
#define | OSPI_RAM_FORCE_RESET() __HAL_RCC_OSPI2_FORCE_RESET()
#define | OSPI_RAM_RELEASE_RESET() __HAL_RCC_OSPI2_RELEASE_RESET()
#define | OSPI_RAM_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_CS_PIN GPIO_PIN_12
#define | OSPI_RAM_CS_GPIO_PORT GPIOG
#define | OSPI_RAM_CS_PIN_AF GPIO_AF3_OCTOSPIM_P2
#define | OSPI_RAM_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_CLK_PIN GPIO_PIN_4
#define | OSPI_RAM_CLK_GPIO_PORT GPIOF
#define | OSPI_RAM_CLK_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_DQS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_DQS_PIN GPIO_PIN_12
#define | OSPI_RAM_DQS_GPIO_PORT GPIOF
#define | OSPI_RAM_DQS_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D0_PIN GPIO_PIN_0
#define | OSPI_RAM_D0_GPIO_PORT GPIOF
#define | OSPI_RAM_D0_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D1_PIN GPIO_PIN_1
#define | OSPI_RAM_D1_GPIO_PORT GPIOF
#define | OSPI_RAM_D1_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D2_PIN GPIO_PIN_2
#define | OSPI_RAM_D2_GPIO_PORT GPIOF
#define | OSPI_RAM_D2_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | OSPI_RAM_D3_PIN GPIO_PIN_3
#define | OSPI_RAM_D3_GPIO_PORT GPIOF
#define | OSPI_RAM_D3_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D4_PIN GPIO_PIN_0
#define | OSPI_RAM_D4_GPIO_PORT GPIOG
#define | OSPI_RAM_D4_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D5_PIN GPIO_PIN_1
#define | OSPI_RAM_D5_GPIO_PORT GPIOG
#define | OSPI_RAM_D5_PIN_AF GPIO_AF9_OCTOSPIM_P2
#define | OSPI_RAM_D6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D6_PIN GPIO_PIN_10
#define | OSPI_RAM_D6_GPIO_PORT GPIOG
#define | OSPI_RAM_D6_PIN_AF GPIO_AF3_OCTOSPIM_P2
#define | OSPI_RAM_D7_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | OSPI_RAM_D7_PIN GPIO_PIN_11
#define | OSPI_RAM_D7_GPIO_PORT GPIOG
#define | OSPI_RAM_D7_PIN_AF GPIO_AF9_OCTOSPIM_P2

Enumerations

enum | OSPI_Access_t { OSPI_ACCESS_NONE = 0, OSPI_ACCESS_INDIRECT, OSPI_ACCESS_MMP }
enum | BSP_OSPI_RAM_Latency_t { BSP_OSPI_RAM_VARIABLE_LATENCY = HAL_OSPI_VARIABLE_LATENCY, BSP_OSPI_RAM_FIXED_LATENCY = HAL_OSPI_FIXED_LATENCY }
enum | BSP_OSPI_RAM_BurstType_t { BSP_OSPI_RAM_HYBRID_BURST = 0, BSP_OSPI_RAM_LINEAR_BURST }

Functions

int32_t | BSP_OSPI_NOR_Init (uint32_t Instance, BSP_OSPI_NOR_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
int32_t | BSP_OSPI_NOR_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the OSPI memory.
int32_t | BSP_OSPI_NOR_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Block (uint32_t Instance, uint32_t BlockAddress, BSP_OSPI_NOR_Erase_t BlockSize)
Erases the specified block of the OSPI memory.
int32_t | BSP_OSPI_NOR_Erase_Chip (uint32_t Instance)
Erases the entire OSPI memory.
int32_t | BSP_OSPI_NOR_GetStatus (uint32_t Instance)
Reads current status of the OSPI memory.
int32_t | BSP_OSPI_NOR_GetInfo (uint32_t Instance, BSP_OSPI_NOR_Info_t *pInfo)
Return the configuration of the OSPI memory.
int32_t | BSP_OSPI_NOR_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_NOR_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_NOR_ReadID (uint32_t Instance, uint8_t *Id)
Get flash ID 3 Bytes: Manufacturer ID, Memory type, Memory density.
int32_t | BSP_OSPI_NOR_ConfigFlash (uint32_t Instance, BSP_OSPI_NOR_Interface_t Mode, BSP_OSPI_NOR_Transfer_t Rate)
Set Flash to desired Interface mode.
int32_t | BSP_OSPI_NOR_SuspendErase (uint32_t Instance)
This function suspends an ongoing erase command.
int32_t | BSP_OSPI_NOR_ResumeErase (uint32_t Instance)
This function resumes a paused erase command.
__weak HAL_StatusTypeDef | MX_OSPI_NOR_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Config)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_Init (uint32_t Instance, BSP_OSPI_RAM_Init_t *Init)
Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_DeInit (uint32_t Instance)
De-Initializes the OSPI interface.
int32_t | BSP_OSPI_RAM_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Read_DMA (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory.
int32_t | BSP_OSPI_RAM_Write_DMA (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the HyperRAM memory in DMA mode.
int32_t | BSP_OSPI_RAM_EnableMemoryMappedMode (uint32_t Instance)
Configure the OSPI in memory-mapped mode.
int32_t | BSP_OSPI_RAM_DisableMemoryMappedMode (uint32_t Instance)
Exit form memory-mapped mode Only 1 Instance can running MMP mode.
int32_t | BSP_OSPI_RAM_ConfigHyperRAM (uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength)
Set HyperRAM to desired configuration.
void | BSP_OSPI_RAM_DMA_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM DMA transfer interrupt request.
void | BSP_OSPI_RAM_IRQHandler (uint32_t Instance)
Handles OctoSPI HyperRAM interrupt request.
HAL_StatusTypeDef | MX_OSPI_RAM_Init (OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init)
Initializes the OSPI interface.
HAL_StatusTypeDef | MX_OSPI_ClockConfig (OSPI_HandleTypeDef *hospi)
OSPI Clock Config for OSPI Memories .

Variables

OSPI_HandleTypeDef | hospi_nor []
OSPI_NOR_Ctx_t OSPINORCtx []

Detailed Description

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ospi.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_ospi.h.


STM32H735G-DK BSP User Manual: stm32h735g_discovery_sd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Typedefs | Functions | Variables
stm32h735g_discovery_sd.c File Reference

This file includes the uSD card driver mounted on STM32H735G_DK boards. More...

#include "stm32h735g_discovery_sd.h"

Go to the source code of this file.

Typedefs

typedef void(* | BSP_EXTI_LineCallback )(void)

Functions

static void | SD_MspInit (SD_HandleTypeDef *hsd)
Initializes the SD MSP.
static void | SD_MspDeInit (SD_HandleTypeDef *hsd)
DeInitializes the SD MSP.
static void | SD_EXTI_Callback (void)
SD EXTI line detection callbacks.
void | HAL_SD_AbortCallback (SD_HandleTypeDef *hsd)
SD Abort callbacks.
void | HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd)
Tx Transfer completed callbacks.
void | HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd)
Rx Transfer completed callbacks.
__weak void | BSP_SD_AbortCallback (uint32_t Instance)
BSP SD Abort callbacks.
__weak void | BSP_SD_WriteCpltCallback (uint32_t Instance)
BSP Tx Transfer completed callbacks.
__weak void | BSP_SD_ReadCpltCallback (uint32_t Instance)
BSP Rx Transfer completed callbacks.
int32_t | BSP_SD_Init (uint32_t Instance)
STM32H735G_DK_SD_Exported_Functions Exported Functions
int32_t | BSP_SD_DeInit (uint32_t Instance)
DeInitializes the SD card device.
__weak HAL_StatusTypeDef | MX_SDMMC1_SD_Init (SD_HandleTypeDef *hsd)
Initializes the SDMMC1 peripheral.
int32_t | BSP_SD_DetectITConfig (uint32_t Instance)
Configures Interrupt mode for SD detection pin.
__weak void | BSP_SD_DetectCallback (uint32_t Instance, uint32_t Status)
BSP SD Callback.
int32_t | BSP_SD_IsDetected (uint32_t Instance)
Detects if SD card is correctly plugged in the memory slot or not.
int32_t | BSP_SD_ReadBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in polling mode.
int32_t | BSP_SD_WriteBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in polling mode.
int32_t | BSP_SD_ReadBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_ReadBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_Erase (uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr)
Erases the specified memory area of the given SD card.
int32_t | BSP_SD_GetCardState (uint32_t Instance)
Gets the current SD card data status.
int32_t | BSP_SD_GetCardInfo (uint32_t Instance, BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
void | BSP_SD_DETECT_IRQHandler (uint32_t Instance)
This function handles SD interrupt request.
void | BSP_SD_IRQHandler (uint32_t Instance)
This function handles SDMMC interrupt requests.

Variables

static uint32_t | PinDetect [SD_INSTANCES_NBR] = {SD_DETECT_PIN}
static GPIO_TypeDef * | SD_GPIO_PORT [SD_INSTANCES_NBR] = {SD_DETECT_GPIO_PORT}
static IRQn_Type | SD_EXTI_IRQn [SD_INSTANCES_NBR] = {SD_DETECT_EXTI_IRQn}
SD_HandleTypeDef | hsd_sdmmc [SD_INSTANCES_NBR]
EXTI_HandleTypeDef | hsd_exti [SD_INSTANCES_NBR]

Detailed Description

This file includes the uSD card driver mounted on STM32H735G_DK boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the micro SD external cards mounted on STM32H735G_DK
     board.
   - This driver does not need a specific component driver for the micro SD device
     to be included with.

  Driver description:
  ------------------
  + Initialization steps:
     o Initialize the micro SD card using the BSP_SD_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       SDIO interface configuration to interface with the external micro SD. It
       also includes the micro SD initialization sequence.

     o To check the SD card presence you can use the function BSP_SD_IsDetected() which
       returns the detection status.

     o If SD presence detection interrupt mode is desired, you must configure the
       SD detection interrupt mode by calling the function BSP_SD_DetectITConfig().
       The interrupt is generated as an external interrupt whenever the micro SD card is
       plugged/unplugged in/from the evaluation board.
       The SD detection interrupt is handled by calling the function BSP_SD_DetectIT()
       which is called in the IRQ handler file, the user callback is implemented in
       the function BSP_SD_DetectCallback().

     o The function BSP_SD_GetCardInfo()are used to get the micro SD card information
       which is stored in the structure "HAL_SD_CardInfoTypedef".

  + Micro SD card operations
     o The micro SD card can be accessed with read/write block(s) operations once
       it is ready for access. The access can be performed whether
       using the polling mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(),
       using the interrupt mode by calling the functions BSP_SD_ReadBlocks_IT()/BSP_SD_WriteBlocks_IT(),
       or by DMA transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA().
     o The DMA transfer complete is used with interrupt mode. Once the SD transfer
       is complete, the SD interrupt is handled using the function BSP_SDMMC1_IRQHandler()
       The DMA Tx/Rx transfer complete are handled using the functions
       SD_SDMMC1_DMA_Tx_IRQHandler(), SD_SDMMC1_DMA_Rx_IRQHandler().The corresponding
       user callbacks are implemented by the user at application level.
     o The SD erase block(s) is performed using the functions BSP_SD_Erase() with specifying
       the number of blocks to erase.
     o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_sd.c.


STM32H735G-DK BSP User Manual: stm32h735g_discovery_sd.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Functions | Variables
stm32h735g_discovery_sd.h File Reference

This file contains the common defines and functions prototypes for the stm32h735g_discovery_sd.c driver. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"

Go to the source code of this file.

Defines

#define | BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.
#define | SD_INSTANCES_NBR 1UL
#define | SD_TRANSFER_OK 0U
SD transfer state definition.
#define | SD_TRANSFER_BUSY 1U
#define | SD_PRESENT 1UL
SD-detect signal.
#define | SD_NOT_PRESENT 0UL
#define | SD_DETECT_PIN GPIO_PIN_5
#define | SD_DETECT_GPIO_PORT GPIOF
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI9_5_IRQn
#define | SD_DETECT_EXTI_LINE EXTI_LINE_5
#define | SD1_DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD1_SDMMC1_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD1_SDMMC1_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD1_SDMMC1_DMAx_Tx_STREAM DMA2_Stream6
#define | SD1_SDMMC1_DMAx_Rx_STREAM DMA2_Stream3
#define | SD1_SDMMC1_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD1_SDMMC1_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | SD1_SDMMC1_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | SD1_SDMMC1_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler
#define | SD1_SDMMC1_IRQHandler SDMMC1_IRQHandler

Functions

int32_t | BSP_SD_Init (uint32_t Instance)
STM32H735G_DK_SD_Exported_Functions Exported Functions
int32_t | BSP_SD_DeInit (uint32_t Instance)
DeInitializes the SD card device.
int32_t | BSP_SD_DetectITConfig (uint32_t Instance)
Configures Interrupt mode for SD detection pin.
int32_t | BSP_SD_ReadBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
Reads block(s) from a specified address in an SD card, in polling mode.
int32_t | BSP_SD_WriteBlocks (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in polling mode.
int32_t | BSP_SD_ReadBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_DMA (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_ReadBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_WriteBlocks_IT (uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
int32_t | BSP_SD_Erase (uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr)
Erases the specified memory area of the given SD card.
int32_t | BSP_SD_GetCardState (uint32_t Instance)
Gets the current SD card data status.
int32_t | BSP_SD_GetCardInfo (uint32_t Instance, BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
int32_t | BSP_SD_IsDetected (uint32_t Instance)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_AbortCallback (uint32_t Instance)
BSP SD Abort callbacks.
void | BSP_SD_WriteCpltCallback (uint32_t Instance)
BSP Tx Transfer completed callbacks.
void | BSP_SD_ReadCpltCallback (uint32_t Instance)
BSP Rx Transfer completed callbacks.
HAL_StatusTypeDef | MX_SDMMC1_SD_Init (SD_HandleTypeDef *hsd)
Initializes the SDMMC1 peripheral.
void | BSP_SD_DetectCallback (uint32_t Instance, uint32_t Status)
BSP SD Callback.
void | BSP_SD_DETECT_IRQHandler (uint32_t Instance)
This function handles SD interrupt request.
void | BSP_SD_IRQHandler (uint32_t Instance)
This function handles SDMMC interrupt requests.

Variables

SD_HandleTypeDef | hsd_sdmmc []
EXTI_HandleTypeDef | hsd_exti []

Detailed Description

This file contains the common defines and functions prototypes for the stm32h735g_discovery_sd.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_sd.h.


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ts.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Defines | Typedefs | Functions | Variables
stm32h735g_discovery_ts.c File Reference

This file provides a set of functions needed to manage the Touch Screen on STM32H735G_DK board. More...

#include "stm32h735g_discovery_ts.h"
#include "stm32h735g_discovery_bus.h"

Go to the source code of this file.

Defines

#define | TS_MIN(a, b) ((a > b) ? b : a)

Typedefs

typedef void(* | BSP_EXTI_LineCallback )(void)

Functions

static int32_t | FT5336_Probe (uint32_t Instance)
Register Bus IOs if component ID is OK.
static void | TS_EXTI_Callback (void)
TS EXTI touch detection callbacks.
int32_t | BSP_TS_Init (uint32_t Instance, TS_Init_t *TS_Init)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
int32_t | BSP_TS_DeInit (uint32_t Instance)
De-Initializes the touch screen functionalities.
int32_t | BSP_TS_GetCapabilities (uint32_t Instance, TS_Capabilities_t *Capabilities)
Get Touch Screen instance capabilities.
int32_t | BSP_TS_EnableIT (uint32_t Instance)
Configures and enables the touch screen interrupts.
int32_t | BSP_TS_DisableIT (uint32_t Instance)
Disables the touch screen interrupts.
void | BSP_TS_IRQHandler (uint32_t Instance)
This function handles TS interrupt request.
__weak void | BSP_TS_Callback (uint32_t Instance)
BSP TS Callback.
int32_t | BSP_TS_GetState (uint32_t Instance, TS_State_t *TS_State)
Returns positions of a single touch screen.
int32_t | BSP_TS_Get_MultiTouchState (uint32_t Instance, TS_MultiTouch_State_t *TS_State)
Returns positions of multi touch screen.
int32_t | BSP_TS_GestureConfig (uint32_t Instance, TS_Gesture_Config_t *GestureConfig)
Update gesture Id following a touch detected.
int32_t | BSP_TS_GetGestureId (uint32_t Instance, uint32_t *GestureId)
Update gesture Id following a touch detected.
int32_t | BSP_TS_Set_Orientation (uint32_t Instance, uint32_t Orientation)
Set TS orientation.
int32_t | BSP_TS_Get_Orientation (uint32_t Instance, uint32_t *Orientation)
Get TS orientation.

Variables

static TS_Drv_t * | Ts_Drv = NULL
EXTI_HandleTypeDef | hts_exti [TS_INSTANCES_NBR] = {0}
void * | Ts_CompObj [TS_INSTANCES_NBR] = {0}
TS_Ctx_t | Ts_Ctx [TS_INSTANCES_NBR] = {0}

Detailed Description

This file provides a set of functions needed to manage the Touch Screen on STM32H735G_DK board.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_ts.c.


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ts.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
Data Structures | Defines | Enumerations | Functions | Variables
stm32h735g_discovery_ts.h File Reference

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ts.c driver. More...

#include "stm32h735g_discovery_conf.h"
#include "stm32h735g_discovery_errno.h"
#include "../Components/ft5336/ft5336.h"
#include "../Components/Common/ts.h"

Go to the source code of this file.

Data Structures

struct | TS_Init_t
struct | TS_Ctx_t
struct | TS_Capabilities_t
struct | TS_State_t
struct | TS_MultiTouch_State_t
struct | TS_Gesture_Config_t

Defines

#define | TS_INSTANCES_NBR 1
#define | TS_MAX_WIDTH 480U /* Touchscreen pad max width */
#define | TS_MAX_HEIGHT 272U /* Touchscreen pad max height */
#define | TS_SWAP_NONE 0x01U
#define | TS_SWAP_X 0x02U
#define | TS_SWAP_Y 0x04U
#define | TS_SWAP_XY 0x08U
#define | TS_I2C_ADDRESS 0x70U
TouchScreen Slave I2C address 1.
#define | TS_INT_PIN GPIO_PIN_2
Touch screen interrupt signal.
#define | TS_INT_GPIO_PORT GPIOG
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI2_IRQn
#define | TS_EXTI_LINE EXTI_LINE_2
#define | GESTURE_ID_NO_GESTURE 0x00U
TS_Gesture_Id_t Define Possible managed gesture identification values returned by touch screen driver.
#define | GESTURE_ID_MOVE_UP 0x01U
#define | GESTURE_ID_MOVE_RIGHT 0x02U
#define | GESTURE_ID_MOVE_DOWN 0x03U
#define | GESTURE_ID_MOVE_LEFT 0x04U
#define | GESTURE_ID_ZOOM_IN 0x05U
#define | GESTURE_ID_ZOOM_OUT 0x06U
#define | GESTURE_ID_NB_MAX 0x07U

Enumerations

enum TS_TouchEventTypeDef {
TOUCH_EVENT_NO_EVT = 0x00, TOUCH_EVENT_PRESS_DOWN = 0x01, TOUCH_EVENT_LIFT_UP = 0x02, TOUCH_EVENT_CONTACT = 0x03,
TOUCH_EVENT_NB_MAX = 0x04
}
TS_TouchEventTypeDef Define Possible touch events kind as returned values by touch screen IC Driver. More...

Functions

int32_t | BSP_TS_Init (uint32_t Instance, TS_Init_t *TS_Init)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
int32_t | BSP_TS_DeInit (uint32_t Instance)
De-Initializes the touch screen functionalities.
int32_t | BSP_TS_EnableIT (uint32_t Instance)
Configures and enables the touch screen interrupts.
int32_t | BSP_TS_DisableIT (uint32_t Instance)
Disables the touch screen interrupts.
int32_t | BSP_TS_GetState (uint32_t Instance, TS_State_t *TS_State)
Returns positions of a single touch screen.
int32_t | BSP_TS_Get_MultiTouchState (uint32_t Instance, TS_MultiTouch_State_t *TS_State)
Returns positions of multi touch screen.
int32_t | BSP_TS_GestureConfig (uint32_t Instance, TS_Gesture_Config_t *GestureConfig)
Update gesture Id following a touch detected.
int32_t | BSP_TS_GetGestureId (uint32_t Instance, uint32_t *GestureId)
Update gesture Id following a touch detected.
int32_t | BSP_TS_Set_Orientation (uint32_t Instance, uint32_t Orientation)
Set TS orientation.
int32_t | BSP_TS_Get_Orientation (uint32_t Instance, uint32_t *Orientation)
Get TS orientation.
int32_t | BSP_TS_GetCapabilities (uint32_t Instance, TS_Capabilities_t *Capabilities)
Get Touch Screen instance capabilities.
__weak void | BSP_TS_Callback (uint32_t Instance)
BSP TS Callback.
void | BSP_TS_IRQHandler (uint32_t Instance)
This function handles TS interrupt request.

Variables

void * | Ts_CompObj []
EXTI_HandleTypeDef | hts_exti []
TS_Ctx_t Ts_Ctx []

Detailed Description

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ts.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2019 STMicroelectronics. All rights reserved.

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.

Definition in file stm32h735g_discovery_ts.h.


STM32H735G-DK BSP User Manual: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
AUDIO_IN_Ctx_t
AUDIO_OUT_Ctx_t
BSP_AUDIO_Init_t
BSP_LCD_Ctx_t
BSP_OSPI_NOR_Init_t
BSP_OSPI_RAM_Init_t
I2C_Charac_t
I2C_Timings_t
MX_DFSDM_Config
MX_I2S_Config
MX_LTDC_LayerConfig_t
MX_OSPI_InitTypeDef
MX_SAI_Config
OSPI_NOR_Ctx_t
OSPI_RAM_Ctx_t
TS_Capabilities_t
TS_Ctx_t
TS_Gesture_Config_t
TS_Init_t
TS_MultiTouch_State_t
TS_State_t


STM32H735G-DK BSP User Manual: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
A | B | I | M | O | T
A
BSP_LCD_Ctx_t
M
O
TS_Ctx_t
BSP_OSPI_NOR_Init_t TS_Gesture_Config_t
AUDIO_IN_Ctx_t BSP_OSPI_RAM_Init_t MX_DFSDM_Config OSPI_NOR_Ctx_t TS_Init_t
AUDIO_OUT_Ctx_t
I
MX_I2S_Config OSPI_RAM_Ctx_t TS_MultiTouch_State_t
B
MX_LTDC_LayerConfig_t
T
TS_State_t
I2C_Charac_t MX_OSPI_InitTypeDef
BSP_AUDIO_Init_t I2C_Timings_t MX_SAI_Config TS_Capabilities_t
A | B | I | M | O | T


STM32H735G-DK BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/ Directory Reference

  • Firmware
  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32H735G-DK


STM32H735G-DK BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/STM32H735G-DK/ Directory Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
STM32H735G-DK Directory Reference

Files

file | stm32h735g_discovery.c [code]

This file provides a set of firmware functions to manage LEDs push-buttons COM ports available on STM32H735G_DK board(MB1520) from STMicroelectronics. .

file | stm32h735g_discovery.h [code]

This file contains definitions for STM32H735G_DK: LEDs push-buttons COM ports hardware resources.

file | stm32h735g_discovery_audio.c [code]

This file provides the Audio driver for the STM32H735G_DISCO board.

file | stm32h735g_discovery_audio.h [code]

This file contains the common defines and functions prototypes for the stm32h735g_discovery_audio.c driver.

file | stm32h735g_discovery_bus.c [code]

This file provides a set of firmware functions to communicate with external devices available on STM32H735G-DK board (MB1520) from STMicroelectronics.

file | stm32h735g_discovery_bus.h [code]

This file contains definitions for STM32H735G_DK LEDs, push-buttons hardware resources.

file | stm32h735g_discovery_conf_template.h [code]
file | stm32h735g_discovery_errno.h [code]

Error Code.

file | stm32h735g_discovery_lcd.c [code]

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H735G_DISCO board.

file | stm32h735g_discovery_lcd.h [code]

This file contains the common defines and functions prototypes for the stm32h735g_discovery_lcd.c driver.

file | stm32h735g_discovery_ospi.c [code]
file | stm32h735g_discovery_ospi.h [code]

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ospi.c driver.

file | stm32h735g_discovery_sd.c [code]

This file includes the uSD card driver mounted on STM32H735G_DK boards.

file | stm32h735g_discovery_sd.h [code]

This file contains the common defines and functions prototypes for the stm32h735g_discovery_sd.c driver.

file | stm32h735g_discovery_ts.c [code]

This file provides a set of functions needed to manage the Touch Screen on STM32H735G_DK board.

file | stm32h735g_discovery_ts.h [code]

This file contains the common defines and functions prototypes for the stm32h735g_discovery_ts.c driver.


STM32H735G-DK BSP User Manual: C:/git/h7_master/Firmware/ Directory Reference

  • Firmware
Firmware Directory Reference

Directories

directory Drivers


STM32H735G-DK BSP User Manual: C:/git/h7_master/Firmware/Drivers/ Directory Reference

  • Firmware
  • Drivers
Drivers Directory Reference

Directories

directory BSP


STM32H735G-DK BSP User Manual: Directories

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


STM32H735G-DK BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32h735g_discovery.c [code] | This file provides a set of firmware functions to manage LEDs push-buttons COM ports available on STM32H735G_DK board(MB1520) from STMicroelectronics.
stm32h735g_discovery.h [code] | This file contains definitions for STM32H735G_DK: LEDs push-buttons COM ports hardware resources
stm32h735g_discovery_audio.c [code] | This file provides the Audio driver for the STM32H735G_DISCO board
stm32h735g_discovery_audio.h [code] | This file contains the common defines and functions prototypes for the stm32h735g_discovery_audio.c driver
stm32h735g_discovery_bus.c [code] | This file provides a set of firmware functions to communicate with external devices available on STM32H735G-DK board (MB1520) from STMicroelectronics
stm32h735g_discovery_bus.h [code] | This file contains definitions for STM32H735G_DK LEDs, push-buttons hardware resources
stm32h735g_discovery_conf_template.h [code] |
stm32h735g_discovery_errno.h [code] | Error Code
stm32h735g_discovery_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H735G_DISCO board
stm32h735g_discovery_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32h735g_discovery_lcd.c driver
stm32h735g_discovery_ospi.c [code] |
stm32h735g_discovery_ospi.h [code] | This file contains the common defines and functions prototypes for the stm32h735g_discovery_ospi.c driver
stm32h735g_discovery_sd.c [code] | This file includes the uSD card driver mounted on STM32H735G_DK boards
stm32h735g_discovery_sd.h [code] | This file contains the common defines and functions prototypes for the stm32h735g_discovery_sd.c driver
stm32h735g_discovery_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32H735G_DK board
stm32h735g_discovery_ts.h [code] | This file contains the common defines and functions prototypes for the stm32h735g_discovery_ts.c driver


STM32H735G-DK BSP User Manual: AUDIO

Modules
AUDIO

Modules

AUDIO Exported Types
AUDIO Exported Constants
AUDIO Exported Macros
AUDIO Exported Variables
AUDIO OUT Exported Functions
STM32H735G_DISCO_AUDIO_IN Exported Functions


STM32H735G-DK BSP User Manual: BSP

Modules
BSP

Modules

STM32H735G_DK
STM32H735G_DISCO


STM32H735G-DK BSP User Manual: STM32H735G_DISCO

Modules
STM32H735G_DISCO
BSP

Modules

AUDIO

This file includes the low layer driver for cs42l51 Audio Codec available on STM32H735G_DISCO board(MB1332).

STM32H735G_DISCO LCD


STM32H735G-DK BSP User Manual: AUDIO

Modules
AUDIO
STM32H735G_DISCO

This file includes the low layer driver for cs42l51 Audio Codec available on STM32H735G_DISCO board(MB1332). More...

Modules

STM32H735G_DISCO_AUDIO Private Defines
AUDIO Private Macros
AUDIO Exported Variables
AUDIO Private Variables
AUDIO Private Function Prototypes
AUDIO OUT Exported Functions
AUDIO OUT Private Functions
STM32H735G_DISCO_AUDIO_IN Exported Functions
AUDIO IN Private Functions

Detailed Description

This file includes the low layer driver for cs42l51 Audio Codec available on STM32H735G_DISCO board(MB1332).


STM32H735G-DK BSP User Manual: AUDIO Exported Types

Data Structures
AUDIO Exported Types
AUDIO

Data Structures

struct | BSP_AUDIO_Init_t
struct | AUDIO_IN_Ctx_t
struct | AUDIO_OUT_Ctx_t
struct | MX_SAI_Config
struct | MX_I2S_Config
struct | MX_DFSDM_Config


STM32H735G-DK BSP User Manual: STM32H735G_DISCO LCD

Modules
STM32H735G_DISCO LCD
STM32H735G_DISCO

Modules

LCD Private Variables
LCD Private TypesDefinitions
Exported Variables
LCD Private FunctionPrototypes
Private Macros
LCD Exported Functions
LCD Private Functions
Exported Constants
Exported Types
Private Constants


STM32H735G-DK BSP User Manual: STM32H735G_DK

Modules
STM32H735G_DK
BSP

Modules

LOW LEVEL
BUS
STM32H735G_DK OSPI
SD
STM32H735G_DK TS


STM32H735G-DK BSP User Manual: BUS

Modules
BUS
STM32H735G_DK

Modules

Private Marcos
Private Constants
Private Types
Exported Variables
Private Variables
Private FunctionPrototypes
Exported Functions
Private Functions
Exported Types
Exported Constants
Exported Functions Prototypes


STM32H735G-DK BSP User Manual: Private Types

Data Structures
Private Types
BUS

Data Structures

struct | I2C_Charac_t
struct | I2C_Timings_t


STM32H735G-DK BSP User Manual: STM32H735G_DK OSPI

Modules
STM32H735G_DK OSPI
STM32H735G_DK

Modules

OSPI_NOR Private Functions
OSPI_RAM Private Functions
OSPI_NOR Exported Functions
Exported Types
OSPI_NOR Exported Types
OSPI_RAM Exported Types
OSPI_NOR Exported Constants
OSPI_RAM Exported Constants
OSPI_RAM Exported Functions Prototypes
OSPI_NOR Exported Variables
OSPI_RAM Exported Variables
STM32H735G_DK_OSPI_RAM_Exported_Functions
STM32H735G_DKVERY_OSPI_NOR_Private_Functions


STM32H735G-DK BSP User Manual: STM32H735G_DK TS

Modules
STM32H735G_DK TS
STM32H735G_DK

Modules

TS Private Types Definitions
TS Private Types Defines
TS Private Macros
TS Private Function Prototypes
TS Privates Variables
TS Exported Variables
TS Private Functions
TS Exported Constants
TS Exported Types
TS Exported Functions


STM32H735G-DK BSP User Manual: Modules

Modules
Here is a list of all modules:
  • OSPI_RAM Private Functions
  • BSP
    • STM32H735G_DK
      • LOW LEVEL
        • Private Types Definitions
        • Private Function Prototypes
        • Exported Variables
        • Private Variables
        • Exported Functions
        • LOW LEVEL Exported Types
        • LOW LEVEL Exported Constants
          • EVAL LOW LEVEL LED
          • LOW LEVEL BUTTON
          • LOW LEVEL COM
        • LOW LEVEL Exported Functions Prototypes
      • BUS
        • Private Marcos
        • Private Constants
        • Private Types
        • Exported Variables
        • Private Variables
        • Private FunctionPrototypes
        • Exported Functions
        • Private Functions
        • Exported Types
        • Exported Constants
        • Exported Functions Prototypes
      • STM32H735G_DK OSPI
        • OSPI_NOR Private Functions
        • OSPI_RAM Private Functions
        • OSPI_NOR Exported Functions
        • Exported Types
        • OSPI_NOR Exported Types
        • OSPI_RAM Exported Types
        • OSPI_NOR Exported Constants
        • OSPI_RAM Exported Constants
        • OSPI_RAM Exported Functions Prototypes
        • OSPI_NOR Exported Variables
        • OSPI_RAM Exported Variables
        • STM32H735G_DK_OSPI_RAM_Exported_Functions
        • STM32H735G_DKVERY_OSPI_NOR_Private_Functions
      • SD
        • Private TypesDefinitions
        • Private Variables
        • Exported Variables
        • Private Functions Prototypes
        • Private Functions
        • Exported Types
        • Exported Constants
        • Exported Functions Prototypes
      • STM32H735G_DK TS
        • TS Private Types Definitions
        • TS Private Types Defines
        • TS Private Macros
        • TS Private Function Prototypes
        • TS Privates Variables
        • TS Exported Variables
        • TS Private Functions
        • TS Exported Constants
        • TS Exported Types
        • TS Exported Functions
    • STM32H735G_DISCO
      • AUDIO
        • STM32H735G_DISCO_AUDIO Private Defines
        • AUDIO Private Macros
        • AUDIO Exported Variables
        • AUDIO Private Variables
        • AUDIO Private Function Prototypes
        • AUDIO OUT Exported Functions
        • AUDIO OUT Private Functions
        • STM32H735G_DISCO_AUDIO_IN Exported Functions
        • AUDIO IN Private Functions
      • STM32H735G_DISCO LCD
        • LCD Private Variables
        • LCD Private TypesDefinitions
        • Exported Variables
        • LCD Private FunctionPrototypes
        • Private Macros
        • LCD Exported Functions
        • LCD Private Functions
        • Exported Constants
        • Exported Types
        • Private Constants
  • AUDIO
    • AUDIO Exported Types
    • AUDIO Exported Constants
    • AUDIO Exported Macros
    • AUDIO Exported Variables
    • AUDIO OUT Exported Functions
    • STM32H735G_DISCO_AUDIO_IN Exported Functions


STM32H735G-DK BSP User Manual: stm32h735g_discovery.c Source File

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


STM32H735G-DK BSP User Manual: stm32h735g_discovery.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32H735G_DK:
00006   *          LEDs
00007   *          push-buttons
00008   *          COM ports
00009   *          hardware resources.
00010   ******************************************************************************
00011   * @attention
00012   *
00013   * Copyright (c) 2019 STMicroelectronics.
00014   * All rights reserved.
00015   *
00016   * This software is licensed under terms that can be found in the LICENSE file
00017   * in the root directory of this software component.
00018   * If no LICENSE file comes with this software, it is provided AS-IS.
00019   *
00020   ******************************************************************************
00021   */
00022
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef STM32H735G_DK_H
00025 #define STM32H735G_DK_H
00026
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32h735g_discovery_conf.h"
00033 #include "stm32h735g_discovery_errno.h"
00034
00035 /** @addtogroup BSP
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32H735G_DK
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32H735G_DK_LOW_LEVEL
00044   * @{
00045   */
00046
00047 /** @defgroup STM32H735G_DK_LOW_LEVEL_Exported_Types LOW LEVEL Exported Types
00048   * @{
00049   */
00050
00051 typedef enum
00052 {
00053   LED1 = 0U,
00054   LED_GREEN = LED1,
00055   LED2 = 1U,
00056   LED_RED = LED2,
00057   LEDn
00058 }Led_TypeDef;
00059
00060
00061 typedef enum
00062 {
00063   BUTTON_USER = 0U,
00064   BUTTONn
00065 }Button_TypeDef;
00066
00067 typedef enum
00068 {
00069   BUTTON_MODE_GPIO = 0U,
00070   BUTTON_MODE_EXTI = 1U
00071 }ButtonMode_TypeDef;
00072
00073 #if (USE_BSP_COM_FEATURE > 0)
00074 typedef enum
00075 {
00076   COM1 = 0U,
00077   COMn
00078 }COM_TypeDef;
00079
00080 typedef enum
00081 {
00082   COM_STOPBITS_1     =   UART_STOPBITS_1,
00083   COM_STOPBITS_2     =   UART_STOPBITS_2,
00084 }COM_StopBitsTypeDef;
00085
00086 typedef enum
00087 {
00088   COM_PARITY_NONE     =  UART_PARITY_NONE,
00089   COM_PARITY_EVEN     =  UART_PARITY_EVEN,
00090   COM_PARITY_ODD      =  UART_PARITY_ODD,
00091 }COM_ParityTypeDef;
00092
00093 typedef enum
00094 {
00095   COM_HWCONTROL_NONE    =  UART_HWCONTROL_NONE,
00096   COM_HWCONTROL_RTS     =  UART_HWCONTROL_RTS,
00097   COM_HWCONTROL_CTS     =  UART_HWCONTROL_CTS,
00098   COM_HWCONTROL_RTS_CTS =  UART_HWCONTROL_RTS_CTS,
00099 }COM_HwFlowCtlTypeDef;
00100
00101 typedef enum
00102 {
00103   COM_WORDLENGTH_7B = UART_WORDLENGTH_7B,
00104   COM_WORDLENGTH_8B = UART_WORDLENGTH_8B,
00105   COM_WORDLENGTH_9B = UART_WORDLENGTH_9B,
00106 }COM_WordLengthTypeDef;
00107
00108 typedef struct
00109 {
00110   uint32_t              BaudRate;
00111   COM_WordLengthTypeDef WordLength;
00112   COM_StopBitsTypeDef   StopBits;
00113   COM_ParityTypeDef     Parity;
00114   COM_HwFlowCtlTypeDef  HwFlowCtl;
00115 }COM_InitTypeDef;
00116
00117 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00118 typedef struct
00119 {
00120   void (* pMspInitCb)(UART_HandleTypeDef *);
00121   void (* pMspDeInitCb)(UART_HandleTypeDef *);
00122 }BSP_COM_Cb_t;
00123 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 1) */
00124 #endif
00125
00126 /**
00127   * @}
00128   */
00129
00130 /** @defgroup STM32H735G_DK_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants
00131   * @{
00132   */
00133
00134 /**
00135   * @brief  Define for STM32H735G_DK board
00136   */
00137 #if !defined (USE_STM32H735G_DK)
00138  #define USE_STM32H735G_DK
00139 #endif
00140
00141 /**
00142  * @brief STM32H735G_DK BSP Driver version number V1.2.1
00143    */
00144 #define STM32H735G_DK_BSP_VERSION_MAIN   (uint32_t)(0x01) /*!< [31:24] main version */
00145 #define STM32H735G_DK_BSP_VERSION_SUB1   (uint32_t)(0x02) /*!< [23:16] sub1 version */
00146 #define STM32H735G_DK_BSP_VERSION_SUB2   (uint32_t)(0x01) /*!< [15:8]  sub2 version */
00147 #define STM32H735G_DK_BSP_VERSION_RC     (uint32_t)(0x00) /*!< [7:0]  release candidate */
00148 #define STM32H735G_DK_BSP_VERSION        ((STM32H735G_DK_BSP_VERSION_MAIN << 24)\
00149                                                 |(STM32H735G_DK_BSP_VERSION_SUB1 << 16)\
00150                                                 |(STM32H735G_DK_BSP_VERSION_SUB2 << 8 )\
00151                                                 |(STM32H735G_DK_BSP_VERSION_RC))
00152
00153
00154 /** @defgroup STM32H735G_DK_LOW_LEVEL_LED EVAL LOW LEVEL LED
00155   * @{
00156   */
00157
00158 #define LED1_GPIO_PORT                   GPIOC
00159 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOC_CLK_ENABLE()
00160 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOC_CLK_DISABLE()
00161 #define LED1_PIN                         GPIO_PIN_3
00162
00163 #define LED2_GPIO_PORT                   GPIOC
00164 #define LED2_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOC_CLK_ENABLE()
00165 #define LED2_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOC_CLK_DISABLE()
00166 #define LED2_PIN                         GPIO_PIN_2
00167
00168 /**
00169   * @}
00170   */
00171 /** @defgroup STM32H735G_DK_LOW_LEVEL_BUTTON LOW LEVEL BUTTON
00172   * @{
00173   */
00174 /* Button state */
00175 #define BUTTON_RELEASED                    0U
00176 #define BUTTON_PRESSED                     1U
00177
00178 /**
00179   * @brief User-button
00180   */
00181 #define BUTTON_USER_PIN                       GPIO_PIN_13
00182 #define BUTTON_USER_GPIO_PORT                 GPIOC
00183 #define BUTTON_USER_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00184 #define BUTTON_USER_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00185 #define BUTTON_USER_EXTI_IRQn                 EXTI15_10_IRQn
00186 #define BUTTON_USER_EXTI_LINE                 EXTI_LINE_13
00187 /**
00188   * @}
00189   */
00190
00191 /** @defgroup STM32H735G_DK_LOW_LEVEL_COM LOW LEVEL COM
00192   * @{
00193   */
00194 #if (USE_BSP_COM_FEATURE > 0)
00195 /**
00196  * @brief Definition for COM port1, connected to USART3
00197  */
00198 #define COM1_UART                      USART3
00199 #define COM1_CLK_ENABLE()             __HAL_RCC_USART3_CLK_ENABLE()
00200 #define COM1_CLK_DISABLE()            __HAL_RCC_USART3_CLK_DISABLE()
00201
00202 #define COM1_TX_PIN                   GPIO_PIN_8
00203 #define COM1_TX_GPIO_PORT             GPIOD
00204 #define COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00205 #define COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00206 #define COM1_TX_AF                    GPIO_AF7_USART3
00207
00208 #define COM1_RX_PIN                   GPIO_PIN_9
00209 #define COM1_RX_GPIO_PORT             GPIOD
00210 #define COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00211 #define COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00212 #define COM1_RX_AF                    GPIO_AF7_USART3
00213 #define COM_POLL_TIMEOUT              1000
00214
00215 #define MX_UART_InitTypeDef COM_InitTypeDef
00216 #endif
00217 /**
00218   * @}
00219   */
00220
00221 /**
00222   * @}
00223   */
00224
00225 /** @addtgroup STM32H735G_DK_LOW_LEVEL_Exported_Variables
00226   * @{
00227   */
00228 extern EXTI_HandleTypeDef hpb_exti[];
00229 #if (USE_BSP_COM_FEATURE > 0)
00230 extern UART_HandleTypeDef hcom_uart[];
00231 extern USART_TypeDef* COM_USART[];
00232 #endif
00233 /**
00234   * @}
00235   */
00236
00237 /** @defgroup STM32H735G_DK_LOW_LEVEL_Exported_FunctionsPrototypes LOW LEVEL Exported Functions Prototypes
00238   * @{
00239   */
00240 int32_t  BSP_GetVersion(void);
00241 int32_t  BSP_LED_Init(Led_TypeDef Led);
00242 int32_t  BSP_LED_DeInit(Led_TypeDef Led);
00243 int32_t  BSP_LED_On(Led_TypeDef Led);
00244 int32_t  BSP_LED_Off(Led_TypeDef Led);
00245 int32_t  BSP_LED_Toggle(Led_TypeDef Led);
00246 int32_t  BSP_LED_GetState (Led_TypeDef Led);
00247 int32_t  BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00248 int32_t  BSP_PB_DeInit(Button_TypeDef Button);
00249 int32_t  BSP_PB_GetState(Button_TypeDef Button);
00250 void     BSP_PB_Callback(Button_TypeDef Button);
00251 #if (USE_BSP_COM_FEATURE > 0)
00252 int32_t  BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init);
00253 int32_t  BSP_COM_DeInit(COM_TypeDef COM);
00254 #if( USE_COM_LOG == 1)
00255 int32_t  BSP_COM_SelectLogPort (COM_TypeDef COM);
00256 #endif
00257
00258 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
00259 int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM);
00260 int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback);
00261 #endif /* USE_HAL_UART_REGISTER_CALLBACKS */
00262 HAL_StatusTypeDef MX_USART3_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init);
00263 #endif
00264 void BSP_PB_IRQHandler(Button_TypeDef Button);
00265
00266 /**
00267   * @}
00268   */
00269 /**
00270   * @}
00271   */
00272
00273 /**
00274   * @}
00275   */
00276
00277 /**
00278   * @}
00279   */
00280
00281 #ifdef __cplusplus
00282 }
00283 #endif
00284 #endif /* STM32H735G_DK_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_audio.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_audio.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_audio.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides the Audio driver for the STM32H735G_DISCO
00006   *          board.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    + This driver supports stm32h7xx devices on STM32H735G_DISCO (MB1520) boards.
00011    + Call the function BSP_AUDIO_OUT_Init() for AUDIO OUT initialization:
00012         Instance:  Select the output instance. It can only be 0 (SAI)
00013         AudioInit: Audio Out structure to select the following parameters
00014                    - Device: Select the output device (headphone, speaker, hdmi ..)
00015                    - SampleRate: Select the output sample rate (8Khz .. 96Khz)
00016                    - BitsPerSample: Select the output resolution (16 or 32bits per sample)
00017                    - ChannelsNbr: Select the output channels number(1 for mono, 2 for stereo)
00018                    - Volume: Select the output volume(0% .. 100%)
00019
00020       This function configures all the hardware required for the audio application (codec, I2C, I2S ,SAI,
00021       GPIOs, DMA and interrupt if needed). This function returns BSP_ERROR_NONE if configuration is OK.
00022       If the returned value is different from BSP_ERROR_NONE or the function is stuck then the communication with
00023       the codec or the MFX has failed (try to un-plug the power or reset device in this case).
00024
00025       User can update the I2S/SAI or the clock configurations by overriding the weak MX functions MX_I2S6_Init(),
00026       MX_I2S6_ClockConfig(),MX_SAI1_Block_B_Init() and  MX_SAI1_ClockConfig()
00027       User can override the default MSP configuration and register his own MSP callbacks (defined at application level)
00028       by calling BSP_AUDIO_OUT_RegisterMspCallbacks() function
00029       User can restore the default MSP configuration by calling BSP_AUDIO_OUT_RegisterDefaultMspCallbacks()
00030       To use these two functions, user have to enable USE_HAL_I2S_REGISTER_CALLBACKS and USE_HAL_SAI_REGISTER_CALLBACKS
00031       within stm32h7xx_hal_conf.h file
00032
00033
00034    + Call the function BSP_AUDIO_OUT_Play() to play audio stream:
00035         Instance:  Select the output instance. It can only be 0 (SAI)
00036         pBuf: pointer to the audio data file address
00037         NbrOfBytes: Total size of the buffer to be sent in Bytes
00038
00039    + Call the function BSP_AUDIO_OUT_Pause() to pause playing
00040    + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
00041        Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00042           for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00043        Note. This function should be called only when the audio file is played or paused (not stopped).
00044    + Call the function BSP_AUDIO_OUT_Stop() to stop playing.
00045    + Call the function BSP_AUDIO_OUT_Mute() to mute the player.
00046    + Call the function BSP_AUDIO_OUT_UnMute() to unmute the player.
00047    + Call the function BSP_AUDIO_OUT_IsMute() to get the mute state(BSP_AUDIO_MUTE_ENABLED or BSP_AUDIO_MUTE_DISABLED).
00048    + Call the function BSP_AUDIO_OUT_SetDevice() to update the AUDIO OUT device.
00049    + Call the function BSP_AUDIO_OUT_GetDevice() to get the AUDIO OUT device.
00050    + Call the function BSP_AUDIO_OUT_SetSampleRate() to update the AUDIO OUT sample rate.
00051    + Call the function BSP_AUDIO_OUT_GetSampleRate() to get the AUDIO OUT sample rate.
00052    + Call the function BSP_AUDIO_OUT_SetBitsPerSample() to update the AUDIO OUT resolution.
00053    + Call the function BSP_AUDIO_OUT_GetBitPerSample() to get the AUDIO OUT resolution.
00054    + Call the function BSP_AUDIO_OUT_SetChannelsNbr() to update the AUDIO OUT number of channels.
00055    + Call the function BSP_AUDIO_OUT_GetChannelsNbr() to get the AUDIO OUT number of channels.
00056    + Call the function BSP_AUDIO_OUT_SetVolume() to update the AUDIO OUT volume.
00057    + Call the function BSP_AUDIO_OUT_GetVolume() to get the AUDIO OUT volume.
00058    + Call the function BSP_AUDIO_OUT_GetState() to get the AUDIO OUT state.
00059
00060    + BSP_AUDIO_OUT_SetDevice(), BSP_AUDIO_OUT_SetSampleRate(), BSP_AUDIO_OUT_SetBitsPerSample() and
00061      BSP_AUDIO_OUT_SetChannelsNbr() cannot be called while the state is AUDIO_OUT_STATE_PLAYING.
00062    + For each mode, you may need to implement the relative callback functions into your code.
00063       The Callback functions are named AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
00064       the STM32H735G_DISCO_audio.h file. (refer to the example for more details on the callbacks implementations)
00065
00066
00067    + Call the function BSP_AUDIO_IN_Init() for AUDIO IN initialization:
00068           Instance : Select the input instance. Can be 0 (SAI), 1 (I2S) or 2 (DFSDM)
00069         AudioInit: Audio In structure to select the following parameters
00070                    - Device: Select the input device (analog, digital micx)
00071                    - SampleRate: Select the input sample rate (8Khz .. 96Khz)
00072                    - BitsPerSample: Select the input resolution (16 or 32bits per sample)
00073                    - ChannelsNbr: Select the input channels number(1 for mono, 2 for stereo)
00074                    - Volume: Select the input volume(0% .. 100%)
00075
00076
00077       This function configures all the hardware required for the audio application (codec, I2C, SAI, I2S, DFSDM
00078       GPIOs, DMA and interrupt if needed). This function returns BSP_ERROR_NONE if configuration is OK.
00079       If the returned value is different from BSP_ERROR_NONE or the function is stuck then the communication with
00080       the codec or the MFX has failed (try to un-plug the power or reset device in this case).
00081       User can update the DFSDM/SAI or the clock configurations by overriding the weak MX functions MX_SAIx_Init(),
00082       MX_SAIx_ClockConfig(), MX_DFSDMx_Init() and MX_DFSDMx_ClockConfig()
00083       User can override the default MSP configuration and register his own MSP callbacks (defined at application level)
00084       by calling BSP_AUDIO_IN_RegisterMspCallbacks() function
00085       User can restore the default MSP configuration by calling BSP_AUDIO_IN_RegisterDefaultMspCallbacks()
00086       To use these two functions, user have to enable USE_HAL_SAI_REGISTER_CALLBACKS and/or USE_HAL_DFSDM_REGISTER_CALLBACKS
00087       within stm32h7xx_hal_conf.h file
00088
00089    + Call the function BSP_AUDIO_IN_Record() to record audio stream. The recorded data are stored to user buffer in raw
00090         (L, R, L, R ...)
00091           Instance : Select the input instance. Can be 0 (SAI), 1 (I2S) or 2 (DFSDM)
00092         pBuf: pointer to user buffer
00093         NbrOfBytes: Total size of the buffer to be sent in Bytes
00094
00095    + Call the function BSP_AUDIO_IN_Pause() to pause recording
00096    + Call the function BSP_AUDIO_IN_Resume() to resume recording.
00097    + Call the function BSP_AUDIO_IN_Stop() to stop recording.
00098    + Call the function BSP_AUDIO_IN_SetDevice() to update the AUDIO IN device.
00099    + Call the function BSP_AUDIO_IN_GetDevice() to get the AUDIO IN device.
00100    + Call the function BSP_AUDIO_IN_SetSampleRate() to update the AUDIO IN sample rate.
00101    + Call the function BSP_AUDIO_IN_GetSampleRate() to get the AUDIO IN sample rate.
00102    + Call the function BSP_AUDIO_IN_SetBitPerSample() to update the AUDIO IN resolution.
00103    + Call the function BSP_AUDIO_IN_GetBitPerSample() to get the AUDIO IN resolution.
00104    + Call the function BSP_AUDIO_IN_SetChannelsNbr() to update the AUDIO IN number of channels.
00105    + Call the function BSP_AUDIO_IN_GetChannelsNbr() to get the AUDIO IN number of channels.
00106    + Call the function BSP_AUDIO_IN_SetVolume() to update the AUDIO IN volume.
00107    + Call the function BSP_AUDIO_IN_GetVolume() to get the AUDIO IN volume.
00108    + Call the function BSP_AUDIO_IN_GetState() to get the AUDIO IN state.
00109    + Call the function BSP_AUDIO_IN_RecordChannels() to record audio stream. The recorded data are stored to user buffers separately
00110         (L, L, ...) (R, R ...). User has to process his data at application level.
00111         Instance : Select the input instance. Can be 2 (DFSDM)
00112         pBuf: pointer to user buffers table
00113         NbrOfBytes: Total size of the buffer to be sent in Bytes
00114    + Call the function BSP_AUDIO_IN_PauseChannels() to pause recording:
00115         Instance : Select the input instance. Can be 2 (DFSDM)
00116         Device: Select the input device (digital micX)
00117    + Call the function BSP_AUDIO_IN_ResumeChannels() to resume recording.
00118         Instance : Select the input instance. Can be 2 (DFSDM)
00119         Device: Select the input device (digital micX)
00120    + Call the function BSP_AUDIO_IN_StopChannels() to stop recording.
00121         Instance : Select the input instance. Can be 2 (DFSDM)
00122         Device: Select the input device (digital micX)
00123    + For each mode, you may need to implement the relative callback functions into your code.
00124       The Callback functions are named AUDIO_IN_XXX_CallBack() and only their prototypes are declared in
00125       the stm32h735g_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
00126
00127    + The driver API and the callback functions are at the end of the stm32h735g_discovery_audio.h file.
00128
00129   @endverbatim
00130   ******************************************************************************
00131   * @attention
00132   *
00133   * Copyright (c) 2019 STMicroelectronics.
00134   * All rights reserved.
00135   *
00136   * This software is licensed under terms that can be found in the LICENSE file
00137   * in the root directory of this software component.
00138   * If no LICENSE file comes with this software, it is provided AS-IS.
00139   *
00140   ******************************************************************************
00141   */
00142 /* Includes ------------------------------------------------------------------*/
00143 #include "stm32h735g_discovery_audio.h"
00144 #include "stm32h735g_discovery_bus.h"
00145
00146 /** @addtogroup BSP
00147   * @{
00148   */
00149
00150 /** @addtogroup STM32H735G_DISCO
00151   * @{
00152   */
00153
00154 /** @defgroup STM32H735G_DISCO_AUDIO AUDIO
00155   * @brief This file includes the low layer driver for cs42l51 Audio Codec
00156   *        available on STM32H735G_DISCO board(MB1332).
00157   * @{
00158   */
00159 /** @defgroup STM32H735G_DISCO_AUDIO_Private_Defines STM32H735G_DISCO_AUDIO Private Defines
00160   * @{
00161   */
00162
00163 /**
00164   * @}
00165   */
00166
00167 /** @defgroup STM32H735G_DISCO_AUDIO_Private_Macros AUDIO Private Macros
00168   * @{
00169   */
00170 /*### RECORD ###*/
00171 #define DFSDM_OVER_SAMPLING(__FREQUENCY__) \
00172         ((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (256U) \
00173       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (256U) \
00174       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (128U) \
00175       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (128U) \
00176       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (64U)  \
00177       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (64U)  \
00178       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (32U) : (16U)
00179
00180 #define DFSDM_CLOCK_DIVIDER(__FREQUENCY__) \
00181         ((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (24U) \
00182       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (4U)  \
00183       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (24U) \
00184       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (4U)  \
00185       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (24U) \
00186       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (4U)  \
00187       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (32U) : (32U)
00188
00189 #define DFSDM_FILTER_ORDER(__FREQUENCY__) \
00190         ((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (DFSDM_FILTER_SINC3_ORDER) \
00191       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (DFSDM_FILTER_SINC3_ORDER) \
00192       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (DFSDM_FILTER_SINC3_ORDER) \
00193       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (DFSDM_FILTER_SINC3_ORDER) \
00194       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (DFSDM_FILTER_SINC4_ORDER) \
00195       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (DFSDM_FILTER_SINC3_ORDER) \
00196       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (DFSDM_FILTER_SINC4_ORDER) : (DFSDM_FILTER_SINC5_ORDER)
00197
00198 #define DFSDM_MIC_BIT_SHIFT(__FREQUENCY__) \
00199         ((__FREQUENCY__) == (AUDIO_FREQUENCY_8K))  ? (5U) \
00200       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (6U) \
00201       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (3U) \
00202       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (3U) \
00203       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (6U) \
00204       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (0U) \
00205       : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (2U) : (2U)
00206
00207 /* Saturate the record PCM sample */
00208 #define SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))
00209
00210 /**
00211   * @}
00212   */
00213
00214 /** @defgroup STM32H735G_DISCO_AUDIO_Exported_Variables AUDIO Exported Variables
00215   * @{
00216   */
00217 /* Audio in and out component object */
00218 void *Audio_CompObj = NULL;
00219 /* Play  */
00220 SAI_HandleTypeDef                      haudio_out_sai = {0};
00221 AUDIO_OUT_Ctx_t                        Audio_Out_Ctx[AUDIO_OUT_INSTANCES_NBR];
00222
00223 /* Record */
00224 DFSDM_Filter_HandleTypeDef             haudio_in_dfsdm_filter[DFSDM_MIC_NUMBER];
00225 DFSDM_Channel_HandleTypeDef            haudio_in_dfsdm_channel[DFSDM_MIC_NUMBER];
00226 SAI_HandleTypeDef                      haudio_in_sai[2] = {0};
00227 AUDIO_IN_Ctx_t                         Audio_In_Ctx[AUDIO_IN_INSTANCES_NBR];
00228 /**
00229   * @}
00230   */
00231
00232 /** @defgroup STM32H735G_DISCO_AUDIO_Private_Variables AUDIO Private Variables
00233   * @{
00234   */
00235 /* Audio in and out driver */
00236 static AUDIO_Drv_t *Audio_Drv = NULL;
00237
00238 /* Recording DFSDM DMA handles */
00239 static DMA_HandleTypeDef               hDmaDfsdm[DFSDM_MIC_NUMBER];
00240
00241 /* Recording Buffer Trigger */
00242 static __IO uint32_t                   RecBuffTrigger          = 0;
00243 static __IO uint32_t                   RecBuffHalf             = 0;
00244
00245 ALIGN_32BYTES(static int32_t           MicRecBuff[2][DEFAULT_AUDIO_IN_BUFFER_SIZE]);
00246 static __IO uint32_t                   MicBuffIndex[DFSDM_MIC_NUMBER];
00247
00248 #if (USE_BSP_PDM_LIB_FEATURE > 0U)
00249 /* PDM filters params */
00250 static PDM_Filter_Handler_t            PDM_FilterHandler[2];
00251 static PDM_Filter_Config_t             PDM_FilterConfig[2];
00252 #endif
00253
00254 /**
00255   * @}
00256   */
00257
00258 /** @defgroup STM32H735G_DISCO_AUDIO_Private_Function_Prototypes AUDIO Private Function Prototypes
00259   * @{
00260   */
00261 /* SAI Msp config */
00262 static void SAI_MspInit(SAI_HandleTypeDef *hsai);
00263 static void SAI_MspDeInit(SAI_HandleTypeDef *hsai);
00264
00265 /* SAI callbacks */
00266 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00267 static void SAI_TxCpltCallback(SAI_HandleTypeDef *hsai);
00268 static void SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai);
00269 static void SAI_RxCpltCallback(SAI_HandleTypeDef *hsai);
00270 static void SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai);
00271 static void SAI_ErrorCallback(SAI_HandleTypeDef *hsai);
00272 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
00273
00274 /* DFSDM Channel Msp config */
00275 static void DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hDfsdmChannel);
00276 static void DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hDfsdmChannel);
00277
00278 /* DFSDM Filter Msp config */
00279 static void DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hDfsdmFilter);
00280 static void DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hDfsdmFilter);
00281
00282 /* DFSDM Filter conversion callbacks */
00283 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
00284 static void DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
00285 static void DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
00286 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
00287
00288 #if (USE_AUDIO_CODEC_WM8994 == 1)
00289 static int32_t WM8994_Probe(void);
00290 #endif
00291
00292 /**
00293   * @}
00294   */
00295
00296 /** @defgroup STM32H735G_DISCO_AUDIO_OUT_Exported_Functions AUDIO OUT Exported Functions
00297   * @{
00298   */
00299 /**
00300   * @brief  Configures the audio peripherals.
00301   * @param  Instance   AUDIO OUT Instance. It can only be 0 (SAI)
00302   * @param  AudioInit  AUDIO OUT init Structure
00303   * @retval BSP status
00304   */
00305 int32_t BSP_AUDIO_OUT_Init(uint32_t Instance, BSP_AUDIO_Init_t* AudioInit)
00306 {
00307   int32_t ret = BSP_ERROR_NONE;
00308
00309   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00310   {
00311     ret = BSP_ERROR_WRONG_PARAM;
00312   }
00313   else
00314   {
00315     /* Fill Audio_Out_Ctx structure */
00316     Audio_Out_Ctx[Instance].Device         = AudioInit->Device;
00317     Audio_Out_Ctx[Instance].Instance       = Instance;
00318     Audio_Out_Ctx[Instance].SampleRate     = AudioInit->SampleRate;
00319     Audio_Out_Ctx[Instance].BitsPerSample  = AudioInit->BitsPerSample;
00320     Audio_Out_Ctx[Instance].ChannelsNbr    = AudioInit->ChannelsNbr;
00321     Audio_Out_Ctx[Instance].Volume         = AudioInit->Volume;
00322     Audio_Out_Ctx[Instance].State          = AUDIO_OUT_STATE_RESET;
00323
00324 #if (USE_AUDIO_CODEC_WM8994 == 1)
00325     if (Audio_In_Ctx[0].State == AUDIO_IN_STATE_RESET)
00326     {
00327       if(WM8994_Probe() != BSP_ERROR_NONE)
00328       {
00329         ret = BSP_ERROR_COMPONENT_FAILURE;
00330       }
00331     }
00332 #endif
00333     if(ret == BSP_ERROR_NONE)
00334     {
00335       /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00336       if(MX_SAI1_ClockConfig(&haudio_out_sai, AudioInit->SampleRate) != HAL_OK)
00337       {
00338         ret = BSP_ERROR_CLOCK_FAILURE;
00339       }
00340       else
00341       {
00342         /* SAI data transfer preparation:
00343         Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00344         haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00345 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00346         /* Register the MSP Callbacks */
00347         if(Audio_Out_Ctx[Instance].IsMspCallbacksValid == 0U)
00348         {
00349           if(BSP_AUDIO_OUT_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
00350           {
00351             ret = BSP_ERROR_PERIPH_FAILURE;
00352           }
00353         }
00354 #else
00355         SAI_MspInit(&haudio_out_sai);
00356 #endif
00357       }
00358
00359
00360       if(ret == BSP_ERROR_NONE)
00361       {
00362         MX_SAI_Config mx_sai_config;
00363
00364         /* Prepare haudio_out_sai handle */
00365         mx_sai_config.AudioFrequency    = AudioInit->SampleRate;
00366         mx_sai_config.AudioMode         = SAI_MODEMASTER_TX;
00367         mx_sai_config.ClockStrobing     = SAI_CLOCKSTROBING_RISINGEDGE;
00368         mx_sai_config.MonoStereoMode    = (AudioInit->ChannelsNbr == 1U) ? SAI_MONOMODE : SAI_STEREOMODE;
00369         if (AudioInit->BitsPerSample == AUDIO_RESOLUTION_32B)
00370         {
00371           mx_sai_config.DataSize          = SAI_DATASIZE_32;
00372           mx_sai_config.FrameLength       = 128;
00373           mx_sai_config.ActiveFrameLength = 64;
00374         }
00375         else
00376         {
00377           mx_sai_config.DataSize          = SAI_DATASIZE_16;
00378           mx_sai_config.FrameLength       = 64;
00379           mx_sai_config.ActiveFrameLength = 32;
00380         }
00381
00382         mx_sai_config.OutputDrive       = SAI_OUTPUTDRIVE_ENABLE;
00383         mx_sai_config.Synchro           = SAI_ASYNCHRONOUS;
00384         mx_sai_config.SynchroExt        = SAI_SYNCEXT_DISABLE;
00385         switch(AudioInit->Device)
00386         {
00387         case AUDIO_OUT_DEVICE_SPK_HP:
00388         case AUDIO_OUT_DEVICE_AUTO:
00389           mx_sai_config.SlotActive         = CODEC_AUDIOFRAME_SLOT_0123;
00390           break;
00391         case AUDIO_OUT_DEVICE_SPEAKER:
00392           mx_sai_config.SlotActive         = CODEC_AUDIOFRAME_SLOT_13;
00393           break;
00394         case AUDIO_OUT_DEVICE_HEADPHONE:
00395         default:
00396           mx_sai_config.SlotActive         = CODEC_AUDIOFRAME_SLOT_02;
00397           break;
00398         }
00399
00400         /* SAI peripheral initialization: this __weak function can be redefined by the application  */
00401         if(MX_SAI1_Block_B_Init(&haudio_out_sai, &mx_sai_config) != HAL_OK)
00402         {
00403           ret = BSP_ERROR_PERIPH_FAILURE;
00404         }
00405 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00406         /* Register SAI TC, HT and Error callbacks */
00407         else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) != HAL_OK)
00408         {
00409           ret = BSP_ERROR_PERIPH_FAILURE;
00410         }
00411         else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) != HAL_OK)
00412         {
00413           ret = BSP_ERROR_PERIPH_FAILURE;
00414         }
00415         else
00416         {
00417           if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
00418           {
00419             ret = BSP_ERROR_PERIPH_FAILURE;
00420           }
00421         }
00422 #endif
00423
00424         if(ret == BSP_ERROR_NONE)
00425         {
00426 #if (USE_AUDIO_CODEC_WM8994 == 1)
00427           WM8994_Init_t codec_init;
00428           /* Fill codec_init structure */
00429           codec_init.InputDevice  = (Audio_In_Ctx[0].State == AUDIO_IN_STATE_RESET) ? WM8994_IN_NONE : WM8994_IN_LINE1;
00430           switch (AudioInit->Device)
00431           {
00432           case AUDIO_OUT_DEVICE_SPK_HP:
00433             codec_init.OutputDevice = WM8994_OUT_SPEAKER;
00434             break;
00435           case AUDIO_OUT_DEVICE_AUTO:
00436             codec_init.OutputDevice = WM8994_OUT_AUTO;
00437             break;
00438           case AUDIO_OUT_DEVICE_SPEAKER:
00439             codec_init.OutputDevice = WM8994_OUT_SPEAKER;
00440             break;
00441           case AUDIO_OUT_DEVICE_HEADPHONE:
00442           default:
00443             codec_init.OutputDevice = WM8994_OUT_HEADPHONE;
00444             break;
00445           }
00446           codec_init.Frequency    = AudioInit->SampleRate;
00447           codec_init.Resolution   = (AudioInit->BitsPerSample == AUDIO_RESOLUTION_32B) ? WM8994_RESOLUTION_32b : WM8994_RESOLUTION_16b;
00448           /* Convert volume before sending to the codec */
00449           codec_init.Volume       = VOLUME_OUT_CONVERT(AudioInit->Volume);
00450           /* Initialize the codec internal registers */
00451           if(Audio_Drv->Init(Audio_CompObj, &codec_init) < 0)
00452           {
00453             ret = BSP_ERROR_COMPONENT_FAILURE;
00454           }
00455 #endif
00456           /* Update BSP AUDIO OUT state */
00457           Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_STOP;
00458         }
00459       }
00460     }
00461   }
00462
00463   return ret;
00464 }
00465
00466 /**
00467   * @brief  De-initializes the audio out peripheral.
00468   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00469   * @retval None
00470   */
00471 int32_t BSP_AUDIO_OUT_DeInit(uint32_t Instance)
00472 {
00473   int32_t ret = BSP_ERROR_NONE;
00474
00475   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00476   {
00477     ret = BSP_ERROR_WRONG_PARAM;
00478   }
00479   else
00480   {
00481 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
00482     SAI_MspDeInit(&haudio_out_sai);
00483 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 0U) */
00484     /* Initialize the haudio_out_sai Instance parameter */
00485     haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00486     /* Call the Media layer stop function */
00487     if(Audio_Drv->DeInit(Audio_CompObj) != 0)
00488     {
00489       ret = BSP_ERROR_COMPONENT_FAILURE;
00490     }
00491     else if(HAL_SAI_DeInit(&haudio_out_sai) != HAL_OK)
00492     {
00493       ret = BSP_ERROR_PERIPH_FAILURE;
00494     }
00495     else
00496     {
00497       /* Update BSP AUDIO OUT state */
00498       Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_RESET;
00499     }
00500   }
00501   /* Return BSP status */
00502   return ret;
00503 }
00504
00505 /**
00506   * @brief  Initializes the Audio Codec audio out instance (SAI).
00507   * @param  hsai SAI handle
00508   * @param  MXConfig SAI confiruration structure
00509   * @note   Being __weak it can be overwritten by the application
00510   * @retval HAL status
00511   */
00512 __weak HAL_StatusTypeDef MX_SAI1_Block_B_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig)
00513 {
00514   HAL_StatusTypeDef ret = HAL_OK;
00515
00516   /* Disable SAI peripheral to allow access to SAI internal registers */
00517   __HAL_SAI_DISABLE(hsai);
00518
00519   /* Configure SAI1_Block_B */
00520   hsai->Init.MonoStereoMode       = MXConfig->MonoStereoMode;
00521   hsai->Init.AudioFrequency       = MXConfig->AudioFrequency;
00522   hsai->Init.AudioMode            = MXConfig->AudioMode;
00523   hsai->Init.NoDivider            = SAI_MASTERDIVIDER_ENABLE;
00524   hsai->Init.Protocol             = SAI_FREE_PROTOCOL;
00525   hsai->Init.DataSize             = MXConfig->DataSize;
00526   hsai->Init.FirstBit             = SAI_FIRSTBIT_MSB;
00527   hsai->Init.ClockStrobing        = MXConfig->ClockStrobing;
00528   hsai->Init.Synchro              = MXConfig->Synchro;
00529   hsai->Init.OutputDrive          = MXConfig->OutputDrive;
00530   hsai->Init.FIFOThreshold        = SAI_FIFOTHRESHOLD_1QF;
00531   hsai->Init.SynchroExt           = MXConfig->SynchroExt;
00532   hsai->Init.CompandingMode       = SAI_NOCOMPANDING;
00533   hsai->Init.TriState             = SAI_OUTPUT_NOTRELEASED;
00534   hsai->Init.Mckdiv               = 0;
00535   hsai->Init.MckOutput            = SAI_MCK_OUTPUT_ENABLE;
00536   hsai->Init.MckOverSampling      = SAI_MCK_OVERSAMPLING_DISABLE;
00537   hsai->Init.PdmInit.Activation   = DISABLE;
00538
00539   /* Configure SAI_Block_x Frame */
00540   hsai->FrameInit.FrameLength       = MXConfig->FrameLength;
00541   hsai->FrameInit.ActiveFrameLength = MXConfig->ActiveFrameLength;
00542   hsai->FrameInit.FSDefinition      = SAI_FS_CHANNEL_IDENTIFICATION;
00543   hsai->FrameInit.FSPolarity        = SAI_FS_ACTIVE_LOW;
00544   hsai->FrameInit.FSOffset          = SAI_FS_BEFOREFIRSTBIT;
00545
00546   /* Configure SAI Block_x Slot */
00547   hsai->SlotInit.FirstBitOffset     = 0;
00548   if ((MXConfig->DataSize == AUDIO_RESOLUTION_24B) || (MXConfig->DataSize == AUDIO_RESOLUTION_32B))
00549   {
00550     hsai->SlotInit.SlotSize         = SAI_SLOTSIZE_32B;
00551   }
00552   else
00553   {
00554     hsai->SlotInit.SlotSize         = SAI_SLOTSIZE_16B;
00555   }
00556   hsai->SlotInit.SlotNumber         = 4;
00557   hsai->SlotInit.SlotActive         = MXConfig->SlotActive;
00558
00559   if(HAL_SAI_Init(hsai) != HAL_OK)
00560   {
00561     ret = HAL_ERROR;
00562   }
00563   __HAL_SAI_ENABLE(hsai);
00564
00565   return ret;
00566 }
00567
00568 /**
00569   * @brief  SAI clock Config.
00570   * @param  hsai SAI handle
00571   * @param  SampleRate  Audio frequency used to play the audio stream.
00572   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
00573   *         Being __weak it can be overwritten by the application
00574   * @retval HAL status
00575   */
00576 __weak HAL_StatusTypeDef MX_SAI1_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate)
00577 {
00578   /* Prevent unused argument(s) compilation warning */
00579   UNUSED(hsai);
00580
00581   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00582   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00583
00584   /* Set the PLL configuration according to the audio frequency */
00585   /* Set the PLL configuration according to the audio frequency */
00586   if((SampleRate == AUDIO_FREQUENCY_11K) || (SampleRate == AUDIO_FREQUENCY_22K) || (SampleRate == AUDIO_FREQUENCY_44K))
00587   {
00588     rcc_ex_clk_init_struct.PLL2.PLL2P = 36;
00589     rcc_ex_clk_init_struct.PLL2.PLL2Q = 36;
00590   }
00591   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_32K, AUDIO_FREQUENCY_48K, AUDIO_FREQUENCY_96K */
00592   {
00593     rcc_ex_clk_init_struct.PLL2.PLL2P = 8;
00594     rcc_ex_clk_init_struct.PLL2.PLL2Q = 8;
00595   }
00596   rcc_ex_clk_init_struct.PLL2.PLL2N = 80;
00597
00598   rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
00599   rcc_ex_clk_init_struct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLL2;
00600   rcc_ex_clk_init_struct.PLL2.PLL2R = 2;
00601   rcc_ex_clk_init_struct.PLL2.PLL2M = 5;
00602   rcc_ex_clk_init_struct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0;
00603   rcc_ex_clk_init_struct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM;
00604   rcc_ex_clk_init_struct.PLL2.PLL2FRACN = 0;
00605   return HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00606 }
00607
00608 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00609 /**
00610   * @brief Default BSP AUDIO OUT Msp Callbacks
00611   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00612   * @retval BSP status
00613   */
00614 int32_t BSP_AUDIO_OUT_RegisterDefaultMspCallbacks (uint32_t Instance)
00615 {
00616   int32_t ret = BSP_ERROR_NONE;
00617
00618   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00619   {
00620     ret = BSP_ERROR_WRONG_PARAM;
00621   }
00622   else
00623   {
00624     __HAL_SAI_RESET_HANDLE_STATE(&haudio_out_sai);
00625 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00626     /* Register MspInit/MspDeInit Callbacks */
00627     if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPINIT_CB_ID,SAI_MspInit) != HAL_OK)
00628     {
00629       ret = BSP_ERROR_PERIPH_FAILURE;
00630     }
00631     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPDEINIT_CB_ID,SAI_MspDeInit) != HAL_OK)
00632     {
00633       ret = BSP_ERROR_PERIPH_FAILURE;
00634     }
00635     else
00636     {
00637       Audio_Out_Ctx[Instance].IsMspCallbacksValid = 1;
00638     }
00639 #endif
00640   }
00641
00642   /* Return BSP status */
00643   return ret;
00644 }
00645
00646 /**
00647   * @brief BSP AUDIO OUT Msp Callback registering
00648   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00649   * @param CallBacks   pointer to MspInit/MspDeInit callbacks functions
00650   * @retval BSP status
00651   */
00652 int32_t BSP_AUDIO_OUT_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_OUT_Cb_t *CallBacks)
00653 {
00654   int32_t ret = BSP_ERROR_NONE;
00655
00656   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00657   {
00658     ret = BSP_ERROR_WRONG_PARAM;
00659   }
00660   else
00661   {
00662     __HAL_SAI_RESET_HANDLE_STATE(&haudio_out_sai);
00663 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00664     /* Register MspInit/MspDeInit Callbacks */
00665     if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPINIT_CB_ID, CallBacks->pMspSaiInitCb) != HAL_OK)
00666     {
00667       ret = BSP_ERROR_PERIPH_FAILURE;
00668     }
00669     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPDEINIT_CB_ID, CallBacks->pMspSaiDeInitCb) != HAL_OK)
00670     {
00671       ret = BSP_ERROR_PERIPH_FAILURE;
00672     }
00673     else
00674     {
00675       Audio_Out_Ctx[Instance].IsMspCallbacksValid = 1;
00676     }
00677 #endif
00678   }
00679
00680   /* Return BSP status */
00681   return ret;
00682 }
00683 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
00684
00685 /**
00686   * @brief  Starts playing audio stream from a data buffer for a determined size.
00687   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00688   * @param  pData         pointer on data address
00689   * @param  NbrOfBytes   Size of total samples in bytes
00690   *                      BitsPerSample: 16 or 32
00691   * @retval BSP status
00692   */
00693 int32_t BSP_AUDIO_OUT_Play(uint32_t Instance, uint8_t* pData, uint32_t NbrOfBytes)
00694 {
00695   int32_t ret = BSP_ERROR_NONE;
00696
00697   if((Instance >= AUDIO_OUT_INSTANCES_NBR) || (((NbrOfBytes / (Audio_Out_Ctx[Instance].BitsPerSample/8U)) > 0xFFFFU)))
00698   {
00699     ret = BSP_ERROR_WRONG_PARAM;
00700   }
00701   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_STOP)
00702   {
00703     ret = BSP_ERROR_BUSY;
00704   }
00705   else if(HAL_SAI_Transmit_DMA(&haudio_out_sai, pData, (uint16_t)(NbrOfBytes /(Audio_Out_Ctx[Instance].BitsPerSample/8U))) != HAL_OK)
00706   {
00707     ret = BSP_ERROR_PERIPH_FAILURE;
00708   }
00709   else if(Audio_Drv->Play(Audio_CompObj) < 0)
00710   {
00711     ret = BSP_ERROR_COMPONENT_FAILURE;
00712   }
00713   else
00714   {
00715     /* Update BSP AUDIO OUT state */
00716     Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_PLAYING;
00717   }
00718
00719   /* Return BSP status */
00720   return ret;
00721 }
00722
00723 /**
00724   * @brief  This function Pauses the audio file stream. In case
00725   *         of using DMA, the DMA Pause feature is used.
00726   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00727   * @note   When calling BSP_AUDIO_OUT_Pause() function for pause, only
00728   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00729   *          function for resume could lead to unexpected behavior).
00730   * @retval BSP status
00731   */
00732 int32_t BSP_AUDIO_OUT_Pause(uint32_t Instance)
00733 {
00734   int32_t ret = BSP_ERROR_NONE;
00735
00736   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
00737   {
00738     ret = BSP_ERROR_WRONG_PARAM;
00739   }
00740   /* Check audio out state */
00741   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_PLAYING)
00742   {
00743     ret = BSP_ERROR_BUSY;
00744   }
00745   /* Call the audio codec pause function */
00746   else if (Audio_Drv->Pause(Audio_CompObj) < 0)
00747   {
00748     ret = BSP_ERROR_COMPONENT_FAILURE;
00749   }/* Pause DMA transfer of audio samples towards the serial audio interface */
00750   else if(HAL_SAI_DMAPause(&haudio_out_sai) != HAL_OK)
00751   {
00752     ret = BSP_ERROR_PERIPH_FAILURE;
00753   }
00754   else
00755   {
00756     /* Update BSP AUDIO OUT state */
00757     Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_PAUSE;
00758   }
00759
00760   /* Return BSP status */
00761   return ret;
00762 }
00763
00764 /**
00765   * @brief   Resumes the audio file stream.
00766   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00767   * @note    When calling BSP_AUDIO_OUT_Pause() function for pause, only
00768   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00769   *          function for resume could lead to unexpected behavior).
00770   * @retval BSP status
00771   */
00772 int32_t BSP_AUDIO_OUT_Resume(uint32_t Instance)
00773 {
00774   int32_t ret = BSP_ERROR_NONE;
00775
00776   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
00777   {
00778     ret = BSP_ERROR_WRONG_PARAM;
00779   }
00780   /* Check audio out state */
00781   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_PAUSE)
00782   {
00783     ret = BSP_ERROR_BUSY;
00784   }
00785   /* Call the audio codec resume function */
00786   else if (Audio_Drv->Resume(Audio_CompObj) < 0)
00787   {
00788     ret = BSP_ERROR_COMPONENT_FAILURE;
00789   }/* Resume DMA transfer of audio samples towards the serial audio interface */
00790   else if(HAL_SAI_DMAResume(&haudio_out_sai) != HAL_OK)
00791   {
00792     ret = BSP_ERROR_PERIPH_FAILURE;
00793   }
00794   else
00795   {
00796     /* Update BSP AUDIO OUT state */
00797     Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_PLAYING;
00798   }
00799
00800   /* Return BSP status */
00801   return ret;
00802 }
00803
00804 /**
00805   * @brief  Stops audio playing and Power down the Audio Codec.
00806   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00807   * @retval BSP status
00808   */
00809 int32_t BSP_AUDIO_OUT_Stop(uint32_t Instance)
00810 {
00811   int32_t ret = BSP_ERROR_NONE;
00812
00813   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
00814   {
00815     ret = BSP_ERROR_WRONG_PARAM;
00816   }
00817   /* Check audio out state */
00818   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_STOP)
00819   {
00820     /* Nothing to do */
00821   }
00822   else if ((Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_PLAYING) &&
00823            (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_PAUSE))
00824   {
00825     ret = BSP_ERROR_BUSY;
00826   }
00827   /* Call the Media layer stop function */
00828   else if(Audio_Drv->Stop(Audio_CompObj, CODEC_PDWN_SW) < 0)
00829   {
00830     ret = BSP_ERROR_COMPONENT_FAILURE;
00831   }
00832   else if(HAL_SAI_DMAStop(&haudio_out_sai)!= HAL_OK)
00833   {
00834     ret = BSP_ERROR_PERIPH_FAILURE;
00835   }
00836   else
00837   {
00838     /* Update BSP AUDIO OUT state */
00839     Audio_Out_Ctx[Instance].State = AUDIO_OUT_STATE_STOP;
00840   }
00841
00842   /* Return BSP status */
00843   return ret;
00844 }
00845
00846 /**
00847   * @brief  Controls the current audio volume level.
00848   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00849   * @param  Volume    Volume level to be set in percentage from 0% to 100% (0 for
00850   *         Mute and 100 for Max volume level).
00851   * @retval BSP status
00852   */
00853 int32_t BSP_AUDIO_OUT_SetVolume(uint32_t Instance, uint32_t Volume)
00854 {
00855   int32_t ret = BSP_ERROR_NONE;
00856
00857   if ((Instance >= AUDIO_OUT_INSTANCES_NBR) || (Volume > 100U))
00858   {
00859     ret = BSP_ERROR_WRONG_PARAM;
00860   }
00861   else
00862   {
00863     /* Call the codec volume control function with converted volume value */
00864     if(Audio_Drv->SetVolume(Audio_CompObj, AUDIO_VOLUME_OUTPUT, Volume) < 0)
00865     {
00866       ret = BSP_ERROR_COMPONENT_FAILURE;
00867     }
00868     else if(Volume == 0U)
00869     {
00870       /* Update Mute State */
00871       Audio_Out_Ctx[Instance].IsMute = BSP_AUDIO_MUTE_ENABLED;
00872     }
00873     else
00874     {
00875       /* Update Mute State */
00876       Audio_Out_Ctx[Instance].IsMute = BSP_AUDIO_MUTE_DISABLED;
00877     }
00878    Audio_Out_Ctx[Instance].Volume = Volume;
00879   }
00880
00881   /* Return BSP status */
00882   return ret;
00883 }
00884
00885 /**
00886   * @brief  Get the current audio volume level.
00887   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00888   * @param  Volume    pointer to volume to be returned
00889   * @retval BSP status
00890   */
00891 int32_t BSP_AUDIO_OUT_GetVolume(uint32_t Instance, uint32_t *Volume)
00892 {
00893   int32_t ret = BSP_ERROR_NONE;
00894
00895   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00896   {
00897     ret = BSP_ERROR_WRONG_PARAM;
00898   }
00899   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
00900   {
00901     ret = BSP_ERROR_BUSY;
00902   }
00903   else
00904   {
00905     *Volume = Audio_Out_Ctx[Instance].Volume;
00906   }
00907   /* Return BSP status */
00908   return ret;
00909 }
00910
00911 /**
00912   * @brief  Enables the MUTE
00913   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00914   * @retval BSP status
00915   */
00916 int32_t BSP_AUDIO_OUT_Mute(uint32_t Instance)
00917 {
00918   int32_t ret = BSP_ERROR_NONE;
00919
00920   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
00921   {
00922     ret = BSP_ERROR_WRONG_PARAM;
00923   }
00924   /* Check audio out state */
00925   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
00926   {
00927     ret = BSP_ERROR_BUSY;
00928   }
00929   /* Check audio out mute status */
00930   else if (Audio_Out_Ctx[Instance].IsMute == 1U)
00931   {
00932     /* Nothing to do */
00933   }
00934   /* Call the audio codec mute function */
00935   else if (Audio_Drv->SetMute(Audio_CompObj, CODEC_MUTE_ON) < 0)
00936   {
00937     ret = BSP_ERROR_COMPONENT_FAILURE;
00938   }
00939   else
00940   {
00941     /* Update audio out mute status */
00942     Audio_Out_Ctx[Instance].IsMute = 1U;
00943   }
00944
00945   /* Return BSP status */
00946   return ret;
00947 }
00948
00949 /**
00950   * @brief  Disables the MUTE mode
00951   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00952   * @retval BSP status
00953   */
00954 int32_t BSP_AUDIO_OUT_UnMute(uint32_t Instance)
00955 {
00956   int32_t ret = BSP_ERROR_NONE;
00957
00958   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
00959   {
00960     ret = BSP_ERROR_WRONG_PARAM;
00961   }
00962   /* Check audio out state */
00963   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
00964   {
00965     ret = BSP_ERROR_BUSY;
00966   }
00967   /* Check audio out mute status */
00968   else if (Audio_Out_Ctx[Instance].IsMute == 0U)
00969   {
00970     /* Nothing to do */
00971   }
00972   /* Call the audio codec mute function */
00973   else if (Audio_Drv->SetMute(Audio_CompObj, CODEC_MUTE_OFF) < 0)
00974   {
00975     ret = BSP_ERROR_COMPONENT_FAILURE;
00976   }
00977   else
00978   {
00979     /* Update audio out mute status */
00980     Audio_Out_Ctx[Instance].IsMute = 0U;
00981   }
00982
00983   /* Return BSP status */
00984   return ret;
00985 }
00986
00987 /**
00988   * @brief  Check whether the MUTE mode is enabled or not
00989   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
00990   * @param  IsMute    pointer to mute state
00991   * @retval Mute status
00992   */
00993 int32_t BSP_AUDIO_OUT_IsMute(uint32_t Instance, uint32_t *IsMute)
00994 {
00995   int32_t ret = BSP_ERROR_NONE;
00996
00997   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
00998   {
00999     ret = BSP_ERROR_WRONG_PARAM;
01000   }
01001   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
01002   {
01003     ret = BSP_ERROR_BUSY;
01004   }
01005   else
01006   {
01007     *IsMute = Audio_Out_Ctx[Instance].IsMute;
01008   }
01009   /* Return BSP status */
01010   return ret;
01011 }
01012
01013 /**
01014   * @brief  Switch dynamically (while audio file is played) the output target
01015   *         (speaker or headphone).
01016   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01017   * @param  Device  The audio output device
01018   * @retval BSP status
01019   */
01020 int32_t BSP_AUDIO_OUT_SetDevice(uint32_t Instance, uint32_t Device)
01021 {
01022   int32_t ret = BSP_ERROR_NONE;
01023
01024   UNUSED(Device);
01025
01026   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
01027   {
01028     ret = BSP_ERROR_WRONG_PARAM;
01029   }
01030   /* Check audio out state */
01031   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_STOP)
01032   {
01033     ret = BSP_ERROR_BUSY;
01034   }
01035   else
01036   {
01037     /* Nothing to do because there is only one device (AUDIO_OUT_DEVICE_HEADPHONE) */
01038   }
01039
01040   /* Return BSP status */
01041   return ret;
01042 }
01043
01044
01045 /**
01046   * @brief  Get the Output Device
01047   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01048   * @param  Device    The audio output device
01049   * @retval BSP status
01050   */
01051 int32_t BSP_AUDIO_OUT_GetDevice(uint32_t Instance, uint32_t *Device)
01052 {
01053   int32_t ret = BSP_ERROR_NONE;
01054
01055   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
01056   {
01057     ret = BSP_ERROR_WRONG_PARAM;
01058   }
01059   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
01060   {
01061     ret = BSP_ERROR_BUSY;
01062   }
01063   else
01064   {
01065     /* Get Audio_Out_Ctx Device */
01066     *Device = Audio_Out_Ctx[Instance].Device;
01067   }
01068   /* Return BSP status */
01069   return ret;
01070 }
01071
01072 /**
01073   * @brief  Updates the audio frequency.
01074   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01075   * @param  SampleRate Audio frequency used to play the audio stream.
01076   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
01077   *         audio frequency.
01078   * @retval BSP status
01079   */
01080 int32_t BSP_AUDIO_OUT_SetSampleRate(uint32_t Instance, uint32_t SampleRate)
01081 {
01082   int32_t ret = BSP_ERROR_NONE;
01083
01084   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
01085   {
01086     ret = BSP_ERROR_WRONG_PARAM;
01087   }
01088   /* Check audio out state */
01089   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_STOP)
01090   {
01091     ret = BSP_ERROR_BUSY;
01092   }
01093   /* Check if record on instance 0 is on going and corresponding sample rate */
01094   else if ((Audio_In_Ctx[0].State != AUDIO_IN_STATE_RESET) &&
01095            (Audio_In_Ctx[0].SampleRate != SampleRate))
01096   {
01097     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
01098   }/* Check if sample rate is modified */
01099   else if (Audio_Out_Ctx[Instance].SampleRate == SampleRate)
01100   {
01101     /* Nothing to do */
01102   }
01103   else
01104   {
01105     /* Update the SAI audio frequency configuration */
01106     haudio_out_sai.Init.AudioFrequency = SampleRate;
01107     /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
01108     if(MX_SAI1_ClockConfig(&haudio_out_sai, SampleRate) != HAL_OK)
01109     {
01110       ret = BSP_ERROR_PERIPH_FAILURE;
01111     }
01112     else if(HAL_SAI_Init(&haudio_out_sai) != HAL_OK)
01113     {
01114       ret = BSP_ERROR_PERIPH_FAILURE;
01115     }
01116     else
01117     {
01118 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01119       /* Register SAI TC, HT and Error callbacks */
01120       if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) != HAL_OK)
01121       {
01122         return BSP_ERROR_PERIPH_FAILURE;
01123       }
01124       if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) != HAL_OK)
01125       {
01126         return BSP_ERROR_PERIPH_FAILURE;
01127       }
01128       if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
01129       {
01130         return BSP_ERROR_PERIPH_FAILURE;
01131       }
01132 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01133
01134       /* Store new sample rate */
01135       Audio_Out_Ctx[Instance].SampleRate = SampleRate;
01136     }
01137   }
01138
01139   /* Return BSP status */
01140   return ret;
01141 }
01142
01143 /**
01144   * @brief  Get the audio frequency.
01145   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01146   * @param  SampleRate  Audio frequency used to play the audio stream.
01147   * @retval BSP status
01148   */
01149 int32_t BSP_AUDIO_OUT_GetSampleRate(uint32_t Instance, uint32_t *SampleRate)
01150 {
01151   int32_t ret = BSP_ERROR_NONE;
01152
01153   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
01154   {
01155     ret = BSP_ERROR_WRONG_PARAM;
01156   }
01157   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
01158   {
01159     ret = BSP_ERROR_BUSY;
01160   }
01161   else
01162   {
01163     *SampleRate = Audio_Out_Ctx[Instance].SampleRate;
01164   }
01165   /* Return BSP status */
01166   return ret;
01167 }
01168
01169 /**
01170   * @brief  Get the audio Resolution.
01171   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01172   * @param  BitsPerSample  Audio Resolution used to play the audio stream.
01173   * @retval BSP status
01174   */
01175 int32_t BSP_AUDIO_OUT_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample)
01176 {
01177   int32_t ret = BSP_ERROR_NONE;
01178
01179   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
01180   {
01181     ret = BSP_ERROR_WRONG_PARAM;
01182   }
01183   else if ((Instance == 0U) && ((BitsPerSample == AUDIO_RESOLUTION_24B) || (BitsPerSample == AUDIO_RESOLUTION_8B)))
01184   {
01185     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
01186   }
01187   else if ((Instance == 0U) && (Audio_In_Ctx[0].State != AUDIO_IN_STATE_RESET) &&
01188            (Audio_In_Ctx[0].BitsPerSample != BitsPerSample))
01189   {
01190     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
01191   }
01192   /* Check audio out state */
01193   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_STOP)
01194   {
01195     ret = BSP_ERROR_BUSY;
01196   }
01197   else
01198   {
01199     /* Store new bits per sample on audio out context */
01200     Audio_Out_Ctx[Instance].BitsPerSample = BitsPerSample;
01201
01202     /* Update data size, frame length and active frame length parameters of SAI handle */
01203     if (BitsPerSample == AUDIO_RESOLUTION_32B)
01204     {
01205       haudio_out_sai.Init.DataSize               = SAI_DATASIZE_32;
01206       haudio_out_sai.FrameInit.FrameLength       = 128;
01207       haudio_out_sai.FrameInit.ActiveFrameLength = 64;
01208     }
01209     else
01210     {
01211       haudio_out_sai.Init.DataSize               = SAI_DATASIZE_16;
01212       haudio_out_sai.FrameInit.FrameLength       = 64;
01213       haudio_out_sai.FrameInit.ActiveFrameLength = 32;
01214     }
01215
01216 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01217     /* Update SAI state only to keep current MSP functions */
01218     haudio_out_sai.State = HAL_SAI_STATE_RESET;
01219 #else
01220     SAI_MspInit(&haudio_out_sai);
01221 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01222
01223     /* Re-initialize SAI1 with new parameters */
01224     if (HAL_SAI_Init(&haudio_out_sai) != HAL_OK)
01225     {
01226       ret = BSP_ERROR_PERIPH_FAILURE;
01227     }
01228 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01229     /* Register SAI TC, HT and Error callbacks */
01230     else if (HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) != HAL_OK)
01231     {
01232       ret = BSP_ERROR_PERIPH_FAILURE;
01233     }
01234     else if (HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) != HAL_OK)
01235     {
01236       ret = BSP_ERROR_PERIPH_FAILURE;
01237     }
01238     else
01239     {
01240       if (HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
01241       {
01242         ret = BSP_ERROR_PERIPH_FAILURE;
01243       }
01244     }
01245 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01246   }
01247
01248   return ret;
01249 }
01250
01251 /**
01252   * @brief  Get the audio Resolution.
01253   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01254   * @param  BitsPerSample  Audio Resolution used to play the audio stream.
01255   * @retval BSP status
01256   */
01257 int32_t BSP_AUDIO_OUT_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample)
01258 {
01259   int32_t ret = BSP_ERROR_NONE;
01260
01261   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
01262   {
01263     ret = BSP_ERROR_WRONG_PARAM;
01264   }
01265   /* Check audio out state */
01266   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
01267   {
01268     ret = BSP_ERROR_BUSY;
01269   }
01270   /* Get the current bits per sample of audio out stream */
01271   else
01272   {
01273     *BitsPerSample = Audio_Out_Ctx[Instance].BitsPerSample;
01274   }
01275
01276   return ret;
01277 }
01278
01279 /**
01280   * @brief  Set the audio Channels number.
01281   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01282   * @param  ChannelNbr  Audio Channels number used to play the audio stream (It can only be 2U for I2S Instance)
01283   * @retval BSP status
01284   */
01285 int32_t BSP_AUDIO_OUT_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr)
01286 {
01287   int32_t ret = BSP_ERROR_NONE;
01288
01289   if (Instance >= AUDIO_OUT_INSTANCES_NBR)
01290   {
01291     ret = BSP_ERROR_WRONG_PARAM;
01292   }
01293   /* Check audio out state */
01294   else if (Audio_Out_Ctx[Instance].State != AUDIO_OUT_STATE_STOP)
01295   {
01296     ret = BSP_ERROR_BUSY;
01297   }
01298   else
01299   {
01300     /* Update mono or stereo mode of SAI handle */
01301     haudio_out_sai.Init.MonoStereoMode = (ChannelNbr == 1U) ? SAI_MONOMODE : SAI_STEREOMODE;
01302
01303     /* Re-initialize SAI1 with new parameter */
01304     if (HAL_SAI_Init(&haudio_out_sai) != HAL_OK)
01305     {
01306       ret = BSP_ERROR_PERIPH_FAILURE;
01307     }
01308
01309 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01310     /* Register SAI TC, HT and Error callbacks */
01311     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) != HAL_OK)
01312     {
01313       ret = BSP_ERROR_PERIPH_FAILURE;
01314     }
01315     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) != HAL_OK)
01316     {
01317       ret = BSP_ERROR_PERIPH_FAILURE;
01318     }
01319     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
01320     {
01321       ret = BSP_ERROR_PERIPH_FAILURE;
01322     }
01323 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01324     else
01325     {
01326       /* Store new Channel number */
01327       Audio_Out_Ctx[Instance].ChannelsNbr = ChannelNbr;
01328     }
01329   }
01330
01331   /* Return BSP status */
01332   return ret;
01333 }
01334
01335 /**
01336   * @brief  Get the audio Channels number.
01337   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01338   * @param  ChannelNbr     Audio Channels number used to play the audio stream.
01339   * @retval BSP status
01340   */
01341 int32_t BSP_AUDIO_OUT_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr)
01342 {
01343   int32_t ret = BSP_ERROR_NONE;
01344
01345   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
01346   {
01347     ret = BSP_ERROR_WRONG_PARAM;
01348   }
01349   else if (Audio_Out_Ctx[Instance].State == AUDIO_OUT_STATE_RESET)
01350   {
01351     ret = BSP_ERROR_BUSY;
01352   }
01353   else
01354   {
01355     /* Get the audio Channels number */
01356     *ChannelNbr = Audio_Out_Ctx[Instance].ChannelsNbr;
01357   }
01358
01359   /* Return BSP status */
01360   return ret;
01361 }
01362
01363 /**
01364   * @brief  Get Audio Out state
01365   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01366   * @param  State     Audio Out state
01367   * @retval BSP status
01368   */
01369 int32_t BSP_AUDIO_OUT_GetState(uint32_t Instance, uint32_t *State)
01370 {
01371   int32_t ret = BSP_ERROR_NONE;
01372
01373   if(Instance >= AUDIO_OUT_INSTANCES_NBR)
01374   {
01375     ret = BSP_ERROR_WRONG_PARAM;
01376   }
01377   else
01378   {
01379     /* Return audio Output State */
01380     *State = Audio_Out_Ctx[Instance].State;
01381   }
01382
01383   /* Return BSP status */
01384   return ret;
01385 }
01386
01387 /**
01388   * @brief  This function handles Audio Out DMA interrupt requests.
01389   * @param  Instance Audio OUT instance
01390   * @retval None
01391   */
01392 void BSP_AUDIO_OUT_IRQHandler(uint32_t Instance)
01393 {
01394   /* Prevent unused argument(s) compilation warning */
01395   UNUSED(Instance);
01396
01397   HAL_DMA_IRQHandler(haudio_out_sai.hdmatx);
01398 }
01399
01400 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0)  || !defined (USE_HAL_SAI_REGISTER_CALLBACKS)
01401 /**
01402   * @brief  Tx Transfer completed callbacks.
01403   * @param  hsai SAI handle
01404   * @retval None
01405   */
01406 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
01407 {
01408   /* Prevent unused argument(s) compilation warning */
01409   UNUSED(hsai);
01410
01411   /* Manage the remaining file size and new address offset: This function
01412      should be coded by user (its prototype is already declared in stm32h735g_discovery_audio.h) */
01413   BSP_AUDIO_OUT_TransferComplete_CallBack(0);
01414 }
01415
01416 /**
01417   * @brief  Tx Half Transfer completed callbacks.
01418   * @param  hsai  SAI handle
01419   * @retval None
01420   */
01421 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
01422 {
01423   /* Prevent unused argument(s) compilation warning */
01424   UNUSED(hsai);
01425
01426   /* Manage the remaining file size and new address offset: This function
01427      should be coded by user (its prototype is already declared in stm32h735g_discovery_audio.h) */
01428   BSP_AUDIO_OUT_HalfTransfer_CallBack(0);
01429 }
01430
01431 /**
01432   * @brief  SAI error callbacks.
01433   * @param  hsai  SAI handle
01434   * @retval None
01435   */
01436 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
01437 {
01438   if(hsai->Instance == AUDIO_OUT_SAIx)
01439   {
01440     BSP_AUDIO_OUT_Error_CallBack(0);
01441   }
01442   else
01443   {
01444     BSP_AUDIO_IN_Error_CallBack(0);
01445   }
01446 }
01447 #endif
01448 /**
01449   * @brief  Manages the DMA full Transfer complete event
01450   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01451   * @retval None
01452   */
01453 __weak void BSP_AUDIO_OUT_TransferComplete_CallBack(uint32_t Instance)
01454 {
01455   /* Prevent unused argument(s) compilation warning */
01456   UNUSED(Instance);
01457 }
01458
01459 /**
01460   * @brief  Manages the DMA Half Transfer complete event
01461   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01462   * @retval None
01463   */
01464 __weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(uint32_t Instance)
01465 {
01466   /* Prevent unused argument(s) compilation warning */
01467   UNUSED(Instance);
01468 }
01469
01470 /**
01471   * @brief  Manages the DMA FIFO error event
01472   * @param  Instance AUDIO OUT Instance. It can only be 0 (SAI)
01473   * @retval None
01474   */
01475 __weak void BSP_AUDIO_OUT_Error_CallBack(uint32_t Instance)
01476 {
01477   /* Prevent unused argument(s) compilation warning */
01478   UNUSED(Instance);
01479 }
01480
01481 /**
01482   * @}
01483   */
01484
01485 /** @defgroup STM32H735G_DISCO_AUDIO_OUT_Private_Functions AUDIO OUT Private Functions
01486   * @{
01487   */
01488 #if (USE_AUDIO_CODEC_WM8994 == 1)
01489 /**
01490   * @brief  Register Bus IOs if component ID is OK
01491   * @retval error status
01492   */
01493 static int32_t WM8994_Probe(void)
01494 {
01495   int32_t ret = BSP_ERROR_NONE;
01496   WM8994_IO_t              IOCtx;
01497   static WM8994_Object_t   WM8994Obj;
01498   uint32_t id;
01499
01500   /* Configure the audio driver */
01501   IOCtx.Address     = AUDIO_I2C_ADDRESS;
01502   IOCtx.Init        = BSP_I2C4_Init;
01503   IOCtx.DeInit      = BSP_I2C4_DeInit;
01504   IOCtx.ReadReg     = BSP_I2C4_ReadReg16;
01505   IOCtx.WriteReg    = BSP_I2C4_WriteReg16;
01506   IOCtx.GetTick     = BSP_GetTick;
01507
01508   if(WM8994_RegisterBusIO (&WM8994Obj, &IOCtx) != WM8994_OK)
01509   {
01510     ret = BSP_ERROR_BUS_FAILURE;
01511   }
01512   else
01513   {
01514     /* Reset the codec */
01515     if(WM8994_Reset(&WM8994Obj) != WM8994_OK)
01516     {
01517       ret = BSP_ERROR_COMPONENT_FAILURE;
01518     }
01519     else if(WM8994_ReadID(&WM8994Obj, &id) != WM8994_OK)
01520     {
01521       ret = BSP_ERROR_COMPONENT_FAILURE;
01522     }
01523     else if(id != WM8994_ID)
01524     {
01525       ret = BSP_ERROR_UNKNOWN_COMPONENT;
01526     }
01527     else
01528     {
01529       Audio_Drv = (AUDIO_Drv_t *) &WM8994_Driver;
01530       Audio_CompObj = &WM8994Obj;
01531     }
01532   }
01533   return ret;
01534 }
01535 #endif
01536
01537 /**
01538   * @brief  Initialize BSP_AUDIO_OUT MSP.
01539   * @param  hsai  SAI handle
01540   * @retval None
01541   */
01542 static void SAI_MspInit(SAI_HandleTypeDef *hsai)
01543 {
01544   GPIO_InitTypeDef  gpio_init_structure;
01545   static DMA_HandleTypeDef hdma_sai_tx, hdma_sai_rx;
01546     /* Enable SAI clock */
01547   AUDIO_OUT_SAIx_CLK_ENABLE();
01548
01549   /* Enable GPIO clock */
01550   AUDIO_OUT_SAIx_MCLK_ENABLE();
01551   AUDIO_OUT_SAIx_SCK_ENABLE();
01552   AUDIO_OUT_SAIx_SD_ENABLE();
01553   AUDIO_OUT_SAIx_FS_ENABLE();
01554   /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
01555   gpio_init_structure.Pin = AUDIO_OUT_SAIx_FS_PIN;
01556   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01557   gpio_init_structure.Pull = GPIO_NOPULL;
01558   gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
01559   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_FS_AF;
01560   HAL_GPIO_Init(AUDIO_OUT_SAIx_FS_GPIO_PORT, &gpio_init_structure);
01561
01562   gpio_init_structure.Pin = AUDIO_OUT_SAIx_SCK_PIN;
01563   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_SCK_AF;
01564   HAL_GPIO_Init(AUDIO_OUT_SAIx_SCK_GPIO_PORT, &gpio_init_structure);
01565
01566   gpio_init_structure.Pin =  AUDIO_OUT_SAIx_SD_PIN;
01567   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_SD_AF;
01568   HAL_GPIO_Init(AUDIO_OUT_SAIx_SD_GPIO_PORT, &gpio_init_structure);
01569
01570     if(hsai->Instance != AUDIO_IN_SAI_PDMx)
01571     {
01572       if(haudio_in_sai[0].State != HAL_SAI_STATE_READY)
01573       {
01574         AUDIO_OUT_SAIx_MCLK_ENABLE();
01575         gpio_init_structure.Pin = AUDIO_OUT_SAIx_MCLK_PIN;
01576         gpio_init_structure.Alternate = AUDIO_OUT_SAIx_MCLK_AF;
01577         HAL_GPIO_Init(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, &gpio_init_structure);
01578       }
01579     }
01580
01581   if(hsai->Instance == AUDIO_OUT_SAIx)
01582   {
01583   /* Enable the DMA clock */
01584   AUDIO_OUT_SAIx_DMAx_CLK_ENABLE();
01585
01586     /* Configure the hdma_saiTx handle parameters */
01587     hdma_sai_tx.Init.Request             = AUDIO_OUT_SAIx_DMAx_REQUEST;
01588     hdma_sai_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
01589     hdma_sai_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
01590     hdma_sai_tx.Init.MemInc              = DMA_MINC_ENABLE;
01591     if (Audio_Out_Ctx[0].BitsPerSample == AUDIO_RESOLUTION_16B)
01592     {
01593       hdma_sai_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
01594       hdma_sai_tx.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
01595     }
01596     else /* AUDIO_RESOLUTION_32B */
01597     {
01598       hdma_sai_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
01599       hdma_sai_tx.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
01600     }
01601     hdma_sai_tx.Init.Mode                = DMA_CIRCULAR;
01602     hdma_sai_tx.Init.Priority            = DMA_PRIORITY_HIGH;
01603     hdma_sai_tx.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
01604     hdma_sai_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01605     hdma_sai_tx.Init.MemBurst            = DMA_MBURST_SINGLE;
01606     hdma_sai_tx.Init.PeriphBurst         = DMA_PBURST_SINGLE;
01607
01608     hdma_sai_tx.Instance = AUDIO_OUT_SAIx_DMAx_STREAM;
01609
01610     /* Associate the DMA handle */
01611     __HAL_LINKDMA(hsai, hdmatx, hdma_sai_tx);
01612
01613     /* Deinitialize the Stream for new transfer */
01614     (void)HAL_DMA_DeInit(&hdma_sai_tx);
01615
01616     /* Configure the DMA Stream */
01617     (void)HAL_DMA_Init(&hdma_sai_tx);
01618
01619     /* SAI DMA IRQ Channel configuration */
01620     HAL_NVIC_SetPriority(AUDIO_OUT_SAIx_DMAx_IRQ, BSP_AUDIO_OUT_IT_PRIORITY, 0);
01621     HAL_NVIC_EnableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
01622   }
01623
01624   /* Audio In Msp initialization */
01625   if(hsai->Instance == AUDIO_IN_SAIx)
01626   {
01627     /* Enable SAI clock */
01628     AUDIO_IN_SAIx_CLK_ENABLE();
01629
01630     /* Enable SD GPIO clock */
01631     AUDIO_IN_SAIx_SD_ENABLE();
01632     /* CODEC_SAI pin configuration: SD pin */
01633     gpio_init_structure.Pin = AUDIO_IN_SAIx_SD_PIN;
01634     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01635     gpio_init_structure.Pull = GPIO_NOPULL;
01636     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01637     gpio_init_structure.Alternate = AUDIO_IN_SAIx_AF;
01638     HAL_GPIO_Init(AUDIO_IN_SAIx_SD_GPIO_PORT, &gpio_init_structure);
01639
01640     /* Enable the DMA clock */
01641     AUDIO_IN_SAIx_DMAx_CLK_ENABLE();
01642
01643     /* Configure the hdma_sai_rx handle parameters */
01644     hdma_sai_rx.Instance                 = AUDIO_IN_SAIx_DMAx_STREAM;
01645     hdma_sai_rx.Init.Request             = AUDIO_IN_SAIx_DMAx_REQUEST;
01646     hdma_sai_rx.Init.Mode                = DMA_CIRCULAR;
01647     hdma_sai_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01648     hdma_sai_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01649     hdma_sai_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01650     hdma_sai_rx.Init.MemInc              = DMA_MINC_ENABLE;
01651     hdma_sai_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01652     hdma_sai_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01653     hdma_sai_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01654     hdma_sai_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01655
01656     if(Audio_In_Ctx[0].BitsPerSample == AUDIO_RESOLUTION_16B)
01657     {
01658       hdma_sai_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
01659       hdma_sai_rx.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
01660     }
01661     else
01662     {
01663       hdma_sai_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
01664       hdma_sai_rx.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
01665     }
01666
01667     /* Associate the DMA handle */
01668     __HAL_LINKDMA(hsai, hdmarx, hdma_sai_rx);
01669
01670     /* Deinitialize the Stream for new transfer */
01671     (void)HAL_DMA_DeInit(&hdma_sai_rx);
01672
01673     /* Configure the DMA Stream */
01674     (void)HAL_DMA_Init(&hdma_sai_rx);
01675
01676     /* SAI DMA IRQ Channel configuration */
01677     HAL_NVIC_SetPriority(AUDIO_IN_SAIx_DMAx_IRQ, BSP_AUDIO_IN_IT_PRIORITY, 0);
01678     HAL_NVIC_EnableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01679   }
01680
01681   if(hsai->Instance == AUDIO_IN_SAI_PDMx)
01682   {
01683      /* Enable SAI clock */
01684     AUDIO_IN_SAI_PDMx_CLK_ENABLE();
01685
01686     AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE();
01687     AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE();
01688
01689     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_CLK_IN_PIN;
01690     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01691     gpio_init_structure.Pull = GPIO_NOPULL;
01692     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01693     gpio_init_structure.Alternate = AUDIO_IN_SAI_PDMx_DATA_CLK_AF;
01694     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_CLK_IN_PORT, &gpio_init_structure);
01695
01696     gpio_init_structure.Pull = GPIO_PULLUP;
01697     gpio_init_structure.Speed = GPIO_SPEED_FREQ_MEDIUM;
01698     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_DATA_IN_PIN;
01699     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_DATA_IN_PORT, &gpio_init_structure);
01700
01701     AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE();
01702
01703     /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
01704     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_FS_PIN | AUDIO_IN_SAI_PDMx_SCK_PIN;
01705     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01706     gpio_init_structure.Pull = GPIO_NOPULL;
01707     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01708     gpio_init_structure.Alternate = AUDIO_IN_SAI_PDMx_FS_SCK_AF;
01709     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT, &gpio_init_structure);
01710
01711     /* Enable the DMA clock */
01712     AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE();
01713
01714     /* Configure the hdma_sai_rx handle parameters */
01715     hdma_sai_rx.Init.Request             = AUDIO_IN_SAI_PDMx_DMAx_REQUEST;
01716     hdma_sai_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01717     hdma_sai_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01718     hdma_sai_rx.Init.MemInc              = DMA_MINC_ENABLE;
01719     hdma_sai_rx.Init.PeriphDataAlignment = AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE;
01720     hdma_sai_rx.Init.MemDataAlignment    = AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE;
01721     hdma_sai_rx.Init.Mode                = DMA_CIRCULAR;
01722     hdma_sai_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01723     hdma_sai_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01724     hdma_sai_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01725     hdma_sai_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01726     hdma_sai_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01727
01728     hdma_sai_rx.Instance = AUDIO_IN_SAI_PDMx_DMAx_STREAM;
01729
01730     /* Associate the DMA handle */
01731     __HAL_LINKDMA(hsai, hdmarx, hdma_sai_rx);
01732
01733     /* Deinitialize the Stream for new transfer */
01734     HAL_DMA_DeInit(&hdma_sai_rx);
01735
01736     /* Configure the DMA Stream */
01737     HAL_DMA_Init(&hdma_sai_rx);
01738
01739     /* SAI DMA IRQ Channel configuration */
01740     HAL_NVIC_SetPriority(AUDIO_IN_SAI_PDMx_DMAx_IRQ, BSP_AUDIO_IN_IT_PRIORITY, 0);
01741     HAL_NVIC_EnableIRQ(AUDIO_IN_SAI_PDMx_DMAx_IRQ);
01742   }
01743 }
01744
01745 /**
01746   * @brief  Deinitializes SAI MSP.
01747   * @param  hsai  SAI handle
01748   * @retval HAL status
01749   */
01750 static void SAI_MspDeInit(SAI_HandleTypeDef *hsai)
01751 {
01752   if(hsai->Instance == AUDIO_OUT_SAIx)
01753   {
01754     /* SAI DMA IRQ Channel deactivation */
01755     HAL_NVIC_DisableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
01756
01757     /* Deinitialize the DMA stream */
01758     (void)HAL_DMA_DeInit(hsai->hdmatx);
01759
01760     /* De-initialize FS, SCK, MCK and SD pins */
01761     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_FS_GPIO_PORT, AUDIO_OUT_SAIx_FS_PIN);
01762     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_SCK_GPIO_PORT, AUDIO_OUT_SAIx_SCK_PIN);
01763     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_SD_GPIO_PORT, AUDIO_OUT_SAIx_SD_PIN);
01764     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN);
01765   }
01766   if(hsai->Instance == AUDIO_IN_SAIx)
01767   {
01768     /* SAI DMA IRQ Channel deactivation */
01769     HAL_NVIC_DisableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01770
01771     /* Deinitialize the DMA stream */
01772     (void)HAL_DMA_DeInit(hsai->hdmarx);
01773
01774     /* De-initialize SD pin */
01775     HAL_GPIO_DeInit(AUDIO_IN_SAIx_SD_GPIO_PORT, AUDIO_IN_SAIx_SD_PIN);
01776
01777     /* Disable SAI clock */
01778     AUDIO_IN_SAIx_CLK_DISABLE();
01779   }
01780 }
01781
01782 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01783 /**
01784   * @brief  Tx Transfer completed callbacks.
01785   * @param  hsai SAI handle
01786   * @retval None
01787   */
01788 static void SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
01789 {
01790   /* Prevent unused argument(s) compilation warning */
01791   UNUSED(hsai);
01792
01793   /* Manage the remaining file size and new address offset: This function
01794      should be coded by user (its prototype is already declared in stm32h735g_discovery_audio.h) */
01795   BSP_AUDIO_OUT_TransferComplete_CallBack(0);
01796 }
01797
01798 /**
01799   * @brief  Tx Half Transfer completed callbacks.
01800   * @param  hsai  SAI handle
01801   * @retval None
01802   */
01803 static void SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
01804 {
01805   /* Prevent unused argument(s) compilation warning */
01806   UNUSED(hsai);
01807
01808   /* Manage the remaining file size and new address offset: This function
01809      should be coded by user (its prototype is already declared in stm32h735g_discovery_audio.h) */
01810   BSP_AUDIO_OUT_HalfTransfer_CallBack(0);
01811 }
01812
01813 /**
01814   * @brief  SAI error callbacks.
01815   * @param  hsai SAI handle
01816   * @retval None
01817   */
01818 static void SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
01819 {
01820   if(hsai->Instance == AUDIO_OUT_SAIx)
01821   {
01822     BSP_AUDIO_OUT_Error_CallBack(0);
01823   }
01824   else
01825   {
01826     BSP_AUDIO_IN_Error_CallBack(0);
01827   }
01828 }
01829 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01830
01831 /**
01832   * @}
01833   */
01834 /** @defgroup STM32H735G_DISCO_AUDIO_IN_Exported_Functions STM32H735G_DISCO_AUDIO_IN Exported Functions
01835   * @{
01836   */
01837
01838 /**
01839   * @brief  Initialize wave recording.
01840   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
01841   * @param  AudioInit Init structure
01842   * @retval BSP status
01843   */
01844 int32_t BSP_AUDIO_IN_Init(uint32_t Instance, BSP_AUDIO_Init_t* AudioInit)
01845 {
01846   uint32_t i;
01847   int32_t ret = BSP_ERROR_NONE;
01848
01849   if(Instance >= AUDIO_IN_INSTANCES_NBR)
01850   {
01851     ret = BSP_ERROR_WRONG_PARAM;
01852   }
01853   else
01854   {
01855     /* Store the audio record context */
01856     Audio_In_Ctx[Instance].Device          = AudioInit->Device;
01857     Audio_In_Ctx[Instance].ChannelsNbr     = AudioInit->ChannelsNbr;
01858     Audio_In_Ctx[Instance].SampleRate      = AudioInit->SampleRate;
01859     Audio_In_Ctx[Instance].BitsPerSample   = AudioInit->BitsPerSample;
01860     Audio_In_Ctx[Instance].Volume          = AudioInit->Volume;
01861     Audio_In_Ctx[Instance].State           = AUDIO_IN_STATE_RESET;
01862
01863     if(Instance == 0U)
01864     {
01865       /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
01866       if(MX_SAI1_ClockConfig(&haudio_in_sai[Instance], AudioInit->SampleRate) != HAL_OK)
01867       {
01868         ret = BSP_ERROR_CLOCK_FAILURE;
01869       }
01870       else
01871       {
01872         haudio_in_sai[Instance].Instance    = AUDIO_IN_SAIx;
01873         haudio_out_sai.Instance   = AUDIO_OUT_SAIx;
01874 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01875         /* Register the default SAI MSP callbacks */
01876         if(Audio_In_Ctx[Instance].IsMspCallbacksValid == 0U)
01877         {
01878           if(BSP_AUDIO_IN_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
01879           {
01880             ret = BSP_ERROR_PERIPH_FAILURE;
01881           }
01882         }
01883 #else
01884         SAI_MspInit(&haudio_in_sai[Instance]);
01885 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01886         if (ret == BSP_ERROR_NONE)
01887         {
01888           MX_SAI_Config mx_config;
01889
01890           /* Prepare haudio_in_sai handle */
01891           mx_config.AudioFrequency        = Audio_In_Ctx[Instance].SampleRate;
01892           mx_config.AudioMode             = SAI_MODESLAVE_RX;
01893           mx_config.ClockStrobing         = SAI_CLOCKSTROBING_FALLINGEDGE;
01894           mx_config.MonoStereoMode        = (AudioInit->ChannelsNbr == 1U) ? SAI_MONOMODE : SAI_STEREOMODE;
01895           mx_config.DataSize              = SAI_DATASIZE_16;
01896           mx_config.FrameLength           = 128;
01897           mx_config.ActiveFrameLength     = 64;
01898           mx_config.OutputDrive           = SAI_OUTPUTDRIVE_ENABLE;
01899           mx_config.Synchro               = SAI_SYNCHRONOUS;
01900           mx_config.SynchroExt            = SAI_SYNCEXT_DISABLE;
01901           mx_config.SlotActive            = SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1;
01902
01903           if(MX_SAI1_Block_A_Init(&haudio_in_sai[Instance], &mx_config) != HAL_OK)
01904           {
01905             /* Return BSP_ERROR_PERIPH_FAILURE when operations are not correctly done */
01906             ret = BSP_ERROR_PERIPH_FAILURE;
01907           }
01908           else
01909           {
01910             /* Prepare haudio_out_sai handle */
01911             mx_config.AudioMode         = SAI_MODEMASTER_TX;
01912             mx_config.Synchro           = SAI_ASYNCHRONOUS;
01913
01914             if(MX_SAI1_Block_B_Init(&haudio_out_sai, &mx_config) != HAL_OK)
01915             {
01916               /* Return BSP_ERROR_PERIPH_FAILURE when operations are not correctly done */
01917               ret = BSP_ERROR_PERIPH_FAILURE;
01918             }
01919           }
01920 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
01921           if (ret == BSP_ERROR_NONE)
01922           {
01923             /* Register SAI TC, HT and Error callbacks */
01924             if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_COMPLETE_CB_ID, SAI_RxCpltCallback) != HAL_OK)
01925             {
01926               ret = BSP_ERROR_PERIPH_FAILURE;
01927             }
01928             else if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_HALFCOMPLETE_CB_ID, SAI_RxHalfCpltCallback) != HAL_OK)
01929             {
01930               ret = BSP_ERROR_PERIPH_FAILURE;
01931             }
01932             else
01933             {
01934               if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
01935               {
01936                 ret = BSP_ERROR_PERIPH_FAILURE;
01937               }
01938             }
01939           }
01940 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
01941 #if (USE_AUDIO_CODEC_WM8994 == 1)
01942           if (ret == BSP_ERROR_NONE)
01943           {
01944             /* Initialize the codec internal registers */
01945             if (WM8994_Probe() == BSP_ERROR_NONE)
01946             {
01947               WM8994_Init_t codec_init;
01948
01949               /* Fill codec_init structure */
01950               codec_init.OutputDevice = (Audio_Out_Ctx[0].State == AUDIO_OUT_STATE_RESET) ? WM8994_OUT_NONE : WM8994_OUT_HEADPHONE;
01951               codec_init.Frequency    = AudioInit->SampleRate;
01952               codec_init.Resolution   = (AudioInit->BitsPerSample == AUDIO_RESOLUTION_32B) ? WM8994_RESOLUTION_32b : WM8994_RESOLUTION_16b;
01953               codec_init.InputDevice  = (AudioInit->Device == AUDIO_IN_DEVICE_ANALOG_MIC) ? WM8994_IN_LINE1 : WM8994_IN_MIC2;
01954
01955               /* Convert volume before sending to the codec */
01956               codec_init.Volume       = VOLUME_IN_CONVERT(AudioInit->Volume);
01957               /* Initialize the codec internal registers */
01958               if(Audio_Drv->Init(Audio_CompObj, &codec_init) < 0)
01959               {
01960                 ret = BSP_ERROR_COMPONENT_FAILURE;
01961               }
01962               else
01963               {
01964                 /* Update audio in context state */
01965                 Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_STOP;
01966               }
01967             }
01968           }
01969 #endif  /*USE_AUDIO_CODEC_WM8994 == 1)*/
01970         }
01971       }
01972     }
01973     else if(Instance == 1)
01974     {
01975       if(Audio_In_Ctx[Instance].Device != AUDIO_IN_DEVICE_DIGITAL_MIC1)
01976       {
01977         ret = BSP_ERROR_WRONG_PARAM;
01978       }
01979       else
01980       {
01981       /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
01982       if(MX_SAI4_ClockConfig(&haudio_in_sai[Instance], AudioInit->SampleRate) != HAL_OK)
01983       {
01984         return BSP_ERROR_CLOCK_FAILURE;
01985       }
01986       haudio_in_sai[Instance].Instance = AUDIO_IN_SAI_PDMx;
01987 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
01988       /* Register the default SAI MSP callbacks */
01989       if(Audio_In_Ctx[Instance].IsMspCallbacksValid == 0U)
01990       {
01991         if(BSP_AUDIO_IN_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
01992         {
01993           return BSP_ERROR_PERIPH_FAILURE;
01994         }
01995       }
01996 #else
01997       SAI_MspInit(&haudio_in_sai[Instance]);
01998 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1U) */
01999       MX_SAI_Config mx_config;
02000
02001       /* Prepare haudio_in_sai handle */
02002       mx_config.MonoStereoMode    = SAI_STEREOMODE;
02003       mx_config.DataSize          = SAI_DATASIZE_16;
02004       mx_config.FrameLength       = 16;
02005       mx_config.ActiveFrameLength = 1;
02006       mx_config.OutputDrive       = SAI_OUTPUTDRIVE_DISABLE;
02007       mx_config.SlotActive        = SAI_SLOTACTIVE_0;
02008       mx_config.AudioFrequency    = Audio_In_Ctx[Instance].SampleRate*8;
02009       mx_config.AudioMode         = SAI_MODEMASTER_RX;
02010       mx_config.ClockStrobing     = SAI_CLOCKSTROBING_FALLINGEDGE;
02011       mx_config.Synchro           = SAI_ASYNCHRONOUS;
02012       mx_config.SynchroExt        = SAI_SYNCEXT_DISABLE;
02013
02014       if(MX_SAI4_Block_A_Init(&haudio_in_sai[Instance], &mx_config) != HAL_OK)
02015       {
02016         /* Return BSP_ERROR_PERIPH_FAILURE when operations are not correctly done */
02017         return BSP_ERROR_PERIPH_FAILURE;
02018       }
02019
02020 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
02021       /* Register SAI TC, HT and Error callbacks */
02022       if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_COMPLETE_CB_ID, SAI_RxCpltCallback) != HAL_OK)
02023       {
02024         return BSP_ERROR_PERIPH_FAILURE;
02025       }
02026       if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_HALFCOMPLETE_CB_ID, SAI_RxHalfCpltCallback) != HAL_OK)
02027       {
02028         return BSP_ERROR_PERIPH_FAILURE;
02029       }
02030       if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
02031       {
02032         return BSP_ERROR_PERIPH_FAILURE;
02033       }
02034 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1U) */
02035 #if (USE_BSP_PDM_LIB_FEATURE > 0U)
02036       if(BSP_AUDIO_IN_PDMToPCM_Init(Instance, AudioInit->SampleRate, Audio_In_Ctx[Instance].ChannelsNbr, Audio_In_Ctx[Instance].ChannelsNbr) != BSP_ERROR_NONE)
02037       {
02038         return BSP_ERROR_NO_INIT;
02039       }
02040 #endif
02041     }
02042     }
02043     else /* (Instance == 2U) */
02044     {
02045       DFSDM_Filter_TypeDef* FilterInstnace[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_MIC1_FILTER, AUDIO_DFSDMx_MIC2_FILTER,AUDIO_DFSDMx_MIC3_FILTER,AUDIO_DFSDMx_MIC4_FILTER};
02046       DFSDM_Channel_TypeDef* ChannelInstance[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_MIC1_CHANNEL, AUDIO_DFSDMx_MIC2_CHANNEL,AUDIO_DFSDMx_MIC3_CHANNEL,AUDIO_DFSDMx_MIC4_CHANNEL};
02047       uint32_t DigitalMicPins[DFSDM_MIC_NUMBER] = {DFSDM_CHANNEL_SAME_CHANNEL_PINS, DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS, DFSDM_CHANNEL_SAME_CHANNEL_PINS, DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS};
02048       uint32_t DigitalMicType[DFSDM_MIC_NUMBER] = {DFSDM_CHANNEL_SPI_RISING, DFSDM_CHANNEL_SPI_FALLING, DFSDM_CHANNEL_SPI_RISING, DFSDM_CHANNEL_SPI_FALLING};
02049       uint32_t Channel4Filter[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER, AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER,AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER,AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER};
02050       MX_DFSDM_Config dfsdm_config;
02051
02052       /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
02053       if(MX_DFSDM1_ClockConfig(&haudio_in_dfsdm_channel[0], AudioInit->SampleRate) != HAL_OK)
02054       {
02055         ret = BSP_ERROR_CLOCK_FAILURE;
02056       }
02057
02058       if(ret == BSP_ERROR_NONE)
02059       {
02060 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
02061         /* Register the default DFSDM MSP callbacks */
02062         if(Audio_In_Ctx[Instance].IsMspCallbacksValid == 0U)
02063         {
02064           if(BSP_AUDIO_IN_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
02065           {
02066             ret = BSP_ERROR_PERIPH_FAILURE;
02067           }
02068         }
02069 #else
02070         DFSDM_FilterMspInit(&haudio_in_dfsdm_filter[1]);
02071         DFSDM_ChannelMspInit(&haudio_in_dfsdm_channel[1]);
02072 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
02073         if(ret == BSP_ERROR_NONE)
02074         {
02075           for(i = 0; i < DFSDM_MIC_NUMBER; i ++)
02076           {
02077             dfsdm_config.FilterInstance  = FilterInstnace[i];
02078             dfsdm_config.ChannelInstance = ChannelInstance[i];
02079             dfsdm_config.DigitalMicPins  = DigitalMicPins[i];
02080             dfsdm_config.DigitalMicType  = DigitalMicType[i];
02081             dfsdm_config.Channel4Filter  = Channel4Filter[i];
02082             dfsdm_config.RegularTrigger  = DFSDM_FILTER_SW_TRIGGER;
02083             /* MIC2, MIC3 and MIC4 should be synchronized to MIC1 if it's used */
02084             if((i >= 1U) && (i < 4U) && ((Audio_In_Ctx[Instance].Device & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1))
02085             {
02086               dfsdm_config.RegularTrigger = DFSDM_FILTER_SYNC_TRIGGER;
02087             }
02088             dfsdm_config.SincOrder       = DFSDM_FILTER_ORDER(Audio_In_Ctx[Instance].SampleRate);
02089             dfsdm_config.Oversampling    = DFSDM_OVER_SAMPLING(Audio_In_Ctx[Instance].SampleRate);
02090             dfsdm_config.ClockDivider    = DFSDM_CLOCK_DIVIDER(Audio_In_Ctx[Instance].SampleRate);
02091             dfsdm_config.RightBitShift   = DFSDM_MIC_BIT_SHIFT(Audio_In_Ctx[Instance].SampleRate);
02092
02093             if(((AudioInit->Device >> i) & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1)
02094             {
02095               /* Default configuration of DFSDM filters and channels */
02096               if(MX_DFSDM1_Init(&haudio_in_dfsdm_filter[i], &haudio_in_dfsdm_channel[i], &dfsdm_config) != HAL_OK)
02097               {
02098                 /* Return BSP_ERROR_PERIPH_FAILURE when operations are not correctly done */
02099                 ret = BSP_ERROR_PERIPH_FAILURE;
02100               }
02101 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
02102               /* Register filter regular conversion callbacks */
02103               if(HAL_DFSDM_Filter_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_REGCONV_COMPLETE_CB_ID, DFSDM_FilterRegConvCpltCallback) != HAL_OK)
02104               {
02105                 ret = BSP_ERROR_PERIPH_FAILURE;
02106               }
02107               else
02108               {
02109                 if(HAL_DFSDM_Filter_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_REGCONV_HALFCOMPLETE_CB_ID, DFSDM_FilterRegConvHalfCpltCallback) != HAL_OK)
02110                 {
02111                   ret = BSP_ERROR_PERIPH_FAILURE;
02112                 }
02113               }
02114 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
02115             }
02116             if(ret != BSP_ERROR_NONE)
02117             {
02118               break;
02119             }
02120           }
02121         }
02122       }
02123     }
02124
02125     /* Update BSP AUDIO IN state */
02126     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_STOP;
02127   }
02128
02129   /* Return BSP status */
02130   return ret;
02131 }
02132
02133 /**
02134   * @brief  Deinit the audio IN peripherals.
02135   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
02136   * @retval BSP status
02137   */
02138 int32_t BSP_AUDIO_IN_DeInit(uint32_t Instance)
02139 {
02140   int32_t ret = BSP_ERROR_NONE;
02141   uint32_t i;
02142
02143   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02144   {
02145     ret = BSP_ERROR_WRONG_PARAM;
02146   }
02147   else
02148   {
02149     if(Instance == 0U)
02150     {
02151 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
02152       SAI_MspDeInit(&haudio_in_sai[Instance]);
02153 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 0U) */
02154
02155       /* Initialize the haudio_in_sai Instance parameter */
02156       haudio_in_sai[Instance].Instance = AUDIO_IN_SAIx;
02157       /* Initialize the haudio_out_sai Instance parameter */
02158       haudio_out_sai.Instance = AUDIO_OUT_SAIx;
02159
02160       if(Audio_Drv->DeInit(Audio_CompObj) < 0)
02161       {
02162         ret = BSP_ERROR_COMPONENT_FAILURE;
02163       }/* De-Initializes SAI handles */
02164       else if(HAL_SAI_DeInit(&haudio_in_sai[Instance]) != HAL_OK)
02165       {
02166         ret = BSP_ERROR_PERIPH_FAILURE;
02167       }
02168       else
02169       {
02170         if(HAL_SAI_DeInit(&haudio_out_sai) != HAL_OK)
02171         {
02172           ret = BSP_ERROR_PERIPH_FAILURE;
02173         }
02174       }
02175     }
02176     else if (Instance == 1U)
02177     {
02178 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
02179       SAI_MspDeInit(&haudio_in_sai[Instance]);
02180 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 0U) */
02181
02182       /* Initialize the haudio_in_sai Instance parameter */
02183       haudio_in_sai[Instance].Instance = AUDIO_IN_SAI_PDMx;
02184       /* Initialize the haudio_out_sai Instance parameter */
02185       haudio_out_sai.Instance = AUDIO_OUT_SAIx;
02186
02187       if(HAL_SAI_DeInit(&haudio_in_sai[Instance]) != HAL_OK)
02188       {
02189         ret = BSP_ERROR_PERIPH_FAILURE;
02190       }
02191       else
02192       {
02193         if(HAL_SAI_DeInit(&haudio_out_sai) != HAL_OK)
02194         {
02195           ret = BSP_ERROR_PERIPH_FAILURE;
02196         }
02197       }
02198     }
02199     else /* if(Instance == 2U) */
02200     {
02201       for(i = 0U; i < DFSDM_MIC_NUMBER; i++)
02202       {
02203         /* De-initializes DFSDM Filter handle */
02204         if(haudio_in_dfsdm_filter[i].Instance != NULL)
02205         {
02206 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0U)
02207           DFSDM_FilterMspDeInit(&haudio_in_dfsdm_filter[i]);
02208 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0U) */
02209           if(HAL_OK != HAL_DFSDM_FilterDeInit(&haudio_in_dfsdm_filter[i]))
02210           {
02211             return BSP_ERROR_PERIPH_FAILURE;
02212           }
02213           haudio_in_dfsdm_filter[i].Instance = NULL;
02214         }
02215
02216         /* De-initializes DFSDM Channel handle */
02217         if(haudio_in_dfsdm_channel[i].Instance != NULL)
02218         {
02219 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0U)
02220           DFSDM_ChannelMspDeInit(&haudio_in_dfsdm_channel[i]);
02221 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0U) */
02222           if(HAL_OK != HAL_DFSDM_ChannelDeInit(&haudio_in_dfsdm_channel[i]))
02223           {
02224             return BSP_ERROR_PERIPH_FAILURE;
02225           }
02226           haudio_in_dfsdm_channel[i].Instance = NULL;
02227         }
02228       }
02229
02230       /* Reset Audio_In_Ctx[1].IsMultiBuff if any */
02231       Audio_In_Ctx[1].IsMultiBuff = 0;
02232     }
02233     /* Update BSP AUDIO IN state */
02234     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_RESET;
02235   }
02236
02237   /* Return BSP status */
02238   return ret;
02239 }
02240
02241 /**
02242   * @brief  Clock Config.
02243   * @param  hDfsdmChannel  DFSDM Channel Handle
02244   * @param  SampleRate     Audio frequency to be configured for the DFSDM Channel.
02245   * @note   This API is called by BSP_AUDIO_IN_Init()
02246   *         Being __weak it can be overwritten by the application
02247   * @retval HAL_status
02248   */
02249 __weak HAL_StatusTypeDef MX_DFSDM1_ClockConfig(DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate)
02250 {
02251   /* Prevent unused argument(s) compilation warning */
02252   UNUSED(hDfsdmChannel);
02253
02254   HAL_StatusTypeDef ret = HAL_OK;
02255   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
02256
02257   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
02258
02259   /* Configure the PLL2 according to the requested audio frequency if not already done by other instances */
02260   if ((Audio_Out_Ctx[0].State == AUDIO_OUT_STATE_RESET) && (Audio_In_Ctx[0].State == AUDIO_IN_STATE_RESET))
02261   {
02262     ret = MX_SAI1_ClockConfig(&haudio_in_sai[0], SampleRate);
02263   }
02264
02265   return ret;
02266 }
02267
02268 /**
02269   * @brief  SAI clock Config.
02270   * @param  hsai SAI handle
02271   * @param  SampleRate  Audio frequency used to play the audio stream.
02272   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
02273   *         Being __weak it can be overwritten by the application
02274   * @retval HAL status
02275   */
02276 __weak HAL_StatusTypeDef MX_SAI4_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate)
02277 {
02278   /* Prevent unused argument(s) compilation warning */
02279   UNUSED(hsai);
02280
02281   HAL_StatusTypeDef ret = HAL_OK;
02282   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
02283   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
02284
02285   /* Set the PLL configuration according to the audio frequency */
02286   if((SampleRate == AUDIO_FREQUENCY_11K) || (SampleRate == AUDIO_FREQUENCY_22K) || (SampleRate == AUDIO_FREQUENCY_44K))
02287   {
02288     rcc_ex_clk_init_struct.PLL2.PLL2P = 24;
02289     rcc_ex_clk_init_struct.PLL2.PLL2N = 271;
02290   }
02291   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_32K, AUDIO_FREQUENCY_48K, AUDIO_FREQUENCY_96K */
02292   {
02293     rcc_ex_clk_init_struct.PLL2.PLL2P = 7;
02294     rcc_ex_clk_init_struct.PLL2.PLL2N = 344;
02295   }
02296
02297   /* SAI clock config */
02298   rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI4A;
02299   rcc_ex_clk_init_struct.Sai4AClockSelection = RCC_SAI4ACLKSOURCE_PLL2;
02300   rcc_ex_clk_init_struct.PLL2.PLL2Q = 1;
02301   rcc_ex_clk_init_struct.PLL2.PLL2R = 1;
02302   rcc_ex_clk_init_struct.PLL2.PLL2M = 25;
02303   if(HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct) != HAL_OK)
02304   {
02305     ret = HAL_ERROR;
02306   }
02307
02308   return ret;
02309 }
02310
02311 /**
02312   * @brief  Initializes the Audio instance (DFSDM).
02313   * @param  hDfsdmFilter  DFSDM Filter Handle
02314   * @param  hDfsdmChannel DFSDM Channel Handle
02315   * @param  MXConfig      DFSDM configuration structure
02316   * @note   Being __weak it can be overwritten by the application
02317   * @note   Channel output Clock Divider and Filter Oversampling are calculated as follow:
02318   *         - Clock_Divider = CLK(input DFSDM)/CLK(micro) with
02319   *           1MHZ < CLK(micro) < 3.2MHZ (TYP 2.4MHZ for MP34DT01TR)
02320   *         - Oversampling = CLK(input DFSDM)/(Clock_Divider * AudioFreq)
02321   * @retval HAL_status
02322   */
02323 __weak HAL_StatusTypeDef MX_DFSDM1_Init(DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig)
02324 {
02325   /* MIC filters  initialization */
02326   hDfsdmFilter->Instance                          = MXConfig->FilterInstance;
02327   hDfsdmFilter->Init.RegularParam.Trigger         = MXConfig->RegularTrigger;
02328   hDfsdmFilter->Init.RegularParam.FastMode        = ENABLE;
02329   hDfsdmFilter->Init.RegularParam.DmaMode         = ENABLE;
02330   hDfsdmFilter->Init.InjectedParam.Trigger        = DFSDM_FILTER_SW_TRIGGER;
02331   hDfsdmFilter->Init.InjectedParam.ScanMode       = DISABLE;
02332   hDfsdmFilter->Init.InjectedParam.DmaMode        = DISABLE;
02333   hDfsdmFilter->Init.InjectedParam.ExtTrigger     = DFSDM_FILTER_EXT_TRIG_TIM8_TRGO;
02334   hDfsdmFilter->Init.InjectedParam.ExtTriggerEdge = DFSDM_FILTER_EXT_TRIG_BOTH_EDGES;
02335   hDfsdmFilter->Init.FilterParam.SincOrder        = MXConfig->SincOrder;
02336   hDfsdmFilter->Init.FilterParam.Oversampling     = MXConfig->Oversampling;
02337   hDfsdmFilter->Init.FilterParam.IntOversampling  = 1;
02338
02339   if(HAL_DFSDM_FilterInit(hDfsdmFilter) != HAL_OK)
02340   {
02341     return HAL_ERROR;
02342   }
02343
02344   /* MIC channels initialization */
02345   hDfsdmChannel->Instance                      = MXConfig->ChannelInstance;
02346   hDfsdmChannel->Init.OutputClock.Activation   = ENABLE;
02347   hDfsdmChannel->Init.OutputClock.Selection    = DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO;
02348   hDfsdmChannel->Init.OutputClock.Divider      = MXConfig->ClockDivider;
02349   hDfsdmChannel->Init.Input.Multiplexer        = DFSDM_CHANNEL_EXTERNAL_INPUTS;
02350   hDfsdmChannel->Init.Input.DataPacking        = DFSDM_CHANNEL_STANDARD_MODE;
02351   hDfsdmChannel->Init.SerialInterface.SpiClock = DFSDM_CHANNEL_SPI_CLOCK_INTERNAL;
02352   hDfsdmChannel->Init.Awd.FilterOrder          = DFSDM_CHANNEL_SINC1_ORDER;
02353   hDfsdmChannel->Init.Awd.Oversampling         = 10;
02354   hDfsdmChannel->Init.Offset                   = 0;
02355   hDfsdmChannel->Init.RightBitShift            = MXConfig->RightBitShift;
02356   hDfsdmChannel->Init.Input.Pins               = MXConfig->DigitalMicPins;
02357   hDfsdmChannel->Init.SerialInterface.Type     = MXConfig->DigitalMicType;
02358
02359   if(HAL_OK != HAL_DFSDM_ChannelInit(hDfsdmChannel))
02360   {
02361     return HAL_ERROR;
02362   }
02363
02364   /* Configure injected channel */
02365   if(HAL_DFSDM_FilterConfigRegChannel(hDfsdmFilter, MXConfig->Channel4Filter, DFSDM_CONTINUOUS_CONV_ON) != HAL_OK)
02366   {
02367     return HAL_ERROR;
02368   }
02369
02370   return HAL_OK;
02371 }
02372
02373 /**
02374   * @brief  Initializes the Audio Codec audio in instance (SAI).
02375   * @param  hsai SAI handle
02376   * @param  MXConfig SAI configuration structure
02377   * @note   Being __weak it can be overwritten by the application
02378   * @retval HAL status
02379   */
02380 __weak HAL_StatusTypeDef MX_SAI1_Block_A_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig)
02381 {
02382   HAL_StatusTypeDef ret = HAL_OK;
02383
02384   /* Disable SAI peripheral to allow access to SAI internal registers */
02385   __HAL_SAI_DISABLE(hsai);
02386
02387   /* Configure SAI1_Block_B */
02388   hsai->Init.AudioFrequency         = MXConfig->AudioFrequency;
02389   hsai->Init.MonoStereoMode         = MXConfig->MonoStereoMode;
02390   hsai->Init.AudioMode              = MXConfig->AudioMode;
02391   hsai->Init.NoDivider              = SAI_MASTERDIVIDER_ENABLE;
02392   hsai->Init.Protocol               = SAI_FREE_PROTOCOL;
02393   hsai->Init.DataSize               = MXConfig->DataSize;
02394   hsai->Init.FirstBit               = SAI_FIRSTBIT_MSB;
02395   hsai->Init.ClockStrobing          = MXConfig->ClockStrobing;
02396   hsai->Init.Synchro                = MXConfig->Synchro;
02397   hsai->Init.OutputDrive            = MXConfig->OutputDrive;
02398   hsai->Init.FIFOThreshold          = SAI_FIFOTHRESHOLD_1QF;
02399   hsai->Init.SynchroExt             = MXConfig->SynchroExt;
02400   hsai->Init.CompandingMode         = SAI_NOCOMPANDING;
02401   hsai->Init.TriState               = SAI_OUTPUT_RELEASED;
02402   hsai->Init.Mckdiv                 = 0;
02403   hsai->Init.MckOutput              = SAI_MCK_OUTPUT_ENABLE;
02404   hsai->Init.MckOverSampling        = SAI_MCK_OVERSAMPLING_DISABLE;
02405   hsai->Init.PdmInit.Activation     = DISABLE;
02406
02407   /* Configure SAI_Block_x Frame */
02408   hsai->FrameInit.FrameLength       = MXConfig->FrameLength;
02409   hsai->FrameInit.ActiveFrameLength = MXConfig->ActiveFrameLength;
02410   hsai->FrameInit.FSDefinition      = SAI_FS_CHANNEL_IDENTIFICATION;
02411   hsai->FrameInit.FSPolarity        = SAI_FS_ACTIVE_LOW;
02412   hsai->FrameInit.FSOffset          = SAI_FS_BEFOREFIRSTBIT;
02413
02414   /* Configure SAI Block_x Slot */
02415   hsai->SlotInit.FirstBitOffset     = 0;
02416   if ((MXConfig->DataSize == AUDIO_RESOLUTION_24B) || (MXConfig->DataSize == AUDIO_RESOLUTION_32B))
02417   {
02418     hsai->SlotInit.SlotSize         = SAI_SLOTSIZE_32B;
02419   }
02420   else
02421   {
02422     hsai->SlotInit.SlotSize         = SAI_SLOTSIZE_16B;
02423   }
02424   hsai->SlotInit.SlotNumber         = 2;
02425   hsai->SlotInit.SlotActive        = MXConfig->SlotActive;
02426
02427   if(HAL_SAI_Init(hsai) != HAL_OK)
02428   {
02429     ret = HAL_ERROR;
02430   }
02431
02432   return ret;
02433 }
02434
02435 /**
02436   * @brief  Initializes the Audio Codec audio in instance (SAI).
02437   * @param  MXConfig SAI configuration structure
02438   * @note   Being __weak it can be overwritten by the application
02439   * @retval HAL status
02440   */
02441 __weak HAL_StatusTypeDef MX_SAI4_Block_A_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig)
02442 {
02443   HAL_StatusTypeDef ret = HAL_OK;
02444
02445   /* Disable SAI peripheral to allow access to SAI internal registers */
02446   __HAL_SAI_DISABLE(hsai);
02447
02448   /* Configure SAI4_Block_A */
02449   hsai->Init.AudioFrequency         = MXConfig->AudioFrequency;
02450   hsai->Init.MonoStereoMode         = MXConfig->MonoStereoMode;
02451   hsai->Init.AudioMode              = MXConfig->AudioMode;
02452   hsai->Init.NoDivider              = SAI_MASTERDIVIDER_DISABLE;
02453   hsai->Init.Protocol               = SAI_FREE_PROTOCOL;
02454   hsai->Init.DataSize               = MXConfig->DataSize;
02455   hsai->Init.FirstBit               = SAI_FIRSTBIT_LSB;
02456   hsai->Init.ClockStrobing          = MXConfig->ClockStrobing;
02457   hsai->Init.Synchro                = MXConfig->Synchro;
02458   hsai->Init.OutputDrive            = MXConfig->OutputDrive;
02459   hsai->Init.FIFOThreshold          = SAI_FIFOTHRESHOLD_1QF;
02460   hsai->Init.SynchroExt             = MXConfig->SynchroExt;
02461   hsai->Init.CompandingMode         = SAI_NOCOMPANDING;
02462   hsai->Init.TriState               = SAI_OUTPUT_RELEASED;
02463   hsai->Init.Mckdiv                 = 0;
02464   hsai->Init.PdmInit.Activation     = ENABLE;
02465   hsai->Init.PdmInit.MicPairsNbr    = 1;
02466   hsai->Init.PdmInit.ClockEnable    = SAI_PDM_CLOCK1_ENABLE;
02467
02468
02469   /* Configure SAI_Block_x Frame */
02470   hsai->FrameInit.FrameLength       = MXConfig->FrameLength;
02471   hsai->FrameInit.ActiveFrameLength = MXConfig->ActiveFrameLength;
02472   hsai->FrameInit.FSDefinition      = SAI_FS_STARTFRAME;
02473   hsai->FrameInit.FSPolarity        = SAI_FS_ACTIVE_HIGH;
02474   hsai->FrameInit.FSOffset          = SAI_FS_FIRSTBIT;
02475
02476   /* Configure SAI Block_x Slot */
02477   hsai->SlotInit.FirstBitOffset     = 0;
02478   hsai->SlotInit.SlotSize           = SAI_SLOTSIZE_DATASIZE;
02479   hsai->SlotInit.SlotNumber         = 1;
02480   hsai->SlotInit.SlotActive        = MXConfig->SlotActive;
02481
02482   if(HAL_SAI_Init(hsai) != HAL_OK)
02483   {
02484     ret = HAL_ERROR;
02485   }
02486 /* Enable SAI peripheral */
02487   __HAL_SAI_ENABLE(hsai);
02488
02489   return ret;
02490 }
02491
02492 #if ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1U) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1U))
02493 /**
02494   * @brief Default BSP AUDIO IN Msp Callbacks
02495   * @param Instance BSP AUDIO IN Instance
02496   * @retval BSP status
02497   */
02498 int32_t BSP_AUDIO_IN_RegisterDefaultMspCallbacks (uint32_t Instance)
02499 {
02500   int32_t ret = BSP_ERROR_NONE;
02501   uint32_t i;
02502
02503   if(Instance == 1U)
02504   {
02505     for(i = 0; i < DFSDM_MIC_NUMBER; i ++)
02506     {
02507       if(((Audio_In_Ctx[Instance].Device >> i) & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1)
02508       {
02509         __HAL_DFSDM_CHANNEL_RESET_HANDLE_STATE(&haudio_in_dfsdm_channel[i]);
02510         __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(&haudio_in_dfsdm_filter[i]);
02511
02512 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
02513         /* Register MspInit/MspDeInit Callbacks */
02514         if(HAL_DFSDM_CHANNEL_RegisterCallback(&haudio_in_dfsdm_channel[i], HAL_DFSDM_CHANNEL_MSPINIT_CB_ID, DFSDM_ChannelMspInit) != HAL_OK)
02515         {
02516           ret = BSP_ERROR_PERIPH_FAILURE;
02517         }
02518         else if(HAL_DFSDM_FILTER_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_MSPINIT_CB_ID, DFSDM_FilterMspInit) != HAL_OK)
02519         {
02520           ret = BSP_ERROR_PERIPH_FAILURE;
02521         }
02522         else if(HAL_DFSDM_CHANNEL_RegisterCallback(&haudio_in_dfsdm_channel[i], HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID, DFSDM_ChannelMspDeInit) != HAL_OK)
02523         {
02524           ret = BSP_ERROR_PERIPH_FAILURE;
02525         }
02526         else if(HAL_DFSDM_FILTER_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_MSPDEINIT_CB_ID, DFSDM_FilterMspDeInit) != HAL_OK)
02527         {
02528           ret = BSP_ERROR_PERIPH_FAILURE;
02529         }
02530         else
02531         {
02532         }
02533 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)  */
02534       }
02535     }
02536   }
02537   else if(Instance == 0U)
02538   {
02539     __HAL_SAI_RESET_HANDLE_STATE(&haudio_in_sai[Instance]);
02540     __HAL_SAI_RESET_HANDLE_STATE(&haudio_out_sai);
02541
02542 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
02543     /* Register MspInit/MspDeInit Callbacks */
02544     if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_MSPINIT_CB_ID, SAI_MspInit) != HAL_OK)
02545     {
02546       ret = BSP_ERROR_PERIPH_FAILURE;
02547     }
02548     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPINIT_CB_ID, SAI_MspInit) != HAL_OK)
02549     {
02550       ret = BSP_ERROR_PERIPH_FAILURE;
02551     }
02552     else if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_MSPDEINIT_CB_ID, SAI_MspDeInit) != HAL_OK)
02553     {
02554       ret = BSP_ERROR_PERIPH_FAILURE;
02555     }
02556     else if(HAL_SAI_RegisterCallback(&haudio_out_sai, HAL_SAI_MSPDEINIT_CB_ID, SAI_MspDeInit) != HAL_OK)
02557     {
02558       ret = BSP_ERROR_PERIPH_FAILURE;
02559     }
02560     else
02561     {
02562     }
02563 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1U) */
02564   }
02565   else
02566   {
02567     ret = BSP_ERROR_WRONG_PARAM;
02568   }
02569
02570   if(ret == BSP_ERROR_NONE)
02571   {
02572     Audio_In_Ctx[Instance].IsMspCallbacksValid = 1;
02573   }
02574
02575   /* Return BSP status */
02576   return ret;
02577 }
02578
02579 /**
02580   * @brief BSP AUDIO In Filter Msp Callback registering
02581   * @param Instance    AUDIO IN Instance
02582   * @param CallBacks   pointer to filter MspInit/MspDeInit functions
02583   * @retval BSP status
02584   */
02585 int32_t BSP_AUDIO_IN_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_IN_Cb_t *CallBacks)
02586 {
02587   int32_t ret = BSP_ERROR_NONE;
02588   uint32_t i;
02589
02590   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02591   {
02592     ret = BSP_ERROR_WRONG_PARAM;
02593   }
02594   else
02595   {
02596     if(Instance == 1U)
02597     {
02598 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
02599       for(i = 0U; i < DFSDM_MIC_NUMBER; i ++)
02600       {
02601         __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(&haudio_in_dfsdm_filter[i]);
02602
02603         /* Register MspInit/MspDeInit Callback */
02604         if(HAL_DFSDM_FILTER_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_MSPINIT_CB_ID, CallBacks->pMspFltrInitCb) != HAL_OK)
02605         {
02606           ret = BSP_ERROR_PERIPH_FAILURE;
02607         }
02608         else if(HAL_DFSDM_FILTER_RegisterCallback(&haudio_in_dfsdm_filter[i], HAL_DFSDM_FILTER_MSPDEINIT_CB_ID, CallBacks->pMspFltrDeInitCb) != HAL_OK)
02609         {
02610           ret = BSP_ERROR_PERIPH_FAILURE;
02611         }
02612         else if(HAL_DFSDM_CHANNEL_RegisterCallback(&haudio_in_dfsdm_channel[i], HAL_DFSDM_CHANNEL_MSPINIT_CB_ID, CallBacks->pMspChInitCb) != HAL_OK)
02613         {
02614           ret = BSP_ERROR_PERIPH_FAILURE;
02615         }
02616         else if(HAL_DFSDM_CHANNEL_RegisterCallback(&haudio_in_dfsdm_channel[i], HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID, CallBacks->pMspChDeInitCb) != HAL_OK)
02617         {
02618           ret = BSP_ERROR_PERIPH_FAILURE;
02619         }
02620         else
02621         {
02622         }
02623       }
02624 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
02625     }
02626     else /* (Instance == 0U) */
02627     {
02628 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
02629       if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_MSPINIT_CB_ID, CallBacks->pMspSaiInitCb) != HAL_OK)
02630       {
02631         ret = BSP_ERROR_PERIPH_FAILURE;
02632       }
02633       else if(HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_MSPDEINIT_CB_ID, CallBacks->pMspSaiDeInitCb) != HAL_OK)
02634       {
02635         ret = BSP_ERROR_PERIPH_FAILURE;
02636       }
02637       else
02638       {
02639       }
02640 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1U) */
02641     }
02642
02643     if(ret == BSP_ERROR_NONE)
02644     {
02645       Audio_In_Ctx[Instance].IsMspCallbacksValid = 1;
02646     }
02647   }
02648
02649   /* Return BSP status */
02650   return ret;
02651 }
02652 #endif /* ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)) */
02653
02654 #if (USE_BSP_PDM_LIB_FEATURE > 0U)
02655 /**
02656   * @brief  Initialize the PDM library.
02657   * @param Instance    AUDIO IN Instance
02658   * @param  AudioFreq  Audio sampling frequency
02659   * @param  ChnlNbrIn  Number of input audio channels in the PDM buffer
02660   * @param  ChnlNbrOut Number of desired output audio channels in the  resulting PCM buffer
02661   * @retval BSP status
02662   */
02663 int32_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t Instance, uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
02664 {
02665   uint32_t index = 0;
02666
02667   if(Instance != 1U)
02668   {
02669     return BSP_ERROR_WRONG_PARAM;
02670   }
02671   else
02672   {
02673     /* Enable CRC peripheral to unlock the PDM library */
02674     __HAL_RCC_CRC_CLK_ENABLE();
02675
02676     for(index = 0; index < ChnlNbrIn; index++)
02677     {
02678       /* Init PDM filters */
02679       PDM_FilterHandler[index].bit_order  = PDM_FILTER_BIT_ORDER_MSB;
02680       PDM_FilterHandler[index].endianness = PDM_FILTER_ENDIANNESS_LE;
02681       PDM_FilterHandler[index].high_pass_tap = 2122358088;
02682       PDM_FilterHandler[index].out_ptr_channels = ChnlNbrOut;
02683       PDM_FilterHandler[index].in_ptr_channels  = ChnlNbrIn;
02684       PDM_Filter_Init((PDM_Filter_Handler_t *)(&PDM_FilterHandler[index]));
02685
02686       /* PDM lib config phase */
02687       PDM_FilterConfig[index].output_samples_number = AudioFreq/1000;
02688       PDM_FilterConfig[index].mic_gain = 24;
02689       PDM_FilterConfig[index].decimation_factor = PDM_FILTER_DEC_FACTOR_64;
02690       PDM_Filter_setConfig((PDM_Filter_Handler_t *)&PDM_FilterHandler[index], &PDM_FilterConfig[index]);
02691     }
02692   }
02693
02694   return BSP_ERROR_NONE;
02695 }
02696
02697
02698 /**
02699   * @brief  Converts audio format from PDM to PCM.
02700   * @param  Instance  AUDIO IN Instance
02701   * @param  PDMBuf    Pointer to PDM buffer data
02702   * @param  PCMBuf    Pointer to PCM buffer data
02703   * @retval BSP status
02704   */
02705 int32_t BSP_AUDIO_IN_PDMToPCM(uint32_t Instance, uint16_t *PDMBuf, uint16_t *PCMBuf)
02706 {
02707   uint32_t index = 0;
02708
02709   if(Instance != 1U)
02710   {
02711     return BSP_ERROR_WRONG_PARAM;
02712   }
02713   else
02714   {
02715     for(index = 0; index < Audio_In_Ctx[Instance].ChannelsNbr; index++)
02716     {
02717       PDM_Filter(&((uint8_t*)(PDMBuf))[index], (uint16_t*)&(PCMBuf[index]), &PDM_FilterHandler[index]);
02718     }
02719   }
02720
02721   return BSP_ERROR_NONE;
02722 }
02723 #endif
02724
02725 /**
02726   * @brief  Start audio recording.
02727   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
02728   * @param  pBuf     Main buffer pointer for the recorded data storing
02729   * @param  NbrOfBytes     Size of the record buffer in bytes
02730   * @retval BSP status
02731   */
02732 int32_t BSP_AUDIO_IN_Record(uint32_t Instance, uint8_t* pBuf, uint32_t NbrOfBytes)
02733 {
02734   int32_t ret = BSP_ERROR_NONE;
02735
02736   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02737   {
02738     ret = BSP_ERROR_WRONG_PARAM;
02739   }
02740   else if(Instance != 2U)
02741   {
02742     uint8_t TxData[2] = {0x00U, 0x00U};
02743     if(HAL_SAI_Transmit(&haudio_out_sai, TxData, 2, 1000) != HAL_OK)
02744     {
02745       ret = BSP_ERROR_PERIPH_FAILURE;
02746     }
02747     else
02748     {
02749       /* Call the audio Codec Play function */
02750       if (Audio_Drv->Play(Audio_CompObj) < 0)
02751       {
02752         ret = BSP_ERROR_COMPONENT_FAILURE;
02753       }
02754
02755       /* Start the process receive DMA */
02756       if(HAL_SAI_Receive_DMA(&haudio_in_sai[Instance], (uint8_t*)pBuf, (uint16_t)(NbrOfBytes/(Audio_In_Ctx[Instance].BitsPerSample/8U))) != HAL_OK)
02757       {
02758         ret = BSP_ERROR_PERIPH_FAILURE;
02759       }
02760     }
02761   }
02762   else
02763   {
02764     Audio_In_Ctx[Instance].pBuff = (uint16_t*)pBuf;
02765     Audio_In_Ctx[Instance].Size  = NbrOfBytes;
02766     /* Reset Buffer Trigger */
02767     RecBuffTrigger = 0;
02768     RecBuffHalf = 0;
02769
02770     /* Call the Media layer start function for MIC2 channel */
02771     if(HAL_DFSDM_FilterRegularStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)], \
02772       (int32_t*)MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)], DEFAULT_AUDIO_IN_BUFFER_SIZE) != HAL_OK)
02773     {
02774       ret = BSP_ERROR_PERIPH_FAILURE;
02775     }
02776     else if(HAL_DFSDM_FilterRegularStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)], \
02777       (int32_t*)MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)], DEFAULT_AUDIO_IN_BUFFER_SIZE) != HAL_OK)
02778     {
02779       ret = BSP_ERROR_PERIPH_FAILURE;
02780     }
02781     else
02782     {
02783       /* Update BSP AUDIO IN state */
02784       Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_RECORDING;
02785     }
02786   }
02787
02788   /* Return BSP status */
02789   return ret;
02790 }
02791
02792 /**
02793   * @brief  Stop audio recording.
02794   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
02795   * @retval BSP status
02796   */
02797 int32_t BSP_AUDIO_IN_Stop(uint32_t Instance)
02798 {
02799   int32_t ret = BSP_ERROR_NONE;
02800
02801   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02802   {
02803     ret = BSP_ERROR_WRONG_PARAM;
02804   }
02805   /* Check audio in state */
02806   else if (Audio_In_Ctx[Instance].State == AUDIO_IN_STATE_STOP)
02807   {
02808     /* Nothing to do */
02809   }
02810   else if ((Audio_In_Ctx[Instance].State != AUDIO_IN_STATE_RECORDING) &&
02811            (Audio_In_Ctx[Instance].State != AUDIO_IN_STATE_PAUSE))
02812   {
02813     ret = BSP_ERROR_BUSY;
02814   }
02815   else
02816   {
02817     if(Instance == 2U)
02818     {
02819       /* Call the Media layer stop function */
02820       if(HAL_DFSDM_FilterRegularStop_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)]) != HAL_OK)
02821       {
02822         ret = BSP_ERROR_PERIPH_FAILURE;
02823       }
02824       else
02825       {
02826         if(HAL_DFSDM_FilterRegularStop_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)]) != HAL_OK)
02827         {
02828           ret = BSP_ERROR_PERIPH_FAILURE;
02829         }
02830       }
02831     }
02832     else
02833     {
02834       if(Instance == 0U)
02835       {
02836         /* Call the Media layer stop function */
02837         if(Audio_Drv->Stop(Audio_CompObj, CODEC_PDWN_SW) < 0)
02838         {
02839           ret = BSP_ERROR_COMPONENT_FAILURE;
02840         }
02841       }
02842
02843       if(ret == BSP_ERROR_NONE)
02844       {
02845         if(HAL_SAI_DMAStop(&haudio_in_sai[Instance]) != HAL_OK)
02846         {
02847           ret = BSP_ERROR_PERIPH_FAILURE;
02848         }
02849       }
02850     }
02851     /* Update BSP AUDIO IN state */
02852     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_STOP;
02853   }
02854
02855   /* Return BSP status */
02856   return ret;
02857 }
02858
02859 /**
02860   * @brief  Pause the audio file stream.
02861   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
02862   * @retval BSP status
02863   */
02864 int32_t BSP_AUDIO_IN_Pause(uint32_t Instance)
02865 {
02866   int32_t ret = BSP_ERROR_NONE;
02867
02868   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02869   {
02870     ret = BSP_ERROR_WRONG_PARAM;
02871   }
02872   else
02873   {
02874     if(Instance == 2U)
02875     {
02876       /* Call the Media layer stop function */
02877       if(HAL_DFSDM_FilterRegularStop_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)]) != HAL_OK)
02878       {
02879         ret = BSP_ERROR_PERIPH_FAILURE;
02880       }
02881       else
02882       {
02883         if(HAL_DFSDM_FilterRegularStop_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)]) != HAL_OK)
02884         {
02885           ret = BSP_ERROR_PERIPH_FAILURE;
02886         }
02887       }
02888     }
02889     else /* 0 or 1*/
02890     {
02891       if(Instance == 0U)
02892       {
02893         /* Call Audio Codec Pause function */
02894         if(Audio_Drv->Pause(Audio_CompObj) < 0)
02895         {
02896           ret = BSP_ERROR_COMPONENT_FAILURE;
02897         }
02898       }
02899
02900       if(ret == BSP_ERROR_NONE)
02901       {
02902         if(HAL_SAI_DMAPause(&haudio_in_sai[Instance]) != HAL_OK)
02903         {
02904           ret = BSP_ERROR_PERIPH_FAILURE;
02905         }
02906       }
02907     }
02908     /* Update BSP AUDIO IN state */
02909     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_PAUSE;
02910   }
02911
02912   /* Return BSP status */
02913   return ret;
02914 }
02915
02916 /**
02917   * @brief  Resume the audio file stream.
02918   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
02919   * @retval BSP status
02920   */
02921 int32_t BSP_AUDIO_IN_Resume(uint32_t Instance)
02922 {
02923   int32_t ret = BSP_ERROR_NONE;
02924
02925   if(Instance >= AUDIO_IN_INSTANCES_NBR)
02926   {
02927     ret = BSP_ERROR_WRONG_PARAM;
02928   }
02929   else
02930   {
02931     if(Instance == 2U)
02932     {
02933       /* Call the Media layer start function for MIC2/MIC1 channel */
02934       if(HAL_DFSDM_FilterRegularMsbStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)], \
02935         (int16_t*)MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)], DEFAULT_AUDIO_IN_BUFFER_SIZE) != HAL_OK)
02936       {
02937         ret = BSP_ERROR_PERIPH_FAILURE;
02938       }
02939       else
02940       {
02941         if(HAL_DFSDM_FilterRegularMsbStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)], \
02942           (int16_t*)MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)], DEFAULT_AUDIO_IN_BUFFER_SIZE) != HAL_OK)
02943         {
02944           ret = BSP_ERROR_PERIPH_FAILURE;
02945         }
02946       }
02947     }
02948     else /* 0 or 1 */
02949     {
02950       if(Instance == 0U)
02951       {
02952         /* Call Audio Codec Resume function */
02953         if(Audio_Drv->Resume(Audio_CompObj) < 0)
02954         {
02955           ret = BSP_ERROR_COMPONENT_FAILURE;
02956         }
02957       }
02958
02959       if(ret == BSP_ERROR_NONE)
02960       {
02961         if(HAL_SAI_DMAResume(&haudio_in_sai[Instance]) != HAL_OK)
02962         {
02963           ret = BSP_ERROR_PERIPH_FAILURE;
02964         }
02965       }
02966     }
02967
02968     /* Update BSP AUDIO IN state */
02969     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_RECORDING;
02970   }
02971
02972   /* Return BSP status */
02973   return ret;
02974 }
02975
02976 /**
02977   * @brief  Starts audio recording.
02978   * @param  Instance  AUDIO IN Instance. It can be 2(DFSDM used)
02979   * @param  pBuf      Main buffer pointer for the recorded data storing
02980   * @param  NbrOfBytes Size of the recorded buffer in bytes
02981   * @retval BSP status
02982   */
02983 int32_t BSP_AUDIO_IN_RecordChannels(uint32_t Instance, uint8_t **pBuf, uint32_t NbrOfBytes)
02984 {
02985   uint16_t i;
02986   int32_t ret = BSP_ERROR_NONE;
02987   uint32_t mic_init[DFSDM_MIC_NUMBER] = {0};
02988   uint32_t audio_in_digital_mic = AUDIO_IN_DEVICE_DIGITAL_MIC1, pbuf_index = 0;
02989   uint32_t enabled_mic = 0;
02990
02991   if(Instance != 2U)
02992   {
02993     ret = BSP_ERROR_WRONG_PARAM;
02994   }
02995   else
02996   {
02997     /* Get the number of activated microphones */
02998     for(i = 0U; i < DFSDM_MIC_NUMBER; i++)
02999     {
03000       if((Audio_In_Ctx[Instance].Device & audio_in_digital_mic) == audio_in_digital_mic)
03001       {
03002         enabled_mic++;
03003       }
03004       audio_in_digital_mic = audio_in_digital_mic << 1;
03005     }
03006
03007     Audio_In_Ctx[Instance].pMultiBuff = pBuf;
03008     Audio_In_Ctx[Instance].Size  = NbrOfBytes;
03009     Audio_In_Ctx[Instance].IsMultiBuff = 1;
03010
03011     audio_in_digital_mic = AUDIO_IN_DEVICE_DIGITAL_MIC_LAST;
03012     for(i = 0U; i < DFSDM_MIC_NUMBER; i++)
03013     {
03014       if((mic_init[POS_VAL(audio_in_digital_mic)] != 1U) && ((Audio_In_Ctx[Instance].Device & audio_in_digital_mic) == audio_in_digital_mic))
03015       {
03016         /* Call the Media layer start function for MICx channel */
03017         if(HAL_DFSDM_FilterRegularStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(audio_in_digital_mic)], (int32_t*)pBuf[enabled_mic - 1U - pbuf_index], NbrOfBytes) != HAL_OK)
03018         {
03019           ret = BSP_ERROR_PERIPH_FAILURE;
03020         }
03021         else
03022         {
03023           mic_init[POS_VAL(audio_in_digital_mic)] = 1;
03024           pbuf_index++;
03025         }
03026       }
03027       audio_in_digital_mic = audio_in_digital_mic >> 1;
03028     }
03029     /* Update BSP AUDIO IN state */
03030     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_RECORDING;
03031   }
03032
03033   /* Return BSP status */
03034   return ret;
03035 }
03036
03037 /**
03038   * @brief  Stop audio recording.
03039   * @param  Instance  AUDIO IN Instance. It can be 1(DFSDM used)
03040   * @param  Device    Digital input device to be stopped
03041   * @retval BSP status
03042   */
03043 int32_t BSP_AUDIO_IN_StopChannels(uint32_t Instance, uint32_t Device)
03044 {
03045   int32_t ret;
03046
03047   /* Stop selected devices */
03048   ret = BSP_AUDIO_IN_PauseChannels(Instance, Device);
03049
03050   if(ret == BSP_ERROR_NONE)
03051   {
03052     /* Update BSP AUDIO IN state */
03053     Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_STOP;
03054   }
03055
03056   /* Return BSP status */
03057   return ret;
03058 }
03059
03060 /**
03061   * @brief  Pause the audio file stream.
03062   * @param  Instance  AUDIO IN Instance. It can be 1(DFSDM used)
03063   * @param  Device    Digital mic to be paused
03064   * @retval BSP status
03065   */
03066 int32_t BSP_AUDIO_IN_PauseChannels(uint32_t Instance, uint32_t Device)
03067 {
03068   uint32_t audio_in_digital_mic = AUDIO_IN_DEVICE_DIGITAL_MIC1;
03069   uint32_t i;
03070   int32_t ret = BSP_ERROR_NONE;
03071
03072   if((Instance != 2U) || ((Device < AUDIO_IN_DEVICE_DIGITAL_MIC1) && (Device > AUDIO_IN_DEVICE_DIGITAL_MIC_LAST)))
03073   {
03074     ret = BSP_ERROR_WRONG_PARAM;
03075   }
03076   else
03077   {
03078     for(i = 0; i < DFSDM_MIC_NUMBER; i++)
03079     {
03080       if((Device & audio_in_digital_mic) == audio_in_digital_mic)
03081       {
03082         /* Call the Media layer stop function */
03083         if(HAL_DFSDM_FilterRegularStop_DMA(&haudio_in_dfsdm_filter[POS_VAL(audio_in_digital_mic)]) != HAL_OK)
03084         {
03085           ret = BSP_ERROR_PERIPH_FAILURE;
03086         }
03087       }
03088       audio_in_digital_mic = audio_in_digital_mic << 1;
03089
03090     }
03091     if(ret == BSP_ERROR_NONE)
03092     {
03093       /* Update BSP AUDIO IN state */
03094       Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_PAUSE;
03095     }
03096   }
03097
03098   /* Return BSP status */
03099   return ret;
03100 }
03101
03102 /**
03103   * @brief  Resume the audio file stream
03104   * @param  Instance  AUDIO IN Instance. It can be 1(DFSDM used)
03105   * @param  Device    Digital mic to be resumed
03106   * @retval BSP status
03107   */
03108 int32_t BSP_AUDIO_IN_ResumeChannels(uint32_t Instance, uint32_t Device)
03109 {
03110   int32_t ret = BSP_ERROR_NONE;
03111   uint32_t audio_in_digital_mic = AUDIO_IN_DEVICE_DIGITAL_MIC_LAST;
03112   uint32_t i;
03113   if((Instance != 2U) || ((Device < AUDIO_IN_DEVICE_DIGITAL_MIC1) && (Device > AUDIO_IN_DEVICE_DIGITAL_MIC_LAST)))
03114   {
03115     ret = BSP_ERROR_WRONG_PARAM;
03116   }
03117   else
03118   {
03119     for(i = 0; i < DFSDM_MIC_NUMBER; i++)
03120     {
03121       if((Device & audio_in_digital_mic) == audio_in_digital_mic)
03122       {
03123         /* Start selected device channel */
03124         if(HAL_DFSDM_FilterRegularStart_DMA(&haudio_in_dfsdm_filter[POS_VAL(audio_in_digital_mic)],\
03125           (int32_t*)Audio_In_Ctx[Instance].pMultiBuff[POS_VAL(audio_in_digital_mic)], Audio_In_Ctx[Instance].Size) != HAL_OK)
03126         {
03127           ret = BSP_ERROR_PERIPH_FAILURE;
03128         }
03129       }
03130       audio_in_digital_mic = audio_in_digital_mic >> 1;
03131     }
03132
03133     if(ret == BSP_ERROR_NONE)
03134     {
03135       /* Update BSP AUDIO IN state */
03136       Audio_In_Ctx[Instance].State = AUDIO_IN_STATE_RECORDING;
03137     }
03138   }
03139
03140   /* Return BSP status */
03141   return ret;
03142 }
03143
03144 /**
03145   * @brief  Start audio recording.
03146   * @param  Instance  AUDIO IN SAI PDM Instance. It can be only 2
03147   * @param  pbuf     Main buffer pointer for the recorded data storing
03148   * @param  Size     Size of the record buffer
03149   * @retval BSP status
03150   */
03151 int32_t BSP_AUDIO_IN_RecordPDM(uint32_t Instance, uint8_t* pBuf, uint32_t NbrOfBytes)
03152 {
03153   int32_t ret = BSP_ERROR_NONE;
03154
03155   if(Instance != 1U)
03156   {
03157     ret = BSP_ERROR_WRONG_PARAM;
03158   }
03159   else
03160   {
03161     /* Start the process receive DMA */
03162     if(HAL_SAI_Receive_DMA(&haudio_in_sai[Instance], (uint8_t*)pBuf, (uint16_t)(NbrOfBytes/(Audio_In_Ctx[Instance].BitsPerSample/8U))) != HAL_OK)
03163     {
03164       ret = BSP_ERROR_PERIPH_FAILURE;
03165     }
03166   }
03167
03168   /* Return BSP status */
03169   return ret;
03170 }
03171
03172 /**
03173   * @brief  Set Audio In device
03174   * @param  Instance  AUDIO IN Instance. It can be 0 when SAI is used or 2 if DFSDM is used
03175   * @param  Device    The audio input device to be used
03176   * @retval BSP status
03177   */
03178 int32_t BSP_AUDIO_IN_SetDevice(uint32_t Instance, uint32_t Device)
03179 {
03180   int32_t ret = BSP_ERROR_NONE;
03181   uint32_t i;
03182   BSP_AUDIO_Init_t audio_init;
03183
03184   if((Instance >= AUDIO_IN_INSTANCES_NBR) || ((Instance == 0U) && (Device != AUDIO_IN_DEVICE_ANALOG_LINE1) &&\
03185                                                (Device != AUDIO_IN_DEVICE_DIGITAL_MIC1))\
03186                                           || ((Instance == 1U) && (Device != AUDIO_IN_DEVICE_DIGITAL_MIC1))\
03187                                           || ((Instance == 2U) && (Device < AUDIO_IN_DEVICE_DIGITAL_MIC1) &&\
03188                                               (Device > AUDIO_IN_DEVICE_DIGITAL_MIC_LAST)))
03189   {
03190     ret = BSP_ERROR_WRONG_PARAM;
03191   }
03192   else if(Audio_In_Ctx[Instance].State == AUDIO_IN_STATE_STOP)
03193   {
03194     if(Instance == 2U)
03195     {
03196       for(i = 0; i < DFSDM_MIC_NUMBER; i ++)
03197       {
03198         if(((Device >> i) & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1)
03199         {
03200           if(HAL_DFSDM_ChannelDeInit(&haudio_in_dfsdm_channel[i]) != HAL_OK)
03201           {
03202             return BSP_ERROR_PERIPH_FAILURE;
03203           }
03204         }
03205       }
03206     }
03207     audio_init.Device        = Device;
03208     audio_init.ChannelsNbr   = Audio_In_Ctx[Instance].ChannelsNbr;
03209     audio_init.SampleRate    = Audio_In_Ctx[Instance].SampleRate;
03210     audio_init.BitsPerSample = Audio_In_Ctx[Instance].BitsPerSample;
03211     audio_init.Volume        = Audio_In_Ctx[Instance].Volume;
03212
03213     if(BSP_AUDIO_IN_Init(Instance, &audio_init) != BSP_ERROR_NONE)
03214     {
03215       ret = BSP_ERROR_NO_INIT;
03216     }
03217   }
03218   else
03219   {
03220     ret = BSP_ERROR_BUSY;
03221   }
03222
03223   /* Return BSP status */
03224   return ret;
03225 }
03226
03227 /**
03228   * @brief  Get Audio In device
03229   * @param  Instance  AUDIO IN Instance. It can be 0 when SAI is used 1 when I2S is used or 2 if DFSDM is used
03230   * @param  Device    The audio input device used
03231   * @retval BSP status
03232   */
03233 int32_t BSP_AUDIO_IN_GetDevice(uint32_t Instance, uint32_t *Device)
03234 {
03235   int32_t ret = BSP_ERROR_NONE;
03236
03237   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03238   {
03239     ret = BSP_ERROR_WRONG_PARAM;
03240   }
03241   else
03242   {
03243     /* Return audio Input Device */
03244     *Device = Audio_In_Ctx[Instance].Device;
03245   }
03246   return ret;
03247 }
03248
03249 /**
03250   * @brief  Set Audio In frequency
03251   * @param  Instance     Audio IN instance
03252   * @param  SampleRate  Input frequency to be set
03253   * @retval BSP status
03254   */
03255 int32_t BSP_AUDIO_IN_SetSampleRate(uint32_t Instance, uint32_t  SampleRate)
03256 {
03257   int32_t ret = BSP_ERROR_NONE;
03258
03259   if (Instance >= AUDIO_IN_INSTANCES_NBR)
03260   {
03261     ret = BSP_ERROR_WRONG_PARAM;
03262   }
03263   /* Check audio in state */
03264   else if (Audio_In_Ctx[Instance].State != AUDIO_IN_STATE_STOP)
03265   {
03266     ret = BSP_ERROR_BUSY;
03267   }
03268   /* Check if playback on instance 0 or 1 is on going and corresponding sample rate */
03269   else if ((Audio_Out_Ctx[0].State != AUDIO_OUT_STATE_RESET) && (Audio_Out_Ctx[0].SampleRate != SampleRate))
03270   {
03271     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
03272   }
03273   /* Check if sample rate is modified */
03274   else if (Audio_In_Ctx[Instance].SampleRate == SampleRate)
03275   {
03276     /* Nothing to do */
03277   }
03278   else if (Instance != 2U)
03279   {
03280     /* Update SAI1 clock config */
03281     haudio_in_sai[Instance].Init.AudioFrequency = SampleRate;
03282     haudio_out_sai.Init.AudioFrequency = SampleRate;
03283     if (MX_SAI1_ClockConfig(&haudio_in_sai[Instance], SampleRate) != HAL_OK)
03284     {
03285       ret = BSP_ERROR_CLOCK_FAILURE;
03286     }
03287     /* Re-initialize SAI1 with new sample rate */
03288     else if (HAL_SAI_Init(&haudio_in_sai[Instance]) != HAL_OK)
03289     {
03290       ret = BSP_ERROR_PERIPH_FAILURE;
03291     }
03292     else if (HAL_SAI_Init(&haudio_out_sai) != HAL_OK)
03293     {
03294       ret = BSP_ERROR_PERIPH_FAILURE;
03295     }
03296 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
03297     /* Register SAI TC, HT and Error callbacks */
03298     else if (HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_COMPLETE_CB_ID, SAI_RxCpltCallback) != HAL_OK)
03299     {
03300       ret = BSP_ERROR_PERIPH_FAILURE;
03301     }
03302     else if (HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_RX_HALFCOMPLETE_CB_ID, SAI_RxHalfCpltCallback) != HAL_OK)
03303     {
03304       ret = BSP_ERROR_PERIPH_FAILURE;
03305     }
03306     else if (HAL_SAI_RegisterCallback(&haudio_in_sai[Instance], HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) != HAL_OK)
03307     {
03308       ret = BSP_ERROR_PERIPH_FAILURE;
03309     }
03310 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
03311     /* Store new sample rate on audio in context */
03312     else
03313     {
03314       Audio_In_Ctx[Instance].SampleRate = SampleRate;
03315     }
03316   }
03317   else /* Instance = 2 */
03318   {
03319     uint32_t i;
03320     BSP_AUDIO_Init_t audio_init;
03321
03322     for(i = 0; i < DFSDM_MIC_NUMBER; i ++)
03323     {
03324       if(((Audio_In_Ctx[Instance].Device >> i) & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1)
03325       {
03326         if(HAL_DFSDM_ChannelDeInit(&haudio_in_dfsdm_channel[i]) != HAL_OK)
03327         {
03328           return BSP_ERROR_PERIPH_FAILURE;
03329         }
03330         if(HAL_DFSDM_FilterDeInit(&haudio_in_dfsdm_filter[i]) != HAL_OK)
03331         {
03332           return BSP_ERROR_PERIPH_FAILURE;
03333         }
03334       }
03335     }
03336
03337     audio_init.Device        = Audio_In_Ctx[Instance].Device;
03338     audio_init.ChannelsNbr   = Audio_In_Ctx[Instance].ChannelsNbr;
03339     audio_init.SampleRate    = SampleRate;
03340     audio_init.BitsPerSample = Audio_In_Ctx[Instance].BitsPerSample;
03341     audio_init.Volume        = Audio_In_Ctx[Instance].Volume;
03342     if(BSP_AUDIO_IN_Init(Instance, &audio_init) != BSP_ERROR_NONE)
03343     {
03344       ret = BSP_ERROR_NO_INIT;
03345     }
03346   }
03347
03348   /* Return BSP status */
03349   return ret;
03350 }
03351
03352 /**
03353 * @brief  Get Audio In frequency
03354   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03355 * @param  SampleRate  Audio Input frequency to be returned
03356 * @retval BSP status
03357 */
03358 int32_t BSP_AUDIO_IN_GetSampleRate(uint32_t Instance, uint32_t *SampleRate)
03359 {
03360   int32_t ret = BSP_ERROR_NONE;
03361
03362   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03363   {
03364     ret = BSP_ERROR_WRONG_PARAM;
03365   }
03366   else
03367   {
03368     /* Return audio in frequency */
03369     *SampleRate = Audio_In_Ctx[Instance].SampleRate;
03370   }
03371
03372   /* Return BSP status */
03373   return ret;
03374 }
03375
03376 /**
03377   * @brief  Set Audio In Resolution
03378   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03379   * @param  BitsPerSample  Input resolution to be set
03380   * @retval BSP status
03381   */
03382 int32_t BSP_AUDIO_IN_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample)
03383 {
03384   uint32_t i;
03385   int32_t ret = BSP_ERROR_NONE;
03386   BSP_AUDIO_Init_t audio_init;
03387
03388   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03389   {
03390     ret = BSP_ERROR_WRONG_PARAM;
03391   }
03392   else if(Audio_In_Ctx[Instance].State == AUDIO_IN_STATE_STOP)
03393   {
03394     if(Instance == 2U)
03395     {
03396       for(i = 0; i < DFSDM_MIC_NUMBER; i ++)
03397       {
03398         if(((Audio_In_Ctx[Instance].Device >> i) & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1)
03399         {
03400           if(HAL_DFSDM_ChannelDeInit(&haudio_in_dfsdm_channel[i]) != HAL_OK)
03401           {
03402             return BSP_ERROR_PERIPH_FAILURE;
03403           }
03404         }
03405       }
03406     }
03407     audio_init.Device        = Audio_In_Ctx[Instance].Device;
03408     audio_init.ChannelsNbr   = Audio_In_Ctx[Instance].ChannelsNbr;
03409     audio_init.SampleRate    = Audio_In_Ctx[Instance].SampleRate;
03410     audio_init.BitsPerSample = BitsPerSample;
03411     audio_init.Volume        = Audio_In_Ctx[Instance].Volume;
03412     if(BSP_AUDIO_IN_Init(Instance, &audio_init) != BSP_ERROR_NONE)
03413     {
03414       ret = BSP_ERROR_NO_INIT;
03415     }
03416   }
03417   else
03418   {
03419     ret = BSP_ERROR_BUSY;
03420   }
03421
03422   /* Return BSP status */
03423   return ret;
03424 }
03425
03426 /**
03427   * @brief  Get Audio In Resolution
03428   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03429   * @param  BitsPerSample  Input resolution to be returned
03430   * @retval BSP status
03431   */
03432 int32_t BSP_AUDIO_IN_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample)
03433 {
03434   int32_t ret = BSP_ERROR_NONE;
03435
03436   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03437   {
03438     ret = BSP_ERROR_WRONG_PARAM;
03439   }
03440   else
03441   {
03442     /* Return audio in resolution */
03443     *BitsPerSample = Audio_In_Ctx[Instance].BitsPerSample;
03444   }
03445   return ret;
03446 }
03447
03448 /**
03449   * @brief  Set Audio In Channel number
03450   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03451   * @param  ChannelNbr  Channel number to be used
03452   * @retval BSP status
03453   */
03454 int32_t BSP_AUDIO_IN_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr)
03455 {
03456   int32_t ret = BSP_ERROR_NONE;
03457
03458   if((Instance >= AUDIO_IN_INSTANCES_NBR) || (ChannelNbr > 2U))
03459   {
03460     ret = BSP_ERROR_WRONG_PARAM;
03461   }
03462   else
03463   {
03464     /* Update AudioIn Context */
03465     Audio_In_Ctx[Instance].ChannelsNbr = ChannelNbr;
03466   }
03467   /* Return BSP status */
03468   return ret;
03469 }
03470
03471 /**
03472   * @brief  Get Audio In Channel number
03473   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03474   * @param  ChannelNbr  Channel number to be used
03475   * @retval BSP status
03476   */
03477 int32_t BSP_AUDIO_IN_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr)
03478 {
03479   int32_t ret = BSP_ERROR_NONE;
03480
03481   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03482   {
03483     ret = BSP_ERROR_WRONG_PARAM;
03484   }
03485   else
03486   {
03487     /* Channel number to be returned */
03488     *ChannelNbr = Audio_In_Ctx[Instance].ChannelsNbr;
03489   }
03490   return ret;
03491 }
03492
03493 /**
03494   * @brief  Set the current audio in volume level.
03495   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03496   * @param  Volume    Volume level to be returned
03497   * @retval BSP status
03498   */
03499 int32_t BSP_AUDIO_IN_SetVolume(uint32_t Instance, uint32_t Volume)
03500 {
03501   int32_t ret;
03502
03503   if ((Instance >= AUDIO_IN_INSTANCES_NBR) || (Volume > 100U))
03504   {
03505     ret = BSP_ERROR_WRONG_PARAM;
03506   }
03507   else
03508   {
03509     /* Feature not supported */
03510     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
03511   }
03512
03513   /* Return BSP status */
03514   return ret;
03515 }
03516
03517 /**
03518   * @brief  Get the current audio in volume level.
03519   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03520   * @param  Volume    Volume level to be returned
03521   * @retval BSP status
03522   */
03523 int32_t BSP_AUDIO_IN_GetVolume(uint32_t Instance, uint32_t *Volume)
03524 {
03525   int32_t ret;
03526
03527  if(Instance >= AUDIO_IN_INSTANCES_NBR)
03528   {
03529     ret = BSP_ERROR_WRONG_PARAM;
03530   }
03531   else
03532   {
03533     /* Input Volume to be returned */
03534     *Volume = 0U;
03535     /* Feature not supported */
03536     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
03537   }
03538
03539   /* Return BSP status */
03540   return ret;
03541 }
03542
03543 /**
03544   * @brief  Get Audio In device
03545   * @param  Instance  Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03546   * @param  State     Audio Out state
03547   * @retval BSP status
03548   */
03549 int32_t BSP_AUDIO_IN_GetState(uint32_t Instance, uint32_t *State)
03550 {
03551   int32_t ret = BSP_ERROR_NONE;
03552
03553   if(Instance >= AUDIO_IN_INSTANCES_NBR)
03554   {
03555     ret = BSP_ERROR_WRONG_PARAM;
03556   }
03557   else
03558   {
03559     /* Input State to be returned */
03560     *State = Audio_In_Ctx[Instance].State;
03561   }
03562   return ret;
03563 }
03564
03565 /**
03566   * @brief  This function handles Audio Out DMA interrupt requests.
03567   * @param  Instance Audio IN instance: 0 for SAI, 1 for SAI PDM and 2 for DFSDM
03568   * @param  InputDevice Can be:
03569   *         - AUDIO_IN_DEVICE_ANALOG_MIC
03570   *         - AUDIO_IN_DEVICE_DIGITAL_MIC1
03571   *         - AUDIO_IN_DEVICE_DIGITAL_MIC2
03572   *         - AUDIO_IN_DEVICE_DIGITAL_MIC3
03573   *         - AUDIO_IN_DEVICE_DIGITAL_MIC4
03574   * @retval None
03575   */
03576 void BSP_AUDIO_IN_IRQHandler(uint32_t Instance, uint32_t InputDevice)
03577 {
03578   if(((Instance == 0U) && (InputDevice == AUDIO_IN_DEVICE_DIGITAL_MIC1)) ||\
03579      ((Instance == 0U) && (InputDevice == AUDIO_IN_DEVICE_ANALOG_MIC)) ||\
03580      ((Instance == 1U) && (InputDevice == AUDIO_IN_DEVICE_DIGITAL_MIC1)))
03581   {
03582     HAL_DMA_IRQHandler(haudio_in_sai[Instance].hdmarx);
03583   }
03584   else
03585   {
03586     if((Instance == 2U) && (InputDevice >= AUDIO_IN_DEVICE_DIGITAL_MIC1) &&\
03587       (InputDevice <= AUDIO_IN_DEVICE_DIGITAL_MIC_LAST))
03588     {
03589     HAL_DMA_IRQHandler(haudio_in_dfsdm_filter[POS_VAL(InputDevice)].hdmaReg);
03590     }
03591   }
03592 }
03593
03594 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0) || !defined (USE_HAL_DFSDM_REGISTER_CALLBACKS)
03595 /**
03596   * @brief  Regular conversion complete callback.
03597   * @note   In interrupt mode, user has to read conversion value in this function
03598             using HAL_DFSDM_FilterGetRegularValue.
03599   * @param  hdfsdm_filter   DFSDM filter handle.
03600   * @retval None
03601   */
03602 void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
03603 {
03604   uint32_t index;
03605   static uint32_t DmaRecBuffCplt[DFSDM_MIC_NUMBER]  = {0};
03606   int32_t  tmp;
03607
03608   if(Audio_In_Ctx[2].IsMultiBuff == 1U)
03609   {
03610     /* Call the record update function to get the second half */
03611     BSP_AUDIO_IN_TransferComplete_CallBack(2);
03612   }
03613   else
03614   {
03615     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)])
03616     {
03617       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 1;
03618     }
03619     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)])
03620     {
03621       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 1;
03622     }
03623
03624     if(DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] == 1U)
03625     {
03626       if(DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] == 1U)
03627       {
03628 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03629       SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)][DEFAULT_AUDIO_IN_BUFFER_SIZE/2U], ((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03630       SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)][DEFAULT_AUDIO_IN_BUFFER_SIZE/2U], ((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03631 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03632       for(index = (DEFAULT_AUDIO_IN_BUFFER_SIZE/2U) ; index < DEFAULT_AUDIO_IN_BUFFER_SIZE; index++)
03633       {
03634         if(Audio_In_Ctx[2].ChannelsNbr == 2U)
03635         {
03636           tmp = MicRecBuff[0][index] / 256;
03637           tmp = SaturaLH(tmp, -32768, 32767);
03638           Audio_In_Ctx[2].pBuff[RecBuffTrigger]     = (uint16_t)(tmp);
03639           tmp = MicRecBuff[1][index] / 256;
03640           tmp = SaturaLH(tmp, -32768, 32767);
03641           Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03642         }
03643         else
03644         {
03645           tmp = MicRecBuff[0][index] / 256;
03646           tmp = SaturaLH(tmp, -32768, 32767);
03647           Audio_In_Ctx[2].pBuff[RecBuffTrigger]      = (uint16_t)(tmp);
03648           Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03649         }
03650         RecBuffTrigger +=2U;
03651       }
03652 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03653       SCB_CleanDCache_by_Addr((uint32_t *)Audio_In_Ctx[2].pBuff,  (int32_t)Audio_In_Ctx[2].Size*2);
03654 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03655
03656       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 0;
03657       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 0;
03658     }
03659   }
03660
03661     /* Call Half Transfer Complete callback */
03662     if(RecBuffTrigger == (Audio_In_Ctx[2].Size/4U))
03663     {
03664       if(RecBuffHalf == 0U)
03665       {
03666         RecBuffHalf = 1;
03667         BSP_AUDIO_IN_HalfTransfer_CallBack(2);
03668       }
03669     }
03670     /* Call Transfer Complete callback */
03671     if(RecBuffTrigger == Audio_In_Ctx[2].Size/2U)
03672     {
03673       /* Reset Application Buffer Trigger */
03674       RecBuffTrigger = 0;
03675       RecBuffHalf = 0;
03676       /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
03677       BSP_AUDIO_IN_TransferComplete_CallBack(2);
03678     }
03679   }
03680 }
03681
03682 /**
03683   * @brief  Half regular conversion complete callback.
03684   * @param  hdfsdm_filter   DFSDM filter handle.
03685   * @retval None
03686   */
03687 void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
03688 {
03689   uint32_t index;
03690   static uint32_t DmaRecHalfBuffCplt[DFSDM_MIC_NUMBER]  = {0};
03691   int32_t  tmp;
03692
03693   if(Audio_In_Ctx[2].IsMultiBuff == 1U)
03694   {
03695     /* Call the record update function to get the first half */
03696     BSP_AUDIO_IN_HalfTransfer_CallBack(2);
03697   }
03698   else
03699   {
03700     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)])
03701     {
03702       DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 1;
03703     }
03704     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)])
03705     {
03706       DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 1;
03707     }
03708
03709     if(DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] == 1U)
03710     {
03711       if(DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] == 1U)
03712       {
03713         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)][0], ((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03714         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)][0], ((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03715         for(index = 0 ; index < (DEFAULT_AUDIO_IN_BUFFER_SIZE/2U); index++)
03716         {
03717           if(Audio_In_Ctx[2].ChannelsNbr == 2U)
03718           {
03719             tmp = MicRecBuff[0][index] / 256;
03720             tmp = SaturaLH(tmp, -32768, 32767);
03721             Audio_In_Ctx[2].pBuff[RecBuffTrigger]     = (uint16_t)(tmp);
03722             tmp = MicRecBuff[1][index] / 256;
03723             tmp = SaturaLH(tmp, -32768, 32767);
03724             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03725           }
03726           else
03727           {
03728             tmp = MicRecBuff[0][index] / 256;
03729             tmp = SaturaLH(tmp, -32768, 32767);
03730             Audio_In_Ctx[2].pBuff[RecBuffTrigger]      = (uint16_t)(tmp);
03731             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03732           }
03733           RecBuffTrigger +=2U;
03734         }
03735
03736 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03737         SCB_CleanDCache_by_Addr((uint32_t *)Audio_In_Ctx[2].pBuff, ((int32_t)Audio_In_Ctx[2].Size*2));
03738 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03739
03740         DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 0;
03741         DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 0;
03742       }
03743     }
03744
03745     /* Call Half Transfer Complete callback */
03746     if(RecBuffTrigger == (Audio_In_Ctx[2].Size/4U))
03747     {
03748       if(RecBuffHalf == 0U)
03749       {
03750         RecBuffHalf = 1;
03751         BSP_AUDIO_IN_HalfTransfer_CallBack(2);
03752       }
03753     }
03754     /* Call Transfer Complete callback */
03755     if(RecBuffTrigger == Audio_In_Ctx[2].Size/2U)
03756     {
03757       /* Reset Application Buffer Trigger */
03758       RecBuffTrigger = 0;
03759       RecBuffHalf = 0;
03760       /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
03761       BSP_AUDIO_IN_TransferComplete_CallBack(2);
03762     }
03763   }
03764 }
03765 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 0) || !defined (USE_HAL_DFSDM_REGISTER_CALLBACKS) */
03766
03767 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0) || !defined (USE_HAL_SAI_REGISTER_CALLBACKS)
03768 /**
03769   * @brief  Half reception complete callback.
03770   * @param  hsai   SAI handle.
03771   * @retval None
03772   */
03773 void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
03774 {
03775   /* Prevent unused argument(s) compilation warning */
03776   UNUSED(hsai);
03777
03778   /* Call the record update function to get the first half */
03779   BSP_AUDIO_IN_HalfTransfer_CallBack(0);
03780 }
03781
03782 /**
03783   * @brief  Reception complete callback.
03784   * @param  hsai   SAI handle.
03785   * @retval None
03786   */
03787 void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
03788 {
03789   /* Prevent unused argument(s) compilation warning */
03790   UNUSED(hsai);
03791
03792   /* Call the record update function to get the second half */
03793   BSP_AUDIO_IN_TransferComplete_CallBack(0);
03794 }
03795 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 0) || !defined (USE_HAL_SAI_REGISTER_CALLBACKS) */
03796
03797 /**
03798   * @brief  User callback when record buffer is filled.
03799   * @retval None
03800   */
03801 __weak void BSP_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance)
03802 {
03803   /* Prevent unused argument(s) compilation warning */
03804   UNUSED(Instance);
03805
03806   /* This function should be implemented by the user application.
03807      It is called into this driver when the current buffer is filled
03808      to prepare the next buffer pointer and its size. */
03809 }
03810
03811 /**
03812   * @brief  Manages the DMA Half Transfer complete event.
03813   * @retval None
03814   */
03815 __weak void BSP_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance)
03816 {
03817   /* Prevent unused argument(s) compilation warning */
03818   UNUSED(Instance);
03819
03820   /* This function should be implemented by the user application.
03821      It is called into this driver when the current buffer is filled
03822      to prepare the next buffer pointer and its size. */
03823 }
03824
03825 /**
03826   * @brief  Audio IN Error callback function.
03827   * @retval None
03828   */
03829 __weak void BSP_AUDIO_IN_Error_CallBack(uint32_t Instance)
03830 {
03831   /* Prevent unused argument(s) compilation warning */
03832   UNUSED(Instance);
03833
03834   /* This function is called when an Interrupt due to transfer error on or peripheral
03835      error occurs. */
03836 }
03837
03838 /**
03839   * @}
03840   */
03841
03842 /** @defgroup STM32H735G_DISCO_AUDIO_IN_Private_Functions AUDIO IN Private Functions
03843   * @{
03844   */
03845 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
03846 /**
03847   * @brief  Half reception complete callback.
03848   * @param  hsai   SAI handle.
03849   * @retval None
03850   */
03851 static void SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
03852 {
03853   /* Prevent unused argument(s) compilation warning */
03854   UNUSED(hsai);
03855
03856   /* Call the record update function to get the first half */
03857   BSP_AUDIO_IN_HalfTransfer_CallBack(0);
03858 }
03859
03860 /**
03861   * @brief  Reception complete callback.
03862   * @param  hsai   SAI handle.
03863   * @retval None
03864   */
03865 static void SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
03866 {
03867   /* Prevent unused argument(s) compilation warning */
03868   UNUSED(hsai);
03869
03870   /* Call the record update function to get the second half */
03871   BSP_AUDIO_IN_TransferComplete_CallBack(0);
03872 }
03873 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1) */
03874
03875 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
03876 /**
03877 * @brief  Regular conversion complete callback.
03878 * @note   In interrupt mode, user has to read conversion value in this function
03879 *         using HAL_DFSDM_FilterGetRegularValue.
03880 * @param  hdfsdm_filter   DFSDM filter handle.
03881 * @retval None
03882 */
03883 static void DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
03884 {
03885   uint32_t index;
03886   static uint32_t DmaRecBuffCplt[DFSDM_MIC_NUMBER]  = {0};
03887   int32_t  tmp;
03888
03889   if(Audio_In_Ctx[2].IsMultiBuff == 1U)
03890   {
03891     /* Call the record update function to get the second half */
03892     BSP_AUDIO_IN_TransferComplete_CallBack(2);
03893   }
03894   else
03895   {
03896     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)])
03897     {
03898       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 1;
03899     }
03900     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)])
03901     {
03902       DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 1;
03903     }
03904
03905     if(DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] == 1U)
03906     {
03907       if(DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] == 1U)
03908       {
03909 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03910         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)][DEFAULT_AUDIO_IN_BUFFER_SIZE/2U], (int32_t)((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03911         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)][DEFAULT_AUDIO_IN_BUFFER_SIZE/2U], (int32_t)((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03912 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03913         for(index = (DEFAULT_AUDIO_IN_BUFFER_SIZE/2U) ; index < DEFAULT_AUDIO_IN_BUFFER_SIZE; index++)
03914         {
03915           if(Audio_In_Ctx[2].ChannelsNbr == 2U)
03916           {
03917             tmp = MicRecBuff[0][index] / 256;
03918             tmp = SaturaLH(tmp, -32768, 32767);
03919             Audio_In_Ctx[2].pBuff[RecBuffTrigger]     = (uint16_t)(tmp);
03920             tmp = MicRecBuff[1][index] / 256;
03921             tmp = SaturaLH(tmp, -32768, 32767);
03922             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03923           }
03924           else
03925           {
03926             tmp = MicRecBuff[0][index] / 256;
03927             tmp = SaturaLH(tmp, -32768, 32767);
03928             Audio_In_Ctx[2].pBuff[RecBuffTrigger]      = (uint16_t)(tmp);
03929             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
03930           }
03931           RecBuffTrigger +=2U;
03932         }
03933 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03934         SCB_CleanDCache_by_Addr((uint32_t *)Audio_In_Ctx[2].pBuff,  (int32_t)Audio_In_Ctx[2].Size*2);
03935 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03936
03937         DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 0;
03938         DmaRecBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 0;
03939       }
03940     }
03941
03942     /* Call Half Transfer Complete callback */
03943     if(RecBuffTrigger == (Audio_In_Ctx[2].Size/4U))
03944     {
03945       if(RecBuffHalf == 0U)
03946       {
03947         RecBuffHalf = 1;
03948         BSP_AUDIO_IN_HalfTransfer_CallBack(2);
03949       }
03950     }
03951     /* Call Transfer Complete callback */
03952     if(RecBuffTrigger == Audio_In_Ctx[2].Size/2U)
03953     {
03954       /* Reset Application Buffer Trigger */
03955       RecBuffTrigger = 0;
03956       RecBuffHalf = 0;
03957       /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
03958       BSP_AUDIO_IN_TransferComplete_CallBack(2);
03959     }
03960   }
03961 }
03962
03963 /**
03964   * @brief  Half regular conversion complete callback.
03965   * @param  hdfsdm_filter   DFSDM filter handle.
03966   * @retval None
03967   */
03968 static void DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
03969 {
03970   uint32_t index;
03971   static uint32_t DmaRecHalfBuffCplt[DFSDM_MIC_NUMBER]  = {0};
03972   int32_t  tmp;
03973
03974   if(Audio_In_Ctx[2].IsMultiBuff == 1U)
03975   {
03976     /* Call the record update function to get the first half */
03977     BSP_AUDIO_IN_HalfTransfer_CallBack(2);
03978   }
03979   else
03980   {
03981     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)])
03982     {
03983       DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 1;
03984     }
03985     if(hdfsdm_filter == &haudio_in_dfsdm_filter[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)])
03986     {
03987       DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 1;
03988     }
03989
03990     if(DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] == 1U)
03991     {
03992       if(DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] == 1U)
03993       {
03994 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
03995         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)][0], (int32_t)((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03996         SCB_InvalidateDCache_by_Addr((uint32_t *)&MicRecBuff[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)][0], (int32_t)((int32_t)DEFAULT_AUDIO_IN_BUFFER_SIZE/2)*4);
03997 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
03998         for(index = 0 ; index < (DEFAULT_AUDIO_IN_BUFFER_SIZE/2U); index++)
03999         {
04000           if(Audio_In_Ctx[2].ChannelsNbr == 2U)
04001           {
04002             tmp = MicRecBuff[0][index] / 256;
04003             tmp = SaturaLH(tmp, -32768, 32767);
04004             Audio_In_Ctx[2].pBuff[RecBuffTrigger]     = (uint16_t)(tmp);
04005             tmp = MicRecBuff[1][index] / 256;
04006             tmp = SaturaLH(tmp, -32768, 32767);
04007             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
04008           }
04009           else
04010           {
04011             tmp = MicRecBuff[0][index] / 256;
04012             tmp = SaturaLH(tmp, -32768, 32767);
04013             Audio_In_Ctx[2].pBuff[RecBuffTrigger]      = (uint16_t)(tmp);
04014             Audio_In_Ctx[2].pBuff[RecBuffTrigger + 1U] = (uint16_t)(tmp);
04015           }
04016           RecBuffTrigger +=2U;
04017         }
04018
04019 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
04020         SCB_CleanDCache_by_Addr((uint32_t *)Audio_In_Ctx[2].pBuff, (int32_t)Audio_In_Ctx[2].Size*2);
04021 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
04022
04023         DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] = 0;
04024         DmaRecHalfBuffCplt[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] = 0;
04025       }
04026     }
04027
04028     /* Call Half Transfer Complete callback */
04029     if(RecBuffTrigger == (Audio_In_Ctx[2].Size/4U))
04030     {
04031       if(RecBuffHalf == 0U)
04032       {
04033         RecBuffHalf = 1;
04034         BSP_AUDIO_IN_HalfTransfer_CallBack(2);
04035       }
04036     }
04037     /* Call Transfer Complete callback */
04038     if(RecBuffTrigger == Audio_In_Ctx[2].Size/2U)
04039     {
04040       /* Reset Application Buffer Trigger */
04041       RecBuffTrigger = 0;
04042       RecBuffHalf = 0;
04043       /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
04044       BSP_AUDIO_IN_TransferComplete_CallBack(2);
04045     }
04046   }
04047 }
04048 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
04049
04050 /**
04051   * @brief  Initialize the DFSDM channel MSP.
04052   * @param  hDfsdmChannel DFSDM Channel handle
04053   * @retval None
04054   */
04055 static void DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
04056 {
04057   GPIO_InitTypeDef  GPIO_InitStruct;
04058
04059   /* Prevent unused argument(s) compilation warning */
04060   UNUSED(hDfsdmChannel);
04061
04062   /* DFSDM pins configuration: DFSDM_CKOUT, DMIC_DATIN pins ------------------*/
04063   GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
04064   GPIO_InitStruct.Pull = GPIO_NOPULL;
04065   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
04066
04067   /* Enable DFSDM clock */
04068   AUDIO_DFSDM1_CLK_ENABLE();
04069
04070   /* Enable GPIO clock */
04071   AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE();
04072   AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE();
04073   AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE();
04074   AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE();
04075   AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE();
04076
04077   GPIO_InitStruct.Pin = AUDIO_DFSDM1_CKOUT_PIN;
04078   GPIO_InitStruct.Alternate = AUDIO_DFSDM1_CKOUT_AF;
04079   HAL_GPIO_Init(AUDIO_DFSDM1_CKOUT_GPIO_PORT, &GPIO_InitStruct);
04080
04081   GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC1_PIN;
04082   GPIO_InitStruct.Alternate = AUDIO_DFSDMx_DATIN_MIC1_AF;
04083   HAL_GPIO_Init(AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT, &GPIO_InitStruct);
04084   GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC2_PIN;
04085   GPIO_InitStruct.Alternate = AUDIO_DFSDMx_DATIN_MIC2_AF;
04086   HAL_GPIO_Init(AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT, &GPIO_InitStruct);
04087   GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC3_PIN;
04088   GPIO_InitStruct.Alternate = AUDIO_DFSDMx_DATIN_MIC3_AF;
04089   HAL_GPIO_Init(AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT, &GPIO_InitStruct);
04090   GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC4_PIN;
04091   GPIO_InitStruct.Alternate = AUDIO_DFSDMx_DATIN_MIC4_AF;
04092   HAL_GPIO_Init(AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT, &GPIO_InitStruct);
04093
04094 }
04095
04096 /**
04097   * @brief  DeInitialize the DFSDM channel MSP.
04098   * @param  hDfsdmChannel DFSDM Channel handle
04099   * @retval None
04100   */
04101 static void DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hDfsdmChannel)
04102 {
04103   GPIO_InitTypeDef  GPIO_InitStruct;
04104
04105   /* Prevent unused argument(s) compilation warning */
04106   UNUSED(hDfsdmChannel);
04107
04108   /* DFSDM pins configuration: DFSDM_CKOUT, DMIC_DATIN pins ------------------*/
04109     GPIO_InitStruct.Pin = AUDIO_DFSDM1_CKOUT_PIN;
04110     HAL_GPIO_DeInit(AUDIO_DFSDM1_CKOUT_GPIO_PORT, GPIO_InitStruct.Pin);
04111
04112     GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC1_PIN;
04113     HAL_GPIO_DeInit(AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT, GPIO_InitStruct.Pin);
04114     GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC2_PIN;
04115     HAL_GPIO_DeInit(AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT, GPIO_InitStruct.Pin);
04116     GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC3_PIN;
04117     HAL_GPIO_DeInit(AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT, GPIO_InitStruct.Pin);
04118     GPIO_InitStruct.Pin = AUDIO_DFSDMx_DATIN_MIC4_PIN;
04119     HAL_GPIO_DeInit(AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT, GPIO_InitStruct.Pin);
04120 }
04121
04122 /**
04123   * @brief  Initialize the DFSDM filter MSP.
04124   * @param  hDfsdmFilter DFSDM Filter handle
04125   * @retval None
04126   */
04127 static void DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
04128 {
04129   uint32_t i, mic_num, mic_init[DFSDM_MIC_NUMBER] = {0};
04130   IRQn_Type AUDIO_DFSDM_DMAx_MIC_IRQHandler[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_DMAx_MIC1_IRQ, AUDIO_DFSDMx_DMAx_MIC2_IRQ, AUDIO_DFSDMx_DMAx_MIC3_IRQ, AUDIO_DFSDMx_DMAx_MIC4_IRQ};
04131   DMA_Stream_TypeDef* AUDIO_DFSDMx_DMAx_MIC_STREAM[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_DMAx_MIC1_STREAM, AUDIO_DFSDMx_DMAx_MIC2_STREAM, AUDIO_DFSDMx_DMAx_MIC3_STREAM, AUDIO_DFSDMx_DMAx_MIC4_STREAM};
04132   uint32_t AUDIO_DFSDMx_DMAx_MIC_REQUEST[DFSDM_MIC_NUMBER] = {AUDIO_DFSDMx_DMAx_MIC1_REQUEST, AUDIO_DFSDMx_DMAx_MIC2_REQUEST, AUDIO_DFSDMx_DMAx_MIC3_REQUEST, AUDIO_DFSDMx_DMAx_MIC4_REQUEST};
04133
04134   /* Prevent unused argument(s) compilation warning */
04135   UNUSED(hDfsdmFilter);
04136
04137   /* Enable DFSDM clock */
04138   AUDIO_DFSDM1_CLK_ENABLE();
04139
04140   /* Enable the DMA clock */
04141   AUDIO_DFSDM1_DMAx_CLK_ENABLE();
04142
04143   for(i = 0; i < DFSDM_MIC_NUMBER; i++)
04144   {
04145     if((mic_init[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC1)] != 1U) && ((Audio_In_Ctx[2].Device & AUDIO_IN_DEVICE_DIGITAL_MIC1) == AUDIO_IN_DEVICE_DIGITAL_MIC1))
04146     {
04147       mic_num = 0U;
04148       mic_init[mic_num] = 1;
04149     }
04150     else if((mic_init[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC2)] != 1U) && ((Audio_In_Ctx[2].Device & AUDIO_IN_DEVICE_DIGITAL_MIC2) == AUDIO_IN_DEVICE_DIGITAL_MIC2))
04151     {
04152       mic_num = 1U;
04153       mic_init[mic_num] = 1;
04154     }
04155     else if((mic_init[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC3)] != 1U) &&((Audio_In_Ctx[2].Device & AUDIO_IN_DEVICE_DIGITAL_MIC3) == AUDIO_IN_DEVICE_DIGITAL_MIC3))
04156     {
04157       mic_num = 2U;
04158       mic_init[mic_num] = 1;
04159     }
04160     else if((mic_init[POS_VAL(AUDIO_IN_DEVICE_DIGITAL_MIC4)] != 1U) && ((Audio_In_Ctx[2].Device & AUDIO_IN_DEVICE_DIGITAL_MIC4) == AUDIO_IN_DEVICE_DIGITAL_MIC4))
04161     {
04162       mic_num = 3U;
04163       mic_init[mic_num] = 1;
04164     }
04165     else
04166     {
04167       break;
04168     }
04169     /* Configure the hDmaDfsdm[i] handle parameters */
04170     hDmaDfsdm[mic_num].Init.Request             = AUDIO_DFSDMx_DMAx_MIC_REQUEST[mic_num];
04171     hDmaDfsdm[mic_num].Instance                 = AUDIO_DFSDMx_DMAx_MIC_STREAM[mic_num];
04172     hDmaDfsdm[mic_num].Init.Direction           = DMA_PERIPH_TO_MEMORY;
04173     hDmaDfsdm[mic_num].Init.PeriphInc           = DMA_PINC_DISABLE;
04174     hDmaDfsdm[mic_num].Init.MemInc              = DMA_MINC_ENABLE;
04175     hDmaDfsdm[mic_num].Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
04176     hDmaDfsdm[mic_num].Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
04177     hDmaDfsdm[mic_num].Init.Mode                = DMA_CIRCULAR;
04178     hDmaDfsdm[mic_num].Init.Priority            = DMA_PRIORITY_HIGH;
04179     hDmaDfsdm[mic_num].Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
04180     hDmaDfsdm[mic_num].Init.MemBurst            = DMA_MBURST_SINGLE;
04181     hDmaDfsdm[mic_num].Init.PeriphBurst         = DMA_PBURST_SINGLE;
04182     hDmaDfsdm[mic_num].State                    = HAL_DMA_STATE_RESET;
04183
04184     /* Associate the DMA handle */
04185     __HAL_LINKDMA(&haudio_in_dfsdm_filter[mic_num], hdmaReg, hDmaDfsdm[mic_num]);
04186
04187     /* Reset DMA handle state */
04188     __HAL_DMA_RESET_HANDLE_STATE(&hDmaDfsdm[mic_num]);
04189
04190     /* Configure the DMA Channel */
04191     (void)HAL_DMA_Init(&hDmaDfsdm[mic_num]);
04192
04193     /* DMA IRQ Channel configuration */
04194     HAL_NVIC_SetPriority(AUDIO_DFSDM_DMAx_MIC_IRQHandler[mic_num], BSP_AUDIO_IN_IT_PRIORITY, 0);
04195     HAL_NVIC_EnableIRQ(AUDIO_DFSDM_DMAx_MIC_IRQHandler[mic_num]);
04196   }
04197 }
04198
04199 /**
04200   * @brief  DeInitialize the DFSDM filter MSP.
04201   * @param  hDfsdmFilter DFSDM Filter handle
04202   * @retval None
04203   */
04204 static void DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hDfsdmFilter)
04205 {
04206   uint32_t i;
04207
04208   /* Prevent unused argument(s) compilation warning */
04209   UNUSED(hDfsdmFilter);
04210
04211   /* Configure the DMA Channel */
04212   for(i = 0; i < DFSDM_MIC_NUMBER; i++)
04213   {
04214     if(hDmaDfsdm[i].Instance != NULL)
04215     {
04216       (void)HAL_DMA_DeInit(&hDmaDfsdm[i]);
04217     }
04218   }
04219 }
04220
04221 /**
04222   * @}
04223   */
04224
04225 /**
04226   * @}
04227   */
04228
04229 /**
04230   * @}
04231   */
04232
04233 /**
04234   * @}
04235   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_audio.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_audio.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h735g_discovery_audio.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DISCO_AUDIO_H
00022 #define STM32H735G_DISCO_AUDIO_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h735g_discovery_conf.h"
00030 #include "stm32h735g_discovery_errno.h"
00031
00032 #if (USE_AUDIO_CODEC_WM8994 == 1U)
00033    /* Include audio component Driver */
00034 #include "../Components/wm8994/wm8994.h"
00035 #endif
00036 #include "../Components/Common/audio.h"
00037 /* Include PDM to PCM lib header file */
00038 #include "pdm2pcm_glo.h"
00039
00040
00041 /** @addtogroup BSP
00042   * @{
00043   */
00044
00045 /** @addtogroup STM32H735G_DISCO
00046   * @{
00047   */
00048
00049 /** @addtogroup AUDIO
00050   * @{
00051   */
00052
00053 /** @defgroup STM32H735G_DISCO_AUDIO_Exported_Types AUDIO Exported Types
00054   * @{
00055   */
00056 typedef struct
00057 {
00058   uint32_t                    Device;
00059   uint32_t                    SampleRate;
00060   uint32_t                    BitsPerSample;
00061   uint32_t                    ChannelsNbr;
00062   uint32_t                    Volume;
00063 }BSP_AUDIO_Init_t;
00064
00065 typedef struct
00066 {
00067   uint32_t                    Instance;            /* Audio IN instance              */
00068   uint32_t                    Device;              /* Audio IN device to be used     */
00069   uint32_t                    SampleRate;          /* Audio IN Sample rate           */
00070   uint32_t                    BitsPerSample;       /* Audio IN Sample resolution     */
00071   uint32_t                    ChannelsNbr;         /* Audio IN number of channel     */
00072   uint16_t                    *pBuff;              /* Audio IN record buffer         */
00073   uint8_t                     **pMultiBuff;        /* Audio IN multi-buffer          */
00074   uint32_t                    Size;                /* Audio IN record buffer size    */
00075   uint32_t                    Volume;              /* Audio IN volume                */
00076   uint32_t                    State;               /* Audio IN State                 */
00077   uint32_t                    IsMultiBuff;         /* Audio IN multi-buffer usage    */
00078   uint32_t                    IsMspCallbacksValid; /* Is Msp Callbacks registered     */
00079 }AUDIO_IN_Ctx_t;
00080
00081 typedef struct
00082 {
00083   uint32_t                    Instance;            /* Audio OUT instance              */
00084   uint32_t                    Device;              /* Audio OUT device to be used     */
00085   uint32_t                    SampleRate;          /* Audio OUT Sample rate           */
00086   uint32_t                    BitsPerSample;       /* Audio OUT Sample Bit Per Sample */
00087   uint32_t                    Volume;              /* Audio OUT volume                */
00088   uint32_t                    ChannelsNbr;         /* Audio OUT number of channel     */
00089   uint32_t                    IsMute;              /* Mute state                      */
00090   uint32_t                    State;               /* Audio OUT State                 */
00091   uint32_t                    IsMspCallbacksValid; /* Is Msp Callbacks registered      */
00092 }AUDIO_OUT_Ctx_t;
00093
00094 typedef struct
00095 {
00096   uint32_t AudioFrequency;
00097   uint32_t AudioMode;
00098   uint32_t DataSize;
00099   uint32_t MonoStereoMode;
00100   uint32_t ClockStrobing;
00101   uint32_t Synchro;
00102   uint32_t OutputDrive;
00103   uint32_t SynchroExt;
00104   uint32_t FrameLength;
00105   uint32_t ActiveFrameLength;
00106   uint32_t SlotActive;
00107 }MX_SAI_Config;
00108
00109 typedef struct
00110 {
00111   uint32_t SampleRate;
00112   uint32_t AudioMode;
00113   uint32_t FullDuplexMode;
00114 }MX_I2S_Config;
00115
00116 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)||(USE_HAL_I2S_REGISTER_CALLBACKS == 1)
00117 typedef struct
00118 {
00119 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00120   pSAI_CallbackTypeDef  pMspSaiInitCb;
00121   pSAI_CallbackTypeDef  pMspSaiDeInitCb;
00122 #endif
00123 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1)
00124   pI2S_CallbackTypeDef  pMspI2sInitCb;
00125   pI2S_CallbackTypeDef  pMspI2sDeInitCb;
00126 #endif
00127 }BSP_AUDIO_OUT_Cb_t;
00128 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1)||(USE_HAL_I2S_REGISTER_CALLBACKS == 1) */
00129
00130
00131 typedef struct
00132 {
00133   /* Filter parameters */
00134   DFSDM_Filter_TypeDef   *FilterInstance;
00135   uint32_t               RegularTrigger;
00136   uint32_t               SincOrder;
00137   uint32_t               Oversampling;
00138   /* Channel parameters */
00139   DFSDM_Channel_TypeDef *ChannelInstance;
00140   uint32_t              DigitalMicPins;
00141   uint32_t              DigitalMicType;
00142   uint32_t              Channel4Filter;
00143   uint32_t              ClockDivider;
00144   uint32_t              RightBitShift;
00145 }MX_DFSDM_Config;
00146
00147 #if ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1))
00148 typedef struct
00149 {
00150 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
00151   pSAI_CallbackTypeDef            pMspSaiInitCb;
00152   pSAI_CallbackTypeDef            pMspSaiDeInitCb;
00153 #endif
00154 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
00155   pDFSDM_Filter_CallbackTypeDef   pMspFltrInitCb;
00156   pDFSDM_Filter_CallbackTypeDef   pMspFltrDeInitCb;
00157   pDFSDM_Channel_CallbackTypeDef  pMspChInitCb;
00158   pDFSDM_Channel_CallbackTypeDef  pMspChDeInitCb;
00159 #endif /* (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) */
00160 }BSP_AUDIO_IN_Cb_t;
00161 #endif /* ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1)) */
00162
00163 /**
00164   * @}
00165   */
00166
00167 /** @defgroup STM32H735G_DISCO_AUDIO_Exported_Constants AUDIO Exported Constants
00168   * @{
00169   */
00170 #define AUDIO_I2C_ADDRESS                0x34U
00171
00172 /* AUDIO FREQUENCY */
00173 #define AUDIO_FREQUENCY_192K     192000U
00174 #define AUDIO_FREQUENCY_176K     176400U
00175 #define AUDIO_FREQUENCY_96K       96000U
00176 #define AUDIO_FREQUENCY_88K       88200U
00177 #define AUDIO_FREQUENCY_48K       48000U
00178 #define AUDIO_FREQUENCY_44K       44100U
00179 #define AUDIO_FREQUENCY_32K       32000U
00180 #define AUDIO_FREQUENCY_22K       22050U
00181 #define AUDIO_FREQUENCY_16K       16000U
00182 #define AUDIO_FREQUENCY_11K       11025U
00183 #define AUDIO_FREQUENCY_8K         8000U
00184
00185 /* Audio bits per sample */
00186 #define AUDIO_RESOLUTION_8B                 8U
00187 #define AUDIO_RESOLUTION_16B                16U
00188 #define AUDIO_RESOLUTION_24B                24U
00189 #define AUDIO_RESOLUTION_32B                32U
00190
00191 /* Audio Out devices */
00192 #define AUDIO_OUT_DEVICE_NONE               0U
00193 #define AUDIO_OUT_DEVICE_SPEAKER            1U
00194 #define AUDIO_OUT_DEVICE_HEADPHONE          2U
00195 #define AUDIO_OUT_DEVICE_SPK_HP             3U
00196 #define AUDIO_OUT_DEVICE_AUTO               4U
00197 #define AUDIO_OUT_DEVICE_HDMI               5U
00198
00199 /* Audio Mute state */
00200 #define BSP_AUDIO_MUTE_DISABLED             0U
00201 #define BSP_AUDIO_MUTE_ENABLED              1U
00202
00203 /* Audio Out states */
00204 #define AUDIO_OUT_STATE_RESET               0U
00205 #define AUDIO_OUT_STATE_PLAYING             1U
00206 #define AUDIO_OUT_STATE_STOP                2U
00207 #define AUDIO_OUT_STATE_PAUSE               3U
00208
00209 /* Audio Out states */
00210 /* Volume Input Output selection */
00211 #define AUDIO_VOLUME_INPUT                  0U
00212 #define AUDIO_VOLUME_OUTPUT                 1U
00213
00214 /* Codec commands */
00215 #define CODEC_PDWN_SW                       1U
00216 #define CODEC_MUTE_ON                       1U
00217 #define CODEC_MUTE_OFF                      0U
00218
00219 /* Audio Out instances number */
00220 #define AUDIO_OUT_INSTANCES_NBR             1U
00221
00222 /** CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode
00223   * TDM format :
00224   * +------------------|------------------|--------------------|-------------------+
00225   * | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right  | CODEC_SLOT1 Right |
00226   * +------------------------------------------------------------------------------+
00227   */
00228 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */
00229 #define CODEC_AUDIOFRAME_SLOT_0123                   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
00230 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */
00231 #define CODEC_AUDIOFRAME_SLOT_02                     SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
00232 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */
00233 #define CODEC_AUDIOFRAME_SLOT_13                     SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
00234 /* SAI peripheral configuration defines */
00235 #define AUDIO_OUT_SAIx                           SAI1_Block_B
00236 #define AUDIO_OUT_SAIx_CLK_ENABLE()              __HAL_RCC_SAI1_CLK_ENABLE()
00237 #define AUDIO_OUT_SAIx_CLK_DISABLE()             __HAL_RCC_SAI1_CLK_DISABLE()
00238
00239 #define AUDIO_OUT_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOF_CLK_ENABLE()
00240 #define AUDIO_OUT_SAIx_MCLK_GPIO_PORT            GPIOF
00241 #define AUDIO_OUT_SAIx_MCLK_PIN                  GPIO_PIN_7
00242 #define AUDIO_OUT_SAIx_MCLK_AF                   GPIO_AF6_SAI1
00243
00244 #define AUDIO_OUT_SAIx_SCK_ENABLE()              __HAL_RCC_GPIOF_CLK_ENABLE()
00245 #define AUDIO_OUT_SAIx_SCK_GPIO_PORT             GPIOF
00246 #define AUDIO_OUT_SAIx_SCK_PIN                   GPIO_PIN_8
00247 #define AUDIO_OUT_SAIx_SCK_AF                    GPIO_AF6_SAI1
00248
00249 #define AUDIO_OUT_SAIx_SD_ENABLE()               __HAL_RCC_GPIOF_CLK_ENABLE()
00250 #define AUDIO_OUT_SAIx_SD_GPIO_PORT              GPIOF
00251 #define AUDIO_OUT_SAIx_SD_PIN                    GPIO_PIN_6
00252 #define AUDIO_OUT_SAIx_SD_AF                     GPIO_AF6_SAI1
00253
00254 #define AUDIO_OUT_SAIx_FS_ENABLE()               __HAL_RCC_GPIOF_CLK_ENABLE()
00255 #define AUDIO_OUT_SAIx_FS_GPIO_PORT              GPIOF
00256 #define AUDIO_OUT_SAIx_FS_PIN                    GPIO_PIN_9
00257 #define AUDIO_OUT_SAIx_FS_AF                     GPIO_AF6_SAI1
00258
00259 /* SAI DMA Stream definitions */
00260 #define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00261 #define AUDIO_OUT_SAIx_DMAx_STREAM               DMA2_Stream6
00262 #define AUDIO_OUT_SAIx_DMAx_REQUEST              DMA_REQUEST_SAI1_B
00263 #define AUDIO_OUT_SAIx_DMAx_IRQ                  DMA2_Stream6_IRQn
00264 #define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00265 #define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00266 #define AUDIO_OUT_SAIx_DMAx_IRQHandler           DMA2_Stream6_IRQHandler
00267
00268 /*------------------------------------------------------------------------------
00269                         AUDIO IN CONFIGURATION
00270 ------------------------------------------------------------------------------*/
00271 /* SAI peripheral configuration defines */
00272 #define AUDIO_IN_SAIx                           SAI1_Block_A
00273 #define AUDIO_IN_SAIx_CLK_ENABLE()              __HAL_RCC_SAI1_CLK_ENABLE()
00274 #define AUDIO_IN_SAIx_CLK_DISABLE()             __HAL_RCC_SAI1_CLK_DISABLE()
00275 #define AUDIO_IN_SAIx_AF                        GPIO_AF6_SAI1
00276 #define AUDIO_IN_SAIx_SD_ENABLE()               __HAL_RCC_GPIOE_CLK_ENABLE()
00277 #define AUDIO_IN_SAIx_SD_GPIO_PORT              GPIOE
00278 #define AUDIO_IN_SAIx_SD_PIN                    GPIO_PIN_6
00279
00280 /* SAI DMA Stream definitions */
00281 #define AUDIO_IN_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00282 #define AUDIO_IN_SAIx_DMAx_STREAM               DMA2_Stream4
00283 #define AUDIO_IN_SAIx_DMAx_REQUEST              DMA_REQUEST_SAI1_A
00284 #define AUDIO_IN_SAIx_DMAx_IRQ                  DMA2_Stream4_IRQn
00285 #define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00286 #define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00287 #define AUDIO_IN_SAIx_DMAx_IRQHandler           DMA2_Stream4_IRQHandler
00288
00289 /* SAI PDM input definitions */
00290 #define AUDIO_IN_SAI_PDMx                            SAI4_Block_A
00291 #define AUDIO_IN_SAI_PDMx_CLK_ENABLE()               __HAL_RCC_SAI4_CLK_ENABLE()
00292 #define AUDIO_IN_SAI_PDMx_CLK_DISABLE()              __HAL_RCC_SAI4_CLK_DISABLE()
00293 #define AUDIO_IN_SAI_PDMx_FS_SCK_AF                  GPIO_AF8_SAI4
00294 #define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE()            __HAL_RCC_GPIOE_CLK_ENABLE()
00295 #define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT           GPIOE
00296 #define AUDIO_IN_SAI_PDMx_FS_PIN                     GPIO_PIN_4
00297 #define AUDIO_IN_SAI_PDMx_SCK_PIN                    GPIO_PIN_5
00298
00299 #define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE()            __HAL_RCC_GPIOE_CLK_ENABLE()
00300 #define AUDIO_IN_SAI_PDMx_CLK_IN_PIN                 GPIO_PIN_2
00301 #define AUDIO_IN_SAI_PDMx_CLK_IN_PORT                GPIOE
00302 #define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE()           __HAL_RCC_GPIOC_CLK_ENABLE()
00303 #define AUDIO_IN_SAI_PDMx_DATA_IN_PIN                GPIO_PIN_1
00304 #define AUDIO_IN_SAI_PDMx_DATA_IN_PORT               GPIOC
00305 #define AUDIO_IN_SAI_PDMx_DATA_CLK_AF                GPIO_AF10_SAI4
00306 #define AUDIO_IN_SAI_PDMx_IRQHandler                 SAI4_IRQHandler
00307 #define AUDIO_IN_SAI_PDMx_IRQ                        SAI4_IRQn
00308
00309 /* SAI PDM DMA Stream definitions */
00310 #define AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE()          __HAL_RCC_BDMA_CLK_ENABLE()
00311 #define AUDIO_IN_SAI_PDMx_DMAx_STREAM                BDMA_Channel1
00312 #define AUDIO_IN_SAI_PDMx_DMAx_REQUEST               BDMA_REQUEST_SAI4_A
00313 #define AUDIO_IN_SAI_PDMx_DMAx_IRQ                   BDMA_Channel1_IRQn
00314 #define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE      DMA_PDATAALIGN_HALFWORD
00315 #define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE         DMA_MDATAALIGN_HALFWORD
00316 #define AUDIO_IN_SAI_PDMx_DMAx_IRQHandler            BDMA_Channel1_IRQHandler
00317
00318 /* DFSDM Configuration defines */
00319 #define AUDIO_DFSDMx_MIC1_CHANNEL                    DFSDM1_Channel2
00320 #define AUDIO_DFSDMx_MIC2_CHANNEL                    DFSDM1_Channel1
00321 #define AUDIO_DFSDMx_MIC3_CHANNEL                    DFSDM1_Channel6
00322 #define AUDIO_DFSDMx_MIC4_CHANNEL                    DFSDM1_Channel5
00323
00324 #define AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER         DFSDM_CHANNEL_2
00325 #define AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER         DFSDM_CHANNEL_1
00326 #define AUDIO_DFSDMx_MIC3_CHANNEL_FOR_FILTER         DFSDM_CHANNEL_6
00327 #define AUDIO_DFSDMx_MIC4_CHANNEL_FOR_FILTER         DFSDM_CHANNEL_5
00328
00329 #define AUDIO_DFSDMx_MIC1_FILTER                     DFSDM1_Filter0
00330 #define AUDIO_DFSDMx_MIC2_FILTER                     DFSDM1_Filter1
00331 #define AUDIO_DFSDMx_MIC3_FILTER                     DFSDM1_Filter2
00332 #define AUDIO_DFSDMx_MIC4_FILTER                     DFSDM1_Filter3
00333
00334 #define AUDIO_DFSDM1_CLK_ENABLE()                    __HAL_RCC_DFSDM1_CLK_ENABLE()
00335
00336 /* DATIN for MIC1 (GPIOE_PIN_7) */
00337 #define AUDIO_DFSDMx_DATIN_MIC1_PIN                  GPIO_PIN_7
00338 #define AUDIO_DFSDMx_DATIN_MIC1_AF                   GPIO_AF3_DFSDM1
00339 #define AUDIO_DFSDMx_DATIN_MIC1_GPIO_PORT            GPIOE
00340 #define AUDIO_DFSDMx_DATIN_MIC1_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOE_CLK_ENABLE()
00341
00342 /* DATIN for MIC2 (GPIOE_PIN_7)*/
00343 #define AUDIO_DFSDMx_DATIN_MIC2_PIN                   GPIO_PIN_7
00344 #define AUDIO_DFSDMx_DATIN_MIC2_AF                    GPIO_AF3_DFSDM1
00345 #define AUDIO_DFSDMx_DATIN_MIC2_GPIO_PORT             GPIOE
00346 #define AUDIO_DFSDMx_DATIN_MIC2_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOE_CLK_ENABLE()
00347
00348 /* DATIN for MIC3 (GPIOF_PIN_13)  */
00349 #define AUDIO_DFSDMx_DATIN_MIC3_PIN                  GPIO_PIN_13
00350 #define AUDIO_DFSDMx_DATIN_MIC3_AF                   GPIO_AF3_DFSDM1
00351 #define AUDIO_DFSDMx_DATIN_MIC3_GPIO_PORT            GPIOF
00352 #define AUDIO_DFSDMx_DATIN_MIC3_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOF_CLK_ENABLE()
00353
00354 /* DATIN for MIC4  (GPIOF_PIN_13)*/
00355 #define AUDIO_DFSDMx_DATIN_MIC4_PIN                  GPIO_PIN_13
00356 #define AUDIO_DFSDMx_DATIN_MIC4_AF                   GPIO_AF3_DFSDM1
00357 #define AUDIO_DFSDMx_DATIN_MIC4_GPIO_PORT            GPIOF
00358 #define AUDIO_DFSDMx_DATIN_MIC4_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOF_CLK_ENABLE()
00359
00360 /* CKOUT for all mics connected to DFSDM1 (GPIOE_PIN_9)*/
00361 #define AUDIO_DFSDM1_CKOUT_PIN                       GPIO_PIN_9
00362 #define AUDIO_DFSDM1_CKOUT_AF                        GPIO_AF3_DFSDM1
00363 #define AUDIO_DFSDM1_CKOUT_GPIO_PORT                 GPIOE
00364 #define AUDIO_DFSDM1_CKOUT_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOE_CLK_ENABLE()
00365
00366 /* DFSDM DMA MIC1, MIC2, MIC3 and MIC4 channels definitions */
00367 #define AUDIO_DFSDMx_DMAx_MIC1_STREAM                DMA2_Stream7
00368 #define AUDIO_DFSDMx_DMAx_MIC1_REQUEST               (uint32_t)DMA_REQUEST_DFSDM1_FLT0
00369 #define AUDIO_DFSDMx_DMAx_MIC1_IRQ                   DMA2_Stream7_IRQn
00370 #define AUDIO_DFSDM_DMAx_MIC1_IRQHandler             DMA2_Stream7_IRQHandler
00371
00372 #define AUDIO_DFSDMx_DMAx_MIC2_STREAM                DMA2_Stream0
00373 #define AUDIO_DFSDMx_DMAx_MIC2_REQUEST               (uint32_t)DMA_REQUEST_DFSDM1_FLT1
00374 #define AUDIO_DFSDMx_DMAx_MIC2_IRQ                   DMA2_Stream0_IRQn
00375 #define AUDIO_DFSDM_DMAx_MIC2_IRQHandler             DMA2_Stream0_IRQHandler
00376
00377 #define AUDIO_DFSDMx_DMAx_MIC3_STREAM                DMA2_Stream3
00378 #define AUDIO_DFSDMx_DMAx_MIC3_REQUEST               (uint32_t)DMA_REQUEST_DFSDM1_FLT2
00379 #define AUDIO_DFSDMx_DMAx_MIC3_IRQ                   DMA2_Stream3_IRQn
00380 #define AUDIO_DFSDM_DMAx_MIC3_IRQHandler             DMA2_Stream3_IRQHandler
00381
00382 #define AUDIO_DFSDMx_DMAx_MIC4_STREAM                DMA2_Stream2
00383 #define AUDIO_DFSDMx_DMAx_MIC4_REQUEST               (uint32_t)DMA_REQUEST_DFSDM1_FLT3
00384 #define AUDIO_DFSDMx_DMAx_MIC4_IRQ                   DMA2_Stream2_IRQn
00385 #define AUDIO_DFSDM_DMAx_MIC4_IRQHandler             DMA2_Stream2_IRQHandler
00386
00387 #define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE           DMA_PDATAALIGN_WORD
00388 #define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE              DMA_MDATAALIGN_WORD
00389 #define AUDIO_DFSDM1_DMAx_CLK_ENABLE()               __HAL_RCC_DMA2_CLK_ENABLE()
00390
00391 /* Audio In devices */
00392 /* Analog microphone input from 3.5 audio jack connector */
00393 #define AUDIO_IN_DEVICE_ANALOG_MIC        0x00U
00394 #define AUDIO_IN_DEVICE_ANALOG_LINE1      0x01U
00395
00396 /* MP34DT01TR digital microphone on PCB top side */
00397 #define AUDIO_IN_DEVICE_DIGITAL_MIC1      0x010U
00398 #define AUDIO_IN_DEVICE_DIGITAL_MIC2      0x020U
00399 #define AUDIO_IN_DEVICE_DIGITAL_MIC3      0x040U
00400 #define AUDIO_IN_DEVICE_DIGITAL_MIC4      0x080U
00401 #define AUDIO_IN_DEVICE_DIGITAL_MIC_LAST  AUDIO_IN_DEVICE_DIGITAL_MIC4
00402 #define AUDIO_IN_DEVICE_DIGITAL_MIC       (AUDIO_IN_DEVICE_DIGITAL_MIC1 | AUDIO_IN_DEVICE_DIGITAL_MIC2)
00403
00404 #define DFSDM_MIC_NUMBER                   4U
00405
00406 /* Audio In states */
00407 #define AUDIO_IN_STATE_RESET               0U
00408 #define AUDIO_IN_STATE_RECORDING           1U
00409 #define AUDIO_IN_STATE_STOP                2U
00410 #define AUDIO_IN_STATE_PAUSE               3U
00411
00412 /* Audio In instances number */
00413 #define AUDIO_IN_INSTANCES_NBR             3U
00414 /**
00415   * @}
00416   */
00417
00418 /** @defgroup STM32H735G_DISCO_AUDIO_Exported_Macros AUDIO Exported Macros
00419   * @{
00420   */
00421 #define POS_VAL(VAL)                  (POSITION_VAL(VAL) - 4U)
00422 #define VOLUME_OUT_CONVERT(Volume)    (((Volume) > 100)? 63:((uint8_t)(((Volume) * 63) / 100)))
00423 #define VOLUME_IN_CONVERT(Volume)     (((Volume) >= 100)? 239:((uint8_t)(((Volume) * 239) / 100)))
00424
00425 /**
00426   * @}
00427   */
00428
00429 /** @addtogroup STM32H735G_DISCO_AUDIO_Exported_Variables
00430   * @{
00431   */
00432 /* Audio in and out component object */
00433 extern void *AudioCompObj;
00434 /* Play  */
00435 extern SAI_HandleTypeDef                      haudio_out_sai;
00436 extern AUDIO_OUT_Ctx_t                        Audio_Out_Ctx[];
00437
00438 /* Record */
00439 extern DFSDM_Filter_HandleTypeDef             haudio_in_dfsdm_filter[];
00440 extern DFSDM_Channel_HandleTypeDef            haudio_in_dfsdm_channel[];
00441 extern SAI_HandleTypeDef                      haudio_in_sai[];
00442 extern AUDIO_IN_Ctx_t                         Audio_In_Ctx[];
00443 /**
00444   * @}
00445   */
00446
00447 /** @addtogroup STM32H735G_DISCO_AUDIO_OUT_Exported_Functions
00448   * @{
00449   */
00450 int32_t BSP_AUDIO_OUT_Init(uint32_t Instance, BSP_AUDIO_Init_t* AudioInit);
00451 int32_t BSP_AUDIO_OUT_DeInit(uint32_t Instance);
00452
00453 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1) || (USE_HAL_I2S_REGISTER_CALLBACKS == 1)
00454 int32_t BSP_AUDIO_OUT_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_OUT_Cb_t *CallBacks);
00455 int32_t BSP_AUDIO_OUT_RegisterDefaultMspCallbacks (uint32_t Instance);
00456 #endif /* (USE_HAL_SAI_REGISTER_CALLBACKS == 1)|| (USE_HAL_I2S_REGISTER_CALLBACKS == 1) */
00457
00458 int32_t BSP_AUDIO_OUT_Play(uint32_t Instance, uint8_t* pData, uint32_t NbrOfBytes);
00459 int32_t BSP_AUDIO_OUT_Pause(uint32_t Instance);
00460 int32_t BSP_AUDIO_OUT_Resume(uint32_t Instance);
00461 int32_t BSP_AUDIO_OUT_Stop(uint32_t Instance);
00462 int32_t BSP_AUDIO_OUT_Mute(uint32_t Instance);
00463 int32_t BSP_AUDIO_OUT_UnMute(uint32_t Instance);
00464 int32_t BSP_AUDIO_OUT_IsMute(uint32_t Instance, uint32_t *IsMute);
00465
00466 int32_t BSP_AUDIO_OUT_SetDevice(uint32_t Instance, uint32_t Device);
00467 int32_t BSP_AUDIO_OUT_GetDevice(uint32_t Instance, uint32_t *Device);
00468
00469 int32_t BSP_AUDIO_OUT_SetSampleRate(uint32_t Instance, uint32_t SampleRate);
00470 int32_t BSP_AUDIO_OUT_GetSampleRate(uint32_t Instance, uint32_t *SampleRate);
00471
00472 int32_t BSP_AUDIO_OUT_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample);
00473 int32_t BSP_AUDIO_OUT_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample);
00474
00475 int32_t BSP_AUDIO_OUT_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr);
00476 int32_t BSP_AUDIO_OUT_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr);
00477
00478 int32_t BSP_AUDIO_OUT_SetVolume(uint32_t Instance, uint32_t Volume);
00479 int32_t BSP_AUDIO_OUT_GetVolume(uint32_t Instance, uint32_t *Volume);
00480 int32_t BSP_AUDIO_OUT_GetState(uint32_t Instance, uint32_t *State);
00481
00482 void BSP_AUDIO_OUT_IRQHandler(uint32_t Instance);
00483
00484 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00485 /* This function is called when the requested data has been completely transferred.*/
00486 void    BSP_AUDIO_OUT_TransferComplete_CallBack(uint32_t Instance);
00487
00488 /* This function is called when half of the requested buffer has been transferred. */
00489 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(uint32_t Instance);
00490
00491 /* This function is called when an Interrupt due to transfer error on or peripheral
00492    error occurs. */
00493 void    BSP_AUDIO_OUT_Error_CallBack(uint32_t Instance);
00494
00495 /* These function can be modified in case the current settings need to be changed
00496    for specific application needs */
00497 HAL_StatusTypeDef MX_SAI1_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate);
00498 HAL_StatusTypeDef MX_SAI1_Block_A_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig);
00499 HAL_StatusTypeDef MX_I2S6_ClockConfig(I2S_HandleTypeDef *hi2s, uint32_t SampleRate);
00500 HAL_StatusTypeDef MX_I2S6_Init(I2S_HandleTypeDef* hi2s, MX_I2S_Config *MXConfig);
00501 /**
00502   * @}
00503   */
00504
00505 /** @addtogroup STM32H735G_DISCO_AUDIO_IN_Exported_Functions
00506   * @{
00507   */
00508 int32_t BSP_AUDIO_IN_Init(uint32_t Instance, BSP_AUDIO_Init_t* AudioInit);
00509 int32_t BSP_AUDIO_IN_DeInit(uint32_t Instance);
00510 #if ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1))
00511 int32_t BSP_AUDIO_IN_RegisterDefaultMspCallbacks (uint32_t Instance);
00512 int32_t BSP_AUDIO_IN_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_IN_Cb_t *CallBacks);
00513 #endif /* ((USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) || (USE_HAL_SAI_REGISTER_CALLBACKS == 1)) */
00514 int32_t BSP_AUDIO_IN_Record(uint32_t Instance, uint8_t* pBuf, uint32_t NbrOfBytes);
00515 int32_t BSP_AUDIO_IN_Stop(uint32_t Instance);
00516 int32_t BSP_AUDIO_IN_Pause(uint32_t Instance);
00517 int32_t BSP_AUDIO_IN_Resume(uint32_t Instance);
00518
00519 int32_t BSP_AUDIO_IN_RecordChannels(uint32_t Instance, uint8_t **pBuf, uint32_t NbrOfBytes);
00520 int32_t BSP_AUDIO_IN_StopChannels(uint32_t Instance, uint32_t Device);
00521 int32_t BSP_AUDIO_IN_PauseChannels(uint32_t Instance, uint32_t Device);
00522 int32_t BSP_AUDIO_IN_ResumeChannels(uint32_t Instance, uint32_t Device);
00523
00524 int32_t BSP_AUDIO_IN_SetDevice(uint32_t Instance, uint32_t Device);
00525 int32_t BSP_AUDIO_IN_GetDevice(uint32_t Instance, uint32_t *Device);
00526
00527 int32_t BSP_AUDIO_IN_SetSampleRate(uint32_t Instance, uint32_t SampleRate);
00528 int32_t BSP_AUDIO_IN_GetSampleRate(uint32_t Instance, uint32_t *SampleRate);
00529
00530 int32_t BSP_AUDIO_IN_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample);
00531 int32_t BSP_AUDIO_IN_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample);
00532
00533 int32_t BSP_AUDIO_IN_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr);
00534 int32_t BSP_AUDIO_IN_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr);
00535
00536 int32_t BSP_AUDIO_IN_SetVolume(uint32_t Instance, uint32_t Volume);
00537 int32_t BSP_AUDIO_IN_GetVolume(uint32_t Instance, uint32_t *Volume);
00538 int32_t BSP_AUDIO_IN_GetState(uint32_t Instance, uint32_t *State);
00539 void BSP_AUDIO_IN_IRQHandler(uint32_t Instance, uint32_t InputDevice);
00540
00541 #if (USE_BSP_PDM_LIB_FEATURE > 0U)
00542 /* Specific PDM recodr APIs */
00543 int32_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t Instance, uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut);
00544 int32_t BSP_AUDIO_IN_PDMToPCM(uint32_t Instance, uint16_t *PDMBuf, uint16_t *PCMBuf);
00545 #endif
00546 int32_t BSP_AUDIO_IN_RecordPDM(uint32_t Instance, uint8_t* pBuf, uint32_t NbrOfBytes);
00547
00548 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00549 /* This function should be implemented by the user application.
00550    It is called into this driver when the current buffer is filled to prepare the next
00551    buffer pointer and its size. */
00552 void BSP_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance);
00553 void BSP_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance);
00554
00555 /* This function is called when an Interrupt due to transfer error on or peripheral
00556    error occurs. */
00557 void BSP_AUDIO_IN_Error_CallBack(uint32_t Instance);
00558
00559 /* These function can be modified in case the current settings (e.g. DMA stream)
00560    need to be changed for specific application needs */
00561 HAL_StatusTypeDef MX_DFSDM1_ClockConfig(DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate);
00562 HAL_StatusTypeDef MX_DFSDM1_Init(DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig);
00563 HAL_StatusTypeDef MX_DFSDM2_ClockConfig(DFSDM_Channel_HandleTypeDef *hDfsdmChannel, uint32_t SampleRate);
00564 HAL_StatusTypeDef MX_DFSDM2_Init(DFSDM_Filter_HandleTypeDef *hDfsdmFilter, DFSDM_Channel_HandleTypeDef *hDfsdmChannel, MX_DFSDM_Config *MXConfig);
00565 HAL_StatusTypeDef MX_SAI1_Block_B_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig);
00566 HAL_StatusTypeDef MX_SAI4_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate);
00567 HAL_StatusTypeDef MX_SAI4_Block_A_Init(SAI_HandleTypeDef* hsai, MX_SAI_Config *MXConfig);
00568
00569 /**
00570   * @}
00571   */
00572
00573 /**
00574   * @}
00575   */
00576
00577 /**
00578   * @}
00579   */
00580
00581 /**
00582   * @}
00583   */
00584
00585 #ifdef __cplusplus
00586 }
00587 #endif
00588
00589 #endif /* STM32H735G_DISCO_AUDIO_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_bus.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_bus.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_bus.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to communicate
00006   *          with  external devices available on STM32H735G-DK board (MB1520) from
00007   *          STMicroelectronics.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * Copyright (c) 2019 STMicroelectronics.
00012   * All rights reserved.
00013   *
00014   * This software is licensed under terms that can be found in the LICENSE file
00015   * in the root directory of this software component.
00016   * If no LICENSE file comes with this software, it is provided AS-IS.
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Includes ------------------------------------------------------------------*/
00022 #include "stm32h735g_discovery_bus.h"
00023 #include "stm32h735g_discovery_errno.h"
00024
00025 /** @addtogroup BSP
00026   * @{
00027   */
00028
00029 /** @addtogroup STM32H735G_DK
00030   * @{
00031   */
00032
00033 /** @defgroup STM32H735G_DK_BUS BUS
00034   * @{
00035   */
00036
00037 /** @defgroup STM32H735G_DK_BUS_Private_Marcos Private Marcos
00038   * @{
00039   */
00040 #define DIV_ROUND_CLOSEST(x, d)  (((x) + ((d) / 2U)) / (d))
00041 /**
00042   * @}
00043   */
00044 /** @defgroup STM32H735G_DK_BUS_Private_Constants Private Constants
00045   * @{
00046   */
00047 #ifndef I2C_VALID_TIMING_NBR
00048   #define I2C_VALID_TIMING_NBR                 128U
00049 #endif
00050 #define I2C_SPEED_FREQ_STANDARD                0U    /* 100 kHz */
00051 #define I2C_SPEED_FREQ_FAST                    1U    /* 400 kHz */
00052 #define I2C_SPEED_FREQ_FAST_PLUS               2U    /* 1 MHz */
00053 #define I2C_ANALOG_FILTER_DELAY_MIN            50U   /* ns */
00054 #define I2C_ANALOG_FILTER_DELAY_MAX            260U  /* ns */
00055 #define I2C_USE_ANALOG_FILTER                  1U
00056 #define I2C_DIGITAL_FILTER_COEF                0U
00057 #define I2C_PRESC_MAX                          16U
00058 #define I2C_SCLDEL_MAX                         16U
00059 #define I2C_SDADEL_MAX                         16U
00060 #define I2C_SCLH_MAX                           256U
00061 #define I2C_SCLL_MAX                           256U
00062 #define SEC2NSEC                               1000000000UL
00063 /**
00064   * @}
00065   */
00066
00067 /** @defgroup STM32H735G_DK_BUS_Private_Types Private Types
00068   * @{
00069   */
00070 typedef struct
00071 {
00072   uint32_t freq;       /* Frequency in Hz */
00073   uint32_t freq_min;   /* Minimum frequency in Hz */
00074   uint32_t freq_max;   /* Maximum frequency in Hz */
00075   uint32_t hddat_min;  /* Minimum data hold time in ns */
00076   uint32_t vddat_max;  /* Maximum data valid time in ns */
00077   uint32_t sudat_min;  /* Minimum data setup time in ns */
00078   uint32_t lscl_min;   /* Minimum low period of the SCL clock in ns */
00079   uint32_t hscl_min;   /* Minimum high period of SCL clock in ns */
00080   uint32_t trise;      /* Rise time in ns */
00081   uint32_t tfall;      /* Fall time in ns */
00082   uint32_t dnf;        /* Digital noise filter coefficient */
00083 } I2C_Charac_t;
00084
00085 typedef struct
00086 {
00087   uint32_t presc;      /* Timing prescaler */
00088   uint32_t tscldel;    /* SCL delay */
00089   uint32_t tsdadel;    /* SDA delay */
00090   uint32_t sclh;       /* SCL high period */
00091   uint32_t scll;       /* SCL low period */
00092 } I2C_Timings_t;
00093 /**
00094   * @}
00095   */
00096
00097 /** @defgroup STM32H735G_DK_BUS_Private_Constants Private Constants
00098   * @{
00099   */
00100 static const I2C_Charac_t I2C_Charac[] =
00101 {
00102   [I2C_SPEED_FREQ_STANDARD] =
00103   {
00104     .freq = 100000,
00105     .freq_min = 80000,
00106     .freq_max = 120000,
00107     .hddat_min = 0,
00108     .vddat_max = 3450,
00109     .sudat_min = 250,
00110     .lscl_min = 4700,
00111     .hscl_min = 4000,
00112     .trise = 640,
00113     .tfall = 20,
00114     .dnf = I2C_DIGITAL_FILTER_COEF,
00115   },
00116   [I2C_SPEED_FREQ_FAST] =
00117   {
00118     .freq = 400000,
00119     .freq_min = 320000,
00120     .freq_max = 480000,
00121     .hddat_min = 0,
00122     .vddat_max = 900,
00123     .sudat_min = 100,
00124     .lscl_min = 1300,
00125     .hscl_min = 600,
00126     .trise = 250,
00127     .tfall = 100,
00128     .dnf = I2C_DIGITAL_FILTER_COEF,
00129   },
00130   [I2C_SPEED_FREQ_FAST_PLUS] =
00131   {
00132     .freq = 1000000,
00133     .freq_min = 800000,
00134     .freq_max = 1200000,
00135     .hddat_min = 0,
00136     .vddat_max = 450,
00137     .sudat_min = 50,
00138     .lscl_min = 500,
00139     .hscl_min = 260,
00140     .trise = 60,
00141     .tfall = 100,
00142     .dnf = I2C_DIGITAL_FILTER_COEF,
00143   },
00144 };
00145 /**
00146   * @}
00147   */
00148
00149 /** @defgroup STM32H735G_DK_BUS_Exported_Variables Exported Variables
00150   * @{
00151   */
00152 I2C_HandleTypeDef hbus_i2c4;
00153 /**
00154   * @}
00155   */
00156
00157 /** @defgroup STM32H735G_DK_BUS_Private_Variables Private Variables
00158   * @{
00159   */
00160 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
00161 static uint32_t IsI2c4MspCbValid = 0;
00162 #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
00163 static uint32_t I2c4InitCounter = 0;
00164 static I2C_Timings_t I2c_valid_timing[I2C_VALID_TIMING_NBR];
00165 static uint32_t      I2c_valid_timing_nbr = 0;
00166 #if defined(BSP_USE_CMSIS_OS)
00167 static osSemaphoreId BspI2cSemaphore = 0;
00168 #endif
00169 /**
00170   * @}
00171   */
00172
00173 /** @defgroup STM32H735G_DK_BUS_Private_FunctionPrototypes Private FunctionPrototypes
00174   * @{
00175   */
00176 static void I2C4_MspInit(I2C_HandleTypeDef *phi2c);
00177 static void I2C4_MspDeInit(I2C_HandleTypeDef *phi2c);
00178 static int32_t I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
00179 static int32_t I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
00180 static uint32_t I2C_GetTiming(uint32_t clock_src_freq, uint32_t i2c_freq);
00181 static uint32_t I2C_Compute_SCLL_SCLH(uint32_t clock_src_freq, uint32_t I2C_speed);
00182 static void     I2C_Compute_PRESC_SCLDEL_SDADEL(uint32_t clock_src_freq, uint32_t I2C_speed);
00183
00184 /**
00185   * @}
00186   */
00187
00188 /** @defgroup STM32H735G_DK_BUS_Exported_Functions Exported Functions
00189   * @{
00190   */
00191
00192 /**
00193   * @brief  Initializes I2C HAL.
00194   * @retval BSP status
00195   */
00196 int32_t BSP_I2C4_Init(void)
00197 {
00198   int32_t ret = BSP_ERROR_NONE;
00199
00200   hbus_i2c4.Instance = BUS_I2C4;
00201
00202   if (I2c4InitCounter++ == 0U)
00203   {
00204     if (HAL_I2C_GetState(&hbus_i2c4) == HAL_I2C_STATE_RESET)
00205     {
00206 #if defined(BSP_USE_CMSIS_OS)
00207       if(BspI2cSemaphore == NULL)
00208       {
00209         /* Create semaphore to prevent multiple I2C access */
00210         osSemaphoreDef(BSP_I2C_SEM);
00211         BspI2cSemaphore = osSemaphoreCreate(osSemaphore(BSP_I2C_SEM), 1);
00212       }
00213 #endif
00214 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 0)
00215       /* Init the I2C4 Msp */
00216       I2C4_MspInit(&hbus_i2c4);
00217 #else
00218       if (IsI2c4MspCbValid == 0U)
00219       {
00220         if (BSP_I2C4_RegisterDefaultMspCallbacks() != BSP_ERROR_NONE)
00221         {
00222           ret = BSP_ERROR_MSP_FAILURE;
00223         }
00224       }
00225 #endif
00226       if (ret == BSP_ERROR_NONE)
00227       {
00228         if (MX_I2C4_Init(&hbus_i2c4, I2C_GetTiming(HAL_RCC_GetPCLK2Freq(), BUS_I2C4_FREQUENCY)) != HAL_OK)
00229         {
00230           ret = BSP_ERROR_BUS_FAILURE;
00231         }
00232       }
00233     }
00234   }
00235
00236   return ret;
00237 }
00238
00239 /**
00240   * @brief  DeInitializes I2C HAL.
00241   * @retval None
00242   */
00243 int32_t BSP_I2C4_DeInit(void)
00244 {
00245   int32_t ret  = BSP_ERROR_NONE;
00246
00247   if (I2c4InitCounter > 0U)
00248   {
00249     if (--I2c4InitCounter == 0U)
00250     {
00251 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 0)
00252       I2C4_MspDeInit(&hbus_i2c4);
00253 #endif /* (USE_HAL_I2C_REGISTER_CALLBACKS == 0) */
00254
00255       /* Init the I2C */
00256       if (HAL_I2C_DeInit(&hbus_i2c4) != HAL_OK)
00257       {
00258         ret = BSP_ERROR_BUS_FAILURE;
00259       }
00260     }
00261   }
00262
00263   return ret;
00264 }
00265
00266 /**
00267   * @brief  MX I2C4 initialization.
00268   * @param  hI2c I2C handle
00269   * @param  timing I2C timing
00270   * @retval HAL status
00271   */
00272 __weak HAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *hI2c, uint32_t timing)
00273 {
00274   HAL_StatusTypeDef status = HAL_OK;
00275
00276   hI2c->Init.Timing           = timing;
00277   hI2c->Init.OwnAddress1      = 0;
00278   hI2c->Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00279   hI2c->Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00280   hI2c->Init.OwnAddress2      = 0;
00281   hI2c->Init.OwnAddress2Masks = I2C_OA2_NOMASK;
00282   hI2c->Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00283   hI2c->Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00284
00285   if (HAL_I2C_Init(hI2c) != HAL_OK)
00286   {
00287     status = HAL_ERROR;
00288   }
00289   else
00290   {
00291     uint32_t analog_filter;
00292
00293     analog_filter = (I2C_USE_ANALOG_FILTER == 1U) ? I2C_ANALOGFILTER_ENABLE : I2C_ANALOGFILTER_DISABLE;
00294     if (HAL_I2CEx_ConfigAnalogFilter(hI2c, analog_filter) != HAL_OK)
00295     {
00296       status = HAL_ERROR;
00297     }
00298     else
00299     {
00300       if (HAL_I2CEx_ConfigDigitalFilter(hI2c, I2C_DIGITAL_FILTER_COEF) != HAL_OK)
00301       {
00302         status = HAL_ERROR;
00303       }
00304     }
00305   }
00306
00307   return status;
00308 }
00309
00310 /**
00311   * @brief  Write a 8bit value in a register of the device through BUS.
00312   * @param  DevAddr Device address on Bus.
00313   * @param  Reg    The target register address to write
00314   * @param  pData  The target register value to be written
00315   * @param  Length buffer size to be written
00316   * @retval BSP status
00317   */
00318 int32_t BSP_I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
00319 {
00320   int32_t ret;
00321 #if defined(BSP_USE_CMSIS_OS)
00322   /* Get semaphore to prevent multiple I2C access */
00323   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00324 #endif
00325   if(I2C4_WriteReg(DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length) == 0)
00326   {
00327     ret = BSP_ERROR_NONE;
00328   }
00329   else
00330   {
00331     if( HAL_I2C_GetError(&hbus_i2c4) == HAL_I2C_ERROR_AF)
00332     {
00333       ret = BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE;
00334     }
00335     else
00336     {
00337       ret =  BSP_ERROR_PERIPH_FAILURE;
00338     }
00339   }
00340 #if defined(BSP_USE_CMSIS_OS)
00341   /* Release semaphore to prevent multiple I2C access */
00342   osSemaphoreRelease(BspI2cSemaphore);
00343 #endif
00344   return ret;
00345 }
00346
00347 /**
00348   * @brief  Read a 8bit register of the device through BUS
00349   * @param  DevAddr Device address on BUS
00350   * @param  Reg     The target register address to read
00351   * @param  pData   Pointer to data buffer
00352   * @param  Length  Length of the data
00353   * @retval BSP status
00354   */
00355 int32_t BSP_I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
00356 {
00357   int32_t ret;
00358 #if defined(BSP_USE_CMSIS_OS)
00359   /* Get semaphore to prevent multiple I2C access */
00360   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00361 #endif
00362   if(I2C4_ReadReg(DevAddr, Reg, I2C_MEMADD_SIZE_8BIT, pData, Length) == 0)
00363   {
00364     ret = BSP_ERROR_NONE;
00365   }
00366   else
00367   {
00368     if( HAL_I2C_GetError(&hbus_i2c4) == HAL_I2C_ERROR_AF)
00369     {
00370       ret = BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE;
00371     }
00372     else
00373     {
00374       ret =  BSP_ERROR_PERIPH_FAILURE;
00375     }
00376   }
00377 #if defined(BSP_USE_CMSIS_OS)
00378   /* Release semaphore to prevent multiple I2C access */
00379   osSemaphoreRelease(BspI2cSemaphore);
00380 #endif
00381   return ret;
00382 }
00383
00384 /**
00385   * @brief  Write a 16bit value in a register of the device through BUS.
00386   * @param  DevAddr Device address on Bus.
00387   * @param  Reg    The target register address to write
00388   * @param  pData  The target register value to be written
00389   * @param  Length buffer size to be written
00390   * @retval BSP status
00391   */
00392 int32_t BSP_I2C4_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
00393 {
00394   int32_t ret;
00395  #if defined(BSP_USE_CMSIS_OS)
00396   /* Get semaphore to prevent multiple I2C access */
00397   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00398 #endif
00399   if(I2C4_WriteReg(DevAddr, Reg, I2C_MEMADD_SIZE_16BIT, pData, Length) == 0)
00400   {
00401     ret = BSP_ERROR_NONE;
00402   }
00403   else
00404   {
00405     if( HAL_I2C_GetError(&hbus_i2c4) == HAL_I2C_ERROR_AF)
00406     {
00407       ret = BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE;
00408     }
00409     else
00410     {
00411       ret =  BSP_ERROR_PERIPH_FAILURE;
00412     }
00413   }
00414 #if defined(BSP_USE_CMSIS_OS)
00415   /* Release semaphore to prevent multiple I2C access */
00416   osSemaphoreRelease(BspI2cSemaphore);
00417 #endif
00418   return ret;
00419 }
00420
00421 /**
00422   * @brief  Read a 16bit register of the device through BUS
00423   * @param  DevAddr Device address on BUS
00424   * @param  Reg     The target register address to read
00425   * @param  pData   Pointer to data buffer
00426   * @param  Length  Length of the data
00427   * @retval BSP status
00428   */
00429 int32_t BSP_I2C4_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
00430 {
00431   int32_t ret;
00432 #if defined(BSP_USE_CMSIS_OS)
00433   /* Get semaphore to prevent multiple I2C access */
00434   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00435 #endif
00436   if(I2C4_ReadReg(DevAddr, Reg, I2C_MEMADD_SIZE_16BIT, pData, Length) == 0)
00437   {
00438     ret = BSP_ERROR_NONE;
00439   }
00440   else
00441   {
00442     if( HAL_I2C_GetError(&hbus_i2c4) == HAL_I2C_ERROR_AF)
00443     {
00444       ret = BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE;
00445     }
00446     else
00447     {
00448       ret =  BSP_ERROR_PERIPH_FAILURE;
00449     }
00450   }
00451 #if defined(BSP_USE_CMSIS_OS)
00452   /* Release semaphore to prevent multiple I2C access */
00453   osSemaphoreRelease(BspI2cSemaphore);
00454 #endif
00455   return ret;
00456 }
00457
00458 /**
00459   * @brief  Checks if target device is ready for communication.
00460   * @note   This function is used with Memory devices
00461   * @param  DevAddr  Target device address
00462   * @param  Trials      Number of trials
00463   * @retval BSP status
00464   */
00465 int32_t BSP_I2C4_IsReady(uint16_t DevAddr, uint32_t Trials)
00466 {
00467   int32_t ret = BSP_ERROR_NONE;
00468 #if defined(BSP_USE_CMSIS_OS)
00469   /* Get semaphore to prevent multiple I2C access */
00470   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00471 #endif
00472   if(HAL_I2C_IsDeviceReady(&hbus_i2c4, DevAddr, Trials, 1000) != HAL_OK)
00473   {
00474     ret = BSP_ERROR_BUSY;
00475   }
00476 #if defined(BSP_USE_CMSIS_OS)
00477   /* Release semaphore to prevent multiple I2C access */
00478   osSemaphoreRelease(BspI2cSemaphore);
00479 #endif
00480   return ret;
00481 }
00482
00483 /**
00484   * @brief  Delay function
00485   * @retval Tick value
00486   */
00487 int32_t BSP_GetTick(void)
00488 {
00489   return (int32_t)HAL_GetTick();
00490 }
00491
00492 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
00493 /**
00494   * @brief Register Default I2C4 Bus Msp Callbacks
00495   * @retval BSP status
00496   */
00497 int32_t BSP_I2C4_RegisterDefaultMspCallbacks (void)
00498 {
00499   int32_t ret = BSP_ERROR_NONE;
00500 #if defined(BSP_USE_CMSIS_OS)
00501   /* Get semaphore to prevent multiple I2C access */
00502   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00503 #endif
00504   __HAL_I2C_RESET_HANDLE_STATE(&hbus_i2c4);
00505
00506   /* Register default MspInit/MspDeInit Callback */
00507   if(HAL_I2C_RegisterCallback(&hbus_i2c4, HAL_I2C_MSPINIT_CB_ID, I2C4_MspInit) != HAL_OK)
00508   {
00509     ret = BSP_ERROR_PERIPH_FAILURE;
00510   }
00511   else if(HAL_I2C_RegisterCallback(&hbus_i2c4, HAL_I2C_MSPDEINIT_CB_ID, I2C4_MspDeInit) != HAL_OK)
00512   {
00513     ret = BSP_ERROR_PERIPH_FAILURE;
00514   }
00515   else
00516   {
00517     IsI2c4MspCbValid = 1U;
00518   }
00519 #if defined(BSP_USE_CMSIS_OS)
00520   /* Release semaphore to prevent multiple I2C access */
00521   osSemaphoreRelease(BspI2cSemaphore);
00522 #endif
00523   /* BSP status */
00524   return ret;
00525 }
00526
00527 /**
00528   * @brief Register I2C4 Bus Msp Callback registering
00529   * @param Callbacks     pointer to I2C4 MspInit/MspDeInit callback functions
00530   * @retval BSP status
00531   */
00532 int32_t BSP_I2C4_RegisterMspCallbacks (BSP_I2C_Cb_t *Callback)
00533 {
00534   int32_t ret = BSP_ERROR_NONE;
00535 #if defined(BSP_USE_CMSIS_OS)
00536   /* Get semaphore to prevent multiple I2C access */
00537   osSemaphoreWait(BspI2cSemaphore, osWaitForever);
00538 #endif
00539   __HAL_I2C_RESET_HANDLE_STATE(&hbus_i2c4);
00540
00541   /* Register MspInit/MspDeInit Callbacks */
00542   if(HAL_I2C_RegisterCallback(&hbus_i2c4, HAL_I2C_MSPINIT_CB_ID, Callback->pMspI2cInitCb) != HAL_OK)
00543   {
00544     ret = BSP_ERROR_PERIPH_FAILURE;
00545   }
00546   else if(HAL_I2C_RegisterCallback(&hbus_i2c4, HAL_I2C_MSPDEINIT_CB_ID, Callback->pMspI2cDeInitCb) != HAL_OK)
00547   {
00548     ret = BSP_ERROR_PERIPH_FAILURE;
00549   }
00550   else
00551   {
00552     IsI2c4MspCbValid = 1U;
00553   }
00554 #if defined(BSP_USE_CMSIS_OS)
00555   /* Release semaphore to prevent multiple I2C access */
00556   osSemaphoreRelease(BspI2cSemaphore);
00557 #endif
00558   /* BSP status */
00559   return ret;
00560 }
00561 #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
00562 /**
00563   * @}
00564   */
00565
00566 /** @defgroup STM32H735G_EVAL_BUS_Private_Functions Private Functions
00567   * @{
00568   */
00569 /**
00570   * @brief  Compute I2C timing according current I2C clock source and required I2C clock.
00571   * @param  clock_src_freq I2C clock source in Hz.
00572   * @param  i2c_freq Required I2C clock in Hz.
00573   * @retval I2C timing or 0 in case of error.
00574   */
00575 static uint32_t I2C_GetTiming(uint32_t clock_src_freq, uint32_t i2c_freq)
00576 {
00577   uint32_t ret = 0;
00578   uint32_t speed;
00579   uint32_t idx;
00580
00581   if((clock_src_freq != 0U) && (i2c_freq != 0U))
00582   {
00583     for ( speed = 0 ; speed <=  (uint32_t)I2C_SPEED_FREQ_FAST_PLUS ; speed++)
00584     {
00585       if ((i2c_freq >= I2C_Charac[speed].freq_min) &&
00586           (i2c_freq <= I2C_Charac[speed].freq_max))
00587       {
00588         I2C_Compute_PRESC_SCLDEL_SDADEL(clock_src_freq, speed);
00589         idx = I2C_Compute_SCLL_SCLH(clock_src_freq, speed);
00590
00591         if (idx < I2C_VALID_TIMING_NBR)
00592         {
00593           ret = ((I2c_valid_timing[idx].presc  & 0x0FU) << 28) |\
00594                 ((I2c_valid_timing[idx].tscldel & 0x0FU) << 20) |\
00595                 ((I2c_valid_timing[idx].tsdadel & 0x0FU) << 16) |\
00596                 ((I2c_valid_timing[idx].sclh & 0xFFU) << 8) |\
00597                 ((I2c_valid_timing[idx].scll & 0xFFU) << 0);
00598         }
00599         break;
00600       }
00601     }
00602   }
00603
00604   return ret;
00605 }
00606
00607 /**
00608   * @brief  Compute PRESC, SCLDEL and SDADEL.
00609   * @param  clock_src_freq I2C source clock in HZ.
00610   * @param  I2C_speed I2C frequency (index).
00611   * @retval None.
00612   */
00613 static void I2C_Compute_PRESC_SCLDEL_SDADEL(uint32_t clock_src_freq, uint32_t I2C_speed)
00614 {
00615   uint32_t prev_presc = I2C_PRESC_MAX;
00616   uint32_t ti2cclk;
00617   int32_t  tsdadel_min, tsdadel_max;
00618   int32_t  tscldel_min;
00619   uint32_t presc, scldel, sdadel;
00620   uint32_t tafdel_min, tafdel_max;
00621
00622   ti2cclk   = (SEC2NSEC + (clock_src_freq / 2U))/ clock_src_freq;
00623
00624   tafdel_min = (I2C_USE_ANALOG_FILTER == 1U) ? I2C_ANALOG_FILTER_DELAY_MIN : 0U;
00625   tafdel_max = (I2C_USE_ANALOG_FILTER == 1U) ? I2C_ANALOG_FILTER_DELAY_MAX : 0U;
00626
00627   /* tDNF = DNF x tI2CCLK
00628      tPRESC = (PRESC+1) x tI2CCLK
00629      SDADEL >= {tf +tHD;DAT(min) - tAF(min) - tDNF - [3 x tI2CCLK]} / {tPRESC}
00630      SDADEL <= {tVD;DAT(max) - tr - tAF(max) - tDNF- [4 x tI2CCLK]} / {tPRESC} */
00631
00632   tsdadel_min = (int32_t)I2C_Charac[I2C_speed].tfall + (int32_t)I2C_Charac[I2C_speed].hddat_min -
00633     (int32_t)tafdel_min - (int32_t)(((int32_t)I2C_Charac[I2C_speed].dnf + 3) * (int32_t)ti2cclk);
00634
00635   tsdadel_max = (int32_t)I2C_Charac[I2C_speed].vddat_max - (int32_t)I2C_Charac[I2C_speed].trise -
00636     (int32_t)tafdel_max - (int32_t)(((int32_t)I2C_Charac[I2C_speed].dnf + 4) * (int32_t)ti2cclk);
00637
00638
00639   /* {[tr+ tSU;DAT(min)] / [tPRESC]} - 1 <= SCLDEL */
00640   tscldel_min = (int32_t)I2C_Charac[I2C_speed].trise + (int32_t)I2C_Charac[I2C_speed].sudat_min;
00641
00642   if (tsdadel_min <= 0)
00643   {
00644     tsdadel_min = 0;
00645   }
00646
00647   if (tsdadel_max <= 0)
00648   {
00649     tsdadel_max = 0;
00650   }
00651
00652   for (presc = 0; presc < I2C_PRESC_MAX; presc++)
00653   {
00654     for (scldel = 0; scldel < I2C_SCLDEL_MAX; scldel++)
00655     {
00656       /* TSCLDEL = (SCLDEL+1) * (PRESC+1) * TI2CCLK */
00657       uint32_t tscldel = (scldel + 1U) * (presc + 1U) * ti2cclk;
00658
00659       if (tscldel >= (uint32_t)tscldel_min)
00660       {
00661         for (sdadel = 0; sdadel < I2C_SDADEL_MAX; sdadel++)
00662         {
00663           /* TSDADEL = SDADEL * (PRESC+1) * TI2CCLK */
00664           uint32_t tsdadel = (sdadel * (presc + 1U)) * ti2cclk;
00665
00666           if ((tsdadel >= (uint32_t)tsdadel_min) && (tsdadel <= (uint32_t)tsdadel_max))
00667           {
00668             if(presc != prev_presc)
00669             {
00670               I2c_valid_timing[I2c_valid_timing_nbr].presc = presc;
00671               I2c_valid_timing[I2c_valid_timing_nbr].tscldel = scldel;
00672               I2c_valid_timing[I2c_valid_timing_nbr].tsdadel = sdadel;
00673               prev_presc = presc;
00674               I2c_valid_timing_nbr ++;
00675
00676               if(I2c_valid_timing_nbr >= I2C_VALID_TIMING_NBR)
00677               {
00678                 return;
00679               }
00680             }
00681           }
00682         }
00683       }
00684     }
00685   }
00686 }
00687
00688 /**
00689   * @brief  Calculate SCLL and SCLH and find best configuration.
00690   * @param  clock_src_freq I2C source clock in HZ.
00691   * @param  I2C_speed I2C frequency (index).
00692   * @retval config index (0 to I2C_VALID_TIMING_NBR], 0xFFFFFFFF for no valid config.
00693   */
00694 static uint32_t I2C_Compute_SCLL_SCLH (uint32_t clock_src_freq, uint32_t I2C_speed)
00695 {
00696  uint32_t ret = 0xFFFFFFFFU;
00697   uint32_t ti2cclk;
00698   uint32_t ti2cspeed;
00699   uint32_t prev_error;
00700   uint32_t dnf_delay;
00701   uint32_t clk_min, clk_max;
00702   uint32_t scll, sclh;
00703   uint32_t tafdel_min;
00704
00705   ti2cclk   = (SEC2NSEC + (clock_src_freq / 2U))/ clock_src_freq;
00706   ti2cspeed   = (SEC2NSEC + (I2C_Charac[I2C_speed].freq / 2U))/ I2C_Charac[I2C_speed].freq;
00707
00708   tafdel_min = (I2C_USE_ANALOG_FILTER == 1U) ? I2C_ANALOG_FILTER_DELAY_MIN : 0U;
00709
00710   /* tDNF = DNF x tI2CCLK */
00711   dnf_delay = I2C_Charac[I2C_speed].dnf * ti2cclk;
00712
00713   clk_max = SEC2NSEC / I2C_Charac[I2C_speed].freq_min;
00714   clk_min = SEC2NSEC / I2C_Charac[I2C_speed].freq_max;
00715
00716   prev_error = ti2cspeed;
00717
00718   for (uint32_t count = 0; count < I2c_valid_timing_nbr; count++)
00719   {
00720     /* tPRESC = (PRESC+1) x tI2CCLK*/
00721     uint32_t tpresc = (I2c_valid_timing[count].presc + 1U) * ti2cclk;
00722
00723     for (scll = 0; scll < I2C_SCLL_MAX; scll++)
00724     {
00725       /* tLOW(min) <= tAF(min) + tDNF + 2 x tI2CCLK + [(SCLL+1) x tPRESC ] */
00726       uint32_t tscl_l = tafdel_min + dnf_delay + (2U * ti2cclk) + ((scll + 1U) * tpresc);
00727
00728
00729       /* The I2CCLK period tI2CCLK must respect the following conditions:
00730       tI2CCLK < (tLOW - tfilters) / 4 and tI2CCLK < tHIGH */
00731       if ((tscl_l > I2C_Charac[I2C_speed].lscl_min) && (ti2cclk < ((tscl_l - tafdel_min - dnf_delay) / 4U)))
00732       {
00733         for (sclh = 0; sclh < I2C_SCLH_MAX; sclh++)
00734         {
00735           /* tHIGH(min) <= tAF(min) + tDNF + 2 x tI2CCLK + [(SCLH+1) x tPRESC] */
00736           uint32_t tscl_h = tafdel_min + dnf_delay + (2U * ti2cclk) + ((sclh + 1U) * tpresc);
00737
00738           /* tSCL = tf + tLOW + tr + tHIGH */
00739           uint32_t tscl = tscl_l + tscl_h + I2C_Charac[I2C_speed].trise + I2C_Charac[I2C_speed].tfall;
00740
00741           if ((tscl >= clk_min) && (tscl <= clk_max) && (tscl_h >= I2C_Charac[I2C_speed].hscl_min) && (ti2cclk < tscl_h))
00742           {
00743             int32_t error = (int32_t)tscl - (int32_t)ti2cspeed;
00744
00745             if (error < 0)
00746             {
00747               error = -error;
00748             }
00749
00750             /* look for the timings with the lowest clock error */
00751             if ((uint32_t)error < prev_error)
00752             {
00753               prev_error = (uint32_t)error;
00754               I2c_valid_timing[count].scll = scll;
00755               I2c_valid_timing[count].sclh = sclh;
00756               ret = count;
00757             }
00758           }
00759         }
00760       }
00761     }
00762   }
00763
00764   return ret;
00765 }
00766
00767 /**
00768   * @brief  Initializes I2C MSP.
00769   * @param  phi2c  I2C handler
00770   * @retval None
00771   */
00772 static void I2C4_MspInit(I2C_HandleTypeDef *phi2c)
00773 {
00774   GPIO_InitTypeDef  gpio_init_structure;
00775
00776   /* Prevent unused argument(s) compilation warning */
00777   UNUSED(phi2c);
00778
00779   /*** Configure the GPIOs ***/
00780   /* Enable SCL GPIO clock */
00781   BUS_I2C4_SCL_GPIO_CLK_ENABLE();
00782   /* Enable SDA GPIO clock */
00783   BUS_I2C4_SDA_GPIO_CLK_ENABLE();
00784
00785   /* Configure I2C Tx as alternate function */
00786   gpio_init_structure.Pin       = BUS_I2C4_SCL_PIN;
00787   gpio_init_structure.Mode      = GPIO_MODE_AF_OD;
00788   gpio_init_structure.Pull      = GPIO_PULLUP;
00789   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_HIGH;
00790   gpio_init_structure.Alternate = BUS_I2C4_SCL_AF;
00791   HAL_GPIO_Init(BUS_I2C4_SCL_GPIO_PORT, &gpio_init_structure);
00792
00793   /* Configure I2C Rx as alternate function */
00794   gpio_init_structure.Pin       = BUS_I2C4_SDA_PIN;
00795   gpio_init_structure.Alternate = BUS_I2C4_SDA_AF;
00796   HAL_GPIO_Init(BUS_I2C4_SDA_GPIO_PORT, &gpio_init_structure);
00797
00798   /*** Configure the I2C peripheral ***/
00799   /* Enable I2C clock */
00800   BUS_I2C4_CLK_ENABLE();
00801
00802   /* Force the I2C peripheral clock reset */
00803   BUS_I2C4_FORCE_RESET();
00804
00805   /* Release the I2C peripheral clock reset */
00806   BUS_I2C4_RELEASE_RESET();
00807 }
00808
00809 /**
00810   * @brief  DeInitializes I2C MSP.
00811   * @param  phi2c  I2C handler
00812   * @retval None
00813   */
00814 static void I2C4_MspDeInit(I2C_HandleTypeDef *phi2c)
00815 {
00816   GPIO_InitTypeDef  gpio_init_structure;
00817
00818   /* Prevent unused argument(s) compilation warning */
00819   UNUSED(phi2c);
00820
00821   /* Configure I2C Tx, Rx as alternate function */
00822   gpio_init_structure.Pin = BUS_I2C4_SCL_PIN;
00823   HAL_GPIO_DeInit(BUS_I2C4_SCL_GPIO_PORT, gpio_init_structure.Pin );
00824   gpio_init_structure.Pin = BUS_I2C4_SDA_PIN;
00825   HAL_GPIO_DeInit(BUS_I2C4_SDA_GPIO_PORT, gpio_init_structure.Pin);
00826
00827   /* Disable I2C clock */
00828   BUS_I2C4_CLK_DISABLE();
00829 }
00830
00831 /**
00832   * @brief  Write a value in a register of the device through BUS.
00833   * @param  Addr       Device address on Bus.
00834   * @param  MemAddSize Size of internal memory address
00835   * @param  Reg        The target register address to write
00836   * @param  pData      The target register value to be written
00837   * @param  Length     data length in bytes
00838   * @retval BSP status
00839   */
00840 static int32_t I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
00841 {
00842   if(HAL_I2C_Mem_Write(&hbus_i2c4, DevAddr, Reg, MemAddSize, pData, Length, 1000) == HAL_OK)
00843   {
00844     return BSP_ERROR_NONE;
00845   }
00846
00847   return BSP_ERROR_BUS_FAILURE;
00848 }
00849
00850 /**
00851   * @brief  Read a register of the device through BUS
00852   * @param  DevAddr    Device address on BUS
00853   * @param  MemAddSize Size of internal memory address
00854   * @param  Reg        The target register address to read
00855   * @retval BSP status
00856   */
00857 static int32_t I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
00858 {
00859   if (HAL_I2C_Mem_Read(&hbus_i2c4, DevAddr, Reg, MemAddSize, pData, Length, 1000) == HAL_OK)
00860   {
00861     return BSP_ERROR_NONE;
00862   }
00863
00864   return BSP_ERROR_BUS_FAILURE;
00865 }
00866
00867 /**
00868   * @}
00869   */
00870
00871 /**
00872   * @}
00873   */
00874
00875 /**
00876   * @}
00877   */
00878
00879 /**
00880   * @}
00881   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_bus.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_bus.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_bus.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32H735G_DK LEDs,
00006   *          push-buttons hardware resources.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DK_BUS_H
00022 #define STM32H735G_DK_BUS_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028
00029  /* Includes ------------------------------------------------------------------*/
00030 #include "stm32h735g_discovery_conf.h"
00031
00032 #if defined(BSP_USE_CMSIS_OS)
00033 #include "cmsis_os.h"
00034 #endif
00035 /** @addtogroup BSP
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32H735G_DK
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32H735G_DK_BUS
00044   * @{
00045   */
00046 /** @defgroup STM32H735G_DK_BUS_Exported_Types Exported Types
00047   * @{
00048   */
00049
00050 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
00051 typedef struct
00052 {
00053   pI2C_CallbackTypeDef  pMspI2cInitCb;
00054   pI2C_CallbackTypeDef  pMspI2cDeInitCb;
00055 }BSP_I2C_Cb_t;
00056 #endif /* (USE_HAL_I2C_REGISTER_CALLBACKS == 1) */
00057
00058 /**
00059   * @}
00060   */
00061
00062 /** @defgroup STM32H735G_DK_BUS_Exported_Constants Exported Constants
00063   * @{
00064   */
00065 /* Definition for I2C4 clock resources */
00066 #define BUS_I2C4                               I2C4
00067 #define BUS_I2C4_CLK_ENABLE()                  __HAL_RCC_I2C4_CLK_ENABLE()
00068 #define BUS_I2C4_CLK_DISABLE()                 __HAL_RCC_I2C4_CLK_DISABLE()
00069 #define BUS_I2C4_SCL_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00070 #define BUS_I2C4_SCL_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOF_CLK_DISABLE()
00071 #define BUS_I2C4_SDA_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00072 #define BUS_I2C4_SDA_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOF_CLK_DISABLE()
00073
00074 #define BUS_I2C4_FORCE_RESET()                 __HAL_RCC_I2C4_FORCE_RESET()
00075 #define BUS_I2C4_RELEASE_RESET()               __HAL_RCC_I2C4_RELEASE_RESET()
00076
00077 /* Definition for I2C4 Pins */
00078 #define BUS_I2C4_SCL_PIN                       GPIO_PIN_14
00079 #define BUS_I2C4_SDA_PIN                       GPIO_PIN_15
00080 #define BUS_I2C4_SCL_GPIO_PORT                 GPIOF
00081 #define BUS_I2C4_SDA_GPIO_PORT                 GPIOF
00082 #define BUS_I2C4_SCL_AF                        GPIO_AF4_I2C4
00083 #define BUS_I2C4_SDA_AF                        GPIO_AF4_I2C4
00084
00085 #ifndef BUS_I2C4_FREQUENCY
00086    #define BUS_I2C4_FREQUENCY                  100000U /* Frequency of I2Cn = 100 KHz*/
00087 #endif
00088
00089 /**
00090   * @}
00091   */
00092
00093 /** @addtogroup STM32H735G_DK_BUS_Private_Variables
00094   * @{
00095   */
00096 extern I2C_HandleTypeDef hbus_i2c4;
00097 /**
00098   * @}
00099   */
00100
00101 /** @defgroup STM32H735G_DK_BUS_Exported_FunctionsPrototypes Exported Functions Prototypes
00102   * @{
00103   */
00104 int32_t BSP_I2C4_Init(void);
00105 int32_t BSP_I2C4_DeInit(void);
00106 int32_t BSP_I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
00107 int32_t BSP_I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
00108 int32_t BSP_I2C4_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
00109 int32_t BSP_I2C4_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
00110 int32_t BSP_I2C4_Recv(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
00111 int32_t BSP_I2C4_Send(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
00112 int32_t BSP_I2C4_IsReady(uint16_t DevAddr, uint32_t Trials);
00113 int32_t BSP_GetTick(void);
00114 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
00115 int32_t BSP_I2C4_RegisterDefaultMspCallbacks (void);
00116 int32_t BSP_I2C4_RegisterMspCallbacks (BSP_I2C_Cb_t *Callback);
00117 #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
00118 HAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *phi2c, uint32_t timing);
00119 /**
00120   * @}
00121   */
00122
00123 /**
00124   * @}
00125   */
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135 #ifdef __cplusplus
00136 }
00137 #endif
00138
00139 #endif /* STM32H735G_DK_BUS_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_conf_template.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_conf_template.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_conf.h
00004   * @author  MCD Application Team
00005   * @brief   STM32H735G_DISCO board configuration file.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * Copyright (c) 2019 STMicroelectronics.
00010   * All rights reserved.
00011   *
00012   * This software is licensed under terms that can be found in the LICENSE file
00013   * in the root directory of this software component.
00014   * If no LICENSE file comes with this software, it is provided AS-IS.
00015   *
00016   ******************************************************************************
00017   */
00018
00019 /* Define to prevent recursive inclusion -------------------------------------*/
00020 #ifndef STM32H735G_DK_CONF_H
00021 #define STM32H735G_DK_CONF_H
00022
00023 #ifdef __cplusplus
00024  extern "C" {
00025 #endif
00026
00027 /* Includes ------------------------------------------------------------------*/
00028 #include "stm32h7xx_hal.h"
00029
00030 /* COM define */
00031 #define USE_COM_LOG                         0U
00032 #define USE_BSP_COM_FEATURE                 0U
00033
00034 /* I2C BUS timing define */
00035 #define I2C_VALID_TIMING_NBR                128U
00036
00037 /* Audio codecs defines */
00038 #define USE_AUDIO_CODEC_WM8994              1U
00039 #define USE_BSP_PDM_LIB_FEATURE             1U
00040
00041 /* Default Audio IN internal buffer size */
00042 #define DEFAULT_AUDIO_IN_BUFFER_SIZE        2048U
00043 #define USE_BSP_CPU_CACHE_MAINTENANCE       1U
00044
00045 /* LCD defines */
00046 #define LCD_LAYER_0_ADDRESS                 0x70000000U
00047 #define LCD_LAYER_1_ADDRESS                 0x70200000U
00048 #define USE_DMA2D_TO_FILL_RGB_RECT          0U
00049 #define USE_LCD_CTRL_RK043FN48H             1U
00050
00051 /* TS defines */
00052 #define USE_TS_GESTURE                      1U
00053 #define USE_TS_MULTI_TOUCH                  1U
00054 #define TS_TOUCH_NBR                        2U
00055
00056 /* OSPI RAM interrupt priority */
00057 #define BSP_OSPI_RAM_IT_PRIORITY            0x07UL
00058 #define BSP_OSPI_RAM_DMA_IT_PRIORITY        0x07UL
00059
00060 /* IRQ priorities */
00061 #define BSP_BUTTON_USER_IT_PRIORITY         15U
00062 #define BSP_AUDIO_OUT_IT_PRIORITY           14U
00063 #define BSP_AUDIO_IN_IT_PRIORITY            15U
00064 #define BSP_SD_IT_PRIORITY                  14U
00065 #define BSP_SD_RX_IT_PRIORITY               14U
00066 #define BSP_SD_TX_IT_PRIORITY               15U
00067 #define BSP_TS_IT_PRIORITY                  15U
00068
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072
00073 #endif /* STM32H735G_DK_CONF_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_errno.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_errno.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_errno.h
00004   * @author  MCD Application Team
00005   * @brief   Error Code.
00006   *
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DISCO_ERRNO_H
00022 #define STM32H735G_DISCO_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 /* BSP OSPI error codes */
00043 #define BSP_ERROR_OSPI_SUSPENDED          -20
00044 #define BSP_ERROR_OSPI_ASSIGN_FAILURE     -24
00045 #define BSP_ERROR_OSPI_SETUP_FAILURE      -25
00046 #define BSP_ERROR_OSPI_MMP_LOCK_FAILURE   -26
00047 #define BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE -27
00048
00049 /* BSP TS error code */
00050 #define BSP_ERROR_TS_TOUCH_NOT_DETECTED   -30
00051
00052 /* BSP BUS error codes */
00053 #define BSP_ERROR_BUS_TRANSACTION_FAILURE    -100
00054 #define BSP_ERROR_BUS_ARBITRATION_LOSS       -101
00055 #define BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE    -102
00056 #define BSP_ERROR_BUS_PROTOCOL_FAILURE       -103
00057
00058 #define BSP_ERROR_BUS_MODE_FAULT             -104
00059 #define BSP_ERROR_BUS_FRAME_ERROR            -105
00060 #define BSP_ERROR_BUS_CRC_ERROR              -106
00061 #define BSP_ERROR_BUS_DMA_FAILURE            -107
00062
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066
00067 #endif /* STM32H735G_DISCO_ERRNO_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_lcd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_lcd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_lcd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00006   *          mounted on STM32H735G_DISCO board.
00007   ******************************************************************************
00008   @verbatim
00009   How To use this driver:
00010   --------------------------
00011    - This driver is used to drive directly a LCD TFT using the LTDC controller.
00012    - This driver uses the adequate timing and setting for the RK043FN48H LCD component
00013
00014   Driver description:
00015   ---------------------
00016    + Initialization steps:
00017      o Initialize the LCD in default mode using the BSP_LCD_Init() function with the
00018        following settings:
00019         - Pixelformat : LCD_PIXEL_FORMAT_RGB888
00020         - Orientation : LCD_ORIENTATION_LANDSCAPE.
00021         - Width       : LCD_DEFAULT_WIDTH (480)
00022         - Height      : LCD_DEFAULT_HEIGHT(272)
00023        The default LTDC layer configured is layer 0.
00024        BSP_LCD_Init() includes LTDC, LTDC Layer and clock configurations by calling:
00025         - MX_LTDC_ClockConfig()
00026         - MX_LTDC_Init()
00027         - MX_LTDC_ConfigLayer()
00028
00029      o Initialize the LCD with required parameters using the BSP_LCD_InitEx() function.
00030
00031      o Select the LCD layer to be activated using the BSP_LCD_SetActiveLayer() function.
00032      o Enable the LCD display using the BSP_LCD_DisplayOn() function.
00033      o Disable the LCD display using the BSP_LCD_DisplayOff() function.
00034      o Set the display brightness using the BSP_LCD_SetBrightness() function.
00035      o Get the display brightness using the BSP_LCD_GetBrightness() function.
00036      o Write a pixel to the LCD memory using the BSP_LCD_WritePixel() function.
00037      o Read a pixel from the LCD memory using the BSP_LCD_ReadPixel() function.
00038      o Draw an horizontal line using the BSP_LCD_DrawHLine() function.
00039      o Draw a vertical line using the BSP_LCD_DrawVLine() function.
00040      o Draw a bitmap image using the BSP_LCD_DrawBitmap() function.
00041
00042    + Options
00043      o Configure the LTDC reload mode by calling BSP_LCD_Relaod(). By default, the
00044        reload mode is set to BSP_LCD_RELOAD_IMMEDIATE then LTDC is reloaded immediately.
00045        To control the reload mode:
00046          - Call BSP_LCD_Relaod() with ReloadType parameter set to BSP_LCD_RELOAD_NONE
00047          - Configure LTDC (color keying, transparency ..)
00048          - Call BSP_LCD_Relaod() with ReloadType parameter set to BSP_LCD_RELOAD_IMMEDIATE
00049            for immediate reload or BSP_LCD_RELOAD_VERTICAL_BLANKING for LTDC reload
00050            in the next vertical blanking
00051      o Configure LTDC layers using BSP_LCD_ConfigLayer()
00052      o Control layer visibility using BSP_LCD_SetLayerVisible()
00053      o Configure and enable the color keying functionality using the
00054        BSP_LCD_SetColorKeying() function.
00055      o Disable the color keying functionality using the BSP_LCD_ResetColorKeying() function.
00056      o Modify on the fly the transparency and/or the frame buffer address
00057        using the following functions:
00058        - BSP_LCD_SetTransparency()
00059        - BSP_LCD_SetLayerAddress()
00060
00061    + Display on LCD
00062      o To draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00063        on LCD and display text, utility basic_gui.c/.h must be called. Once the LCD is initialized,
00064        user should call GUI_SetFuncDriver() API to link board LCD drivers to BASIC GUI LCD drivers.
00065        The basic gui services, defined in basic_gui utility, are ready for use.
00066
00067   Note:
00068   --------
00069     Regarding the "Instance" parameter, needed for all functions, it is used to select
00070     an LCD instance. On the STM32F769I_EVAL board, there's one instance. Then, this
00071     parameter should be 0.
00072
00073   @endverbatim
00074   ******************************************************************************
00075   * @attention
00076   *
00077   * Copyright (c) 2019 STMicroelectronics.
00078   * All rights reserved.
00079   *
00080   * This software is licensed under terms that can be found in the LICENSE file
00081   * in the root directory of this software component.
00082   * If no LICENSE file comes with this software, it is provided AS-IS.
00083   *
00084   ******************************************************************************
00085   */
00086
00087 /* Includes ------------------------------------------------------------------*/
00088 #include "stm32h735g_discovery_lcd.h"
00089 #include "stm32h735g_discovery_bus.h"
00090 #include "stm32h735g_discovery_ts.h"
00091 #include "stm32h735g_discovery_ospi.h"
00092
00093 /** @addtogroup BSP
00094   * @{
00095   */
00096
00097 /** @addtogroup STM32H735G_DISCO
00098   * @{
00099   */
00100
00101 /** @defgroup STM32H735G_DISCO_LCD STM32H735G_DISCO LCD
00102   * @{
00103   */
00104
00105 /** @defgroup STM32H735G_DISCO_LCD_Private_Variables LCD Private Variables
00106   * @{
00107   */
00108 static uint32_t PixelFormatFactor;
00109 /**
00110   * @}
00111   */
00112
00113 /** @defgroup STM32H735G_DISCO_LCD_Private_TypesDefinitions LCD Private TypesDefinitions
00114   * @{
00115   */
00116 const LCD_UTILS_Drv_t LCD_Driver =
00117 {
00118   BSP_LCD_DrawBitmap,
00119   BSP_LCD_FillRGBRect,
00120   BSP_LCD_DrawHLine,
00121   BSP_LCD_DrawVLine,
00122   BSP_LCD_FillRect,
00123   BSP_LCD_ReadPixel,
00124   BSP_LCD_WritePixel,
00125   BSP_LCD_GetXSize,
00126   BSP_LCD_GetYSize,
00127   BSP_LCD_SetActiveLayer,
00128   BSP_LCD_GetPixelFormat
00129 };
00130
00131 /**
00132   * @}
00133   */
00134
00135 /** @defgroup STM32H735G_DISCO_LCD_Exported_Variables Exported Variables
00136   * @{
00137   */
00138 DMA2D_HandleTypeDef hlcd_dma2d;
00139 LTDC_HandleTypeDef  hlcd_ltdc;
00140 BSP_LCD_Ctx_t       Lcd_Ctx[LCD_INSTANCES_NBR];
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32H735G_DISCO_LCD_Private_FunctionPrototypes LCD Private FunctionPrototypes
00146   * @{
00147   */
00148
00149 static void LTDC_MspInit(LTDC_HandleTypeDef *hltdc);
00150 static void LTDC_MspDeInit(LTDC_HandleTypeDef *hltdc);
00151 static void DMA2D_MspInit(DMA2D_HandleTypeDef *hdma2d);
00152 static void DMA2D_MspDeInit(DMA2D_HandleTypeDef *hdma2d);
00153 static void LL_FillBuffer(uint32_t Instance, uint32_t LayerIndex, uint32_t *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t Color);
00154 static void LL_ConvertLineToRGB(uint32_t Instance, uint32_t *pSrc, uint32_t *pDst, uint32_t xSize, uint32_t ColorMode);
00155 /**
00156   * @}
00157   */
00158
00159 /** @defgroup STM32H735G_EVAL_LCD_Private_Macros  Private Macros
00160   * @{
00161   */
00162 #define CONVERTRGB5652ARGB8888(Color)(((((((Color >> 11) & 0x1FU) * 527) + 23) >> 6) << 16) |\
00163                                      ((((((Color >> 5) & 0x3FU) * 259) + 33) >> 6) << 8) |\
00164                                      ((((Color & 0x1FU) * 527) + 23) >> 6) | 0xFF000000)
00165 /**
00166   * @}
00167   */
00168
00169 /** @defgroup STM32H735G_DISCO_LCD_Exported_Functions LCD Exported Functions
00170   * @{
00171   */
00172 /**
00173   * @brief  Initializes the LCD in default mode.
00174   * @param  Instance    LCD Instance
00175   * @param  Orientation LCD_ORIENTATION_LANDSCAPE
00176   * @retval BSP status
00177   */
00178
00179 int32_t BSP_LCD_Init(uint32_t Instance, uint32_t Orientation)
00180 {
00181   return BSP_LCD_InitEx(Instance, Orientation, LCD_PIXEL_FORMAT_RGB888, LCD_DEFAULT_WIDTH, LCD_DEFAULT_HEIGHT);
00182 }
00183
00184 /**
00185   * @brief  Initializes the LCD.
00186   * @param  Instance    LCD Instance
00187   * @param  Orientation LCD_ORIENTATION_LANDSCAPE
00188   * @param  PixelFormat LCD_PIXEL_FORMAT_RGB565 or LCD_PIXEL_FORMAT_RGB888
00189   * @param  Width       Display width
00190   * @param  Height      Display height
00191   * @retval BSP status
00192   */
00193 int32_t BSP_LCD_InitEx(uint32_t Instance, uint32_t Orientation, uint32_t PixelFormat, uint32_t Width, uint32_t Height)
00194 {
00195   int32_t ret = BSP_ERROR_NONE;
00196   uint32_t ltdc_pixel_format;
00197   static uint32_t id;
00198   FT5336_Object_t ts_comp_obj;
00199   FT5336_IO_t io_comp_ctx;
00200   MX_LTDC_LayerConfig_t config;
00201   BSP_OSPI_RAM_Init_t ospi_init;
00202
00203   if((Orientation > LCD_ORIENTATION_LANDSCAPE) || (Instance >= LCD_INSTANCES_NBR))
00204   {
00205     ret = BSP_ERROR_WRONG_PARAM;
00206   }
00207   else
00208   {
00209     switch(PixelFormat)
00210     {
00211     case LCD_PIXEL_FORMAT_RGB565:
00212       ltdc_pixel_format = LTDC_PIXEL_FORMAT_RGB565;
00213       PixelFormatFactor = 2U;
00214       break;
00215     case LCD_PIXEL_FORMAT_RGB888:
00216     default:
00217       ltdc_pixel_format = LTDC_PIXEL_FORMAT_ARGB8888;
00218       PixelFormatFactor = 4U;
00219       break;
00220     }
00221
00222     /* Store pixel format, xsize and ysize information */
00223     Lcd_Ctx[Instance].PixelFormat = PixelFormat;
00224     Lcd_Ctx[Instance].XSize  = Width;
00225     Lcd_Ctx[Instance].YSize  = Height;
00226
00227     /* Initializes peripherals instance value */
00228     hlcd_ltdc.Instance = LTDC;
00229     hlcd_dma2d.Instance = DMA2D;
00230
00231     /* MSP initialization */
00232 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
00233     /* Register the LTDC MSP Callbacks */
00234     if(Lcd_Ctx[Instance].IsMspCallbacksValid == 0U)
00235     {
00236       if(BSP_LCD_RegisterDefaultMspCallbacks(0) != BSP_ERROR_NONE)
00237       {
00238         return BSP_ERROR_PERIPH_FAILURE;
00239       }
00240     }
00241 #else
00242     LTDC_MspInit(&hlcd_ltdc);
00243 #endif
00244     /* De-assert display enable LCD_DISP_EN pin */
00245     HAL_GPIO_WritePin(LCD_DISP_EN_GPIO_PORT, LCD_DISP_EN_PIN, GPIO_PIN_RESET);
00246
00247     /* Assert display enable LCD_DISP_CTRL pin */
00248     HAL_GPIO_WritePin(LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, GPIO_PIN_SET);
00249
00250     /* Assert backlight LCD_BL_CTRL pin */
00251     HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);
00252
00253     DMA2D_MspInit(&hlcd_dma2d);
00254
00255     io_comp_ctx.Init    = BSP_I2C4_Init;
00256     io_comp_ctx.ReadReg = BSP_I2C4_ReadReg;
00257     io_comp_ctx.Address = TS_I2C_ADDRESS;
00258     if(FT5336_RegisterBusIO(&ts_comp_obj, &io_comp_ctx) < 0)
00259     {
00260       ret = BSP_ERROR_UNKNOWN_COMPONENT;
00261     }
00262     else if(FT5336_ReadID(&ts_comp_obj, &id) < 0)
00263     {
00264       ret = BSP_ERROR_UNKNOWN_COMPONENT;
00265     }
00266     else if(id != FT5336_ID)
00267     {
00268       ret = BSP_ERROR_UNKNOWN_COMPONENT;
00269     }
00270     else if(MX_LTDC_ClockConfig(&hlcd_ltdc) != HAL_OK)
00271     {
00272       ret = BSP_ERROR_PERIPH_FAILURE;
00273     }
00274     else
00275     {
00276       if(MX_LTDC_Init(&hlcd_ltdc, Width, Height) != HAL_OK)
00277       {
00278         ret = BSP_ERROR_PERIPH_FAILURE;
00279       }
00280     }
00281
00282     if(ret == BSP_ERROR_NONE)
00283     {
00284       /* Before configuring LTDC layer, ensure OSPI is initialized */
00285       ospi_init.LatencyType = BSP_OSPI_RAM_FIXED_LATENCY;
00286       ospi_init.BurstType   = BSP_OSPI_RAM_LINEAR_BURST;
00287       ospi_init.BurstLength = BSP_OSPI_RAM_BURST_32_BYTES;
00288       if(BSP_OSPI_RAM_Init(0, &ospi_init) != BSP_ERROR_NONE)
00289       {
00290         ret = BSP_ERROR_NO_INIT;
00291       }
00292       else if(BSP_OSPI_RAM_EnableMemoryMappedMode(0) != BSP_ERROR_NONE)
00293       {
00294         ret = BSP_ERROR_PERIPH_FAILURE;
00295       }
00296       else
00297       {
00298         /* Configure default LTDC Layer 0. This configuration can be override by calling
00299         BSP_LCD_ConfigLayer() at application level */
00300         config.X0          = 0;
00301         config.X1          = Width;
00302         config.Y0          = 0;
00303         config.Y1          = Height;
00304         config.PixelFormat = ltdc_pixel_format;
00305         config.Address     = LCD_LAYER_0_ADDRESS;
00306         if(MX_LTDC_ConfigLayer(&hlcd_ltdc, 0, &config) != HAL_OK)
00307         {
00308           ret = BSP_ERROR_PERIPH_FAILURE;
00309         }
00310         /* By default the reload is activated and executed immediately */
00311         Lcd_Ctx[Instance].ReloadEnable = 1U;
00312       }
00313     }
00314    }
00315
00316   return ret;
00317 }
00318
00319 /**
00320   * @brief  De-Initializes the LCD resources.
00321   * @param  Instance    LCD Instance
00322   * @retval BSP status
00323   */
00324 int32_t BSP_LCD_DeInit(uint32_t Instance)
00325 {
00326   int32_t ret = BSP_ERROR_NONE;
00327
00328   if(Instance >= LCD_INSTANCES_NBR)
00329   {
00330     ret = BSP_ERROR_WRONG_PARAM;
00331   }
00332   else
00333   {
00334     /* Assert display enable LCD_DISP pin */
00335     HAL_GPIO_WritePin(LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, GPIO_PIN_RESET);
00336
00337     /* Assert backlight LCD_BL_CTRL pin */
00338     HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_RESET);
00339 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 0)
00340     LTDC_MspDeInit(&hlcd_ltdc);
00341 #endif /* (USE_HAL_LTDC_REGISTER_CALLBACKS == 0) */
00342
00343     DMA2D_MspDeInit(&hlcd_dma2d);
00344
00345     (void)HAL_LTDC_DeInit(&hlcd_ltdc);
00346     if(HAL_DMA2D_DeInit(&hlcd_dma2d) != HAL_OK)
00347     {
00348       ret = BSP_ERROR_PERIPH_FAILURE;
00349     }
00350     else
00351     {
00352       Lcd_Ctx[Instance].IsMspCallbacksValid = 0;
00353     }
00354   }
00355
00356   return ret;
00357 }
00358
00359
00360 /**
00361   * @brief  Initializes the LTDC.
00362   * @param  hltdc  LTDC handle
00363   * @param  Width  LTDC width
00364   * @param  Height LTDC height
00365   * @retval HAL status
00366   */
00367 __weak HAL_StatusTypeDef MX_LTDC_Init(LTDC_HandleTypeDef *hltdc, uint32_t Width, uint32_t Height)
00368 {
00369   hltdc->Instance = LTDC;
00370   hltdc->Init.HSPolarity = LTDC_HSPOLARITY_AL;
00371   hltdc->Init.VSPolarity = LTDC_VSPOLARITY_AL;
00372   hltdc->Init.DEPolarity = LTDC_DEPOLARITY_AL;
00373   hltdc->Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00374
00375   hltdc->Init.HorizontalSync     = RK043FN48H_HSYNC - 1;
00376   hltdc->Init.AccumulatedHBP     = (RK043FN48H_HSYNC + (RK043FN48H_HBP-11) - 1);
00377   hltdc->Init.AccumulatedActiveW = RK043FN48H_HSYNC + Width + RK043FN48H_HBP - 1;
00378   hltdc->Init.TotalWidth         = RK043FN48H_HSYNC + Width + (RK043FN48H_HBP-11) + RK043FN48H_HFP - 1;
00379   hltdc->Init.VerticalSync       = RK043FN48H_VSYNC - 1;
00380   hltdc->Init.AccumulatedVBP     = RK043FN48H_VSYNC + RK043FN48H_VBP - 1;
00381   hltdc->Init.AccumulatedActiveH = RK043FN48H_VSYNC + Height + RK043FN48H_VBP - 1;
00382   hltdc->Init.TotalHeigh         = RK043FN48H_VSYNC + Height + RK043FN48H_VBP + RK043FN48H_VFP - 1;
00383
00384   hltdc->Init.Backcolor.Blue  = 0xFF;
00385   hltdc->Init.Backcolor.Green = 0xFF;
00386   hltdc->Init.Backcolor.Red   = 0xFF;
00387
00388   return HAL_LTDC_Init(hltdc);
00389 }
00390
00391 /**
00392   * @brief  MX LTDC layer configuration.
00393   * @param  hltdc      LTDC handle
00394   * @param  LayerIndex Layer 0 or 1
00395   * @param  Config     Layer configuration
00396   * @retval HAL status
00397   */
00398 __weak HAL_StatusTypeDef MX_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, uint32_t LayerIndex, MX_LTDC_LayerConfig_t *Config)
00399 {
00400   LTDC_LayerCfgTypeDef pLayerCfg;
00401
00402   pLayerCfg.WindowX0 = Config->X0;
00403   pLayerCfg.WindowX1 = Config->X1;
00404   pLayerCfg.WindowY0 = Config->Y0;
00405   pLayerCfg.WindowY1 = Config->Y1;
00406   pLayerCfg.PixelFormat = Config->PixelFormat;
00407   pLayerCfg.Alpha = 255;
00408   pLayerCfg.Alpha0 = 0;
00409   pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00410   pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00411   pLayerCfg.FBStartAdress = Config->Address;
00412   pLayerCfg.ImageWidth = (Config->X1 - Config->X0);
00413   pLayerCfg.ImageHeight = (Config->Y1 - Config->Y0);
00414   pLayerCfg.Backcolor.Blue = 0;
00415   pLayerCfg.Backcolor.Green = 0;
00416   pLayerCfg.Backcolor.Red = 0;
00417   return HAL_LTDC_ConfigLayer(hltdc, &pLayerCfg, LayerIndex);
00418 }
00419
00420 /**
00421   * @brief  LTDC Clock Config for LCD DPI display.
00422   * @param  hltdc  LTDC Handle
00423   *         Being __weak it can be overwritten by the application
00424   * @retval HAL_status
00425   */
00426 __weak HAL_StatusTypeDef MX_LTDC_ClockConfig(LTDC_HandleTypeDef *hltdc)
00427 {
00428   RCC_PeriphCLKInitTypeDef  PeriphClkInitStruct;
00429
00430   /* RK043FN48H LCD clock configuration */
00431   /* LCD clock configuration */
00432   /* PLL3_VCO Input = HSE_VALUE/PLL3M = 5 Mhz */
00433   /* PLL3_VCO Output = PLL3_VCO Input * PLL3N = 800 Mhz */
00434   /* PLLLCDCLK = PLL3_VCO Output/PLL3R = 800/83 = 9.63 Mhz */
00435   /* LTDC clock frequency = PLLLCDCLK = 9.63 Mhz */
00436   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
00437   PeriphClkInitStruct.PLL3.PLL3M = 5;
00438   PeriphClkInitStruct.PLL3.PLL3N = 160;
00439   PeriphClkInitStruct.PLL3.PLL3P = 2;
00440   PeriphClkInitStruct.PLL3.PLL3Q = 2;
00441   PeriphClkInitStruct.PLL3.PLL3R = 83;
00442   PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
00443   PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL1VCOWIDE;
00444   PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL1VCIRANGE_0;
00445
00446
00447   return HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
00448 }
00449
00450 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
00451 /**
00452   * @brief Default BSP LCD Msp Callbacks
00453   * @param Instance BSP LCD Instance
00454   * @retval BSP status
00455   */
00456 int32_t BSP_LCD_RegisterDefaultMspCallbacks (uint32_t Instance)
00457 {
00458   int32_t ret = BSP_ERROR_NONE;
00459
00460   if(Instance >= LCD_INSTANCES_NBR)
00461   {
00462     ret = BSP_ERROR_WRONG_PARAM;
00463   }
00464   else
00465   {
00466     if(HAL_LTDC_RegisterCallback(&hlcd_ltdc, HAL_LTDC_MSPINIT_CB_ID, LTDC_MspInit) != HAL_OK)
00467     {
00468       ret = BSP_ERROR_PERIPH_FAILURE;
00469     }
00470     else
00471     {
00472       if(HAL_LTDC_RegisterCallback(&hlcd_ltdc, HAL_LTDC_MSPDEINIT_CB_ID, LTDC_MspDeInit) != HAL_OK)
00473       {
00474         ret = BSP_ERROR_PERIPH_FAILURE;
00475       }
00476     }
00477
00478     Lcd_Ctx[Instance].IsMspCallbacksValid = 1;
00479   }
00480
00481   return ret;
00482 }
00483
00484 /**
00485   * @brief BSP LCD Msp Callback registering
00486   * @param Instance    LCD Instance
00487   * @param CallBacks   pointer to LCD MspInit/MspDeInit functions
00488   * @retval BSP status
00489   */
00490 int32_t BSP_LCD_RegisterMspCallbacks (uint32_t Instance, BSP_LCD_Cb_t *CallBacks)
00491 {
00492   int32_t ret = BSP_ERROR_NONE;
00493
00494   if(Instance >= LCD_INSTANCES_NBR)
00495   {
00496     ret = BSP_ERROR_WRONG_PARAM;
00497   }
00498   else
00499   {
00500     if(HAL_LTDC_RegisterCallback(&hlcd_ltdc, HAL_LTDC_MSPINIT_CB_ID, CallBacks->pMspLtdcInitCb) != HAL_OK)
00501     {
00502       ret = BSP_ERROR_PERIPH_FAILURE;
00503     }
00504     else
00505     {
00506       if(HAL_LTDC_RegisterCallback(&hlcd_ltdc, HAL_LTDC_MSPDEINIT_CB_ID, CallBacks->pMspLtdcDeInitCb) != HAL_OK)
00507       {
00508         ret = BSP_ERROR_PERIPH_FAILURE;
00509       }
00510     }
00511
00512     Lcd_Ctx[Instance].IsMspCallbacksValid = 1;
00513   }
00514
00515   return ret;
00516 }
00517 #endif /*(USE_HAL_LTDC_REGISTER_CALLBACKS == 1) */
00518
00519 /**
00520   * @brief  LTDC layer configuration.
00521   * @param  Instance   LCD instance
00522   * @param  LayerIndex Layer 0 or 1
00523   * @param  Config     Layer configuration
00524   * @retval HAL status
00525   */
00526 int32_t BSP_LCD_ConfigLayer(uint32_t Instance, uint32_t LayerIndex, BSP_LCD_LayerConfig_t *Config)
00527 {
00528   int32_t ret = BSP_ERROR_NONE;
00529   if(Instance >= LCD_INSTANCES_NBR)
00530   {
00531     ret = BSP_ERROR_WRONG_PARAM;
00532   }
00533   else
00534   {
00535     if (MX_LTDC_ConfigLayer(&hlcd_ltdc, LayerIndex, Config) != HAL_OK)
00536     {
00537       ret = BSP_ERROR_PERIPH_FAILURE;
00538     }
00539   }
00540   return ret;
00541 }
00542
00543 /**
00544   * @brief  Gets the LCD Active LCD Pixel Format.
00545   * @param  Instance    LCD Instance
00546   * @param  PixelFormat Active LCD Pixel Format
00547   * @retval BSP status
00548   */
00549 int32_t BSP_LCD_GetPixelFormat(uint32_t Instance, uint32_t *PixelFormat)
00550 {
00551   int32_t ret = BSP_ERROR_NONE;
00552
00553   if(Instance >= LCD_INSTANCES_NBR)
00554   {
00555     ret = BSP_ERROR_WRONG_PARAM;
00556   }
00557   else
00558   {
00559     /* Only RGB565 format is supported */
00560     *PixelFormat = Lcd_Ctx[Instance].PixelFormat;
00561   }
00562
00563   return ret;
00564 }
00565
00566 /**
00567   * @brief  Set the LCD Active Layer.
00568   * @param  Instance    LCD Instance
00569   * @param  LayerIndex  LCD layer index
00570   * @retval BSP status
00571   */
00572 int32_t BSP_LCD_SetActiveLayer(uint32_t Instance, uint32_t LayerIndex)
00573 {
00574   int32_t ret = BSP_ERROR_NONE;
00575
00576   if(Instance >= LCD_INSTANCES_NBR)
00577   {
00578     ret = BSP_ERROR_WRONG_PARAM;
00579   }
00580   else
00581   {
00582     Lcd_Ctx[Instance].ActiveLayer = LayerIndex;
00583   }
00584
00585   return ret;
00586 }
00587
00588 /**
00589   * @brief  Control the LTDC reload
00590   * @param  Instance    LCD Instance
00591   * @param  ReloadType can be one of the following values
00592   *         - BSP_LCD_RELOAD_NONE
00593   *         - BSP_LCD_RELOAD_IMMEDIATE
00594   *         - BSP_LCD_RELOAD_VERTICAL_BLANKING
00595   * @retval BSP status
00596   */
00597 int32_t BSP_LCD_Relaod(uint32_t Instance, uint32_t ReloadType)
00598 {
00599   int32_t ret = BSP_ERROR_NONE;
00600
00601   if(Instance >= LCD_INSTANCES_NBR)
00602   {
00603     ret = BSP_ERROR_WRONG_PARAM;
00604   }
00605   else if(ReloadType == BSP_LCD_RELOAD_NONE)
00606   {
00607     Lcd_Ctx[Instance].ReloadEnable = 0U;
00608   }
00609   else if(HAL_LTDC_Reload (&hlcd_ltdc, ReloadType) != HAL_OK)
00610   {
00611     ret = BSP_ERROR_PERIPH_FAILURE;
00612   }
00613   else
00614   {
00615     Lcd_Ctx[Instance].ReloadEnable = 1U;
00616   }
00617
00618   return ret;
00619 }
00620
00621 /**
00622   * @brief  Sets an LCD Layer visible
00623   * @param  Instance    LCD Instance
00624   * @param  LayerIndex  Visible Layer
00625   * @param  State  New state of the specified layer
00626   *          This parameter can be one of the following values:
00627   *            @arg  ENABLE
00628   *            @arg  DISABLE
00629   * @retval BSP status
00630   */
00631 int32_t BSP_LCD_SetLayerVisible(uint32_t Instance, uint32_t LayerIndex, FunctionalState State)
00632 {
00633   int32_t ret = BSP_ERROR_NONE;
00634
00635   if(Instance >= LCD_INSTANCES_NBR)
00636   {
00637     ret = BSP_ERROR_WRONG_PARAM;
00638   }
00639   else
00640   {
00641     if(State == ENABLE)
00642     {
00643       __HAL_LTDC_LAYER_ENABLE(&hlcd_ltdc, LayerIndex);
00644     }
00645     else
00646     {
00647       __HAL_LTDC_LAYER_DISABLE(&hlcd_ltdc, LayerIndex);
00648     }
00649
00650     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00651     {
00652       __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(&hlcd_ltdc);
00653     }
00654   }
00655
00656   return ret;
00657 }
00658
00659 /**
00660   * @brief  Configures the transparency.
00661   * @param  Instance      LCD Instance
00662   * @param  LayerIndex    Layer foreground or background.
00663   * @param  Transparency  Transparency
00664   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00665   * @retval BSP status
00666   */
00667 int32_t BSP_LCD_SetTransparency(uint32_t Instance, uint32_t LayerIndex, uint8_t Transparency)
00668 {
00669   int32_t ret = BSP_ERROR_NONE;
00670
00671   if(Instance >= LCD_INSTANCES_NBR)
00672   {
00673     ret = BSP_ERROR_WRONG_PARAM;
00674   }
00675   else
00676   {
00677     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00678     {
00679       (void)HAL_LTDC_SetAlpha(&hlcd_ltdc, Transparency, LayerIndex);
00680     }
00681     else
00682     {
00683       (void)HAL_LTDC_SetAlpha_NoReload(&hlcd_ltdc, Transparency, LayerIndex);
00684     }
00685   }
00686
00687   return ret;
00688 }
00689
00690 /**
00691   * @brief  Sets an LCD layer frame buffer address.
00692   * @param  Instance    LCD Instance
00693   * @param  LayerIndex  Layer foreground or background
00694   * @param  Address     New LCD frame buffer value
00695   * @retval BSP status
00696   */
00697 int32_t BSP_LCD_SetLayerAddress(uint32_t Instance, uint32_t LayerIndex, uint32_t Address)
00698 {
00699   int32_t ret = BSP_ERROR_NONE;
00700
00701   if(Instance >= LCD_INSTANCES_NBR)
00702   {
00703     ret = BSP_ERROR_WRONG_PARAM;
00704   }
00705   else
00706   {
00707     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00708     {
00709       (void)HAL_LTDC_SetAddress(&hlcd_ltdc, Address, LayerIndex);
00710     }
00711     else
00712     {
00713       (void)HAL_LTDC_SetAddress_NoReload(&hlcd_ltdc, Address, LayerIndex);
00714     }
00715   }
00716
00717   return ret;
00718 }
00719
00720 /**
00721   * @brief  Sets display window.
00722   * @param  Instance    LCD Instance
00723   * @param  LayerIndex  Layer index
00724   * @param  Xpos   LCD X position
00725   * @param  Ypos   LCD Y position
00726   * @param  Width  LCD window width
00727   * @param  Height LCD window height
00728   * @retval BSP status
00729   */
00730 int32_t BSP_LCD_SetLayerWindow(uint32_t Instance, uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00731 {
00732   int32_t ret = BSP_ERROR_NONE;
00733
00734   if(Instance >= LCD_INSTANCES_NBR)
00735   {
00736     ret = BSP_ERROR_WRONG_PARAM;
00737   }
00738   else
00739   {
00740     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00741     {
00742       /* Reconfigure the layer size  and position */
00743       (void)HAL_LTDC_SetWindowSize(&hlcd_ltdc, Width, Height, LayerIndex);
00744       (void)HAL_LTDC_SetWindowPosition(&hlcd_ltdc, Xpos, Ypos, LayerIndex);
00745     }
00746     else
00747     {
00748       /* Reconfigure the layer size and position */
00749       (void)HAL_LTDC_SetWindowSize_NoReload(&hlcd_ltdc, Width, Height, LayerIndex);
00750       (void)HAL_LTDC_SetWindowPosition_NoReload(&hlcd_ltdc, Xpos, Ypos, LayerIndex);
00751     }
00752
00753     Lcd_Ctx[Instance].XSize = Width;
00754     Lcd_Ctx[Instance].YSize = Height;
00755   }
00756
00757   return ret;
00758 }
00759
00760 /**
00761   * @brief  Configures and sets the color keying.
00762   * @param  Instance    LCD Instance
00763   * @param  LayerIndex  Layer foreground or background
00764   * @param  Color       Color reference
00765   * @retval BSP status
00766   */
00767 int32_t BSP_LCD_SetColorKeying(uint32_t Instance, uint32_t LayerIndex, uint32_t Color)
00768 {
00769   int32_t ret = BSP_ERROR_NONE;
00770
00771   if(Instance >= LCD_INSTANCES_NBR)
00772   {
00773     ret = BSP_ERROR_WRONG_PARAM;
00774   }
00775   else
00776   {
00777     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00778     {
00779       /* Configure and Enable the color Keying for LCD Layer */
00780       (void)HAL_LTDC_ConfigColorKeying(&hlcd_ltdc, Color, LayerIndex);
00781       (void)HAL_LTDC_EnableColorKeying(&hlcd_ltdc, LayerIndex);
00782     }
00783     else
00784     {
00785       /* Configure and Enable the color Keying for LCD Layer */
00786       (void)HAL_LTDC_ConfigColorKeying_NoReload(&hlcd_ltdc, Color, LayerIndex);
00787       (void)HAL_LTDC_EnableColorKeying_NoReload(&hlcd_ltdc, LayerIndex);
00788     }
00789   }
00790
00791   return ret;
00792 }
00793
00794 /**
00795   * @brief  Disables the color keying.
00796   * @param  Instance    LCD Instance
00797   * @param  LayerIndex Layer foreground or background
00798   * @retval BSP status
00799   */
00800 int32_t BSP_LCD_ResetColorKeying(uint32_t Instance, uint32_t LayerIndex)
00801 {
00802   int32_t ret = BSP_ERROR_NONE;
00803
00804   if(Instance >= LCD_INSTANCES_NBR)
00805   {
00806     ret = BSP_ERROR_WRONG_PARAM;
00807   }
00808   else
00809   {
00810     if(Lcd_Ctx[Instance].ReloadEnable == 1U)
00811     {
00812       /* Disable the color Keying for LCD Layer */
00813       (void)HAL_LTDC_DisableColorKeying(&hlcd_ltdc, LayerIndex);
00814     }
00815     else
00816     {
00817       /* Disable the color Keying for LCD Layer */
00818       (void)HAL_LTDC_DisableColorKeying_NoReload(&hlcd_ltdc, LayerIndex);
00819     }
00820   }
00821
00822   return ret;
00823 }
00824
00825 /**
00826   * @brief  Gets the LCD X size.
00827   * @param  Instance  LCD Instance
00828   * @param  XSize     LCD width
00829   * @retval BSP status
00830   */
00831 int32_t BSP_LCD_GetXSize(uint32_t Instance, uint32_t *XSize)
00832 {
00833   int32_t ret = BSP_ERROR_NONE;
00834
00835   if(Instance >= LCD_INSTANCES_NBR)
00836   {
00837     ret = BSP_ERROR_WRONG_PARAM;
00838   }
00839   else
00840   {
00841     *XSize = Lcd_Ctx[Instance].XSize;
00842   }
00843
00844   return ret;
00845 }
00846
00847 /**
00848   * @brief  Gets the LCD Y size.
00849   * @param  Instance  LCD Instance
00850   * @param  YSize     LCD Height
00851   * @retval BSP status
00852   */
00853 int32_t BSP_LCD_GetYSize(uint32_t Instance, uint32_t *YSize)
00854 {
00855   int32_t ret = BSP_ERROR_NONE;
00856
00857   if(Instance >= LCD_INSTANCES_NBR)
00858   {
00859     ret = BSP_ERROR_WRONG_PARAM;
00860   }
00861   else
00862   {
00863     *YSize = Lcd_Ctx[Instance].YSize;
00864   }
00865
00866   return ret;
00867 }
00868
00869 /**
00870   * @brief  Switch On the display.
00871   * @param  Instance    LCD Instance
00872   * @retval BSP status
00873   */
00874 int32_t BSP_LCD_DisplayOn(uint32_t Instance)
00875 {
00876   int32_t ret;
00877
00878   if(Instance >= LCD_INSTANCES_NBR)
00879   {
00880     ret = BSP_ERROR_WRONG_PARAM;
00881   }
00882   else
00883   {
00884     __HAL_LTDC_ENABLE(&hlcd_ltdc);
00885         /* Assert LCD_DISP_CTRL_EN pin */
00886     HAL_GPIO_WritePin(LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, GPIO_PIN_SET);
00887         /* Assert LCD_BL_CTRL pin */
00888     HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);
00889
00890     ret = BSP_ERROR_NONE;
00891   }
00892
00893   return ret;
00894 }
00895
00896 /**
00897   * @brief  Switch Off the display.
00898   * @param  Instance    LCD Instance
00899   * @retval BSP status
00900   */
00901 int32_t BSP_LCD_DisplayOff(uint32_t Instance)
00902 {
00903   int32_t ret;
00904
00905   if(Instance >= LCD_INSTANCES_NBR)
00906   {
00907     ret = BSP_ERROR_WRONG_PARAM;
00908   }
00909   else
00910   {
00911     __HAL_LTDC_DISABLE(&hlcd_ltdc);
00912         /* Assert LCD_DISP_CTRL_EN pin */
00913     HAL_GPIO_WritePin(LCD_DISP_CTRL_GPIO_PORT, LCD_DISP_CTRL_PIN, GPIO_PIN_RESET);
00914         /* Assert LCD_BL_CTRL pin */
00915     HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_RESET);
00916
00917     ret = BSP_ERROR_NONE;
00918   }
00919
00920   return ret;
00921 }
00922
00923 /**
00924   * @brief  Set the brightness value
00925   * @param  Instance    LCD Instance
00926   * @param  Brightness [00: Min (black), 100 Max]
00927   * @retval BSP status
00928   */
00929 int32_t BSP_LCD_SetBrightness(uint32_t Instance, uint32_t Brightness)
00930 {
00931   int32_t ret = BSP_ERROR_NONE;
00932
00933   if(Instance >= LCD_INSTANCES_NBR)
00934   {
00935     ret = BSP_ERROR_WRONG_PARAM;
00936   }
00937   else
00938   {
00939     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
00940   }
00941
00942   return ret;
00943 }
00944
00945 /**
00946   * @brief  Set the brightness value
00947   * @param  Instance    LCD Instance
00948   * @param  Brightness [00: Min (black), 100 Max]
00949   * @retval BSP status
00950   */
00951 int32_t BSP_LCD_GetBrightness(uint32_t Instance, uint32_t *Brightness)
00952 {
00953   int32_t ret = BSP_ERROR_NONE;
00954
00955   if(Instance >= LCD_INSTANCES_NBR)
00956   {
00957     ret = BSP_ERROR_WRONG_PARAM;
00958   }
00959   else
00960   {
00961     ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
00962   }
00963
00964   return ret;
00965 }
00966
00967 /**
00968   * @brief  Draws a bitmap picture loaded in the internal Flash in currently active layer.
00969   * @param  Instance LCD Instance
00970   * @param  Xpos Bmp X position in the LCD
00971   * @param  Ypos Bmp Y position in the LCD
00972   * @param  pbmp Pointer to Bmp picture address in the internal Flash.
00973   * @retval BSP status
00974   */
00975 int32_t BSP_LCD_DrawBitmap(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
00976 {
00977   int32_t ret = BSP_ERROR_NONE;
00978   uint32_t index, width, height, bit_pixel;
00979   uint32_t Address;
00980   uint32_t input_color_mode;
00981   uint8_t *pbmp;
00982
00983   /* Get bitmap data address offset */
00984   index = (uint32_t)pBmp[10] + ((uint32_t)pBmp[11] << 8) + ((uint32_t)pBmp[12] << 16)  + ((uint32_t)pBmp[13] << 24);
00985
00986   /* Read bitmap width */
00987   width = (uint32_t)pBmp[18] + ((uint32_t)pBmp[19] << 8) + ((uint32_t)pBmp[20] << 16)  + ((uint32_t)pBmp[21] << 24);
00988
00989   /* Read bitmap height */
00990   height = (uint32_t)pBmp[22] + ((uint32_t)pBmp[23] << 8) + ((uint32_t)pBmp[24] << 16)  + ((uint32_t)pBmp[25] << 24);
00991
00992   /* Read bit/pixel */
00993   bit_pixel = (uint32_t)pBmp[28] + ((uint32_t)pBmp[29] << 8);
00994
00995   /* Set the address */
00996   Address = hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (((Lcd_Ctx[Instance].XSize*Ypos) + Xpos)*PixelFormatFactor);
00997
00998   /* Get the layer pixel format */
00999   if ((bit_pixel/8U) == 4U)
01000   {
01001     input_color_mode = DMA2D_INPUT_ARGB8888;
01002   }
01003   else if ((bit_pixel/8U) == 2U)
01004   {
01005     input_color_mode = DMA2D_INPUT_RGB565;
01006   }
01007   else
01008   {
01009     input_color_mode = DMA2D_INPUT_RGB888;
01010   }
01011
01012   /* Bypass the bitmap header */
01013   pbmp = pBmp + (index + (width * (height - 1U) * (bit_pixel/8U)));
01014
01015   /* Convert picture to ARGB8888 pixel format */
01016   for(index=0; index < height; index++)
01017   {
01018     /* Pixel format conversion */
01019     LL_ConvertLineToRGB(Instance, (uint32_t *)pbmp, (uint32_t *)Address, width, input_color_mode);
01020
01021     /* Increment the source and destination buffers */
01022     Address+=  (Lcd_Ctx[Instance].XSize * PixelFormatFactor);
01023     pbmp -= width*(bit_pixel/8U);
01024   }
01025
01026   return ret;
01027 }
01028
01029 /**
01030   * @brief  Draw a horizontal line on LCD.
01031   * @param  Instance LCD Instance.
01032   * @param  Xpos X position.
01033   * @param  Ypos Y position.
01034   * @param  pData Pointer to RGB line data
01035   * @param  Width Rectangle width.
01036   * @param  Height Rectangle Height.
01037   * @retval BSP status.
01038   */
01039 int32_t BSP_LCD_FillRGBRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
01040 {
01041   uint32_t i;
01042
01043 #if (USE_DMA2D_TO_FILL_RGB_RECT == 1)
01044   uint32_t  Xaddress;
01045   for(i = 0; i < Height; i++)
01046   {
01047     /* Get the line address */
01048     Xaddress = hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (PixelFormatFactor*((Lcd_Ctx[Instance].XSize*(Ypos + i)) + Xpos));
01049
01050 #if (USE_BSP_CPU_CACHE_MAINTENANCE == 1)
01051     SCB_CleanDCache_by_Addr((uint32_t *)pdata, PixelFormatFactor*Lcd_Ctx[Instance].XSize);
01052 #endif /* USE_BSP_CPU_CACHE_MAINTENANCE */
01053
01054     /* Write line */
01055     if(Lcd_Ctx[Instance].PixelFormat == LCD_PIXEL_FORMAT_RGB565)
01056     {
01057       LL_ConvertLineToRGB(Instance, (uint32_t *)pData, (uint32_t *)Xaddress, Width, DMA2D_INPUT_RGB565);
01058     }
01059     else
01060     {
01061       LL_ConvertLineToRGB(Instance, (uint32_t *)pData, (uint32_t *)Xaddress, Width, DMA2D_INPUT_ARGB8888);
01062     }
01063     pData += PixelFormatFactor*Width;
01064   }
01065 #else
01066   uint32_t color, j;
01067   for(i = 0; i < Height; i++)
01068   {
01069     for(j = 0; j < Width; j++)
01070     {
01071       color = *pData | (*(pData + 1) << 8) | (*(pData + 2) << 16) | (*(pData + 3) << 24);
01072       BSP_LCD_WritePixel(Instance, Xpos + j, Ypos + i, color);
01073       pData += PixelFormatFactor;
01074     }
01075   }
01076 #endif
01077   return BSP_ERROR_NONE;
01078 }
01079
01080 /**
01081   * @brief  Draws an horizontal line in currently active layer.
01082   * @param  Instance   LCD Instance
01083   * @param  Xpos  X position
01084   * @param  Ypos  Y position
01085   * @param  Length  Line length
01086   */
01087 int32_t BSP_LCD_DrawHLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
01088 {
01089   uint32_t  Xaddress;
01090
01091   /* Get the line address */
01092   Xaddress = hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (PixelFormatFactor*((Lcd_Ctx[Instance].XSize*Ypos) + Xpos));
01093
01094   /* Write line */
01095   LL_FillBuffer(Instance, Lcd_Ctx[Instance].ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, Color);
01096
01097   return BSP_ERROR_NONE;
01098 }
01099
01100 /**
01101   * @brief  Draws a vertical line in currently active layer.
01102   * @param  Instance   LCD Instance
01103   * @param  Xpos  X position
01104   * @param  Ypos  Y position
01105   * @param  Length  Line length
01106   */
01107 int32_t BSP_LCD_DrawVLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
01108 {
01109   uint32_t  Xaddress;
01110
01111   /* Get the line address */
01112   Xaddress = (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress) + (PixelFormatFactor*(Lcd_Ctx[Instance].XSize*Ypos + Xpos));
01113
01114   /* Write line */
01115   LL_FillBuffer(Instance, Lcd_Ctx[Instance].ActiveLayer, (uint32_t *)Xaddress, 1, Length, (Lcd_Ctx[Instance].XSize - 1U), Color);
01116
01117   return BSP_ERROR_NONE;
01118 }
01119
01120 /**
01121   * @brief  Draws a full rectangle in currently active layer.
01122   * @param  Instance   LCD Instance
01123   * @param  Xpos X position
01124   * @param  Ypos Y position
01125   * @param  Width Rectangle width
01126   * @param  Height Rectangle height
01127   */
01128 int32_t BSP_LCD_FillRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
01129 {
01130   uint32_t  Xaddress;
01131
01132   /* Get the rectangle start address */
01133   Xaddress = (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress) + (PixelFormatFactor*(Lcd_Ctx[Instance].XSize*Ypos + Xpos));
01134
01135   /* Fill the rectangle */
01136   LL_FillBuffer(Instance, Lcd_Ctx[Instance].ActiveLayer, (uint32_t *)Xaddress, Width, Height, (Lcd_Ctx[Instance].XSize - Width), Color);
01137
01138   return BSP_ERROR_NONE;
01139 }
01140
01141 /**
01142   * @brief  Reads an LCD pixel.
01143   * @param  Instance    LCD Instance
01144   * @param  Xpos X position
01145   * @param  Ypos Y position
01146   * @param  Color RGB pixel color
01147   * @retval Value  pixel color
01148   */
01149 int32_t BSP_LCD_ReadPixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
01150 {
01151   if(hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
01152   {
01153     /* Read data value from SDRAM memory */
01154     *Color = *(__IO uint32_t*) (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (4U*(Ypos*Lcd_Ctx[Instance].XSize + Xpos)));
01155   }
01156   else /* if((hlcd_ltdc.LayerCfg[layer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) */
01157   {
01158     /* Read data value from SDRAM memory */
01159     *Color = *(__IO uint16_t*) (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (2U*(Ypos*Lcd_Ctx[Instance].XSize + Xpos)));
01160   }
01161
01162   return BSP_ERROR_NONE;
01163 }
01164
01165 /**
01166   * @brief  Draws a pixel on LCD.
01167   * @param  Instance    LCD Instance
01168   * @param  Xpos X position
01169   * @param  Ypos Y position
01170   * @param  Color Pixel color
01171   * @retval BSP status
01172   */
01173 int32_t BSP_LCD_WritePixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
01174 {
01175   if(hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
01176   {
01177     /* Write data value to SDRAM memory */
01178     *(__IO uint32_t*) (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (4U*(Ypos*Lcd_Ctx[Instance].XSize + Xpos))) = Color;
01179   }
01180   else
01181   {
01182     /* Write data value to SDRAM memory */
01183     *(__IO uint16_t*) (hlcd_ltdc.LayerCfg[Lcd_Ctx[Instance].ActiveLayer].FBStartAdress + (2U*(Ypos*Lcd_Ctx[Instance].XSize + Xpos))) = Color;
01184   }
01185
01186   return BSP_ERROR_NONE;
01187 }
01188
01189 /**
01190   * @}
01191   */
01192
01193 /** @defgroup STM32H735G_DISCO_LCD_Private_Functions LCD Private Functions
01194   * @{
01195   */
01196 /**
01197   * @brief  Fills a buffer.
01198   * @param  Instance LCD Instance
01199   * @param  LayerIndex Layer index
01200   * @param  pDst Pointer to destination buffer
01201   * @param  xSize Buffer width
01202   * @param  ySize Buffer height
01203   * @param  OffLine Offset
01204   * @param  Color Color index
01205   */
01206 static void LL_FillBuffer(uint32_t Instance, uint32_t LayerIndex, uint32_t *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t Color)
01207 {
01208   uint32_t output_color_mode, input_color = Color;
01209
01210   switch(Lcd_Ctx[Instance].PixelFormat)
01211   {
01212   case LCD_PIXEL_FORMAT_RGB565:
01213     output_color_mode = DMA2D_OUTPUT_RGB565; /* RGB565 */
01214     input_color = CONVERTRGB5652ARGB8888(Color);
01215     break;
01216   case LCD_PIXEL_FORMAT_RGB888:
01217   default:
01218     output_color_mode = DMA2D_OUTPUT_ARGB8888; /* ARGB8888 */
01219     break;
01220   }
01221
01222   /* Register to memory mode with ARGB8888 as color Mode */
01223   hlcd_dma2d.Init.Mode         = DMA2D_R2M;
01224   hlcd_dma2d.Init.ColorMode    = output_color_mode;
01225   hlcd_dma2d.Init.OutputOffset = OffLine;
01226
01227   hlcd_dma2d.Instance = DMA2D;
01228
01229   /* DMA2D Initialization */
01230   if(HAL_DMA2D_Init(&hlcd_dma2d) == HAL_OK)
01231   {
01232     if (HAL_DMA2D_Start(&hlcd_dma2d, input_color, (uint32_t)pDst, xSize, ySize) == HAL_OK)
01233     {
01234       /* Polling For DMA transfer */
01235       (void)HAL_DMA2D_PollForTransfer(&hlcd_dma2d, 50);
01236     }
01237   }
01238 }
01239
01240 /**
01241   * @brief  Converts a line to an RGB pixel format.
01242   * @param  Instance LCD Instance
01243   * @param  pSrc Pointer to source buffer
01244   * @param  pDst Output color
01245   * @param  xSize Buffer width
01246   * @param  ColorMode Input color mode
01247   */
01248 static void LL_ConvertLineToRGB(uint32_t Instance, uint32_t *pSrc, uint32_t *pDst, uint32_t xSize, uint32_t ColorMode)
01249 {
01250   uint32_t output_color_mode;
01251
01252   switch(Lcd_Ctx[Instance].PixelFormat)
01253   {
01254   case LCD_PIXEL_FORMAT_RGB565:
01255     output_color_mode = DMA2D_OUTPUT_RGB565; /* RGB565 */
01256     break;
01257   case LCD_PIXEL_FORMAT_RGB888:
01258   default:
01259     output_color_mode = DMA2D_OUTPUT_ARGB8888; /* ARGB8888 */
01260     break;
01261   }
01262
01263   /* Configure the DMA2D Mode, Color Mode and output offset */
01264   hlcd_dma2d.Init.Mode         = DMA2D_M2M_PFC;
01265   hlcd_dma2d.Init.ColorMode    = output_color_mode;
01266   hlcd_dma2d.Init.OutputOffset = 0;
01267
01268   /* Foreground Configuration */
01269   hlcd_dma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
01270   hlcd_dma2d.LayerCfg[1].InputAlpha = 0xFF;
01271   hlcd_dma2d.LayerCfg[1].InputColorMode = ColorMode;
01272   hlcd_dma2d.LayerCfg[1].InputOffset = 0;
01273
01274   hlcd_dma2d.Instance = DMA2D;
01275
01276   /* DMA2D Initialization */
01277   if(HAL_DMA2D_Init(&hlcd_dma2d) == HAL_OK)
01278   {
01279     if(HAL_DMA2D_ConfigLayer(&hlcd_dma2d, 1) == HAL_OK)
01280     {
01281       if (HAL_DMA2D_Start(&hlcd_dma2d, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1) == HAL_OK)
01282       {
01283         /* Polling For DMA transfer */
01284         (void)HAL_DMA2D_PollForTransfer(&hlcd_dma2d, 25);
01285       }
01286     }
01287   }
01288 }
01289
01290 /*******************************************************************************
01291                        BSP Routines:
01292                                            LTDC
01293                                            DMA2D
01294 *******************************************************************************/
01295 /**
01296   * @brief  Initialize the BSP LTDC Msp.
01297   * @param  hltdc  LTDC handle
01298   * @retval None
01299   */
01300 static void LTDC_MspInit(LTDC_HandleTypeDef *hltdc)
01301 {
01302   GPIO_InitTypeDef  gpio_init_structure;
01303
01304   if(hltdc->Instance == LTDC)
01305   {
01306     /* Enable the LTDC clock */
01307     __HAL_RCC_LTDC_CLK_ENABLE();
01308
01309     /* Enable GPIOs clock */
01310     __HAL_RCC_GPIOA_CLK_ENABLE();
01311     __HAL_RCC_GPIOB_CLK_ENABLE();
01312     __HAL_RCC_GPIOC_CLK_ENABLE();
01313     __HAL_RCC_GPIOD_CLK_ENABLE();
01314     __HAL_RCC_GPIOE_CLK_ENABLE();
01315     __HAL_RCC_GPIOG_CLK_ENABLE();
01316     __HAL_RCC_GPIOH_CLK_ENABLE();
01317
01318     gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01319     gpio_init_structure.Pull      = GPIO_NOPULL;
01320     gpio_init_structure.Speed     = GPIO_SPEED_FREQ_HIGH;
01321     gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01322
01323     gpio_init_structure.Pin       = GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_6;
01324     HAL_GPIO_Init(GPIOA, &gpio_init_structure);
01325
01326     gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9;
01327     HAL_GPIO_Init(GPIOB, &gpio_init_structure);
01328
01329     gpio_init_structure.Pin       = GPIO_PIN_6 | GPIO_PIN_7;
01330     HAL_GPIO_Init(GPIOC, &gpio_init_structure);
01331
01332     gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_3 | GPIO_PIN_6;
01333     HAL_GPIO_Init(GPIOD, &gpio_init_structure);
01334
01335     gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_15;
01336     HAL_GPIO_Init(GPIOE, &gpio_init_structure);
01337
01338     gpio_init_structure.Pin       = GPIO_PIN_7 | GPIO_PIN_14;
01339     HAL_GPIO_Init(GPIOG, &gpio_init_structure);
01340
01341     gpio_init_structure.Pin       = GPIO_PIN_3 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_15;
01342     HAL_GPIO_Init(GPIOH, &gpio_init_structure);
01343
01344     gpio_init_structure.Alternate = GPIO_AF13_LTDC;
01345     gpio_init_structure.Pin       = GPIO_PIN_8;
01346     HAL_GPIO_Init(GPIOA, &gpio_init_structure);
01347
01348     gpio_init_structure.Alternate = GPIO_AF9_LTDC;
01349     gpio_init_structure.Pin       = GPIO_PIN_4;
01350     HAL_GPIO_Init(GPIOH, &gpio_init_structure);
01351
01352     /** Toggle Sw reset of LTDC peripheral */
01353     __HAL_RCC_LTDC_FORCE_RESET();
01354     __HAL_RCC_LTDC_RELEASE_RESET();
01355
01356   }
01357
01358   LCD_DISP_CTRL_GPIO_CLK_ENABLE();
01359   LCD_BL_CTRL_GPIO_CLK_ENABLE();
01360   LCD_DISP_EN_GPIO_CLK_ENABLE();
01361
01362   /* LCD_DISP_EN GPIO configuration */
01363   gpio_init_structure.Pin       = LCD_DISP_EN_PIN;     /* LCD_DISP pin has to be manually controlled */
01364   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
01365   HAL_GPIO_Init(LCD_DISP_EN_GPIO_PORT, &gpio_init_structure);
01366
01367   /* LCD_DISP_CTRL GPIO configuration */
01368   gpio_init_structure.Pin       = LCD_DISP_CTRL_PIN;     /* LCD_DISP pin has to be manually controlled */
01369   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
01370   HAL_GPIO_Init(LCD_DISP_CTRL_GPIO_PORT, &gpio_init_structure);
01371
01372   /* LCD_BL_CTRL GPIO configuration */
01373   gpio_init_structure.Pin       = LCD_BL_CTRL_PIN;  /* LCD_BL_CTRL pin has to be manually controlled */
01374   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
01375   HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &gpio_init_structure);
01376
01377   HAL_Delay(40);
01378 }
01379
01380 /**
01381   * @brief  De-Initializes the BSP LTDC Msp
01382   * @param  hltdc  LTDC handle
01383   * @retval None
01384   */
01385 static void LTDC_MspDeInit(LTDC_HandleTypeDef *hltdc)
01386 {
01387   GPIO_InitTypeDef  gpio_init_structure;
01388
01389   if(hltdc->Instance == LTDC)
01390   {
01391     /* LTDC Pins deactivation */
01392     /* GPIOA deactivation */
01393     gpio_init_structure.Pin       =  GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_8;
01394     HAL_GPIO_DeInit(GPIOA, gpio_init_structure.Pin);
01395
01396     /* GPIOB deactivation */
01397     gpio_init_structure.Pin       =  GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9;
01398     HAL_GPIO_DeInit(GPIOB, gpio_init_structure.Pin);
01399
01400     /* GPIOC deactivation */
01401     gpio_init_structure.Pin       =  GPIO_PIN_6 | GPIO_PIN_7;
01402     HAL_GPIO_DeInit(GPIOC, gpio_init_structure.Pin);
01403
01404     /* GPIOD deactivation */
01405     gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_3 | GPIO_PIN_6;
01406     HAL_GPIO_DeInit(GPIOD, gpio_init_structure.Pin);
01407
01408     /* GPIOE deactivation */
01409     gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_15;
01410     HAL_GPIO_DeInit(GPIOE, gpio_init_structure.Pin);
01411
01412     /* GPIOG deactivation */
01413     gpio_init_structure.Pin       =  GPIO_PIN_7 | GPIO_PIN_14;
01414     HAL_GPIO_DeInit(GPIOG, gpio_init_structure.Pin);
01415
01416     /* GPIOH deactivation */
01417     gpio_init_structure.Pin       =  GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_15;
01418     HAL_GPIO_DeInit(GPIOH, gpio_init_structure.Pin);
01419
01420     /** Force and let in reset state LTDC */
01421     __HAL_RCC_LTDC_FORCE_RESET();
01422
01423     /** Disable the LTDC */
01424     __HAL_RCC_LTDC_CLK_DISABLE();
01425   }
01426 }
01427
01428 /**
01429   * @brief  Initialize the BSP DMA2D Msp.
01430   * @param  hdma2d  DMA2D handle
01431   * @retval None
01432   */
01433 static void DMA2D_MspInit(DMA2D_HandleTypeDef *hdma2d)
01434 {
01435   if(hdma2d->Instance == DMA2D)
01436   {
01437     /** Enable the DMA2D clock */
01438     __HAL_RCC_DMA2D_CLK_ENABLE();
01439
01440     /** Toggle Sw reset of DMA2D IP */
01441     __HAL_RCC_DMA2D_FORCE_RESET();
01442     __HAL_RCC_DMA2D_RELEASE_RESET();
01443   }
01444 }
01445
01446 /**
01447   * @brief  De-Initializes the BSP DMA2D Msp
01448   * @param  hdma2d  DMA2D handle
01449   * @retval None
01450   */
01451 static void DMA2D_MspDeInit(DMA2D_HandleTypeDef *hdma2d)
01452 {
01453   if(hdma2d->Instance == DMA2D)
01454   {
01455     /** Disable IRQ of DMA2D IP */
01456     HAL_NVIC_DisableIRQ(DMA2D_IRQn);
01457
01458     /** Force and let in reset state DMA2D */
01459     __HAL_RCC_DMA2D_FORCE_RESET();
01460
01461     /** Disable the DMA2D */
01462     __HAL_RCC_DMA2D_CLK_DISABLE();
01463   }
01464 }
01465
01466 /**
01467   * @}
01468   */
01469
01470 /**
01471   * @}
01472   */
01473
01474 /**
01475   * @}
01476   */
01477
01478 /**
01479   * @}
01480   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_lcd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h735g_discovery_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DISCO_LCD_H
00022 #define STM32H735G_DISCO_LCD_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h735g_discovery_conf.h"
00030 #include "stm32h735g_discovery_errno.h"
00031
00032 #include "lcd.h"
00033
00034
00035 #if (USE_LCD_CTRL_RK043FN48H == 1)
00036 /* Include RK043FN48H LCD Driver IC driver code */
00037 #include "../Components/rk043fn48h/rk043fn48h.h"
00038 #endif
00039
00040 /** @addtogroup BSP
00041   * @{
00042   */
00043
00044 /** @addtogroup STM32H735G_DISCO
00045   * @{
00046   */
00047
00048 /** @addtogroup STM32H735G_DISCO_LCD
00049   * @{
00050   */
00051
00052 /** @defgroup STM32H735G_DISCO_LCD_Exported_Constants Exported Constants
00053   * @{
00054   */
00055 #define LCD_INSTANCES_NBR          1U
00056
00057 #define LCD_ORIENTATION_LANDSCAPE        0x01U /* Landscape orientation choice of LCD screen              */
00058
00059 #define LCD_DEFAULT_WIDTH                480U
00060 #define LCD_DEFAULT_HEIGHT               272U
00061
00062 #define BSP_LCD_RELOAD_NONE              0U                            /* No reload executed       */
00063 #define BSP_LCD_RELOAD_IMMEDIATE         LTDC_RELOAD_IMMEDIATE         /* Immediate Reload         */
00064 #define BSP_LCD_RELOAD_VERTICAL_BLANKING LTDC_RELOAD_VERTICAL_BLANKING /* Vertical Blanking Reload */
00065 /**
00066   * @brief LCD special pins
00067   */
00068 /* LCD Display control pin */
00069 #define LCD_DISP_CTRL_PIN                     GPIO_PIN_10
00070 #define LCD_DISP_CTRL_PULL                    GPIO_NOPULL
00071 #define LCD_DISP_CTRL_GPIO_PORT               GPIOD
00072 #define LCD_DISP_CTRL_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOD_CLK_ENABLE()
00073 #define LCD_DISP_CTRL_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOD_CLK_DISABLE()
00074
00075 /* LCD Display enable pin */
00076 #define LCD_DISP_EN_PIN                      GPIO_PIN_13
00077 #define LCD_DISP_EN_PULL                     GPIO_NOPULL
00078 #define LCD_DISP_EN_GPIO_PORT                GPIOE
00079 #define LCD_DISP_EN_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOE_CLK_ENABLE()
00080 #define LCD_DISP_EN_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOE_CLK_DISABLE()
00081
00082 /* Back-light control pin */
00083 #define LCD_BL_CTRL_PIN                       GPIO_PIN_15
00084 #define LCD_BL_CTRL_GPIO_PORT                 GPIOG
00085 #define LCD_BL_CTRL_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00086 #define LCD_BL_CTRL_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOG_CLK_DISABLE()
00087
00088 /* RGB565 colors definitions */
00089 #define LCD_COLOR_RGB565_BLUE                 0x001FU
00090 #define LCD_COLOR_RGB565_GREEN                0x07E0U
00091 #define LCD_COLOR_RGB565_RED                  0xF800U
00092 #define LCD_COLOR_RGB565_CYAN                 0x07FFU
00093 #define LCD_COLOR_RGB565_MAGENTA              0xF81FU
00094 #define LCD_COLOR_RGB565_YELLOW               0xFFE0U
00095 #define LCD_COLOR_RGB565_LIGHTBLUE            0x841FU
00096 #define LCD_COLOR_RGB565_LIGHTGREEN           0x87F0U
00097 #define LCD_COLOR_RGB565_LIGHTRED             0xFC10U
00098 #define LCD_COLOR_RGB565_LIGHTCYAN            0x87FFU
00099 #define LCD_COLOR_RGB565_LIGHTMAGENTA         0xFC1FU
00100 #define LCD_COLOR_RGB565_LIGHTYELLOW          0xFFF0U
00101 #define LCD_COLOR_RGB565_DARKBLUE             0x0010U
00102 #define LCD_COLOR_RGB565_DARKGREEN            0x0400U
00103 #define LCD_COLOR_RGB565_DARKRED              0x8000U
00104 #define LCD_COLOR_RGB565_DARKCYAN             0x0410U
00105 #define LCD_COLOR_RGB565_DARKMAGENTA          0x8010U
00106 #define LCD_COLOR_RGB565_DARKYELLOW           0x8400U
00107 #define LCD_COLOR_RGB565_WHITE                0xFFFFU
00108 #define LCD_COLOR_RGB565_LIGHTGRAY            0xD69AU
00109 #define LCD_COLOR_RGB565_GRAY                 0x8410U
00110 #define LCD_COLOR_RGB565_DARKGRAY             0x4208U
00111 #define LCD_COLOR_RGB565_BLACK                0x0000U
00112 #define LCD_COLOR_RGB565_BROWN                0xA145U
00113 #define LCD_COLOR_RGB565_ORANGE               0xFD20U
00114 /* Definition of Official ST COLOR */
00115 #define LCD_COLOR_RGB565_ST_BLUE_DARK         0x0001U
00116 #define LCD_COLOR_RGB565_ST_BLUE              0x01EBU
00117 #define LCD_COLOR_RGB565_ST_BLUE_LIGHT        0x06A7U
00118 #define LCD_COLOR_RGB565_ST_GREEN_LIGHT       0x05ECU
00119 #define LCD_COLOR_RGB565_ST_GREEN_DARK        0x001CU
00120 #define LCD_COLOR_RGB565_ST_YELLOW            0x07F0U
00121 #define LCD_COLOR_RGB565_ST_BROWN             0x02C8U
00122 #define LCD_COLOR_RGB565_ST_PINK              0x0681U
00123 #define LCD_COLOR_RGB565_ST_PURPLE            0x02CDU
00124 #define LCD_COLOR_RGB565_ST_GRAY_DARK         0x0251U
00125 #define LCD_COLOR_RGB565_ST_GRAY              0x04BAU
00126 #define LCD_COLOR_RGB565_ST_GRAY_LIGHT        0x05E7U
00127
00128 /* ARGB8888 colors definitions */
00129 #define LCD_COLOR_ARGB8888_BLUE               0xFF0000FFUL
00130 #define LCD_COLOR_ARGB8888_GREEN              0xFF00FF00UL
00131 #define LCD_COLOR_ARGB8888_RED                0xFFFF0000UL
00132 #define LCD_COLOR_ARGB8888_CYAN               0xFF00FFFFUL
00133 #define LCD_COLOR_ARGB8888_MAGENTA            0xFFFF00FFUL
00134 #define LCD_COLOR_ARGB8888_YELLOW             0xFFFFFF00UL
00135 #define LCD_COLOR_ARGB8888_LIGHTBLUE          0xFF8080FFUL
00136 #define LCD_COLOR_ARGB8888_LIGHTGREEN         0xFF80FF80UL
00137 #define LCD_COLOR_ARGB8888_LIGHTRED           0xFFFF8080UL
00138 #define LCD_COLOR_ARGB8888_LIGHTCYAN          0xFF80FFFFUL
00139 #define LCD_COLOR_ARGB8888_LIGHTMAGENTA       0xFFFF80FFUL
00140 #define LCD_COLOR_ARGB8888_LIGHTYELLOW        0xFFFFFF80UL
00141 #define LCD_COLOR_ARGB8888_DARKBLUE           0xFF000080UL
00142 #define LCD_COLOR_ARGB8888_DARKGREEN          0xFF008000UL
00143 #define LCD_COLOR_ARGB8888_DARKRED            0xFF800000UL
00144 #define LCD_COLOR_ARGB8888_DARKCYAN           0xFF008080UL
00145 #define LCD_COLOR_ARGB8888_DARKMAGENTA        0xFF800080UL
00146 #define LCD_COLOR_ARGB8888_DARKYELLOW         0xFF808000UL
00147 #define LCD_COLOR_ARGB8888_WHITE              0xFFFFFFFFUL
00148 #define LCD_COLOR_ARGB8888_LIGHTGRAY          0xFFD3D3D3UL
00149 #define LCD_COLOR_ARGB8888_GRAY               0xFF808080UL
00150 #define LCD_COLOR_ARGB8888_DARKGRAY           0xFF404040UL
00151 #define LCD_COLOR_ARGB8888_BLACK              0xFF000000UL
00152 #define LCD_COLOR_ARGB8888_BROWN              0xFFA52A2AUL
00153 #define LCD_COLOR_ARGB8888_ORANGE             0xFFFFA500UL
00154 /* Definition of Official ST Colors */
00155 #define LCD_COLOR_ARGB8888_ST_BLUE_DARK       0xFF002052UL
00156 #define LCD_COLOR_ARGB8888_ST_BLUE            0xFF39A9DCUL
00157 #define LCD_COLOR_ARGB8888_ST_BLUE_LIGHT      0xFFD1E4F3UL
00158 #define LCD_COLOR_ARGB8888_ST_GREEN_LIGHT     0xFFBBCC01UL
00159 #define LCD_COLOR_ARGB8888_ST_GREEN_DARK      0xFF003D14UL
00160 #define LCD_COLOR_ARGB8888_ST_YELLOW          0xFFFFD300UL
00161 #define LCD_COLOR_ARGB8888_ST_BROWN           0xFF5C0915UL
00162 #define LCD_COLOR_ARGB8888_ST_PINK            0xFFD4007AUL
00163 #define LCD_COLOR_ARGB8888_ST_PURPLE          0xFF590D58UL
00164 #define LCD_COLOR_ARGB8888_ST_GRAY_DARK       0xFF4F5251UL
00165 #define LCD_COLOR_ARGB8888_ST_GRAY            0xFF90989EUL
00166 #define LCD_COLOR_ARGB8888_ST_GRAY_LIGHT      0xFFB9C4CAUL
00167
00168 /**
00169   * @}
00170   */
00171
00172 /** @defgroup STM32H735G_DISCO_LCD_Exported_Variables Exported Variables
00173   * @{
00174   */
00175 extern const LCD_UTILS_Drv_t LCD_Driver;
00176 /**
00177   * @}
00178   */
00179
00180 /** @defgroup STM32H735G_DISCO_LCD_Exported_Types Exported Types
00181   * @{
00182   */
00183 typedef uint32_t(*ConvertColor_Func)(uint32_t);
00184
00185 typedef struct
00186 {
00187   uint32_t XSize;
00188   uint32_t YSize;
00189   uint32_t ActiveLayer;
00190   uint32_t PixelFormat;
00191   uint32_t IsMspCallbacksValid;
00192   uint32_t ReloadEnable;
00193 } BSP_LCD_Ctx_t;
00194
00195 typedef struct
00196 {
00197   uint32_t X0;
00198   uint32_t X1;
00199   uint32_t Y0;
00200   uint32_t Y1;
00201   uint32_t PixelFormat;
00202   uint32_t Address;
00203 }MX_LTDC_LayerConfig_t;
00204
00205 #define BSP_LCD_LayerConfig_t MX_LTDC_LayerConfig_t
00206
00207
00208 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
00209 typedef struct
00210 {
00211   pLTDC_CallbackTypeDef            pMspLtdcInitCb;
00212   pLTDC_CallbackTypeDef            pMspLtdcDeInitCb;
00213 }BSP_LCD_Cb_t;
00214 #endif /*(USE_HAL_LTDC_REGISTER_CALLBACKS == 1) */
00215 /**
00216   * @}
00217   */
00218
00219 /** @addtogroup STM32H735G_DISCO_LCD_Exported_Variables
00220   * @{
00221   */
00222 extern DMA2D_HandleTypeDef hlcd_dma2d;
00223 extern LTDC_HandleTypeDef  hlcd_ltdc;
00224 extern BSP_LCD_Ctx_t       LcdCtx[];
00225 /**
00226   * @}
00227   */
00228 /** @addtogroup STM32H735G_DISCO_LCD_Exported_Functions
00229   * @{
00230   */
00231 /* Initialization APIs */
00232 int32_t BSP_LCD_Init(uint32_t Instance, uint32_t Orientation);
00233 int32_t BSP_LCD_InitEx(uint32_t Instance, uint32_t Orientation, uint32_t PixelFormat, uint32_t Width, uint32_t Height);
00234 int32_t BSP_LCD_DeInit(uint32_t Instance);
00235
00236 /* Register Callbacks APIs */
00237 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
00238 int32_t BSP_LCD_RegisterDefaultMspCallbacks (uint32_t Instance);
00239 int32_t BSP_LCD_RegisterMspCallbacks (uint32_t Instance, BSP_LCD_Cb_t *CallBacks);
00240 #endif /*(USE_HAL_LTDC_REGISTER_CALLBACKS == 1) */
00241
00242 /* LCD specific APIs: Layer control & LCD HW reset */
00243 int32_t BSP_LCD_Relaod(uint32_t Instance, uint32_t ReloadType);
00244 int32_t BSP_LCD_ConfigLayer(uint32_t Instance, uint32_t LayerIndex, BSP_LCD_LayerConfig_t *Config);
00245 int32_t BSP_LCD_SetLayerVisible(uint32_t Instance, uint32_t LayerIndex, FunctionalState State);
00246 int32_t BSP_LCD_SetTransparency(uint32_t Instance, uint32_t LayerIndex, uint8_t Transparency);
00247 int32_t BSP_LCD_SetLayerAddress(uint32_t Instance, uint32_t LayerIndex, uint32_t Address);
00248 int32_t BSP_LCD_SetLayerWindow(uint32_t Instance, uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00249 int32_t BSP_LCD_SetColorKeying(uint32_t Instance, uint32_t LayerIndex, uint32_t Color);
00250 int32_t BSP_LCD_ResetColorKeying(uint32_t Instance, uint32_t LayerIndex);
00251 void    BSP_LCD_Reset(uint32_t Instance);
00252
00253 /* LCD generic APIs: Display control */
00254 int32_t BSP_LCD_DisplayOn(uint32_t Instance);
00255 int32_t BSP_LCD_DisplayOff(uint32_t Instance);
00256 int32_t BSP_LCD_SetBrightness(uint32_t Instance, uint32_t Brightness);
00257 int32_t BSP_LCD_GetBrightness(uint32_t Instance, uint32_t *Brightness);
00258 int32_t BSP_LCD_GetXSize(uint32_t Instance, uint32_t *XSize);
00259 int32_t BSP_LCD_GetYSize(uint32_t Instance, uint32_t *YSize);
00260
00261 /* LCD generic APIs: Draw operations. This list of APIs is required for
00262    lcd gfx utilities */
00263 int32_t BSP_LCD_SetActiveLayer(uint32_t Instance, uint32_t LayerIndex);
00264 int32_t BSP_LCD_GetPixelFormat(uint32_t Instance, uint32_t *PixelFormat);
00265 int32_t BSP_LCD_DrawBitmap(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
00266 int32_t BSP_LCD_DrawHLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
00267 int32_t BSP_LCD_DrawVLine(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
00268 int32_t BSP_LCD_FillRGBRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
00269 int32_t BSP_LCD_FillRect(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
00270 int32_t BSP_LCD_ReadPixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
00271 int32_t BSP_LCD_WritePixel(uint32_t Instance, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
00272
00273 /* LCD MX APIs */
00274 HAL_StatusTypeDef MX_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, uint32_t LayerIndex, MX_LTDC_LayerConfig_t *Config);
00275 HAL_StatusTypeDef MX_LTDC_ClockConfig(LTDC_HandleTypeDef *hltdc);
00276 HAL_StatusTypeDef MX_LTDC_Init(LTDC_HandleTypeDef *hltdc, uint32_t Width, uint32_t Height);
00277 HAL_StatusTypeDef MX_LTDC_ClockConfig2(LTDC_HandleTypeDef *hltdc);
00278
00279 /**
00280   * @}
00281   */
00282
00283 /* Private constants --------------------------------------------------------*/
00284 /** @defgroup STM32H735G_DISCO_LCD_Private_Constants Private Constants
00285   * @{
00286   */
00287 /* Legacy defines */
00288 #define LCD_ORIENTATION_PORTRAIT         0x00U /* Portrait orientation choice of LCD screen               */
00289 /**
00290   * @}
00291   */
00292
00293 /**
00294   * @}
00295   */
00296
00297 /**
00298   * @}
00299   */
00300
00301 /**
00302   * @}
00303   */
00304
00305 /**
00306   * @}
00307   */
00308
00309 #ifdef __cplusplus
00310 }
00311 #endif
00312
00313 #endif /* STM32H735G_DISCO_LCD_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ospi.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_ospi.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_ospi_nor.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the MX25LM51245G OSPI
00006   *          memory mounted on STM32H735G-DK board.
00007   @verbatim
00008   ==============================================================================
00009                      ##### How to use this driver #####
00010   ==============================================================================
00011   [..]
00012    (#) This driver is used to drive the MX25LM51245G Octal NOR and the S70KL1281 HyperRAM
00013        external memories mounted on STM32H735G-DK board.
00014
00015    (#) This driver need specific component driver (MX25LM51245G and S70KL1281) to be included with.
00016
00017    (#) MX25LM51245G Initialization steps:
00018        (++) Initialize the OPSI external memory using the BSP_OSPI_NOR_Init() function. This
00019             function includes the MSP layer hardware resources initialization and the
00020             OSPI interface with the external memory.
00021
00022    (#) MX25LM51245G Octal NOR memory operations
00023        (++) OSPI memory can be accessed with read/write operations once it is
00024             initialized.
00025             Read/write operation can be performed with AHB access using the functions
00026             BSP_OSPI_NOR_Read()/BSP_OSPI_NOR_Write().
00027        (++) The function BSP_OSPI_NOR_GetInfo() returns the configuration of the OSPI memory.
00028             (see the OSPI memory data sheet)
00029        (++) Perform erase block operation using the function BSP_OSPI_NOR_Erase_Block() and by
00030             specifying the block address. You can perform an erase operation of the whole
00031             chip by calling the function BSP_OSPI_NOR_Erase_Chip().
00032        (++) The function BSP_OSPI_NOR_GetStatus() returns the current status of the OSPI memory.
00033             (see the OSPI memory data sheet)
00034        (++) The memory access can be configured in memory-mapped mode with the call of
00035             function BSP_OSPI_NOR_EnableMemoryMapped(). To go back in indirect mode, the
00036             function BSP_OSPI_NOR_DisableMemoryMapped() should be used.
00037        (++) The erase operation can be suspend and resume with using functions
00038             BSP_OSPI_NOR_SuspendErase() and BSP_OSPI_NOR_ResumeErase()
00039        (++) The function BSP_OSPI_NOR_ReadID() returns the identifier of the memory
00040             (see the OSPI memory data sheet)
00041        (++) The configuration of the interface between peripheral and memory is done by
00042             the function BSP_OSPI_NOR_ConfigFlash(), three modes are possible :
00043             - SPI : instruction, address and data on one line
00044             - STR OPI : instruction, address and data on eight lines with sampling on one edge of clock
00045             - DTR OPI : instruction, address and data on eight lines with sampling on both edgaes of clock
00046
00047    (#) S70KL1281 Initialization steps:
00048        (++) Initialize the HyperRAM external memory using the BSP_OSPI_RAM_Init() function. This
00049             function includes the MSP layer hardware resources initialization and the
00050             OSPI interface with the external memory.
00051
00052    (#) S70KL1281 HyperRAM memory operations
00053        (++) HyperRAM memory can be accessed with read/write operations once it is
00054             initialized.
00055             Read/write operation can be performed with AHB access using the functions
00056             BSP_OSPI_RAM_Read()/BSP_OSPI_RAM_Write().
00057             Read/write operation can be performed with DMA using the functions
00058             BSP_OSPI_RAM_Read_DMA()/BSP_OSPI_RAM_Write_DMA().
00059        (++) The memory access can be configured in memory-mapped mode with the call of
00060             function BSP_OSPI_RAM_EnableMemoryMapped(). To go back in indirect mode, the
00061             function BSP_OSPI_RAM_DisableMemoryMapped() should be used.
00062        (++) The configuration of the interface between peripheral and memory is done by
00063             the function BSP_OSPI_RAM_ConfigHyperRAM() :
00064             - one latency mode is possible :
00065               - Fixed latency mode
00066             - five burst configuration are possible :
00067               - Linear burst access
00068               - 16-bytes hybrid burst access
00069               - 32-bytes hybrid burst access
00070               - 64-bytes hybrid burst access
00071               - 128-bytes hybrid burst access
00072
00073   @endverbatim
00074   ******************************************************************************
00075   * @attention
00076   *
00077   * Copyright (c) 2019 STMicroelectronics.
00078   * All rights reserved.
00079   *
00080   * This software is licensed under terms that can be found in the LICENSE file
00081   * in the root directory of this software component.
00082   * If no LICENSE file comes with this software, it is provided AS-IS.
00083   *
00084   ******************************************************************************
00085   */
00086
00087 /* Includes ------------------------------------------------------------------*/
00088 #include "stm32h735g_discovery_ospi.h"
00089
00090 /** @addtogroup BSP
00091   * @{
00092   */
00093
00094 /** @addtogroup STM32H735G_DK
00095   * @{
00096   */
00097
00098 /** @defgroup STM32H735G_DK_OSPI STM32H735G_DK OSPI
00099   * @{
00100   */
00101
00102 /* Exported variables --------------------------------------------------------*/
00103 /** @addtogroup STM32H735G_DK_OSPI_NOR_Exported_Variables OSPI_NOR Exported Variables
00104   * @{
00105   */
00106 OSPI_HandleTypeDef hospi_nor[OSPI_NOR_INSTANCES_NUMBER] = {0};;
00107 OSPI_NOR_Ctx_t Ospi_Nor_Ctx[OSPI_NOR_INSTANCES_NUMBER] = {{OSPI_ACCESS_NONE,
00108                                                            MX25LM51245G_SPI_MODE,
00109                                                            MX25LM51245G_STR_TRANSFER}};
00110 /**
00111   * @}
00112   */
00113 /** @addtogroup STM32H735G_DK_OSPI_RAM_Exported_Variables OSPI_RAM Exported Variables
00114   * @{
00115   */
00116 OSPI_HandleTypeDef hospi_ram[OSPI_RAM_INSTANCES_NUMBER] = {0};
00117 OSPI_RAM_Ctx_t Ospi_Ram_Ctx[OSPI_RAM_INSTANCES_NUMBER] = {{OSPI_ACCESS_NONE,
00118                                                            BSP_OSPI_RAM_FIXED_LATENCY,
00119                                                            BSP_OSPI_RAM_HYBRID_BURST,
00120                                                            BSP_OSPI_RAM_BURST_16_BYTES}};
00121 /**
00122   * @}
00123   */
00124
00125 /** @defgroup STM32H735G_DK_OSPI_NOR_Private_Functions OSPI_NOR Private Functions
00126   * @{
00127   */
00128 static void    OSPI_NOR_MspInit      (OSPI_HandleTypeDef *hospi);
00129 static void    OSPI_NOR_MspDeInit    (OSPI_HandleTypeDef *hospi);
00130 static int32_t OSPI_NOR_ResetMemory  (uint32_t Instance);
00131 static int32_t OSPI_NOR_EnterDOPIMode(uint32_t Instance);
00132 static int32_t OSPI_NOR_EnterSOPIMode(uint32_t Instance);
00133 static int32_t OSPI_NOR_ExitOPIMode  (uint32_t Instance);
00134 /**
00135   * @}
00136   */
00137 /** @defgroup STM32H735G_DK_OSPI_RAM_Private_Functions OSPI_RAM Private Functions
00138   * @{
00139   */
00140 static void OSPI_RAM_MspInit  (OSPI_HandleTypeDef *hospi);
00141 static void OSPI_RAM_MspDeInit(OSPI_HandleTypeDef *hospi);
00142
00143 /**
00144   * @}
00145   */
00146
00147 /* Exported functions ---------------------------------------------------------*/
00148
00149 /** @defgroup STM32H735G_DK_OSPI_NOR_Exported_Functions OSPI_NOR Exported Functions
00150   * @{
00151   */
00152
00153 /**
00154   * @brief  Initializes the OSPI interface.
00155   * @param  Instance   OSPI Instance
00156   * @param  Init       OSPI Init structure
00157   * @retval BSP status
00158   */
00159 int32_t BSP_OSPI_NOR_Init(uint32_t Instance, BSP_OSPI_NOR_Init_t *Init)
00160 {
00161   int32_t ret;
00162   BSP_OSPI_NOR_Info_t pInfo;
00163   MX_OSPI_InitTypeDef ospi_config;
00164
00165   /* Check if the instance is supported */
00166   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00167   {
00168     ret = BSP_ERROR_WRONG_PARAM;
00169   }
00170   else
00171   {
00172     /* Check if the instance is already initialized */
00173     if (Ospi_Nor_Ctx[Instance].IsInitialized == OSPI_ACCESS_NONE)
00174     {
00175 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
00176       /* Register the OSPI MSP Callbacks */
00177       if(Ospi_Nor_Ctx[Instance].IsMspCallbacksValid == 0UL)
00178       {
00179         if(BSP_OSPI_NOR_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
00180         {
00181           return BSP_ERROR_PERIPH_FAILURE;
00182         }
00183       }
00184 #else
00185       /* Msp OSPI initialization */
00186       OSPI_NOR_MspInit(&hospi_nor[Instance]);
00187 #endif /* USE_HAL_OSPI_REGISTER_CALLBACKS */
00188
00189       /* Get Flash information of one memory */
00190       (void)MX25LM51245G_GetFlashInfo(&pInfo);
00191
00192       /* Fill config structure */
00193       ospi_config.ClockPrescaler = 2U;
00194       ospi_config.MemorySize     = (uint32_t)POSITION_VAL((uint32_t)pInfo.FlashSize);
00195       ospi_config.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
00196       ospi_config.TransferRate   = Init->TransferRate;
00197
00198       /* STM32 OSPI Clock configuration */
00199       if (MX_OSPI_ClockConfig(&hospi_nor[Instance]) != HAL_OK)
00200       {
00201         ret = BSP_ERROR_PERIPH_FAILURE;
00202       }
00203        /* STM32 OSPI interface initialization */
00204       else if (MX_OSPI_NOR_Init(&hospi_nor[Instance], &ospi_config) != HAL_OK)
00205       {
00206         ret = BSP_ERROR_PERIPH_FAILURE;
00207       }
00208       /* OSPI memory reset */
00209       else if (OSPI_NOR_ResetMemory(Instance) != BSP_ERROR_NONE)
00210       {
00211         ret = BSP_ERROR_COMPONENT_FAILURE;
00212       }
00213       /* Check if memory is ready */
00214       else if (MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00215       {
00216         ret = BSP_ERROR_COMPONENT_FAILURE;
00217       }
00218       /* Configure the memory */
00219       else if (BSP_OSPI_NOR_ConfigFlash(Instance, Init->InterfaceMode, Init->TransferRate) != BSP_ERROR_NONE)
00220       {
00221         ret = BSP_ERROR_COMPONENT_FAILURE;
00222       }
00223       else
00224       {
00225         ret = BSP_ERROR_NONE;
00226       }
00227     }
00228     else
00229     {
00230       ret = BSP_ERROR_NONE;
00231     }
00232   }
00233
00234   /* Return BSP status */
00235   return ret;
00236 }
00237
00238 /**
00239   * @brief  De-Initializes the OSPI interface.
00240   * @param  Instance   OSPI Instance
00241   * @retval BSP status
00242   */
00243 int32_t BSP_OSPI_NOR_DeInit(uint32_t Instance)
00244 {
00245   int32_t ret = BSP_ERROR_NONE;
00246
00247   /* Check if the instance is supported */
00248   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00249   {
00250     ret = BSP_ERROR_WRONG_PARAM;
00251   }
00252   else
00253   {
00254     /* Disable Memory mapped mode */
00255     if(Ospi_Nor_Ctx[Instance].IsInitialized == OSPI_ACCESS_MMP)
00256     {
00257       if(BSP_OSPI_NOR_DisableMemoryMappedMode(Instance) != BSP_ERROR_NONE)
00258       {
00259         return BSP_ERROR_COMPONENT_FAILURE;
00260       }
00261     }
00262
00263     /* Set default Ospi_Nor_Ctx values */
00264     Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_NONE;
00265     Ospi_Nor_Ctx[Instance].InterfaceMode = BSP_OSPI_NOR_SPI_MODE;
00266     Ospi_Nor_Ctx[Instance].TransferRate  = BSP_OSPI_NOR_STR_TRANSFER;
00267
00268 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 0)
00269     OSPI_NOR_MspDeInit(&hospi_nor[Instance]);
00270 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 0) */
00271
00272     /* Call the DeInit function to reset the driver */
00273     if (HAL_OSPI_DeInit(&hospi_nor[Instance]) != HAL_OK)
00274     {
00275       ret = BSP_ERROR_PERIPH_FAILURE;
00276     }
00277   }
00278
00279   /* Return BSP status */
00280   return ret;
00281 }
00282
00283 /**
00284   * @brief  Initializes the OSPI interface.
00285   * @param  hospi          OSPI handle
00286   * @param  Config         OSPI config structure
00287   * @retval BSP status
00288   */
00289 __weak HAL_StatusTypeDef MX_OSPI_NOR_Init(OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Config)
00290 {
00291     /* OctoSPI initialization */
00292   hospi->Instance = OCTOSPI1;
00293
00294   hospi->Init.FifoThreshold      = 4;
00295   hospi->Init.DualQuad           = HAL_OSPI_DUALQUAD_DISABLE;
00296   hospi->Init.DeviceSize         = Config->MemorySize; /* 512 MBits */
00297   hospi->Init.ChipSelectHighTime = 2;
00298   hospi->Init.FreeRunningClock   = HAL_OSPI_FREERUNCLK_DISABLE;
00299   hospi->Init.ClockMode          = HAL_OSPI_CLOCK_MODE_0;
00300   hospi->Init.WrapSize           = HAL_OSPI_WRAP_NOT_SUPPORTED;
00301   hospi->Init.ClockPrescaler     = Config->ClockPrescaler;
00302   hospi->Init.SampleShifting     = Config->SampleShifting;
00303   hospi->Init.ChipSelectBoundary = 0;
00304
00305   if (Config->TransferRate == BSP_OSPI_NOR_DTR_TRANSFER)
00306   {
00307     hospi->Init.MemoryType            = HAL_OSPI_MEMTYPE_MACRONIX;
00308     hospi->Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE;
00309   }
00310   else
00311   {
00312     hospi->Init.MemoryType            = HAL_OSPI_MEMTYPE_MICRON;
00313     hospi->Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
00314   }
00315
00316   return HAL_OSPI_Init(hospi);
00317 }
00318
00319 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
00320 /**
00321   * @brief Default BSP OSPI Msp Callbacks
00322   * @param Instance      OSPI Instance
00323   * @retval BSP status
00324   */
00325 int32_t BSP_OSPI_NOR_RegisterDefaultMspCallbacks (uint32_t Instance)
00326 {
00327   int32_t ret = BSP_ERROR_NONE;
00328
00329   /* Check if the instance is supported */
00330   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00331   {
00332     ret = BSP_ERROR_WRONG_PARAM;
00333   }
00334   else
00335   {
00336     /* Register MspInit/MspDeInit Callbacks */
00337     if(HAL_OSPI_RegisterCallback(&hospi_nor[Instance], HAL_OSPI_MSP_INIT_CB_ID, OSPI_NOR_MspInit) != HAL_OK)
00338     {
00339       ret = BSP_ERROR_PERIPH_FAILURE;
00340     }
00341     else if(HAL_OSPI_RegisterCallback(&hospi_nor[Instance], HAL_OSPI_MSP_DEINIT_CB_ID, OSPI_NOR_MspDeInit) != HAL_OK)
00342     {
00343       ret = BSP_ERROR_PERIPH_FAILURE;
00344     }
00345     else
00346     {
00347       Ospi_Nor_Ctx[Instance].IsMspCallbacksValid = 1U;
00348     }
00349   }
00350
00351   /* Return BSP status */
00352   return ret;
00353 }
00354
00355 /**
00356   * @brief BSP OSPI Msp Callback registering
00357   * @param Instance     OSPI Instance
00358   * @param CallBacks    pointer to MspInit/MspDeInit callbacks functions
00359   * @retval BSP status
00360   */
00361 int32_t BSP_OSPI_NOR_RegisterMspCallbacks (uint32_t Instance, BSP_OSPI_Cb_t *CallBacks)
00362 {
00363   int32_t ret = BSP_ERROR_NONE;
00364
00365   /* Check if the instance is supported */
00366   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00367   {
00368     ret = BSP_ERROR_WRONG_PARAM;
00369   }
00370   else
00371   {
00372     /* Register MspInit/MspDeInit Callbacks */
00373     if(HAL_OSPI_RegisterCallback(&hospi_nor[Instance], HAL_OSPI_MSP_INIT_CB_ID, CallBacks->pMspInitCb) != HAL_OK)
00374     {
00375       ret = BSP_ERROR_PERIPH_FAILURE;
00376     }
00377     else if(HAL_OSPI_RegisterCallback(&hospi_nor[Instance], HAL_OSPI_MSP_DEINIT_CB_ID, CallBacks->pMspDeInitCb) != HAL_OK)
00378     {
00379       ret = BSP_ERROR_PERIPH_FAILURE;
00380     }
00381     else
00382     {
00383       Ospi_Nor_Ctx[Instance].IsMspCallbacksValid = 1U;
00384     }
00385   }
00386
00387   /* Return BSP status */
00388   return ret;
00389 }
00390 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 1) */
00391
00392 /**
00393   * @brief  Reads an amount of data from the OSPI memory.
00394   * @param  Instance  OSPI instance
00395   * @param  pData     Pointer to data to be read
00396   * @param  ReadAddr  Read start address
00397   * @param  Size      Size of data to read
00398   * @retval BSP status
00399   */
00400 int32_t BSP_OSPI_NOR_Read(uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
00401 {
00402   int32_t ret = BSP_ERROR_NONE;
00403
00404   /* Check if the instance is supported */
00405   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00406   {
00407     ret = BSP_ERROR_WRONG_PARAM;
00408   }
00409   else
00410   {
00411     if(Ospi_Nor_Ctx[Instance].TransferRate == BSP_OSPI_NOR_STR_TRANSFER)
00412     {
00413       if(MX25LM51245G_ReadSTR(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, MX25LM51245G_4BYTES_SIZE, pData, ReadAddr, Size) != MX25LM51245G_OK)
00414       {
00415         ret = BSP_ERROR_COMPONENT_FAILURE;
00416       }
00417     }
00418     else
00419     {
00420       if(MX25LM51245G_ReadDTR(&hospi_nor[Instance], pData, ReadAddr, Size) != MX25LM51245G_OK)
00421       {
00422         ret = BSP_ERROR_COMPONENT_FAILURE;
00423       }
00424     }
00425   }
00426
00427   /* Return BSP status */
00428   return ret;
00429 }
00430
00431 /**
00432   * @brief  Writes an amount of data to the OSPI memory.
00433   * @param  Instance  OSPI instance
00434   * @param  pData     Pointer to data to be written
00435   * @param  WriteAddr Write start address
00436   * @param  Size      Size of data to write
00437   * @retval BSP status
00438   */
00439 int32_t BSP_OSPI_NOR_Write(uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
00440 {
00441   int32_t ret = BSP_ERROR_NONE;
00442   uint32_t end_addr, current_size, current_addr;
00443   uint32_t data_addr;
00444
00445   /* Check if the instance is supported */
00446   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00447   {
00448     ret = BSP_ERROR_WRONG_PARAM;
00449   }
00450   else
00451   {
00452     /* Calculation of the size between the write address and the end of the page */
00453     current_size = MX25LM51245G_PAGE_SIZE - (WriteAddr % MX25LM51245G_PAGE_SIZE);
00454
00455     /* Check if the size of the data is less than the remaining place in the page */
00456     if (current_size > Size)
00457     {
00458       current_size = Size;
00459     }
00460
00461     /* Initialize the address variables */
00462     current_addr = WriteAddr;
00463     end_addr = WriteAddr + Size;
00464     data_addr = (uint32_t)pData;
00465
00466     /* Perform the write page by page */
00467     do
00468     {
00469       /* Check if Flash busy ? */
00470       if(MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00471       {
00472         ret = BSP_ERROR_COMPONENT_FAILURE;
00473       }/* Enable write operations */
00474       else if(MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00475       {
00476         ret = BSP_ERROR_COMPONENT_FAILURE;
00477       }
00478       else
00479       {
00480         if(Ospi_Nor_Ctx[Instance].TransferRate == BSP_OSPI_NOR_STR_TRANSFER)
00481         {
00482           /* Issue page program command */
00483           if(MX25LM51245G_PageProgram(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, MX25LM51245G_4BYTES_SIZE, (uint8_t*)data_addr, current_addr, current_size) != MX25LM51245G_OK)
00484           {
00485             ret = BSP_ERROR_COMPONENT_FAILURE;
00486           }
00487         }
00488         else
00489         {
00490           /* Issue page program command */
00491           if(MX25LM51245G_PageProgramDTR(&hospi_nor[Instance], (uint8_t*)data_addr, current_addr, current_size) != MX25LM51245G_OK)
00492           {
00493             ret = BSP_ERROR_COMPONENT_FAILURE;
00494           }
00495         }
00496
00497         if (ret == BSP_ERROR_NONE)
00498         {
00499           /* Configure automatic polling mode to wait for end of program */
00500           if (MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00501           {
00502             ret = BSP_ERROR_COMPONENT_FAILURE;
00503           }
00504           else
00505           {
00506             /* Update the address and size variables for next page programming */
00507             current_addr += current_size;
00508             data_addr += current_size;
00509             current_size = ((current_addr + MX25LM51245G_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : MX25LM51245G_PAGE_SIZE;
00510           }
00511         }
00512       }
00513     } while ((current_addr < end_addr) && (ret == BSP_ERROR_NONE));
00514   }
00515
00516   /* Return BSP status */
00517   return ret;
00518 }
00519
00520 /**
00521   * @brief  Erases the specified block of the OSPI memory.
00522   * @param  Instance     OSPI instance
00523   * @param  BlockAddress Block address to erase
00524   * @param  BlockSize    Erase Block size
00525   * @retval BSP status
00526   */
00527 int32_t BSP_OSPI_NOR_Erase_Block(uint32_t Instance, uint32_t BlockAddress, BSP_OSPI_NOR_Erase_t BlockSize)
00528 {
00529   int32_t ret;
00530
00531   /* Check if the instance is supported */
00532   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00533   {
00534     ret = BSP_ERROR_WRONG_PARAM;
00535   }
00536   else
00537   {
00538     /* Check Flash busy ? */
00539     if(MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00540     {
00541       ret = BSP_ERROR_COMPONENT_FAILURE;
00542     }/* Enable write operations */
00543     else if(MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00544     {
00545       ret = BSP_ERROR_COMPONENT_FAILURE;
00546     }/* Issue Block Erase command */
00547     else if(MX25LM51245G_BlockErase(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_4BYTES_SIZE, BlockAddress, BlockSize) != MX25LM51245G_OK)
00548     {
00549       ret = BSP_ERROR_COMPONENT_FAILURE;
00550     }/* Check Flash busy ? */
00551     else if(MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00552     {
00553       ret = BSP_ERROR_COMPONENT_FAILURE;
00554     }
00555     else
00556     {
00557       ret = BSP_ERROR_NONE;
00558     }
00559   }
00560
00561   /* Return BSP status */
00562   return ret;
00563 }
00564
00565 /**
00566   * @brief  Erases the entire OSPI memory.
00567   * @param  Instance  QSPI instance
00568   * @retval BSP status
00569   */
00570 int32_t BSP_OSPI_NOR_Erase_Chip(uint32_t Instance)
00571 {
00572   int32_t ret;
00573
00574   /* Check if the instance is supported */
00575   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00576   {
00577     ret = BSP_ERROR_WRONG_PARAM;
00578   }
00579   else
00580   {
00581     /* Check Flash busy ? */
00582     if(MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00583     {
00584       ret = BSP_ERROR_COMPONENT_FAILURE;
00585     }/* Enable write operations */
00586     else if(MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00587     {
00588       ret = BSP_ERROR_COMPONENT_FAILURE;
00589     }/* Issue Chip erase command */
00590     else if(MX25LM51245G_ChipErase(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00591     {
00592       ret = BSP_ERROR_COMPONENT_FAILURE;
00593     }
00594     else
00595     {
00596       ret = BSP_ERROR_NONE;
00597     }
00598   }
00599
00600   /* Return BSP status */
00601   return ret;
00602 }
00603
00604 /**
00605   * @brief  Reads current status of the OSPI memory.
00606   * @param  Instance  QSPI instance
00607   * @retval OSPI memory status: whether busy or not
00608   */
00609 int32_t BSP_OSPI_NOR_GetStatus(uint32_t Instance)
00610 {
00611   static uint8_t reg[2];
00612   int32_t ret;
00613
00614   /* Check if the instance is supported */
00615   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00616   {
00617     ret = BSP_ERROR_WRONG_PARAM;
00618   }
00619   else
00620   {
00621     if(MX25LM51245G_ReadSecurityRegister(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, reg) != MX25LM51245G_OK)
00622     {
00623       ret = BSP_ERROR_COMPONENT_FAILURE;
00624     }/* Check the value of the register */
00625     else if ((reg[0] & (MX25LM51245G_SECR_P_FAIL | MX25LM51245G_SECR_E_FAIL)) != 0U)
00626     {
00627       ret = BSP_ERROR_COMPONENT_FAILURE;
00628     }
00629     else if ((reg[0] & (MX25LM51245G_SECR_PSB | MX25LM51245G_SECR_ESB)) != 0U)
00630     {
00631       ret = BSP_ERROR_OSPI_SUSPENDED;
00632     }
00633     else if(MX25LM51245G_ReadStatusRegister(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, reg) != MX25LM51245G_OK)
00634     {
00635       ret = BSP_ERROR_COMPONENT_FAILURE;
00636     }/* Check the value of the register */
00637     else if ((reg[0] & MX25LM51245G_SR_WIP) != 0U)
00638     {
00639       ret = BSP_ERROR_BUSY;
00640     }
00641     else
00642     {
00643       ret = BSP_ERROR_NONE;
00644     }
00645   }
00646
00647   /* Return BSP status */
00648   return ret;
00649 }
00650
00651 /**
00652   * @brief  Return the configuration of the OSPI memory.
00653   * @param  Instance  OSPI instance
00654   * @param  pInfo     pointer on the configuration structure
00655   * @retval BSP status
00656   */
00657 int32_t BSP_OSPI_NOR_GetInfo(uint32_t Instance, BSP_OSPI_NOR_Info_t* pInfo)
00658 {
00659   int32_t ret = BSP_ERROR_NONE;
00660
00661   /* Check if the instance is supported */
00662   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00663   {
00664     ret = BSP_ERROR_WRONG_PARAM;
00665   }
00666   else
00667   {
00668     (void)MX25LM51245G_GetFlashInfo(pInfo);
00669   }
00670
00671   /* Return BSP status */
00672   return ret;
00673 }
00674
00675 /**
00676   * @brief  Configure the OSPI in memory-mapped mode
00677   * @param  Instance  OSPI instance
00678   * @retval BSP status
00679   */
00680 int32_t BSP_OSPI_NOR_EnableMemoryMappedMode(uint32_t Instance)
00681 {
00682   int32_t ret = BSP_ERROR_NONE;
00683
00684   /* Check if the instance is supported */
00685   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00686   {
00687     ret = BSP_ERROR_WRONG_PARAM;
00688   }
00689   else
00690   {
00691     if(Ospi_Nor_Ctx[Instance].TransferRate == BSP_OSPI_NOR_STR_TRANSFER)
00692     {
00693       if(MX25LM51245G_EnableMemoryMappedModeSTR(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, MX25LM51245G_4BYTES_SIZE) != MX25LM51245G_OK)
00694       {
00695         ret = BSP_ERROR_COMPONENT_FAILURE;
00696       }
00697       else /* Update OSPI context if all operations are well done */
00698       {
00699         Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_MMP;
00700       }
00701     }
00702     else
00703     {
00704       if(MX25LM51245G_EnableMemoryMappedModeDTR(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode) != MX25LM51245G_OK)
00705       {
00706         ret = BSP_ERROR_COMPONENT_FAILURE;
00707       }
00708       else /* Update OSPI context if all operations are well done */
00709       {
00710         Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_MMP;
00711       }
00712     }
00713   }
00714
00715   /* Return BSP status */
00716   return ret;
00717 }
00718
00719 /**
00720   * @brief  Exit form memory-mapped mode
00721   *         Only 1 Instance can running MMP mode. And it will lock system at this mode.
00722   * @param  Instance  OSPI instance
00723   * @retval BSP status
00724   */
00725 int32_t BSP_OSPI_NOR_DisableMemoryMappedMode(uint32_t Instance)
00726 {
00727   int32_t ret = BSP_ERROR_NONE;
00728
00729   /* Check if the instance is supported */
00730   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00731   {
00732     ret = BSP_ERROR_WRONG_PARAM;
00733   }
00734   else
00735   {
00736     if(Ospi_Nor_Ctx[Instance].IsInitialized != OSPI_ACCESS_MMP)
00737     {
00738       ret = BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE;
00739     }/* Abort MMP back to indirect mode */
00740     else if(HAL_OSPI_Abort(&hospi_nor[Instance]) != HAL_OK)
00741     {
00742       ret = BSP_ERROR_PERIPH_FAILURE;
00743     }
00744     else /* Update OSPI NOR context if all operations are well done */
00745     {
00746       /* Update OSPI context if all operations are well done */
00747       Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_INDIRECT;
00748     }
00749   }
00750
00751   /* Return BSP status */
00752   return ret;
00753 }
00754
00755 /**
00756   * @brief  Get flash ID 3 Bytes:
00757   *         Manufacturer ID, Memory type, Memory density
00758   * @param  Instance  OSPI instance
00759   * @param  Id Pointer to flash ID bytes
00760   * @retval BSP status
00761   */
00762 int32_t BSP_OSPI_NOR_ReadID(uint32_t Instance, uint8_t *Id)
00763 {
00764   int32_t ret;
00765
00766   /* Check if the instance is supported */
00767   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00768   {
00769     ret = BSP_ERROR_WRONG_PARAM;
00770   }
00771   else if(MX25LM51245G_ReadID(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, Id) != MX25LM51245G_OK)
00772   {
00773     ret = BSP_ERROR_COMPONENT_FAILURE;
00774   }
00775   else
00776   {
00777     ret = BSP_ERROR_NONE;
00778   }
00779
00780   /* Return BSP status */
00781   return ret;
00782 }
00783
00784 /**
00785   * @brief  Set Flash to desired Interface mode. And this instance becomes current instance.
00786   *         If current instance running at MMP mode then this function doesn't work.
00787   *         Indirect -> Indirect
00788   * @param  Instance  OSPI instance
00789   * @param  Mode      OSPI mode
00790   * @param  Rate      OSPI transfer rate
00791   * @retval BSP status
00792   */
00793 int32_t BSP_OSPI_NOR_ConfigFlash(uint32_t Instance, BSP_OSPI_NOR_Interface_t Mode, BSP_OSPI_NOR_Transfer_t Rate)
00794 {
00795   int32_t ret = BSP_ERROR_NONE;
00796
00797   /* Check if the instance is supported */
00798   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00799   {
00800     ret = BSP_ERROR_WRONG_PARAM;
00801   }
00802   else
00803   {
00804     /* Check if MMP mode locked ************************************************/
00805     if(Ospi_Nor_Ctx[Instance].IsInitialized == OSPI_ACCESS_MMP)
00806     {
00807       ret = BSP_ERROR_OSPI_MMP_LOCK_FAILURE;
00808     }
00809     else
00810     {
00811       /* Setup Flash interface ***************************************************/
00812       switch(Ospi_Nor_Ctx[Instance].InterfaceMode)
00813       {
00814       case BSP_OSPI_NOR_OPI_MODE :  /* 8-8-8 commands */
00815         if((Mode != BSP_OSPI_NOR_OPI_MODE) || (Rate != Ospi_Nor_Ctx[Instance].TransferRate))
00816         {
00817           /* Exit OPI mode */
00818           ret = OSPI_NOR_ExitOPIMode(Instance);
00819
00820           if ((ret == BSP_ERROR_NONE) && (Mode == BSP_OSPI_NOR_OPI_MODE))
00821           {
00822
00823             if (Ospi_Nor_Ctx[Instance].TransferRate == BSP_OSPI_NOR_STR_TRANSFER)
00824             {
00825               /* Enter DTR OPI mode */
00826               ret = OSPI_NOR_EnterDOPIMode(Instance);
00827             }
00828             else
00829             {
00830               /* Enter STR OPI mode */
00831               ret = OSPI_NOR_EnterSOPIMode(Instance);
00832             }
00833           }
00834         }
00835         break;
00836
00837       case BSP_OSPI_NOR_SPI_MODE :  /* 1-1-1 commands, Power on H/W default setting */
00838       default :
00839         if(Mode == BSP_OSPI_NOR_OPI_MODE)
00840         {
00841           if(Rate == BSP_OSPI_NOR_STR_TRANSFER)
00842           {
00843             /* Enter STR OPI mode */
00844             ret = OSPI_NOR_EnterSOPIMode(Instance);
00845           }
00846           else
00847           {
00848             /* Enter DTR OPI mode */
00849             ret = OSPI_NOR_EnterDOPIMode(Instance);
00850           }
00851         }
00852         break;
00853       }
00854
00855       /* Update OSPI context if all operations are well done */
00856       if(ret == BSP_ERROR_NONE)
00857       {
00858         /* Update current status parameter *****************************************/
00859         Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_INDIRECT;
00860         Ospi_Nor_Ctx[Instance].InterfaceMode = Mode;
00861         Ospi_Nor_Ctx[Instance].TransferRate  = Rate;
00862       }
00863     }
00864   }
00865
00866   /* Return BSP status */
00867   return ret;
00868 }
00869
00870 /**
00871   * @brief  This function suspends an ongoing erase command.
00872   * @param  Instance  QSPI instance
00873   * @retval BSP status
00874   */
00875 int32_t BSP_OSPI_NOR_SuspendErase(uint32_t Instance)
00876 {
00877   int32_t ret = BSP_ERROR_NONE;
00878
00879   /* Check if the instance is supported */
00880   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00881   {
00882     ret = BSP_ERROR_WRONG_PARAM;
00883   }
00884   /* Check whether the device is busy (erase operation is in progress). */
00885   else if (BSP_OSPI_NOR_GetStatus(Instance) != BSP_ERROR_BUSY)
00886   {
00887     ret = BSP_ERROR_COMPONENT_FAILURE;
00888   }
00889   else if(MX25LM51245G_Suspend(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00890   {
00891     ret = BSP_ERROR_COMPONENT_FAILURE;
00892   }
00893   else if (BSP_OSPI_NOR_GetStatus(Instance) != BSP_ERROR_OSPI_SUSPENDED)
00894   {
00895     ret = BSP_ERROR_COMPONENT_FAILURE;
00896   }
00897   else
00898   {
00899     ret = BSP_ERROR_NONE;
00900   }
00901
00902   /* Return BSP status */
00903   return ret;
00904 }
00905
00906 /**
00907   * @brief  This function resumes a paused erase command.
00908   * @param  Instance  QSPI instance
00909   * @retval BSP status
00910   */
00911 int32_t BSP_OSPI_NOR_ResumeErase(uint32_t Instance)
00912 {
00913   int32_t ret = BSP_ERROR_NONE;
00914
00915   /* Check if the instance is supported */
00916   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
00917   {
00918     ret = BSP_ERROR_WRONG_PARAM;
00919   }
00920   /* Check whether the device is busy (erase operation is in progress). */
00921   else if (BSP_OSPI_NOR_GetStatus(Instance) != BSP_ERROR_OSPI_SUSPENDED)
00922   {
00923     ret = BSP_ERROR_COMPONENT_FAILURE;
00924   }
00925   else if(MX25LM51245G_Resume(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
00926   {
00927     ret = BSP_ERROR_COMPONENT_FAILURE;
00928   }
00929   /*
00930   When this command is executed, the status register write in progress bit is set to 1, and
00931   the flag status register program erase controller bit is set to 0. This command is ignored
00932   if the device is not in a suspended state.
00933   */
00934   else if (BSP_OSPI_NOR_GetStatus(Instance) != BSP_ERROR_BUSY)
00935   {
00936     ret = BSP_ERROR_COMPONENT_FAILURE;
00937   }
00938   else
00939   {
00940     ret = BSP_ERROR_NONE;
00941   }
00942
00943   /* Return BSP status */
00944   return ret;
00945 }
00946
00947 /**
00948   * @}
00949   */
00950
00951 /** @addtogroup STM32H735G_DK_OSPI_RAM_Exported_Functions
00952   * @{
00953   */
00954
00955 /**
00956   * @brief  Initializes the OSPI interface.
00957   * @param  Instance   OSPI Instance
00958   * @param  Init       OSPI Init structure
00959   * @retval BSP status
00960   */
00961 int32_t BSP_OSPI_RAM_Init(uint32_t Instance, BSP_OSPI_RAM_Init_t *Init)
00962 {
00963   int32_t ret;
00964   MX_OSPI_InitTypeDef ospi_init;
00965
00966   /* Check if the instance is supported */
00967   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
00968   {
00969     ret = BSP_ERROR_WRONG_PARAM;
00970   }
00971   else
00972   {
00973     /* Check if the instance is already initialized */
00974     if (Ospi_Ram_Ctx[Instance].IsInitialized == OSPI_ACCESS_NONE)
00975     {
00976 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 0)
00977       /* Msp OSPI initialization */
00978       OSPI_RAM_MspInit(&hospi_ram[Instance]);
00979 #else
00980       /* Register the OSPI MSP Callbacks */
00981       if(Ospi_Ram_Ctx[Instance].IsMspCallbacksValid == 0UL)
00982       {
00983         if(BSP_OSPI_RAM_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
00984         {
00985           return BSP_ERROR_PERIPH_FAILURE;
00986         }
00987       }
00988 #endif /* USE_HAL_OSPI_REGISTER_CALLBACKS */
00989
00990       /* Fill config structure */
00991       ospi_init.ClockPrescaler = 2U; /* OctoSPI clock = 200 MHz / ClockPrescaler = 100 MHz */
00992       ospi_init.MemorySize     = (uint32_t)POSITION_VAL(S70KL1281_RAM_SIZE);
00993       ospi_init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
00994
00995       /* STM32 OSPI Clock configuration */
00996       if (MX_OSPI_ClockConfig(&hospi_ram[Instance]) != HAL_OK)
00997       {
00998         ret = BSP_ERROR_PERIPH_FAILURE;
00999       }
01000       /* STM32 OSPI interface initialization */
01001       else if (MX_OSPI_RAM_Init(&hospi_ram[Instance], &ospi_init) != HAL_OK)
01002       {
01003         ret = BSP_ERROR_PERIPH_FAILURE;
01004       }
01005       /* Configure the memory */
01006       else if (BSP_OSPI_RAM_ConfigHyperRAM(Instance, Init->LatencyType, Init->BurstType, Init->BurstLength) != BSP_ERROR_NONE)
01007       {
01008         ret = BSP_ERROR_COMPONENT_FAILURE;
01009       }
01010       else
01011       {
01012         ret = BSP_ERROR_NONE;
01013       }
01014     }
01015     else
01016     {
01017       ret = BSP_ERROR_NONE;
01018     }
01019   }
01020
01021   /* Return BSP status */
01022   return ret;
01023 }
01024
01025 /**
01026   * @brief  De-Initializes the OSPI interface.
01027   * @param  Instance   OSPI Instance
01028   * @retval BSP status
01029   */
01030 int32_t BSP_OSPI_RAM_DeInit(uint32_t Instance)
01031 {
01032   int32_t ret = BSP_ERROR_NONE;
01033
01034   /* Check if the instance is supported */
01035   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01036   {
01037     ret = BSP_ERROR_WRONG_PARAM;
01038   }
01039   else
01040   {
01041     /* Check if the instance is already initialized */
01042     if (Ospi_Ram_Ctx[Instance].IsInitialized != OSPI_ACCESS_NONE)
01043     {
01044       /* Disable Memory mapped mode */
01045       if(Ospi_Ram_Ctx[Instance].IsInitialized == OSPI_ACCESS_MMP)
01046       {
01047         if(BSP_OSPI_RAM_DisableMemoryMappedMode(Instance) != BSP_ERROR_NONE)
01048         {
01049           return BSP_ERROR_COMPONENT_FAILURE;
01050         }
01051       }
01052
01053       /* Set default Ospi_Ram_Ctx values */
01054       Ospi_Ram_Ctx[Instance].IsInitialized = OSPI_ACCESS_NONE;
01055       Ospi_Ram_Ctx[Instance].LatencyType   = BSP_OSPI_RAM_FIXED_LATENCY;
01056       Ospi_Ram_Ctx[Instance].BurstType     = BSP_OSPI_RAM_LINEAR_BURST;
01057       Ospi_Ram_Ctx[Instance].BurstLength   = BSP_OSPI_RAM_BURST_32_BYTES;
01058
01059 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 0)
01060       OSPI_RAM_MspDeInit(&hospi_ram[Instance]);
01061 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 0) */
01062
01063       /* Call the DeInit function to reset the driver */
01064       if (HAL_OSPI_DeInit(&hospi_ram[Instance]) != HAL_OK)
01065       {
01066         ret = BSP_ERROR_PERIPH_FAILURE;
01067       }
01068     }
01069   }
01070
01071   /* Return BSP status */
01072   return ret;
01073 }
01074
01075 /**
01076   * @brief  OSPI Clock Config for OSPI Memories .
01077   * @param  hospi  OSPI Handle
01078   *         Being __weak it can be overwritten by the application
01079   * @retval HAL_status
01080   */
01081 __weak HAL_StatusTypeDef MX_OSPI_ClockConfig(OSPI_HandleTypeDef *hospi)
01082 {
01083   RCC_PeriphCLKInitTypeDef  PeriphClkInitStruct;
01084
01085   /* HyperRAM clock configuration */
01086   /* OSPI clock configuration */
01087   /* PLL2_VCO Input = HSE_VALUE/PLL3M = 5 Mhz */
01088   /* PLL2_VCO Output = PLL2_VCO Input * PLL3N = 400 Mhz */
01089   /* PLLOSPICLK = PLL2_VCO Output/PLL2R = 400/2 = 200 Mhz */
01090   /* OSPI clock frequency = PLLOSPICLK = 200 Mhz */
01091   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_OSPI ;
01092   PeriphClkInitStruct.OspiClockSelection = RCC_OSPICLKSOURCE_PLL2;
01093   PeriphClkInitStruct.PLL2.PLL2M = 5;
01094   PeriphClkInitStruct.PLL2.PLL2N = 80;
01095   PeriphClkInitStruct.PLL2.PLL2P = 5;
01096   PeriphClkInitStruct.PLL2.PLL2Q = 2;
01097   PeriphClkInitStruct.PLL2.PLL2R = 2;
01098   PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
01099   PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOWIDE;
01100   PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0;
01101
01102   return HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
01103 }
01104
01105 /**
01106   * @brief  Initializes the OSPI interface.
01107   * @param  hospi          OSPI handle
01108   * @param  Init           OSPI config structure
01109   * @retval BSP status
01110   */
01111 __weak HAL_StatusTypeDef MX_OSPI_RAM_Init(OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init)
01112 {
01113   OSPI_HyperbusCfgTypeDef sHyperbusCfg;
01114   HAL_StatusTypeDef status;
01115
01116   hospi->Instance = OCTOSPI2;
01117   HAL_OSPI_DeInit(hospi);
01118
01119   hospi->Init.FifoThreshold         = 4;
01120   hospi->Init.DualQuad              = HAL_OSPI_DUALQUAD_DISABLE;
01121   hospi->Init.MemoryType            = HAL_OSPI_MEMTYPE_HYPERBUS;
01122   hospi->Init.DeviceSize            = Init->MemorySize;
01123   hospi->Init.ChipSelectHighTime    = 4;
01124   hospi->Init.FreeRunningClock      = HAL_OSPI_FREERUNCLK_DISABLE;
01125   hospi->Init.ClockMode             = HAL_OSPI_CLOCK_MODE_0;
01126   hospi->Init.WrapSize              = HAL_OSPI_WRAP_NOT_SUPPORTED;
01127   hospi->Init.ClockPrescaler        = Init->ClockPrescaler;
01128   hospi->Init.SampleShifting        = Init->SampleShifting;
01129   hospi->Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE;
01130   hospi->Init.Refresh               = 400; /*4us @100MHz*/
01131   hospi->Init.ChipSelectBoundary    = 23;  /* memory die boundary 2^23=8MBs*/
01132
01133   status = HAL_OSPI_Init(hospi);
01134   if (status == HAL_OK)
01135   {
01136     sHyperbusCfg.RWRecoveryTime   = RW_RECOVERY_TIME;
01137     sHyperbusCfg.AccessTime       = DEFAULT_INITIAL_LATENCY;
01138     sHyperbusCfg.WriteZeroLatency = HAL_OSPI_LATENCY_ON_WRITE;
01139     sHyperbusCfg.LatencyMode      = HAL_OSPI_FIXED_LATENCY;
01140
01141     status = HAL_OSPI_HyperbusCfg(hospi, &sHyperbusCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE);
01142   }
01143
01144   return status;
01145 }
01146
01147 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
01148 /**
01149   * @brief Default BSP OSPI Msp Callbacks
01150   * @param Instance      OSPI Instance
01151   * @retval BSP status
01152   */
01153 int32_t BSP_OSPI_RAM_RegisterDefaultMspCallbacks (uint32_t Instance)
01154 {
01155   int32_t ret = BSP_ERROR_NONE;
01156
01157   /* Check if the instance is supported */
01158   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01159   {
01160     ret = BSP_ERROR_WRONG_PARAM;
01161   }
01162   else
01163   {
01164     /* Register MspInit/MspDeInit Callbacks */
01165     if(HAL_OSPI_RegisterCallback(&hospi_ram[Instance], HAL_OSPI_MSP_INIT_CB_ID, OSPI_RAM_MspInit) != HAL_OK)
01166     {
01167       ret = BSP_ERROR_PERIPH_FAILURE;
01168     }
01169     else if(HAL_OSPI_RegisterCallback(&hospi_ram[Instance], HAL_OSPI_MSP_DEINIT_CB_ID, OSPI_RAM_MspDeInit) != HAL_OK)
01170     {
01171       ret = BSP_ERROR_PERIPH_FAILURE;
01172     }
01173     else
01174     {
01175       Ospi_Ram_Ctx[Instance].IsMspCallbacksValid = 1U;
01176     }
01177   }
01178
01179   /* Return BSP status */
01180   return ret;
01181 }
01182
01183 /**
01184   * @brief BSP OSPI Msp Callback registering
01185   * @param Instance     OSPI Instance
01186   * @param CallBacks    pointer to MspInit/MspDeInit callbacks functions
01187   * @retval BSP status
01188   */
01189 int32_t BSP_OSPI_RAM_RegisterMspCallbacks (uint32_t Instance, BSP_OSPI_Cb_t *CallBacks)
01190 {
01191   int32_t ret = BSP_ERROR_NONE;
01192
01193   /* Check if the instance is supported */
01194   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01195   {
01196     ret = BSP_ERROR_WRONG_PARAM;
01197   }
01198   else
01199   {
01200     /* Register MspInit/MspDeInit Callbacks */
01201     if(HAL_OSPI_RegisterCallback(&hospi_ram[Instance], HAL_OSPI_MSP_INIT_CB_ID, CallBacks->pMspInitCb) != HAL_OK)
01202     {
01203       ret = BSP_ERROR_PERIPH_FAILURE;
01204     }
01205     else if(HAL_OSPI_RegisterCallback(&hospi_ram[Instance], HAL_OSPI_MSP_DEINIT_CB_ID, CallBacks->pMspDeInitCb) != HAL_OK)
01206     {
01207       ret = BSP_ERROR_PERIPH_FAILURE;
01208     }
01209     else
01210     {
01211       Ospi_Ram_Ctx[Instance].IsMspCallbacksValid = 1U;
01212     }
01213   }
01214
01215   /* Return BSP status */
01216   return ret;
01217 }
01218 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 1) */
01219
01220 /**
01221   * @brief  Reads an amount of data from the HyperRAM memory.
01222   * @param  Instance  OSPI instance
01223   * @param  pData     Pointer to data to be read
01224   * @param  ReadAddr  Read start address
01225   * @param  Size      Size of data to read
01226   * @retval BSP status
01227   */
01228 int32_t BSP_OSPI_RAM_Read(uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
01229 {
01230   int32_t ret;
01231
01232   /* Check if the instance is supported */
01233   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01234   {
01235     ret = BSP_ERROR_WRONG_PARAM;
01236   }
01237   else
01238   {
01239     if(S70KL1281_Read(&hospi_ram[Instance], pData, ReadAddr, Size) != S70KL1281_OK)
01240     {
01241       ret = BSP_ERROR_COMPONENT_FAILURE;
01242     }
01243     else
01244     {
01245       ret = BSP_ERROR_NONE;
01246     }
01247   }
01248
01249   /* Return BSP status */
01250   return ret;
01251 }
01252
01253 /**
01254   * @brief  Reads an amount of data from the HyperRAM memory in DMA mode.
01255   * @param  Instance  OSPI instance
01256   * @param  pData     Pointer to data to be read
01257   * @param  ReadAddr  Read start address
01258   * @param  Size      Size of data to read
01259   * @retval BSP status
01260   */
01261 int32_t BSP_OSPI_RAM_Read_DMA(uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
01262 {
01263   int32_t ret;
01264
01265   /* Check if the instance is supported */
01266   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01267   {
01268     ret = BSP_ERROR_WRONG_PARAM;
01269   }
01270   else
01271   {
01272     if(S70KL1281_Read_DMA(&hospi_ram[Instance], pData, ReadAddr, Size) != S70KL1281_OK)
01273     {
01274       ret = BSP_ERROR_COMPONENT_FAILURE;
01275     }
01276     else
01277     {
01278       ret = BSP_ERROR_NONE;
01279     }
01280   }
01281
01282   /* Return BSP status */
01283   return ret;
01284 }
01285
01286 /**
01287   * @brief  Writes an amount of data to the HyperRAM memory.
01288   * @param  Instance  OSPI instance
01289   * @param  pData     Pointer to data to be written
01290   * @param  WriteAddr Write start address
01291   * @param  Size      Size of data to write
01292   * @retval BSP status
01293   */
01294 int32_t BSP_OSPI_RAM_Write(uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
01295 {
01296   int32_t ret;
01297
01298   /* Check if the instance is supported */
01299   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01300   {
01301     ret = BSP_ERROR_WRONG_PARAM;
01302   }
01303   else
01304   {
01305     if(S70KL1281_Write(&hospi_ram[Instance], pData, WriteAddr, Size) != S70KL1281_OK)
01306     {
01307       ret = BSP_ERROR_COMPONENT_FAILURE;
01308     }
01309     else
01310     {
01311       ret = BSP_ERROR_NONE;
01312     }
01313   }
01314
01315   /* Return BSP status */
01316   return ret;
01317 }
01318
01319 /**
01320   * @brief  Writes an amount of data to the HyperRAM memory in DMA mode.
01321   * @param  Instance  OSPI instance
01322   * @param  pData     Pointer to data to be written
01323   * @param  WriteAddr Write start address
01324   * @param  Size      Size of data to write
01325   * @retval BSP status
01326   */
01327 int32_t BSP_OSPI_RAM_Write_DMA(uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
01328 {
01329   int32_t ret;
01330
01331   /* Check if the instance is supported */
01332   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01333   {
01334     ret = BSP_ERROR_WRONG_PARAM;
01335   }
01336   else
01337   {
01338     if(S70KL1281_Write_DMA(&hospi_ram[Instance], pData, WriteAddr, Size) != S70KL1281_OK)
01339     {
01340       ret = BSP_ERROR_COMPONENT_FAILURE;
01341     }
01342     else
01343     {
01344       ret = BSP_ERROR_NONE;
01345     }
01346   }
01347
01348   /* Return BSP status */
01349   return ret;
01350 }
01351
01352 /**
01353   * @brief  Configure the OSPI in memory-mapped mode
01354   * @param  Instance  OSPI instance
01355   * @retval BSP status
01356   */
01357 int32_t BSP_OSPI_RAM_EnableMemoryMappedMode(uint32_t Instance)
01358 {
01359   int32_t ret = BSP_ERROR_NONE;
01360
01361   /* Check if the instance is supported */
01362   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01363   {
01364     ret = BSP_ERROR_WRONG_PARAM;
01365   }
01366   else
01367   {
01368     if(S70KL1281_EnableMemoryMappedMode(&hospi_ram[Instance]) != S70KL1281_OK)
01369     {
01370       ret = BSP_ERROR_COMPONENT_FAILURE;
01371     }
01372     else /* Update OSPI context if all operations are well done */
01373     {
01374       Ospi_Ram_Ctx[Instance].IsInitialized = OSPI_ACCESS_MMP;
01375     }
01376   }
01377
01378   /* Return BSP status */
01379   return ret;
01380 }
01381
01382 /**
01383   * @brief  Exit form memory-mapped mode
01384   *         Only 1 Instance can running MMP mode. And it will lock system at this mode.
01385   * @param  Instance  OSPI instance
01386   * @retval BSP status
01387   */
01388 int32_t BSP_OSPI_RAM_DisableMemoryMappedMode(uint32_t Instance)
01389 {
01390   int32_t ret = BSP_ERROR_NONE;
01391
01392   /* Check if the instance is supported */
01393   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01394   {
01395     ret = BSP_ERROR_WRONG_PARAM;
01396   }
01397   else
01398   {
01399     if(Ospi_Ram_Ctx[Instance].IsInitialized != OSPI_ACCESS_MMP)
01400     {
01401       ret = BSP_ERROR_OSPI_MMP_UNLOCK_FAILURE;
01402     }
01403     /* Abort MMP back to indirect mode */
01404     else if(HAL_OSPI_Abort(&hospi_ram[Instance]) != HAL_OK)
01405     {
01406       ret = BSP_ERROR_PERIPH_FAILURE;
01407     }
01408     /* Update OSPI HyperRAM context if all operations are well done */
01409     else
01410     {
01411       Ospi_Ram_Ctx[Instance].IsInitialized = OSPI_ACCESS_INDIRECT;
01412     }
01413   }
01414
01415   /* Return BSP status */
01416   return ret;
01417 }
01418
01419 /**
01420   * @brief  Set HyperRAM to desired configuration. And this instance becomes current instance.
01421   *         If current instance running at MMP mode then this function doesn't work.
01422   *         Indirect -> Indirect
01423   * @param  Instance    OSPI instance
01424   * @param  Latency     OSPI latency mode
01425   * @param  BurstType   OSPI burst type
01426   * @param  BurstLength OSPI burst length
01427   * @retval BSP status
01428   */
01429 int32_t BSP_OSPI_RAM_ConfigHyperRAM(uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength)
01430 {
01431   OSPI_HyperbusCfgTypeDef sHyperbusCfg;
01432   int32_t ret = BSP_ERROR_NONE;
01433   uint32_t initial_latency, latency_mode;
01434   uint16_t reg;
01435
01436   /* Check if the instance is supported */
01437   if(Instance >= OSPI_RAM_INSTANCES_NUMBER)
01438   {
01439     ret = BSP_ERROR_WRONG_PARAM;
01440   }
01441   else
01442   {
01443     /* Check if MMP mode locked ***********************************************/
01444     if(Ospi_Ram_Ctx[Instance].IsInitialized == OSPI_ACCESS_MMP)
01445     {
01446       ret = BSP_ERROR_OSPI_MMP_LOCK_FAILURE;
01447     }
01448     else if((Ospi_Ram_Ctx[Instance].IsInitialized == OSPI_ACCESS_NONE) ||
01449             (Ospi_Ram_Ctx[Instance].LatencyType   != Latency)              ||
01450             (Ospi_Ram_Ctx[Instance].BurstType     != BurstType)            ||
01451             (Ospi_Ram_Ctx[Instance].BurstLength   != BurstLength))
01452     {
01453       /* Reading the configuration of the HyperRAM ****************************/
01454       if(S70KL1281_ReadCfgReg0(&hospi_ram[Instance], &reg) != S70KL1281_OK)
01455       {
01456         ret = BSP_ERROR_COMPONENT_FAILURE;
01457       }
01458       else
01459       {
01460         /* Configure the HyperRAM memory **************************************/
01461         /* Initial latency */
01462         if(Ospi_Ram_Ctx[Instance].IsInitialized == OSPI_ACCESS_NONE)
01463         {
01464           initial_latency = DEFAULT_INITIAL_LATENCY;
01465           latency_mode = HAL_OSPI_FIXED_LATENCY;
01466         }
01467         else
01468         {
01469           ret = BSP_ERROR_WRONG_PARAM;
01470         }
01471
01472         /* check Latency Type */
01473         if (Latency != BSP_OSPI_RAM_FIXED_LATENCY)
01474         {
01475           ret = BSP_ERROR_WRONG_PARAM;
01476         }
01477
01478         /* Burst type */
01479         if (BurstType == BSP_OSPI_RAM_HYBRID_BURST)
01480         {
01481           CLEAR_BIT(reg, S70KL1281_CR0_HBE);
01482         }
01483         else
01484         {
01485           SET_BIT(reg, S70KL1281_CR0_HBE);
01486         }
01487
01488         /* Burst length */
01489         MODIFY_REG(reg, (uint16_t) S70KL1281_CR0_BLENGTH, (uint16_t) BurstLength);
01490
01491         if (S70KL1281_WriteCfgReg0(&hospi_ram[Instance], reg, latency_mode, initial_latency) != S70KL1281_OK)
01492         {
01493           ret = BSP_ERROR_COMPONENT_FAILURE;
01494         }
01495         else
01496         {
01497           /* Configure the peripheral *****************************************/
01498           if (BurstType == BSP_OSPI_RAM_HYBRID_BURST)
01499           {
01500             switch (BurstLength)
01501             {
01502             case BSP_OSPI_RAM_BURST_16_BYTES :
01503               hospi_ram[Instance].Init.WrapSize = HAL_OSPI_WRAP_16_BYTES;
01504               break;
01505             case BSP_OSPI_RAM_BURST_32_BYTES :
01506               hospi_ram[Instance].Init.WrapSize = HAL_OSPI_WRAP_32_BYTES;
01507               break;
01508             case BSP_OSPI_RAM_BURST_64_BYTES :
01509               hospi_ram[Instance].Init.WrapSize = HAL_OSPI_WRAP_64_BYTES;
01510               break;
01511             case BSP_OSPI_RAM_BURST_128_BYTES :
01512               hospi_ram[Instance].Init.WrapSize = HAL_OSPI_WRAP_128_BYTES;
01513               break;
01514             default :
01515               break;
01516             }
01517           }
01518           else
01519           {
01520             hospi_ram[Instance].Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;
01521           }
01522           if (HAL_OSPI_Init(&hospi_ram[Instance]) != HAL_OK)
01523           {
01524             ret = BSP_ERROR_PERIPH_FAILURE;
01525           }
01526           else
01527           {
01528             sHyperbusCfg.RWRecoveryTime   = RW_RECOVERY_TIME;
01529             sHyperbusCfg.AccessTime       = DEFAULT_INITIAL_LATENCY;
01530             sHyperbusCfg.WriteZeroLatency = HAL_OSPI_LATENCY_ON_WRITE;
01531             sHyperbusCfg.LatencyMode      = HAL_OSPI_FIXED_LATENCY;
01532
01533             if (HAL_OSPI_HyperbusCfg(&hospi_ram[Instance], &sHyperbusCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01534             {
01535               ret = BSP_ERROR_PERIPH_FAILURE;
01536             }
01537           }
01538         }
01539       }
01540
01541       /* Update OSPI context if all operations are well done */
01542       if(ret == BSP_ERROR_NONE)
01543       {
01544         /* Update current status parameter *****************************************/
01545         Ospi_Ram_Ctx[Instance].IsInitialized = OSPI_ACCESS_INDIRECT;
01546         Ospi_Ram_Ctx[Instance].LatencyType   = BSP_OSPI_RAM_FIXED_LATENCY;
01547         Ospi_Ram_Ctx[Instance].BurstType     = BurstType;
01548         Ospi_Ram_Ctx[Instance].BurstLength   = BurstLength;
01549       }
01550     }
01551     else
01552     {
01553       /* Nothing to do */
01554     }
01555   }
01556
01557   /* Return BSP status */
01558   return ret;
01559 }
01560
01561 /**
01562   * @brief  Handles OctoSPI HyperRAM DMA transfer interrupt request.
01563   * @param  Instance OSPI instance
01564   * @retval None
01565   */
01566 void BSP_OSPI_RAM_DMA_IRQHandler(uint32_t Instance)
01567 {
01568   HAL_MDMA_IRQHandler(hospi_ram[Instance].hmdma);
01569 }
01570
01571 /**
01572   * @brief  Handles OctoSPI HyperRAM interrupt request.
01573   * @param  Instance OSPI instance
01574   * @retval None
01575   */
01576 void BSP_OSPI_RAM_IRQHandler(uint32_t Instance)
01577 {
01578   HAL_OSPI_IRQHandler(&hospi_ram[Instance]);
01579 }
01580 /**
01581   * @}
01582   */
01583
01584 /** @addtogroup STM32H735G_DKVERY_OSPI_NOR_Private_Functions
01585   * @{
01586   */
01587
01588 /**
01589   * @brief  Initializes the OSPI MSP.
01590   * @param  hospi OSPI handle
01591   * @retval None
01592   */
01593 static void OSPI_NOR_MspInit(OSPI_HandleTypeDef *hospi)
01594 {
01595   GPIO_InitTypeDef GPIO_InitStruct;
01596
01597   /* hospi unused argument(s) compilation warning */
01598   UNUSED(hospi);
01599
01600   /* Enable the OctoSPI memory interface clock */
01601   OSPI_NOR_CLK_ENABLE();
01602
01603   /* Reset the OctoSPI memory interface */
01604   OSPI_NOR_FORCE_RESET();
01605   OSPI_NOR_RELEASE_RESET();
01606
01607   /* Enable GPIO clocks */
01608   OSPI_NOR_CLK_GPIO_CLK_ENABLE();
01609   OSPI_NOR_DQS_GPIO_CLK_ENABLE();
01610   OSPI_NOR_CS_GPIO_CLK_ENABLE();
01611   OSPI_NOR_D0_GPIO_CLK_ENABLE();
01612   OSPI_NOR_D1_GPIO_CLK_ENABLE();
01613   OSPI_NOR_D2_GPIO_CLK_ENABLE();
01614   OSPI_NOR_D3_GPIO_CLK_ENABLE();
01615   OSPI_NOR_D4_GPIO_CLK_ENABLE();
01616   OSPI_NOR_D5_GPIO_CLK_ENABLE();
01617   OSPI_NOR_D6_GPIO_CLK_ENABLE();
01618   OSPI_NOR_D7_GPIO_CLK_ENABLE();
01619
01620   /* OctoSPI CS GPIO pin configuration  */
01621   GPIO_InitStruct.Pin       = OSPI_NOR_CS_PIN;
01622   GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
01623   GPIO_InitStruct.Pull      = GPIO_PULLUP;
01624   GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01625   GPIO_InitStruct.Alternate = OSPI_NOR_CS_PIN_AF;
01626   HAL_GPIO_Init(OSPI_NOR_CS_GPIO_PORT, &GPIO_InitStruct);
01627
01628   /* OctoSPI DQS GPIO pin configuration  */
01629   GPIO_InitStruct.Pin       = OSPI_NOR_DQS_PIN;
01630   GPIO_InitStruct.Pull      = GPIO_NOPULL;
01631   GPIO_InitStruct.Alternate = OSPI_NOR_DQS_PIN_AF;
01632   HAL_GPIO_Init(OSPI_NOR_DQS_GPIO_PORT, &GPIO_InitStruct);
01633
01634   /* OctoSPI CLK GPIO pin configuration  */
01635   GPIO_InitStruct.Pin       = OSPI_NOR_CLK_PIN;
01636   GPIO_InitStruct.Pull      = GPIO_NOPULL;
01637   GPIO_InitStruct.Alternate = OSPI_NOR_CLK_PIN_AF;
01638   HAL_GPIO_Init(OSPI_NOR_CLK_GPIO_PORT, &GPIO_InitStruct);
01639
01640   /* OctoSPI D0 GPIO pin configuration  */
01641   GPIO_InitStruct.Pin       = OSPI_NOR_D0_PIN;
01642   GPIO_InitStruct.Alternate = OSPI_NOR_D0_PIN_AF;
01643   HAL_GPIO_Init(OSPI_NOR_D0_GPIO_PORT, &GPIO_InitStruct);
01644
01645   /* OctoSPI D1 GPIO pin configuration  */
01646   GPIO_InitStruct.Pin       = OSPI_NOR_D1_PIN;
01647   GPIO_InitStruct.Alternate = OSPI_NOR_D1_PIN_AF;
01648   HAL_GPIO_Init(OSPI_NOR_D1_GPIO_PORT, &GPIO_InitStruct);
01649
01650   /* OctoSPI D2 GPIO pin configuration  */
01651   GPIO_InitStruct.Pin       = OSPI_NOR_D2_PIN;
01652   GPIO_InitStruct.Alternate = OSPI_NOR_D2_PIN_AF;
01653   HAL_GPIO_Init(OSPI_NOR_D2_GPIO_PORT, &GPIO_InitStruct);
01654
01655   /* OctoSPI D3 GPIO pin configuration  */
01656   GPIO_InitStruct.Pin       = OSPI_NOR_D3_PIN;
01657   GPIO_InitStruct.Alternate = OSPI_NOR_D3_PIN_AF;
01658   HAL_GPIO_Init(OSPI_NOR_D3_GPIO_PORT, &GPIO_InitStruct);
01659
01660   /* OctoSPI D4 GPIO pin configuration  */
01661   GPIO_InitStruct.Pin       = OSPI_NOR_D4_PIN;
01662   GPIO_InitStruct.Alternate = OSPI_NOR_D4_PIN_AF;
01663   HAL_GPIO_Init(OSPI_NOR_D4_GPIO_PORT, &GPIO_InitStruct);
01664
01665   /* OctoSPI D5 GPIO pin configuration  */
01666   GPIO_InitStruct.Pin       = OSPI_NOR_D5_PIN;
01667   GPIO_InitStruct.Alternate = OSPI_NOR_D5_PIN_AF;
01668   HAL_GPIO_Init(OSPI_NOR_D5_GPIO_PORT, &GPIO_InitStruct);
01669
01670   /* OctoSPI D6 GPIO pin configuration  */
01671   GPIO_InitStruct.Pin       = OSPI_NOR_D6_PIN;
01672   GPIO_InitStruct.Alternate = OSPI_NOR_D6_PIN_AF;
01673   HAL_GPIO_Init(OSPI_NOR_D6_GPIO_PORT, &GPIO_InitStruct);
01674
01675   /* OctoSPI D7 GPIO pin configuration  */
01676   GPIO_InitStruct.Pin       = OSPI_NOR_D7_PIN;
01677   GPIO_InitStruct.Alternate = OSPI_NOR_D7_PIN_AF;
01678   HAL_GPIO_Init(OSPI_NOR_D7_GPIO_PORT, &GPIO_InitStruct);
01679 }
01680
01681 /**
01682   * @brief  De-Initializes the OSPI MSP.
01683   * @param  hospi OSPI handle
01684   * @retval None
01685   */
01686 static void OSPI_NOR_MspDeInit(OSPI_HandleTypeDef *hospi)
01687 {
01688   /* hospi unused argument(s) compilation warning */
01689   UNUSED(hospi);
01690
01691   /* OctoSPI GPIO pins de-configuration  */
01692   HAL_GPIO_DeInit(OSPI_NOR_CLK_GPIO_PORT, OSPI_NOR_CLK_PIN);
01693   HAL_GPIO_DeInit(OSPI_NOR_DQS_GPIO_PORT, OSPI_NOR_DQS_PIN);
01694   HAL_GPIO_DeInit(OSPI_NOR_CS_GPIO_PORT, OSPI_NOR_CS_PIN);
01695   HAL_GPIO_DeInit(OSPI_NOR_D0_GPIO_PORT, OSPI_NOR_D0_PIN);
01696   HAL_GPIO_DeInit(OSPI_NOR_D1_GPIO_PORT, OSPI_NOR_D1_PIN);
01697   HAL_GPIO_DeInit(OSPI_NOR_D2_GPIO_PORT, OSPI_NOR_D2_PIN);
01698   HAL_GPIO_DeInit(OSPI_NOR_D3_GPIO_PORT, OSPI_NOR_D3_PIN);
01699   HAL_GPIO_DeInit(OSPI_NOR_D4_GPIO_PORT, OSPI_NOR_D4_PIN);
01700   HAL_GPIO_DeInit(OSPI_NOR_D5_GPIO_PORT, OSPI_NOR_D5_PIN);
01701   HAL_GPIO_DeInit(OSPI_NOR_D6_GPIO_PORT, OSPI_NOR_D6_PIN);
01702   HAL_GPIO_DeInit(OSPI_NOR_D7_GPIO_PORT, OSPI_NOR_D7_PIN);
01703
01704   /* Reset the OctoSPI memory interface */
01705   OSPI_NOR_FORCE_RESET();
01706   OSPI_NOR_RELEASE_RESET();
01707
01708   /* Disable the OctoSPI memory interface clock */
01709   OSPI_NOR_CLK_DISABLE();
01710 }
01711
01712 /**
01713   * @brief  This function reset the OSPI memory.
01714   * @param  Instance  OSPI instance
01715   * @retval BSP status
01716   */
01717 static int32_t OSPI_NOR_ResetMemory (uint32_t Instance)
01718 {
01719   int32_t ret = BSP_ERROR_NONE;
01720
01721   /* Check if the instance is supported */
01722   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
01723   {
01724     ret = BSP_ERROR_WRONG_PARAM;
01725   }
01726   else if(MX25LM51245G_ResetEnable(&hospi_nor[Instance], BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01727   {
01728     ret = BSP_ERROR_COMPONENT_FAILURE;
01729   }
01730   else if(MX25LM51245G_ResetMemory(&hospi_nor[Instance], BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01731   {
01732     ret = BSP_ERROR_COMPONENT_FAILURE;
01733   }
01734   else if(MX25LM51245G_ResetEnable(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01735   {
01736     ret = BSP_ERROR_COMPONENT_FAILURE;
01737   }
01738   else if(MX25LM51245G_ResetMemory(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01739   {
01740     ret = BSP_ERROR_COMPONENT_FAILURE;
01741   }
01742   else if(MX25LM51245G_ResetEnable(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_DTR_TRANSFER) != MX25LM51245G_OK)
01743   {
01744     ret = BSP_ERROR_COMPONENT_FAILURE;
01745   }
01746   else if(MX25LM51245G_ResetMemory(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_DTR_TRANSFER) != MX25LM51245G_OK)
01747   {
01748     ret = BSP_ERROR_COMPONENT_FAILURE;
01749   }
01750   else
01751   {
01752     Ospi_Nor_Ctx[Instance].IsInitialized = OSPI_ACCESS_INDIRECT;      /* After reset S/W setting to indirect access   */
01753     Ospi_Nor_Ctx[Instance].InterfaceMode = BSP_OSPI_NOR_SPI_MODE;         /* After reset H/W back to SPI mode by default  */
01754     Ospi_Nor_Ctx[Instance].TransferRate  = BSP_OSPI_NOR_STR_TRANSFER;     /* After reset S/W setting to STR mode          */
01755
01756     /* After SWreset CMD, wait in case SWReset occurred during erase operation */
01757     HAL_Delay(MX25LM51245G_RESET_MAX_TIME);
01758   }
01759
01760   /* Return BSP status */
01761   return ret;
01762 }
01763
01764 /**
01765   * @brief  This function enables the octal DTR mode of the memory.
01766   * @param  Instance  OSPI instance
01767   * @retval BSP status
01768   */
01769 static int32_t OSPI_NOR_EnterDOPIMode(uint32_t Instance)
01770 {
01771   int32_t ret = BSP_ERROR_NONE;
01772   uint8_t reg[2];
01773
01774   /* Check if the instance is supported */
01775   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
01776   {
01777     ret = BSP_ERROR_WRONG_PARAM;
01778   }
01779   /* Enable write operations */
01780   else if (MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
01781   {
01782     ret = BSP_ERROR_COMPONENT_FAILURE;
01783   }
01784   /* Write Configuration register 2 (with new dummy cycles) */
01785   else if (MX25LM51245G_WriteCfg2Register(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_CR2_REG3_ADDR, CONF_OSPI_DUMMY_CYCLES) != MX25LM51245G_OK)
01786   {
01787     ret = BSP_ERROR_COMPONENT_FAILURE;
01788   }
01789   /* Enable write operations */
01790   else if (MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
01791   {
01792     ret = BSP_ERROR_COMPONENT_FAILURE;
01793   }
01794   /* Write Configuration register 2 (with Octal I/O SPI protocol) */
01795   else if (MX25LM51245G_WriteCfg2Register(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_CR2_REG1_ADDR, MX25LM51245G_CR2_DOPI) != MX25LM51245G_OK)
01796   {
01797     ret = BSP_ERROR_COMPONENT_FAILURE;
01798   }
01799   else
01800   {
01801     /* Wait that the configuration is effective and check that memory is ready */
01802     HAL_Delay(MX25LM51245G_WRITE_REG_MAX_TIME);
01803
01804     /* Reconfigure the memory type of the peripheral */
01805     hospi_nor[Instance].Init.MemoryType            = HAL_OSPI_MEMTYPE_MACRONIX;
01806     hospi_nor[Instance].Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE;
01807     if (HAL_OSPI_Init(&hospi_nor[Instance]) != HAL_OK)
01808     {
01809       ret = BSP_ERROR_PERIPH_FAILURE;
01810     }
01811     /* Check Flash busy ? */
01812     else if (MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_DTR_TRANSFER) != MX25LM51245G_OK)
01813     {
01814       ret = BSP_ERROR_COMPONENT_FAILURE;
01815     }
01816     /* Check the configuration has been correctly done */
01817     else if (MX25LM51245G_ReadCfg2Register(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_DTR_TRANSFER, MX25LM51245G_CR2_REG1_ADDR, reg) != MX25LM51245G_OK)
01818     {
01819       ret = BSP_ERROR_COMPONENT_FAILURE;
01820     }
01821     else if (reg[0] != MX25LM51245G_CR2_DOPI)
01822     {
01823       ret = BSP_ERROR_COMPONENT_FAILURE;
01824     }
01825     else
01826     {
01827       ret = BSP_ERROR_NONE;
01828     }
01829   }
01830
01831   /* Return BSP status */
01832   return ret;
01833 }
01834
01835 /**
01836   * @brief  This function enables the octal STR mode of the memory.
01837   * @param  Instance  OSPI instance
01838   * @retval BSP status
01839   */
01840 static int32_t OSPI_NOR_EnterSOPIMode(uint32_t Instance)
01841 {
01842   int32_t ret = BSP_ERROR_NONE;
01843   uint8_t reg[2];
01844
01845   /* Check if the instance is supported */
01846   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
01847   {
01848     ret = BSP_ERROR_WRONG_PARAM;
01849   }
01850   /* Enable write operations */
01851   else if (MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
01852   {
01853     ret = BSP_ERROR_COMPONENT_FAILURE;
01854   }
01855   /* Write Configuration register 2 (with new dummy cycles) */
01856   else if (MX25LM51245G_WriteCfg2Register(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_CR2_REG3_ADDR, CONF_OSPI_DUMMY_CYCLES) != MX25LM51245G_OK)
01857   {
01858     ret = BSP_ERROR_COMPONENT_FAILURE;
01859   }
01860   /* Enable write operations */
01861   else if (MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
01862   {
01863     ret = BSP_ERROR_COMPONENT_FAILURE;
01864   }
01865   /* Write Configuration register 2 (with Octal I/O SPI protocol) */
01866   else if (MX25LM51245G_WriteCfg2Register(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_CR2_REG1_ADDR, MX25LM51245G_CR2_SOPI) != MX25LM51245G_OK)
01867   {
01868     ret = BSP_ERROR_COMPONENT_FAILURE;
01869   }
01870   else
01871   {
01872     /* Wait that the configuration is effective and check that memory is ready */
01873     HAL_Delay(MX25LM51245G_WRITE_REG_MAX_TIME);
01874
01875     /* Check Flash busy ? */
01876     if (MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01877     {
01878       ret = BSP_ERROR_COMPONENT_FAILURE;
01879     }
01880     /* Check the configuration has been correctly done */
01881     else if (MX25LM51245G_ReadCfg2Register(&hospi_nor[Instance], BSP_OSPI_NOR_OPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, MX25LM51245G_CR2_REG1_ADDR, reg) != MX25LM51245G_OK)
01882     {
01883       ret = BSP_ERROR_COMPONENT_FAILURE;
01884     }
01885     else if (reg[0] != MX25LM51245G_CR2_SOPI)
01886     {
01887       ret = BSP_ERROR_COMPONENT_FAILURE;
01888     }
01889     else
01890     {
01891       ret = BSP_ERROR_NONE;
01892     }
01893   }
01894
01895   /* Return BSP status */
01896   return ret;
01897 }
01898
01899 /**
01900   * @brief  This function disables the octal DTR or STR mode of the memory.
01901   * @param  Instance  OSPI instance
01902   * @retval BSP status
01903   */
01904 static int32_t OSPI_NOR_ExitOPIMode (uint32_t Instance)
01905 {
01906   int32_t ret = BSP_ERROR_NONE;
01907   uint8_t reg[2];
01908
01909   /* Check if the instance is supported */
01910   if(Instance >= OSPI_NOR_INSTANCES_NUMBER)
01911   {
01912     ret = BSP_ERROR_WRONG_PARAM;
01913   }
01914   /* Enable write operations */
01915   else if (MX25LM51245G_WriteEnable(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate) != MX25LM51245G_OK)
01916   {
01917     ret = BSP_ERROR_COMPONENT_FAILURE;
01918   }
01919   else
01920   {
01921     /* Write Configuration register 2 (with SPI protocol) */
01922     reg[0] = 0;
01923     reg[1] = 0;
01924     if (MX25LM51245G_WriteCfg2Register(&hospi_nor[Instance], Ospi_Nor_Ctx[Instance].InterfaceMode, Ospi_Nor_Ctx[Instance].TransferRate, MX25LM51245G_CR2_REG1_ADDR, reg[0]) != MX25LM51245G_OK)
01925     {
01926       ret = BSP_ERROR_COMPONENT_FAILURE;
01927     }
01928     else
01929     {
01930       /* Wait that the configuration is effective and check that memory is ready */
01931       HAL_Delay(MX25LM51245G_WRITE_REG_MAX_TIME);
01932
01933       if (Ospi_Nor_Ctx[Instance].TransferRate == BSP_OSPI_NOR_DTR_TRANSFER)
01934       {
01935         /* Reconfigure the memory type of the peripheral */
01936         hospi_nor[Instance].Init.MemoryType            = HAL_OSPI_MEMTYPE_MICRON;
01937         hospi_nor[Instance].Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
01938         if (HAL_OSPI_Init(&hospi_nor[Instance]) != HAL_OK)
01939         {
01940           ret = BSP_ERROR_PERIPH_FAILURE;
01941         }
01942       }
01943
01944       /* Check Flash busy ? */
01945       if (MX25LM51245G_AutoPollingMemReady(&hospi_nor[Instance], BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER) != MX25LM51245G_OK)
01946       {
01947         ret = BSP_ERROR_COMPONENT_FAILURE;
01948       }
01949       /* Check the configuration has been correctly done */
01950       else if (MX25LM51245G_ReadCfg2Register(&hospi_nor[Instance], BSP_OSPI_NOR_SPI_MODE, BSP_OSPI_NOR_STR_TRANSFER, MX25LM51245G_CR2_REG1_ADDR, reg) != MX25LM51245G_OK)
01951       {
01952         ret = BSP_ERROR_COMPONENT_FAILURE;
01953       }
01954       else if (reg[0] != 0)
01955       {
01956         ret = BSP_ERROR_COMPONENT_FAILURE;
01957       }
01958       else
01959       {
01960         ret = BSP_ERROR_NONE;
01961       }
01962     }
01963   }
01964
01965   /* Return BSP status */
01966   return ret;
01967 }
01968
01969 /**
01970   * @}
01971   */
01972
01973 /** @defgroup STM32H735G_DKVERY_OSPI_RAM_Private_Functions OSPI_RAM Private Functions
01974   * @{
01975   */
01976
01977 /**
01978   * @brief  Initializes the OSPI MSP.
01979   * @param  hospi OSPI handle
01980   * @retval None
01981   */
01982 static void OSPI_RAM_MspInit(OSPI_HandleTypeDef *hospi)
01983 {
01984   static MDMA_HandleTypeDef mdma_handle;
01985   GPIO_InitTypeDef GPIO_InitStruct;
01986
01987   /* Enable the OctoSPI memory interface, DMA and GPIO clocks */
01988   OSPI_RAM_CLK_ENABLE();
01989   OSPI_RAM_MDMAx_CLK_ENABLE();
01990   OSPI_RAM_CLK_GPIO_CLK_ENABLE();
01991   OSPI_RAM_DQS_GPIO_CLK_ENABLE();
01992   OSPI_RAM_CS_GPIO_CLK_ENABLE();
01993   OSPI_RAM_D0_GPIO_CLK_ENABLE();
01994   OSPI_RAM_D1_GPIO_CLK_ENABLE();
01995   OSPI_RAM_D2_GPIO_CLK_ENABLE();
01996   OSPI_RAM_D3_GPIO_CLK_ENABLE();
01997   OSPI_RAM_D4_GPIO_CLK_ENABLE();
01998   OSPI_RAM_D5_GPIO_CLK_ENABLE();
01999   OSPI_RAM_D6_GPIO_CLK_ENABLE();
02000   OSPI_RAM_D7_GPIO_CLK_ENABLE();
02001
02002   /* Reset the OctoSPI memory interface */
02003   OSPI_RAM_FORCE_RESET();
02004   OSPI_RAM_RELEASE_RESET();
02005
02006   /* OctoSPI CS GPIO pin configuration  */
02007   GPIO_InitStruct.Pin       = OSPI_RAM_CS_PIN;
02008   GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
02009   GPIO_InitStruct.Pull      = GPIO_PULLUP;
02010   GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
02011   GPIO_InitStruct.Alternate = OSPI_RAM_CS_PIN_AF;
02012   HAL_GPIO_Init(OSPI_RAM_CS_GPIO_PORT, &GPIO_InitStruct);
02013
02014   /* OctoSPI DQS GPIO pin configuration  */
02015   GPIO_InitStruct.Pull      = GPIO_NOPULL;
02016   GPIO_InitStruct.Pin       = OSPI_RAM_DQS_PIN;
02017   GPIO_InitStruct.Alternate = OSPI_RAM_DQS_PIN_AF;
02018   HAL_GPIO_Init(OSPI_RAM_DQS_GPIO_PORT, &GPIO_InitStruct);
02019
02020   /* OctoSPI CLK GPIO pin configuration  */
02021   GPIO_InitStruct.Pin       = OSPI_RAM_CLK_PIN;
02022   GPIO_InitStruct.Alternate = OSPI_RAM_CLK_PIN_AF;
02023   HAL_GPIO_Init(OSPI_RAM_CLK_GPIO_PORT, &GPIO_InitStruct);
02024
02025   /* OctoSPI D0 GPIO pin configuration  */
02026   GPIO_InitStruct.Pin       = OSPI_RAM_D0_PIN;
02027   GPIO_InitStruct.Alternate = OSPI_RAM_D0_PIN_AF;
02028   HAL_GPIO_Init(OSPI_RAM_D0_GPIO_PORT, &GPIO_InitStruct);
02029
02030   /* OctoSPI D1 GPIO pin configuration  */
02031   GPIO_InitStruct.Pin       = OSPI_RAM_D1_PIN;
02032   GPIO_InitStruct.Alternate = OSPI_RAM_D1_PIN_AF;
02033   HAL_GPIO_Init(OSPI_RAM_D1_GPIO_PORT, &GPIO_InitStruct);
02034
02035   /* OctoSPI D2 GPIO pin configuration  */
02036   GPIO_InitStruct.Pin       = OSPI_RAM_D2_PIN;
02037   GPIO_InitStruct.Alternate = OSPI_RAM_D2_PIN_AF;
02038   HAL_GPIO_Init(OSPI_RAM_D2_GPIO_PORT, &GPIO_InitStruct);
02039
02040   /* OctoSPI D3 GPIO pin configuration  */
02041   GPIO_InitStruct.Pin       = OSPI_RAM_D3_PIN;
02042   GPIO_InitStruct.Alternate = OSPI_RAM_D3_PIN_AF;
02043   HAL_GPIO_Init(OSPI_RAM_D3_GPIO_PORT, &GPIO_InitStruct);
02044
02045   /* OctoSPI D4 GPIO pin configuration  */
02046   GPIO_InitStruct.Pin       = OSPI_RAM_D4_PIN;
02047   GPIO_InitStruct.Alternate = OSPI_RAM_D4_PIN_AF;
02048   HAL_GPIO_Init(OSPI_RAM_D4_GPIO_PORT, &GPIO_InitStruct);
02049
02050   /* OctoSPI D5 GPIO pin configuration  */
02051   GPIO_InitStruct.Pin       = OSPI_RAM_D5_PIN;
02052   GPIO_InitStruct.Alternate = OSPI_RAM_D5_PIN_AF;
02053   HAL_GPIO_Init(OSPI_RAM_D5_GPIO_PORT, &GPIO_InitStruct);
02054
02055   /* OctoSPI D6 GPIO pin configuration  */
02056   GPIO_InitStruct.Pin       = OSPI_RAM_D6_PIN;
02057   GPIO_InitStruct.Alternate = OSPI_RAM_D6_PIN_AF;
02058   HAL_GPIO_Init(OSPI_RAM_D6_GPIO_PORT, &GPIO_InitStruct);
02059
02060   /* OctoSPI D7 GPIO pin configuration  */
02061   GPIO_InitStruct.Pin       = OSPI_RAM_D7_PIN;
02062   GPIO_InitStruct.Alternate = OSPI_RAM_D7_PIN_AF;
02063   HAL_GPIO_Init(OSPI_RAM_D7_GPIO_PORT, &GPIO_InitStruct);
02064
02065   /* Configure the OctoSPI DMA */
02066   mdma_handle.Init.Request                  = MDMA_REQUEST_SW;
02067   mdma_handle.Init.TransferTriggerMode      = MDMA_BLOCK_TRANSFER;
02068   mdma_handle.Init.Priority                 = MDMA_PRIORITY_HIGH;
02069   mdma_handle.Init.SourceInc                = MDMA_SRC_INC_WORD;
02070   mdma_handle.Init.DestinationInc           = MDMA_DEST_INC_WORD;
02071   mdma_handle.Init.SourceDataSize           = MDMA_SRC_DATASIZE_WORD;
02072   mdma_handle.Init.DestDataSize             = MDMA_DEST_DATASIZE_WORD;
02073   mdma_handle.Init.DataAlignment            = MDMA_DATAALIGN_PACKENABLE;
02074   mdma_handle.Init.SourceBurst              = MDMA_SOURCE_BURST_SINGLE;
02075   mdma_handle.Init.DestBurst                = MDMA_DEST_BURST_SINGLE;
02076   mdma_handle.Init.BufferTransferLength     = 128;
02077   mdma_handle.Init.SourceBlockAddressOffset = 0;
02078   mdma_handle.Init.DestBlockAddressOffset   = 0;
02079
02080   mdma_handle.Instance = OSPI_RAM_MDMAx_CHANNEL;
02081
02082   __HAL_LINKDMA(hospi, hmdma, mdma_handle);
02083   (void) HAL_MDMA_Init(&mdma_handle);
02084
02085   /* Enable and set priority of the OctoSPI and DMA interrupts */
02086   HAL_NVIC_SetPriority(OCTOSPI2_IRQn, BSP_OSPI_RAM_IT_PRIORITY, 0);
02087   HAL_NVIC_SetPriority(OSPI_RAM_MDMAx_IRQn, BSP_OSPI_RAM_DMA_IT_PRIORITY, 0);
02088
02089   HAL_NVIC_EnableIRQ(OCTOSPI2_IRQn);
02090   HAL_NVIC_EnableIRQ(OSPI_RAM_MDMAx_IRQn);
02091
02092 }
02093
02094 /**
02095   * @brief  De-Initializes the OSPI MSP.
02096   * @param  hospi OSPI handle
02097   * @retval None
02098   */
02099 static void OSPI_RAM_MspDeInit(OSPI_HandleTypeDef *hospi)
02100 {
02101   static MDMA_HandleTypeDef mdma_handle;
02102
02103   /* hospi unused argument(s) compilation warning */
02104   UNUSED(hospi);
02105
02106   /* Disable DMA and OctoSPI interrupts */
02107   HAL_NVIC_DisableIRQ(OSPI_RAM_MDMAx_IRQn);
02108   HAL_NVIC_DisableIRQ(OCTOSPI2_IRQn);
02109
02110   /* De-configure the OctoSPI DMA */
02111   mdma_handle.Instance = OSPI_RAM_MDMAx_CHANNEL;
02112   (void) HAL_MDMA_DeInit(&mdma_handle);
02113
02114   /* OctoSPI GPIO pins de-configuration  */
02115   HAL_GPIO_DeInit(OSPI_RAM_CLK_GPIO_PORT, OSPI_RAM_CLK_PIN);
02116   HAL_GPIO_DeInit(OSPI_RAM_DQS_GPIO_PORT, OSPI_RAM_DQS_PIN);
02117   HAL_GPIO_DeInit(OSPI_RAM_CS_GPIO_PORT, OSPI_RAM_CS_PIN);
02118   HAL_GPIO_DeInit(OSPI_RAM_D0_GPIO_PORT, OSPI_RAM_D0_PIN);
02119   HAL_GPIO_DeInit(OSPI_RAM_D1_GPIO_PORT, OSPI_RAM_D1_PIN);
02120   HAL_GPIO_DeInit(OSPI_RAM_D2_GPIO_PORT, OSPI_RAM_D2_PIN);
02121   HAL_GPIO_DeInit(OSPI_RAM_D3_GPIO_PORT, OSPI_RAM_D3_PIN);
02122   HAL_GPIO_DeInit(OSPI_RAM_D4_GPIO_PORT, OSPI_RAM_D4_PIN);
02123   HAL_GPIO_DeInit(OSPI_RAM_D5_GPIO_PORT, OSPI_RAM_D5_PIN);
02124   HAL_GPIO_DeInit(OSPI_RAM_D6_GPIO_PORT, OSPI_RAM_D6_PIN);
02125   HAL_GPIO_DeInit(OSPI_RAM_D7_GPIO_PORT, OSPI_RAM_D7_PIN);
02126
02127   /* Reset the OctoSPI memory interface */
02128   OSPI_RAM_FORCE_RESET();
02129   OSPI_RAM_RELEASE_RESET();
02130
02131   /* Disable the OctoSPI memory interface clock */
02132   OSPI_RAM_CLK_DISABLE();
02133 }
02134 /**
02135   * @}
02136   */
02137
02138 /**
02139   * @}
02140   */
02141
02142 /**
02143   * @}
02144   */
02145
02146 /**
02147   * @}
02148   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ospi.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_ospi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_ospi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h735g_discovery_ospi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DK_OSPI_H
00022 #define STM32H735G_DK_OSPI_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h735g_discovery_conf.h"
00030 #include "stm32h735g_discovery_errno.h"
00031 #include "../Components/mx25lm51245g/mx25lm51245g.h"
00032 #include "../Components/s70kl1281/s70kl1281.h"
00033
00034 /** @addtogroup BSP
00035   * @{
00036   */
00037
00038 /** @addtogroup STM32H735G_DK
00039   * @{
00040   */
00041
00042 /** @addtogroup STM32H735G_DK_OSPI
00043   * @{
00044   */
00045
00046 /* Exported types ------------------------------------------------------------*/
00047 /** @defgroup STM32H735G_DK_OSPI_Exported_Types Exported Types
00048   * @{
00049   */
00050 typedef enum {
00051   OSPI_ACCESS_NONE = 0,          /*!<  Instance not initialized,              */
00052   OSPI_ACCESS_INDIRECT,          /*!<  Instance use indirect mode access      */
00053   OSPI_ACCESS_MMP                /*!<  Instance use Memory Mapped Mode read   */
00054 } OSPI_Access_t;
00055
00056 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
00057 typedef struct
00058 {
00059   pOSPI_CallbackTypeDef  pMspInitCb;
00060   pOSPI_CallbackTypeDef  pMspDeInitCb;
00061 }BSP_OSPI_Cb_t;
00062 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 1) */
00063
00064 typedef struct
00065 {
00066   uint32_t MemorySize;
00067   uint32_t ClockPrescaler;
00068   uint32_t SampleShifting;
00069   uint32_t TransferRate;
00070 } MX_OSPI_InitTypeDef;
00071 /**
00072   * @}
00073   */
00074
00075 /** @defgroup STM32H735G_DK_OSPI_NOR_Exported_Types OSPI_NOR Exported Types
00076   * @{
00077   */
00078 #define BSP_OSPI_NOR_Info_t                MX25LM51245G_Info_t
00079 #define BSP_OSPI_NOR_Interface_t           MX25LM51245G_Interface_t
00080 #define BSP_OSPI_NOR_Transfer_t            MX25LM51245G_Transfer_t
00081 #define BSP_OSPI_NOR_Erase_t               MX25LM51245G_Erase_t
00082
00083 typedef struct
00084 {
00085   OSPI_Access_t              IsInitialized;  /*!<  Instance access Flash method     */
00086   BSP_OSPI_NOR_Interface_t   InterfaceMode;  /*!<  Flash Interface mode of Instance */
00087   BSP_OSPI_NOR_Transfer_t    TransferRate;   /*!<  Flash Transfer mode of Instance  */
00088   uint32_t                   IsMspCallbacksValid;
00089 } OSPI_NOR_Ctx_t;
00090
00091 typedef struct
00092 {
00093   BSP_OSPI_NOR_Interface_t   InterfaceMode;      /*!<  Current Flash Interface mode */
00094   BSP_OSPI_NOR_Transfer_t    TransferRate;       /*!<  Current Flash Transfer rate  */
00095 } BSP_OSPI_NOR_Init_t;
00096   /**
00097   * @}
00098   */
00099 /** @defgroup STM32H735G_DK_OSPI_RAM_Exported_Types OSPI_RAM Exported Types
00100   * @{
00101   */
00102 #define BSP_OSPI_RAM_BurstLength_t S70KL1281_BurstLength_t
00103
00104 typedef enum {
00105   BSP_OSPI_RAM_VARIABLE_LATENCY = HAL_OSPI_VARIABLE_LATENCY,
00106   BSP_OSPI_RAM_FIXED_LATENCY    = HAL_OSPI_FIXED_LATENCY
00107 } BSP_OSPI_RAM_Latency_t;
00108
00109 typedef enum {
00110   BSP_OSPI_RAM_HYBRID_BURST = 0,
00111   BSP_OSPI_RAM_LINEAR_BURST
00112 } BSP_OSPI_RAM_BurstType_t;
00113
00114 typedef struct
00115 {
00116   OSPI_Access_t               IsInitialized; /*!< Instance access Flash method */
00117   BSP_OSPI_RAM_Latency_t      LatencyType;   /*!< Latency Type of Instance     */
00118   BSP_OSPI_RAM_BurstType_t    BurstType;     /*!< Burst Type of Instance       */
00119   BSP_OSPI_RAM_BurstLength_t  BurstLength;   /*!< Burst Length of Instance     */
00120   uint32_t                   IsMspCallbacksValid;
00121 } OSPI_RAM_Ctx_t;
00122
00123 typedef struct
00124 {
00125   BSP_OSPI_RAM_Latency_t      LatencyType;   /*!< Current HyperRAM Latency Type */
00126   BSP_OSPI_RAM_BurstType_t    BurstType;     /*!< Current HyperRAM Burst Type   */
00127   BSP_OSPI_RAM_BurstLength_t  BurstLength;   /*!< Current HyperRAM Burst Length */
00128 } BSP_OSPI_RAM_Init_t;
00129   /**
00130   * @}
00131   */
00132
00133 /* Exported constants --------------------------------------------------------*/
00134 /** @defgroup STM32H735G_DK_OSPI_NOR_Exported_Constants OSPI_NOR Exported Constants
00135   * @{
00136   */
00137 #define OSPI_NOR_INSTANCES_NUMBER         1U
00138
00139 /* Definition for OSPI modes */
00140 #define BSP_OSPI_NOR_SPI_MODE             (BSP_OSPI_NOR_Interface_t)MX25LM51245G_SPI_MODE      /* 1 Cmd Line, 1 Address Line and 1 Data Line    */
00141 #define BSP_OSPI_NOR_OPI_MODE             (BSP_OSPI_NOR_Interface_t)MX25LM51245G_OPI_MODE      /* 8 Cmd Lines, 8 Address Lines and 8 Data Lines */
00142
00143 /* Definition for OSPI transfer rates */
00144 #define BSP_OSPI_NOR_STR_TRANSFER         (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_STR_TRANSFER   /* Single Transfer Rate */
00145 #define BSP_OSPI_NOR_DTR_TRANSFER         (BSP_OSPI_NOR_Transfer_t)MX25LM51245G_DTR_TRANSFER   /* Double Transfer Rate */
00146
00147 /* OSPI erase types */
00148 #define BSP_OSPI_NOR_ERASE_4K             MX25LM51245G_ERASE_4K
00149 #define BSP_OSPI_NOR_ERASE_64K            MX25LM51245G_ERASE_64K
00150 #define BSP_OSPI_NOR_ERASE_CHIP           MX25LM51245G_ERASE_BULK
00151
00152 /* OSPI block sizes */
00153 #define BSP_OSPI_NOR_BLOCK_4K             MX25LM51245G_SUBSECTOR_4K
00154 #define BSP_OSPI_NOR_BLOCK_64K            MX25LM51245G_SECTOR_64K
00155
00156 /* Definition for OSPI clock resources */
00157 #define OSPI_NOR_CLK_ENABLE()                 __HAL_RCC_OSPI1_CLK_ENABLE()
00158 #define OSPI_NOR_CLK_DISABLE()                __HAL_RCC_OSPI1_CLK_DISABLE()
00159
00160 #define OSPI_NOR_FORCE_RESET()                __HAL_RCC_OSPI1_FORCE_RESET()
00161 #define OSPI_NOR_RELEASE_RESET()              __HAL_RCC_OSPI1_RELEASE_RESET()
00162
00163 /* Definition for OSPI NOR Pins */
00164 #define OSPI_NOR_CS_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00165 #define OSPI_NOR_CS_PIN                       GPIO_PIN_6
00166 #define OSPI_NOR_CS_GPIO_PORT                 GPIOG
00167 #define OSPI_NOR_CS_PIN_AF                    GPIO_AF10_OCTOSPIM_P1
00168
00169 #define OSPI_NOR_CLK_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOF_CLK_ENABLE()
00170 #define OSPI_NOR_CLK_PIN                      GPIO_PIN_10
00171 #define OSPI_NOR_CLK_GPIO_PORT                GPIOF
00172 #define OSPI_NOR_CLK_PIN_AF                   GPIO_AF9_OCTOSPIM_P1
00173
00174 #define OSPI_NOR_DQS_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOB_CLK_ENABLE()
00175 #define OSPI_NOR_DQS_PIN                      GPIO_PIN_2
00176 #define OSPI_NOR_DQS_GPIO_PORT                GPIOB
00177 #define OSPI_NOR_DQS_PIN_AF                   GPIO_AF10_OCTOSPIM_P1
00178
00179 #define OSPI_NOR_D0_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00180 #define OSPI_NOR_D0_PIN                       GPIO_PIN_11
00181 #define OSPI_NOR_D0_GPIO_PORT                 GPIOD
00182 #define OSPI_NOR_D0_PIN_AF                    GPIO_AF9_OCTOSPIM_P1
00183
00184 #define OSPI_NOR_D1_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00185 #define OSPI_NOR_D1_PIN                       GPIO_PIN_12
00186 #define OSPI_NOR_D1_GPIO_PORT                 GPIOD
00187 #define OSPI_NOR_D1_PIN_AF                    GPIO_AF9_OCTOSPIM_P1
00188
00189 #define OSPI_NOR_D2_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOE_CLK_ENABLE()
00190 #define OSPI_NOR_D2_PIN                       GPIO_PIN_2
00191 #define OSPI_NOR_D2_GPIO_PORT                 GPIOE
00192 #define OSPI_NOR_D2_PIN_AF                    GPIO_AF9_OCTOSPIM_P1
00193
00194 #define OSPI_NOR_D3_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00195 #define OSPI_NOR_D3_PIN                       GPIO_PIN_13
00196 #define OSPI_NOR_D3_GPIO_PORT                 GPIOD
00197 #define OSPI_NOR_D3_PIN_AF                    GPIO_AF9_OCTOSPIM_P1
00198
00199 #define OSPI_NOR_D4_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00200 #define OSPI_NOR_D4_PIN                       GPIO_PIN_4
00201 #define OSPI_NOR_D4_GPIO_PORT                 GPIOD
00202 #define OSPI_NOR_D4_PIN_AF                    GPIO_AF10_OCTOSPIM_P1
00203
00204 #define OSPI_NOR_D5_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00205 #define OSPI_NOR_D5_PIN                       GPIO_PIN_5
00206 #define OSPI_NOR_D5_GPIO_PORT                 GPIOD
00207 #define OSPI_NOR_D5_PIN_AF                    GPIO_AF10_OCTOSPIM_P1
00208
00209 #define OSPI_NOR_D6_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00210 #define OSPI_NOR_D6_PIN                       GPIO_PIN_9
00211 #define OSPI_NOR_D6_GPIO_PORT                 GPIOG
00212 #define OSPI_NOR_D6_PIN_AF                    GPIO_AF9_OCTOSPIM_P1
00213
00214 #define OSPI_NOR_D7_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
00215 #define OSPI_NOR_D7_PIN                       GPIO_PIN_7
00216 #define OSPI_NOR_D7_GPIO_PORT                 GPIOD
00217 #define OSPI_NOR_D7_PIN_AF                    GPIO_AF10_OCTOSPIM_P1
00218
00219 /**
00220   * @}
00221   */
00222 /** @defgroup STM32H735G_DK_OSPI_RAM_Exported_Constants OSPI_RAM Exported Constants
00223   * @{
00224   */
00225 #define OSPI_RAM_INSTANCES_NUMBER         1U
00226
00227 /* OSPI Burst length */
00228 #define BSP_OSPI_RAM_BURST_16_BYTES       (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_16_BYTES
00229 #define BSP_OSPI_RAM_BURST_32_BYTES       (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_32_BYTES
00230 #define BSP_OSPI_RAM_BURST_64_BYTES       (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_64_BYTES
00231 #define BSP_OSPI_RAM_BURST_128_BYTES      (BSP_OSPI_RAM_BurstLength_t)S70KL1281_BURST_128_BYTES
00232
00233 /* DMA definitions for OSPI RAM DMA transfer */
00234 #define OSPI_RAM_MDMAx_CLK_ENABLE             __HAL_RCC_MDMA_CLK_ENABLE
00235 #define OSPI_RAM_MDMAx_CLK_DISABLE            __HAL_RCC_MDMA_CLK_DISABLE
00236 #define OSPI_RAM_MDMAx_CHANNEL                MDMA_Channel0
00237 #define OSPI_RAM_MDMAx_IRQn                   MDMA_IRQn
00238 #define OPSI_RAM_MDMA_IRQHandler              MDMA_IRQHandler
00239
00240 /* Definition for OSPI clock resources */
00241 #define OSPI_RAM_CLK_ENABLE()                 __HAL_RCC_OSPI2_CLK_ENABLE()
00242 #define OSPI_RAM_CLK_DISABLE()                __HAL_RCC_OSPI2_CLK_DISABLE()
00243
00244 #define OSPI_RAM_FORCE_RESET()                __HAL_RCC_OSPI2_FORCE_RESET()
00245 #define OSPI_RAM_RELEASE_RESET()              __HAL_RCC_OSPI2_RELEASE_RESET()
00246
00247 /* Definition for OSPI RAM Pins */
00248 #define OSPI_RAM_CS_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00249 #define OSPI_RAM_CS_PIN                       GPIO_PIN_12
00250 #define OSPI_RAM_CS_GPIO_PORT                 GPIOG
00251 #define OSPI_RAM_CS_PIN_AF                    GPIO_AF3_OCTOSPIM_P2
00252
00253 #define OSPI_RAM_CLK_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOF_CLK_ENABLE()
00254 #define OSPI_RAM_CLK_PIN                      GPIO_PIN_4
00255 #define OSPI_RAM_CLK_GPIO_PORT                GPIOF
00256 #define OSPI_RAM_CLK_PIN_AF                   GPIO_AF9_OCTOSPIM_P2
00257
00258 #define OSPI_RAM_DQS_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOF_CLK_ENABLE()
00259 #define OSPI_RAM_DQS_PIN                      GPIO_PIN_12
00260 #define OSPI_RAM_DQS_GPIO_PORT                GPIOF
00261 #define OSPI_RAM_DQS_PIN_AF                   GPIO_AF9_OCTOSPIM_P2
00262
00263 #define OSPI_RAM_D0_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00264 #define OSPI_RAM_D0_PIN                       GPIO_PIN_0
00265 #define OSPI_RAM_D0_GPIO_PORT                 GPIOF
00266 #define OSPI_RAM_D0_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00267
00268 #define OSPI_RAM_D1_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00269 #define OSPI_RAM_D1_PIN                       GPIO_PIN_1
00270 #define OSPI_RAM_D1_GPIO_PORT                 GPIOF
00271 #define OSPI_RAM_D1_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00272
00273 #define OSPI_RAM_D2_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00274 #define OSPI_RAM_D2_PIN                       GPIO_PIN_2
00275 #define OSPI_RAM_D2_GPIO_PORT                 GPIOF
00276 #define OSPI_RAM_D2_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00277
00278 #define OSPI_RAM_D3_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
00279 #define OSPI_RAM_D3_PIN                       GPIO_PIN_3
00280 #define OSPI_RAM_D3_GPIO_PORT                 GPIOF
00281 #define OSPI_RAM_D3_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00282
00283 #define OSPI_RAM_D4_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00284 #define OSPI_RAM_D4_PIN                       GPIO_PIN_0
00285 #define OSPI_RAM_D4_GPIO_PORT                 GPIOG
00286 #define OSPI_RAM_D4_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00287
00288 #define OSPI_RAM_D5_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00289 #define OSPI_RAM_D5_PIN                       GPIO_PIN_1
00290 #define OSPI_RAM_D5_GPIO_PORT                 GPIOG
00291 #define OSPI_RAM_D5_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00292
00293 #define OSPI_RAM_D6_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00294 #define OSPI_RAM_D6_PIN                       GPIO_PIN_10
00295 #define OSPI_RAM_D6_GPIO_PORT                 GPIOG
00296 #define OSPI_RAM_D6_PIN_AF                    GPIO_AF3_OCTOSPIM_P2
00297
00298 #define OSPI_RAM_D7_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
00299 #define OSPI_RAM_D7_PIN                       GPIO_PIN_11
00300 #define OSPI_RAM_D7_GPIO_PORT                 GPIOG
00301 #define OSPI_RAM_D7_PIN_AF                    GPIO_AF9_OCTOSPIM_P2
00302
00303 /**
00304   * @}
00305   */
00306
00307 /* Exported variables --------------------------------------------------------*/
00308 /** @addtogroup STM32H735G_DK_OSPI_NOR_Exported_Variables NOR Exported Variables
00309   * @{
00310   */
00311 extern OSPI_HandleTypeDef hospi_nor[];
00312 extern OSPI_NOR_Ctx_t OSPINORCtx[];
00313 /**
00314   * @}
00315   */
00316
00317 /* Exported functions --------------------------------------------------------*/
00318 /** @defgroup STM32H735G_DK_OSPI_NOR_Exported_Functions NOR Exported Functions
00319   * @{
00320   */
00321 int32_t BSP_OSPI_NOR_Init                        (uint32_t Instance, BSP_OSPI_NOR_Init_t *Init);
00322 int32_t BSP_OSPI_NOR_DeInit                      (uint32_t Instance);
00323 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
00324 int32_t BSP_OSPI_NOR_RegisterMspCallbacks        (uint32_t Instance, BSP_OSPI_Cb_t *CallBacks);
00325 int32_t BSP_OSPI_NOR_RegisterDefaultMspCallbacks (uint32_t Instance);
00326 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 1) */
00327 int32_t BSP_OSPI_NOR_Read                        (uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00328 int32_t BSP_OSPI_NOR_Write                       (uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00329 int32_t BSP_OSPI_NOR_Erase_Block                 (uint32_t Instance, uint32_t BlockAddress, BSP_OSPI_NOR_Erase_t BlockSize);
00330 int32_t BSP_OSPI_NOR_Erase_Chip                  (uint32_t Instance);
00331 int32_t BSP_OSPI_NOR_GetStatus                   (uint32_t Instance);
00332 int32_t BSP_OSPI_NOR_GetInfo                     (uint32_t Instance, BSP_OSPI_NOR_Info_t* pInfo);
00333 int32_t BSP_OSPI_NOR_EnableMemoryMappedMode      (uint32_t Instance);
00334 int32_t BSP_OSPI_NOR_DisableMemoryMappedMode     (uint32_t Instance);
00335 int32_t BSP_OSPI_NOR_ReadID                      (uint32_t Instance, uint8_t *Id);
00336 int32_t BSP_OSPI_NOR_ConfigFlash                 (uint32_t Instance, BSP_OSPI_NOR_Interface_t Mode, BSP_OSPI_NOR_Transfer_t Rate);
00337 int32_t BSP_OSPI_NOR_SuspendErase                (uint32_t Instance);
00338 int32_t BSP_OSPI_NOR_ResumeErase                 (uint32_t Instance);
00339
00340 /* These functions can be modified in case the current settings
00341    need to be changed for specific application needs */
00342 HAL_StatusTypeDef MX_OSPI_NOR_Init(OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Config);
00343
00344 /**
00345   * @}
00346   */
00347 /** @defgroup STM32H735G_DK_OSPI_RAM_Exported_FunctionsPrototypes OSPI_RAM Exported Functions Prototypes
00348   * @{
00349   */
00350 int32_t BSP_OSPI_RAM_Init                        (uint32_t Instance, BSP_OSPI_RAM_Init_t *Init);
00351 int32_t BSP_OSPI_RAM_DeInit                      (uint32_t Instance);
00352 #if (USE_HAL_OSPI_REGISTER_CALLBACKS == 1)
00353 int32_t BSP_OSPI_RAM_RegisterMspCallbacks        (uint32_t Instance, BSP_OSPI_Cb_t *CallBacks);
00354 int32_t BSP_OSPI_RAM_RegisterDefaultMspCallbacks (uint32_t Instance);
00355 #endif /* (USE_HAL_OSPI_REGISTER_CALLBACKS == 1) */
00356 int32_t BSP_OSPI_RAM_Read                        (uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00357 int32_t BSP_OSPI_RAM_Read_DMA                    (uint32_t Instance, uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00358 int32_t BSP_OSPI_RAM_Write                       (uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00359 int32_t BSP_OSPI_RAM_Write_DMA                   (uint32_t Instance, uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00360 int32_t BSP_OSPI_RAM_EnableMemoryMappedMode      (uint32_t Instance);
00361 int32_t BSP_OSPI_RAM_DisableMemoryMappedMode     (uint32_t Instance);
00362 int32_t BSP_OSPI_RAM_ConfigHyperRAM              (uint32_t Instance, BSP_OSPI_RAM_Latency_t Latency, BSP_OSPI_RAM_BurstType_t BurstType, BSP_OSPI_RAM_BurstLength_t BurstLength);
00363
00364 void    BSP_OSPI_RAM_DMA_IRQHandler              (uint32_t Instance);
00365 void    BSP_OSPI_RAM_IRQHandler                  (uint32_t Instance);
00366
00367 /* These functions can be modified in case the current settings
00368    need to be changed for specific application needs */
00369 HAL_StatusTypeDef MX_OSPI_RAM_Init(OSPI_HandleTypeDef *hospi, MX_OSPI_InitTypeDef *Init);
00370 HAL_StatusTypeDef MX_OSPI_ClockConfig(OSPI_HandleTypeDef *hospi);
00371 /**
00372   * @}
00373   */
00374
00375 /**
00376   * @}
00377   */
00378
00379 /**
00380   * @}
00381   */
00382
00383 /**
00384   * @}
00385   */
00386
00387 #ifdef __cplusplus
00388 }
00389 #endif
00390
00391 #endif /* STM32H735G_DK_OSPI_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_sd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_sd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_sd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the uSD card driver mounted on STM32H735G_DK
00006   *          boards.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the micro SD external cards mounted on STM32H735G_DK
00011      board.
00012    - This driver does not need a specific component driver for the micro SD device
00013      to be included with.
00014
00015   Driver description:
00016   ------------------
00017   + Initialization steps:
00018      o Initialize the micro SD card using the BSP_SD_Init() function. This
00019        function includes the MSP layer hardware resources initialization and the
00020        SDIO interface configuration to interface with the external micro SD. It
00021        also includes the micro SD initialization sequence.
00022
00023      o To check the SD card presence you can use the function BSP_SD_IsDetected() which
00024        returns the detection status.
00025
00026      o If SD presence detection interrupt mode is desired, you must configure the
00027        SD detection interrupt mode by calling the function BSP_SD_DetectITConfig().
00028        The interrupt is generated as an external interrupt whenever the micro SD card is
00029        plugged/unplugged in/from the evaluation board.
00030        The SD detection interrupt is handled by calling the function BSP_SD_DetectIT()
00031        which is called in the IRQ handler file, the user callback is implemented in
00032        the function BSP_SD_DetectCallback().
00033
00034      o The function BSP_SD_GetCardInfo()are used to get the micro SD card information
00035        which is stored in the structure "HAL_SD_CardInfoTypedef".
00036
00037   + Micro SD card operations
00038      o The micro SD card can be accessed with read/write block(s) operations once
00039        it is ready for access. The access can be performed whether
00040        using the polling mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(),
00041        using the interrupt mode by calling the functions BSP_SD_ReadBlocks_IT()/BSP_SD_WriteBlocks_IT(),
00042        or by DMA transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA().
00043      o The DMA transfer complete is used with interrupt mode. Once the SD transfer
00044        is complete, the SD interrupt is handled using the function BSP_SDMMC1_IRQHandler()
00045        The DMA Tx/Rx transfer complete are handled using the functions
00046        SD_SDMMC1_DMA_Tx_IRQHandler(), SD_SDMMC1_DMA_Rx_IRQHandler().The corresponding
00047        user callbacks are implemented by the user at application level.
00048      o The SD erase block(s) is performed using the functions BSP_SD_Erase() with specifying
00049        the number of blocks to erase.
00050      o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
00051
00052   @endverbatim
00053   ******************************************************************************
00054   * @attention
00055   *
00056   * Copyright (c) 2019 STMicroelectronics.
00057   * All rights reserved.
00058   *
00059   * This software is licensed under terms that can be found in the LICENSE file
00060   * in the root directory of this software component.
00061   * If no LICENSE file comes with this software, it is provided AS-IS.
00062   *
00063   ******************************************************************************
00064   */
00065
00066 /* Includes ------------------------------------------------------------------*/
00067 #include "stm32h735g_discovery_sd.h"
00068
00069 /** @addtogroup BSP
00070   * @{
00071   */
00072
00073 /** @addtogroup STM32H735G_DK
00074   * @{
00075   */
00076
00077 /** @defgroup STM32H735G_DK_SD SD
00078   * @{
00079   */
00080
00081
00082 /** @defgroup STM32H735G_DK_SD_Private_TypesDefinitions Private TypesDefinitions
00083   * @{
00084   */
00085 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00086 /* Is Msp Callbacks registered */
00087 static uint32_t   IsMspCallbacksValid[SD_INSTANCES_NBR] = {0};
00088 #endif
00089 typedef void (* BSP_EXTI_LineCallback) (void);
00090 /**
00091   * @}
00092   */
00093
00094 /** @defgroup STM32H735G_DK_SD_Private_Variables Private Variables
00095   * @{
00096   */
00097 static uint32_t PinDetect[SD_INSTANCES_NBR]  = {SD_DETECT_PIN};
00098 static GPIO_TypeDef* SD_GPIO_PORT[SD_INSTANCES_NBR] = {SD_DETECT_GPIO_PORT};
00099 static IRQn_Type SD_EXTI_IRQn[SD_INSTANCES_NBR] = {SD_DETECT_EXTI_IRQn};
00100
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32H735G_DK_SD_Exported_Variables Exported Variables
00106   * @{
00107   */
00108 SD_HandleTypeDef hsd_sdmmc[SD_INSTANCES_NBR];
00109 EXTI_HandleTypeDef hsd_exti[SD_INSTANCES_NBR];
00110
00111 /**
00112   * @}
00113   */
00114
00115 /** @defgroup STM32H735G_DK_SD_Private_Functions_Prototypes Private Functions Prototypes
00116   * @{
00117   */
00118 static void SD_MspInit(SD_HandleTypeDef *hsd);
00119 static void SD_MspDeInit(SD_HandleTypeDef *hsd);
00120 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00121 static void SD_AbortCallback(SD_HandleTypeDef *hsd);
00122 static void SD_TxCpltCallback(SD_HandleTypeDef *hsd);
00123 static void SD_RxCpltCallback(SD_HandleTypeDef *hsd);
00124 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 1) */
00125 static void SD_EXTI_Callback(void);
00126 /**
00127   * @}
00128   */
00129
00130 /** @addgroup STM32H735G_DK_SD_Exported_Functions Exported Functions
00131   * @{
00132   */
00133
00134 /**
00135   * @brief  Initializes the SD card device.
00136   * @param  Instance      SD Instance
00137   * @retval BSP status
00138   */
00139 int32_t BSP_SD_Init(uint32_t Instance)
00140 {
00141   int32_t ret = BSP_ERROR_NONE;
00142   GPIO_InitTypeDef gpio_init_structure;
00143
00144   if(Instance >= SD_INSTANCES_NBR)
00145   {
00146     ret = BSP_ERROR_WRONG_PARAM;
00147   }
00148   else
00149   {
00150     SD_DETECT_GPIO_CLK_ENABLE();
00151
00152     /* Configure Interrupt mode for SD detection pin */
00153     gpio_init_structure.Pin = PinDetect[Instance];
00154     gpio_init_structure.Pull = GPIO_PULLUP;
00155     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00156     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00157     HAL_GPIO_Init(SD_GPIO_PORT[Instance], &gpio_init_structure);
00158
00159     /* Check if SD card is present */
00160     if((uint32_t)BSP_SD_IsDetected(Instance) != SD_PRESENT)
00161     {
00162       ret = BSP_ERROR_UNKNOWN_COMPONENT;
00163     }
00164     else
00165     {
00166 #if (USE_HAL_SD_REGISTER_CALLBACKS == 0)
00167       /* Msp SD initialization */
00168       SD_MspInit(&hsd_sdmmc[Instance]);
00169 #else
00170       /* Register the SD MSP Callbacks */
00171       if(IsMspCallbacksValid[Instance] == 0UL)
00172       {
00173         if(BSP_SD_RegisterDefaultMspCallbacks(Instance) != BSP_ERROR_NONE)
00174         {
00175           ret = BSP_ERROR_PERIPH_FAILURE;
00176         }
00177       }
00178 #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
00179       if(ret == BSP_ERROR_NONE)
00180       {
00181         /* HAL SD initialization and Enable wide operation */
00182         if(MX_SDMMC1_SD_Init(&hsd_sdmmc[Instance]) != HAL_OK)
00183         {
00184           ret = BSP_ERROR_PERIPH_FAILURE;
00185         }
00186         else if(HAL_SD_ConfigWideBusOperation(&hsd_sdmmc[Instance], SDMMC_BUS_WIDE_4B) != HAL_OK)
00187         {
00188           ret = BSP_ERROR_PERIPH_FAILURE;
00189         }
00190         else
00191         {
00192           /* Switch to High Speed mode if the card support this mode */
00193           (void)HAL_SD_ConfigSpeedBusOperation(&hsd_sdmmc[Instance], SDMMC_SPEED_MODE_HIGH);
00194
00195 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00196           /* Register SD TC, HT and Abort callbacks */
00197           if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_TX_CPLT_CB_ID, SD_TxCpltCallback) != HAL_OK)
00198           {
00199             ret = BSP_ERROR_PERIPH_FAILURE;
00200           }
00201           else if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_RX_CPLT_CB_ID, SD_RxCpltCallback) != HAL_OK)
00202           {
00203             ret = BSP_ERROR_PERIPH_FAILURE;
00204           }
00205           else
00206           {
00207             if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_ABORT_CB_ID, SD_AbortCallback) != HAL_OK)
00208             {
00209               ret = BSP_ERROR_PERIPH_FAILURE;
00210             }
00211           }
00212 #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
00213         }
00214       }
00215     }
00216   }
00217
00218   return ret;
00219 }
00220
00221 /**
00222   * @brief  DeInitializes the SD card device.
00223   * @param  Instance      SD Instance
00224   * @retval BSP status
00225   */
00226 int32_t BSP_SD_DeInit(uint32_t Instance)
00227 {
00228   int32_t ret = BSP_ERROR_NONE;
00229
00230   if(Instance >= SD_INSTANCES_NBR)
00231   {
00232     ret = BSP_ERROR_WRONG_PARAM;
00233   }
00234   else if(HAL_SD_DeInit(&hsd_sdmmc[Instance]) != HAL_OK)/* HAL SD de-initialization */
00235   {
00236     ret = BSP_ERROR_PERIPH_FAILURE;
00237   }
00238   else
00239   {
00240     /* Msp SD de-initialization */
00241 #if (USE_HAL_SD_REGISTER_CALLBACKS == 0)
00242     SD_MspDeInit(&hsd_sdmmc[Instance]);
00243 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 0) */
00244   }
00245
00246   return ret;
00247 }
00248
00249 /**
00250   * @brief  Initializes the SDMMC1 peripheral.
00251   * @param  hsd SD handle
00252   * @retval HAL status
00253   */
00254 __weak HAL_StatusTypeDef MX_SDMMC1_SD_Init(SD_HandleTypeDef *hsd)
00255 {
00256   HAL_StatusTypeDef ret = HAL_OK;
00257   /* uSD device interface configuration */
00258   hsd->Instance                 = SDMMC1;
00259   hsd->Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00260   hsd->Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00261   hsd->Init.BusWide             = SDMMC_BUS_WIDE_1B;
00262   hsd->Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
00263   hsd->Init.ClockDiv            = SDMMC_NSpeed_CLK_DIV;
00264   /* HAL SD initialization */
00265   if(HAL_SD_Init(hsd) != HAL_OK)
00266   {
00267     ret = HAL_ERROR;
00268   }
00269
00270   return ret;
00271 }
00272
00273
00274 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00275 /**
00276   * @brief Default BSP SD Msp Callbacks
00277   * @param Instance      SD Instance
00278   * @retval BSP status
00279   */
00280 int32_t BSP_SD_RegisterDefaultMspCallbacks(uint32_t Instance)
00281 {
00282   int32_t ret = BSP_ERROR_NONE;
00283
00284   if(Instance >= SD_INSTANCES_NBR)
00285   {
00286     ret = BSP_ERROR_WRONG_PARAM;
00287   }
00288   else
00289   {
00290     /* Register MspInit/MspDeInit Callbacks */
00291     if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_MSP_INIT_CB_ID, SD_MspInit) != HAL_OK)
00292     {
00293       ret = BSP_ERROR_PERIPH_FAILURE;
00294     }
00295     else if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_MSP_DEINIT_CB_ID, SD_MspDeInit) != HAL_OK)
00296     {
00297       ret = BSP_ERROR_PERIPH_FAILURE;
00298     }
00299     else
00300     {
00301       IsMspCallbacksValid[Instance] = 1U;
00302     }
00303   }
00304   /* Return BSP status */
00305   return ret;
00306 }
00307
00308 /**
00309   * @brief BSP SD Msp Callback registering
00310   * @param Instance     SD Instance
00311   * @param CallBacks    pointer to MspInit/MspDeInit callbacks functions
00312   * @retval BSP status
00313   */
00314 int32_t BSP_SD_RegisterMspCallbacks(uint32_t Instance, BSP_SD_Cb_t *CallBacks)
00315 {
00316   int32_t ret = BSP_ERROR_NONE;
00317
00318   if(Instance >= SD_INSTANCES_NBR)
00319   {
00320     ret = BSP_ERROR_WRONG_PARAM;
00321   }
00322   else
00323   {
00324     /* Register MspInit/MspDeInit Callbacks */
00325     if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_MSP_INIT_CB_ID, CallBacks->pMspInitCb) != HAL_OK)
00326     {
00327       ret = BSP_ERROR_PERIPH_FAILURE;
00328     }
00329     else if(HAL_SD_RegisterCallback(&hsd_sdmmc[Instance], HAL_SD_MSP_DEINIT_CB_ID, CallBacks->pMspDeInitCb) != HAL_OK)
00330     {
00331       ret = BSP_ERROR_PERIPH_FAILURE;
00332     }
00333     else
00334     {
00335       IsMspCallbacksValid[Instance] = 1U;
00336     }
00337   }
00338
00339   /* Return BSP status */
00340   return ret;
00341 }
00342 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 1) */
00343
00344 /**
00345   * @brief  Configures Interrupt mode for SD detection pin.
00346   * @param  Instance      SD Instance
00347   * @retval BSP status
00348   */
00349 int32_t BSP_SD_DetectITConfig(uint32_t Instance)
00350 {
00351   int32_t ret;
00352   GPIO_InitTypeDef gpio_init_structure;
00353   const uint32_t SD_EXTI_LINE[SD_INSTANCES_NBR]   = {SD_DETECT_EXTI_LINE};
00354   static BSP_EXTI_LineCallback SdCallback[SD_INSTANCES_NBR] = {SD_EXTI_Callback};
00355   if(Instance >= SD_INSTANCES_NBR)
00356   {
00357     ret = BSP_ERROR_WRONG_PARAM;
00358   }
00359   else
00360   {
00361     SD_DETECT_GPIO_CLK_ENABLE();
00362     /* Configure Interrupt mode for SD detection pin */
00363     gpio_init_structure.Pin = PinDetect[Instance];
00364     gpio_init_structure.Pull = GPIO_PULLUP;
00365     gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00366     gpio_init_structure.Mode = GPIO_MODE_IT_RISING_FALLING;
00367     HAL_GPIO_Init(SD_GPIO_PORT[Instance], &gpio_init_structure);
00368
00369     if(HAL_EXTI_GetHandle(&hsd_exti[Instance], SD_EXTI_LINE[Instance]) != HAL_OK)
00370     {
00371       ret = BSP_ERROR_PERIPH_FAILURE;
00372     }
00373     else if(HAL_EXTI_RegisterCallback(&hsd_exti[Instance],  HAL_EXTI_COMMON_CB_ID, SdCallback[Instance]) != HAL_OK)
00374     {
00375       ret = BSP_ERROR_PERIPH_FAILURE;
00376     }
00377     else
00378     {
00379       /* Enable and set Button EXTI Interrupt to the lowest priority */
00380       HAL_NVIC_SetPriority(SD_EXTI_IRQn[Instance], BSP_SD_IT_PRIORITY, 0x00);
00381       HAL_NVIC_EnableIRQ(SD_EXTI_IRQn[Instance]);
00382       ret = BSP_ERROR_NONE;
00383     }
00384   }
00385   /* Return BSP status */
00386   return ret;
00387 }
00388
00389 /**
00390   * @brief  BSP SD Callback.
00391   * @param  Instance SD Instance
00392   * @param  Status   Pin status
00393   * @retval None.
00394   */
00395 __weak void BSP_SD_DetectCallback(uint32_t Instance, uint32_t Status)
00396 {
00397   /* Prevent unused argument(s) compilation warning */
00398   UNUSED(Instance);
00399   UNUSED(Status);
00400
00401   /* This function should be implemented by the user application.
00402      It is called into this driver when an event on JoyPin is triggered. */
00403 }
00404
00405 /**
00406  * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00407  * @param Instance  SD Instance
00408  * @retval Returns if SD is detected or not
00409  */
00410 int32_t BSP_SD_IsDetected(uint32_t Instance)
00411 {
00412   int32_t ret;
00413   if(Instance >= SD_INSTANCES_NBR)
00414   {
00415     ret = BSP_ERROR_WRONG_PARAM;
00416   }
00417   else
00418   {
00419     /* Check SD card detect pin */
00420     if (HAL_GPIO_ReadPin(SD_GPIO_PORT[Instance], PinDetect[Instance]) == GPIO_PIN_SET)
00421     {
00422       ret = SD_NOT_PRESENT;
00423     }
00424     else
00425     {
00426       ret = SD_PRESENT;
00427     }
00428   }
00429
00430   return(int32_t)ret;
00431 }
00432
00433 /**
00434   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00435   * @param  Instance   SD Instance
00436   * @param  pData      Pointer to the buffer that will contain the data to transmit
00437   * @param  BlockIdx   Block index from where data is to be read
00438   * @param  BlocksNbr  Number of SD blocks to read
00439   * @retval BSP status
00440   */
00441 int32_t BSP_SD_ReadBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00442 {
00443   uint32_t timeout = SD_READ_TIMEOUT*BlocksNbr;
00444   int32_t ret;
00445
00446   if(Instance >= SD_INSTANCES_NBR)
00447   {
00448     ret = BSP_ERROR_WRONG_PARAM;
00449   }
00450   else if(HAL_SD_ReadBlocks(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr, timeout) != HAL_OK)
00451   {
00452     ret = BSP_ERROR_PERIPH_FAILURE;
00453   }
00454   else
00455   {
00456     ret = BSP_ERROR_NONE;
00457   }
00458   /* Return BSP status */
00459   return ret;
00460 }
00461
00462 /**
00463   * @brief  Writes block(s) to a specified address in an SD card, in polling mode.
00464   * @param  Instance   SD Instance
00465   * @param  pData      Pointer to the buffer that will contain the data to transmit
00466   * @param  BlockIdx   Block index from where data is to be written
00467   * @param  BlocksNbr  Number of SD blocks to write
00468   * @retval BSP status
00469   */
00470 int32_t BSP_SD_WriteBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00471 {
00472   uint32_t timeout = SD_WRITE_TIMEOUT*BlocksNbr;
00473   int32_t ret;
00474
00475   if(Instance >= SD_INSTANCES_NBR)
00476   {
00477     ret = BSP_ERROR_WRONG_PARAM;
00478   }
00479   else if(HAL_SD_WriteBlocks(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr, timeout) != HAL_OK)
00480   {
00481     ret = BSP_ERROR_PERIPH_FAILURE;
00482   }
00483   else
00484   {
00485     ret = BSP_ERROR_NONE;
00486   }
00487   /* Return BSP status */
00488   return ret;
00489 }
00490
00491 /**
00492   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00493   * @param  Instance   SD Instance
00494   * @param  pData      Pointer to the buffer that will contain the data to transmit
00495   * @param  BlockIdx   Block index from where data is to be read
00496   * @param  BlocksNbr  Number of SD blocks to read
00497   * @retval BSP status
00498   */
00499 int32_t BSP_SD_ReadBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00500 {
00501   int32_t ret;
00502
00503   if(Instance >= SD_INSTANCES_NBR)
00504   {
00505     ret = BSP_ERROR_WRONG_PARAM;
00506   }
00507   else if(HAL_SD_ReadBlocks_DMA(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr) != HAL_OK)
00508   {
00509     ret = BSP_ERROR_PERIPH_FAILURE;
00510   }
00511   else
00512   {
00513     ret = BSP_ERROR_NONE;
00514   }
00515   /* Return BSP status */
00516   return ret;
00517 }
00518
00519 /**
00520   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00521   * @param  Instance   SD Instance
00522   * @param  pData      Pointer to the buffer that will contain the data to transmit
00523   * @param  BlockIdx   Block index from where data is to be written
00524   * @param  BlocksNbr  Number of SD blocks to write
00525   * @retval BSP status
00526   */
00527 int32_t BSP_SD_WriteBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00528 {
00529   int32_t ret;
00530
00531   if(Instance >= SD_INSTANCES_NBR)
00532   {
00533     ret = BSP_ERROR_WRONG_PARAM;
00534   }
00535   else if(HAL_SD_WriteBlocks_DMA(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr) != HAL_OK)
00536   {
00537     ret = BSP_ERROR_PERIPH_FAILURE;
00538   }
00539   else
00540   {
00541     ret = BSP_ERROR_NONE;
00542   }
00543   /* Return BSP status */
00544   return ret;
00545 }
00546
00547 /**
00548   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00549   * @param  Instance   SD Instance
00550   * @param  pData      Pointer to the buffer that will contain the data to transmit
00551   * @param  BlockIdx   Block index from where data is to be read
00552   * @param  BlocksNbr  Number of SD blocks to read
00553   * @retval SD status
00554   */
00555 int32_t BSP_SD_ReadBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00556 {
00557   int32_t ret;
00558
00559   if(Instance >= SD_INSTANCES_NBR)
00560   {
00561     ret = BSP_ERROR_WRONG_PARAM;
00562   }
00563   else if(HAL_SD_ReadBlocks_IT(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr) != HAL_OK)
00564   {
00565     ret = BSP_ERROR_PERIPH_FAILURE;
00566   }
00567   else
00568   {
00569     ret = BSP_ERROR_NONE;
00570   }
00571   /* Return BSP status */
00572   return ret;
00573 }
00574
00575 /**
00576   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00577   * @param  Instance   SD Instance
00578   * @param  pData      Pointer to the buffer that will contain the data to transmit
00579   * @param  BlockIdx   Block index from where data is to be written
00580   * @param  BlocksNbr  Number of SD blocks to write
00581   * @retval SD status
00582   */
00583 int32_t BSP_SD_WriteBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr)
00584 {
00585   int32_t ret;
00586
00587   if(Instance >= SD_INSTANCES_NBR)
00588   {
00589     ret = BSP_ERROR_WRONG_PARAM;
00590   }
00591   else if(HAL_SD_WriteBlocks_IT(&hsd_sdmmc[Instance], (uint8_t *)pData, BlockIdx, BlocksNbr) != HAL_OK)
00592   {
00593     ret = BSP_ERROR_PERIPH_FAILURE;
00594   }
00595   else
00596   {
00597     ret = BSP_ERROR_NONE;
00598   }
00599   /* Return BSP status */
00600   return ret;
00601 }
00602
00603
00604 /**
00605   * @brief  Erases the specified memory area of the given SD card.
00606   * @param  Instance   SD Instance
00607   * @param  BlockIdx   Block index from where data is to be
00608   * @param  BlocksNbr  Number of SD blocks to erase
00609   * @retval SD status
00610   */
00611 int32_t BSP_SD_Erase(uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr)
00612 {
00613   int32_t ret;
00614
00615   if(Instance >= SD_INSTANCES_NBR)
00616   {
00617     ret = BSP_ERROR_WRONG_PARAM;
00618   }
00619   else if(HAL_SD_Erase(&hsd_sdmmc[Instance], BlockIdx, BlockIdx + BlocksNbr) != HAL_OK)
00620   {
00621     ret = BSP_ERROR_PERIPH_FAILURE;
00622   }
00623   else
00624   {
00625     ret = BSP_ERROR_NONE;
00626   }
00627   /* Return BSP status */
00628   return ret;
00629 }
00630
00631 /**
00632   * @brief  Gets the current SD card data status.
00633   * @param  Instance  SD Instance
00634   * @retval Data transfer state.
00635   *          This value can be one of the following values:
00636   *            @arg  SD_TRANSFER_OK: No data transfer is acting
00637   *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
00638   */
00639 int32_t BSP_SD_GetCardState(uint32_t Instance)
00640 {
00641   return (int32_t)((HAL_SD_GetCardState(&hsd_sdmmc[Instance]) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY);
00642 }
00643
00644 /**
00645   * @brief  Get SD information about specific SD card.
00646   * @param  Instance  SD Instance
00647   * @param  CardInfo  Pointer to HAL_SD_CardInfoTypedef structure
00648   * @retval BSP status
00649   */
00650 int32_t BSP_SD_GetCardInfo(uint32_t Instance, BSP_SD_CardInfo *CardInfo)
00651 {
00652   int32_t ret;
00653
00654   if(Instance >= SD_INSTANCES_NBR)
00655   {
00656     ret = BSP_ERROR_WRONG_PARAM;
00657   }
00658   else if(HAL_SD_GetCardInfo(&hsd_sdmmc[Instance], CardInfo) != HAL_OK)
00659   {
00660     ret = BSP_ERROR_PERIPH_FAILURE;
00661   }
00662   else
00663   {
00664     ret = BSP_ERROR_NONE;
00665   }
00666   /* Return BSP status */
00667   return ret;
00668 }
00669
00670 /**
00671   * @brief  This function handles SD interrupt request.
00672   * @param  Instance  SD Instance
00673   * @retval None
00674   */
00675 void BSP_SD_DETECT_IRQHandler(uint32_t Instance)
00676 {
00677   HAL_EXTI_IRQHandler(&hsd_exti[Instance]);
00678 }
00679
00680 /**
00681   * @brief  This function handles SDMMC interrupt requests.
00682   * @param  Instance  SD Instance
00683   * @retval None
00684   */
00685 void BSP_SD_IRQHandler(uint32_t Instance)
00686 {
00687   HAL_SD_IRQHandler(&hsd_sdmmc[Instance]);
00688 }
00689
00690 /**
00691   * @}
00692   */
00693
00694 /** @defgroup STM32H735G_DK_SD_Private_Functions Private Functions
00695   * @{
00696   */
00697 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00698 /**
00699   * @brief SD Abort callbacks
00700   * @param hsd  SD handle
00701   * @retval None
00702   */
00703 static void SD_AbortCallback(SD_HandleTypeDef *hsd)
00704 {
00705   BSP_SD_AbortCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00706 }
00707
00708 /**
00709   * @brief Tx Transfer completed callbacks
00710   * @param hsd  SD handle
00711   * @retval None
00712   */
00713 static void SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00714 {
00715   BSP_SD_WriteCpltCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00716 }
00717
00718 /**
00719   * @brief Rx Transfer completed callbacks
00720   * @param hsd  SD handle
00721   * @retval None
00722   */
00723 static void SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00724 {
00725   BSP_SD_ReadCpltCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00726 }
00727 #else
00728 /**
00729   * @brief SD Abort callbacks
00730   * @param hsd  SD handle
00731   * @retval None
00732   */
00733 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00734 {
00735   BSP_SD_AbortCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00736 }
00737
00738 /**
00739   * @brief Tx Transfer completed callbacks
00740   * @param hsd  SD handle
00741   * @retval None
00742   */
00743 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00744 {
00745   BSP_SD_WriteCpltCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00746 }
00747
00748 /**
00749   * @brief Rx Transfer completed callbacks
00750   * @param hsd  SD handle
00751   * @retval None
00752   */
00753 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00754 {
00755   BSP_SD_ReadCpltCallback((hsd == &hsd_sdmmc[0]) ? 0UL : 1UL);
00756 }
00757 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 1) */
00758
00759 /**
00760   * @brief BSP SD Abort callbacks
00761   * @param  Instance     SD Instance
00762   * @retval None
00763   */
00764 __weak void BSP_SD_AbortCallback(uint32_t Instance)
00765 {
00766   /* Prevent unused argument(s) compilation warning */
00767   UNUSED(Instance);
00768 }
00769
00770 /**
00771   * @brief BSP Tx Transfer completed callbacks
00772   * @param  Instance     SD Instance
00773   * @retval None
00774   */
00775 __weak void BSP_SD_WriteCpltCallback(uint32_t Instance)
00776 {
00777   /* Prevent unused argument(s) compilation warning */
00778   UNUSED(Instance);
00779 }
00780
00781 /**
00782   * @brief BSP Rx Transfer completed callbacks
00783   * @param  Instance     SD Instance
00784   * @retval None
00785   */
00786 __weak void BSP_SD_ReadCpltCallback(uint32_t Instance)
00787 {
00788   /* Prevent unused argument(s) compilation warning */
00789   UNUSED(Instance);
00790 }
00791
00792 /**
00793   * @brief  SD EXTI line detection callbacks.
00794   * @retval None
00795   */
00796 static void SD_EXTI_Callback(void)
00797 {
00798    uint32_t sd_status = SD_PRESENT;
00799    /* Check SD card detect pin */
00800   if (HAL_GPIO_ReadPin(SD_GPIO_PORT[0], PinDetect[0]) == GPIO_PIN_SET)
00801   {
00802     sd_status = SD_NOT_PRESENT;
00803   }
00804   else
00805   {
00806     sd_status = SD_PRESENT;
00807   }
00808   BSP_SD_DetectCallback(0, sd_status);
00809
00810 }
00811
00812 /**
00813   * @brief  Initializes the SD MSP.
00814   * @param  hsd  SD handle
00815   * @retval None
00816   */
00817 static void SD_MspInit(SD_HandleTypeDef *hsd)
00818 {
00819   GPIO_InitTypeDef gpio_init_structure;
00820
00821   UNUSED(hsd);
00822
00823   /* Enable SDIO clock */
00824   __HAL_RCC_SDMMC1_CLK_ENABLE();
00825   /* Enable GPIOs clock */
00826   __HAL_RCC_GPIOC_CLK_ENABLE();
00827   __HAL_RCC_GPIOD_CLK_ENABLE();
00828
00829   /* Common GPIO configuration */
00830   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00831   gpio_init_structure.Pull      = GPIO_PULLUP;
00832   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00833
00834   /* GPIOC configuration*/
00835   gpio_init_structure.Alternate = GPIO_AF12_SDMMC1;
00836   gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00837   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00838
00839   /* GPIOD configuration*/
00840   gpio_init_structure.Alternate = GPIO_AF12_SDMMC1;
00841   gpio_init_structure.Pin = GPIO_PIN_2;
00842   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00843
00844   /* NVIC configuration for SDIO interrupts */
00845   HAL_NVIC_SetPriority(SDMMC1_IRQn, BSP_SD_IT_PRIORITY, 0);
00846   HAL_NVIC_EnableIRQ(SDMMC1_IRQn);
00847 }
00848
00849 /**
00850   * @brief  DeInitializes the SD MSP.
00851   * @param  hsd  SD handle
00852   * @retval None
00853   */
00854 static void SD_MspDeInit(SD_HandleTypeDef *hsd)
00855 {
00856   GPIO_InitTypeDef gpio_init_structure;
00857
00858   if(hsd == &hsd_sdmmc[0])
00859   {
00860     /* Disable NVIC for SDIO interrupts */
00861     HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
00862     /* GPIOC configuration */
00863     gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00864     HAL_GPIO_DeInit(GPIOC, gpio_init_structure.Pin);
00865
00866     /* GPIOD configuration */
00867     gpio_init_structure.Pin = GPIO_PIN_2;
00868     HAL_GPIO_DeInit(GPIOD, gpio_init_structure.Pin);
00869     /* Disable SDMMC1 clock */
00870     __HAL_RCC_SDMMC1_CLK_DISABLE();
00871   }
00872 }
00873
00874 /**
00875   * @}
00876   */
00877
00878 /**
00879   * @}
00880   */
00881
00882 /**
00883   * @}
00884   */
00885
00886 /**
00887   * @}
00888   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_sd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h735g_discovery_sd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DK_SD_H
00022 #define STM32H735G_DK_SD_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h735g_discovery_conf.h"
00030 #include "stm32h735g_discovery_errno.h"
00031
00032 /** @addtogroup BSP
00033   * @{
00034   */
00035
00036 /** @addtogroup STM32H735G_DK
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32H735G_DK_SD
00041   * @{
00042   */
00043
00044 /** @defgroup STM32H735G_DK_SD_Exported_Types Exported Types
00045   * @{
00046   */
00047
00048 /**
00049   * @brief SD Card information structure
00050   */
00051 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00052
00053 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00054 typedef struct
00055 {
00056   pSD_CallbackTypeDef  pMspInitCb;
00057   pSD_CallbackTypeDef  pMspDeInitCb;
00058 }BSP_SD_Cb_t;
00059 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 1) */
00060 /**
00061   * @}
00062   */
00063
00064 /** @defgroup STM32H735G_DK_SD_Exported_Constants Exported Constants
00065   * @{
00066   */
00067 #define SD_INSTANCES_NBR         1UL
00068
00069 #ifndef SD_WRITE_TIMEOUT
00070 #define SD_WRITE_TIMEOUT         500U
00071 #endif
00072
00073 #ifndef SD_READ_TIMEOUT
00074 #define SD_READ_TIMEOUT          100U
00075 #endif
00076
00077 /**
00078   * @brief  SD transfer state definition
00079   */
00080 #define   SD_TRANSFER_OK         0U
00081 #define   SD_TRANSFER_BUSY       1U
00082
00083 /**
00084   * @brief SD-detect signal
00085   */
00086 #define SD_PRESENT               1UL
00087 #define SD_NOT_PRESENT           0UL
00088
00089 #define SD_DETECT_PIN                        GPIO_PIN_5
00090 #define SD_DETECT_GPIO_PORT                  GPIOF
00091 #define SD_DETECT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOF_CLK_ENABLE()
00092 #define SD_DETECT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOF_CLK_DISABLE()
00093 #define SD_DETECT_EXTI_IRQn                  EXTI9_5_IRQn
00094 #define SD_DETECT_EXTI_LINE                  EXTI_LINE_5
00095
00096 /* DMA definitions for SD DMA transfer */
00097 #define SD1_DMAx_TxRx_CLK_ENABLE           __HAL_RCC_DMA2_CLK_ENABLE
00098 #define SD1_SDMMC1_DMAx_Tx_CHANNEL         DMA_CHANNEL_4
00099 #define SD1_SDMMC1_DMAx_Rx_CHANNEL         DMA_CHANNEL_4
00100 #define SD1_SDMMC1_DMAx_Tx_STREAM          DMA2_Stream6
00101 #define SD1_SDMMC1_DMAx_Rx_STREAM          DMA2_Stream3
00102 #define SD1_SDMMC1_DMAx_Tx_IRQn            DMA2_Stream6_IRQn
00103 #define SD1_SDMMC1_DMAx_Rx_IRQn            DMA2_Stream3_IRQn
00104 #define SD1_SDMMC1_DMA_Tx_IRQHandler       DMA2_Stream6_IRQHandler
00105 #define SD1_SDMMC1_DMA_Rx_IRQHandler       DMA2_Stream3_IRQHandler
00106 #define SD1_SDMMC1_IRQHandler              SDMMC1_IRQHandler
00107
00108 /**
00109   * @}
00110   */
00111
00112 /** @addtogroup STM32H735G_DK_SD_Exported_Variables
00113   * @{
00114   */
00115 extern SD_HandleTypeDef   hsd_sdmmc[];
00116 extern EXTI_HandleTypeDef hsd_exti[];
00117
00118 /**
00119   * @}
00120   */
00121
00122 /** @defgroup STM32H735G_DK_SD_Exported_FunctionsPrototypes Exported Functions Prototypes
00123   * @{
00124   */
00125 int32_t BSP_SD_Init(uint32_t Instance);
00126 int32_t BSP_SD_DeInit(uint32_t Instance);
00127 #if (USE_HAL_SD_REGISTER_CALLBACKS == 1)
00128 int32_t BSP_SD_RegisterMspCallbacks(uint32_t Instance, BSP_SD_Cb_t *CallBacks);
00129 int32_t BSP_SD_RegisterDefaultMspCallbacks(uint32_t Instance);
00130 #endif /* (USE_HAL_SD_REGISTER_CALLBACKS == 1) */
00131 int32_t BSP_SD_DetectITConfig(uint32_t Instance);
00132 int32_t BSP_SD_ReadBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t BlocksNbr);
00133 int32_t BSP_SD_WriteBlocks(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks);
00134 int32_t BSP_SD_ReadBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks);
00135 int32_t BSP_SD_WriteBlocks_DMA(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks);
00136 int32_t BSP_SD_ReadBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks);
00137 int32_t BSP_SD_WriteBlocks_IT(uint32_t Instance, uint32_t *pData, uint32_t BlockIdx, uint32_t NbrOfBlocks);
00138 int32_t BSP_SD_Erase(uint32_t Instance, uint32_t BlockIdx, uint32_t BlocksNbr);
00139 int32_t BSP_SD_GetCardState(uint32_t Instance);
00140 int32_t BSP_SD_GetCardInfo(uint32_t Instance, BSP_SD_CardInfo *CardInfo);
00141 int32_t BSP_SD_IsDetected(uint32_t Instance);
00142
00143 /* These functions can be modified in case the current settings (e.g. DMA stream or IT)
00144    need to be changed for specific application needs */
00145 void BSP_SD_AbortCallback(uint32_t Instance);
00146 void BSP_SD_WriteCpltCallback(uint32_t Instance);
00147 void BSP_SD_ReadCpltCallback(uint32_t Instance);
00148
00149 HAL_StatusTypeDef MX_SDMMC1_SD_Init(SD_HandleTypeDef *hsd);
00150 void BSP_SD_DetectCallback(uint32_t Instance, uint32_t Status);
00151
00152 void BSP_SD_DETECT_IRQHandler(uint32_t Instance);
00153 void BSP_SD_IRQHandler(uint32_t Instance);
00154
00155 /**
00156   * @}
00157   */
00158
00159 /**
00160   * @}
00161   */
00162
00163 /**
00164   * @}
00165   */
00166
00167 /**
00168   * @}
00169   */
00170
00171 #ifdef __cplusplus
00172 }
00173 #endif
00174
00175 #endif /* STM32H735G_DK_SD_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ts.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_ts.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the Touch
00006   *          Screen on STM32H735G_DK board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* File Info : -----------------------------------------------------------------
00021                                    User NOTES
00022 1. How To use this driver:
00023 --------------------------
00024    - This driver is used to drive the FT5336 touch screen module
00025      mounted over TFT-LCD on the STM32H735G_DK board.
00026
00027 2. Driver description:
00028 ---------------------
00029   + Initialization steps:
00030      o Initialize the TS module using the BSP_TS_Init() function. This
00031        function includes the MSP layer hardware resources initialization and the
00032        communication layer configuration to start the TS use. The LCD size properties
00033        (x and y) are passed as parameters.
00034      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00035        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00036        as an external interrupt whenever a touch is detected.
00037        The interrupt mode internally uses the IO functionalities driver driven by
00038        the IO expander, to configure the IT line.
00039
00040   + Touch screen use
00041      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00042        used. This function returns information about the last LCD touch occurred
00043        in the TS_State_t structure.
00044      o The IT is handled using the corresponding external interrupt IRQ handler,
00045        the user IT callback treatment is implemented on the same external interrupt
00046        callback.
00047
00048 ------------------------------------------------------------------------------*/
00049
00050 /* Includes ------------------------------------------------------------------*/
00051 #include "stm32h735g_discovery_ts.h"
00052 #include "stm32h735g_discovery_bus.h"
00053
00054 /** @addtogroup BSP
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32H735G_DK
00059   * @{
00060   */
00061
00062 /** @defgroup STM32H735G_DK_TS STM32H735G_DK TS
00063   * @{
00064   */
00065
00066 /** @defgroup STM32H735G_DK_TS_Private_Types_Definitions TS Private Types Definitions
00067   * @{
00068   */
00069 typedef void (* BSP_EXTI_LineCallback) (void);
00070 /**
00071   * @}
00072   */
00073
00074 /** @defgroup STM32H735G_DK_TS_Private_Defines TS Private Types Defines
00075   * @{
00076   */
00077 /**
00078   * @}
00079   */
00080
00081 /** @defgroup STM32H735G_DK_TS_Private_Macros TS Private Macros
00082   * @{
00083   */
00084 #define TS_MIN(a,b) ((a > b) ? b : a)
00085 /**
00086   * @}
00087   */
00088 /** @defgroup STM32H735G_DK_TS_Private_Function_Prototypes TS Private Function Prototypes
00089   * @{
00090   */
00091 static int32_t FT5336_Probe(uint32_t Instance);
00092 static void TS_EXTI_Callback(void);
00093 /**
00094   * @}
00095   */
00096
00097 /** @defgroup STM32H735G_DK_TS_Privates_Variables TS Privates Variables
00098   * @{
00099   */
00100 static TS_Drv_t   *Ts_Drv = NULL;
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32H735G_DK_TS_Exported_Variables TS Exported Variables
00106   * @{
00107   */
00108 EXTI_HandleTypeDef hts_exti[TS_INSTANCES_NBR] = {0};
00109 void     *Ts_CompObj[TS_INSTANCES_NBR] = {0};
00110 TS_Ctx_t  Ts_Ctx[TS_INSTANCES_NBR]     = {0};
00111 /**
00112   * @}
00113   */
00114
00115 /** @addtogroup STM32H735G_DK_TS_Exported_Functions
00116   * @{
00117   */
00118
00119 /**
00120   * @brief  Initializes and configures the touch screen functionalities and
00121   *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00122   * @param  Instance TS instance. Could be only 0.
00123   * @param  TS_Init  TS Init structure
00124   * @retval BSP status
00125   */
00126 int32_t BSP_TS_Init(uint32_t Instance, TS_Init_t *TS_Init)
00127 {
00128   int32_t ret = BSP_ERROR_NONE;
00129
00130   if((Instance >= TS_INSTANCES_NBR) || (TS_Init->Width == 0U) ||( TS_Init->Width > TS_MAX_WIDTH) ||\
00131                          (TS_Init->Height == 0U) ||( TS_Init->Height > TS_MAX_HEIGHT) ||\
00132                          (TS_Init->Accuracy > TS_MIN((TS_Init->Width), (TS_Init->Height))))
00133   {
00134     ret = BSP_ERROR_WRONG_PARAM;
00135   }
00136   else
00137   {
00138     if(FT5336_Probe(Instance) != BSP_ERROR_NONE)
00139     {
00140       ret = BSP_ERROR_NO_INIT;
00141     }
00142     else
00143     {
00144       TS_Capabilities_t Capabilities;
00145       uint32_t i;
00146       /* Store parameters on TS context */
00147       Ts_Ctx[Instance].Width       = TS_Init->Width;
00148       Ts_Ctx[Instance].Height      = TS_Init->Height;
00149       Ts_Ctx[Instance].Orientation = TS_Init->Orientation;
00150       Ts_Ctx[Instance].Accuracy    = TS_Init->Accuracy;
00151       /* Get capabilities to retrieve maximum values of X and Y */
00152       if (Ts_Drv->GetCapabilities(Ts_CompObj[Instance], &Capabilities) < 0)
00153       {
00154         ret = BSP_ERROR_COMPONENT_FAILURE;
00155       }
00156       else
00157       {
00158         /* Store maximum X and Y on context */
00159         Ts_Ctx[Instance].MaxX = Capabilities.MaxXl;
00160         Ts_Ctx[Instance].MaxY = Capabilities.MaxYl;
00161         /* Initialize previous position in order to always detect first touch */
00162         for(i = 0; i < TS_TOUCH_NBR; i++)
00163         {
00164           Ts_Ctx[Instance].PreviousX[i] = TS_Init->Width + TS_Init->Accuracy + 1U;
00165           Ts_Ctx[Instance].PreviousY[i] = TS_Init->Height + TS_Init->Accuracy + 1U;
00166         }
00167       }
00168     }
00169   }
00170
00171   return ret;
00172 }
00173
00174 /**
00175   * @brief  De-Initializes the touch screen functionalities
00176   * @param  Instance TS instance. Could be only 0.
00177   * @retval BSP status
00178   */
00179 int32_t BSP_TS_DeInit(uint32_t Instance)
00180 {
00181   int32_t ret = BSP_ERROR_NONE;
00182
00183   if(Instance >= TS_INSTANCES_NBR)
00184   {
00185     ret = BSP_ERROR_WRONG_PARAM;
00186   }
00187   else
00188   {
00189     if(Ts_Drv->DeInit(Ts_CompObj[Instance]) < 0)
00190     {
00191       ret = BSP_ERROR_COMPONENT_FAILURE;
00192     }
00193   }
00194
00195   return ret;
00196 }
00197
00198 /**
00199   * @brief  Get Touch Screen instance capabilities
00200   * @param  Instance Touch Screen instance
00201   * @param  Capabilities pointer to Touch Screen capabilities
00202   * @retval BSP status
00203   */
00204 int32_t BSP_TS_GetCapabilities(uint32_t Instance, TS_Capabilities_t *Capabilities)
00205 {
00206   int32_t ret = BSP_ERROR_NONE;
00207
00208   if(Instance >= TS_INSTANCES_NBR)
00209   {
00210     ret = BSP_ERROR_WRONG_PARAM;
00211   }
00212   else
00213   {
00214     (void)Ts_Drv->GetCapabilities(Ts_CompObj[Instance], Capabilities);
00215   }
00216
00217   return ret;
00218 }
00219
00220 /**
00221   * @brief  Configures and enables the touch screen interrupts.
00222   * @param  Instance TS instance. Could be only 0.
00223   * @retval BSP status
00224   */
00225 int32_t BSP_TS_EnableIT(uint32_t Instance)
00226 {
00227   int32_t ret = BSP_ERROR_NONE;
00228   GPIO_InitTypeDef gpio_init_structure;
00229
00230   if(Instance >= TS_INSTANCES_NBR)
00231   {
00232     ret = BSP_ERROR_WRONG_PARAM;
00233   }
00234   else
00235   {
00236     /* Configure Interrupt mode for TS_INT pin falling edge : when a new touch is available */
00237     /* TS_INT pin is active on low level on new touch available */
00238     gpio_init_structure.Pin   = TS_INT_PIN;
00239     gpio_init_structure.Pull  = GPIO_NOPULL;
00240     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00241     gpio_init_structure.Mode  = GPIO_MODE_IT_FALLING;
00242     HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00243
00244     if(Ts_Drv->EnableIT(Ts_CompObj[Instance]) < 0)
00245     {
00246       ret = BSP_ERROR_COMPONENT_FAILURE;
00247     }
00248     else
00249     {
00250       if(HAL_EXTI_GetHandle(&hts_exti[Instance], TS_EXTI_LINE) != HAL_OK)
00251       {
00252         ret = BSP_ERROR_PERIPH_FAILURE;
00253       }
00254       else if(HAL_EXTI_RegisterCallback(&hts_exti[Instance],  HAL_EXTI_COMMON_CB_ID, TS_EXTI_Callback) != HAL_OK)
00255       {
00256         ret = BSP_ERROR_PERIPH_FAILURE;
00257       }
00258       else
00259       {
00260         /* Enable and set the TS_INT EXTI Interrupt to an intermediate priority */
00261         HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), BSP_TS_IT_PRIORITY, 0x00);
00262         HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00263       }
00264     }
00265   }
00266
00267   return ret;
00268 }
00269
00270 /**
00271   * @brief  Disables the touch screen interrupts.
00272   * @param  Instance TS instance. Could be only 0.
00273   * @retval BSP status
00274   */
00275 int32_t BSP_TS_DisableIT(uint32_t Instance)
00276 {
00277   int32_t ret = BSP_ERROR_NONE;
00278   GPIO_InitTypeDef gpio_init_structure;
00279
00280   if(Instance >= TS_INSTANCES_NBR)
00281   {
00282     ret = BSP_ERROR_WRONG_PARAM;
00283   }
00284   else
00285   {
00286     /* Configure TS_INT_PIN low level to generate MFX_IRQ_OUT in EXTI on MCU            */
00287     gpio_init_structure.Pin  = TS_INT_PIN;
00288     HAL_GPIO_DeInit(TS_INT_GPIO_PORT, gpio_init_structure.Pin);
00289
00290     /* Disable the TS in interrupt mode */
00291     /* In that case the INT output of FT5336 when new touch is available */
00292     /* is active on low level and directed on EXTI */
00293     if(Ts_Drv->DisableIT(Ts_CompObj[Instance]) < 0)
00294     {
00295       ret = BSP_ERROR_COMPONENT_FAILURE;
00296     }
00297   }
00298
00299   return ret;
00300 }
00301
00302 /**
00303   * @brief  This function handles TS interrupt request.
00304   * @param  Instance TS instance
00305   * @retval None
00306   */
00307 void BSP_TS_IRQHandler(uint32_t Instance)
00308 {
00309   HAL_EXTI_IRQHandler(&hts_exti[Instance]);
00310 }
00311
00312 /**
00313   * @brief  BSP TS Callback.
00314   * @retval None.
00315   */
00316 __weak void BSP_TS_Callback(uint32_t Instance)
00317 {
00318   /* This function should be implemented by the user application.
00319      It is called into this driver when an event on TS touch detection */
00320 }
00321
00322 /**
00323   * @brief  Returns positions of a single touch screen.
00324   * @param  Instance  TS instance. Could be only 0.
00325   * @param  TS_State  Pointer to touch screen current state structure
00326   * @retval BSP status
00327   */
00328 int32_t BSP_TS_GetState(uint32_t Instance, TS_State_t *TS_State)
00329 {
00330   int32_t ret = BSP_ERROR_NONE;
00331   uint32_t x_oriented, y_oriented;
00332   uint32_t x_diff, y_diff;
00333
00334   if(Instance >= TS_INSTANCES_NBR)
00335   {
00336     ret = BSP_ERROR_WRONG_PARAM;
00337   }
00338   else
00339   {
00340     FT5336_State_t state;
00341
00342     /* Get each touch coordinates */
00343     if(Ts_Drv->GetState(Ts_CompObj[Instance], &state) < 0)
00344     {
00345       ret = BSP_ERROR_COMPONENT_FAILURE;
00346     }/* Check and update the number of touches active detected */
00347     else if(state.TouchDetected != 0U)
00348     {
00349       x_oriented = state.TouchX;
00350       y_oriented = state.TouchY;
00351
00352       if((Ts_Ctx[Instance].Orientation & TS_SWAP_XY) == TS_SWAP_XY)
00353       {
00354         x_oriented = state.TouchY;
00355         y_oriented = state.TouchX;
00356       }
00357
00358       if((Ts_Ctx[Instance].Orientation & TS_SWAP_X) == TS_SWAP_X)
00359       {
00360         x_oriented = Ts_Ctx[Instance].MaxX - state.TouchX - 1UL;
00361       }
00362
00363       if((Ts_Ctx[Instance].Orientation & TS_SWAP_Y) == TS_SWAP_Y)
00364       {
00365         y_oriented = Ts_Ctx[Instance].MaxY - state.TouchY;
00366       }
00367
00368       /* Apply boundary */
00369       TS_State->TouchX = (x_oriented * Ts_Ctx[Instance].Width) / Ts_Ctx[Instance].MaxX;
00370       TS_State->TouchY = (y_oriented * Ts_Ctx[Instance].Height) / Ts_Ctx[Instance].MaxY;
00371       /* Store Current TS state */
00372       TS_State->TouchDetected = state.TouchDetected;
00373
00374       /* Check accuracy */
00375       x_diff = (TS_State->TouchX > Ts_Ctx[Instance].PreviousX[0])?
00376         (TS_State->TouchX - Ts_Ctx[Instance].PreviousX[0]):
00377         (Ts_Ctx[Instance].PreviousX[0] - TS_State->TouchX);
00378
00379         y_diff = (TS_State->TouchY > Ts_Ctx[Instance].PreviousY[0])?
00380           (TS_State->TouchY - Ts_Ctx[Instance].PreviousY[0]):
00381           (Ts_Ctx[Instance].PreviousY[0] - TS_State->TouchY);
00382
00383
00384           if ((x_diff > Ts_Ctx[Instance].Accuracy) || (y_diff > Ts_Ctx[Instance].Accuracy))
00385           {
00386             /* New touch detected */
00387             Ts_Ctx[Instance].PreviousX[0] = TS_State->TouchX;
00388             Ts_Ctx[Instance].PreviousY[0] = TS_State->TouchY;
00389           }
00390           else
00391           {
00392             TS_State->TouchX = Ts_Ctx[Instance].PreviousX[0];
00393             TS_State->TouchY = Ts_Ctx[Instance].PreviousY[0];
00394           }
00395     }
00396     else
00397     {
00398       TS_State->TouchDetected = 0U;
00399       TS_State->TouchX = Ts_Ctx[Instance].PreviousX[0];
00400       TS_State->TouchY = Ts_Ctx[Instance].PreviousY[0];
00401     }
00402   }
00403
00404   return ret;
00405 }
00406
00407 #if (USE_TS_MULTI_TOUCH > 0)
00408 /**
00409   * @brief  Returns positions of multi touch screen.
00410   * @param  Instance  TS instance. Could be only 0.
00411   * @param  TS_State  Pointer to touch screen current state structure
00412   * @retval BSP status
00413   */
00414 int32_t BSP_TS_Get_MultiTouchState(uint32_t Instance, TS_MultiTouch_State_t *TS_State)
00415 {
00416   int32_t ret = BSP_ERROR_NONE;
00417   uint32_t index;
00418   uint32_t x_oriented, y_oriented;
00419   uint32_t x_diff, y_diff;
00420
00421   if(Instance >= TS_INSTANCES_NBR)
00422   {
00423     ret = BSP_ERROR_WRONG_PARAM;
00424   }
00425   else
00426   {
00427     FT5336_MultiTouch_State_t state;
00428
00429     /* Get each touch coordinates */
00430     if(Ts_Drv->GetMultiTouchState(Ts_CompObj[Instance], &state) < 0)
00431     {
00432       ret = BSP_ERROR_COMPONENT_FAILURE;
00433     }
00434     else
00435     {
00436       /* Check and update the number of touches active detected */
00437       if(state.TouchDetected != 0U)
00438       {
00439         for(index = 0; index < state.TouchDetected; index++)
00440         {
00441           x_oriented = state.TouchX[index];
00442           y_oriented = state.TouchY[index];
00443
00444           if((Ts_Ctx[Instance].Orientation & TS_SWAP_XY) == TS_SWAP_XY)
00445           {
00446             x_oriented = state.TouchY[index];
00447             y_oriented = state.TouchX[index];
00448           }
00449
00450           if((Ts_Ctx[Instance].Orientation & TS_SWAP_X) == TS_SWAP_X)
00451           {
00452             x_oriented = Ts_Ctx[Instance].MaxX - state.TouchX[index] - 1UL;
00453           }
00454
00455           if((Ts_Ctx[Instance].Orientation & TS_SWAP_Y) == TS_SWAP_Y)
00456           {
00457             y_oriented = Ts_Ctx[Instance].MaxY - state.TouchY[index];
00458           }
00459
00460           /* Apply boundary */
00461           TS_State->TouchX[index] = (x_oriented * Ts_Ctx[Instance].Width) / Ts_Ctx[Instance].MaxX;
00462           TS_State->TouchY[index] = (y_oriented * Ts_Ctx[Instance].Height) / Ts_Ctx[Instance].MaxY;
00463           /* Store Current TS state */
00464           TS_State->TouchDetected = state.TouchDetected;
00465
00466           /* Check accuracy */
00467           x_diff = (TS_State->TouchX[index] > Ts_Ctx[Instance].PreviousX[index])?
00468                    (TS_State->TouchX[index] - Ts_Ctx[Instance].PreviousX[index]):
00469                    (Ts_Ctx[Instance].PreviousX[index] - TS_State->TouchX[index]);
00470
00471           y_diff = (TS_State->TouchY[index] > Ts_Ctx[Instance].PreviousY[index])?
00472                    (TS_State->TouchY[index] - Ts_Ctx[Instance].PreviousY[index]):
00473                    (Ts_Ctx[Instance].PreviousY[index] - TS_State->TouchY[index]);
00474
00475           if ((x_diff > Ts_Ctx[Instance].Accuracy) || (y_diff > Ts_Ctx[Instance].Accuracy))
00476           {
00477             /* New touch detected */
00478             Ts_Ctx[Instance].PreviousX[index] = TS_State->TouchX[index];
00479             Ts_Ctx[Instance].PreviousY[index] = TS_State->TouchY[index];
00480           }
00481           else
00482           {
00483             TS_State->TouchX[index] = Ts_Ctx[Instance].PreviousX[index];
00484             TS_State->TouchY[index] = Ts_Ctx[Instance].PreviousY[index];
00485           }
00486         }
00487       }
00488       else
00489       {
00490         TS_State->TouchDetected = 0U;
00491         for(index = 0; index < TS_TOUCH_NBR; index++)
00492         {
00493           TS_State->TouchX[index] = Ts_Ctx[Instance].PreviousX[index];
00494           TS_State->TouchY[index] = Ts_Ctx[Instance].PreviousY[index];
00495         }
00496       }
00497     }
00498   }
00499
00500   return ret;
00501 }
00502
00503 #endif /* USE_TS_MULTI_TOUCH == 1 */
00504
00505 #if (USE_TS_GESTURE == 1)
00506 /**
00507   * @brief  Update gesture Id following a touch detected.
00508   * @param  Instance      TS instance. Could be only 0.
00509   * @param  GestureConfig Pointer to gesture configuration structure
00510   * @retval BSP status
00511   */
00512 int32_t BSP_TS_GestureConfig(uint32_t Instance, TS_Gesture_Config_t *GestureConfig)
00513 {
00514   int32_t ret = BSP_ERROR_NONE;
00515
00516   if(Instance >= TS_INSTANCES_NBR)
00517   {
00518     ret = BSP_ERROR_WRONG_PARAM;
00519   }
00520   else
00521   {
00522     if(Ts_Drv->GestureConfig(Ts_CompObj[Instance], GestureConfig) < 0)
00523     {
00524       ret = BSP_ERROR_COMPONENT_FAILURE;
00525     }
00526   }
00527
00528   return ret;
00529 }
00530
00531 /**
00532   * @brief  Update gesture Id following a touch detected.
00533   * @param  Instance   TS instance. Could be only 0.
00534   * @param  GestureId  Pointer to gesture ID
00535   * @retval BSP status
00536   */
00537 int32_t BSP_TS_GetGestureId(uint32_t Instance, uint32_t *GestureId)
00538 {
00539   int32_t ret = BSP_ERROR_NONE;
00540   uint8_t tmp = 0;
00541
00542   if(Instance >= TS_INSTANCES_NBR)
00543   {
00544     ret = BSP_ERROR_WRONG_PARAM;
00545   }/* Get gesture Id */
00546   else if(Ts_Drv->GetGesture(Ts_CompObj[Instance], &tmp)  < 0)
00547   {
00548     ret = BSP_ERROR_COMPONENT_FAILURE;
00549   }
00550   else
00551   {
00552     /* Remap gesture Id to a TS_Gesture_Id_t value */
00553     switch(tmp)
00554     {
00555     case FT5336_GEST_ID_NO_GESTURE :
00556       *GestureId = GESTURE_ID_NO_GESTURE;
00557       break;
00558     case FT5336_GEST_ID_MOVE_UP :
00559       *GestureId = GESTURE_ID_MOVE_UP;
00560       break;
00561     case FT5336_GEST_ID_MOVE_RIGHT :
00562       *GestureId = GESTURE_ID_MOVE_RIGHT;
00563       break;
00564     case FT5336_GEST_ID_MOVE_DOWN :
00565       *GestureId = GESTURE_ID_MOVE_DOWN;
00566       break;
00567     case FT5336_GEST_ID_MOVE_LEFT :
00568       *GestureId = GESTURE_ID_MOVE_LEFT;
00569       break;
00570     case FT5336_GEST_ID_ZOOM_IN :
00571       *GestureId = GESTURE_ID_ZOOM_IN;
00572       break;
00573     case FT5336_GEST_ID_ZOOM_OUT :
00574       *GestureId = GESTURE_ID_ZOOM_OUT;
00575       break;
00576     default :
00577       *GestureId = GESTURE_ID_NO_GESTURE;
00578       break;
00579     }
00580   }
00581
00582   return ret;
00583 }
00584 #endif /* USE_TS_GESTURE == 1 */
00585
00586 /**
00587   * @brief  Set TS orientation
00588   * @param  Instance TS instance. Could be only 0.
00589   * @param  Orientation Orientation to be set
00590   * @retval BSP status
00591   */
00592 int32_t BSP_TS_Set_Orientation(uint32_t Instance, uint32_t Orientation)
00593 {
00594   Ts_Ctx[Instance].Orientation = Orientation;
00595   return BSP_ERROR_NONE;
00596 }
00597
00598 /**
00599   * @brief  Get TS orientation
00600   * @param  Instance TS instance. Could be only 0.
00601   * @param  Orientation Current Orientation to be returned
00602   * @retval BSP status
00603   */
00604 int32_t BSP_TS_Get_Orientation(uint32_t Instance, uint32_t *Orientation)
00605 {
00606   *Orientation = Ts_Ctx[Instance].Orientation;
00607   return BSP_ERROR_NONE;
00608 }
00609
00610 /**
00611   * @}
00612   */
00613 /** @defgroup STM32H735G_DK_TS_Private_Functions TS Private Functions
00614   * @{
00615   */
00616
00617 /**
00618   * @brief  Register Bus IOs if component ID is OK
00619   * @param  Instance TS instance. Could be only 0.
00620   * @retval BSP status
00621   */
00622 static int32_t FT5336_Probe(uint32_t Instance)
00623 {
00624   int32_t ret              = BSP_ERROR_NONE;
00625   FT5336_IO_t              IOCtx;
00626   static FT5336_Object_t   FT5336Obj;
00627   uint32_t ft5336_id       = 0;
00628
00629   /* Configure the touch screen driver */
00630   IOCtx.Address     = TS_I2C_ADDRESS;
00631   IOCtx.Init        = BSP_I2C4_Init;
00632   IOCtx.DeInit      = BSP_I2C4_DeInit;
00633   IOCtx.ReadReg     = BSP_I2C4_ReadReg;
00634   IOCtx.WriteReg    = BSP_I2C4_WriteReg;
00635   IOCtx.GetTick     = BSP_GetTick;
00636
00637   if(FT5336_RegisterBusIO (&FT5336Obj, &IOCtx) != FT5336_OK)
00638   {
00639     ret = BSP_ERROR_BUS_FAILURE;
00640   }
00641   else if(FT5336_ReadID(&FT5336Obj, &ft5336_id) != FT5336_OK)
00642   {
00643     ret = BSP_ERROR_COMPONENT_FAILURE;
00644   }
00645   else if(ft5336_id != FT5336_ID)
00646   {
00647     ret = BSP_ERROR_UNKNOWN_COMPONENT;
00648   }
00649   else
00650   {
00651     Ts_CompObj[Instance] = &FT5336Obj;
00652     Ts_Drv = (TS_Drv_t *) &FT5336_TS_Driver;
00653
00654     if(Ts_Drv->Init(Ts_CompObj[Instance]) != FT5336_OK)
00655     {
00656       ret = BSP_ERROR_COMPONENT_FAILURE;
00657     }
00658   }
00659
00660   return ret;
00661 }
00662
00663 /**
00664   * @brief  TS EXTI touch detection callbacks.
00665   * @retval None
00666   */
00667 static void TS_EXTI_Callback(void)
00668 {
00669   BSP_TS_Callback(0);
00670
00671   /* Clear interrupt on TS driver */
00672   if (Ts_Drv->ClearIT(Ts_CompObj) < 0)
00673   {
00674     /* Nothing to do */
00675   }
00676 }
00677
00678 /**
00679   * @}
00680   */
00681
00682
00683 /**
00684   * @}
00685   */
00686
00687 /**
00688   * @}
00689   */
00690
00691 /**
00692   * @}
00693   */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: stm32h735g_discovery_ts.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32H735G-DK
stm32h735g_discovery_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h735g_discovery_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h735g_discovery_ts.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2019 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32H735G_DK_TS_H
00022 #define STM32H735G_DK_TS_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32h735g_discovery_conf.h"
00030 #include "stm32h735g_discovery_errno.h"
00031
00032 #include "../Components/ft5336/ft5336.h"
00033 #include "../Components/Common/ts.h"
00034
00035 /** @addtogroup BSP
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32H735G_DK
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32H735G_DK_TS
00044   * @{
00045   */
00046
00047  /** @defgroup STM32H735G_DK_TS_Exported_Constants TS Exported Constants
00048    * @{
00049    */
00050 #ifndef USE_TS_MULTI_TOUCH
00051 #define USE_TS_MULTI_TOUCH          1U
00052 #endif
00053 #ifndef USE_TS_GESTURE
00054 #define USE_TS_GESTURE              1U
00055 #endif
00056
00057 #ifndef TS_TOUCH_NBR
00058 #define TS_TOUCH_NBR                     2U
00059 #endif
00060
00061 #define TS_INSTANCES_NBR            1
00062
00063 /* Maximum border values of the touchscreen pad */
00064 #define TS_MAX_WIDTH                480U     /* Touchscreen pad max width   */
00065 #define TS_MAX_HEIGHT               272U     /* Touchscreen pad max height  */
00066
00067 #define TS_SWAP_NONE                0x01U
00068 #define TS_SWAP_X                   0x02U
00069 #define TS_SWAP_Y                   0x04U
00070 #define TS_SWAP_XY                  0x08U
00071
00072 /**
00073   * @brief TouchScreen Slave I2C address 1
00074   */
00075 #define TS_I2C_ADDRESS              0x70U
00076
00077 /**
00078   * @brief Touch screen interrupt signal
00079   */
00080 #define TS_INT_PIN                   GPIO_PIN_2
00081 #define TS_INT_GPIO_PORT             GPIOG
00082 #define TS_INT_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOG_CLK_ENABLE()
00083 #define TS_INT_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOG_CLK_DISABLE()
00084 #define TS_INT_EXTI_IRQn             EXTI2_IRQn
00085 #define TS_EXTI_LINE                 EXTI_LINE_2
00086
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32H735G_DK_TS_Exported_Types  TS Exported Types
00092   * @{
00093   */
00094 typedef struct
00095 {
00096   uint32_t   Width;                  /* Screen Width */
00097   uint32_t   Height;                 /* Screen Height */
00098   uint32_t   Orientation;            /* Touch Screen orientation from the upper left position  */
00099   uint32_t   Accuracy;               /* Expressed in pixel and means the x or y difference vs old
00100                                         position to consider the new values valid */
00101 }TS_Init_t;
00102
00103 typedef struct
00104 {
00105   uint32_t   Width;
00106   uint32_t   Height;
00107   uint32_t   Orientation;
00108   uint32_t   Accuracy;
00109   uint32_t   MaxX;
00110   uint32_t   MaxY;
00111   uint32_t   PreviousX[TS_TOUCH_NBR];
00112   uint32_t   PreviousY[TS_TOUCH_NBR];
00113 } TS_Ctx_t;
00114
00115 typedef struct
00116 {
00117   uint8_t   MultiTouch;
00118   uint8_t   Gesture;
00119   uint8_t   MaxTouch;
00120   uint32_t  MaxXl;
00121   uint32_t  MaxYl;
00122 } TS_Capabilities_t;
00123
00124 typedef struct
00125 {
00126   uint32_t  TouchDetected;
00127   uint32_t  TouchX;
00128   uint32_t  TouchY;
00129 } TS_State_t;
00130
00131 typedef struct
00132 {
00133   uint32_t  TouchDetected;
00134   uint32_t  TouchX[TS_TOUCH_NBR];
00135   uint32_t  TouchY[TS_TOUCH_NBR];
00136   uint32_t  TouchWeight[TS_TOUCH_NBR];
00137   uint32_t  TouchEvent[TS_TOUCH_NBR];
00138   uint32_t  TouchArea[TS_TOUCH_NBR];
00139 } TS_MultiTouch_State_t;
00140
00141 #if (USE_TS_GESTURE > 0)
00142 /**
00143  *  @brief TS_Gesture_Id_t
00144  *  Define Possible managed gesture identification values returned by touch screen
00145  *  driver.
00146  */
00147 #define GESTURE_ID_NO_GESTURE   0x00U /*!< Gesture not defined / recognized */
00148 #define GESTURE_ID_MOVE_UP      0x01U /*!< Gesture Move Up */
00149 #define GESTURE_ID_MOVE_RIGHT   0x02U /*!< Gesture Move Right */
00150 #define GESTURE_ID_MOVE_DOWN    0x03U /*!< Gesture Move Down */
00151 #define GESTURE_ID_MOVE_LEFT    0x04U /*!< Gesture Move Left */
00152 #define GESTURE_ID_ZOOM_IN      0x05U /*!< Gesture Zoom In */
00153 #define GESTURE_ID_ZOOM_OUT     0x06U /*!< Gesture Zoom Out */
00154 #define GESTURE_ID_NB_MAX       0x07U /*!< max number of gesture id */
00155
00156 typedef struct
00157 {
00158   uint32_t  Radian;
00159   uint32_t  OffsetLeftRight;
00160   uint32_t  OffsetUpDown;
00161   uint32_t  DistanceLeftRight;
00162   uint32_t  DistanceUpDown;
00163   uint32_t  DistanceZoom;
00164 }TS_Gesture_Config_t;
00165
00166 #endif /* (USE_TS_GESTURE > 0) */
00167
00168 /**
00169  *  @brief TS_TouchEventTypeDef
00170  *  Define Possible touch events kind as returned values
00171  *  by touch screen IC Driver.
00172  */
00173 typedef enum
00174 {
00175   TOUCH_EVENT_NO_EVT        = 0x00, /*!< Touch Event : undetermined */
00176   TOUCH_EVENT_PRESS_DOWN    = 0x01, /*!< Touch Event Press Down */
00177   TOUCH_EVENT_LIFT_UP       = 0x02, /*!< Touch Event Lift Up */
00178   TOUCH_EVENT_CONTACT       = 0x03, /*!< Touch Event Contact */
00179   TOUCH_EVENT_NB_MAX        = 0x04  /*!< max number of touch events kind */
00180 } TS_TouchEventTypeDef;
00181
00182 /**
00183   * @}
00184   */
00185
00186 /** @addtogroup STM32H735G_DK_TS_Exported_Variables
00187   * @{
00188   */
00189 extern void               *Ts_CompObj[];
00190 extern EXTI_HandleTypeDef hts_exti[];
00191 extern TS_Ctx_t           Ts_Ctx[];
00192 /**
00193   * @}
00194   */
00195
00196 /** @defgroup STM32H735G_DK_TS_Exported_Functions TS Exported Functions
00197   * @{
00198   */
00199 int32_t BSP_TS_Init(uint32_t Instance, TS_Init_t *TS_Init);
00200 int32_t BSP_TS_DeInit(uint32_t Instance);
00201 int32_t BSP_TS_EnableIT(uint32_t Instance);
00202 int32_t BSP_TS_DisableIT(uint32_t Instance);
00203 int32_t BSP_TS_GetState(uint32_t Instance, TS_State_t *TS_State);
00204 #if (USE_TS_MULTI_TOUCH == 1)
00205 int32_t BSP_TS_Get_MultiTouchState(uint32_t Instance, TS_MultiTouch_State_t *TS_State);
00206 #endif /* USE_TS_MULTI_TOUCH == 1 */
00207 #if (USE_TS_GESTURE == 1)
00208 int32_t BSP_TS_GestureConfig(uint32_t Instance, TS_Gesture_Config_t *GestureConfig);
00209 int32_t BSP_TS_GetGestureId(uint32_t Instance, uint32_t *GestureId);
00210 #endif /* (USE_TS_GESTURE == 1) */
00211 int32_t BSP_TS_Set_Orientation(uint32_t Instance, uint32_t Orientation);
00212 int32_t BSP_TS_Get_Orientation(uint32_t Instance, uint32_t *Orientation);
00213 int32_t BSP_TS_GetCapabilities(uint32_t Instance, TS_Capabilities_t *Capabilities);
00214 void    BSP_TS_Callback(uint32_t Instance);
00215 void    BSP_TS_IRQHandler(uint32_t Instance);
00216
00217 /**
00218   * @}
00219   */
00220
00221 /**
00222   * @}
00223   */
00224
00225 /**
00226   * @}
00227   */
00228
00229 /**
00230   * @}
00231   */
00232
00233 #ifdef __cplusplus
00234 }
00235 #endif
00236
00237 #endif /* STM32H735G_DK_TS_H */
Generated on Mon Feb 19 2024 11:27:13 for STM32H735G-DK BSP User Manual by doxygen 1.7.6.1


STM32H735G-DK BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference