STM32H747I-Discovery BSP User Manual: STM32H747I-Discovery BSP Drivers

STM32H747I-Discovery BSP User Manual
  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories
STM32H747I-Discovery BSP Drivers

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32H747I-Discovery 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
09/24/2018 | V1.0 | boudinar | STM32H747I-Discovery Board
Generated on Mon Sep 24 2018 15:52:00 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Private Defines

  • Data Structures
  • Files
  • Directories
Defines
Private Defines
STM32H747I_DISCOVERY_LOW_LEVEL

Defines

#define | __STM32H747I_DISCOVERY_BSP_VERSION_MAIN (0x01)
STM32H747I Discovery BSP Driver version number V1.0.0.
#define | __STM32H747I_DISCOVERY_BSP_VERSION_SUB1 (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION_SUB2 (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION

Define Documentation

#define __STM32H747I_DISCOVERY_BSP_VERSION
Value:
((__STM32H747I_DISCOVERY_BSP_VERSION_MAIN << 24)\
                                                  |(__STM32H747I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
                                                  |(__STM32H747I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
                                                  |(__STM32H747I_DISCOVERY_BSP_VERSION_RC))

Definition at line 48 of file stm32h747i_discovery.c.

Referenced by BSP_GetVersion().

#define __STM32H747I_DISCOVERY_BSP_VERSION_MAIN (0x01)

STM32H747I Discovery BSP Driver version number V1.0.0.

[31:24] main version

Definition at line 44 of file stm32h747i_discovery.c.

#define __STM32H747I_DISCOVERY_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 47 of file stm32h747i_discovery.c.

#define __STM32H747I_DISCOVERY_BSP_VERSION_SUB1 (0x00)

[23:16] sub1 version

Definition at line 45 of file stm32h747i_discovery.c.

#define __STM32H747I_DISCOVERY_BSP_VERSION_SUB2 (0x00)

[15:8] sub2 version

Definition at line 46 of file stm32h747i_discovery.c.


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_LOW_LEVEL

Variables

GPIO_TypeDef * | GPIO_PORT [LEDn]
const uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }
const uint16_t | BUTTON_PIN [BUTTONn] = {WAKEUP_BUTTON_PIN }
const uint16_t | BUTTON_IRQn [BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }
GPIO_TypeDef * | JOY_PORT [JOYn]
const uint16_t | JOY_PIN [JOYn]
const uint8_t | JOY_IRQn [JOYn]
static I2C_HandleTypeDef | heval_I2c = {0}

Variable Documentation

const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }

Definition at line 75 of file stm32h747i_discovery.c.

Referenced by BSP_PB_DeInit(), and BSP_PB_Init().

const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN }

Definition at line 73 of file stm32h747i_discovery.c.

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

GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }

Definition at line 71 of file stm32h747i_discovery.c.

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

const uint32_t GPIO_PIN[LEDn]
Initial value:
 {LED1_PIN,
                                 LED2_PIN,
                                 LED3_PIN,
                                 LED4_PIN}

Definition at line 66 of file stm32h747i_discovery.c.

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

GPIO_TypeDef* GPIO_PORT[LEDn]
Initial value:
 {LED1_GPIO_PORT,
                                 LED2_GPIO_PORT,
                                 LED3_GPIO_PORT,
                                 LED4_GPIO_PORT}

Definition at line 61 of file stm32h747i_discovery.c.

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

I2C_HandleTypeDef heval_I2c = {0} [static]

Definition at line 95 of file stm32h747i_discovery.c.

Referenced by I2Cx_Error(), I2Cx_Init(), I2Cx_IsDeviceReady(), I2Cx_Read(), I2Cx_ReadMultiple(), I2Cx_Write(), and I2Cx_WriteMultiple().

const uint8_t JOY_IRQn[JOYn]
Initial value:
   {SEL_JOY_EXTI_IRQn,
                                  DOWN_JOY_EXTI_IRQn,
                                  LEFT_JOY_EXTI_IRQn,
                                  RIGHT_JOY_EXTI_IRQn,
                                  UP_JOY_EXTI_IRQn}

Definition at line 89 of file stm32h747i_discovery.c.

Referenced by BSP_JOY_Init().

const uint16_t JOY_PIN[JOYn]
Initial value:
   {SEL_JOY_PIN,
                                  DOWN_JOY_PIN,
                                  LEFT_JOY_PIN,
                                  RIGHT_JOY_PIN,
                                  UP_JOY_PIN}

Definition at line 83 of file stm32h747i_discovery.c.

Referenced by BSP_JOY_DeInit(), BSP_JOY_GetState(), and BSP_JOY_Init().

GPIO_TypeDef* JOY_PORT[JOYn]
Initial value:
   {SEL_JOY_GPIO_PORT,
                                  DOWN_JOY_GPIO_PORT,
                                  LEFT_JOY_GPIO_PORT,
                                  RIGHT_JOY_GPIO_PORT,
                                  UP_JOY_GPIO_PORT}

Definition at line 77 of file stm32h747i_discovery.c.

Referenced by BSP_JOY_DeInit(), BSP_JOY_GetState(), and BSP_JOY_Init().


STM32H747I-Discovery BSP User Manual: Private FunctionPrototypes

Functions
Private FunctionPrototypes
STM32H747I_DISCOVERY_LOW_LEVEL

Functions

void | HDMI_IO_Init (void)
void | HDMI_IO_Delay (uint32_t Delay)
void | HDMI_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
uint8_t | HDMI_IO_Read (uint8_t Addr, uint8_t Reg)
void | TS_IO_Init (void)
Initialize I2C communication channel from MCU to TouchScreen (TS).

Function Documentation

void HDMI_IO_Delay ( uint32_t Delay )

Referenced by LCD_IO_GetID().

void HDMI_IO_Init ( void )

Referenced by LCD_IO_GetID().

uint8_t HDMI_IO_Read | ( | uint8_t | Addr,
 |  | uint8_t | Reg
 | ) |  |

Referenced by LCD_IO_GetID().

void HDMI_IO_Write | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t | Value
 | ) |  |
void TS_IO_Init ( void )

Initialize I2C communication channel from MCU to TouchScreen (TS).

Definition at line 813 of file stm32h747i_discovery.c.

References I2Cx_Init().


STM32H747I-Discovery BSP User Manual: BSP Exported Functions

Functions
BSP Exported Functions
STM32H747I_DISCOVERY_LOW_LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32H747I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all joystick's buttons in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Un-configures all GPIOs used as joystick's buttons.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.

Function Documentation

uint32_t BSP_GetVersion ( void )

This method returns the STM32H747I Discovery BSP Driver revision.

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

Definition at line 160 of file stm32h747i_discovery.c.

References __STM32H747I_DISCOVERY_BSP_VERSION.

void BSP_JOY_DeInit ( void )

Un-configures all GPIOs used as joystick's buttons.

Return values:
None.

Definition at line 387 of file stm32h747i_discovery.c.

References JOY_PIN, JOY_PORT, JOY_SEL, JOYn, and JOYx_GPIO_CLK_ENABLE.

JOYState_TypeDef BSP_JOY_GetState ( void )

Returns the current joystick status.

Return values:
Code of the joystick key pressed This code can be one of the following values:
  • JOY_NONE
  • JOY_SEL
  • JOY_DOWN
  • JOY_LEFT
  • JOY_RIGHT
  • JOY_UP

Definition at line 412 of file stm32h747i_discovery.c.

References JOY_NONE, JOY_PIN, JOY_PORT, JOY_SEL, and JOYn.

uint8_t BSP_JOY_Init ( JOYMode_TypeDef Joy_Mode )

Configures all joystick's buttons in GPIO or EXTI modes.

Parameters:
Joy_Mode,: Joystick mode. This parameter can be one of the following values:
  • JOY_MODE_GPIO: Joystick pins will be used as simple IOs
  • JOY_MODE_EXTI: Joystick pins will be connected to EXTI line with interrupt generation capability
Return values:
HAL_OK,: if all initializations are OK. Other value if error.

Definition at line 347 of file stm32h747i_discovery.c.

References JOY_IRQn, JOY_MODE_EXTI, JOY_MODE_GPIO, JOY_PIN, JOY_PORT, JOY_SEL, JOYn, and JOYx_GPIO_CLK_ENABLE.

void 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
  • LED3
  • LED4
Note:
Led DeInit does not disable the GPIO clock
Return values:
None

Definition at line 206 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

Parameters:
Led,: LED to be configured. This parameter can be one of the following values:
  • LED1
  • LED2
  • LED3
  • LED4
Return values:
None

Definition at line 175 of file stm32h747i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LEDx_GPIO_CLK_ENABLE.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 239 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 224 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 254 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Note:
PB DeInit does not disable the GPIO clock
Return values:
None

Definition at line 315 of file stm32h747i_discovery.c.

References BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

uint32_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_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Return values:
The Button GPIO pin value

Definition at line 333 of file stm32h747i_discovery.c.

References BUTTON_PIN, and BUTTON_PORT.

void BSP_PB_Init | ( | Button_TypeDef | Button,
 |  | ButtonMode_TypeDef | Button_Mode
 | ) |  |

Configures button GPIO and EXTI Line.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Button_Mode,: 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:
None

Definition at line 272 of file stm32h747i_discovery.c.

References BUTTON_GPIO_CLK_ENABLE, BUTTON_IRQn, BUTTON_MODE_EXTI, BUTTON_MODE_GPIO, BUTTON_PIN, and BUTTON_PORT.


STM32H747I-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32H747I_DISCOVERY_LOW_LEVEL

Functions

static void | I2Cx_MspInit (void)
Initializes I2C MSP.
static void | I2Cx_Init (void)
Initializes I2C HAL.
static void | I2Cx_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
static uint8_t | I2Cx_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static HAL_StatusTypeDef | I2Cx_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
De-Initializes Audio low level.
void | AUDIO_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
Writes a single data.
uint16_t | AUDIO_IO_Read (uint8_t Addr, uint16_t Reg)
Reads a single data.
void | AUDIO_IO_Delay (uint32_t Delay)
AUDIO Codec delay.
void | CAMERA_IO_Init (void)
Initializes Camera low level.
void | CAMERA_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
Camera writes single data.
uint16_t | CAMERA_IO_Read (uint8_t Addr, uint16_t Reg)
Camera reads single data.
void | CAMERA_Delay (uint32_t Delay)
Camera delay.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes single data with I2C communication channel from MCU to TouchScreen.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from TouchScreen.
uint16_t | TS_IO_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Reads multiple data with I2C communication channel from TouchScreen.
void | TS_IO_WriteMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Writes multiple data with I2C communication channel from MCU to TouchScreen.
void | TS_IO_Delay (uint32_t Delay)
Delay function used in TouchScreen low level driver.
void | OTM8009A_IO_Delay (uint32_t Delay)
OTM8009A delay.

Function Documentation

void AUDIO_IO_DeInit ( void )

De-Initializes Audio low level.

Return values:
None

Definition at line 653 of file stm32h747i_discovery.c.

void AUDIO_IO_Delay ( uint32_t Delay )

AUDIO Codec delay.

Parameters:
Delay,: Delay in ms
Return values:
None

Definition at line 701 of file stm32h747i_discovery.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Return values:
None

Definition at line 644 of file stm32h747i_discovery.c.

References I2Cx_Init().

uint16_t AUDIO_IO_Read | ( | uint8_t | Addr,
 |  | uint16_t | Reg
 | ) |  |

Reads a single data.

Parameters:
Addr,: I2C address
Reg,: Reg address
Return values:
Data to be read

Definition at line 681 of file stm32h747i_discovery.c.

References I2Cx_ReadMultiple().

void AUDIO_IO_Write | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | Value
 | ) |  |

Writes a single data.

Parameters:
Addr,: I2C address
Reg,: Reg address
Value,: Data to be written
Return values:
None

Definition at line 664 of file stm32h747i_discovery.c.

References I2Cx_WriteMultiple().

void CAMERA_Delay ( uint32_t Delay )

Camera delay.

Parameters:
Delay,: Delay in ms
Return values:
None

Definition at line 753 of file stm32h747i_discovery.c.

void CAMERA_IO_Init ( void )

Initializes Camera low level.

Return values:
None

Definition at line 712 of file stm32h747i_discovery.c.

References I2Cx_Init().

uint16_t CAMERA_IO_Read | ( | uint8_t | Addr,
 |  | uint16_t | Reg
 | ) |  |

Camera reads single data.

Parameters:
Addr,: I2C address
Reg,: Register address
Return values:
Read data

Definition at line 737 of file stm32h747i_discovery.c.

References I2Cx_ReadMultiple().

void CAMERA_IO_Write | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | Value
 | ) |  |

Camera writes single data.

Parameters:
Addr,: I2C address
Reg,: Register address
Value,: Data to be written
Return values:
None

Definition at line 724 of file stm32h747i_discovery.c.

References I2Cx_WriteMultiple().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Return values:
None

Definition at line 764 of file stm32h747i_discovery.c.

References I2Cx_Init().

HAL_StatusTypeDef EEPROM_IO_IsDeviceReady | ( | uint16_t | DevAddress,
 |  | uint32_t | Trials
 | ) |  |

Checks if target device is ready for communication.

Note:
This function is used with Memory devices
Parameters:
DevAddress,: Target device address
Trials,: Number of trials
Return values:
HAL status

Definition at line 802 of file stm32h747i_discovery.c.

References I2Cx_IsDeviceReady().

HAL_StatusTypeDef EEPROM_IO_ReadData | ( | uint16_t | DevAddress,
 |  | uint16_t | MemAddress,
 |  | uint8_t * | pBuffer,
 |  | uint32_t | BufferSize
 | ) |  |

Read data from I2C EEPROM driver in using DMA channel.

Parameters:
DevAddress,: Target device address
MemAddress,: Internal memory address
pBuffer,: Pointer to data buffer
BufferSize,: Amount of data to be read
Return values:
HAL status

Definition at line 790 of file stm32h747i_discovery.c.

References I2Cx_ReadMultiple().

HAL_StatusTypeDef EEPROM_IO_WriteData | ( | uint16_t | DevAddress,
 |  | uint16_t | MemAddress,
 |  | uint8_t * | pBuffer,
 |  | uint32_t | BufferSize
 | ) |  |

Write data to I2C EEPROM driver in using DMA channel.

Parameters:
DevAddress,: Target device address
MemAddress,: Internal memory address
pBuffer,: Pointer to data buffer
BufferSize,: Amount of data to be sent
Return values:
HAL status

Definition at line 777 of file stm32h747i_discovery.c.

References I2Cx_WriteMultiple().

static void I2Cx_Error ( uint8_t Addr ) [static]

Manages error callback by re-initializing I2C.

Parameters:
Addr,: I2C Address
Return values:
None

Definition at line 625 of file stm32h747i_discovery.c.

References heval_I2c, and I2Cx_Init().

Referenced by I2Cx_Read(), I2Cx_ReadMultiple(), I2Cx_Write(), and I2Cx_WriteMultiple().

static void I2Cx_Init ( void ) [static]

Initializes I2C HAL.

Return values:
None

Definition at line 497 of file stm32h747i_discovery.c.

References DISCOVERY_I2Cx, heval_I2c, and I2Cx_MspInit().

Referenced by AUDIO_IO_Init(), CAMERA_IO_Init(), EEPROM_IO_Init(), I2Cx_Error(), and TS_IO_Init().

static HAL_StatusTypeDef I2Cx_IsDeviceReady | ( | uint16_t | DevAddress,
 |  | uint32_t | Trials
 | ) |  | [static]

Checks if target device is ready for communication.

Note:
This function is used with Memory devices
Parameters:
DevAddress,: Target device address
Trials,: Number of trials
Return values:
HAL status

Definition at line 615 of file stm32h747i_discovery.c.

References heval_I2c.

Referenced by EEPROM_IO_IsDeviceReady().

static void I2Cx_MspInit ( void ) [static]

Initializes I2C MSP.

Return values:
None

Definition at line 445 of file stm32h747i_discovery.c.

References DISCOVERY_I2Cx_CLK_ENABLE, DISCOVERY_I2Cx_ER_IRQn, DISCOVERY_I2Cx_EV_IRQn, DISCOVERY_I2Cx_FORCE_RESET, DISCOVERY_I2Cx_RELEASE_RESET, DISCOVERY_I2Cx_SCL_PIN, DISCOVERY_I2Cx_SCL_SDA_AF, DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE, DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT, and DISCOVERY_I2Cx_SDA_PIN.

Referenced by I2Cx_Init().

static uint8_t I2Cx_Read | ( | uint8_t | Addr,
 |  | uint8_t | Reg
 | ) |  | [static]

Reads a single data.

Parameters:
Addr,: I2C address
Reg,: Register address
Return values:
Read data

Definition at line 544 of file stm32h747i_discovery.c.

References heval_I2c, and I2Cx_Error().

Referenced by TS_IO_Read().

static HAL_StatusTypeDef I2Cx_ReadMultiple | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddress,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  | [static]

Reads multiple data.

Parameters:
Addr,: I2C address
Reg,: Reg address
MemAddress,: memory address
Buffer,: Pointer to data buffer
Length,: Length of the data
Return values:
HAL status

Definition at line 569 of file stm32h747i_discovery.c.

References heval_I2c, and I2Cx_Error().

Referenced by AUDIO_IO_Read(), CAMERA_IO_Read(), EEPROM_IO_ReadData(), and TS_IO_ReadMultiple().

static void I2Cx_Write | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t | Value
 | ) |  | [static]

Writes a single data.

Parameters:
Addr,: I2C address
Reg,: Register address
Value,: Data to be written
Return values:
None

Definition at line 524 of file stm32h747i_discovery.c.

References heval_I2c, and I2Cx_Error().

Referenced by TS_IO_Write().

static HAL_StatusTypeDef I2Cx_WriteMultiple | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddress,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  | [static]

Writes a value in a register of the device through BUS in using DMA mode.

Parameters:
Addr,: Device address on BUS Bus.
Reg,: The target register address to write
MemAddress,: memory address
Buffer,: The target register value to be written
Length,: buffer size to be written
Return values:
HAL status

Definition at line 593 of file stm32h747i_discovery.c.

References heval_I2c, and I2Cx_Error().

Referenced by AUDIO_IO_Write(), CAMERA_IO_Write(), EEPROM_IO_WriteData(), and TS_IO_WriteMultiple().

void OTM8009A_IO_Delay ( uint32_t Delay )

OTM8009A delay.

Parameters:
Delay,: Delay in ms

Definition at line 885 of file stm32h747i_discovery.c.

void TS_IO_Delay ( uint32_t Delay )

Delay function used in TouchScreen low level driver.

Parameters:
Delay,: Delay in ms
Return values:
None

Definition at line 875 of file stm32h747i_discovery.c.

uint8_t TS_IO_Read | ( | uint8_t | Addr,
 |  | uint8_t | Reg
 | ) |  |

Reads single data with I2C communication channel from TouchScreen.

Parameters:
Addr,: I2C address
Reg,: Register address
Return values:
Read data

Definition at line 837 of file stm32h747i_discovery.c.

References I2Cx_Read().

uint16_t TS_IO_ReadMultiple | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  |

Reads multiple data with I2C communication channel from TouchScreen.

Parameters:
Addr,: I2C address
Reg,: Register address
Buffer,: Pointer to data buffer
Length,: Length of the data
Return values:
Number of read data

Definition at line 851 of file stm32h747i_discovery.c.

References I2Cx_ReadMultiple().

void TS_IO_Write | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t | Value
 | ) |  |

Writes single data with I2C communication channel from MCU to TouchScreen.

Parameters:
Addr,: I2C address
Reg,: Register address
Value,: Data to be written

Definition at line 825 of file stm32h747i_discovery.c.

References I2Cx_Write().

void TS_IO_WriteMultiple | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  |

Writes multiple data with I2C communication channel from MCU to TouchScreen.

Parameters:
Addr,: I2C address
Reg,: Register address
Buffer,: Pointer to data buffer
Length,: Length of the data
Return values:
None

Definition at line 865 of file stm32h747i_discovery.c.

References I2Cx_WriteMultiple().


STM32H747I-Discovery BSP User Manual: Exported Types

Defines | Enumerations
Exported Types
STM32H747I_DISCOVERY_LOW_LEVEL

Defines

#define | BUTTON_USER BUTTON_WAKEUP

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_ORANGE = LED2,
LED3 = 2, LED_RED = LED3, LED4 = 3, LED_BLUE = LED4
}
Led_TypeDef STM32H747I_DISCOVERY board leds definitions. More...
enum | Button_TypeDef { BUTTON_WAKEUP = 0 }
Button_TypeDef STM32H747I_DISCOVERY board Buttons definitions. More...
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
ButtonMode_TypeDef STM32H747I_DISCOVERY board Buttons Modes definitions. More...
enum | ButtonValue_TypeDef { PB_SET = 0, PB_RESET = !PB_SET }
enum | JOYMode_TypeDef { JOY_MODE_GPIO = 0, JOY_MODE_EXTI = 1 }
enum JOYState_TypeDef {
JOY_SEL = 0, JOY_DOWN = 1, JOY_LEFT = 2, JOY_RIGHT = 3,
JOY_UP = 4, JOY_NONE = 5
}
enum | DISCO_Status_TypeDef { DISCO_OK = 0, DISCO_ERROR = 1 }
DISCO_Status_TypeDef STM32H747I_DISCO board Status return possible values. More...

Define Documentation

#define BUTTON_USER BUTTON_WAKEUP

Definition at line 71 of file stm32h747i_discovery.h.

Enumeration Type Documentation

enum Button_TypeDef

Button_TypeDef STM32H747I_DISCOVERY board Buttons definitions.

Enumerator:
BUTTON_WAKEUP

Definition at line 66 of file stm32h747i_discovery.h.

enum ButtonMode_TypeDef

ButtonMode_TypeDef STM32H747I_DISCOVERY board Buttons Modes definitions.

Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 76 of file stm32h747i_discovery.h.

enum ButtonValue_TypeDef
Enumerator:
PB_SET
PB_RESET

Definition at line 83 of file stm32h747i_discovery.h.

enum DISCO_Status_TypeDef

DISCO_Status_TypeDef STM32H747I_DISCO board Status return possible values.

Enumerator:
DISCO_OK
DISCO_ERROR

Definition at line 108 of file stm32h747i_discovery.h.

enum JOYMode_TypeDef
Enumerator:
JOY_MODE_GPIO
JOY_MODE_EXTI

Definition at line 89 of file stm32h747i_discovery.h.

enum JOYState_TypeDef
Enumerator:
JOY_SEL
JOY_DOWN
JOY_LEFT
JOY_RIGHT
JOY_UP
JOY_NONE

Definition at line 95 of file stm32h747i_discovery.h.

enum Led_TypeDef

Led_TypeDef STM32H747I_DISCOVERY board leds definitions.

Enumerator:
LED1
LED_GREEN
LED2
LED_ORANGE
LED3
LED_RED
LED4
LED_BLUE

Definition at line 51 of file stm32h747i_discovery.h.


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_LOW_LEVEL

Defines

#define | LEDn ((uint32_t)4)
Define for STM32H747I_DISCOVERY board.
#define | LED1_GPIO_PORT GPIOI
#define | LED1_PIN GPIO_PIN_12
#define | LED2_GPIO_PORT GPIOI
#define | LED2_PIN GPIO_PIN_13
#define | LED3_GPIO_PORT GPIOI
#define | LED3_PIN GPIO_PIN_14
#define | LED4_GPIO_PORT GPIOI
#define | LED4_PIN GPIO_PIN_15
#define | LEDx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LEDx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | BUTTONn ((uint8_t)1)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_13
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOC
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | USER_BUTTON_PIN WAKEUP_BUTTON_PIN
#define | USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
#define | USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
#define | USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
#define | USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
#define | BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | JOYn ((uint8_t)5)
#define | SEL_JOY_PIN GPIO_PIN_2
Joystick Selection push-button.
#define | SEL_JOY_GPIO_PORT GPIOK
#define | SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | SEL_JOY_EXTI_IRQn EXTI2_IRQn
#define | DOWN_JOY_PIN GPIO_PIN_3
Joystick Down push-button.
#define | DOWN_JOY_GPIO_PORT GPIOK
#define | DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | DOWN_JOY_EXTI_IRQn EXTI3_IRQn
#define | LEFT_JOY_PIN GPIO_PIN_4
Joystick Left push-button.
#define | LEFT_JOY_GPIO_PORT GPIOK
#define | LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | LEFT_JOY_EXTI_IRQn EXTI4_IRQn
#define | RIGHT_JOY_PIN GPIO_PIN_5
Joystick Right push-button.
#define | RIGHT_JOY_GPIO_PORT GPIOK
#define | RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | RIGHT_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | UP_JOY_PIN GPIO_PIN_6
Joystick Up push-button.
#define | UP_JOY_GPIO_PORT GPIOK
#define | UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | UP_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | JOYx_GPIO_CLK_ENABLE(__JOY__)
#define | JOYx_GPIO_CLK_DISABLE(__JOY__)
#define | JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
#define | OTG_HS_OVER_CURRENT_PIN GPIO_PIN_1
USB OTG HS Over Current signal.
#define | OTG_HS_OVER_CURRENT_PORT GPIOJ
#define | OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | SD_DETECT_PIN ((uint32_t)GPIO_PIN_8)
SD-detect signal.
#define | SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_INT_PIN ((uint32_t)GPIO_PIN_7)
TS_INT signal from TouchScreen when it is configured in interrupt mode GPIOI13 is used for that purpose on Manta Dragon Discovery board.
#define | TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_I2C_ADDRESS ((uint16_t)0x54)
TouchScreen FT6206 Slave I2C address.
#define | TS3510_I2C_ADDRESS ((uint16_t)0x80)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
Audio I2C Slave address.
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x60)
#define | DISCOVERY_I2Cx I2C4
User can use this section to tailor I2C4/I2C4 instance used and associated resources (audio codec).
#define | DISCOVERY_I2Cx_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
#define | DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | DISCOVERY_I2Cx_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
#define | DISCOVERY_I2Cx_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
#define | DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_12
Definition for I2C4 Pins.
#define | DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_13
#define | DISCOVERY_I2Cx_SCL_SDA_AF GPIO_AF4_I2C4
#define | DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT GPIOD
#define | DISCOVERY_I2Cx_EV_IRQn I2C4_EV_IRQn
Definition of I2C4 interrupt requests.
#define | DISCOVERY_I2Cx_ER_IRQn I2C4_ER_IRQn

Define Documentation

#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)

Audio I2C Slave address.

Definition at line 264 of file stm32h747i_discovery.h.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

#define BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 165 of file stm32h747i_discovery.h.

Referenced by BSP_PB_Init().

#define BUTTONn ((uint8_t)1)

Definition at line 147 of file stm32h747i_discovery.h.

#define CAMERA_I2C_ADDRESS ((uint16_t)0x60)

Definition at line 266 of file stm32h747i_discovery.h.

Referenced by BSP_CAMERA_Init().

#define DISCOVERY_I2Cx I2C4

User can use this section to tailor I2C4/I2C4 instance used and associated resources (audio codec).

Definition for I2C4 clock resources

Definition at line 273 of file stm32h747i_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C4_CLK_ENABLE()

Definition at line 274 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_ER_IRQn I2C4_ER_IRQn

Definition at line 289 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_EV_IRQn I2C4_EV_IRQn

Definition of I2C4 interrupt requests.

Definition at line 288 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C4_FORCE_RESET()

Definition at line 277 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C4_RELEASE_RESET()

Definition at line 278 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_12

Definition for I2C4 Pins.

PD12

Definition at line 282 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_SCL_SDA_AF GPIO_AF4_I2C4

Definition at line 284 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 275 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT GPIOD

Definition at line 285 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_13

PD13

Definition at line 283 of file stm32h747i_discovery.h.

Referenced by I2Cx_MspInit().

#define DOWN_JOY_EXTI_IRQn EXTI3_IRQn

Definition at line 185 of file stm32h747i_discovery.h.

#define DOWN_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 184 of file stm32h747i_discovery.h.

#define DOWN_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 183 of file stm32h747i_discovery.h.

#define DOWN_JOY_GPIO_PORT GPIOK

Definition at line 182 of file stm32h747i_discovery.h.

#define DOWN_JOY_PIN GPIO_PIN_3

Joystick Down push-button.

Definition at line 181 of file stm32h747i_discovery.h.

#define JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)

Definition at line 226 of file stm32h747i_discovery.h.

#define JOYn ((uint8_t)5)

Definition at line 167 of file stm32h747i_discovery.h.

Referenced by BSP_JOY_DeInit(), BSP_JOY_GetState(), and BSP_JOY_Init().

#define JOYx_GPIO_CLK_DISABLE ( __JOY__ )
Value:
do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_DISABLE();   } else \
                                               if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_DISABLE();  } else \
                                               if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_DISABLE();  } else \
                                               if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_DISABLE(); } else \
                                               if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_DISABLE(); }  } while(0)

Definition at line 220 of file stm32h747i_discovery.h.

#define JOYx_GPIO_CLK_ENABLE ( __JOY__ )
Value:
do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_ENABLE();   } else \
                                               if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_ENABLE();  } else \
                                               if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_ENABLE();  } else \
                                               if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_ENABLE(); } else \
                                               if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_ENABLE(); }  } while(0)

Definition at line 214 of file stm32h747i_discovery.h.

Referenced by BSP_JOY_DeInit(), and BSP_JOY_Init().

#define LED1_GPIO_PORT GPIOI

Definition at line 131 of file stm32h747i_discovery.h.

#define LED1_PIN GPIO_PIN_12

Definition at line 132 of file stm32h747i_discovery.h.

#define LED2_GPIO_PORT GPIOI

Definition at line 134 of file stm32h747i_discovery.h.

#define LED2_PIN GPIO_PIN_13

Definition at line 135 of file stm32h747i_discovery.h.

#define LED3_GPIO_PORT GPIOI

Definition at line 137 of file stm32h747i_discovery.h.

#define LED3_PIN GPIO_PIN_14

Definition at line 138 of file stm32h747i_discovery.h.

#define LED4_GPIO_PORT GPIOI

Definition at line 140 of file stm32h747i_discovery.h.

#define LED4_PIN GPIO_PIN_15

Definition at line 141 of file stm32h747i_discovery.h.

#define LEDn ((uint32_t)4)

Define for STM32H747I_DISCOVERY board.

Definition at line 129 of file stm32h747i_discovery.h.

#define LEDx_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 144 of file stm32h747i_discovery.h.

#define LEDx_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 143 of file stm32h747i_discovery.h.

Referenced by BSP_LED_Init().

#define LEFT_JOY_EXTI_IRQn EXTI4_IRQn

Definition at line 194 of file stm32h747i_discovery.h.

#define LEFT_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 193 of file stm32h747i_discovery.h.

#define LEFT_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 192 of file stm32h747i_discovery.h.

#define LEFT_JOY_GPIO_PORT GPIOK

Definition at line 191 of file stm32h747i_discovery.h.

#define LEFT_JOY_PIN GPIO_PIN_4

Joystick Left push-button.

Definition at line 190 of file stm32h747i_discovery.h.

#define OTG_HS_OVER_CURRENT_PIN GPIO_PIN_1

USB OTG HS Over Current signal.

Definition at line 232 of file stm32h747i_discovery.h.

#define OTG_HS_OVER_CURRENT_PORT GPIOJ

Definition at line 233 of file stm32h747i_discovery.h.

#define OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE ( ) __HAL_RCC_GPIOJ_CLK_ENABLE()

Definition at line 234 of file stm32h747i_discovery.h.

#define RIGHT_JOY_EXTI_IRQn EXTI9_5_IRQn

Definition at line 203 of file stm32h747i_discovery.h.

#define RIGHT_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 202 of file stm32h747i_discovery.h.

#define RIGHT_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 201 of file stm32h747i_discovery.h.

#define RIGHT_JOY_GPIO_PORT GPIOK

Definition at line 200 of file stm32h747i_discovery.h.

#define RIGHT_JOY_PIN GPIO_PIN_5

Joystick Right push-button.

Definition at line 199 of file stm32h747i_discovery.h.

#define SD_DETECT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 243 of file stm32h747i_discovery.h.

Referenced by BSP_SD_ITConfig().

#define SD_DETECT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 242 of file stm32h747i_discovery.h.

#define SD_DETECT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 241 of file stm32h747i_discovery.h.

#define SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)

Definition at line 240 of file stm32h747i_discovery.h.

Referenced by BSP_SD_IsDetected(), and BSP_SD_ITConfig().

#define SD_DETECT_PIN ((uint32_t)GPIO_PIN_8)

SD-detect signal.

Definition at line 239 of file stm32h747i_discovery.h.

Referenced by BSP_SD_IsDetected(), and BSP_SD_ITConfig().

#define SEL_JOY_EXTI_IRQn EXTI2_IRQn

Definition at line 176 of file stm32h747i_discovery.h.

#define SEL_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 175 of file stm32h747i_discovery.h.

#define SEL_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 174 of file stm32h747i_discovery.h.

#define SEL_JOY_GPIO_PORT GPIOK

Definition at line 173 of file stm32h747i_discovery.h.

#define SEL_JOY_PIN GPIO_PIN_2

Joystick Selection push-button.

Definition at line 172 of file stm32h747i_discovery.h.

#define TS3510_I2C_ADDRESS ((uint16_t)0x80)

Definition at line 259 of file stm32h747i_discovery.h.

#define TS_I2C_ADDRESS ((uint16_t)0x54)

TouchScreen FT6206 Slave I2C address.

Definition at line 258 of file stm32h747i_discovery.h.

Referenced by BSP_TS_Init().

#define TS_INT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 253 of file stm32h747i_discovery.h.

Referenced by BSP_TS_ITConfig().

#define TS_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 252 of file stm32h747i_discovery.h.

#define TS_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 251 of file stm32h747i_discovery.h.

Referenced by BSP_TS_INT_MspInit().

#define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOK)

Definition at line 250 of file stm32h747i_discovery.h.

Referenced by BSP_TS_INT_MspInit(), and BSP_TS_ITConfig().

#define TS_INT_PIN ((uint32_t)GPIO_PIN_7)

TS_INT signal from TouchScreen when it is configured in interrupt mode GPIOI13 is used for that purpose on Manta Dragon Discovery board.

Definition at line 249 of file stm32h747i_discovery.h.

Referenced by BSP_TS_INT_MspInit(), and BSP_TS_ITConfig().

#define UP_JOY_EXTI_IRQn EXTI9_5_IRQn

Definition at line 212 of file stm32h747i_discovery.h.

#define UP_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 211 of file stm32h747i_discovery.h.

#define UP_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 210 of file stm32h747i_discovery.h.

#define UP_JOY_GPIO_PORT GPIOK

Definition at line 209 of file stm32h747i_discovery.h.

#define UP_JOY_PIN GPIO_PIN_6

Joystick Up push-button.

Definition at line 208 of file stm32h747i_discovery.h.

#define USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn

Definition at line 163 of file stm32h747i_discovery.h.

#define USER_BUTTON_GPIO_CLK_DISABLE ( ) WAKEUP_BUTTON_GPIO_CLK_DISABLE()

Definition at line 162 of file stm32h747i_discovery.h.

#define USER_BUTTON_GPIO_CLK_ENABLE ( ) WAKEUP_BUTTON_GPIO_CLK_ENABLE()

Definition at line 161 of file stm32h747i_discovery.h.

#define USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT

Definition at line 160 of file stm32h747i_discovery.h.

#define USER_BUTTON_PIN WAKEUP_BUTTON_PIN

Definition at line 159 of file stm32h747i_discovery.h.

#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 156 of file stm32h747i_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 155 of file stm32h747i_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 154 of file stm32h747i_discovery.h.

#define WAKEUP_BUTTON_GPIO_PORT GPIOC

Definition at line 153 of file stm32h747i_discovery.h.

#define WAKEUP_BUTTON_PIN GPIO_PIN_13

Wakeup push-button.

Definition at line 152 of file stm32h747i_discovery.h.


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions

Functions
STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions
STM32H747I_DISCOVERY_LOW_LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32H747I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all joystick's buttons in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Un-configures all GPIOs used as joystick's buttons.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.

Function Documentation

uint32_t BSP_GetVersion ( void )

This method returns the STM32H747I Discovery BSP Driver revision.

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

Definition at line 160 of file stm32h747i_discovery.c.

References __STM32H747I_DISCOVERY_BSP_VERSION.

void BSP_JOY_DeInit ( void )

Un-configures all GPIOs used as joystick's buttons.

Return values:
None.

Definition at line 387 of file stm32h747i_discovery.c.

References JOY_PIN, JOY_PORT, JOY_SEL, JOYn, and JOYx_GPIO_CLK_ENABLE.

JOYState_TypeDef BSP_JOY_GetState ( void )

Returns the current joystick status.

Return values:
Code of the joystick key pressed This code can be one of the following values:
  • JOY_NONE
  • JOY_SEL
  • JOY_DOWN
  • JOY_LEFT
  • JOY_RIGHT
  • JOY_UP

Definition at line 412 of file stm32h747i_discovery.c.

References JOY_NONE, JOY_PIN, JOY_PORT, JOY_SEL, and JOYn.

uint8_t BSP_JOY_Init ( JOYMode_TypeDef Joy_Mode )

Configures all joystick's buttons in GPIO or EXTI modes.

Parameters:
Joy_Mode,: Joystick mode. This parameter can be one of the following values:
  • JOY_MODE_GPIO: Joystick pins will be used as simple IOs
  • JOY_MODE_EXTI: Joystick pins will be connected to EXTI line with interrupt generation capability
Return values:
HAL_OK,: if all initializations are OK. Other value if error.

Definition at line 347 of file stm32h747i_discovery.c.

References JOY_IRQn, JOY_MODE_EXTI, JOY_MODE_GPIO, JOY_PIN, JOY_PORT, JOY_SEL, JOYn, and JOYx_GPIO_CLK_ENABLE.

void 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
  • LED3
  • LED4
Note:
Led DeInit does not disable the GPIO clock
Return values:
None

Definition at line 206 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

Parameters:
Led,: LED to be configured. This parameter can be one of the following values:
  • LED1
  • LED2
  • LED3
  • LED4
Return values:
None

Definition at line 175 of file stm32h747i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LEDx_GPIO_CLK_ENABLE.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 239 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 224 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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
  • LED3
  • LED4
Return values:
None

Definition at line 254 of file stm32h747i_discovery.c.

References GPIO_PIN, and GPIO_PORT.

void 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_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Note:
PB DeInit does not disable the GPIO clock
Return values:
None

Definition at line 315 of file stm32h747i_discovery.c.

References BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

uint32_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_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Return values:
The Button GPIO pin value

Definition at line 333 of file stm32h747i_discovery.c.

References BUTTON_PIN, and BUTTON_PORT.

void BSP_PB_Init | ( | Button_TypeDef | Button,
 |  | ButtonMode_TypeDef | Button_Mode
 | ) |  |

Configures button GPIO and EXTI Line.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Button_Mode,: 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:
None

Definition at line 272 of file stm32h747i_discovery.c.

References BUTTON_GPIO_CLK_ENABLE, BUTTON_IRQn, BUTTON_MODE_EXTI, BUTTON_MODE_GPIO, BUTTON_PIN, and BUTTON_PORT.


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_AUDIO

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai
SAI_HandleTypeDef | haudio_in_sai
AUDIOIN_ContextTypeDef hAudioIn
__IO uint16_t | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME
PDM_Filter_Handler_t | PDM_FilterHandler [2]
PDM_Filter_Config_t | PDM_FilterConfig [2]

Variable Documentation

AUDIO_DrvTypeDef* audio_drv

Definition at line 137 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

__IO uint16_t AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Definition at line 147 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_SetVolume().

SAI_HandleTypeDef haudio_in_sai

Definition at line 139 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_MspDeInit(), BSP_AUDIO_IN_MspInit(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), and SAIx_In_Init().

SAI_HandleTypeDef haudio_out_sai

Definition at line 138 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_ChangeBuffer(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_Stop(), and SAIx_Out_Init().

AUDIOIN_ContextTypeDef hAudioIn

Definition at line 142 of file stm32h747i_discovery_audio.c.

PDM_Filter_Config_t PDM_FilterConfig[2]

Definition at line 151 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM_Init().

PDM_Filter_Handler_t PDM_FilterHandler[2]

Definition at line 150 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and BSP_AUDIO_IN_PDMToPCM_Init().


STM32H747I-Discovery BSP User Manual: Private FunctionPrototypes

Private FunctionPrototypes
STM32H747I_DISCOVERY_AUDIO


STM32H747I-Discovery BSP User Manual: OUT Exported Functions

Functions
OUT Exported Functions
STM32H747I_DISCOVERY_AUDIO

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio Out peripheral.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
uint8_t | BSP_AUDIO_OUT_Pause (void)
This function Pauses the audio file stream.
uint8_t | BSP_AUDIO_OUT_Resume (void)
Resumes the audio file stream.
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option)
Stops audio playing and Power down the Audio Codec.
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
Controls the current audio volume level.
uint8_t | BSP_AUDIO_OUT_SetMute (uint32_t Cmd)
Enables or disables the MUTE mode by software.
uint8_t | BSP_AUDIO_OUT_SetOutputMode (uint8_t Output)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
void | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_SetAudioFrameSlot (uint32_t AudioFrameSlot)
Updates the Audio frame slot configuration.
void | BSP_AUDIO_OUT_DeInit (void)
De-initializes the audio out peripheral.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (void)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (void)
Manages the DMA FIFO error event.
__weak void | BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_OUT MSP.
__weak void | BSP_AUDIO_OUT_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
Deinitializes SAI MSP.
__weak void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.

Function Documentation

void BSP_AUDIO_OUT_ChangeBuffer | ( | uint16_t * | pData,
 |  | uint16_t | Size
 | ) |  |

Sends n-Bytes on the SAI interface.

Parameters:
pData,: pointer on data address
Size,: number of data to be written
Return values:
None

Definition at line 264 of file stm32h747i_discovery_audio.c.

References haudio_out_sai.

void BSP_AUDIO_OUT_ClockConfig | ( | SAI_HandleTypeDef * | hsai,
 |  | uint32_t | AudioFreq,
 |  | void * | Params
 | ) |  |

Clock Config.

Parameters:
hsai,: might be required to set audio peripheral predivider if any.
AudioFreq,: Audio frequency used to play the audio stream.
Params,: pointer on additional configuration parameters, can be NULL.
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:
None

Definition at line 600 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetFrequency().

void BSP_AUDIO_OUT_DeInit ( void )

De-initializes the audio out peripheral.

Return values:
None

Definition at line 457 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_OUT_MspDeInit(), haudio_out_sai, and SAIx_Out_DeInit().

void BSP_AUDIO_OUT_Error_CallBack ( void )

Manages the DMA FIFO error event.

Return values:
None

Definition at line 484 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

void BSP_AUDIO_OUT_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 476 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_TxHalfCpltCallback().

uint8_t BSP_AUDIO_OUT_Init | ( | uint16_t | OutputDevice,
 |  | uint8_t | Volume,
 |  | uint32_t | AudioFreq
 | ) |  |

Configures the audio Out peripheral.

Parameters:
OutputDevice,: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
Volume,: Initial volume level (from 0 (Mute) to 100 (Max))
AudioFreq,: Audio frequency used to play the audio stream.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 183 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_SAIx, BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_0123, haudio_out_sai, SAIx_Out_DeInit(), and SAIx_Out_Init().

void BSP_AUDIO_OUT_MspDeInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  |

Deinitializes SAI MSP.

Parameters:
hsai,: SAI handle
Params,: pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 561 of file stm32h747i_discovery_audio.c.

References AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_CLK_DISABLE, AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT, and AUDIO_OUT_SAIx_SD_PIN.

Referenced by BSP_AUDIO_OUT_DeInit().

void BSP_AUDIO_OUT_MspInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  |

Initializes BSP_AUDIO_OUT MSP.

Parameters:
hsai,: SAI handle
Params,: pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 494 of file stm32h747i_discovery_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_AF, AUDIO_OUT_SAIx_CLK_ENABLE, AUDIO_OUT_SAIx_DMAx_CLK_ENABLE, AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE, AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE, AUDIO_OUT_SAIx_DMAx_REQUEST, AUDIO_OUT_SAIx_DMAx_STREAM, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_MCLK_ENABLE, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE, AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT, and AUDIO_OUT_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_OUT_Init(), and BSP_AUDIO_OUT_Init().

uint8_t BSP_AUDIO_OUT_Pause ( void )

This function Pauses the audio file stream.

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

Warning:
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 behaviour).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 277 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_out_sai.

uint8_t BSP_AUDIO_OUT_Play | ( | uint16_t * | pBuffer,
 |  | uint32_t | Size
 | ) |  |

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

Parameters:
pBuffer,: Pointer to the buffer
Size,: Number of audio data BYTES.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 242 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIODATA_SIZE, DMA_MAX, and haudio_out_sai.

uint8_t BSP_AUDIO_OUT_Resume ( void )

Resumes the audio file stream.

Warning:
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 behaviour).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 301 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_out_sai.

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t AudioFrameSlot )

Updates the Audio frame slot configuration.

Parameters:
AudioFrameSlot,: specifies the audio Frame slot
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frame slot.
Return values:
None

Definition at line 440 of file stm32h747i_discovery_audio.c.

References haudio_out_sai.

void BSP_AUDIO_OUT_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: 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:
None

Definition at line 417 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_OUT_ClockConfig(), and haudio_out_sai.

uint8_t BSP_AUDIO_OUT_SetMute ( uint32_t Cmd )

Enables or disables the MUTE mode by software.

Parameters:
Cmd,: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to unmute the codec and restore previous volume level.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 375 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetOutputMode ( uint8_t Output )

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

Parameters:
Output,: The audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 396 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetVolume ( uint8_t Volume )

Controls the current audio volume level.

Parameters:
Volume,: Volume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 355 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_Stop ( uint32_t Option )

Stops audio playing and Power down the Audio Codec.

Parameters:
Option,: could be one of the following parameters
  • CODEC_PDWN_SW: for software power off (by writing registers). Then no need to reconfigure the Codec after power on.
  • CODEC_PDWN_HW: completely shut down the codec (physically). Then need to reconfigure the Codec after power on.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 327 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_out_sai.

void BSP_AUDIO_OUT_TransferComplete_CallBack ( void )

Manages the DMA full Transfer complete event.

Return values:
None

Definition at line 468 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_TxCpltCallback().


STM32H747I-Discovery BSP User Manual: OUT Private Functions

Functions
OUT Private Functions
STM32H747I_DISCOVERY_AUDIO

Functions

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.
static void | SAIx_Out_Init (uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_Out_DeInit (SAI_HandleTypeDef *hsai)
Deinitializes the Audio Codec audio interface (SAI).

Function Documentation

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 678 of file stm32h747i_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 654 of file stm32h747i_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 666 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_OUT_HalfTransfer_CallBack().

static void SAIx_Out_DeInit ( SAI_HandleTypeDef * hsai ) [static]

Deinitializes the Audio Codec audio interface (SAI).

Return values:
None

Definition at line 762 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_DeInit(), and BSP_AUDIO_OUT_Init().

static void SAIx_Out_Init | ( | uint32_t | SaiOutMode,
 |  | uint32_t | SlotActive,
 |  | uint32_t | AudioFreq
 | ) |  | [static]

Initializes the Audio Codec audio interface (SAI).

Parameters:
SaiOutMode,: Audio mode to be configured for the SAI peripheral.
SlotActive,: Audio active slot to be configured for the SAI peripheral.
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
Note:
The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123 and user can update this configuration using
Return values:
None

Definition at line 703 of file stm32h747i_discovery_audio.c.

References haudio_out_sai.

Referenced by BSP_AUDIO_IN_OUT_Init(), and BSP_AUDIO_OUT_Init().


STM32H747I-Discovery BSP User Manual: IN Exported Functions

Functions
IN Exported Functions
STM32H747I_DISCOVERY_AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
__weak uint8_t | BSP_AUDIO_IN_ConfigDigitalMic (uint32_t InputDevice, void *Params)
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
uint8_t | BSP_AUDIO_IN_OUT_Init (uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
void | BSP_AUDIO_IN_SelectInterface (uint32_t Interface)
Link digital mic to specified source.
uint32_t | BSP_AUDIO_IN_GetInterface (void)
Get digital mic interface.
uint8_t | BSP_AUDIO_IN_GetChannelNumber (void)
Return audio in channel number.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pBuf, uint32_t size)
Start audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
Stop audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pause the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resume the audio file stream.
uint8_t | BSP_AUDIO_IN_SetVolume (uint8_t Volume)
Controls the audio in volume level.
void | BSP_AUDIO_IN_DeInit (void)
Deinit the audio IN peripherals.
uint8_t | BSP_AUDIO_IN_PDMToPCM_Init (uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
Initialize the PDM library.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (void)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_Error_CallBack (void)
Audio IN Error callback function.
__weak void | BSP_AUDIO_IN_MspInit (void)
Initialize BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (void)
DeInitialize BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_ClockConfig (uint32_t AudioFreq, void *Params)
Clock Config.
uint8_t | BSP_AUDIO_IN_ConfigMicDefault (uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_AllocScratch (int32_t *pScratch, uint32_t size)
uint8_t | BSP_AUDIO_IN_RecordEx (uint32_t *pBuf, uint32_t Size)
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
uint8_t | BSP_AUDIO_IN_StopEx (uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_PauseEx (uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_ResumeEx (uint32_t *pBuf, uint32_t InputDevice)
void | BSP_AUDIO_IN_Error_Callback (void)

Function Documentation

uint8_t BSP_AUDIO_IN_AllocScratch | ( | int32_t * | pScratch,
 |  | uint32_t | size
 | ) |  |
void BSP_AUDIO_IN_ClockConfig | ( | uint32_t | AudioFreq,
 |  | void * | Params
 | ) |  |

Clock Config.

Parameters:
AudioFreq,: Audio frequency used to play the audio stream.
Params,: pointer on additional configuration parameters, can be NULL.
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application
Return values:
None

Definition at line 1249 of file stm32h747i_discovery_audio.c.

References AUDIO_IN_INTERFACE_PDM, and AUDIOIN_ContextTypeDef::Interface.

Referenced by BSP_AUDIO_IN_InitEx().

uint8_t BSP_AUDIO_IN_ConfigDigitalMic | ( | uint32_t | InputDevice,
 |  | void * | Params
 | ) |  |

Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).

Parameters:
InputDevice,: The microphone to be configured. Can be INPUT_DEVICE_DIGITAL_MIC1..INPUT_DEVICE_DIGITAL_MIC5
Params,: pointer on additional configuration parameters, can be NULL.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 891 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_IN_ConfigMicDefault().

uint8_t BSP_AUDIO_IN_ConfigMicDefault ( uint32_t InputDevice )

Referenced by BSP_AUDIO_IN_ConfigDigitalMic().

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 1108 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_IN_MspDeInit(), haudio_in_sai, and SAIx_In_DeInit().

void BSP_AUDIO_IN_Error_Callback ( void )
void BSP_AUDIO_IN_Error_CallBack ( void )

Audio IN Error callback function.

Return values:
None

Definition at line 1217 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

uint8_t BSP_AUDIO_IN_GetChannelNumber ( void )

Return audio in channel number.

Return values:
Number of channel

Definition at line 1013 of file stm32h747i_discovery_audio.c.

References AUDIOIN_ContextTypeDef::ChannelNbr.

uint32_t BSP_AUDIO_IN_GetInterface ( void )

Get digital mic interface.

Return values:
Digital mic interface.

Definition at line 1004 of file stm32h747i_discovery_audio.c.

References AUDIOIN_ContextTypeDef::Interface.

void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1184 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_RxHalfCpltCallback().

void BSP_AUDIO_IN_HalfTransfer_CallBackEx ( uint32_t InputDevice )

User callback when record buffer is filled.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MIC1 or INPUT_DEVICE_DIGITAL_MIC2

Definition at line 1206 of file stm32h747i_discovery_audio.c.

uint8_t BSP_AUDIO_IN_Init | ( | uint32_t | AudioFreq,
 |  | uint32_t | BitRes,
 |  | uint32_t | ChnlNbr
 | ) |  |

Initialize wave recording.

Parameters:
AudioFreq,: Audio frequency to be configured for the DFSDM peripheral.
BitRes,: Audio frequency to be configured for the DFSDM peripheral.
ChnlNbr,: Audio frequency to be configured for the DFSDM peripheral.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 785 of file stm32h747i_discovery_audio.c.

References AUDIO_IN_INTERFACE_PDM, BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_SelectInterface(), and INPUT_DEVICE_DIGITAL_MIC.

uint8_t BSP_AUDIO_IN_InitEx | ( | uint16_t | InputDevice,
 |  | uint32_t | AudioFreq,
 |  | uint32_t | BitRes,
 |  | uint32_t | ChnlNbr
 | ) |  |

Initialize wave recording.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MIC or INPUT_DEVICE_ANALOG_MIC.
AudioFreq,: Audio frequency to be configured.
BitRes,: Audio bit resolution to be configured..
ChnlNbr,: Number of channel to be configured.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 800 of file stm32h747i_discovery_audio.c.

References AUDIO_ERROR, AUDIO_IN_INTERFACE_PDM, AUDIO_IN_INTERFACE_SAI, AUDIO_IN_SAI_PDMx, AUDIO_IN_SAIx, AUDIO_OK, AUDIOIN_ContextTypeDef::BitResolution, BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_MspInit(), BSP_AUDIO_IN_PDMToPCM_Init(), AUDIOIN_ContextTypeDef::ChannelNbr, CODEC_AUDIOFRAME_SLOT_0, CODEC_AUDIOFRAME_SLOT_13, AUDIOIN_ContextTypeDef::Frequency, haudio_in_sai, INPUT_DEVICE_DIGITAL_MIC, AUDIOIN_ContextTypeDef::InputDevice, AUDIOIN_ContextTypeDef::Interface, SAIx_In_DeInit(), and SAIx_In_Init().

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_MspDeInit ( void )

DeInitialize BSP_AUDIO_IN MSP.

Return values:
None

Definition at line 1236 of file stm32h747i_discovery_audio.c.

References haudio_in_sai, and SAIx_In_MspDeInit().

Referenced by BSP_AUDIO_IN_DeInit().

void BSP_AUDIO_IN_MspInit ( void )

Initialize BSP_AUDIO_IN MSP.

Return values:
None

Definition at line 1227 of file stm32h747i_discovery_audio.c.

References haudio_in_sai, and SAIx_In_MspInit().

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

uint8_t BSP_AUDIO_IN_OUT_Init | ( | uint32_t | InputDevice,
 |  | uint32_t | OutputDevice,
 |  | uint32_t | AudioFreq,
 |  | uint32_t | BitRes,
 |  | uint32_t | ChnlNbr
 | ) |  |

Initializes wave recording and playback in parallel.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MICROPHONE_2
OutputDevice,: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
BitRes,: Audio frequency to be configured.
ChnlNbr,: Channel number.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 912 of file stm32h747i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, AUDIO_OUT_SAIx, AUDIOIN_ContextTypeDef::BitResolution, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), AUDIOIN_ContextTypeDef::ChannelNbr, CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, AUDIOIN_ContextTypeDef::Frequency, haudio_in_sai, haudio_out_sai, AUDIOIN_ContextTypeDef::InputDevice, SAIx_In_Init(), and SAIx_Out_Init().

uint8_t BSP_AUDIO_IN_Pause ( void )

Pause the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1053 of file stm32h747i_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, haudio_in_sai, INPUT_DEVICE_ANALOG_MIC, and AUDIOIN_ContextTypeDef::InputDevice.

uint8_t BSP_AUDIO_IN_PauseEx ( uint32_t InputDevice )
uint8_t BSP_AUDIO_IN_PDMToPCM | ( | uint16_t * | PDMBuf,
 |  | uint16_t * | PCMBuf
 | ) |  |

Converts audio format from PDM to PCM.

Parameters:
PDMBuf,: Pointer to PDM buffer data
PCMBuf,: Pointer to PCM buffer data
Return values:
AUDIO_OK in case of success, AUDIO_ERROR otherwise

Definition at line 1157 of file stm32h747i_discovery_audio.c.

References AUDIO_OK, AUDIOIN_ContextTypeDef::ChannelNbr, and PDM_FilterHandler.

uint8_t BSP_AUDIO_IN_PDMToPCM_Init | ( | uint32_t | AudioFreq,
 |  | uint32_t | ChnlNbrIn,
 |  | uint32_t | ChnlNbrOut
 | ) |  |

Initialize the PDM library.

Parameters:
AudioFreq,: Audio sampling frequency
ChnlNbrIn,: Number of input audio channels in the PDM buffer
ChnlNbrOut,: Number of desired output audio channels in the resulting PCM buffer
Return values:
None

Definition at line 1122 of file stm32h747i_discovery_audio.c.

References AUDIO_OK, PDM_FilterConfig, and PDM_FilterHandler.

Referenced by BSP_AUDIO_IN_InitEx().

uint8_t BSP_AUDIO_IN_Record | ( | uint16_t * | pBuf,
 |  | uint32_t | size
 | ) |  |

Start audio recording.

Parameters:
pBuf,: Main buffer pointer for the recorded data storing
size,: Current size of the recorded buffer
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1024 of file stm32h747i_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_RecordEx | ( | uint32_t * | pBuf,
 |  | uint32_t | Size
 | ) |  |
uint8_t BSP_AUDIO_IN_Resume ( void )

Resume the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1073 of file stm32h747i_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, haudio_in_sai, INPUT_DEVICE_ANALOG_MIC, and AUDIOIN_ContextTypeDef::InputDevice.

uint8_t BSP_AUDIO_IN_ResumeEx | ( | uint32_t * | pBuf,
 |  | uint32_t | InputDevice
 | ) |  |
void BSP_AUDIO_IN_SelectInterface ( uint32_t Interface )

Link digital mic to specified source.

Parameters:
Interface : Audio In interface for Digital mic. It can be: AUDIO_IN_INTERFACE_SAI AUDIO_IN_INTERFACE_PDM
Return values:
None

Definition at line 995 of file stm32h747i_discovery_audio.c.

References AUDIOIN_ContextTypeDef::Interface.

Referenced by BSP_AUDIO_IN_Init().

uint8_t BSP_AUDIO_IN_SetFrequency ( uint32_t AudioFreq )
uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t Volume )

Controls the audio in volume level.

Parameters:
Volume,: Volume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1095 of file stm32h747i_discovery_audio.c.

References AUDIO_OK, and AudioInVolume.

uint8_t BSP_AUDIO_IN_Stop ( void )

Stop audio recording.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1040 of file stm32h747i_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_StopEx ( uint32_t InputDevice )
void BSP_AUDIO_IN_TransferComplete_CallBack ( void )

User callback when record buffer is filled.

Return values:
None

Definition at line 1173 of file stm32h747i_discovery_audio.c.

Referenced by HAL_SAI_RxCpltCallback().

void BSP_AUDIO_IN_TransferComplete_CallBackEx ( uint32_t InputDevice )

User callback when record buffer is filled.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MIC1 or INPUT_DEVICE_DIGITAL_MIC2

Definition at line 1195 of file stm32h747i_discovery_audio.c.


STM32H747I-Discovery BSP User Manual: IN Private Functions

Functions
IN Private Functions
STM32H747I_DISCOVERY_AUDIO

Functions

void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Half reception complete callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Reception complete callback.
static void | SAIx_In_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes SAI Audio IN MSP.
static void | SAIx_In_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
De-Initializes SAI Audio IN MSP.
static void | SAIx_In_Init (uint32_t SaiInMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_In_DeInit (SAI_HandleTypeDef *hsai)
De-initializes the output Audio Codec audio interface (SAI).

Function Documentation

void HAL_SAI_RxCpltCallback ( SAI_HandleTypeDef * hsai )

Reception complete callback.

Parameters:
hsai,: SAI handle.
Return values:
None

Definition at line 1327 of file stm32h747i_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 1316 of file stm32h747i_discovery_audio.c.

References BSP_AUDIO_IN_HalfTransfer_CallBack().

static void SAIx_In_DeInit ( SAI_HandleTypeDef * hsai ) [static]

De-initializes the output Audio Codec audio interface (SAI).

Return values:
None

Definition at line 1619 of file stm32h747i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_IN_InitEx().

static void SAIx_In_Init | ( | uint32_t | SaiInMode,
 |  | uint32_t | SlotActive,
 |  | uint32_t | AudioFreq
 | ) |  | [static]

Initializes the Audio Codec audio interface (SAI).

Parameters:
SaiInMode,: Audio mode to be configured for the SAI peripheral.
SlotActive,: Audio active slot to be configured for the SAI peripheral.
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
Return values:
None

Definition at line 1539 of file stm32h747i_discovery_audio.c.

References AUDIO_IN_INTERFACE_PDM, haudio_in_sai, and AUDIOIN_ContextTypeDef::Interface.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

static void SAIx_In_MspDeInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  | [static]

De-Initializes SAI Audio IN MSP.

Parameters:
hsai,: SAI handle
Params,: pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 1477 of file stm32h747i_discovery_audio.c.

References AUDIO_IN_INT_GPIO_PIN, AUDIO_IN_INT_GPIO_PORT, AUDIO_IN_SAI_PDMx, AUDIO_IN_SAI_PDMx_CLK_DISABLE, AUDIO_IN_SAI_PDMx_CLK_IN_PIN, AUDIO_IN_SAI_PDMx_CLK_IN_PORT, AUDIO_IN_SAI_PDMx_DATA_IN_PIN, AUDIO_IN_SAI_PDMx_DATA_IN_PORT, AUDIO_IN_SAI_PDMx_FS_PIN, AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT, AUDIO_IN_SAI_PDMx_SCK_PIN, AUDIO_IN_SAIx, AUDIO_IN_SAIx_CLK_DISABLE, AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_SAIx_SD_GPIO_PORT, and AUDIO_IN_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_MspDeInit().

static void SAIx_In_MspInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  | [static]

Initializes SAI Audio IN MSP.

Parameters:
hsai,: SAI handle
Params,: pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 1342 of file stm32h747i_discovery_audio.c.

References AUDIO_IN_INT_GPIO_ENABLE, AUDIO_IN_INT_GPIO_PIN, AUDIO_IN_INT_GPIO_PORT, AUDIO_IN_INT_IRQ, AUDIO_IN_IRQ_PREPRIO, 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_AF, AUDIO_IN_SAIx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE, AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE, AUDIO_IN_SAIx_DMAx_REQUEST, AUDIO_IN_SAIx_DMAx_STREAM, AUDIO_IN_SAIx_SD_ENABLE, AUDIO_IN_SAIx_SD_GPIO_PORT, and AUDIO_IN_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_MspInit().


STM32H747I-Discovery BSP User Manual: AUDIOIN_ContextTypeDef Struct Reference

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

#include <stm32h747i_discovery_audio.h>

Data Fields

uint32_t | Frequency
uint32_t | BitResolution
uint32_t | ChannelNbr
uint16_t * | pRecBuf
uint32_t | RecSize
uint32_t | InputDevice
uint32_t | Interface
uint32_t | MultiBuffMode

Detailed Description

Definition at line 52 of file stm32h747i_discovery_audio.h.

Field Documentation

uint32_t AUDIOIN_ContextTypeDef::BitResolution

Definition at line 55 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

uint32_t AUDIOIN_ContextTypeDef::ChannelNbr

Definition at line 56 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_GetChannelNumber(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), and BSP_AUDIO_IN_PDMToPCM().

uint32_t AUDIOIN_ContextTypeDef::Frequency

Definition at line 54 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

uint32_t AUDIOIN_ContextTypeDef::InputDevice

Definition at line 59 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Pause(), and BSP_AUDIO_IN_Resume().

uint32_t AUDIOIN_ContextTypeDef::Interface

Definition at line 60 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_GetInterface(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_SelectInterface(), and SAIx_In_Init().

uint32_t AUDIOIN_ContextTypeDef::MultiBuffMode

Definition at line 61 of file stm32h747i_discovery_audio.h.

uint16_t* AUDIOIN_ContextTypeDef::pRecBuf

Definition at line 57 of file stm32h747i_discovery_audio.h.

uint32_t AUDIOIN_ContextTypeDef::RecSize

Definition at line 58 of file stm32h747i_discovery_audio.h.

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


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_AUDIO

Defines

#define | BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K
#define | BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K
#define | BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K
#define | BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K
#define | BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K
#define | BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K
#define | BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K
#define | BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K
#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
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 | CODEC_AUDIOFRAME_SLOT_0 SAI_SLOTACTIVE_0
#define | AUDIO_OUT_SAIx SAI1_Block_A
#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_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOG
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT GPIOE
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_4
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream1
#define | AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream1_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_Stream1_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E)
#define | AUDIO_IN_SAIx SAI1_Block_B
#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_3
#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_B
#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_INT_GPIO_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | AUDIO_IN_INT_GPIO_PORT GPIOJ
#define | AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15
#define | AUDIO_IN_INT_IRQ EXTI15_10_IRQn
#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_IN_IRQ_PREPRIO ((uint32_t)0x0F)
#define | AUDIODATA_SIZE ((uint32_t)2) /* 16-bits audio data size */
#define | AUDIO_OK ((uint8_t)0)
#define | AUDIO_ERROR ((uint8_t)1)
#define | AUDIO_TIMEOUT ((uint8_t)2)
#define | DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2)
#define | DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)
#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
#define | INPUT_DEVICE_ANALOG_MIC ((uint32_t)0x00000001)
#define | INPUT_DEVICE_DIGITAL_MIC1 ((uint32_t)0x00000010)
#define | INPUT_DEVICE_DIGITAL_MIC2 ((uint32_t)0x00000020)
#define | INPUT_DEVICE_DIGITAL_MIC ((uint32_t)(INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2))
#define | AUDIO_IN_INTERFACE_SAI ((uint16_t)0)
#define | AUDIO_IN_INTERFACE_PDM ((uint16_t)1)

Define Documentation

#define AUDIO_ERROR ((uint8_t)1)

Definition at line 196 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

#define AUDIO_IN_INT_GPIO_ENABLE ( ) __HAL_RCC_GPIOJ_CLK_ENABLE()

Definition at line 150 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15

Definition at line 152 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_INT_GPIO_PORT GPIOJ

Definition at line 151 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_INT_IRQ EXTI15_10_IRQn

Definition at line 153 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_INTERFACE_PDM ((uint16_t)1)

Definition at line 224 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_InitEx(), and SAIx_In_Init().

#define AUDIO_IN_INTERFACE_SAI ((uint16_t)0)

Definition at line 223 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx().

#define AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F)

Definition at line 185 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx SAI4_Block_A

Definition at line 156 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_DISABLE ( ) __HAL_RCC_SAI4_CLK_DISABLE()

Definition at line 158 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit().

#define AUDIO_IN_SAI_PDMx_CLK_ENABLE ( ) __HAL_RCC_SAI4_CLK_ENABLE()

Definition at line 157 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 165 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_PIN GPIO_PIN_2

Definition at line 166 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_CLK_IN_PORT GPIOE

Definition at line 167 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_CLK_AF GPIO_AF10_SAI4

Definition at line 171 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 168 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_PIN GPIO_PIN_1

Definition at line 169 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DATA_IN_PORT GPIOC

Definition at line 170 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE ( ) __HAL_RCC_BDMA_CLK_ENABLE()

Definition at line 176 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_IRQ BDMA_Channel1_IRQn

Definition at line 179 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_IRQHandler BDMA_Channel1_IRQHandler

Definition at line 182 of file stm32h747i_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 181 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 180 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_REQUEST BDMA_REQUEST_SAI4_A

Definition at line 178 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_DMAx_STREAM BDMA_Channel1

Definition at line 177 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_PIN GPIO_PIN_4

Definition at line 162 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_AF GPIO_AF8_SAI4

Definition at line 159 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 160 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT GPIOE

Definition at line 161 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAI_PDMx_IRQ SAI4_IRQn

Definition at line 173 of file stm32h747i_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_IRQHandler SAI4_IRQHandler

Definition at line 172 of file stm32h747i_discovery_audio.h.

#define AUDIO_IN_SAI_PDMx_SCK_PIN GPIO_PIN_5

Definition at line 163 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAIx SAI1_Block_B

Definition at line 132 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), and SAIx_In_MspDeInit().

#define AUDIO_IN_SAIx_AF GPIO_AF6_SAI1

Definition at line 135 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI1_CLK_DISABLE()

Definition at line 134 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit().

#define AUDIO_IN_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 133 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 141 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream4_IRQn

Definition at line 144 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler

Definition at line 148 of file stm32h747i_discovery_audio.h.

#define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 146 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 145 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_B

Definition at line 143 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream4

Definition at line 142 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_SD_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 136 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspInit().

#define AUDIO_IN_SAIx_SD_GPIO_PORT GPIOE

Definition at line 137 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_IN_SAIx_SD_PIN GPIO_PIN_3

Definition at line 138 of file stm32h747i_discovery_audio.h.

Referenced by SAIx_In_MspDeInit(), and SAIx_In_MspInit().

#define AUDIO_OK ((uint8_t)0)

Definition at line 195 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PDMToPCM(), BSP_AUDIO_IN_PDMToPCM_Init(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetVolume(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

#define AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E)

Definition at line 126 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx SAI1_Block_A

Definition at line 102 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_MspDeInit(), BSP_AUDIO_OUT_MspInit(), and HAL_SAI_ErrorCallback().

#define AUDIO_OUT_SAIx_AF GPIO_AF6_SAI1

Definition at line 105 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI1_CLK_DISABLE()

Definition at line 104 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit().

#define AUDIO_OUT_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 103 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 117 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream1_IRQn

Definition at line 120 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream1_IRQHandler

Definition at line 123 of file stm32h747i_discovery_audio.h.

#define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 122 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 121 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A

Definition at line 119 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream1

Definition at line 118 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_4

Definition at line 112 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 107 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOG

Definition at line 108 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7

Definition at line 109 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5

Definition at line 113 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 110 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT GPIOE

Definition at line 111 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6

Definition at line 114 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_TIMEOUT ((uint8_t)2)

Definition at line 197 of file stm32h747i_discovery_audio.h.

#define AUDIODATA_SIZE ((uint32_t)2) /* 16-bits audio data size */

Definition at line 192 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K

Definition at line 76 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K

Definition at line 75 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K

Definition at line 74 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K

Definition at line 73 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K

Definition at line 72 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K

Definition at line 71 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K

Definition at line 77 of file stm32h747i_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K

Definition at line 70 of file stm32h747i_discovery_audio.h.

#define CODEC_AUDIOFRAME_SLOT_0 SAI_SLOTACTIVE_0

Definition at line 96 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx().

#define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

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 89 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 92 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_OUT_Init().

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 94 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)

Definition at line 201 of file stm32h747i_discovery_audio.h.

#define DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2)

Definition at line 202 of file stm32h747i_discovery_audio.h.

#define DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K

Definition at line 200 of file stm32h747i_discovery_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)

Definition at line 203 of file stm32h747i_discovery_audio.h.

#define INPUT_DEVICE_ANALOG_MIC ((uint32_t)0x00000001)

Definition at line 216 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Pause(), and BSP_AUDIO_IN_Resume().

#define INPUT_DEVICE_DIGITAL_MIC ((uint32_t)(INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2))

Definition at line 220 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), and BSP_AUDIO_IN_InitEx().

#define INPUT_DEVICE_DIGITAL_MIC1 ((uint32_t)0x00000010)

Definition at line 218 of file stm32h747i_discovery_audio.h.

#define INPUT_DEVICE_DIGITAL_MIC2 ((uint32_t)0x00000020)

Definition at line 219 of file stm32h747i_discovery_audio.h.

#define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE

Definition at line 209 of file stm32h747i_discovery_audio.h.

#define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */

Definition at line 210 of file stm32h747i_discovery_audio.h.


STM32H747I-Discovery BSP User Manual: Exported Macros

Defines
Exported Macros
STM32H747I_DISCOVERY_AUDIO

Defines

#define | DMA_MAX_SIZE 0xFFFF
#define | DMA_MAX(x) (((x) <= DMA_MAX_SIZE)? (x):DMA_MAX_SIZE)
#define | POS_VAL(VAL) (POSITION_VAL(VAL) - 4)

Define Documentation

#define DMA_MAX ( x ) (((x) <= DMA_MAX_SIZE)? (x):DMA_MAX_SIZE)

Definition at line 234 of file stm32h747i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define DMA_MAX_SIZE 0xFFFF

Definition at line 233 of file stm32h747i_discovery_audio.h.

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

Definition at line 235 of file stm32h747i_discovery_audio.h.


STM32H747I-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32H747I_DISCOVERY_CAMERA

Variables

DCMI_HandleTypeDef | hdcmi_discovery
CAMERA_DrvTypeDef * | camera_drv

Variable Documentation

CAMERA_DrvTypeDef* camera_drv

Definition at line 68 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_BlackWhiteConfig(), BSP_CAMERA_ColorEffectConfig(), BSP_CAMERA_ContrastBrightnessConfig(), and BSP_CAMERA_Init().

DCMI_HandleTypeDef hdcmi_discovery

Definition at line 67 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_ContinuousStart(), BSP_CAMERA_DeInit(), BSP_CAMERA_Init(), BSP_CAMERA_Resume(), BSP_CAMERA_SnapshotStart(), BSP_CAMERA_Stop(), and BSP_CAMERA_Suspend().


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_CAMERA

Variables

static uint32_t | CameraCurrentResolution
uint32_t | CameraRotation = CAMERA_ROTATION_INVALID
static uint32_t | CameraHwAddress

Variable Documentation

uint32_t CameraCurrentResolution [static]

Definition at line 77 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_ContinuousStart(), BSP_CAMERA_Init(), and BSP_CAMERA_SnapshotStart().

uint32_t CameraHwAddress [static]

Definition at line 83 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_BlackWhiteConfig(), BSP_CAMERA_ColorEffectConfig(), BSP_CAMERA_ContrastBrightnessConfig(), and BSP_CAMERA_Init().

uint32_t CameraRotation = CAMERA_ROTATION_INVALID

Definition at line 80 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_GetRotation(), and BSP_CAMERA_SetRotation().


STM32H747I-Discovery BSP User Manual: Private FunctionPrototypes

Private FunctionPrototypes
STM32H747I_DISCOVERY_CAMERA


STM32H747I-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32H747I_DISCOVERY_CAMERA

Functions

uint8_t | BSP_CAMERA_SetRotation (uint32_t rotation)
Set Camera image rotation on LCD Displayed frame buffer.
uint32_t | BSP_CAMERA_GetRotation (void)
Get Camera image rotation on LCD Displayed frame buffer.
uint8_t | BSP_CAMERA_Init (uint32_t Resolution)
Initializes the camera.
uint8_t | BSP_CAMERA_DeInit (void)
DeInitializes the camera.
void | BSP_CAMERA_ContinuousStart (uint8_t *buff)
Starts the camera capture in continuous mode.
void | BSP_CAMERA_SnapshotStart (uint8_t *buff)
Starts the camera capture in snapshot mode.
void | BSP_CAMERA_Suspend (void)
Suspend the CAMERA capture.
void | BSP_CAMERA_Resume (void)
Resume the CAMERA capture.
uint8_t | BSP_CAMERA_Stop (void)
Stop the CAMERA capture.
void | BSP_CAMERA_PwrUp (void)
CANERA power up.
void | BSP_CAMERA_PwrDown (void)
CAMERA power down.
void | BSP_CAMERA_ContrastBrightnessConfig (uint32_t contrast_level, uint32_t brightness_level)
Configures the camera contrast and brightness.
void | BSP_CAMERA_BlackWhiteConfig (uint32_t Mode)
Configures the camera white balance.
void | BSP_CAMERA_ColorEffectConfig (uint32_t Effect)
Configures the camera color effect.
__weak void | BSP_CAMERA_MspInit (DCMI_HandleTypeDef *hdcmi, void *Params)
Initializes the DCMI MSP.
__weak void | BSP_CAMERA_MspDeInit (DCMI_HandleTypeDef *hdcmi, void *Params)
DeInitializes the DCMI MSP.
void | HAL_DCMI_LineEventCallback (DCMI_HandleTypeDef *hdcmi)
Line event callback.
__weak void | BSP_CAMERA_LineEventCallback (void)
Line Event callback.
void | HAL_DCMI_VsyncEventCallback (DCMI_HandleTypeDef *hdcmi)
VSYNC event callback.
__weak void | BSP_CAMERA_VsyncEventCallback (void)
VSYNC Event callback.
void | HAL_DCMI_FrameEventCallback (DCMI_HandleTypeDef *hdcmi)
Frame event callback.
__weak void | BSP_CAMERA_FrameEventCallback (void)
Frame Event callback.
void | HAL_DCMI_ErrorCallback (DCMI_HandleTypeDef *hdcmi)
Error callback.
__weak void | BSP_CAMERA_ErrorCallback (void)
Error callback.
static uint32_t | GetSize (uint32_t Resolution)
Get the capture size in pixels unit.

Function Documentation

void BSP_CAMERA_BlackWhiteConfig ( uint32_t Mode )

Configures the camera white balance.

Parameters:
Mode,: black_white mode This parameter can be one of the following values:
  • CAMERA_BLACK_WHITE_BW
  • CAMERA_BLACK_WHITE_NEGATIVE
  • CAMERA_BLACK_WHITE_BW_NEGATIVE
  • CAMERA_BLACK_WHITE_NORMAL

Definition at line 357 of file stm32h747i_discovery_camera.c.

References camera_drv, and CameraHwAddress.

void BSP_CAMERA_ColorEffectConfig ( uint32_t Effect )

Configures the camera color effect.

Parameters:
Effect,: Color effect This parameter can be one of the following values:
  • CAMERA_COLOR_EFFECT_ANTIQUE
  • CAMERA_COLOR_EFFECT_BLUE
  • CAMERA_COLOR_EFFECT_GREEN
  • CAMERA_COLOR_EFFECT_RED
Return values:
None

Definition at line 375 of file stm32h747i_discovery_camera.c.

References camera_drv, and CameraHwAddress.

void BSP_CAMERA_ContinuousStart ( uint8_t * buff )

Starts the camera capture in continuous mode.

Parameters:
buff,: pointer to the camera output buffer
Return values:
None

Definition at line 219 of file stm32h747i_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hdcmi_discovery.

void BSP_CAMERA_ContrastBrightnessConfig | ( | uint32_t | contrast_level,
 |  | uint32_t | brightness_level
 | ) |  |

Configures the camera contrast and brightness.

Parameters:
contrast_level,: Contrast level This parameter can be one of the following values:
  • CAMERA_CONTRAST_LEVEL4: for contrast +2
  • CAMERA_CONTRAST_LEVEL3: for contrast +1
  • CAMERA_CONTRAST_LEVEL2: for contrast 0
  • CAMERA_CONTRAST_LEVEL1: for contrast -1
  • CAMERA_CONTRAST_LEVEL0: for contrast -2
brightness_level,: Contrast level This parameter can be one of the following values:
  • CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
  • CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
  • CAMERA_BRIGHTNESS_LEVEL2: for brightness 0
  • CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
  • CAMERA_BRIGHTNESS_LEVEL0: for brightness -2

Definition at line 340 of file stm32h747i_discovery_camera.c.

References camera_drv, and CameraHwAddress.

uint8_t BSP_CAMERA_DeInit ( void )

DeInitializes the camera.

Return values:
Camera status

Definition at line 205 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_MspDeInit(), CAMERA_OK, and hdcmi_discovery.

void BSP_CAMERA_ErrorCallback ( void )

Error callback.

Return values:
None

Definition at line 620 of file stm32h747i_discovery_camera.c.

Referenced by HAL_DCMI_ErrorCallback().

void BSP_CAMERA_FrameEventCallback ( void )

Frame Event callback.

Return values:
None

Definition at line 599 of file stm32h747i_discovery_camera.c.

Referenced by HAL_DCMI_FrameEventCallback().

uint32_t BSP_CAMERA_GetRotation ( void )

Get Camera image rotation on LCD Displayed frame buffer.

Return values:
rotation : uint32_t value of type Camera_ImageRotationTypeDef

Definition at line 124 of file stm32h747i_discovery_camera.c.

References CameraRotation.

uint8_t BSP_CAMERA_Init ( uint32_t Resolution )

Initializes the camera.

Parameters:
Resolution : camera sensor requested resolution (x, y) : standard resolution naming QQVGA, QVGA, VGA ...
Return values:
Camera status

Definition at line 135 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_MspInit(), BSP_CAMERA_PwrUp(), CAMERA_480x272_RES_X, CAMERA_480x272_RES_Y, camera_drv, CAMERA_ERROR, CAMERA_I2C_ADDRESS, CAMERA_NOT_SUPPORTED, CAMERA_OK, CAMERA_VGA_RES_X, CAMERA_VGA_RES_Y, CameraCurrentResolution, CameraHwAddress, and hdcmi_discovery.

void BSP_CAMERA_LineEventCallback ( void )

Line Event callback.

Return values:
None

Definition at line 557 of file stm32h747i_discovery_camera.c.

Referenced by HAL_DCMI_LineEventCallback().

void BSP_CAMERA_MspDeInit | ( | DCMI_HandleTypeDef * | hdcmi,
 |  | void * | Params
 | ) |  |

DeInitializes the DCMI MSP.

Parameters:
hdcmi,: HDMI handle
Params : pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 525 of file stm32h747i_discovery_camera.c.

References CAMERA_DCMI_DMAx_IRQ.

Referenced by BSP_CAMERA_DeInit().

void BSP_CAMERA_MspInit | ( | DCMI_HandleTypeDef * | hdcmi,
 |  | void * | Params
 | ) |  |

Initializes the DCMI MSP.

Parameters:
hdcmi,: HDMI handle
Params : pointer on additional configuration parameters, can be NULL.
Return values:
None

Definition at line 430 of file stm32h747i_discovery_camera.c.

References CAMERA_DCMI_DMAx_CLK_ENABLE, CAMERA_DCMI_DMAx_IRQ, and CAMERA_DCMI_DMAx_STREAM.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_PwrDown ( void )

CAMERA power down.

Return values:
None

Definition at line 304 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_Stop().

void BSP_CAMERA_PwrUp ( void )

CANERA power up.

Return values:
None

Definition at line 279 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_Resume ( void )

Resume the CAMERA capture.

Return values:
None

Definition at line 250 of file stm32h747i_discovery_camera.c.

References hdcmi_discovery.

uint8_t BSP_CAMERA_SetRotation ( uint32_t rotation )

Set Camera image rotation on LCD Displayed frame buffer.

Parameters:
rotation : uint32_t rotation of camera image in preview buffer sent to LCD need to be of type Camera_ImageRotationTypeDef
Return values:
Camera status

Definition at line 106 of file stm32h747i_discovery_camera.c.

References CAMERA_ERROR, CAMERA_OK, CAMERA_ROTATION_INVALID, and CameraRotation.

void BSP_CAMERA_SnapshotStart ( uint8_t * buff )

Starts the camera capture in snapshot mode.

Parameters:
buff,: pointer to the camera output buffer
Return values:
None

Definition at line 230 of file stm32h747i_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hdcmi_discovery.

uint8_t BSP_CAMERA_Stop ( void )

Stop the CAMERA capture.

Return values:
Camera status

Definition at line 260 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_PwrDown(), CAMERA_ERROR, CAMERA_OK, and hdcmi_discovery.

void BSP_CAMERA_Suspend ( void )

Suspend the CAMERA capture.

Return values:
None

Definition at line 240 of file stm32h747i_discovery_camera.c.

References hdcmi_discovery.

void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 578 of file stm32h747i_discovery_camera.c.

Referenced by HAL_DCMI_VsyncEventCallback().

static uint32_t GetSize ( uint32_t Resolution ) [static]

Get the capture size in pixels unit.

Parameters:
Resolution,: the current resolution.
Return values:
capture size in pixels unit.

Definition at line 388 of file stm32h747i_discovery_camera.c.

Referenced by BSP_CAMERA_ContinuousStart(), and BSP_CAMERA_SnapshotStart().

void HAL_DCMI_ErrorCallback ( DCMI_HandleTypeDef * hdcmi )

Error callback.

Parameters:
hdcmi,: pointer to the DCMI handle
Return values:
None

Definition at line 611 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_ErrorCallback().

void HAL_DCMI_FrameEventCallback ( DCMI_HandleTypeDef * hdcmi )

Frame event callback.

Parameters:
hdcmi,: pointer to the DCMI handle
Return values:
None

Definition at line 590 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_FrameEventCallback().

void HAL_DCMI_LineEventCallback ( DCMI_HandleTypeDef * hdcmi )

Line event callback.

Parameters:
hdcmi,: pointer to the DCMI handle
Return values:
None

Definition at line 548 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_LineEventCallback().

void HAL_DCMI_VsyncEventCallback ( DCMI_HandleTypeDef * hdcmi )

VSYNC event callback.

Parameters:
hdcmi,: pointer to the DCMI handle
Return values:
None

Definition at line 569 of file stm32h747i_discovery_camera.c.

References BSP_CAMERA_VsyncEventCallback().


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_CAMERA

Defines

#define | CAMERA_OK 0x00
Camera State structures definition.
#define | CAMERA_ERROR 0x01
#define | CAMERA_TIMEOUT 0x02
#define | CAMERA_NOT_DETECTED 0x03
#define | CAMERA_NOT_SUPPORTED 0x04
#define | CAMERA_NO_ROTATION 0x00
Camera Image rotation definition in frame buffer for LCD Display.
#define | CAMERA_ROTATION_90 0x01
#define | CAMERA_ROTATION_INVALID 0x02
#define | RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
#define | RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
#define | RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
#define | RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
#define | CAMERA_VGA_RES_X 640
#define | CAMERA_VGA_RES_Y 480
#define | CAMERA_480x272_RES_X 480
#define | CAMERA_480x272_RES_Y 272
#define | CAMERA_QVGA_RES_X 320
#define | CAMERA_QVGA_RES_Y 240
#define | CAMERA_QQVGA_RES_X 160
#define | CAMERA_QQVGA_RES_Y 120
#define | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Stream3_IRQHandler
#define | CAMERA_DCMI_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | CAMERA_DCMI_DMAx_STREAM DMA2_Stream3
#define | CAMERA_DCMI_DMAx_IRQ DMA2_Stream3_IRQn
#define | CAMERA_FB_START_ADDRESS ((uint32_t)0xD0600000)
CAMERA FB_StartAddress.

Define Documentation

#define BSP_CAMERA_DMA_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 82 of file stm32h747i_discovery_camera.h.

#define BSP_CAMERA_IRQHandler DCMI_IRQHandler

Definition at line 81 of file stm32h747i_discovery_camera.h.

#define CAMERA_480x272_RES_X 480

Definition at line 74 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init().

#define CAMERA_480x272_RES_Y 272

Definition at line 75 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init().

#define CAMERA_DCMI_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 85 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_MspInit().

#define CAMERA_DCMI_DMAx_IRQ DMA2_Stream3_IRQn

Definition at line 87 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_MspDeInit(), and BSP_CAMERA_MspInit().

#define CAMERA_DCMI_DMAx_STREAM DMA2_Stream3

Definition at line 86 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_MspInit().

#define CAMERA_ERROR 0x01

Definition at line 54 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init(), BSP_CAMERA_SetRotation(), and BSP_CAMERA_Stop().

#define CAMERA_FB_START_ADDRESS ((uint32_t)0xD0600000)

CAMERA FB_StartAddress.

Definition at line 92 of file stm32h747i_discovery_camera.h.

#define CAMERA_NO_ROTATION 0x00

Camera Image rotation definition in frame buffer for LCD Display.

Definition at line 63 of file stm32h747i_discovery_camera.h.

#define CAMERA_NOT_DETECTED 0x03

Definition at line 56 of file stm32h747i_discovery_camera.h.

#define CAMERA_NOT_SUPPORTED 0x04

Definition at line 57 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init().

#define CAMERA_OK 0x00

Camera State structures definition.

Definition at line 53 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_DeInit(), BSP_CAMERA_Init(), BSP_CAMERA_SetRotation(), and BSP_CAMERA_Stop().

#define CAMERA_QQVGA_RES_X 160

Definition at line 78 of file stm32h747i_discovery_camera.h.

#define CAMERA_QQVGA_RES_Y 120

Definition at line 79 of file stm32h747i_discovery_camera.h.

#define CAMERA_QVGA_RES_X 320

Definition at line 76 of file stm32h747i_discovery_camera.h.

#define CAMERA_QVGA_RES_Y 240

Definition at line 77 of file stm32h747i_discovery_camera.h.

#define CAMERA_ROTATION_90 0x01

Definition at line 64 of file stm32h747i_discovery_camera.h.

#define CAMERA_ROTATION_INVALID 0x02

Definition at line 65 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_SetRotation().

#define CAMERA_TIMEOUT 0x02

Definition at line 55 of file stm32h747i_discovery_camera.h.

#define CAMERA_VGA_RES_X 640

Definition at line 72 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init().

#define CAMERA_VGA_RES_Y 480

Definition at line 73 of file stm32h747i_discovery_camera.h.

Referenced by BSP_CAMERA_Init().

#define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */

Definition at line 67 of file stm32h747i_discovery_camera.h.

#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */

Definition at line 68 of file stm32h747i_discovery_camera.h.

#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */

Definition at line 69 of file stm32h747i_discovery_camera.h.

#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Definition at line 70 of file stm32h747i_discovery_camera.h.


STM32H747I-Discovery BSP User Manual: Private Defines

Defines
Private Defines
STM32H747I_DISCOVERY_LCD

Defines

#define | LCD_DSI_ID 0x11
#define | LCD_DSI_ADDRESS TS_I2C_ADDRESS
#define | LCD_DSI_ID_REG 0xA8

Define Documentation

#define LCD_DSI_ADDRESS TS_I2C_ADDRESS

Definition at line 87 of file stm32h747i_discovery_lcd.c.

Referenced by LCD_IO_GetID().

#define LCD_DSI_ID 0x11

Definition at line 86 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_InitEx(), and LCD_IO_GetID().

#define LCD_DSI_ID_REG 0xA8

Definition at line 88 of file stm32h747i_discovery_lcd.c.

Referenced by LCD_IO_GetID().


STM32H747I-Discovery BSP User Manual: Private Types

Private Types
STM32H747I_DISCOVERY_LCD


STM32H747I-Discovery BSP User Manual: Private Macros

Defines
Private Macros
STM32H747I_DISCOVERY_LCD

Defines

#define | ABS(X) ((X) > 0 ? (X) : -(X))
#define | POLY_X(Z) ((int32_t)((Points + (Z))->X))
#define | POLY_Y(Z) ((int32_t)((Points + (Z))->Y))

Define Documentation

#define ABS ( X ) ((X) > 0 ? (X) : -(X))

Definition at line 148 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_DrawLine(), and FillTriangle().

#define POLY_X ( Z ) ((int32_t)((Points + (Z))->X))

Definition at line 149 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().

#define POLY_Y ( Z ) ((int32_t)((Points + (Z))->Y))

Definition at line 150 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().


STM32H747I-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32H747I_DISCOVERY_LCD

Variables

DMA2D_HandleTypeDef | hdma2d_discovery
LTDC_HandleTypeDef | hltdc_discovery
DSI_HandleTypeDef | hdsi_discovery
DMA2D_HandleTypeDef | hdma2d_discovery

Variable Documentation

DMA2D_HandleTypeDef hdma2d_discovery

Definition at line 158 of file stm32h747i_discovery_lcd.c.

Referenced by LL_ConvertLineToARGB8888(), and LL_FillBuffer().

DMA2D_HandleTypeDef hdma2d_discovery

Definition at line 158 of file stm32h747i_discovery_lcd.c.

Referenced by LL_ConvertLineToARGB8888(), and LL_FillBuffer().

DSI_HandleTypeDef hdsi_discovery

Definition at line 160 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_InitEx(), BSP_LCD_SetBrightness(), and DSI_IO_WriteCmd().

LTDC_HandleTypeDef hltdc_discovery

Definition at line 159 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_Clear(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawPixel(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_InitEx(), BSP_LCD_LayerDefaultInit(), BSP_LCD_ReadPixel(), BSP_LCD_ResetColorKeying(), BSP_LCD_SetColorKeying(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetTransparency(), BSP_LCD_SetXSize(), and BSP_LCD_SetYSize().


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_LCD

Variables

static DSI_VidCfgTypeDef | hdsivideo_handle
uint32_t | lcd_x_size = OTM8009A_800X480_WIDTH
uint32_t | lcd_y_size = OTM8009A_800X480_HEIGHT
static uint32_t | ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND
Default Active LTDC Layer in which drawing is made is LTDC Layer Background.
static LCD_DrawPropTypeDef | DrawProp [LTDC_MAX_LAYER_NUMBER]
Current Drawing Layer properties variable.

Variable Documentation

uint32_t ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND [static]

Default Active LTDC Layer in which drawing is made is LTDC Layer Background.

Definition at line 210 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_Clear(), BSP_LCD_ClearStringLine(), BSP_LCD_DisplayChar(), BSP_LCD_DisplayStringAt(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawCircle(), BSP_LCD_DrawEllipse(), BSP_LCD_DrawHLine(), BSP_LCD_DrawLine(), BSP_LCD_DrawPixel(), BSP_LCD_DrawVLine(), BSP_LCD_FillCircle(), BSP_LCD_FillRect(), BSP_LCD_GetBackColor(), BSP_LCD_GetFont(), BSP_LCD_GetTextColor(), BSP_LCD_ReadPixel(), BSP_LCD_SelectLayer(), BSP_LCD_SetBackColor(), BSP_LCD_SetFont(), BSP_LCD_SetTextColor(), BSP_LCD_SetXSize(), BSP_LCD_SetYSize(), and DrawChar().

LCD_DrawPropTypeDef DrawProp[LTDC_MAX_LAYER_NUMBER] [static]

Current Drawing Layer properties variable.

Definition at line 215 of file stm32h747i_discovery_lcd.c.

DSI_VidCfgTypeDef hdsivideo_handle [static]

Definition at line 169 of file stm32h747i_discovery_lcd.c.

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

uint32_t lcd_x_size = OTM8009A_800X480_WIDTH

Definition at line 170 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_GetXSize(), and BSP_LCD_InitEx().

uint32_t lcd_y_size = OTM8009A_800X480_HEIGHT

Definition at line 171 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_GetYSize(), and BSP_LCD_InitEx().


STM32H747I-Discovery BSP User Manual: Private FunctionPrototypes

Private FunctionPrototypes
STM32H747I_DISCOVERY_LCD


STM32H747I-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32H747I_DISCOVERY_LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the DSI LCD.
uint8_t | BSP_LCD_InitEx (LCD_OrientationTypeDef orientation)
Initializes the DSI LCD.
void | BSP_LCD_Reset (void)
BSP LCD Reset Hw reset the LCD DSI activating its XRES signal (active low for some time) and deactivating it later.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
void | BSP_LCD_SetXSize (uint32_t imageWidthPixels)
Set the LCD X size.
void | BSP_LCD_SetYSize (uint32_t imageHeightPixels)
Set the LCD Y size.
void | BSP_LCD_LayerDefaultInit (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layers.
void | BSP_LCD_SelectLayer (uint32_t LayerIndex)
Selects the LCD Layer.
void | BSP_LCD_SetLayerVisible (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetLayerWindow (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_SetTextColor (uint32_t Color)
Sets the LCD text color.
uint32_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
void | BSP_LCD_SetBackColor (uint32_t Color)
Sets the LCD background color.
uint32_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetFont (sFONT *fonts)
Sets the LCD text font.
sFONT * | BSP_LCD_GetFont (void)
Gets the LCD text font.
uint32_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_Clear (uint32_t Color)
Clears the whole currently active layer of LTDC.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line in currently active layer.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character in currently active layer.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
Displays characters in currently active layer.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a maximum of 60 characters on the LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line in currently active layer.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line in currently active layer.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points) in currently active layer.
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle in currently active layer.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle in currently active layer.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points) in currently active layer.
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD in currently active layer.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle in currently active layer.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle in currently active layer.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points) in currently active layer.
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse in currently active layer.
void | BSP_LCD_DisplayOn (void)
Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().
void | BSP_LCD_DisplayOff (void)
Switch Off the display.
void | BSP_LCD_SetBrightness (uint8_t BrightnessValue)
Set the brightness value.
void | DSI_IO_WriteCmd (uint32_t NbrParams, uint8_t *pParams)
DCS or Generic short/long write command.
__weak void | BSP_LCD_MspDeInit (void)
De-Initializes the BSP LCD Msp Application can surcharge if needed this function implementation.
__weak void | BSP_LCD_MspInit (void)
Initialize the BSP LCD Msp.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
Draws a pixel on LCD.
static uint16_t | LCD_IO_GetID (void)
Returns the ID of connected screen by checking the HDMI (adv7533 component) ID or LCD DSI (via TS ID) ID.

Function Documentation

void BSP_LCD_Clear ( uint32_t Color )

Clears the whole currently active layer of LTDC.

Parameters:
Color,: Color of the background
Return values:
None

Definition at line 960 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), hltdc_discovery, and LL_FillBuffer().

void BSP_LCD_ClearStringLine ( uint32_t Line )

Clears the selected line in currently active layer.

Parameters:
Line,: Line to be cleared
Return values:
None

Definition at line 971 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, LCD_DrawPropTypeDef::BackColor, BSP_LCD_FillRect(), BSP_LCD_GetXSize(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

void BSP_LCD_DisplayChar | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint8_t | Ascii
 | ) |  |

Displays one character in currently active layer.

Parameters:
Xpos,: Start column address
Ypos,: Line where to display the character shape.
Ascii,: Character ascii code This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
Return values:
None

Definition at line 991 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, DrawChar(), and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DisplayStringAt().

void BSP_LCD_DisplayOff ( void )

Switch Off the display.

Enter DSI ULPM mode if was allowed and configured in Dsi Configuration.

Return values:
None

Definition at line 1577 of file stm32h747i_discovery_lcd.c.

References hdsi_discovery, and hdsivideo_handle.

void BSP_LCD_DisplayOn ( void )

Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().

Exit DSI ULPM mode if was allowed and configured in Dsi Configuration.

Return values:
None

Definition at line 1551 of file stm32h747i_discovery_lcd.c.

References hdsi_discovery, and hdsivideo_handle.

void BSP_LCD_DisplayStringAt | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint8_t * | Text,
 |  | Text_AlignModeTypdef | Mode
 | ) |  |

Displays characters in currently active layer.

Parameters:
Xpos,: X position (in pixel)
Ypos,: Y position (in pixel)
Text,: Pointer to string to display on LCD
Mode,: Display mode This parameter can be one of the following values:
  • CENTER_MODE
  • RIGHT_MODE
  • LEFT_MODE
Return values:
None

Definition at line 1009 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_DisplayChar(), BSP_LCD_GetXSize(), CENTER_MODE, LEFT_MODE, LCD_DrawPropTypeDef::pFont, and RIGHT_MODE.

Referenced by BSP_LCD_DisplayStringAtLine().

void BSP_LCD_DisplayStringAtLine | ( | uint16_t | Line,
 |  | uint8_t * | ptr
 | ) |  |

Displays a maximum of 60 characters on the LCD.

Parameters:
Line,: Line where to display the character shape
ptr,: Pointer to string to display on LCD
Return values:
None

Definition at line 1072 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

void BSP_LCD_DrawBitmap | ( | uint32_t | Xpos,
 |  | uint32_t | Ypos,
 |  | uint8_t * | pbmp
 | ) |  |

Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.

Parameters:
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:
None

Definition at line 1322 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hltdc_discovery, and LL_ConvertLineToARGB8888().

void BSP_LCD_DrawCircle | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Radius
 | ) |  |

Draws a circle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Radius,: Circle radius
Return values:
None

Definition at line 1214 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and BSP_LCD_DrawPixel().

Referenced by BSP_LCD_FillCircle().

void BSP_LCD_DrawEllipse | ( | int | Xpos,
 |  | int | Ypos,
 |  | int | XRadius,
 |  | int | YRadius
 | ) |  |

Draws an ellipse on LCD in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
XRadius,: Ellipse X radius
YRadius,: Ellipse Y radius
Return values:
None

Definition at line 1289 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and BSP_LCD_DrawPixel().

void BSP_LCD_DrawHLine | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Length
 | ) |  |

Draws an horizontal line in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Length,: Line length
Return values:
None

Definition at line 1084 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hltdc_discovery, and LL_FillBuffer().

Referenced by BSP_LCD_DrawRect(), BSP_LCD_FillCircle(), and BSP_LCD_FillEllipse().

void BSP_LCD_DrawLine | ( | uint16_t | x1,
 |  | uint16_t | y1,
 |  | uint16_t | x2,
 |  | uint16_t | y2
 | ) |  |

Draws an uni-line (between two points) in currently active layer.

Parameters:
x1,: Point 1 X position
y1,: Point 1 Y position
x2,: Point 2 X position
y2,: Point 2 Y position
Return values:
None

Definition at line 1121 of file stm32h747i_discovery_lcd.c.

References ABS, ActiveLayer, and BSP_LCD_DrawPixel().

Referenced by BSP_LCD_DrawPolygon(), and FillTriangle().

void BSP_LCD_DrawPixel | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint32_t | RGB_Code
 | ) |  |

Draws a pixel on LCD.

Parameters:
Xpos,: X position
Ypos,: Y position
RGB_Code,: Pixel color in ARGB mode (8-8-8-8)
Return values:
None

Definition at line 1748 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hltdc_discovery.

Referenced by BSP_LCD_DrawCircle(), BSP_LCD_DrawEllipse(), BSP_LCD_DrawLine(), and DrawChar().

void BSP_LCD_DrawPolygon | ( | pPoint | Points,
 |  | uint16_t | PointCount
 | ) |  |

Draws an poly-line (between many points) in currently active layer.

Parameters:
Points,: Pointer to the points array
PointCount,: Number of points
Return values:
None

Definition at line 1261 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_DrawLine(), Point::X, and Point::Y.

void BSP_LCD_DrawRect | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Width,
 |  | uint16_t | Height
 | ) |  |

Draws a rectangle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Width,: Rectangle width
Height,: Rectangle height
Return values:
None

Definition at line 1196 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_DrawHLine(), and BSP_LCD_DrawVLine().

void BSP_LCD_DrawVLine | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Length
 | ) |  |

Draws a vertical line in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Length,: Line length
Return values:
None

Definition at line 1102 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hltdc_discovery, and LL_FillBuffer().

Referenced by BSP_LCD_DrawRect().

void BSP_LCD_FillCircle | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Radius
 | ) |  |

Draws a full circle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Radius,: Circle radius
Return values:
None

Definition at line 1404 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_DrawCircle(), BSP_LCD_DrawHLine(), and BSP_LCD_SetTextColor().

void BSP_LCD_FillEllipse | ( | int | Xpos,
 |  | int | Ypos,
 |  | int | XRadius,
 |  | int | YRadius
 | ) |  |

Draws a full ellipse in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
XRadius,: Ellipse X radius
YRadius,: Ellipse Y radius
Return values:
None

Definition at line 1520 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_DrawHLine().

void BSP_LCD_FillPolygon | ( | pPoint | Points,
 |  | uint16_t | PointCount
 | ) |  |

Draws a full poly-line (between many points) in currently active layer.

Parameters:
Points,: Pointer to the points array
PointCount,: Number of points
Return values:
None

Definition at line 1452 of file stm32h747i_discovery_lcd.c.

References FillTriangle(), POLY_X, POLY_Y, Point::X, and Point::Y.

void BSP_LCD_FillRect | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Width,
 |  | uint16_t | Height
 | ) |  |

Draws a full rectangle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Width,: Rectangle width
Height,: Rectangle height
Return values:
None

Definition at line 1383 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), BSP_LCD_SetTextColor(), hltdc_discovery, and LL_FillBuffer().

Referenced by BSP_LCD_ClearStringLine().

uint32_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Return values:
Used background color

Definition at line 896 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::BackColor.

sFONT * BSP_LCD_GetFont ( void )

Gets the LCD text font.

Return values:
Used layer font

Definition at line 914 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

uint32_t BSP_LCD_GetTextColor ( void )

Gets the LCD text color.

Return values:
Used text color.

Definition at line 878 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::TextColor.

uint32_t BSP_LCD_GetXSize ( void )

Gets the LCD X size.

Return values:
Used LCD X size

Definition at line 700 of file stm32h747i_discovery_lcd.c.

References lcd_x_size.

Referenced by BSP_LCD_Clear(), BSP_LCD_ClearStringLine(), BSP_LCD_DisplayStringAt(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawPixel(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_LayerDefaultInit(), and BSP_LCD_ReadPixel().

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Return values:
Used LCD Y size

Definition at line 709 of file stm32h747i_discovery_lcd.c.

References lcd_y_size.

Referenced by BSP_LCD_Clear(), and BSP_LCD_LayerDefaultInit().

uint8_t BSP_LCD_Init ( void )

Initializes the DSI LCD.

Return values:
LCD state

Definition at line 240 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_InitEx(), and LCD_ORIENTATION_LANDSCAPE.

uint8_t BSP_LCD_InitEx ( LCD_OrientationTypeDef orientation )

Initializes the DSI LCD.

The ititialization is done as below:

  • DSI PLL ititialization
  • DSI ititialization
  • LTDC ititialization
  • OTM8009A LCD Display IC Driver ititialization
    Parameters:
    orientation Display orientation
    Return values:
    LCD state

< LcdClk = 26400 kHz

< Vertical start active time in units of lines

< Vertical Back Porch time in units of lines

< Vertical Front Porch time in units of lines

< Vertical Active time in units of lines = imageSize Y in pixels to display

< Horizontal start active time in units of lcdClk

< Horizontal Back Porch time in units of lcdClk

< Horizontal Front Porch time in units of lcdClk

< Horizontal Active time in units of lcdClk = imageSize X in pixels to display

Definition at line 255 of file stm32h747i_discovery_lcd.c.

References BSP_LCD_MspInit(), BSP_LCD_Reset(), BSP_LCD_SetFont(), BSP_SDRAM_Init(), hdsi_discovery, hdsivideo_handle, hltdc_discovery, LCD_DEFAULT_FONT, LCD_DSI_ID, LCD_DSI_PIXEL_DATA_FMT_RBG888, LCD_ERROR, LCD_IO_GetID(), LCD_OK, LCD_ORIENTATION_PORTRAIT, LCD_OTM8009A_ID, lcd_x_size, and lcd_y_size.

Referenced by BSP_LCD_Init().

void BSP_LCD_LayerDefaultInit | ( | uint16_t | LayerIndex,
 |  | uint32_t | FB_Address
 | ) |  |

Initializes the LCD layers.

Parameters:
LayerIndex,: Layer foreground or background
FB_Address,: Layer frame buffer
Return values:
None

Definition at line 740 of file stm32h747i_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor, BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), hltdc_discovery, LCD_COLOR_BLACK, LCD_COLOR_WHITE, LCD_LayerCfgTypeDef, LCD_DrawPropTypeDef::pFont, and LCD_DrawPropTypeDef::TextColor.

void BSP_LCD_MspDeInit ( void )

De-Initializes the BSP LCD Msp Application can surcharge if needed this function implementation.

Return values:
None

Disable IRQ of LTDC IP

Disable IRQ of DMA2D IP

Disable IRQ of DSI IP

Force and let in reset state LTDC, DMA2D and DSI Host + Wrapper IPs

Disable the LTDC, DMA2D and DSI Host and Wrapper clocks

Definition at line 1678 of file stm32h747i_discovery_lcd.c.

void BSP_LCD_MspInit ( void )

Initialize the BSP LCD Msp.

Application can surcharge if needed this function implementation

Return values:
None

Enable the LTDC clock

Toggle Sw reset of LTDC IP

Enable the DMA2D clock

Toggle Sw reset of DMA2D IP

Enable DSI Host and wrapper clocks

Soft Reset the DSI Host and wrapper

NVIC configuration for LTDC interrupt that is now enabled

NVIC configuration for DMA2D interrupt that is now enabled

NVIC configuration for DSI interrupt that is now enabled

Definition at line 1705 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

uint32_t BSP_LCD_ReadPixel | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos
 | ) |  |

Reads an LCD pixel.

Parameters:
Xpos,: X position
Ypos,: Y position
Return values:
RGB pixel color

Definition at line 925 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hltdc_discovery.

void BSP_LCD_Reset ( void )

BSP LCD Reset Hw reset the LCD DSI activating its XRES signal (active low for some time) and deactivating it later.

Return values:
None

Definition at line 670 of file stm32h747i_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

void BSP_LCD_ResetColorKeying ( uint32_t LayerIndex )

Disables the color keying.

Parameters:
LayerIndex,: Layer foreground or background

Definition at line 859 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SelectLayer ( uint32_t LayerIndex )

Selects the LCD Layer.

Parameters:
LayerIndex,: Layer foreground or background

Definition at line 773 of file stm32h747i_discovery_lcd.c.

References ActiveLayer.

void BSP_LCD_SetBackColor ( uint32_t Color )

Sets the LCD background color.

Parameters:
Color,: Layer background color code ARGB(8-8-8-8)

Definition at line 887 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::BackColor.

void BSP_LCD_SetBrightness ( uint8_t BrightnessValue )

Set the brightness value.

Parameters:
BrightnessValue,: [00: Min (black), 100 Max]
Return values:
None

Definition at line 1602 of file stm32h747i_discovery_lcd.c.

References hdsi_discovery, and LCD_OTM8009A_ID.

void BSP_LCD_SetColorKeying | ( | uint32_t | LayerIndex,
 |  | uint32_t | RGBValue
 | ) |  |

Configures and sets the color keying.

Parameters:
LayerIndex,: Layer foreground or background
RGBValue,: Color reference

Definition at line 848 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

Parameters:
fonts,: Layer font to be used

Definition at line 905 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_InitEx().

void BSP_LCD_SetLayerAddress | ( | uint32_t | LayerIndex,
 |  | uint32_t | Address
 | ) |  |

Sets an LCD layer frame buffer address.

Parameters:
LayerIndex,: Layer foreground or background
Address,: New LCD frame buffer value

Definition at line 818 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SetLayerVisible | ( | uint32_t | LayerIndex,
 |  | FunctionalState | State
 | ) |  |

Sets an LCD Layer visible.

Parameters:
LayerIndex,: Visible Layer
State,: New state of the specified layer This parameter can be one of the following values:
  • ENABLE
  • DISABLE

Definition at line 786 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SetLayerWindow | ( | uint16_t | LayerIndex,
 |  | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Width,
 |  | uint16_t | Height
 | ) |  |

Sets display window.

Parameters:
LayerIndex,: Layer index
Xpos,: LCD X position
Ypos,: LCD Y position
Width,: LCD window width
Height,: LCD window height

Definition at line 833 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SetTextColor ( uint32_t Color )

Sets the LCD text color.

Parameters:
Color,: Text color code ARGB(8-8-8-8)

Definition at line 869 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_ClearStringLine(), BSP_LCD_FillCircle(), and BSP_LCD_FillRect().

void BSP_LCD_SetTransparency | ( | uint32_t | LayerIndex,
 |  | uint8_t | Transparency
 | ) |  |

Configures the transparency.

Parameters:
LayerIndex,: Layer foreground or background.
Transparency,: Transparency This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF

Definition at line 806 of file stm32h747i_discovery_lcd.c.

References hltdc_discovery.

void BSP_LCD_SetXSize ( uint32_t imageWidthPixels )

Set the LCD X size.

Parameters:
imageWidthPixels : uint32_t image width in pixels unit
Return values:
None

Definition at line 719 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and hltdc_discovery.

void BSP_LCD_SetYSize ( uint32_t imageHeightPixels )

Set the LCD Y size.

Parameters:
imageHeightPixels : uint32_t image height in lines unit

Definition at line 728 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, and hltdc_discovery.

void DSI_IO_WriteCmd | ( | uint32_t | NbrParams,
 |  | uint8_t * | pParams
 | ) |  |

DCS or Generic short/long write command.

Parameters:
NbrParams,: Number of parameters. It indicates the write command mode: If inferior to 2, a long write command is performed else short.
pParams,: Pointer to parameter values table.
Return values:
None

Definition at line 1628 of file stm32h747i_discovery_lcd.c.

References hdsi_discovery, and LCD_OTM8009A_ID.

static uint16_t LCD_IO_GetID ( void ) [static]

Returns the ID of connected screen by checking the HDMI (adv7533 component) ID or LCD DSI (via TS ID) ID.

Return values:
LCD ID

Definition at line 1645 of file stm32h747i_discovery_lcd.c.

References HDMI_IO_Delay(), HDMI_IO_Init(), HDMI_IO_Read(), LCD_DSI_ADDRESS, LCD_DSI_ID, and LCD_DSI_ID_REG.

Referenced by BSP_LCD_InitEx().


STM32H747I-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32H747I_DISCOVERY_LCD

Functions

static void | DrawChar (uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
Draws a character on LCD.
static void | FillTriangle (uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
Fills a triangle (between 3 points).
static void | LL_FillBuffer (uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
Fills a buffer.
static void | LL_ConvertLineToARGB8888 (void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
Converts a line to an ARGB8888 pixel format.

Function Documentation

static void DrawChar | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | const uint8_t * | c
 | ) |  | [static]

Draws a character on LCD.

Parameters:
Xpos,: Line where to display the character shape
Ypos,: Start column address
c,: Pointer to the character data
Return values:
None

Definition at line 1768 of file stm32h747i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_DrawPixel(), and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DisplayChar().

static void FillTriangle | ( | uint16_t | x1,
 |  | uint16_t | x2,
 |  | uint16_t | x3,
 |  | uint16_t | y1,
 |  | uint16_t | y2,
 |  | uint16_t | y3
 | ) |  | [static]

Fills a triangle (between 3 points).

Parameters:
x1,: Point 1 X position
y1,: Point 1 Y position
x2,: Point 2 X position
y2,: Point 2 Y position
x3,: Point 3 X position
y3,: Point 3 Y position
Return values:
None

Definition at line 1827 of file stm32h747i_discovery_lcd.c.

References ABS, and BSP_LCD_DrawLine().

Referenced by BSP_LCD_FillPolygon().

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

Converts a line to an ARGB8888 pixel format.

Parameters:
pSrc,: Pointer to source buffer
pDst,: Output color
xSize,: Buffer width
ColorMode,: Input color mode
Return values:
None

Definition at line 1936 of file stm32h747i_discovery_lcd.c.

References hdma2d_discovery.

Referenced by BSP_LCD_DrawBitmap().

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

Fills a buffer.

Parameters:
LayerIndex,: Layer index
pDst,: Pointer to destination buffer
xSize,: Buffer width
ySize,: Buffer height
OffLine,: Offset
ColorIndex,: Color index
Return values:
None

Definition at line 1905 of file stm32h747i_discovery_lcd.c.

References hdma2d_discovery.

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


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_LCD

Defines

#define | BSP_LCD_DMA2D_IRQHandler DMA2D_IRQHandler
#define | BSP_LCD_DSI_IRQHandler DSI_IRQHandler
#define | BSP_LCD_LTDC_IRQHandler LTDC_IRQHandler
#define | BSP_LCD_LTDC_ER_IRQHandler LTDC_ER_IRQHandler
#define | LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
#define | LCD_FB_START_ADDRESS ((uint32_t)0xD0000000)
LCD FB_StartAddress.
#define | LTDC_MAX_LAYER_NUMBER ((uint32_t) 2)
Maximum number of LTDC layers.
#define | LTDC_ACTIVE_LAYER_BACKGROUND ((uint32_t) 0)
LTDC Background layer index.
#define | LTDC_ACTIVE_LAYER_FOREGROUND ((uint32_t) 1)
LTDC Foreground layer index.
#define | LTDC_NB_OF_LAYERS ((uint32_t) 2)
Number of LTDC layers.
#define | LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_FOREGROUND
LTDC Default used layer index.
#define | LCD_OK 0x00
LCD status structure definition.
#define | LCD_ERROR 0x01
#define | LCD_TIMEOUT 0x02
#define | LCD_OTM8009A_ID ((uint32_t) 0)
LCD Display OTM8009A ID.
#define | LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF)
LCD color definitions values in ARGB8888 format.
#define | LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00)
Green value in ARGB8888 format.
#define | LCD_COLOR_RED ((uint32_t) 0xFFFF0000)
Red value in ARGB8888 format.
#define | LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF)
Cyan value in ARGB8888 format.
#define | LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF)
Magenta value in ARGB8888 format.
#define | LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00)
Yellow value in ARGB8888 format.
#define | LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF)
Light Blue value in ARGB8888 format.
#define | LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80)
Light Green value in ARGB8888 format.
#define | LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080)
Light Red value in ARGB8888 format.
#define | LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF)
Light Cyan value in ARGB8888 format.
#define | LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF)
Light Magenta value in ARGB8888 format.
#define | LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80)
Light Yellow value in ARGB8888 format.
#define | LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080)
Dark Blue value in ARGB8888 format.
#define | LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000)
Light Dark Green value in ARGB8888 format.
#define | LCD_COLOR_DARKRED ((uint32_t) 0xFF800000)
Light Dark Red value in ARGB8888 format.
#define | LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080)
Dark Cyan value in ARGB8888 format.
#define | LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080)
Dark Magenta value in ARGB8888 format.
#define | LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000)
Dark Yellow value in ARGB8888 format.
#define | LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF)
White value in ARGB8888 format.
#define | LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3)
Light Gray value in ARGB8888 format.
#define | LCD_COLOR_GRAY ((uint32_t) 0xFF808080)
Gray value in ARGB8888 format.
#define | LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040)
Dark Gray value in ARGB8888 format.
#define | LCD_COLOR_BLACK ((uint32_t) 0xFF000000)
Black value in ARGB8888 format.
#define | LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A)
Brown value in ARGB8888 format.
#define | LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500)
Orange value in ARGB8888 format.
#define | LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000)
Transparent value in ARGB8888 format.
#define | LCD_DEFAULT_FONT Font24
LCD default font.
#define | LCD_DSI_PIXEL_DATA_FMT_RBG888 DSI_RGB888
Possible values of pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets.
#define | LCD_DSI_PIXEL_DATA_FMT_RBG565 DSI_RGB565

Define Documentation

#define BSP_LCD_DMA2D_IRQHandler DMA2D_IRQHandler

Definition at line 63 of file stm32h747i_discovery_lcd.h.

#define BSP_LCD_DSI_IRQHandler DSI_IRQHandler

Definition at line 64 of file stm32h747i_discovery_lcd.h.

#define BSP_LCD_LTDC_ER_IRQHandler LTDC_ER_IRQHandler

Definition at line 66 of file stm32h747i_discovery_lcd.h.

#define BSP_LCD_LTDC_IRQHandler LTDC_IRQHandler

Definition at line 65 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_BLACK ((uint32_t) 0xFF000000)

Black value in ARGB8888 format.

Definition at line 216 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF)

LCD color definitions values in ARGB8888 format.

Blue value in ARGB8888 format

Definition at line 128 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A)

Brown value in ARGB8888 format.

Definition at line 220 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF)

Cyan value in ARGB8888 format.

Definition at line 140 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080)

Dark Blue value in ARGB8888 format.

Definition at line 176 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080)

Dark Cyan value in ARGB8888 format.

Definition at line 188 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040)

Dark Gray value in ARGB8888 format.

Definition at line 212 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000)

Light Dark Green value in ARGB8888 format.

Definition at line 180 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080)

Dark Magenta value in ARGB8888 format.

Definition at line 192 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKRED ((uint32_t) 0xFF800000)

Light Dark Red value in ARGB8888 format.

Definition at line 184 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000)

Dark Yellow value in ARGB8888 format.

Definition at line 196 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_GRAY ((uint32_t) 0xFF808080)

Gray value in ARGB8888 format.

Definition at line 208 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00)

Green value in ARGB8888 format.

Definition at line 132 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF)

Light Blue value in ARGB8888 format.

Definition at line 152 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF)

Light Cyan value in ARGB8888 format.

Definition at line 164 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3)

Light Gray value in ARGB8888 format.

Definition at line 204 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80)

Light Green value in ARGB8888 format.

Definition at line 156 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF)

Light Magenta value in ARGB8888 format.

Definition at line 168 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080)

Light Red value in ARGB8888 format.

Definition at line 160 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80)

Light Yellow value in ARGB8888 format.

Definition at line 172 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF)

Magenta value in ARGB8888 format.

Definition at line 144 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500)

Orange value in ARGB8888 format.

Definition at line 224 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_RED ((uint32_t) 0xFFFF0000)

Red value in ARGB8888 format.

Definition at line 136 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000)

Transparent value in ARGB8888 format.

Definition at line 228 of file stm32h747i_discovery_lcd.h.

#define LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF)

White value in ARGB8888 format.

Definition at line 200 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00)

Yellow value in ARGB8888 format.

Definition at line 148 of file stm32h747i_discovery_lcd.h.

#define LCD_DEFAULT_FONT Font24

LCD default font.

Definition at line 233 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_DSI_PIXEL_DATA_FMT_RBG565 DSI_RGB565

DSI packet pixel format chosen is RGB565 : 16 bpp

Definition at line 241 of file stm32h747i_discovery_lcd.h.

#define LCD_DSI_PIXEL_DATA_FMT_RBG888 DSI_RGB888

Possible values of pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets.

DSI packet pixel format chosen is RGB888 : 24 bpp

Definition at line 240 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_ERROR 0x01

Definition at line 99 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_FB_START_ADDRESS ((uint32_t)0xD0000000)

LCD FB_StartAddress.

Definition at line 73 of file stm32h747i_discovery_lcd.h.

#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef

Definition at line 69 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_OK 0x00

LCD status structure definition.

Definition at line 98 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_OTM8009A_ID ((uint32_t) 0)

LCD Display OTM8009A ID.

Definition at line 105 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), BSP_LCD_SetBrightness(), and DSI_IO_WriteCmd().

#define LCD_TIMEOUT 0x02

Definition at line 100 of file stm32h747i_discovery_lcd.h.

#define LTDC_ACTIVE_LAYER_BACKGROUND ((uint32_t) 0)

LTDC Background layer index.

Definition at line 81 of file stm32h747i_discovery_lcd.h.

#define LTDC_ACTIVE_LAYER_FOREGROUND ((uint32_t) 1)

LTDC Foreground layer index.

Definition at line 85 of file stm32h747i_discovery_lcd.h.

#define LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_FOREGROUND

LTDC Default used layer index.

Definition at line 93 of file stm32h747i_discovery_lcd.h.

#define LTDC_MAX_LAYER_NUMBER ((uint32_t) 2)

Maximum number of LTDC layers.

Definition at line 77 of file stm32h747i_discovery_lcd.h.

#define LTDC_NB_OF_LAYERS ((uint32_t) 2)

Number of LTDC layers.

Definition at line 89 of file stm32h747i_discovery_lcd.h.


STM32H747I-Discovery BSP User Manual: Exported Types

Data Structures | Typedefs | Enumerations
Exported Types
STM32H747I_DISCOVERY_LCD

Data Structures

struct | LCD_DrawPropTypeDef
LCD Drawing main properties. More...
struct | Point
LCD Drawing point (pixel) geometric definition. More...

Typedefs

typedef Point * | pPoint
Pointer on LCD Drawing point (pixel) geometric definition.

Enumerations

enum | Text_AlignModeTypdef { CENTER_MODE = 0x01, RIGHT_MODE = 0x02, LEFT_MODE = 0x03 }
LCD drawing Line alignment mode definitions. More...
enum | LCD_OrientationTypeDef { LCD_ORIENTATION_PORTRAIT = 0x00, LCD_ORIENTATION_LANDSCAPE = 0x01, LCD_ORIENTATION_INVALID = 0x02 }
LCD_OrientationTypeDef Possible values of Display Orientation. More...

Typedef Documentation

typedef Point* pPoint

Pointer on LCD Drawing point (pixel) geometric definition.

Definition at line 275 of file stm32h747i_discovery_lcd.h.

Enumeration Type Documentation

enum LCD_OrientationTypeDef

LCD_OrientationTypeDef Possible values of Display Orientation.

Enumerator:
LCD_ORIENTATION_PORTRAIT

Portrait orientation choice of LCD screen

LCD_ORIENTATION_LANDSCAPE

Landscape orientation choice of LCD screen

LCD_ORIENTATION_INVALID

Invalid orientation choice of LCD screen

Definition at line 293 of file stm32h747i_discovery_lcd.h.

enum Text_AlignModeTypdef

LCD drawing Line alignment mode definitions.

Enumerator:
CENTER_MODE

Center mode

RIGHT_MODE

Right mode

LEFT_MODE

Left mode

Definition at line 280 of file stm32h747i_discovery_lcd.h.


STM32H747I-Discovery BSP User Manual: LCD_DrawPropTypeDef Struct Reference

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

LCD Drawing main properties. More...

#include <stm32h747i_discovery_lcd.h>

Data Fields

uint32_t | TextColor
uint32_t | BackColor
sFONT * | pFont

Detailed Description

LCD Drawing main properties.

Definition at line 254 of file stm32h747i_discovery_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Specifies the background color below the text

Definition at line 257 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_ClearStringLine(), BSP_LCD_GetBackColor(), BSP_LCD_LayerDefaultInit(), and BSP_LCD_SetBackColor().

sFONT* LCD_DrawPropTypeDef::pFont

Specifies the font used for the text

Definition at line 258 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_DisplayChar(), BSP_LCD_DisplayStringAt(), BSP_LCD_GetFont(), BSP_LCD_LayerDefaultInit(), BSP_LCD_SetFont(), and DrawChar().

uint32_t LCD_DrawPropTypeDef::TextColor

Specifies the color of text

Definition at line 256 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_ClearStringLine(), BSP_LCD_GetTextColor(), BSP_LCD_LayerDefaultInit(), and BSP_LCD_SetTextColor().

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


STM32H747I-Discovery BSP User Manual: Point Struct Reference

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

LCD Drawing point (pixel) geometric definition. More...

#include <stm32h747i_discovery_lcd.h>

Data Fields

int16_t | X
int16_t | Y

Detailed Description

LCD Drawing point (pixel) geometric definition.

Definition at line 265 of file stm32h747i_discovery_lcd.h.

Field Documentation

int16_t Point::X

geometric X position of drawing

Definition at line 267 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

geometric Y position of drawing

Definition at line 268 of file stm32h747i_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

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


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_QSPI

Variables

QSPI_HandleTypeDef QSPIHandle

Variable Documentation

QSPI_HandleTypeDef QSPIHandle

Definition at line 70 of file stm32h747i_discovery_qspi.c.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_Read(), BSP_QSPI_Write(), and QSPI_ResetMemory().


STM32H747I-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32H747I_DISCOVERY_QSPI

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_EnterFourBytesAddress (QSPI_HandleTypeDef *hqspi)
This function set the QSPI memory in 4-byte address mode.
static uint8_t | QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
This function configure the dummy cycles on memory side.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
static uint8_t | QSPI_EnterQPI (QSPI_HandleTypeDef *hqspi)
This function enter the QPSI memory in QPI mode.

Function Documentation

static uint8_t QSPI_AutoPollingMemReady | ( | QSPI_HandleTypeDef * | hqspi,
 |  | uint32_t | Timeout
 | ) |  | [static]

This function read the SR of the memory and wait the EOP.

Parameters:
hqspi,: QSPI handle
Timeout,: timeout in ms
Return values:
None

Definition at line 818 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Write(), QSPI_EnterFourBytesAddress(), and QSPI_ResetMemory().

static uint8_t QSPI_DummyCyclesCfg ( QSPI_HandleTypeDef * hqspi ) [static]

This function configure the dummy cycles on memory side.

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 712 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_EnterFourBytesAddress ( QSPI_HandleTypeDef * hqspi ) [static]

This function set the QSPI memory in 4-byte address mode.

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 671 of file stm32h747i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_EnterQPI ( QSPI_HandleTypeDef * hqspi ) [static]

This function enter the QPSI memory in QPI mode.

Parameters:
hqspi QSPI handle
Return values:
QSPI status

Definition at line 854 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by QSPI_ResetMemory().

static uint8_t QSPI_ResetMemory ( QSPI_HandleTypeDef * hqspi ) [static]

This function reset the QSPI memory.

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 608 of file stm32h747i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_EnterQPI(), QSPI_ERROR, QSPI_OK, and QSPIHandle.

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_WriteEnable ( QSPI_HandleTypeDef * hqspi ) [static]

This function send a Write Enable and wait it is effective.

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 772 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Write(), QSPI_DummyCyclesCfg(), and QSPI_EnterFourBytesAddress().


STM32H747I-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32H747I_DISCOVERY_QSPI

Functions

uint8_t | BSP_QSPI_Init (void)
Initializes the QSPI interface.
uint8_t | BSP_QSPI_DeInit (void)
De-Initializes the QSPI interface.
uint8_t | BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the QSPI memory.
uint8_t | BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the QSPI memory.
uint8_t | BSP_QSPI_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
__weak void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
__weak void | BSP_QSPI_MspDeInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP De-Initialization This function frees the hardware resources used in this example:

Function Documentation

uint8_t BSP_QSPI_DeInit ( void )

De-Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 153 of file stm32h747i_discovery_qspi.c.

References BSP_QSPI_MspDeInit(), QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_EnableMemoryMappedMode ( void )

Configure the QSPI in memory-mapped mode.

Return values:
QSPI memory status

Definition at line 441 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_Erase_Block ( uint32_t BlockAddress )

Erases the specified block of the QSPI memory.

Parameters:
BlockAddress,: Block address to erase
Return values:
QSPI memory status

Definition at line 290 of file stm32h747i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.

uint8_t BSP_QSPI_Erase_Chip ( void )

Erases the entire QSPI memory.

Return values:
QSPI memory status

Definition at line 332 of file stm32h747i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.

uint8_t BSP_QSPI_GetInfo ( QSPI_Info * pInfo )

Return the configuration of the QSPI memory.

Parameters:
pInfo,: pointer on the configuration structure
Return values:
QSPI memory status

Definition at line 425 of file stm32h747i_discovery_qspi.c.

References QSPI_Info::EraseSectorSize, QSPI_Info::EraseSectorsNumber, QSPI_Info::FlashSize, QSPI_Info::ProgPageSize, QSPI_Info::ProgPagesNumber, and QSPI_OK.

uint8_t BSP_QSPI_GetStatus ( void )

Reads current status of the QSPI memory.

Return values:
QSPI memory status

Definition at line 372 of file stm32h747i_discovery_qspi.c.

References QSPI_BUSY, QSPI_ERROR, QSPI_OK, QSPI_SUSPENDED, and QSPIHandle.

uint8_t BSP_QSPI_Init ( void )

Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 99 of file stm32h747i_discovery_qspi.c.

References BSP_QSPI_MspInit(), QSPI_DummyCyclesCfg(), QSPI_EnterFourBytesAddress(), QSPI_ERROR, QSPI_NOT_SUPPORTED, QSPI_OK, QSPI_ResetMemory(), and QSPIHandle.

void BSP_QSPI_MspDeInit | ( | QSPI_HandleTypeDef * | hqspi,
 |  | void * | Params
 | ) |  |

QSPI MSP De-Initialization This function frees the hardware resources used in this example:

  • Disable the Peripheral's clock
  • Revert GPIO and NVIC configuration to their default state
    Return values:
    None

Definition at line 566 of file stm32h747i_discovery_qspi.c.

References QSPI_BK1_CS_GPIO_PORT, QSPI_BK1_CS_PIN, QSPI_BK1_D0_GPIO_PORT, QSPI_BK1_D0_PIN, QSPI_BK1_D1_GPIO_PORT, QSPI_BK1_D1_PIN, QSPI_BK1_D2_GPIO_PORT, QSPI_BK1_D2_PIN, QSPI_BK1_D3_GPIO_PORT, QSPI_BK1_D3_PIN, QSPI_BK2_CS_GPIO_PORT, QSPI_BK2_CS_PIN, QSPI_BK2_D0_GPIO_PORT, QSPI_BK2_D0_PIN, QSPI_BK2_D1_GPIO_PORT, QSPI_BK2_D1_PIN, QSPI_BK2_D2_GPIO_PORT, QSPI_BK2_D2_PIN, QSPI_BK2_D3_GPIO_PORT, QSPI_BK2_D3_PIN, QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_DeInit().

void BSP_QSPI_MspInit | ( | QSPI_HandleTypeDef * | hqspi,
 |  | void * | Params
 | ) |  |

QSPI MSP Initialization This function configures the hardware resources used in this example:

  • Peripheral's clock enable
  • Peripheral's GPIO Configuration
  • NVIC configuration for QSPI interrupt
    Return values:
    None

Definition at line 479 of file stm32h747i_discovery_qspi.c.

References QSPI_BK1_CS_GPIO_CLK_ENABLE, QSPI_BK1_CS_GPIO_PORT, QSPI_BK1_CS_PIN, QSPI_BK1_D0_GPIO_CLK_ENABLE, QSPI_BK1_D0_GPIO_PORT, QSPI_BK1_D0_PIN, QSPI_BK1_D1_GPIO_CLK_ENABLE, QSPI_BK1_D1_GPIO_PORT, QSPI_BK1_D1_PIN, QSPI_BK1_D2_GPIO_CLK_ENABLE, QSPI_BK1_D2_GPIO_PORT, QSPI_BK1_D2_PIN, QSPI_BK1_D3_GPIO_CLK_ENABLE, QSPI_BK1_D3_GPIO_PORT, QSPI_BK1_D3_PIN, QSPI_BK2_CS_GPIO_CLK_ENABLE, QSPI_BK2_D0_GPIO_CLK_ENABLE, QSPI_BK2_D0_GPIO_PORT, QSPI_BK2_D0_PIN, QSPI_BK2_D1_GPIO_CLK_ENABLE, QSPI_BK2_D1_GPIO_PORT, QSPI_BK2_D1_PIN, QSPI_BK2_D2_GPIO_CLK_ENABLE, QSPI_BK2_D2_GPIO_PORT, QSPI_BK2_D2_PIN, QSPI_BK2_D3_GPIO_CLK_ENABLE, QSPI_BK2_D3_GPIO_PORT, QSPI_BK2_D3_PIN, QSPI_CLK_ENABLE, QSPI_CLK_GPIO_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_Init().

uint8_t BSP_QSPI_Read | ( | uint8_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | Size
 | ) |  |

Reads an amount of data from the QSPI memory.

Parameters:
pData,: Pointer to data to be read
ReadAddr,: Read start address
Size,: Size of data to read
Return values:
QSPI memory status

Definition at line 176 of file stm32h747i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_Write | ( | uint8_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | Size
 | ) |  |

Writes an amount of data to the QSPI memory.

Parameters:
pData,: Pointer to data to be written
WriteAddr,: Write start address
Size,: Size of data to write
Return values:
QSPI memory status

Definition at line 216 of file stm32h747i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_QSPI

Defines

#define | QSPI_OK ((uint8_t)0x00)
#define | QSPI_ERROR ((uint8_t)0x01)
#define | QSPI_BUSY ((uint8_t)0x02)
#define | QSPI_NOT_SUPPORTED ((uint8_t)0x04)
#define | QSPI_SUSPENDED ((uint8_t)0x08)
#define | QSPI_PROTECTED ((uint8_t)0x10)
#define | QSPI_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
#define | QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
#define | QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_BK1_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK1_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_BK1_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK1_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK1_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK2_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK2_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | QSPI_BK2_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | QSPI_BK2_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK2_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_FORCE_RESET() __HAL_RCC_QSPI_FORCE_RESET()
#define | QSPI_RELEASE_RESET() __HAL_RCC_QSPI_RELEASE_RESET()
#define | QSPI_CLK_PIN GPIO_PIN_2
#define | QSPI_CLK_GPIO_PORT GPIOB
#define | QSPI_BK1_CS_PIN GPIO_PIN_6
#define | QSPI_BK1_CS_GPIO_PORT GPIOG
#define | QSPI_BK1_D0_PIN GPIO_PIN_11
#define | QSPI_BK1_D0_GPIO_PORT GPIOD
#define | QSPI_BK1_D1_PIN GPIO_PIN_9
#define | QSPI_BK1_D1_GPIO_PORT GPIOF
#define | QSPI_BK1_D2_PIN GPIO_PIN_7
#define | QSPI_BK1_D2_GPIO_PORT GPIOF
#define | QSPI_BK1_D3_PIN GPIO_PIN_6
#define | QSPI_BK1_D3_GPIO_PORT GPIOF
#define | QSPI_BK2_CS_PIN GPIO_PIN_6
#define | QSPI_BK2_CS_GPIO_PORT GPIOG
#define | QSPI_BK2_D0_PIN GPIO_PIN_2
#define | QSPI_BK2_D0_GPIO_PORT GPIOH
#define | QSPI_BK2_D1_PIN GPIO_PIN_3
#define | QSPI_BK2_D1_GPIO_PORT GPIOH
#define | QSPI_BK2_D2_PIN GPIO_PIN_9
#define | QSPI_BK2_D2_GPIO_PORT GPIOG
#define | QSPI_BK2_D3_PIN GPIO_PIN_14
#define | QSPI_BK2_D3_GPIO_PORT GPIOG
#define | QSPI_FLASH_SIZE 26 /* Address bus width to access whole memory space */
#define | QSPI_PAGE_SIZE 256
#define | QSPI_BASE_ADDRESS 0x90000000

Define Documentation

#define QSPI_BASE_ADDRESS 0x90000000

Definition at line 110 of file stm32h747i_discovery_qspi.h.

#define QSPI_BK1_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 61 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK1_CS_GPIO_PORT GPIOG

Definition at line 81 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_CS_PIN GPIO_PIN_6

Definition at line 80 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 62 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK1_D0_GPIO_PORT GPIOD

Definition at line 83 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D0_PIN GPIO_PIN_11

Definition at line 82 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 63 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK1_D1_GPIO_PORT GPIOF

Definition at line 85 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D1_PIN GPIO_PIN_9

Definition at line 84 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 64 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK1_D2_GPIO_PORT GPIOF

Definition at line 87 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D2_PIN GPIO_PIN_7

Definition at line 86 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 65 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK1_D3_GPIO_PORT GPIOF

Definition at line 89 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK1_D3_PIN GPIO_PIN_6

Definition at line 88 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 66 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK2_CS_GPIO_PORT GPIOG

Definition at line 93 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_BK2_CS_PIN GPIO_PIN_6

Definition at line 92 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_BK2_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 67 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK2_D0_GPIO_PORT GPIOH

Definition at line 95 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D0_PIN GPIO_PIN_2

Definition at line 94 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 68 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK2_D1_GPIO_PORT GPIOH

Definition at line 97 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D1_PIN GPIO_PIN_3

Definition at line 96 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 69 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK2_D2_GPIO_PORT GPIOG

Definition at line 99 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D2_PIN GPIO_PIN_9

Definition at line 98 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 70 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_BK2_D3_GPIO_PORT GPIOG

Definition at line 101 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BK2_D3_PIN GPIO_PIN_14

Definition at line 100 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 52 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().

#define QSPI_CLK_DISABLE ( ) __HAL_RCC_QSPI_CLK_DISABLE()

Definition at line 59 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_CLK_ENABLE ( ) __HAL_RCC_QSPI_CLK_ENABLE()

Definition at line 58 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 60 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_PORT GPIOB

Definition at line 78 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CLK_PIN GPIO_PIN_2

Definition at line 77 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_ERROR ((uint8_t)0x01)

Definition at line 51 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_Read(), BSP_QSPI_Write(), QSPI_AutoPollingMemReady(), QSPI_DummyCyclesCfg(), QSPI_EnterFourBytesAddress(), QSPI_EnterQPI(), QSPI_ResetMemory(), and QSPI_WriteEnable().

#define QSPI_FLASH_SIZE 26 /* Address bus width to access whole memory space */

Definition at line 106 of file stm32h747i_discovery_qspi.h.

#define QSPI_FORCE_RESET ( ) __HAL_RCC_QSPI_FORCE_RESET()

Definition at line 73 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)

Definition at line 53 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

Definition at line 50 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_GetInfo(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_Read(), BSP_QSPI_Write(), QSPI_AutoPollingMemReady(), QSPI_DummyCyclesCfg(), QSPI_EnterFourBytesAddress(), QSPI_EnterQPI(), QSPI_ResetMemory(), and QSPI_WriteEnable().

#define QSPI_PAGE_SIZE 256

Definition at line 107 of file stm32h747i_discovery_qspi.h.

#define QSPI_PROTECTED ((uint8_t)0x10)

Definition at line 55 of file stm32h747i_discovery_qspi.h.

#define QSPI_RELEASE_RESET ( ) __HAL_RCC_QSPI_RELEASE_RESET()

Definition at line 74 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_SUSPENDED ((uint8_t)0x08)

Definition at line 54 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().


STM32H747I-Discovery BSP User Manual: QSPI_Info Struct Reference

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

#include <stm32h747i_discovery_qspi.h>

Data Fields

uint32_t | FlashSize
uint32_t | EraseSectorSize
uint32_t | EraseSectorsNumber
uint32_t | ProgPageSize
uint32_t | ProgPagesNumber

Detailed Description

Definition at line 121 of file stm32h747i_discovery_qspi.h.

Field Documentation

uint32_t QSPI_Info::EraseSectorSize

Size of sectors for the erase operation

Definition at line 123 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::EraseSectorsNumber

Number of sectors for the erase operation

Definition at line 124 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::FlashSize

Size of the flash

Definition at line 122 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPageSize

Size of pages for the program operation

Definition at line 125 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPagesNumber

Number of pages for the program operation

Definition at line 126 of file stm32h747i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

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


STM32H747I-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32H747I_DISCOVERY_SD

Variables

SD_HandleTypeDef uSdHandle

Variable Documentation

SD_HandleTypeDef uSdHandle

Definition at line 80 of file stm32h747i_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_WriteBlocks(), and BSP_SD_WriteBlocks_DMA().


STM32H747I-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32H747I_DISCOVERY_SD

Functions

uint8_t | BSP_SD_Init (void)
Initializes the SD card device.
uint8_t | BSP_SD_DeInit (void)
DeInitializes the SD card device.
uint8_t | BSP_SD_ITConfig (void)
Configures Interrupt mode for SD1 detection pin.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
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 (void)
BSP SD Abort callbacks.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callbacks.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callbacks.

Function Documentation

void BSP_SD_AbortCallback ( void )

BSP SD Abort callbacks.

Return values:
None

Definition at line 441 of file stm32h747i_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

uint8_t BSP_SD_DeInit ( void )

DeInitializes the SD card device.

Return values:
SD status

Definition at line 128 of file stm32h747i_discovery_sd.c.

References BSP_SD_MspDeInit(), MSD_ERROR, MSD_OK, and uSdHandle.

uint8_t BSP_SD_Erase | ( | uint32_t | StartAddr,
 |  | uint32_t | EndAddr
 | ) |  |

Erases the specified memory area of the given SD card.

Parameters:
StartAddr,: Start byte address
EndAddr,: End byte address
Return values:
SD status

Definition at line 277 of file stm32h747i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( BSP_SD_CardInfo * CardInfo )

Get SD information about specific SD card.

Parameters:
CardInfo,: Pointer to HAL_SD_CardInfoTypedef structure
Return values:
None

Definition at line 401 of file stm32h747i_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_GetCardState ( void )

Gets the current SD card data status.

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
  • SD_TRANSFER_ERROR: Data transfer error

Definition at line 391 of file stm32h747i_discovery_sd.c.

References SD_TRANSFER_BUSY, SD_TRANSFER_OK, and uSdHandle.

uint8_t BSP_SD_Init ( void )

Initializes the SD card device.

Return values:
SD status

Definition at line 93 of file stm32h747i_discovery_sd.c.

References BSP_SD_IsDetected(), BSP_SD_MspInit(), MSD_ERROR, MSD_ERROR_SD_NOT_PRESENT, MSD_OK, SD_PRESENT, and uSdHandle.

void BSP_SD_IRQHandler ( void )

Handles SD card interrupt request.

Return values:
None

Definition at line 378 of file stm32h747i_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_IsDetected ( void )

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

Return values:
Returns if SD is detected or not

Definition at line 173 of file stm32h747i_discovery_sd.c.

References SD_DETECT_GPIO_PORT, SD_DETECT_PIN, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_Init().

uint8_t BSP_SD_ITConfig ( void )

Configures Interrupt mode for SD1 detection pin.

Return values:
Returns 0

Definition at line 151 of file stm32h747i_discovery_sd.c.

References MSD_OK, SD_DETECT_EXTI_IRQn, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

void BSP_SD_MspDeInit | ( | SD_HandleTypeDef * | hsd,
 |  | void * | Params
 | ) |  |

DeInitializes the SD MSP.

Parameters:
hsd | SD handle
Params | User parameters
Return values:
None

Definition at line 359 of file stm32h747i_discovery_sd.c.

Referenced by BSP_SD_DeInit().

void BSP_SD_MspInit | ( | SD_HandleTypeDef * | hsd,
 |  | void * | Params
 | ) |  |

Initializes the SD MSP.

Parameters:
hsd | SD handle
Params | User parameters
Return values:
None

Definition at line 296 of file stm32h747i_discovery_sd.c.

Referenced by BSP_SD_Init().

uint8_t BSP_SD_ReadBlocks | ( | uint32_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | NumOfBlocks,
 |  | uint32_t | Timeout
 | ) |  |

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

Parameters:
pData,: Pointer to the buffer that will contain the data to transmit
ReadAddr,: Address from where data is to be read
NumOfBlocks,: Number of SD blocks to read
Timeout,: Timeout for read operation
Return values:
SD status

Definition at line 195 of file stm32h747i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

uint8_t BSP_SD_ReadBlocks_DMA | ( | uint32_t * | pData,
 |  | uint32_t | ReadAddr,
 |  | uint32_t | NumOfBlocks
 | ) |  |

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

Parameters:
pData,: Pointer to the buffer that will contain the data to transmit
ReadAddr,: Address from where data is to be read
NumOfBlocks,: Number of SD blocks to read
Return values:
SD status

Definition at line 237 of file stm32h747i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_ReadCpltCallback ( void )

BSP Rx Transfer completed callbacks.

Return values:
None

Definition at line 459 of file stm32h747i_discovery_sd.c.

Referenced by HAL_SD_RxCpltCallback().

uint8_t BSP_SD_WriteBlocks | ( | uint32_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | NumOfBlocks,
 |  | uint32_t | Timeout
 | ) |  |

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

Parameters:
pData,: Pointer to the buffer that will contain the data to transmit
WriteAddr,: Address from where data is to be written
NumOfBlocks,: Number of SD blocks to write
Timeout,: Timeout for write operation
Return values:
SD status

Definition at line 217 of file stm32h747i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

uint8_t BSP_SD_WriteBlocks_DMA | ( | uint32_t * | pData,
 |  | uint32_t | WriteAddr,
 |  | uint32_t | NumOfBlocks
 | ) |  |

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

Parameters:
pData,: Pointer to the buffer that will contain the data to transmit
WriteAddr,: Address from where data is to be written
NumOfBlocks,: Number of SD blocks to write
Return values:
SD status

Definition at line 257 of file stm32h747i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_WriteCpltCallback ( void )

BSP Tx Transfer completed callbacks.

Return values:
None

Definition at line 450 of file stm32h747i_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 411 of file stm32h747i_discovery_sd.c.

References BSP_SD_AbortCallback().

void HAL_SD_RxCpltCallback ( SD_HandleTypeDef * hsd )

Rx Transfer completed callbacks.

Parameters:
hsd SD handle
Return values:
None

Definition at line 432 of file stm32h747i_discovery_sd.c.

References BSP_SD_ReadCpltCallback().

void HAL_SD_TxCpltCallback ( SD_HandleTypeDef * hsd )

Tx Transfer completed callbacks.

Parameters:
hsd SD handle
Return values:
None

Definition at line 422 of file stm32h747i_discovery_sd.c.

References BSP_SD_WriteCpltCallback().


STM32H747I-Discovery BSP User Manual: Exported Types

Defines
Exported Types
STM32H747I_DISCOVERY_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 52 of file stm32h747i_discovery_sd.h.


STM32H747I-Discovery BSP User Manual: Exported_Constants Exported Constants

Defines
Exported_Constants Exported Constants
STM32H747I_DISCOVERY_SD

Defines

#define | MSD_OK ((uint8_t)0x00)
SD status structure definition.
#define | MSD_ERROR ((uint8_t)0x01)
#define | MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)
#define | SD_TRANSFER_OK ((uint8_t)0x00)
SD transfer state definition.
#define | SD_TRANSFER_BUSY ((uint8_t)0x01)
#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SD_DATATIMEOUT ((uint32_t)100000000)

Define Documentation

#define MSD_ERROR ((uint8_t)0x01)

Definition at line 64 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_DeInit(), BSP_SD_Erase(), BSP_SD_Init(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_WriteBlocks(), and BSP_SD_WriteBlocks_DMA().

#define MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)

Definition at line 65 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

Definition at line 63 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_DeInit(), BSP_SD_Erase(), BSP_SD_Init(), BSP_SD_ITConfig(), BSP_SD_ReadBlocks(), BSP_SD_ReadBlocks_DMA(), BSP_SD_WriteBlocks(), and BSP_SD_WriteBlocks_DMA().

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 77 of file stm32h747i_discovery_sd.h.

#define SD_NOT_PRESENT ((uint8_t)0x00)

Definition at line 75 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 74 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_Init(), and BSP_SD_IsDetected().

#define SD_TRANSFER_BUSY ((uint8_t)0x01)

Definition at line 71 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK ((uint8_t)0x00)

SD transfer state definition.

Definition at line 70 of file stm32h747i_discovery_sd.h.

Referenced by BSP_SD_GetCardState().


STM32H747I-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32H747I_DISCOVERY_SDRAM

Variables

SDRAM_HandleTypeDef sdramHandle

Variable Documentation

SDRAM_HandleTypeDef sdramHandle

Definition at line 77 of file stm32h747i_discovery_sdram.c.

Referenced by BSP_SDRAM_DeInit(), BSP_SDRAM_Init(), BSP_SDRAM_Initialization_sequence(), BSP_SDRAM_ReadData(), BSP_SDRAM_ReadData_DMA(), BSP_SDRAM_Sendcmd(), BSP_SDRAM_WriteData(), and BSP_SDRAM_WriteData_DMA().


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_SDRAM

Variables

static FMC_SDRAM_TimingTypeDef | Timing
static FMC_SDRAM_CommandTypeDef | Command

Variable Documentation

FMC_SDRAM_CommandTypeDef Command [static]

Definition at line 86 of file stm32h747i_discovery_sdram.c.

Referenced by BSP_SDRAM_Initialization_sequence().

FMC_SDRAM_TimingTypeDef Timing [static]

Definition at line 85 of file stm32h747i_discovery_sdram.c.

Referenced by BSP_SDRAM_Init().


STM32H747I-Discovery BSP User Manual: Exported_Functions

Functions
Exported_Functions
STM32H747I_DISCOVERY_SDRAM

Functions

uint8_t | BSP_SDRAM_Init (void)
Initializes the SDRAM device.
uint8_t | BSP_SDRAM_DeInit (void)
DeInitializes the SDRAM device.
void | BSP_SDRAM_Initialization_sequence (uint32_t RefreshCount)
Programs the SDRAM device.
uint8_t | BSP_SDRAM_ReadData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_ReadData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_WriteData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_WriteData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_Sendcmd (FMC_SDRAM_CommandTypeDef *SdramCmd)
Sends command to the SDRAM bank.
__weak void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
__weak void | BSP_SDRAM_MspDeInit (SDRAM_HandleTypeDef *hsdram, void *Params)
DeInitializes SDRAM MSP.

Function Documentation

uint8_t BSP_SDRAM_DeInit ( void )

DeInitializes the SDRAM device.

Return values:
SDRAM status

Definition at line 146 of file stm32h747i_discovery_sdram.c.

References BSP_SDRAM_MspDeInit(), SDRAM_ERROR, SDRAM_OK, and sdramHandle.

uint8_t BSP_SDRAM_Init ( void )

Initializes the SDRAM device.

Return values:
SDRAM status

Definition at line 99 of file stm32h747i_discovery_sdram.c.

References BSP_SDRAM_Initialization_sequence(), BSP_SDRAM_MspInit(), REFRESH_COUNT, SDCLOCK_PERIOD, SDRAM_ERROR, SDRAM_MEMORY_WIDTH, SDRAM_OK, sdramHandle, and Timing.

Referenced by BSP_LCD_InitEx().

void BSP_SDRAM_Initialization_sequence ( uint32_t RefreshCount )

Programs the SDRAM device.

Parameters:
RefreshCount,: SDRAM refresh counter value
Return values:
None

Definition at line 170 of file stm32h747i_discovery_sdram.c.

References Command, SDRAM_MODEREG_BURST_LENGTH_1, SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL, SDRAM_MODEREG_CAS_LATENCY_3, SDRAM_MODEREG_OPERATING_MODE_STANDARD, SDRAM_MODEREG_WRITEBURST_MODE_SINGLE, SDRAM_TIMEOUT, and sdramHandle.

Referenced by BSP_SDRAM_Init().

void BSP_SDRAM_MspDeInit | ( | SDRAM_HandleTypeDef * | hsdram,
 |  | void * | Params
 | ) |  |

DeInitializes SDRAM MSP.

Parameters:
hsdram | SDRAM handle
Params | User parameters
Return values:
None

Definition at line 425 of file stm32h747i_discovery_sdram.c.

References SDRAM_MDMAx_CHANNEL, and SDRAM_MDMAx_IRQn.

Referenced by BSP_SDRAM_DeInit().

void BSP_SDRAM_MspInit | ( | SDRAM_HandleTypeDef * | hsdram,
 |  | void * | Params
 | ) |  |

Initializes SDRAM MSP.

Parameters:
hsdram | SDRAM handle
Params | User parameters
Return values:
None

Definition at line 324 of file stm32h747i_discovery_sdram.c.

References __MDMAx_CLK_ENABLE, SDRAM_MDMAx_CHANNEL, and SDRAM_MDMAx_IRQn.

Referenced by BSP_SDRAM_Init().

uint8_t BSP_SDRAM_ReadData | ( | uint32_t | uwStartAddress,
 |  | uint32_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the SDRAM memory in polling mode.

Parameters:
uwStartAddress,: Read start address
pData,: Pointer to data to be read
uwDataSize,: Size of read data from the memory
Return values:
SDRAM status

Definition at line 232 of file stm32h747i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

uint8_t BSP_SDRAM_ReadData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint32_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

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

Parameters:
uwStartAddress,: Read start address
pData,: Pointer to data to be read
uwDataSize,: Size of read data from the memory
Return values:
SDRAM status

Definition at line 251 of file stm32h747i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

uint8_t BSP_SDRAM_Sendcmd ( FMC_SDRAM_CommandTypeDef * SdramCmd )

Sends command to the SDRAM bank.

Parameters:
SdramCmd,: Pointer to SDRAM command structure
Return values:
SDRAM status

Definition at line 306 of file stm32h747i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, SDRAM_TIMEOUT, and sdramHandle.

uint8_t BSP_SDRAM_WriteData | ( | uint32_t | uwStartAddress,
 |  | uint32_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data to the SDRAM memory in polling mode.

Parameters:
uwStartAddress,: Write start address
pData,: Pointer to data to be written
uwDataSize,: Size of written data from the memory
Return values:
SDRAM status

Definition at line 270 of file stm32h747i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

uint8_t BSP_SDRAM_WriteData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint32_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

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

Parameters:
uwStartAddress,: Write start address
pData,: Pointer to data to be written
uwDataSize,: Size of written data from the memory
Return values:
SDRAM status

Definition at line 289 of file stm32h747i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_SDRAM

Defines

#define | SDRAM_OK ((uint8_t)0x00)
SDRAM status structure definition.
#define | SDRAM_ERROR ((uint8_t)0x01)
#define | SDRAM_DEVICE_ADDR ((uint32_t)0xD0000000)
#define | SDRAM_DEVICE_SIZE ((uint32_t)0x2000000) /* SDRAM device size in MBytes */
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
#define | SDRAM_TIMEOUT ((uint32_t)0xFFFF)
#define | __MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE
#define | __MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE
#define | SDRAM_MDMAx_CHANNEL MDMA_Channel0
#define | SDRAM_MDMAx_IRQn MDMA_IRQn
#define | SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
FMC SDRAM Mode definition register defines.
#define | SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
#define | SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
#define | SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
#define | SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
#define | SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
#define | SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
#define | SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
#define | SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
#define | SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
#define | SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Define Documentation

#define __MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE

Definition at line 69 of file stm32h747i_discovery_sdram.h.

#define __MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE

Definition at line 68 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */

Definition at line 63 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2

Definition at line 60 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_DEVICE_ADDR ((uint32_t)0xD0000000)

Definition at line 53 of file stm32h747i_discovery_sdram.h.

#define SDRAM_DEVICE_SIZE ((uint32_t)0x2000000) /* SDRAM device size in MBytes */

Definition at line 54 of file stm32h747i_discovery_sdram.h.

#define SDRAM_ERROR ((uint8_t)0x01)

Definition at line 51 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_DeInit(), BSP_SDRAM_Init(), BSP_SDRAM_ReadData(), BSP_SDRAM_ReadData_DMA(), BSP_SDRAM_Sendcmd(), BSP_SDRAM_WriteData(), and BSP_SDRAM_WriteData_DMA().

#define SDRAM_MDMAx_CHANNEL MDMA_Channel0

Definition at line 70 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_MDMAx_IRQn MDMA_IRQn

Definition at line 71 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32

Definition at line 58 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)

FMC SDRAM Mode definition register defines.

Definition at line 77 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)

Definition at line 78 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)

Definition at line 79 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)

Definition at line 80 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)

Definition at line 82 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)

Definition at line 81 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)

Definition at line 83 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)

Definition at line 84 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)

Definition at line 85 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)

Definition at line 86 of file stm32h747i_discovery_sdram.h.

#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Definition at line 87 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_OK ((uint8_t)0x00)

SDRAM status structure definition.

Definition at line 50 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_DeInit(), BSP_SDRAM_Init(), BSP_SDRAM_ReadData(), BSP_SDRAM_ReadData_DMA(), BSP_SDRAM_Sendcmd(), BSP_SDRAM_WriteData(), and BSP_SDRAM_WriteData_DMA().

#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)

Definition at line 65 of file stm32h747i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence(), and BSP_SDRAM_Sendcmd().


STM32H747I-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32H747I_DISCOVERY_TS

Variables

static TS_DrvTypeDef * | ts_driver
static uint8_t | ts_orientation
static uint8_t | I2C_Address = 0
char * | ts_event_string_tab [TOUCH_EVENT_NB_MAX]
Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.
char * | ts_gesture_id_string_tab [GEST_ID_NB_MAX]
Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Variable Documentation

uint8_t I2C_Address = 0 [static]

Definition at line 74 of file stm32h747i_discovery_ts.c.

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

TS_DrvTypeDef* ts_driver [static]

Definition at line 72 of file stm32h747i_discovery_ts.c.

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

char* ts_event_string_tab[TOUCH_EVENT_NB_MAX]
Initial value:
 { "None",
                                                   "Press down",
                                                   "Lift up",
                                                   "Contact"
                                                  }

Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.

Definition at line 77 of file stm32h747i_discovery_ts.c.

char* ts_gesture_id_string_tab[GEST_ID_NB_MAX]
Initial value:
 { "None",
                                                    "Move Up",
                                                    "Move Right",
                                                    "Move Down",
                                                    "Move Left",
                                                    "Zoom In",
                                                    "Zoom Out"
                                                  }

Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Definition at line 84 of file stm32h747i_discovery_ts.c.

uint8_t ts_orientation [static]

Definition at line 73 of file stm32h747i_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


STM32H747I-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32H747I_DISCOVERY_TS

Functions

uint8_t | BSP_TS_Init (uint16_t ts_SizeX, uint16_t ts_SizeY)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
__weak void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.

Function Documentation

uint8_t BSP_TS_GetState ( TS_StateTypeDef * TS_State )

Returns status and positions of the touch screen.

Parameters:
TS_State,: Pointer to touch screen current state structure
Return values:
TS_OK if all initializations are OK. Other value if error.

Definition at line 194 of file stm32h747i_discovery_ts.c.

References I2C_Address, TOUCH_EVENT_CONTACT, TOUCH_EVENT_LIFT_UP, TOUCH_EVENT_NO_EVT, TOUCH_EVENT_PRESS_DOWN, TS_StateTypeDef::touchDetected, TS_StateTypeDef::touchX, TS_StateTypeDef::touchY, ts_driver, TS_ERROR, TS_MAX_NB_TOUCH, TS_OK, ts_orientation, TS_SWAP_X, TS_SWAP_XY, and TS_SWAP_Y.

uint8_t BSP_TS_Init | ( | uint16_t | ts_SizeX,
 |  | uint16_t | ts_SizeY
 | ) |  |

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

Parameters:
ts_SizeX | : Maximum X size of the TS area on LCD
ts_SizeY | : Maximum Y size of the TS area on LCD
Return values:
TS_OK if all initializations are OK. Other value if error.

Definition at line 108 of file stm32h747i_discovery_ts.c.

References I2C_Address, TS_DEVICE_NOT_FOUND, ts_driver, TS_I2C_ADDRESS, TS_OK, ts_orientation, TS_SWAP_NONE, TS_SWAP_XY, and TS_SWAP_Y.

void BSP_TS_INT_MspInit ( void )

Initializes the TS_INT pin MSP.

Return values:
None

Definition at line 379 of file stm32h747i_discovery_ts.c.

References TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITConfig().

uint8_t BSP_TS_ITConfig ( void )

Configures and enables the touch screen interrupts.

Return values:
TS_OK if all initializations are OK. Other value if error.

Definition at line 160 of file stm32h747i_discovery_ts.c.

References BSP_TS_INT_MspInit(), I2C_Address, ts_driver, TS_INT_EXTI_IRQn, TS_INT_GPIO_PORT, TS_INT_PIN, and TS_OK.


STM32H747I-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32H747I_DISCOVERY_TS

Defines

#define | TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
With FT6206 : maximum 2 touches detected simultaneously.
#define | TS_NO_IRQ_PENDING ((uint8_t) 0)
#define | TS_IRQ_PENDING ((uint8_t) 1)
#define | TS_SWAP_NONE ((uint8_t) 0x01)
#define | TS_SWAP_X ((uint8_t) 0x02)
#define | TS_SWAP_Y ((uint8_t) 0x04)
#define | TS_SWAP_XY ((uint8_t) 0x08)

Define Documentation

#define TS_IRQ_PENDING ((uint8_t) 1)

Definition at line 56 of file stm32h747i_discovery_ts.h.

#define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)

With FT6206 : maximum 2 touches detected simultaneously.

Definition at line 53 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_NO_IRQ_PENDING ((uint8_t) 0)

Definition at line 55 of file stm32h747i_discovery_ts.h.

#define TS_SWAP_NONE ((uint8_t) 0x01)

Definition at line 58 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_Init().

#define TS_SWAP_X ((uint8_t) 0x02)

Definition at line 59 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_XY ((uint8_t) 0x08)

Definition at line 61 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

#define TS_SWAP_Y ((uint8_t) 0x04)

Definition at line 60 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


STM32H747I-Discovery BSP User Manual: Exported Types

Data Structures | Enumerations
Exported Types
STM32H747I_DISCOVERY_TS

Data Structures

struct | TS_StateTypeDef
TS_StateTypeDef Define TS State structure. More...

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02, TS_DEVICE_NOT_FOUND = 0x03 }
TS_StatusTypeDef Define BSP_TS_xxx() functions possible return value, when status is returned by those functions. More...
enum TS_GestureIdTypeDef {
GEST_ID_NO_GESTURE = 0x00, GEST_ID_MOVE_UP = 0x01, GEST_ID_MOVE_RIGHT = 0x02, GEST_ID_MOVE_DOWN = 0x03,
GEST_ID_MOVE_LEFT = 0x04, GEST_ID_ZOOM_IN = 0x05, GEST_ID_ZOOM_OUT = 0x06, GEST_ID_NB_MAX = 0x07
}
TS_GestureIdTypeDef Define Possible managed gesture identification values returned by touch screen driver. More...
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...

Enumeration Type Documentation

enum TS_GestureIdTypeDef

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

Enumerator:
GEST_ID_NO_GESTURE

Gesture not defined / recognized

GEST_ID_MOVE_UP

Gesture Move Up

GEST_ID_MOVE_RIGHT

Gesture Move Right

GEST_ID_MOVE_DOWN

Gesture Move Down

GEST_ID_MOVE_LEFT

Gesture Move Left

GEST_ID_ZOOM_IN

Gesture Zoom In

GEST_ID_ZOOM_OUT

Gesture Zoom Out

GEST_ID_NB_MAX

max number of gesture id

Definition at line 107 of file stm32h747i_discovery_ts.h.

enum TS_StatusTypeDef

TS_StatusTypeDef Define BSP_TS_xxx() functions possible return value, when status is returned by those functions.

Enumerator:
TS_OK

Touch Ok

TS_ERROR

Touch Error

TS_TIMEOUT

Touch Timeout

TS_DEVICE_NOT_FOUND

Touchscreen device not found

Definition at line 94 of file stm32h747i_discovery_ts.h.

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 124 of file stm32h747i_discovery_ts.h.


STM32H747I-Discovery BSP User Manual: TS_StateTypeDef Struct Reference

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

TS_StateTypeDef Define TS State structure. More...

#include <stm32h747i_discovery_ts.h>

Data Fields

uint8_t | touchDetected
uint16_t | touchX [TS_MAX_NB_TOUCH]
uint16_t | touchY [TS_MAX_NB_TOUCH]

Detailed Description

TS_StateTypeDef Define TS State structure.

Definition at line 74 of file stm32h747i_discovery_ts.h.

Field Documentation

uint8_t TS_StateTypeDef::touchDetected

Total number of active touches detected at last scan

Definition at line 76 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::touchX[TS_MAX_NB_TOUCH]

Touch X[0], X[1] coordinates on 12 bits

Definition at line 77 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::touchY[TS_MAX_NB_TOUCH]

Touch Y[0], Y[1] coordinates on 12 bits

Definition at line 78 of file stm32h747i_discovery_ts.h.

Referenced by BSP_TS_GetState().

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


STM32H747I-Discovery BSP User Manual: Imported Variables

Variables
Imported Variables
STM32H747I_DISCOVERY_TS

Variables

char * | ts_event_string_tab [TOUCH_EVENT_NB_MAX]
Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.
char * | ts_gesture_id_string_tab [GEST_ID_NB_MAX]
Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Variable Documentation

char* ts_event_string_tab[TOUCH_EVENT_NB_MAX]

Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.

Definition at line 77 of file stm32h747i_discovery_ts.c.

char* ts_gesture_id_string_tab[GEST_ID_NB_MAX]

Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Definition at line 84 of file stm32h747i_discovery_ts.c.


STM32H747I-Discovery BSP User Manual: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:
  • BackColor : LCD_DrawPropTypeDef
  • BitResolution : AUDIOIN_ContextTypeDef
  • ChannelNbr : AUDIOIN_ContextTypeDef
  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info
  • FlashSize : QSPI_Info
  • Frequency : AUDIOIN_ContextTypeDef
  • InputDevice : AUDIOIN_ContextTypeDef
  • Interface : AUDIOIN_ContextTypeDef
  • MultiBuffMode : AUDIOIN_ContextTypeDef
  • pFont : LCD_DrawPropTypeDef
  • pRecBuf : AUDIOIN_ContextTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • RecSize : AUDIOIN_ContextTypeDef
  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point


STM32H747I-Discovery BSP User Manual: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • BackColor : LCD_DrawPropTypeDef
  • BitResolution : AUDIOIN_ContextTypeDef
  • ChannelNbr : AUDIOIN_ContextTypeDef
  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info
  • FlashSize : QSPI_Info
  • Frequency : AUDIOIN_ContextTypeDef
  • InputDevice : AUDIOIN_ContextTypeDef
  • Interface : AUDIOIN_ContextTypeDef
  • MultiBuffMode : AUDIOIN_ContextTypeDef
  • pFont : LCD_DrawPropTypeDef
  • pRecBuf : AUDIOIN_ContextTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • RecSize : AUDIOIN_ContextTypeDef
  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point


STM32H747I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • __MDMAx_CLK_DISABLE : stm32h747i_discovery_sdram.h
  • __MDMAx_CLK_ENABLE : stm32h747i_discovery_sdram.h
  • __STM32H747I_DISCOVERY_BSP_VERSION : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_MAIN : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_RC : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_SUB1 : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_SUB2 : stm32h747i_discovery.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- a -

  • ABS : stm32h747i_discovery_lcd.c
  • ActiveLayer : stm32h747i_discovery_lcd.c
  • audio_drv : stm32h747i_discovery_audio.c
  • AUDIO_ERROR : stm32h747i_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32h747i_discovery.h
  • AUDIO_IN_INT_GPIO_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_INTERFACE_PDM : stm32h747i_discovery_audio.h
  • AUDIO_IN_INTERFACE_SAI : stm32h747i_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_CLK_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_SCK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IO_DeInit() : stm32h747i_discovery.c
  • AUDIO_IO_Delay() : stm32h747i_discovery.c
  • AUDIO_IO_Init() : stm32h747i_discovery.c
  • AUDIO_IO_Read() : stm32h747i_discovery.c
  • AUDIO_IO_Write() : stm32h747i_discovery.c
  • AUDIO_OK : stm32h747i_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_AF : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32h747i_discovery_audio.h
  • AUDIO_TIMEOUT : stm32h747i_discovery_audio.h
  • AUDIODATA_SIZE : stm32h747i_discovery_audio.h
  • AudioInVolume : stm32h747i_discovery_audio.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • BSP_AUDIO_FREQUENCY_11K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_16K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_22K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_32K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_44K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_48K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_8K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_96K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_AllocScratch() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_ClockConfig() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ConfigDigitalMic() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ConfigMicDefault() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Error_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Error_Callback() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_GetChannelNumber() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_GetInterface() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBackEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_InitEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_MspDeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_MspInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_OUT_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Pause() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_PauseEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_PDMToPCM() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_PDMToPCM_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Record() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_RecordEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ResumeEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_SelectInterface() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_SetFrequency() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_StopEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_TransferComplete_CallBackEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_ClockConfig() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_MspDeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_MspInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32h747i_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_DMA_IRQHandler : stm32h747i_discovery_camera.h
  • BSP_CAMERA_ErrorCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_GetRotation() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Init() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_IRQHandler : stm32h747i_discovery_camera.h
  • BSP_CAMERA_LineEventCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_SetRotation() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32h747i_discovery_camera.c
  • BSP_GetVersion() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_DeInit() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_GetState() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_Init() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LCD_Clear() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DMA2D_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_DrawBitmap() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DSI_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_FillCircle() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_Init() : stm32h747i_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32h747i_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_LTDC_ER_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_LTDC_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_MspDeInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32h747i_discovery_lcd.c
  • BSP_LCD_Reset() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetBrightness() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32h747i_discovery_lcd.c
  • BSP_LED_DeInit() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_Init() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_LED_Off() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_On() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_Toggle() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_PB_DeInit() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_PB_GetState() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_PB_Init() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_QSPI_DeInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Init() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_MspDeInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_MspInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Read() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Write() : stm32h747i_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32h747i_discovery_sd.c
  • BSP_SD_CardInfo : stm32h747i_discovery_sd.h
  • BSP_SD_DeInit() : stm32h747i_discovery_sd.c
  • BSP_SD_Erase() : stm32h747i_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32h747i_discovery_sd.c
  • BSP_SD_GetCardState() : stm32h747i_discovery_sd.c
  • BSP_SD_Init() : stm32h747i_discovery_sd.c
  • BSP_SD_IRQHandler() : stm32h747i_discovery_sd.c
  • BSP_SD_IsDetected() : stm32h747i_discovery_sd.c
  • BSP_SD_ITConfig() : stm32h747i_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32h747i_discovery_sd.c
  • BSP_SD_MspInit() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32h747i_discovery_sd.c
  • BSP_SDRAM_DeInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Init() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32h747i_discovery_sdram.c
  • BSP_TS_GetState() : stm32h747i_discovery_ts.c
  • BSP_TS_Init() : stm32h747i_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32h747i_discovery_ts.c
  • BSP_TS_ITConfig() : stm32h747i_discovery_ts.c
  • BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • BUTTON_IRQn : stm32h747i_discovery.c
  • BUTTON_MODE_EXTI : stm32h747i_discovery.h
  • BUTTON_MODE_GPIO : stm32h747i_discovery.h
  • BUTTON_PIN : stm32h747i_discovery.c
  • BUTTON_PORT : stm32h747i_discovery.c
  • Button_TypeDef : stm32h747i_discovery.h
  • BUTTON_USER : stm32h747i_discovery.h
  • BUTTON_WAKEUP : stm32h747i_discovery.h
  • ButtonMode_TypeDef : stm32h747i_discovery.h
  • BUTTONn : stm32h747i_discovery.h
  • ButtonValue_TypeDef : stm32h747i_discovery.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • CAMERA_480x272_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_480x272_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_CLK_ENABLE : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_IRQ : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_STREAM : stm32h747i_discovery_camera.h
  • CAMERA_Delay() : stm32h747i_discovery.c
  • camera_drv : stm32h747i_discovery_camera.c
  • CAMERA_ERROR : stm32h747i_discovery_camera.h
  • CAMERA_FB_START_ADDRESS : stm32h747i_discovery_camera.h
  • CAMERA_I2C_ADDRESS : stm32h747i_discovery.h
  • CAMERA_IO_Init() : stm32h747i_discovery.c
  • CAMERA_IO_Read() : stm32h747i_discovery.c
  • CAMERA_IO_Write() : stm32h747i_discovery.c
  • CAMERA_NO_ROTATION : stm32h747i_discovery_camera.h
  • CAMERA_NOT_DETECTED : stm32h747i_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32h747i_discovery_camera.h
  • CAMERA_OK : stm32h747i_discovery_camera.h
  • CAMERA_QQVGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_QQVGA_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_QVGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_QVGA_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_ROTATION_90 : stm32h747i_discovery_camera.h
  • CAMERA_ROTATION_INVALID : stm32h747i_discovery_camera.h
  • CAMERA_TIMEOUT : stm32h747i_discovery_camera.h
  • CAMERA_VGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_VGA_RES_Y : stm32h747i_discovery_camera.h
  • CameraCurrentResolution : stm32h747i_discovery_camera.c
  • CameraHwAddress : stm32h747i_discovery_camera.c
  • CameraRotation : stm32h747i_discovery_camera.c
  • CENTER_MODE : stm32h747i_discovery_lcd.h
  • CODEC_AUDIOFRAME_SLOT_0 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32h747i_discovery_audio.h
  • Command : stm32h747i_discovery_sdram.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32h747i_discovery_audio.h
  • DISCO_ERROR : stm32h747i_discovery.h
  • DISCO_OK : stm32h747i_discovery.h
  • DISCO_Status_TypeDef : stm32h747i_discovery.h
  • DISCOVERY_I2Cx : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_CLK_ENABLE : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_ER_IRQn : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_EV_IRQn : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_FORCE_RESET : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_RELEASE_RESET : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_PIN : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_AF : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SDA_PIN : stm32h747i_discovery.h
  • DMA_MAX : stm32h747i_discovery_audio.h
  • DMA_MAX_SIZE : stm32h747i_discovery_audio.h
  • DOWN_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_PORT : stm32h747i_discovery.h
  • DOWN_JOY_PIN : stm32h747i_discovery.h
  • DrawChar() : stm32h747i_discovery_lcd.c
  • DrawProp : stm32h747i_discovery_lcd.c
  • DSI_IO_WriteCmd() : stm32h747i_discovery_lcd.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- e -

  • EEPROM_IO_Init() : stm32h747i_discovery.c
  • EEPROM_IO_IsDeviceReady() : stm32h747i_discovery.c
  • EEPROM_IO_ReadData() : stm32h747i_discovery.c
  • EEPROM_IO_WriteData() : stm32h747i_discovery.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- f -

  • FillTriangle() : stm32h747i_discovery_lcd.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- g -

  • GEST_ID_MOVE_DOWN : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_LEFT : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_RIGHT : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_UP : stm32h747i_discovery_ts.h
  • GEST_ID_NB_MAX : stm32h747i_discovery_ts.h
  • GEST_ID_NO_GESTURE : stm32h747i_discovery_ts.h
  • GEST_ID_ZOOM_IN : stm32h747i_discovery_ts.h
  • GEST_ID_ZOOM_OUT : stm32h747i_discovery_ts.h
  • GetSize() : stm32h747i_discovery_camera.c
  • GPIO_PIN : stm32h747i_discovery.c
  • GPIO_PORT : stm32h747i_discovery.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- h -

  • HAL_DCMI_ErrorCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32h747i_discovery_camera.c
  • HAL_SAI_ErrorCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32h747i_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32h747i_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32h747i_discovery_sd.c
  • haudio_in_sai : stm32h747i_discovery_audio.c
  • haudio_out_sai : stm32h747i_discovery_audio.c
  • hAudioIn : stm32h747i_discovery_audio.c
  • hdcmi_discovery : stm32h747i_discovery_camera.c
  • hdma2d_discovery : stm32h747i_discovery_lcd.c , stm32h747i_discovery_lcd.h
  • HDMI_IO_Delay() : stm32h747i_discovery.c
  • HDMI_IO_Init() : stm32h747i_discovery.c
  • HDMI_IO_Read() : stm32h747i_discovery.c
  • HDMI_IO_Write() : stm32h747i_discovery.c
  • hdsi_discovery : stm32h747i_discovery_lcd.c
  • hdsivideo_handle : stm32h747i_discovery_lcd.c
  • heval_I2c : stm32h747i_discovery.c
  • hltdc_discovery : stm32h747i_discovery_lcd.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- i -

  • I2C_Address : stm32h747i_discovery_ts.c
  • I2Cx_Error() : stm32h747i_discovery.c
  • I2Cx_Init() : stm32h747i_discovery.c
  • I2Cx_IsDeviceReady() : stm32h747i_discovery.c
  • I2Cx_MspInit() : stm32h747i_discovery.c
  • I2Cx_Read() : stm32h747i_discovery.c
  • I2Cx_ReadMultiple() : stm32h747i_discovery.c
  • I2Cx_Write() : stm32h747i_discovery.c
  • I2Cx_WriteMultiple() : stm32h747i_discovery.c
  • INPUT_DEVICE_ANALOG_MIC : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC1 : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC2 : stm32h747i_discovery_audio.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- j -

  • JOY_ALL_PINS : stm32h747i_discovery.h
  • JOY_DOWN : stm32h747i_discovery.h
  • JOY_IRQn : stm32h747i_discovery.c
  • JOY_LEFT : stm32h747i_discovery.h
  • JOY_MODE_EXTI : stm32h747i_discovery.h
  • JOY_MODE_GPIO : stm32h747i_discovery.h
  • JOY_NONE : stm32h747i_discovery.h
  • JOY_PIN : stm32h747i_discovery.c
  • JOY_PORT : stm32h747i_discovery.c
  • JOY_RIGHT : stm32h747i_discovery.h
  • JOY_SEL : stm32h747i_discovery.h
  • JOY_UP : stm32h747i_discovery.h
  • JOYMode_TypeDef : stm32h747i_discovery.h
  • JOYn : stm32h747i_discovery.h
  • JOYState_TypeDef : stm32h747i_discovery.h
  • JOYx_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • JOYx_GPIO_CLK_ENABLE : stm32h747i_discovery.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- l -

  • LCD_COLOR_BLACK : stm32h747i_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32h747i_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32h747i_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_RED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32h747i_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32h747i_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32h747i_discovery_lcd.h
  • LCD_DSI_ADDRESS : stm32h747i_discovery_lcd.c
  • LCD_DSI_ID : stm32h747i_discovery_lcd.c
  • LCD_DSI_ID_REG : stm32h747i_discovery_lcd.c
  • LCD_DSI_PIXEL_DATA_FMT_RBG565 : stm32h747i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG888 : stm32h747i_discovery_lcd.h
  • LCD_ERROR : stm32h747i_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32h747i_discovery_lcd.h
  • LCD_IO_GetID() : stm32h747i_discovery_lcd.c
  • LCD_LayerCfgTypeDef : stm32h747i_discovery_lcd.h
  • LCD_OK : stm32h747i_discovery_lcd.h
  • LCD_ORIENTATION_INVALID : stm32h747i_discovery_lcd.h
  • LCD_ORIENTATION_LANDSCAPE : stm32h747i_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32h747i_discovery_lcd.h
  • LCD_OrientationTypeDef : stm32h747i_discovery_lcd.h
  • LCD_OTM8009A_ID : stm32h747i_discovery_lcd.h
  • LCD_TIMEOUT : stm32h747i_discovery_lcd.h
  • lcd_x_size : stm32h747i_discovery_lcd.c
  • lcd_y_size : stm32h747i_discovery_lcd.c
  • LED1 : stm32h747i_discovery.h
  • LED1_GPIO_PORT : stm32h747i_discovery.h
  • LED1_PIN : stm32h747i_discovery.h
  • LED2 : stm32h747i_discovery.h
  • LED2_GPIO_PORT : stm32h747i_discovery.h
  • LED2_PIN : stm32h747i_discovery.h
  • LED3 : stm32h747i_discovery.h
  • LED3_GPIO_PORT : stm32h747i_discovery.h
  • LED3_PIN : stm32h747i_discovery.h
  • LED4 : stm32h747i_discovery.h
  • LED4_GPIO_PORT : stm32h747i_discovery.h
  • LED4_PIN : stm32h747i_discovery.h
  • LED_BLUE : stm32h747i_discovery.h
  • LED_GREEN : stm32h747i_discovery.h
  • LED_ORANGE : stm32h747i_discovery.h
  • LED_RED : stm32h747i_discovery.h
  • Led_TypeDef : stm32h747i_discovery.h
  • LEDn : stm32h747i_discovery.h
  • LEDx_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • LEDx_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • LEFT_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_PORT : stm32h747i_discovery.h
  • LEFT_JOY_PIN : stm32h747i_discovery.h
  • LEFT_MODE : stm32h747i_discovery_lcd.h
  • LL_ConvertLineToARGB8888() : stm32h747i_discovery_lcd.c
  • LL_FillBuffer() : stm32h747i_discovery_lcd.c
  • LTDC_ACTIVE_LAYER_BACKGROUND : stm32h747i_discovery_lcd.h
  • LTDC_ACTIVE_LAYER_FOREGROUND : stm32h747i_discovery_lcd.h
  • LTDC_DEFAULT_ACTIVE_LAYER : stm32h747i_discovery_lcd.h
  • LTDC_MAX_LAYER_NUMBER : stm32h747i_discovery_lcd.h
  • LTDC_NB_OF_LAYERS : stm32h747i_discovery_lcd.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- m -

  • MSD_ERROR : stm32h747i_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32h747i_discovery_sd.h
  • MSD_OK : stm32h747i_discovery_sd.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- o -

  • OTG_HS_OVER_CURRENT_PIN : stm32h747i_discovery.h
  • OTG_HS_OVER_CURRENT_PORT : stm32h747i_discovery.h
  • OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE : stm32h747i_discovery.h
  • OTM8009A_IO_Delay() : stm32h747i_discovery.c
  • OUTPUT_DEVICE_HEADPHONE1 : stm32h747i_discovery_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32h747i_discovery_audio.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- p -

  • PB_RESET : stm32h747i_discovery.h
  • PB_SET : stm32h747i_discovery.h
  • PDM_FilterConfig : stm32h747i_discovery_audio.c
  • PDM_FilterHandler : stm32h747i_discovery_audio.c
  • POLY_X : stm32h747i_discovery_lcd.c
  • POLY_Y : stm32h747i_discovery_lcd.c
  • POS_VAL : stm32h747i_discovery_audio.h
  • pPoint : stm32h747i_discovery_lcd.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- q -

  • QSPI_AutoPollingMemReady() : stm32h747i_discovery_qspi.c
  • QSPI_BASE_ADDRESS : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BUSY : stm32h747i_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_CLK_PIN : stm32h747i_discovery_qspi.h
  • QSPI_DummyCyclesCfg() : stm32h747i_discovery_qspi.c
  • QSPI_EnterFourBytesAddress() : stm32h747i_discovery_qspi.c
  • QSPI_EnterQPI() : stm32h747i_discovery_qspi.c
  • QSPI_ERROR : stm32h747i_discovery_qspi.h
  • QSPI_FLASH_SIZE : stm32h747i_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32h747i_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32h747i_discovery_qspi.h
  • QSPI_OK : stm32h747i_discovery_qspi.h
  • QSPI_PAGE_SIZE : stm32h747i_discovery_qspi.h
  • QSPI_PROTECTED : stm32h747i_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32h747i_discovery_qspi.h
  • QSPI_ResetMemory() : stm32h747i_discovery_qspi.c
  • QSPI_SUSPENDED : stm32h747i_discovery_qspi.h
  • QSPI_WriteEnable() : stm32h747i_discovery_qspi.c
  • QSPIHandle : stm32h747i_discovery_qspi.c


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- r -

  • REFRESH_COUNT : stm32h747i_discovery_sdram.h
  • RESOLUTION_R160x120 : stm32h747i_discovery_camera.h
  • RESOLUTION_R320x240 : stm32h747i_discovery_camera.h
  • RESOLUTION_R480x272 : stm32h747i_discovery_camera.h
  • RESOLUTION_R640x480 : stm32h747i_discovery_camera.h
  • RIGHT_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_PORT : stm32h747i_discovery.h
  • RIGHT_JOY_PIN : stm32h747i_discovery.h
  • RIGHT_MODE : stm32h747i_discovery_lcd.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- s -

  • SAIx_In_DeInit() : stm32h747i_discovery_audio.c
  • SAIx_In_Init() : stm32h747i_discovery_audio.c
  • SAIx_In_MspDeInit() : stm32h747i_discovery_audio.c
  • SAIx_In_MspInit() : stm32h747i_discovery_audio.c
  • SAIx_Out_DeInit() : stm32h747i_discovery_audio.c
  • SAIx_Out_Init() : stm32h747i_discovery_audio.c
  • SD_DATATIMEOUT : stm32h747i_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32h747i_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • SD_DETECT_GPIO_PORT : stm32h747i_discovery.h
  • SD_DETECT_PIN : stm32h747i_discovery.h
  • SD_NOT_PRESENT : stm32h747i_discovery_sd.h
  • SD_PRESENT : stm32h747i_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32h747i_discovery_sd.h
  • SD_TRANSFER_OK : stm32h747i_discovery_sd.h
  • SDCLOCK_PERIOD : stm32h747i_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32h747i_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32h747i_discovery_sdram.h
  • SDRAM_ERROR : stm32h747i_discovery_sdram.h
  • SDRAM_MDMAx_CHANNEL : stm32h747i_discovery_sdram.h
  • SDRAM_MDMAx_IRQn : stm32h747i_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32h747i_discovery_sdram.h
  • SDRAM_OK : stm32h747i_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32h747i_discovery_sdram.h
  • sdramHandle : stm32h747i_discovery_sdram.c
  • SEL_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • SEL_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • SEL_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • SEL_JOY_GPIO_PORT : stm32h747i_discovery.h
  • SEL_JOY_PIN : stm32h747i_discovery.h


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- t -

  • Text_AlignModeTypdef : stm32h747i_discovery_lcd.h
  • Timing : stm32h747i_discovery_sdram.c
  • TOUCH_EVENT_CONTACT : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32h747i_discovery_ts.h
  • TS3510_I2C_ADDRESS : stm32h747i_discovery.h
  • TS_DEVICE_NOT_FOUND : stm32h747i_discovery_ts.h
  • ts_driver : stm32h747i_discovery_ts.c
  • TS_ERROR : stm32h747i_discovery_ts.h
  • ts_event_string_tab : stm32h747i_discovery_ts.c , stm32h747i_discovery_ts.h
  • ts_gesture_id_string_tab : stm32h747i_discovery_ts.c , stm32h747i_discovery_ts.h
  • TS_GestureIdTypeDef : stm32h747i_discovery_ts.h
  • TS_I2C_ADDRESS : stm32h747i_discovery.h
  • TS_INT_EXTI_IRQn : stm32h747i_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • TS_INT_GPIO_PORT : stm32h747i_discovery.h
  • TS_INT_PIN : stm32h747i_discovery.h
  • TS_IO_Delay() : stm32h747i_discovery.c
  • TS_IO_Init() : stm32h747i_discovery.c
  • TS_IO_Read() : stm32h747i_discovery.c
  • TS_IO_ReadMultiple() : stm32h747i_discovery.c
  • TS_IO_Write() : stm32h747i_discovery.c
  • TS_IO_WriteMultiple() : stm32h747i_discovery.c
  • TS_IRQ_PENDING : stm32h747i_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32h747i_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32h747i_discovery_ts.h
  • TS_OK : stm32h747i_discovery_ts.h
  • ts_orientation : stm32h747i_discovery_ts.c
  • TS_StatusTypeDef : stm32h747i_discovery_ts.h
  • TS_SWAP_NONE : stm32h747i_discovery_ts.h
  • TS_SWAP_X : stm32h747i_discovery_ts.h
  • TS_SWAP_XY : stm32h747i_discovery_ts.h
  • TS_SWAP_Y : stm32h747i_discovery_ts.h
  • TS_TIMEOUT : stm32h747i_discovery_ts.h
  • TS_TouchEventTypeDef : stm32h747i_discovery_ts.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- u -

  • UP_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • UP_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • UP_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • UP_JOY_GPIO_PORT : stm32h747i_discovery.h
  • UP_JOY_PIN : stm32h747i_discovery.h
  • uSdHandle : stm32h747i_discovery_sd.c
  • USER_BUTTON_EXTI_IRQn : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_PORT : stm32h747i_discovery.h
  • USER_BUTTON_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- w -

  • WAKEUP_BUTTON_EXTI_IRQn : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32h747i_discovery.h
  • WAKEUP_BUTTON_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- a -

  • AUDIO_IO_DeInit() : stm32h747i_discovery.c
  • AUDIO_IO_Delay() : stm32h747i_discovery.c
  • AUDIO_IO_Init() : stm32h747i_discovery.c
  • AUDIO_IO_Read() : stm32h747i_discovery.c
  • AUDIO_IO_Write() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- b -

  • BSP_AUDIO_IN_AllocScratch() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_ClockConfig() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ConfigDigitalMic() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ConfigMicDefault() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Error_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Error_Callback() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_GetChannelNumber() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_GetInterface() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBackEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_InitEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_MspDeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_MspInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_OUT_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Pause() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_PauseEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_PDMToPCM() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_PDMToPCM_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Record() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_RecordEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_ResumeEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_SelectInterface() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_SetFrequency() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_StopEx() : stm32h747i_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_IN_TransferComplete_CallBackEx() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_ClockConfig() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_MspDeInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_MspInit() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32h747i_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32h747i_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_ErrorCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_GetRotation() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Init() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_LineEventCallback() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_SetRotation() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32h747i_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32h747i_discovery_camera.c
  • BSP_GetVersion() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_DeInit() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_GetState() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_JOY_Init() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LCD_Clear() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32h747i_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillCircle() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32h747i_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_Init() : stm32h747i_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32h747i_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32h747i_discovery_lcd.c
  • BSP_LCD_Reset() : stm32h747i_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetBrightness() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32h747i_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32h747i_discovery_lcd.c
  • BSP_LED_DeInit() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_Init() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_LED_Off() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_On() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_LED_Toggle() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_PB_DeInit() : stm32h747i_discovery.c , stm32h747i_discovery.h
  • BSP_PB_GetState() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_PB_Init() : stm32h747i_discovery.h , stm32h747i_discovery.c
  • BSP_QSPI_DeInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Init() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_MspDeInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_MspInit() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Read() : stm32h747i_discovery_qspi.c
  • BSP_QSPI_Write() : stm32h747i_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32h747i_discovery_sd.c
  • BSP_SD_DeInit() : stm32h747i_discovery_sd.c
  • BSP_SD_Erase() : stm32h747i_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32h747i_discovery_sd.c
  • BSP_SD_GetCardState() : stm32h747i_discovery_sd.c
  • BSP_SD_Init() : stm32h747i_discovery_sd.c
  • BSP_SD_IRQHandler() : stm32h747i_discovery_sd.c
  • BSP_SD_IsDetected() : stm32h747i_discovery_sd.c
  • BSP_SD_ITConfig() : stm32h747i_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32h747i_discovery_sd.c
  • BSP_SD_MspInit() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32h747i_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32h747i_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32h747i_discovery_sd.c
  • BSP_SDRAM_DeInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Init() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32h747i_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32h747i_discovery_sdram.c
  • BSP_TS_GetState() : stm32h747i_discovery_ts.c
  • BSP_TS_Init() : stm32h747i_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32h747i_discovery_ts.c
  • BSP_TS_ITConfig() : stm32h747i_discovery_ts.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- c -

  • CAMERA_Delay() : stm32h747i_discovery.c
  • CAMERA_IO_Init() : stm32h747i_discovery.c
  • CAMERA_IO_Read() : stm32h747i_discovery.c
  • CAMERA_IO_Write() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- d -

  • DrawChar() : stm32h747i_discovery_lcd.c
  • DSI_IO_WriteCmd() : stm32h747i_discovery_lcd.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- e -

  • EEPROM_IO_Init() : stm32h747i_discovery.c
  • EEPROM_IO_IsDeviceReady() : stm32h747i_discovery.c
  • EEPROM_IO_ReadData() : stm32h747i_discovery.c
  • EEPROM_IO_WriteData() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- f -

  • FillTriangle() : stm32h747i_discovery_lcd.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- g -

  • GetSize() : stm32h747i_discovery_camera.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- h -

  • HAL_DCMI_ErrorCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32h747i_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32h747i_discovery_camera.c
  • HAL_SAI_ErrorCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32h747i_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32h747i_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32h747i_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32h747i_discovery_sd.c
  • HDMI_IO_Delay() : stm32h747i_discovery.c
  • HDMI_IO_Init() : stm32h747i_discovery.c
  • HDMI_IO_Read() : stm32h747i_discovery.c
  • HDMI_IO_Write() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- i -

  • I2Cx_Error() : stm32h747i_discovery.c
  • I2Cx_Init() : stm32h747i_discovery.c
  • I2Cx_IsDeviceReady() : stm32h747i_discovery.c
  • I2Cx_MspInit() : stm32h747i_discovery.c
  • I2Cx_Read() : stm32h747i_discovery.c
  • I2Cx_ReadMultiple() : stm32h747i_discovery.c
  • I2Cx_Write() : stm32h747i_discovery.c
  • I2Cx_WriteMultiple() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- l -

  • LCD_IO_GetID() : stm32h747i_discovery_lcd.c
  • LL_ConvertLineToARGB8888() : stm32h747i_discovery_lcd.c
  • LL_FillBuffer() : stm32h747i_discovery_lcd.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- o -

  • OTM8009A_IO_Delay() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- q -

  • QSPI_AutoPollingMemReady() : stm32h747i_discovery_qspi.c
  • QSPI_DummyCyclesCfg() : stm32h747i_discovery_qspi.c
  • QSPI_EnterFourBytesAddress() : stm32h747i_discovery_qspi.c
  • QSPI_EnterQPI() : stm32h747i_discovery_qspi.c
  • QSPI_ResetMemory() : stm32h747i_discovery_qspi.c
  • QSPI_WriteEnable() : stm32h747i_discovery_qspi.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- s -

  • SAIx_In_DeInit() : stm32h747i_discovery_audio.c
  • SAIx_In_Init() : stm32h747i_discovery_audio.c
  • SAIx_In_MspDeInit() : stm32h747i_discovery_audio.c
  • SAIx_In_MspInit() : stm32h747i_discovery_audio.c
  • SAIx_Out_DeInit() : stm32h747i_discovery_audio.c
  • SAIx_Out_Init() : stm32h747i_discovery_audio.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • o
  • q
  • s
  • t

- t -

  • TS_IO_Delay() : stm32h747i_discovery.c
  • TS_IO_Init() : stm32h747i_discovery.c
  • TS_IO_Read() : stm32h747i_discovery.c
  • TS_IO_ReadMultiple() : stm32h747i_discovery.c
  • TS_IO_Write() : stm32h747i_discovery.c
  • TS_IO_WriteMultiple() : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • g
  • h
  • i
  • j
  • l
  • p
  • q
  • s
  • t
  • u

- a -

  • ActiveLayer : stm32h747i_discovery_lcd.c
  • audio_drv : stm32h747i_discovery_audio.c
  • AudioInVolume : stm32h747i_discovery_audio.c

- b -

  • BUTTON_IRQn : stm32h747i_discovery.c
  • BUTTON_PIN : stm32h747i_discovery.c
  • BUTTON_PORT : stm32h747i_discovery.c

- c -

  • camera_drv : stm32h747i_discovery_camera.c
  • CameraCurrentResolution : stm32h747i_discovery_camera.c
  • CameraHwAddress : stm32h747i_discovery_camera.c
  • CameraRotation : stm32h747i_discovery_camera.c
  • Command : stm32h747i_discovery_sdram.c

- d -

  • DrawProp : stm32h747i_discovery_lcd.c

- g -

  • GPIO_PIN : stm32h747i_discovery.c
  • GPIO_PORT : stm32h747i_discovery.c

- h -

  • haudio_in_sai : stm32h747i_discovery_audio.c
  • haudio_out_sai : stm32h747i_discovery_audio.c
  • hAudioIn : stm32h747i_discovery_audio.c
  • hdcmi_discovery : stm32h747i_discovery_camera.c
  • hdma2d_discovery : stm32h747i_discovery_lcd.c , stm32h747i_discovery_lcd.h
  • hdsi_discovery : stm32h747i_discovery_lcd.c
  • hdsivideo_handle : stm32h747i_discovery_lcd.c
  • heval_I2c : stm32h747i_discovery.c
  • hltdc_discovery : stm32h747i_discovery_lcd.c

- i -

  • I2C_Address : stm32h747i_discovery_ts.c

- j -

  • JOY_IRQn : stm32h747i_discovery.c
  • JOY_PIN : stm32h747i_discovery.c
  • JOY_PORT : stm32h747i_discovery.c

- l -

  • lcd_x_size : stm32h747i_discovery_lcd.c
  • lcd_y_size : stm32h747i_discovery_lcd.c

- p -

  • PDM_FilterConfig : stm32h747i_discovery_audio.c
  • PDM_FilterHandler : stm32h747i_discovery_audio.c

- q -

  • QSPIHandle : stm32h747i_discovery_qspi.c

- s -

  • sdramHandle : stm32h747i_discovery_sdram.c

- t -

  • Timing : stm32h747i_discovery_sdram.c
  • ts_driver : stm32h747i_discovery_ts.c
  • ts_event_string_tab : stm32h747i_discovery_ts.h , stm32h747i_discovery_ts.c
  • ts_gesture_id_string_tab : stm32h747i_discovery_ts.h , stm32h747i_discovery_ts.c
  • ts_orientation : stm32h747i_discovery_ts.c

- u -

  • uSdHandle : stm32h747i_discovery_sd.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • pPoint : stm32h747i_discovery_lcd.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Button_TypeDef : stm32h747i_discovery.h
  • ButtonMode_TypeDef : stm32h747i_discovery.h
  • ButtonValue_TypeDef : stm32h747i_discovery.h
  • DISCO_Status_TypeDef : stm32h747i_discovery.h
  • JOYMode_TypeDef : stm32h747i_discovery.h
  • JOYState_TypeDef : stm32h747i_discovery.h
  • LCD_OrientationTypeDef : stm32h747i_discovery_lcd.h
  • Led_TypeDef : stm32h747i_discovery.h
  • Text_AlignModeTypdef : stm32h747i_discovery_lcd.h
  • TS_GestureIdTypeDef : stm32h747i_discovery_ts.h
  • TS_StatusTypeDef : stm32h747i_discovery_ts.h
  • TS_TouchEventTypeDef : stm32h747i_discovery_ts.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • c
  • d
  • g
  • j
  • l
  • p
  • r
  • t

- b -

  • BUTTON_MODE_EXTI : stm32h747i_discovery.h
  • BUTTON_MODE_GPIO : stm32h747i_discovery.h
  • BUTTON_WAKEUP : stm32h747i_discovery.h

- c -

  • CENTER_MODE : stm32h747i_discovery_lcd.h

- d -

  • DISCO_ERROR : stm32h747i_discovery.h
  • DISCO_OK : stm32h747i_discovery.h

- g -

  • GEST_ID_MOVE_DOWN : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_LEFT : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_RIGHT : stm32h747i_discovery_ts.h
  • GEST_ID_MOVE_UP : stm32h747i_discovery_ts.h
  • GEST_ID_NB_MAX : stm32h747i_discovery_ts.h
  • GEST_ID_NO_GESTURE : stm32h747i_discovery_ts.h
  • GEST_ID_ZOOM_IN : stm32h747i_discovery_ts.h
  • GEST_ID_ZOOM_OUT : stm32h747i_discovery_ts.h

- j -

  • JOY_DOWN : stm32h747i_discovery.h
  • JOY_LEFT : stm32h747i_discovery.h
  • JOY_MODE_EXTI : stm32h747i_discovery.h
  • JOY_MODE_GPIO : stm32h747i_discovery.h
  • JOY_NONE : stm32h747i_discovery.h
  • JOY_RIGHT : stm32h747i_discovery.h
  • JOY_SEL : stm32h747i_discovery.h
  • JOY_UP : stm32h747i_discovery.h

- l -

  • LCD_ORIENTATION_INVALID : stm32h747i_discovery_lcd.h
  • LCD_ORIENTATION_LANDSCAPE : stm32h747i_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32h747i_discovery_lcd.h
  • LED1 : stm32h747i_discovery.h
  • LED2 : stm32h747i_discovery.h
  • LED3 : stm32h747i_discovery.h
  • LED4 : stm32h747i_discovery.h
  • LED_BLUE : stm32h747i_discovery.h
  • LED_GREEN : stm32h747i_discovery.h
  • LED_ORANGE : stm32h747i_discovery.h
  • LED_RED : stm32h747i_discovery.h
  • LEFT_MODE : stm32h747i_discovery_lcd.h

- p -

  • PB_RESET : stm32h747i_discovery.h
  • PB_SET : stm32h747i_discovery.h

- r -

  • RIGHT_MODE : stm32h747i_discovery_lcd.h

- t -

  • TOUCH_EVENT_CONTACT : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32h747i_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32h747i_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32h747i_discovery_ts.h
  • TS_ERROR : stm32h747i_discovery_ts.h
  • TS_OK : stm32h747i_discovery_ts.h
  • TS_TIMEOUT : stm32h747i_discovery_ts.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- _ -

  • __MDMAx_CLK_DISABLE : stm32h747i_discovery_sdram.h
  • __MDMAx_CLK_ENABLE : stm32h747i_discovery_sdram.h
  • __STM32H747I_DISCOVERY_BSP_VERSION : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_MAIN : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_RC : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_SUB1 : stm32h747i_discovery.c
  • __STM32H747I_DISCOVERY_BSP_VERSION_SUB2 : stm32h747i_discovery.c
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- a -

  • ABS : stm32h747i_discovery_lcd.c
  • AUDIO_ERROR : stm32h747i_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32h747i_discovery.h
  • AUDIO_IN_INT_GPIO_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_INT_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_INTERFACE_PDM : stm32h747i_discovery_audio.h
  • AUDIO_IN_INTERFACE_SAI : stm32h747i_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_CLK_IN_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_CLK_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DATA_IN_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAI_PDMx_SCK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_AF : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OK : stm32h747i_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_AF : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_REQUEST : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT : stm32h747i_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32h747i_discovery_audio.h
  • AUDIO_TIMEOUT : stm32h747i_discovery_audio.h
  • AUDIODATA_SIZE : stm32h747i_discovery_audio.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- b -

  • BSP_AUDIO_FREQUENCY_11K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_16K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_22K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_32K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_44K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_48K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_8K : stm32h747i_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_96K : stm32h747i_discovery_audio.h
  • BSP_CAMERA_DMA_IRQHandler : stm32h747i_discovery_camera.h
  • BSP_CAMERA_IRQHandler : stm32h747i_discovery_camera.h
  • BSP_LCD_DMA2D_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_DSI_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_LTDC_ER_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_LCD_LTDC_IRQHandler : stm32h747i_discovery_lcd.h
  • BSP_SD_CardInfo : stm32h747i_discovery_sd.h
  • BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • BUTTON_USER : stm32h747i_discovery.h
  • BUTTONn : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- c -

  • CAMERA_480x272_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_480x272_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_CLK_ENABLE : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_IRQ : stm32h747i_discovery_camera.h
  • CAMERA_DCMI_DMAx_STREAM : stm32h747i_discovery_camera.h
  • CAMERA_ERROR : stm32h747i_discovery_camera.h
  • CAMERA_FB_START_ADDRESS : stm32h747i_discovery_camera.h
  • CAMERA_I2C_ADDRESS : stm32h747i_discovery.h
  • CAMERA_NO_ROTATION : stm32h747i_discovery_camera.h
  • CAMERA_NOT_DETECTED : stm32h747i_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32h747i_discovery_camera.h
  • CAMERA_OK : stm32h747i_discovery_camera.h
  • CAMERA_QQVGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_QQVGA_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_QVGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_QVGA_RES_Y : stm32h747i_discovery_camera.h
  • CAMERA_ROTATION_90 : stm32h747i_discovery_camera.h
  • CAMERA_ROTATION_INVALID : stm32h747i_discovery_camera.h
  • CAMERA_TIMEOUT : stm32h747i_discovery_camera.h
  • CAMERA_VGA_RES_X : stm32h747i_discovery_camera.h
  • CAMERA_VGA_RES_Y : stm32h747i_discovery_camera.h
  • CODEC_AUDIOFRAME_SLOT_0 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32h747i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32h747i_discovery_audio.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32h747i_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32h747i_discovery_audio.h
  • DISCOVERY_I2Cx : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_CLK_ENABLE : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_ER_IRQn : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_EV_IRQn : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_FORCE_RESET : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_RELEASE_RESET : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_PIN : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_AF : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT : stm32h747i_discovery.h
  • DISCOVERY_I2Cx_SDA_PIN : stm32h747i_discovery.h
  • DMA_MAX : stm32h747i_discovery_audio.h
  • DMA_MAX_SIZE : stm32h747i_discovery_audio.h
  • DOWN_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • DOWN_JOY_GPIO_PORT : stm32h747i_discovery.h
  • DOWN_JOY_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- i -

  • INPUT_DEVICE_ANALOG_MIC : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC1 : stm32h747i_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC2 : stm32h747i_discovery_audio.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- j -

  • JOY_ALL_PINS : stm32h747i_discovery.h
  • JOYn : stm32h747i_discovery.h
  • JOYx_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • JOYx_GPIO_CLK_ENABLE : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- l -

  • LCD_COLOR_BLACK : stm32h747i_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32h747i_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32h747i_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32h747i_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_RED : stm32h747i_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32h747i_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32h747i_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32h747i_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32h747i_discovery_lcd.h
  • LCD_DSI_ADDRESS : stm32h747i_discovery_lcd.c
  • LCD_DSI_ID : stm32h747i_discovery_lcd.c
  • LCD_DSI_ID_REG : stm32h747i_discovery_lcd.c
  • LCD_DSI_PIXEL_DATA_FMT_RBG565 : stm32h747i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG888 : stm32h747i_discovery_lcd.h
  • LCD_ERROR : stm32h747i_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32h747i_discovery_lcd.h
  • LCD_LayerCfgTypeDef : stm32h747i_discovery_lcd.h
  • LCD_OK : stm32h747i_discovery_lcd.h
  • LCD_OTM8009A_ID : stm32h747i_discovery_lcd.h
  • LCD_TIMEOUT : stm32h747i_discovery_lcd.h
  • LED1_GPIO_PORT : stm32h747i_discovery.h
  • LED1_PIN : stm32h747i_discovery.h
  • LED2_GPIO_PORT : stm32h747i_discovery.h
  • LED2_PIN : stm32h747i_discovery.h
  • LED3_GPIO_PORT : stm32h747i_discovery.h
  • LED3_PIN : stm32h747i_discovery.h
  • LED4_GPIO_PORT : stm32h747i_discovery.h
  • LED4_PIN : stm32h747i_discovery.h
  • LEDn : stm32h747i_discovery.h
  • LEDx_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • LEDx_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • LEFT_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • LEFT_JOY_GPIO_PORT : stm32h747i_discovery.h
  • LEFT_JOY_PIN : stm32h747i_discovery.h
  • LTDC_ACTIVE_LAYER_BACKGROUND : stm32h747i_discovery_lcd.h
  • LTDC_ACTIVE_LAYER_FOREGROUND : stm32h747i_discovery_lcd.h
  • LTDC_DEFAULT_ACTIVE_LAYER : stm32h747i_discovery_lcd.h
  • LTDC_MAX_LAYER_NUMBER : stm32h747i_discovery_lcd.h
  • LTDC_NB_OF_LAYERS : stm32h747i_discovery_lcd.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- m -

  • MSD_ERROR : stm32h747i_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32h747i_discovery_sd.h
  • MSD_OK : stm32h747i_discovery_sd.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- o -

  • OTG_HS_OVER_CURRENT_PIN : stm32h747i_discovery.h
  • OTG_HS_OVER_CURRENT_PORT : stm32h747i_discovery.h
  • OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE : stm32h747i_discovery.h
  • OUTPUT_DEVICE_HEADPHONE1 : stm32h747i_discovery_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32h747i_discovery_audio.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- p -

  • POLY_X : stm32h747i_discovery_lcd.c
  • POLY_Y : stm32h747i_discovery_lcd.c
  • POS_VAL : stm32h747i_discovery_audio.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- q -

  • QSPI_BASE_ADDRESS : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_CS_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D0_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D1_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D2_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK1_D3_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_CS_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D0_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D1_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D2_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_BK2_D3_PIN : stm32h747i_discovery_qspi.h
  • QSPI_BUSY : stm32h747i_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32h747i_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32h747i_discovery_qspi.h
  • QSPI_CLK_PIN : stm32h747i_discovery_qspi.h
  • QSPI_ERROR : stm32h747i_discovery_qspi.h
  • QSPI_FLASH_SIZE : stm32h747i_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32h747i_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32h747i_discovery_qspi.h
  • QSPI_OK : stm32h747i_discovery_qspi.h
  • QSPI_PAGE_SIZE : stm32h747i_discovery_qspi.h
  • QSPI_PROTECTED : stm32h747i_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32h747i_discovery_qspi.h
  • QSPI_SUSPENDED : stm32h747i_discovery_qspi.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- r -

  • REFRESH_COUNT : stm32h747i_discovery_sdram.h
  • RESOLUTION_R160x120 : stm32h747i_discovery_camera.h
  • RESOLUTION_R320x240 : stm32h747i_discovery_camera.h
  • RESOLUTION_R480x272 : stm32h747i_discovery_camera.h
  • RESOLUTION_R640x480 : stm32h747i_discovery_camera.h
  • RIGHT_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • RIGHT_JOY_GPIO_PORT : stm32h747i_discovery.h
  • RIGHT_JOY_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- s -

  • SD_DATATIMEOUT : stm32h747i_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32h747i_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • SD_DETECT_GPIO_PORT : stm32h747i_discovery.h
  • SD_DETECT_PIN : stm32h747i_discovery.h
  • SD_NOT_PRESENT : stm32h747i_discovery_sd.h
  • SD_PRESENT : stm32h747i_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32h747i_discovery_sd.h
  • SD_TRANSFER_OK : stm32h747i_discovery_sd.h
  • SDCLOCK_PERIOD : stm32h747i_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32h747i_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32h747i_discovery_sdram.h
  • SDRAM_ERROR : stm32h747i_discovery_sdram.h
  • SDRAM_MDMAx_CHANNEL : stm32h747i_discovery_sdram.h
  • SDRAM_MDMAx_IRQn : stm32h747i_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32h747i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32h747i_discovery_sdram.h
  • SDRAM_OK : stm32h747i_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32h747i_discovery_sdram.h
  • SEL_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • SEL_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • SEL_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • SEL_JOY_GPIO_PORT : stm32h747i_discovery.h
  • SEL_JOY_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- t -

  • TS3510_I2C_ADDRESS : stm32h747i_discovery.h
  • TS_I2C_ADDRESS : stm32h747i_discovery.h
  • TS_INT_EXTI_IRQn : stm32h747i_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • TS_INT_GPIO_PORT : stm32h747i_discovery.h
  • TS_INT_PIN : stm32h747i_discovery.h
  • TS_IRQ_PENDING : stm32h747i_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32h747i_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32h747i_discovery_ts.h
  • TS_SWAP_NONE : stm32h747i_discovery_ts.h
  • TS_SWAP_X : stm32h747i_discovery_ts.h
  • TS_SWAP_XY : stm32h747i_discovery_ts.h
  • TS_SWAP_Y : stm32h747i_discovery_ts.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- u -

  • UP_JOY_EXTI_IRQn : stm32h747i_discovery.h
  • UP_JOY_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • UP_JOY_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • UP_JOY_GPIO_PORT : stm32h747i_discovery.h
  • UP_JOY_PIN : stm32h747i_discovery.h
  • USER_BUTTON_EXTI_IRQn : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • USER_BUTTON_GPIO_PORT : stm32h747i_discovery.h
  • USER_BUTTON_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • i
  • j
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- w -

  • WAKEUP_BUTTON_EXTI_IRQn : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32h747i_discovery.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32h747i_discovery.h
  • WAKEUP_BUTTON_PIN : stm32h747i_discovery.h
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Functions | Variables
stm32h747i_discovery.c File Reference

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, available on STM32H747I-Discovery board (MB1248) from STMicroelectronics. More...

#include "stm32h747i_discovery.h"

Go to the source code of this file.

Defines

#define | __STM32H747I_DISCOVERY_BSP_VERSION_MAIN (0x01)
STM32H747I Discovery BSP Driver version number V1.0.0.
#define | __STM32H747I_DISCOVERY_BSP_VERSION_SUB1 (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION_SUB2 (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32H747I_DISCOVERY_BSP_VERSION

Functions

static void | I2Cx_MspInit (void)
Initializes I2C MSP.
static void | I2Cx_Init (void)
Initializes I2C HAL.
static void | I2Cx_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
static uint8_t | I2Cx_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static HAL_StatusTypeDef | I2Cx_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.
void | HDMI_IO_Init (void)
void | HDMI_IO_Delay (uint32_t Delay)
void | HDMI_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
uint8_t | HDMI_IO_Read (uint8_t Addr, uint8_t Reg)
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
De-Initializes Audio low level.
void | AUDIO_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
Writes a single data.
uint16_t | AUDIO_IO_Read (uint8_t Addr, uint16_t Reg)
Reads a single data.
void | AUDIO_IO_Delay (uint32_t Delay)
AUDIO Codec delay.
void | CAMERA_IO_Init (void)
Initializes Camera low level.
void | CAMERA_Delay (uint32_t Delay)
Camera delay.
void | CAMERA_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
Camera writes single data.
uint16_t | CAMERA_IO_Read (uint8_t Addr, uint16_t Reg)
Camera reads single data.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
void | TS_IO_Init (void)
Initialize I2C communication channel from MCU to TouchScreen (TS).
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes single data with I2C communication channel from MCU to TouchScreen.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from TouchScreen.
uint16_t | TS_IO_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Reads multiple data with I2C communication channel from TouchScreen.
void | TS_IO_WriteMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Writes multiple data with I2C communication channel from MCU to TouchScreen.
void | TS_IO_Delay (uint32_t Delay)
Delay function used in TouchScreen low level driver.
void | OTM8009A_IO_Delay (uint32_t Delay)
OTM8009A delay.
uint32_t | BSP_GetVersion (void)
This method returns the STM32H747I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all joystick's buttons in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Un-configures all GPIOs used as joystick's buttons.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.

Variables

GPIO_TypeDef * | GPIO_PORT [LEDn]
const uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }
const uint16_t | BUTTON_PIN [BUTTONn] = {WAKEUP_BUTTON_PIN }
const uint16_t | BUTTON_IRQn [BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }
GPIO_TypeDef * | JOY_PORT [JOYn]
const uint16_t | JOY_PIN [JOYn]
const uint8_t | JOY_IRQn [JOYn]
static I2C_HandleTypeDef | heval_I2c = {0}

Detailed Description

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, available on STM32H747I-Discovery board (MB1248) from STMicroelectronics.

This file includes the driver for Camera modules mounted on STM32H747I-DISCOVERY board.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Enumerations | Functions
stm32h747i_discovery.h File Reference

This file contains definitions for STM32H747I-Discovery LEDs, push-buttons hardware resources. More...

#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define | BUTTON_USER BUTTON_WAKEUP
#define | LEDn ((uint32_t)4)
Define for STM32H747I_DISCOVERY board.
#define | LED1_GPIO_PORT GPIOI
#define | LED1_PIN GPIO_PIN_12
#define | LED2_GPIO_PORT GPIOI
#define | LED2_PIN GPIO_PIN_13
#define | LED3_GPIO_PORT GPIOI
#define | LED3_PIN GPIO_PIN_14
#define | LED4_GPIO_PORT GPIOI
#define | LED4_PIN GPIO_PIN_15
#define | LEDx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LEDx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | BUTTONn ((uint8_t)1)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_13
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOC
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | USER_BUTTON_PIN WAKEUP_BUTTON_PIN
#define | USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
#define | USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
#define | USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
#define | USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
#define | BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | JOYn ((uint8_t)5)
#define | SEL_JOY_PIN GPIO_PIN_2
Joystick Selection push-button.
#define | SEL_JOY_GPIO_PORT GPIOK
#define | SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | SEL_JOY_EXTI_IRQn EXTI2_IRQn
#define | DOWN_JOY_PIN GPIO_PIN_3
Joystick Down push-button.
#define | DOWN_JOY_GPIO_PORT GPIOK
#define | DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | DOWN_JOY_EXTI_IRQn EXTI3_IRQn
#define | LEFT_JOY_PIN GPIO_PIN_4
Joystick Left push-button.
#define | LEFT_JOY_GPIO_PORT GPIOK
#define | LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | LEFT_JOY_EXTI_IRQn EXTI4_IRQn
#define | RIGHT_JOY_PIN GPIO_PIN_5
Joystick Right push-button.
#define | RIGHT_JOY_GPIO_PORT GPIOK
#define | RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | RIGHT_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | UP_JOY_PIN GPIO_PIN_6
Joystick Up push-button.
#define | UP_JOY_GPIO_PORT GPIOK
#define | UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | UP_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | JOYx_GPIO_CLK_ENABLE(__JOY__)
#define | JOYx_GPIO_CLK_DISABLE(__JOY__)
#define | JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
#define | OTG_HS_OVER_CURRENT_PIN GPIO_PIN_1
USB OTG HS Over Current signal.
#define | OTG_HS_OVER_CURRENT_PORT GPIOJ
#define | OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | SD_DETECT_PIN ((uint32_t)GPIO_PIN_8)
SD-detect signal.
#define | SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_INT_PIN ((uint32_t)GPIO_PIN_7)
TS_INT signal from TouchScreen when it is configured in interrupt mode GPIOI13 is used for that purpose on Manta Dragon Discovery board.
#define | TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_I2C_ADDRESS ((uint16_t)0x54)
TouchScreen FT6206 Slave I2C address.
#define | TS3510_I2C_ADDRESS ((uint16_t)0x80)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
Audio I2C Slave address.
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x60)
#define | DISCOVERY_I2Cx I2C4
User can use this section to tailor I2C4/I2C4 instance used and associated resources (audio codec).
#define | DISCOVERY_I2Cx_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
#define | DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | DISCOVERY_I2Cx_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
#define | DISCOVERY_I2Cx_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
#define | DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_12
Definition for I2C4 Pins.
#define | DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_13
#define | DISCOVERY_I2Cx_SCL_SDA_AF GPIO_AF4_I2C4
#define | DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT GPIOD
#define | DISCOVERY_I2Cx_EV_IRQn I2C4_EV_IRQn
Definition of I2C4 interrupt requests.
#define | DISCOVERY_I2Cx_ER_IRQn I2C4_ER_IRQn

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_ORANGE = LED2,
LED3 = 2, LED_RED = LED3, LED4 = 3, LED_BLUE = LED4
}
Led_TypeDef STM32H747I_DISCOVERY board leds definitions. More...
enum | Button_TypeDef { BUTTON_WAKEUP = 0 }
Button_TypeDef STM32H747I_DISCOVERY board Buttons definitions. More...
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
ButtonMode_TypeDef STM32H747I_DISCOVERY board Buttons Modes definitions. More...
enum | ButtonValue_TypeDef { PB_SET = 0, PB_RESET = !PB_SET }
enum | JOYMode_TypeDef { JOY_MODE_GPIO = 0, JOY_MODE_EXTI = 1 }
enum JOYState_TypeDef {
JOY_SEL = 0, JOY_DOWN = 1, JOY_LEFT = 2, JOY_RIGHT = 3,
JOY_UP = 4, JOY_NONE = 5
}
enum | DISCO_Status_TypeDef { DISCO_OK = 0, DISCO_ERROR = 1 }
DISCO_Status_TypeDef STM32H747I_DISCO board Status return possible values. More...

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32H747I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all joystick's buttons in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Un-configures all GPIOs used as joystick's buttons.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.

Detailed Description

This file contains definitions for STM32H747I-Discovery LEDs, push-buttons hardware resources.

This file contains the common defines and functions prototypes for the STM32H747I_DISCOVERY_camera.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_audio.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_audio.c File Reference

This file provides the Audio driver for the STM32H747I-DISCOVERY board. More...

#include "stm32h747i_discovery_audio.h"

Go to the source code of this file.

Functions

static void | SAIx_Out_Init (uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_Out_DeInit (SAI_HandleTypeDef *hsai)
Deinitializes the Audio Codec audio interface (SAI).
static void | SAIx_In_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes SAI Audio IN MSP.
static void | SAIx_In_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
De-Initializes SAI Audio IN MSP.
static void | SAIx_In_Init (uint32_t SaiInMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_In_DeInit (SAI_HandleTypeDef *hsai)
De-initializes the output Audio Codec audio interface (SAI).
uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio Out peripheral.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
uint8_t | BSP_AUDIO_OUT_Pause (void)
This function Pauses the audio file stream.
uint8_t | BSP_AUDIO_OUT_Resume (void)
Resumes the audio file stream.
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option)
Stops audio playing and Power down the Audio Codec.
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
Controls the current audio volume level.
uint8_t | BSP_AUDIO_OUT_SetMute (uint32_t Cmd)
Enables or disables the MUTE mode by software.
uint8_t | BSP_AUDIO_OUT_SetOutputMode (uint8_t Output)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
void | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_SetAudioFrameSlot (uint32_t AudioFrameSlot)
Updates the Audio frame slot configuration.
void | BSP_AUDIO_OUT_DeInit (void)
De-initializes the audio out peripheral.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (void)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (void)
Manages the DMA FIFO error event.
__weak void | BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_OUT MSP.
__weak void | BSP_AUDIO_OUT_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
Deinitializes SAI MSP.
__weak void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.
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.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
__weak uint8_t | BSP_AUDIO_IN_ConfigDigitalMic (uint32_t InputDevice, void *Params)
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
uint8_t | BSP_AUDIO_IN_OUT_Init (uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
void | BSP_AUDIO_IN_SelectInterface (uint32_t Interface)
Link digital mic to specified source.
uint32_t | BSP_AUDIO_IN_GetInterface (void)
Get digital mic interface.
uint8_t | BSP_AUDIO_IN_GetChannelNumber (void)
Return audio in channel number.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pBuf, uint32_t size)
Start audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
Stop audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pause the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resume the audio file stream.
uint8_t | BSP_AUDIO_IN_SetVolume (uint8_t Volume)
Controls the audio in volume level.
void | BSP_AUDIO_IN_DeInit (void)
Deinit the audio IN peripherals.
uint8_t | BSP_AUDIO_IN_PDMToPCM_Init (uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
Initialize the PDM library.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (void)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_Error_CallBack (void)
Audio IN Error callback function.
__weak void | BSP_AUDIO_IN_MspInit (void)
Initialize BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (void)
DeInitialize BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_ClockConfig (uint32_t AudioFreq, void *Params)
Clock Config.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Half reception complete callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Reception complete callback.

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai
SAI_HandleTypeDef | haudio_in_sai
AUDIOIN_ContextTypeDef hAudioIn
__IO uint16_t | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME
PDM_Filter_Handler_t | PDM_FilterHandler [2]
PDM_Filter_Config_t | PDM_FilterConfig [2]

Detailed Description

This file provides the Audio driver for the STM32H747I-DISCOVERY board.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   + This driver supports STM32H7xx devices on STM32H747I-DISCOVERY (MB1248) Discovery boards.
   + Call the function BSP_AUDIO_OUT_Init(
                                    OutputDevice: physical output mode (OUTPUT_DEVICE_SPEAKER,
                                                  OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH)
                                    Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
                                    AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
                                                  this parameter is relative to the audio file/stream type.
                                   )
      This function configures all the hardware required for the audio application (codec, I2C, SAI,
      GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
      If the returned value is different from AUDIO_OK or the function is stuck then the communication with
      the codec has failed (try to un-plug the power or reset device in this case).
      - OUTPUT_DEVICE_SPEAKER  : only speaker will be set as output for the audio stream.
      - OUTPUT_DEVICE_HEADPHONE: only headphones will be set as output for the audio stream.
      - OUTPUT_DEVICE_BOTH     : both Speaker and Headphone are used as outputs for the audio stream
                                 at the same time.
      Note. On STM32H747I-DISCOVERY SAI_DMA is configured in CIRCULAR mode. Due to this the application
        does NOT need to call BSP_AUDIO_OUT_ChangeBuffer() to assure streaming.
   + Call the function BSP_AUDIO_OUT_Play(
                                  pBuffer: pointer to the audio data file address
                                  Size   : size of the buffer to be sent in Bytes
                                 )
      to start playing (for the first time) from the audio file/stream.
   + 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).
   + For each mode, you may need to implement the relative callback functions into your code.
      The Callback functions are named BSP_AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
      the stm32h747i_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
   + To Stop playing, to modify the volume level, the frequency, the audio frame slot,
      the device output mode the mute or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
      AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetOutputMode(),
      BSP_AUDIO_OUT_SetMute() and BSP_AUDIO_OUT_Stop().

   + Call the function BSP_AUDIO_IN_Init(
                                    AudioFreq: Audio frequency in Hz (8000, 16000, 22500, 32000...)
                                                  this parameter is relative to the audio file/stream type.
                                    BitRes: Bit resolution fixed to 16bit
                                    ChnlNbr: Number of channel to be configured for the DFSDM peripheral
                                   )
      This function configures all the hardware required for the audio in application (channels,
      Clock source for SAI PDM periphiral, GPIOs, DMA and interrupt if needed).
      This function returns AUDIO_OK if configuration is OK.If the returned value is different from AUDIO_OK then
      the configuration should be wrong.
   + Call the function BSP_AUDIO_IN_AllocScratch(
                                        pScratch: pointer to scratch tables
                                        size: size of scratch buffer)
     This function must be called before BSP_AUDIO_IN_RECORD() to allocate buffer scratch for each DFSDM channel
     and its size.
     Note: These buffers scratch are used as intermidiate buffers to collect data within final record buffer.
           size is the total size of the four buffers scratch; If size is 512 then the size of each is 128.
           This function must be called after BSP_AUDIO_IN_Init()
   + Call the function BSP_AUDIO_IN_RECORD(
                                  pBuf: pointer to the recorded audio data file address
                                  Size: size of the buffer to be written in Bytes
                                 )
      to start recording from microphones.

   + Call the function BSP_AUDIO_IN_Pause() to pause recording
   + Call the function BSP_AUDIO_IN_Resume() to recording playing.
       Note. After calling BSP_AUDIO_IN_Pause() function for pause, only BSP_AUDIO_IN_Resume() should be called
          for resume (it is not allowed to call BSP_AUDIO_IN_RECORD() in this case).
   + Call the function BSP_AUDIO_IN_Stop() to stop recording
   + For each mode, you may need to implement the relative callback functions into your code.
      The Callback functions are named BSP_AUDIO_IN_XXX_CallBack() and only their prototypes are declared in
      the stm32h747i_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
   + Call the function BSP_AUDIO_IN_SelectInterface(uint32_t Interface) to select one of the two interfaces
     available on the STM32H747I-Discovery board: SAI or PDM. This function is to be called before BSP_AUDIO_IN_InitEx().
   + Call the function BSP_AUDIO_IN_GetInterface() to get the current used interface.
   + Call the function BSP_AUDIO_IN_PDMToPCM_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
     to init PDM filters if the libPDMFilter is used for audio data filtering.
   + Call the function BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf) to filter PDM data to PCM format
     if the libPDMFilter library is used for audio data filtering.

  Driver architecture:
  --------------------
   + This driver provides the High Audio Layer: consists of the function API exported in the stm32h747i_discovery_audio.h file
     (BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play() ...)
   + This driver provide also the Media Access Layer (MAL): which consists of functions allowing to access the media containing/
     providing the audio file/stream. These functions are also included as local functions into
     the stm32h747i_discovery_audio.c file (DFSDMx_Init(), DFSDMx_DeInit(), SAIx_Init() and SAIx_DeInit())

  Known Limitations:
  ------------------
   1- If the TDM Format used to play in parallel 2 audio Stream (the first Stream is configured in codec SLOT0 and second
      Stream in SLOT1) the Pause/Resume, volume and mute feature will control the both streams.
   2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
      File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
   3- Supports only Stereo audio streaming.
   4- Supports only 16-bits audio data size.
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_audio.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_audio.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Data Structures | Defines | Functions
stm32h747i_discovery_audio.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio.c driver. More...

#include "../Components/wm8994/wm8994.h"
#include "stm32h747i_discovery.h"
#include <stdlib.h>
#include "pdm2pcm_glo.h"

Go to the source code of this file.

Data Structures

struct | AUDIOIN_ContextTypeDef

Defines

#define | BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K
#define | BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K
#define | BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K
#define | BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K
#define | BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K
#define | BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K
#define | BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K
#define | BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K
#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
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 | CODEC_AUDIOFRAME_SLOT_0 SAI_SLOTACTIVE_0
#define | AUDIO_OUT_SAIx SAI1_Block_A
#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_AF GPIO_AF6_SAI1
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOG
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT GPIOE
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_4
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream1
#define | AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream1_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_Stream1_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E)
#define | AUDIO_IN_SAIx SAI1_Block_B
#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_3
#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_B
#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_INT_GPIO_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | AUDIO_IN_INT_GPIO_PORT GPIOJ
#define | AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15
#define | AUDIO_IN_INT_IRQ EXTI15_10_IRQn
#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_IN_IRQ_PREPRIO ((uint32_t)0x0F)
#define | AUDIODATA_SIZE ((uint32_t)2) /* 16-bits audio data size */
#define | AUDIO_OK ((uint8_t)0)
#define | AUDIO_ERROR ((uint8_t)1)
#define | AUDIO_TIMEOUT ((uint8_t)2)
#define | DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2)
#define | DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)
#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
#define | INPUT_DEVICE_ANALOG_MIC ((uint32_t)0x00000001)
#define | INPUT_DEVICE_DIGITAL_MIC1 ((uint32_t)0x00000010)
#define | INPUT_DEVICE_DIGITAL_MIC2 ((uint32_t)0x00000020)
#define | INPUT_DEVICE_DIGITAL_MIC ((uint32_t)(INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2))
#define | AUDIO_IN_INTERFACE_SAI ((uint16_t)0)
#define | AUDIO_IN_INTERFACE_PDM ((uint16_t)1)
#define | DMA_MAX_SIZE 0xFFFF
#define | DMA_MAX(x) (((x) <= DMA_MAX_SIZE)? (x):DMA_MAX_SIZE)
#define | POS_VAL(VAL) (POSITION_VAL(VAL) - 4)

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio Out peripheral.
void | BSP_AUDIO_OUT_DeInit (void)
De-initializes the audio out peripheral.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
uint8_t | BSP_AUDIO_OUT_Pause (void)
This function Pauses the audio file stream.
uint8_t | BSP_AUDIO_OUT_Resume (void)
Resumes the audio file stream.
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option)
Stops audio playing and Power down the Audio Codec.
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
Controls the current audio volume level.
void | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_SetAudioFrameSlot (uint32_t AudioFrameSlot)
Updates the Audio frame slot configuration.
uint8_t | BSP_AUDIO_OUT_SetMute (uint32_t Cmd)
Enables or disables the MUTE mode by software.
uint8_t | BSP_AUDIO_OUT_SetOutputMode (uint8_t Output)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (void)
Manages the DMA full Transfer complete event.
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_OUT_Error_CallBack (void)
Manages the DMA FIFO error event.
__weak void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.
__weak void | BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_OUT MSP.
__weak void | BSP_AUDIO_OUT_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
Deinitializes SAI MSP.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_ConfigMicDefault (uint32_t InputDevice)
__weak uint8_t | BSP_AUDIO_IN_ConfigDigitalMic (uint32_t InputDevice, void *Params)
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
uint8_t | BSP_AUDIO_IN_AllocScratch (int32_t *pScratch, uint32_t size)
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pBuf, uint32_t size)
Start audio recording.
uint8_t | BSP_AUDIO_IN_RecordEx (uint32_t *pBuf, uint32_t Size)
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
uint8_t | BSP_AUDIO_IN_Stop (void)
Stop audio recording.
uint8_t | BSP_AUDIO_IN_StopEx (uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_Pause (void)
Pause the audio file stream.
uint8_t | BSP_AUDIO_IN_PauseEx (uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_Resume (void)
Resume the audio file stream.
uint8_t | BSP_AUDIO_IN_ResumeEx (uint32_t *pBuf, uint32_t InputDevice)
uint8_t | BSP_AUDIO_IN_SetVolume (uint8_t Volume)
Controls the audio in volume level.
void | BSP_AUDIO_IN_DeInit (void)
Deinit the audio IN peripherals.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
uint8_t | BSP_AUDIO_IN_PDMToPCM_Init (uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
Initialize the PDM library.
void | BSP_AUDIO_IN_SelectInterface (uint32_t Interface)
Link digital mic to specified source.
uint32_t | BSP_AUDIO_IN_GetInterface (void)
Get digital mic interface.
uint8_t | BSP_AUDIO_IN_OUT_Init (uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
uint8_t | BSP_AUDIO_IN_GetChannelNumber (void)
Return audio in channel number.
void | BSP_AUDIO_IN_Error_Callback (void)
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (void)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
__weak void | BSP_AUDIO_IN_TransferComplete_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBackEx (uint32_t InputDevice)
User callback when record buffer is filled.
__weak void | BSP_AUDIO_IN_Error_CallBack (void)
Audio IN Error callback function.
__weak void | BSP_AUDIO_IN_ClockConfig (uint32_t AudioFreq, void *Params)
Clock Config.
__weak void | BSP_AUDIO_IN_MspInit (void)
Initialize BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (void)
DeInitialize BSP_AUDIO_IN MSP.

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_audio.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_camera.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_camera.c File Reference
#include "stm32h747i_discovery_camera.h"

Go to the source code of this file.

Functions

static uint32_t | GetSize (uint32_t Resolution)
Get the capture size in pixels unit.
uint8_t | BSP_CAMERA_SetRotation (uint32_t rotation)
Set Camera image rotation on LCD Displayed frame buffer.
uint32_t | BSP_CAMERA_GetRotation (void)
Get Camera image rotation on LCD Displayed frame buffer.
uint8_t | BSP_CAMERA_Init (uint32_t Resolution)
Initializes the camera.
uint8_t | BSP_CAMERA_DeInit (void)
DeInitializes the camera.
void | BSP_CAMERA_ContinuousStart (uint8_t *buff)
Starts the camera capture in continuous mode.
void | BSP_CAMERA_SnapshotStart (uint8_t *buff)
Starts the camera capture in snapshot mode.
void | BSP_CAMERA_Suspend (void)
Suspend the CAMERA capture.
void | BSP_CAMERA_Resume (void)
Resume the CAMERA capture.
uint8_t | BSP_CAMERA_Stop (void)
Stop the CAMERA capture.
void | BSP_CAMERA_PwrUp (void)
CANERA power up.
void | BSP_CAMERA_PwrDown (void)
CAMERA power down.
void | BSP_CAMERA_ContrastBrightnessConfig (uint32_t contrast_level, uint32_t brightness_level)
Configures the camera contrast and brightness.
void | BSP_CAMERA_BlackWhiteConfig (uint32_t Mode)
Configures the camera white balance.
void | BSP_CAMERA_ColorEffectConfig (uint32_t Effect)
Configures the camera color effect.
__weak void | BSP_CAMERA_MspInit (DCMI_HandleTypeDef *hdcmi, void *Params)
Initializes the DCMI MSP.
__weak void | BSP_CAMERA_MspDeInit (DCMI_HandleTypeDef *hdcmi, void *Params)
DeInitializes the DCMI MSP.
void | HAL_DCMI_LineEventCallback (DCMI_HandleTypeDef *hdcmi)
Line event callback.
__weak void | BSP_CAMERA_LineEventCallback (void)
Line Event callback.
void | HAL_DCMI_VsyncEventCallback (DCMI_HandleTypeDef *hdcmi)
VSYNC event callback.
__weak void | BSP_CAMERA_VsyncEventCallback (void)
VSYNC Event callback.
void | HAL_DCMI_FrameEventCallback (DCMI_HandleTypeDef *hdcmi)
Frame event callback.
__weak void | BSP_CAMERA_FrameEventCallback (void)
Frame Event callback.
void | HAL_DCMI_ErrorCallback (DCMI_HandleTypeDef *hdcmi)
Error callback.
__weak void | BSP_CAMERA_ErrorCallback (void)
Error callback.

Variables

DCMI_HandleTypeDef | hdcmi_discovery
CAMERA_DrvTypeDef * | camera_drv
static uint32_t | CameraCurrentResolution
uint32_t | CameraRotation = CAMERA_ROTATION_INVALID
static uint32_t | CameraHwAddress


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_camera.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Functions
stm32h747i_discovery_camera.h File Reference
#include "../Components/ov9655/ov9655.h"
#include "stm32h747i_discovery.h"

Go to the source code of this file.

Defines

#define | CAMERA_OK 0x00
Camera State structures definition.
#define | CAMERA_ERROR 0x01
#define | CAMERA_TIMEOUT 0x02
#define | CAMERA_NOT_DETECTED 0x03
#define | CAMERA_NOT_SUPPORTED 0x04
#define | CAMERA_NO_ROTATION 0x00
Camera Image rotation definition in frame buffer for LCD Display.
#define | CAMERA_ROTATION_90 0x01
#define | CAMERA_ROTATION_INVALID 0x02
#define | RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
#define | RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
#define | RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
#define | RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
#define | CAMERA_VGA_RES_X 640
#define | CAMERA_VGA_RES_Y 480
#define | CAMERA_480x272_RES_X 480
#define | CAMERA_480x272_RES_Y 272
#define | CAMERA_QVGA_RES_X 320
#define | CAMERA_QVGA_RES_Y 240
#define | CAMERA_QQVGA_RES_X 160
#define | CAMERA_QQVGA_RES_Y 120
#define | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Stream3_IRQHandler
#define | CAMERA_DCMI_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | CAMERA_DCMI_DMAx_STREAM DMA2_Stream3
#define | CAMERA_DCMI_DMAx_IRQ DMA2_Stream3_IRQn
#define | CAMERA_FB_START_ADDRESS ((uint32_t)0xD0600000)
CAMERA FB_StartAddress.

Functions

uint8_t | BSP_CAMERA_Init (uint32_t Resolution)
Initializes the camera.
uint8_t | BSP_CAMERA_DeInit (void)
DeInitializes the camera.
void | BSP_CAMERA_ContinuousStart (uint8_t *buff)
Starts the camera capture in continuous mode.
void | BSP_CAMERA_SnapshotStart (uint8_t *buff)
Starts the camera capture in snapshot mode.
void | BSP_CAMERA_Suspend (void)
Suspend the CAMERA capture.
void | BSP_CAMERA_Resume (void)
Resume the CAMERA capture.
uint8_t | BSP_CAMERA_Stop (void)
Stop the CAMERA capture.
void | BSP_CAMERA_PwrUp (void)
CANERA power up.
void | BSP_CAMERA_PwrDown (void)
CAMERA power down.
__weak void | BSP_CAMERA_LineEventCallback (void)
Line Event callback.
__weak void | BSP_CAMERA_VsyncEventCallback (void)
VSYNC Event callback.
__weak void | BSP_CAMERA_FrameEventCallback (void)
Frame Event callback.
__weak void | BSP_CAMERA_ErrorCallback (void)
Error callback.
void | BSP_CAMERA_ContrastBrightnessConfig (uint32_t contrast_level, uint32_t brightness_level)
Configures the camera contrast and brightness.
void | BSP_CAMERA_BlackWhiteConfig (uint32_t Mode)
Configures the camera white balance.
void | BSP_CAMERA_ColorEffectConfig (uint32_t Effect)
Configures the camera color effect.
__weak void | BSP_CAMERA_MspInit (DCMI_HandleTypeDef *hdcmi, void *Params)
Initializes the DCMI MSP.
__weak void | BSP_CAMERA_MspDeInit (DCMI_HandleTypeDef *hdcmi, void *Params)
DeInitializes the DCMI MSP.
uint8_t | BSP_CAMERA_SetRotation (uint32_t rotation)
Set Camera image rotation on LCD Displayed frame buffer.
uint32_t | BSP_CAMERA_GetRotation (void)
Get Camera image rotation on LCD Displayed frame buffer.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_lcd.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Functions | Variables
stm32h747i_discovery_lcd.c File Reference

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H747I_DISCOVERY board. More...

#include "stm32h747i_discovery_lcd.h"
#include "../../../Utilities/Fonts/fonts.h"
#include "../../../Utilities/Fonts/font24.c"
#include "../../../Utilities/Fonts/font20.c"
#include "../../../Utilities/Fonts/font16.c"
#include "../../../Utilities/Fonts/font12.c"
#include "../../../Utilities/Fonts/font8.c"

Go to the source code of this file.

Defines

#define | LCD_DSI_ID 0x11
#define | LCD_DSI_ADDRESS TS_I2C_ADDRESS
#define | LCD_DSI_ID_REG 0xA8
#define | ABS(X) ((X) > 0 ? (X) : -(X))
#define | POLY_X(Z) ((int32_t)((Points + (Z))->X))
#define | POLY_Y(Z) ((int32_t)((Points + (Z))->Y))

Functions

static void | DrawChar (uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
Draws a character on LCD.
static void | FillTriangle (uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
Fills a triangle (between 3 points).
static void | LL_FillBuffer (uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
Fills a buffer.
static void | LL_ConvertLineToARGB8888 (void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
Converts a line to an ARGB8888 pixel format.
static uint16_t | LCD_IO_GetID (void)
Returns the ID of connected screen by checking the HDMI (adv7533 component) ID or LCD DSI (via TS ID) ID.
uint8_t | BSP_LCD_Init (void)
Initializes the DSI LCD.
uint8_t | BSP_LCD_InitEx (LCD_OrientationTypeDef orientation)
Initializes the DSI LCD.
void | BSP_LCD_Reset (void)
BSP LCD Reset Hw reset the LCD DSI activating its XRES signal (active low for some time) and deactivating it later.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
void | BSP_LCD_SetXSize (uint32_t imageWidthPixels)
Set the LCD X size.
void | BSP_LCD_SetYSize (uint32_t imageHeightPixels)
Set the LCD Y size.
void | BSP_LCD_LayerDefaultInit (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layers.
void | BSP_LCD_SelectLayer (uint32_t LayerIndex)
Selects the LCD Layer.
void | BSP_LCD_SetLayerVisible (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetLayerWindow (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_SetTextColor (uint32_t Color)
Sets the LCD text color.
uint32_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
void | BSP_LCD_SetBackColor (uint32_t Color)
Sets the LCD background color.
uint32_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetFont (sFONT *fonts)
Sets the LCD text font.
sFONT * | BSP_LCD_GetFont (void)
Gets the LCD text font.
uint32_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_Clear (uint32_t Color)
Clears the whole currently active layer of LTDC.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line in currently active layer.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character in currently active layer.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
Displays characters in currently active layer.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a maximum of 60 characters on the LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line in currently active layer.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line in currently active layer.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points) in currently active layer.
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle in currently active layer.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle in currently active layer.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points) in currently active layer.
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD in currently active layer.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle in currently active layer.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle in currently active layer.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points) in currently active layer.
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse in currently active layer.
void | BSP_LCD_DisplayOn (void)
Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().
void | BSP_LCD_DisplayOff (void)
Switch Off the display.
void | BSP_LCD_SetBrightness (uint8_t BrightnessValue)
Set the brightness value.
void | DSI_IO_WriteCmd (uint32_t NbrParams, uint8_t *pParams)
DCS or Generic short/long write command.
__weak void | BSP_LCD_MspDeInit (void)
De-Initializes the BSP LCD Msp Application can surcharge if needed this function implementation.
__weak void | BSP_LCD_MspInit (void)
Initialize the BSP LCD Msp.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
Draws a pixel on LCD.

Variables

DMA2D_HandleTypeDef | hdma2d_discovery
LTDC_HandleTypeDef | hltdc_discovery
DSI_HandleTypeDef | hdsi_discovery
static DSI_VidCfgTypeDef | hdsivideo_handle
uint32_t | lcd_x_size = OTM8009A_800X480_WIDTH
uint32_t | lcd_y_size = OTM8009A_800X480_HEIGHT
static uint32_t | ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND
Default Active LTDC Layer in which drawing is made is LTDC Layer Background.
static LCD_DrawPropTypeDef | DrawProp [LTDC_MAX_LAYER_NUMBER]
Current Drawing Layer properties variable.

Detailed Description

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H747I_DISCOVERY board.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_lcd.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_lcd.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
stm32h747i_discovery_lcd.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_lcd.c driver. More...

#include "../Components/otm8009a/otm8009a.h"
#include "stm32h747i_discovery_sdram.h"
#include "stm32h747i_discovery.h"
#include "../../../Utilities/Fonts/fonts.h"
#include <string.h>

Go to the source code of this file.

Data Structures

struct | LCD_DrawPropTypeDef
LCD Drawing main properties. More...
struct | Point
LCD Drawing point (pixel) geometric definition. More...

Defines

#define | BSP_LCD_DMA2D_IRQHandler DMA2D_IRQHandler
#define | BSP_LCD_DSI_IRQHandler DSI_IRQHandler
#define | BSP_LCD_LTDC_IRQHandler LTDC_IRQHandler
#define | BSP_LCD_LTDC_ER_IRQHandler LTDC_ER_IRQHandler
#define | LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
#define | LCD_FB_START_ADDRESS ((uint32_t)0xD0000000)
LCD FB_StartAddress.
#define | LTDC_MAX_LAYER_NUMBER ((uint32_t) 2)
Maximum number of LTDC layers.
#define | LTDC_ACTIVE_LAYER_BACKGROUND ((uint32_t) 0)
LTDC Background layer index.
#define | LTDC_ACTIVE_LAYER_FOREGROUND ((uint32_t) 1)
LTDC Foreground layer index.
#define | LTDC_NB_OF_LAYERS ((uint32_t) 2)
Number of LTDC layers.
#define | LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_FOREGROUND
LTDC Default used layer index.
#define | LCD_OK 0x00
LCD status structure definition.
#define | LCD_ERROR 0x01
#define | LCD_TIMEOUT 0x02
#define | LCD_OTM8009A_ID ((uint32_t) 0)
LCD Display OTM8009A ID.
#define | LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF)
LCD color definitions values in ARGB8888 format.
#define | LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00)
Green value in ARGB8888 format.
#define | LCD_COLOR_RED ((uint32_t) 0xFFFF0000)
Red value in ARGB8888 format.
#define | LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF)
Cyan value in ARGB8888 format.
#define | LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF)
Magenta value in ARGB8888 format.
#define | LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00)
Yellow value in ARGB8888 format.
#define | LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF)
Light Blue value in ARGB8888 format.
#define | LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80)
Light Green value in ARGB8888 format.
#define | LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080)
Light Red value in ARGB8888 format.
#define | LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF)
Light Cyan value in ARGB8888 format.
#define | LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF)
Light Magenta value in ARGB8888 format.
#define | LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80)
Light Yellow value in ARGB8888 format.
#define | LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080)
Dark Blue value in ARGB8888 format.
#define | LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000)
Light Dark Green value in ARGB8888 format.
#define | LCD_COLOR_DARKRED ((uint32_t) 0xFF800000)
Light Dark Red value in ARGB8888 format.
#define | LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080)
Dark Cyan value in ARGB8888 format.
#define | LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080)
Dark Magenta value in ARGB8888 format.
#define | LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000)
Dark Yellow value in ARGB8888 format.
#define | LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF)
White value in ARGB8888 format.
#define | LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3)
Light Gray value in ARGB8888 format.
#define | LCD_COLOR_GRAY ((uint32_t) 0xFF808080)
Gray value in ARGB8888 format.
#define | LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040)
Dark Gray value in ARGB8888 format.
#define | LCD_COLOR_BLACK ((uint32_t) 0xFF000000)
Black value in ARGB8888 format.
#define | LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A)
Brown value in ARGB8888 format.
#define | LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500)
Orange value in ARGB8888 format.
#define | LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000)
Transparent value in ARGB8888 format.
#define | LCD_DEFAULT_FONT Font24
LCD default font.
#define | LCD_DSI_PIXEL_DATA_FMT_RBG888 DSI_RGB888
Possible values of pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets.
#define | LCD_DSI_PIXEL_DATA_FMT_RBG565 DSI_RGB565

Typedefs

typedef Point * | pPoint
Pointer on LCD Drawing point (pixel) geometric definition.

Enumerations

enum | Text_AlignModeTypdef { CENTER_MODE = 0x01, RIGHT_MODE = 0x02, LEFT_MODE = 0x03 }
LCD drawing Line alignment mode definitions. More...
enum | LCD_OrientationTypeDef { LCD_ORIENTATION_PORTRAIT = 0x00, LCD_ORIENTATION_LANDSCAPE = 0x01, LCD_ORIENTATION_INVALID = 0x02 }
LCD_OrientationTypeDef Possible values of Display Orientation. More...

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the DSI LCD.
uint8_t | BSP_LCD_InitEx (LCD_OrientationTypeDef orientation)
Initializes the DSI LCD.
__weak void | BSP_LCD_MspDeInit (void)
De-Initializes the BSP LCD Msp Application can surcharge if needed this function implementation.
__weak void | BSP_LCD_MspInit (void)
Initialize the BSP LCD Msp.
void | BSP_LCD_Reset (void)
BSP LCD Reset Hw reset the LCD DSI activating its XRES signal (active low for some time) and deactivating it later.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
void | BSP_LCD_SetXSize (uint32_t imageWidthPixels)
Set the LCD X size.
void | BSP_LCD_SetYSize (uint32_t imageHeightPixels)
Set the LCD Y size.
void | BSP_LCD_LayerDefaultInit (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layers.
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_SetLayerWindow (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
void | BSP_LCD_SelectLayer (uint32_t LayerIndex)
Selects the LCD Layer.
void | BSP_LCD_SetLayerVisible (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
void | BSP_LCD_SetTextColor (uint32_t Color)
Sets the LCD text color.
uint32_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
void | BSP_LCD_SetBackColor (uint32_t Color)
Sets the LCD background color.
uint32_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetFont (sFONT *fonts)
Sets the LCD text font.
sFONT * | BSP_LCD_GetFont (void)
Gets the LCD text font.
uint32_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_Clear (uint32_t Color)
Clears the whole currently active layer of LTDC.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line in currently active layer.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a maximum of 60 characters on the LCD.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
Displays characters in currently active layer.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character in currently active layer.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line in currently active layer.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line in currently active layer.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points) in currently active layer.
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle in currently active layer.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle in currently active layer.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points) in currently active layer.
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD in currently active layer.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle in currently active layer.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle in currently active layer.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points) in currently active layer.
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse in currently active layer.
void | BSP_LCD_DisplayOff (void)
Switch Off the display.
void | BSP_LCD_DisplayOn (void)
Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().
void | BSP_LCD_SetBrightness (uint8_t BrightnessValue)
Set the brightness value.

Variables

DMA2D_HandleTypeDef | hdma2d_discovery

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_lcd.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_lcd.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_qspi.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_qspi.c File Reference

This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-DISCOVERY board. More...

#include "stm32h747i_discovery_qspi.h"

Go to the source code of this file.

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_EnterFourBytesAddress (QSPI_HandleTypeDef *hqspi)
This function set the QSPI memory in 4-byte address mode.
static uint8_t | QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
This function configure the dummy cycles on memory side.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
static uint8_t | QSPI_EnterQPI (QSPI_HandleTypeDef *hqspi)
This function enter the QPSI memory in QPI mode.
uint8_t | BSP_QSPI_Init (void)
Initializes the QSPI interface.
uint8_t | BSP_QSPI_DeInit (void)
De-Initializes the QSPI interface.
uint8_t | BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the QSPI memory.
uint8_t | BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the QSPI memory.
uint8_t | BSP_QSPI_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
__weak void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
__weak void | BSP_QSPI_MspDeInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP De-Initialization This function frees the hardware resources used in this example:

Variables

QSPI_HandleTypeDef | QSPIHandle

Detailed Description

This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-DISCOVERY board.

Author:
MCD Application Team
  ==============================================================================
                     ##### How to use this driver #####
  ==============================================================================
  [..]
   (#) This driver is used to drive the MT25TL01G QSPI external
       memory mounted on STM32H747I-DISCOVERY board.

   (#) This driver need a specific component driver (MT25TL01G) to be included with.

   (#) Initialization steps:
       (++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
            function includes the MSP layer hardware resources initialization and the
            QSPI interface with the external memory.

   (#) QSPI memory operations
       (++) QSPI memory can be accessed with read/write operations once it is
            initialized.
            Read/write operation can be performed with AHB access using the functions
            BSP_QSPI_Read()/BSP_QSPI_Write().
       (++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
            (see the QSPI memory data sheet)
       (++) Perform erase block operation using the function BSP_QSPI_Erase_Block() and by
            specifying the block address. You can perform an erase operation of the whole
            chip by calling the function BSP_QSPI_Erase_Chip().
       (++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
            (see the QSPI memory data sheet)
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_qspi.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_qspi.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Data Structures | Defines | Functions
stm32h747i_discovery_qspi.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_qspi.c driver. More...

#include "stm32h7xx_hal.h"
#include "../Components/mt25tl01g/mt25tl01g.h"

Go to the source code of this file.

Data Structures

struct | QSPI_Info

Defines

#define | QSPI_OK ((uint8_t)0x00)
#define | QSPI_ERROR ((uint8_t)0x01)
#define | QSPI_BUSY ((uint8_t)0x02)
#define | QSPI_NOT_SUPPORTED ((uint8_t)0x04)
#define | QSPI_SUSPENDED ((uint8_t)0x08)
#define | QSPI_PROTECTED ((uint8_t)0x10)
#define | QSPI_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
#define | QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
#define | QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_BK1_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK1_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_BK1_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK1_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK1_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_BK2_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK2_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | QSPI_BK2_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | QSPI_BK2_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_BK2_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | QSPI_FORCE_RESET() __HAL_RCC_QSPI_FORCE_RESET()
#define | QSPI_RELEASE_RESET() __HAL_RCC_QSPI_RELEASE_RESET()
#define | QSPI_CLK_PIN GPIO_PIN_2
#define | QSPI_CLK_GPIO_PORT GPIOB
#define | QSPI_BK1_CS_PIN GPIO_PIN_6
#define | QSPI_BK1_CS_GPIO_PORT GPIOG
#define | QSPI_BK1_D0_PIN GPIO_PIN_11
#define | QSPI_BK1_D0_GPIO_PORT GPIOD
#define | QSPI_BK1_D1_PIN GPIO_PIN_9
#define | QSPI_BK1_D1_GPIO_PORT GPIOF
#define | QSPI_BK1_D2_PIN GPIO_PIN_7
#define | QSPI_BK1_D2_GPIO_PORT GPIOF
#define | QSPI_BK1_D3_PIN GPIO_PIN_6
#define | QSPI_BK1_D3_GPIO_PORT GPIOF
#define | QSPI_BK2_CS_PIN GPIO_PIN_6
#define | QSPI_BK2_CS_GPIO_PORT GPIOG
#define | QSPI_BK2_D0_PIN GPIO_PIN_2
#define | QSPI_BK2_D0_GPIO_PORT GPIOH
#define | QSPI_BK2_D1_PIN GPIO_PIN_3
#define | QSPI_BK2_D1_GPIO_PORT GPIOH
#define | QSPI_BK2_D2_PIN GPIO_PIN_9
#define | QSPI_BK2_D2_GPIO_PORT GPIOG
#define | QSPI_BK2_D3_PIN GPIO_PIN_14
#define | QSPI_BK2_D3_GPIO_PORT GPIOG
#define | QSPI_FLASH_SIZE 26 /* Address bus width to access whole memory space */
#define | QSPI_PAGE_SIZE 256
#define | QSPI_BASE_ADDRESS 0x90000000

Functions

uint8_t | BSP_QSPI_Init (void)
Initializes the QSPI interface.
uint8_t | BSP_QSPI_DeInit (void)
De-Initializes the QSPI interface.
uint8_t | BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the QSPI memory.
uint8_t | BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the QSPI memory.
uint8_t | BSP_QSPI_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
__weak void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
__weak void | BSP_QSPI_MspDeInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP De-Initialization This function frees the hardware resources used in this example:

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_qspi.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_qspi.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sd.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_sd.c File Reference

This file includes the uSD card driver mounted on STM32H747I-DISCOVERY board. More...

#include "stm32h747i_discovery_sd.h"

Go to the source code of this file.

Functions

uint8_t | BSP_SD_Init (void)
Initializes the SD card device.
uint8_t | BSP_SD_DeInit (void)
DeInitializes the SD card device.
uint8_t | BSP_SD_ITConfig (void)
Configures Interrupt mode for SD1 detection pin.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
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 (void)
BSP SD Abort callbacks.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callbacks.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callbacks.

Variables

SD_HandleTypeDef | uSdHandle

Detailed Description

This file includes the uSD card driver mounted on STM32H747I-DISCOVERY board.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_sd.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sd.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Functions
stm32h747i_discovery_sd.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sd.c driver. More...

#include "stm32h7xx_hal.h"
#include "stm32h747i_discovery.h"

Go to the source code of this file.

Defines

#define | BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.
#define | MSD_OK ((uint8_t)0x00)
SD status structure definition.
#define | MSD_ERROR ((uint8_t)0x01)
#define | MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)
#define | SD_TRANSFER_OK ((uint8_t)0x00)
SD transfer state definition.
#define | SD_TRANSFER_BUSY ((uint8_t)0x01)
#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SD_DATATIMEOUT ((uint32_t)100000000)

Functions

uint8_t | BSP_SD_Init (void)
Initializes the SD card device.
uint8_t | BSP_SD_DeInit (void)
DeInitializes the SD card device.
uint8_t | BSP_SD_ITConfig (void)
Configures Interrupt mode for SD1 detection pin.
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
__weak void | BSP_SD_AbortCallback (void)
BSP SD Abort callbacks.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callbacks.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callbacks.

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sd.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_sd.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sdram.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_sdram.c File Reference

This file includes the SDRAM driver for the MT48LC4M32B2B5-6A memory device mounted on STM32H747I-DISCOVERY boards. More...

#include "stm32h747i_discovery_sdram.h"

Go to the source code of this file.

Functions

uint8_t | BSP_SDRAM_Init (void)
Initializes the SDRAM device.
uint8_t | BSP_SDRAM_DeInit (void)
DeInitializes the SDRAM device.
void | BSP_SDRAM_Initialization_sequence (uint32_t RefreshCount)
Programs the SDRAM device.
uint8_t | BSP_SDRAM_ReadData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_ReadData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_WriteData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_WriteData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_Sendcmd (FMC_SDRAM_CommandTypeDef *SdramCmd)
Sends command to the SDRAM bank.
__weak void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
__weak void | BSP_SDRAM_MspDeInit (SDRAM_HandleTypeDef *hsdram, void *Params)
DeInitializes SDRAM MSP.

Variables

SDRAM_HandleTypeDef | sdramHandle
static FMC_SDRAM_TimingTypeDef | Timing
static FMC_SDRAM_CommandTypeDef | Command

Detailed Description

This file includes the SDRAM driver for the MT48LC4M32B2B5-6A memory device mounted on STM32H747I-DISCOVERY boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the MT48LC4M32B2B5-6A SDRAM external memory mounted
     on STM32H747I-DISCOVERY board.
   - This driver does not need a specific component driver for the SDRAM device
     to be included with.

  Driver description:
  ------------------
  + Initialization steps:
     o Initialize the SDRAM external memory using the BSP_SDRAM_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       FMC controller configuration to interface with the external SDRAM memory.
     o It contains the SDRAM initialization sequence to program the SDRAM external
       device using the function BSP_SDRAM_Initialization_sequence(). Note that this
       sequence is standard for all SDRAM devices, but can include some differences
       from a device to another. If it is the case, the right sequence should be
       implemented separately.

  + SDRAM read/write operations
     o SDRAM external memory can be accessed with read/write operations once it is
       initialized.
       Read/write operation can be performed with AHB access using the functions
       BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by MDMA transfer using the functions
       BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
     o The AHB access is performed with 32-bit width transaction, the MDMA transfer
       configuration is fixed at single (no burst) word transfer (see the
       SDRAM_MspInit() static function).
     o User can implement his own functions for read/write access with his desired
       configurations.
     o If interrupt mode is used for MDMA transfer, the function BSP_SDRAM_MDMA_IRQHandler()
       is called in IRQ handler file, to serve the generated interrupt once the MDMA
       transfer is complete.
     o You can send a command to the SDRAM device in runtime using the function
       BSP_SDRAM_Sendcmd(), and giving the desired command as parameter chosen between
       the predefined commands of the "FMC_SDRAM_CommandTypeDef" structure.
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_sdram.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sdram.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Defines | Functions
stm32h747i_discovery_sdram.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sdram.c driver. More...

#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define | SDRAM_OK ((uint8_t)0x00)
SDRAM status structure definition.
#define | SDRAM_ERROR ((uint8_t)0x01)
#define | SDRAM_DEVICE_ADDR ((uint32_t)0xD0000000)
#define | SDRAM_DEVICE_SIZE ((uint32_t)0x2000000) /* SDRAM device size in MBytes */
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
#define | SDRAM_TIMEOUT ((uint32_t)0xFFFF)
#define | __MDMAx_CLK_ENABLE __HAL_RCC_MDMA_CLK_ENABLE
#define | __MDMAx_CLK_DISABLE __HAL_RCC_MDMA_CLK_DISABLE
#define | SDRAM_MDMAx_CHANNEL MDMA_Channel0
#define | SDRAM_MDMAx_IRQn MDMA_IRQn
#define | SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
FMC SDRAM Mode definition register defines.
#define | SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
#define | SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
#define | SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
#define | SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
#define | SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
#define | SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
#define | SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
#define | SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
#define | SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
#define | SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Functions

uint8_t | BSP_SDRAM_Init (void)
Initializes the SDRAM device.
uint8_t | BSP_SDRAM_DeInit (void)
DeInitializes the SDRAM device.
void | BSP_SDRAM_Initialization_sequence (uint32_t RefreshCount)
Programs the SDRAM device.
uint8_t | BSP_SDRAM_ReadData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_ReadData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_WriteData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in polling mode.
uint8_t | BSP_SDRAM_WriteData_DMA (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Writes an amount of data to the SDRAM memory in DMA mode.
uint8_t | BSP_SDRAM_Sendcmd (FMC_SDRAM_CommandTypeDef *SdramCmd)
Sends command to the SDRAM bank.
__weak void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
__weak void | BSP_SDRAM_MspDeInit (SDRAM_HandleTypeDef *hsdram, void *Params)
DeInitializes SDRAM MSP.

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sdram.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_sdram.h.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_ts.c File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Functions | Variables
stm32h747i_discovery_ts.c File Reference

This file provides a set of functions needed to manage the Touch Screen on STM32H747I_DISCOVERY discovery board. More...

#include "stm32h747i_discovery.h"
#include "stm32h747i_discovery_ts.h"

Go to the source code of this file.

Functions

uint8_t | BSP_TS_Init (uint16_t ts_SizeX, uint16_t ts_SizeY)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
__weak void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.

Variables

static TS_DrvTypeDef * | ts_driver
static uint8_t | ts_orientation
static uint8_t | I2C_Address = 0
char * | ts_event_string_tab [TOUCH_EVENT_NB_MAX]
Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.
char * | ts_gesture_id_string_tab [GEST_ID_NB_MAX]
Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Detailed Description

This file provides a set of functions needed to manage the Touch Screen on STM32H747I_DISCOVERY discovery board.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_ts.c.


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_ts.h File Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
Data Structures | Defines | Enumerations | Functions | Variables
stm32h747i_discovery_ts.h File Reference

This file contains the common defines and functions prototypes for the stm32h747i_discovery_ts.c driver. More...

#include "stm32h747i_discovery.h"
#include "stm32h747i_discovery_lcd.h"
#include "../Components/ft6x06/ft6x06.h"

Go to the source code of this file.

Data Structures

struct | TS_StateTypeDef
TS_StateTypeDef Define TS State structure. More...

Defines

#define | TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
With FT6206 : maximum 2 touches detected simultaneously.
#define | TS_NO_IRQ_PENDING ((uint8_t) 0)
#define | TS_IRQ_PENDING ((uint8_t) 1)
#define | TS_SWAP_NONE ((uint8_t) 0x01)
#define | TS_SWAP_X ((uint8_t) 0x02)
#define | TS_SWAP_Y ((uint8_t) 0x04)
#define | TS_SWAP_XY ((uint8_t) 0x08)

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02, TS_DEVICE_NOT_FOUND = 0x03 }
TS_StatusTypeDef Define BSP_TS_xxx() functions possible return value, when status is returned by those functions. More...
enum TS_GestureIdTypeDef {
GEST_ID_NO_GESTURE = 0x00, GEST_ID_MOVE_UP = 0x01, GEST_ID_MOVE_RIGHT = 0x02, GEST_ID_MOVE_DOWN = 0x03,
GEST_ID_MOVE_LEFT = 0x04, GEST_ID_ZOOM_IN = 0x05, GEST_ID_ZOOM_OUT = 0x06, GEST_ID_NB_MAX = 0x07
}
TS_GestureIdTypeDef Define Possible managed gesture identification values returned by touch screen driver. More...
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

uint8_t | BSP_TS_Init (uint16_t ts_SizeX, uint16_t ts_SizeY)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
__weak void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.

Variables

char * | ts_event_string_tab [TOUCH_EVENT_NB_MAX]
Table for touchscreen event information display on LCD : table indexed on enum TS_TouchEventTypeDef information.
char * | ts_gesture_id_string_tab [GEST_ID_NB_MAX]
Table for touchscreen gesture Id information display on LCD : table indexed on enum TS_GestureIdTypeDef information.

Detailed Description

This file contains the common defines and functions prototypes for the stm32h747i_discovery_ts.c driver.

Author:
MCD Application Team
Attention:

© Copyright (c) 2018 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_ts.h.


STM32H747I-Discovery BSP User Manual: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
AUDIOIN_ContextTypeDef |
LCD_DrawPropTypeDef | LCD Drawing main properties
Point | LCD Drawing point (pixel) geometric definition
QSPI_Info |
TS_StateTypeDef | TS_StateTypeDef Define TS State structure


STM32H747I-Discovery BSP User Manual: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
A | L | P | Q | T
A
L
P
Q
T
AUDIOIN_ContextTypeDef LCD_DrawPropTypeDef Point QSPI_Info TS_StateTypeDef
A | L | P | Q | T


STM32H747I-Discovery BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/ Directory Reference

  • Firmware
  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32H747I-Discovery


STM32H747I-Discovery BSP User Manual: C:/git/h7_master/Firmware/ Directory Reference

  • Firmware
Firmware Directory Reference

Directories

directory Drivers


STM32H747I-Discovery BSP User Manual: C:/git/h7_master/Firmware/Drivers/BSP/STM32H747I-Discovery/ Directory Reference

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
STM32H747I-Discovery Directory Reference

Files

file | stm32h747i_discovery.c [code]

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, available on STM32H747I-Discovery board (MB1248) from STMicroelectronics.

file | stm32h747i_discovery.h [code]

This file contains definitions for STM32H747I-Discovery LEDs, push-buttons hardware resources.

file | stm32h747i_discovery_audio.c [code]

This file provides the Audio driver for the STM32H747I-DISCOVERY board.

file | stm32h747i_discovery_audio.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio.c driver.

file | stm32h747i_discovery_camera.c [code]
file | stm32h747i_discovery_camera.h [code]
file | stm32h747i_discovery_lcd.c [code]

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H747I_DISCOVERY board.

file | stm32h747i_discovery_lcd.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_lcd.c driver.

file | stm32h747i_discovery_qspi.c [code]

This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-DISCOVERY board.

file | stm32h747i_discovery_qspi.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_qspi.c driver.

file | stm32h747i_discovery_sd.c [code]

This file includes the uSD card driver mounted on STM32H747I-DISCOVERY board.

file | stm32h747i_discovery_sd.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sd.c driver.

file | stm32h747i_discovery_sdram.c [code]

This file includes the SDRAM driver for the MT48LC4M32B2B5-6A memory device mounted on STM32H747I-DISCOVERY boards.

file | stm32h747i_discovery_sdram.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_sdram.c driver.

file | stm32h747i_discovery_ts.c [code]

This file provides a set of functions needed to manage the Touch Screen on STM32H747I_DISCOVERY discovery board.

file | stm32h747i_discovery_ts.h [code]

This file contains the common defines and functions prototypes for the stm32h747i_discovery_ts.c driver.


STM32H747I-Discovery BSP User Manual: C:/git/h7_master/Firmware/Drivers/ Directory Reference

  • Firmware
  • Drivers
Drivers Directory Reference

Directories

directory BSP


STM32H747I-Discovery BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Firmware
    • Drivers
      • BSP
        • STM32H747I-Discovery
Generated on Mon Sep 24 2018 15:52:01 for STM32H747I-Discovery BSP User Manual by doxygen 1.7.6.1


STM32H747I-Discovery BSP User Manual: File List

File List
Here is a list of all files with brief descriptions:
stm32h747i_discovery.c [code] | This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, available on STM32H747I-Discovery board (MB1248) from STMicroelectronics
stm32h747i_discovery.h [code] | This file contains definitions for STM32H747I-Discovery LEDs, push-buttons hardware resources
stm32h747i_discovery_audio.c [code] | This file provides the Audio driver for the STM32H747I-DISCOVERY board
stm32h747i_discovery_audio.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio.c driver
stm32h747i_discovery_camera.c [code] |
stm32h747i_discovery_camera.h [code] |
stm32h747i_discovery_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32H747I_DISCOVERY board
stm32h747i_discovery_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_lcd.c driver
stm32h747i_discovery_qspi.c [code] | This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-DISCOVERY board
stm32h747i_discovery_qspi.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_qspi.c driver
stm32h747i_discovery_sd.c [code] | This file includes the uSD card driver mounted on STM32H747I-DISCOVERY board
stm32h747i_discovery_sd.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_sd.c driver
stm32h747i_discovery_sdram.c [code] | This file includes the SDRAM driver for the MT48LC4M32B2B5-6A memory device mounted on STM32H747I-DISCOVERY boards
stm32h747i_discovery_sdram.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_sdram.c driver
stm32h747i_discovery_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32H747I_DISCOVERY discovery board
stm32h747i_discovery_ts.h [code] | This file contains the common defines and functions prototypes for the stm32h747i_discovery_ts.c driver


STM32H747I-Discovery BSP User Manual: BSP

Modules
BSP

Modules

STM32H747I_DISCOVERY


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY

Modules
STM32H747I_DISCOVERY
BSP

Modules

STM32H747I_DISCOVERY_LOW_LEVEL
STM32H747I_DISCOVERY_AUDIO

This file includes the low layer driver for wm8994 Audio Codec available on STM32H747I-DISCOVERY discovery board(MB1248).

STM32H747I_DISCOVERY_CAMERA
STM32H747I_DISCOVERY_LCD
STM32H747I_DISCOVERY_QSPI
STM32H747I_DISCOVERY_SD
STM32H747I_DISCOVERY_SDRAM
STM32H747I_DISCOVERY_TS


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_AUDIO

Modules
STM32H747I_DISCOVERY_AUDIO
STM32H747I_DISCOVERY

This file includes the low layer driver for wm8994 Audio Codec available on STM32H747I-DISCOVERY discovery board(MB1248). More...

Modules

Private Variables
Private FunctionPrototypes
OUT Exported Functions
OUT Private Functions
IN Exported Functions
IN Private Functions
Exported Types
Exported Constants
Exported Macros

Detailed Description

This file includes the low layer driver for wm8994 Audio Codec available on STM32H747I-DISCOVERY discovery board(MB1248).


STM32H747I-Discovery BSP User Manual: Exported Types

Data Structures
Exported Types
STM32H747I_DISCOVERY_AUDIO

Data Structures

struct AUDIOIN_ContextTypeDef


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_CAMERA

Modules
STM32H747I_DISCOVERY_CAMERA
STM32H747I_DISCOVERY

Modules

Exported Variables
Private Variables
Private FunctionPrototypes
Exported Functions
Exported Constants


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_LCD

Modules
STM32H747I_DISCOVERY_LCD
STM32H747I_DISCOVERY

Modules

Private Defines
Private Types
Private Macros
Exported Variables
Private Variables
Private FunctionPrototypes
Exported Functions
Private Functions
Exported Constants
Exported Types


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_LOW_LEVEL

Modules
STM32H747I_DISCOVERY_LOW_LEVEL
STM32H747I_DISCOVERY

Modules

Private Defines
Private Variables
Private FunctionPrototypes
BSP Exported Functions
Private Functions
Exported Types
Exported Constants
STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_QSPI

Modules
STM32H747I_DISCOVERY_QSPI
STM32H747I_DISCOVERY

Modules

Private Variables
Private Functions
Exported Functions
Exported Constants
Exported Types


STM32H747I-Discovery BSP User Manual: Exported Types

Data Structures
Exported Types
STM32H747I_DISCOVERY_QSPI

Data Structures

struct QSPI_Info


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_SD

Modules
STM32H747I_DISCOVERY_SD
STM32H747I_DISCOVERY

Modules

Exported Variables
Exported Functions
Exported Types
Exported_Constants Exported Constants


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_SDRAM

Modules
STM32H747I_DISCOVERY_SDRAM
STM32H747I_DISCOVERY

Modules

Exported Variables
Private Variables
Exported_Functions
Exported Constants


STM32H747I-Discovery BSP User Manual: STM32H747I_DISCOVERY_TS

Modules
STM32H747I_DISCOVERY_TS
STM32H747I_DISCOVERY

Modules

Private Variables
Exported Functions
Exported Constants
Exported Types
Imported Variables


STM32H747I-Discovery BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • STM32H747I_DISCOVERY
      • STM32H747I_DISCOVERY_LOW_LEVEL
        • Private Defines
        • Private Variables
        • Private FunctionPrototypes
        • BSP Exported Functions
        • Private Functions
        • Exported Types
        • Exported Constants
        • STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions
      • STM32H747I_DISCOVERY_AUDIO
        • Private Variables
        • Private FunctionPrototypes
        • OUT Exported Functions
        • OUT Private Functions
        • IN Exported Functions
        • IN Private Functions
        • Exported Types
        • Exported Constants
        • Exported Macros
      • STM32H747I_DISCOVERY_CAMERA
        • Exported Variables
        • Private Variables
        • Private FunctionPrototypes
        • Exported Functions
        • Exported Constants
      • STM32H747I_DISCOVERY_LCD
        • Private Defines
        • Private Types
        • Private Macros
        • Exported Variables
        • Private Variables
        • Private FunctionPrototypes
        • Exported Functions
        • Private Functions
        • Exported Constants
        • Exported Types
      • STM32H747I_DISCOVERY_QSPI
        • Private Variables
        • Private Functions
        • Exported Functions
        • Exported Constants
        • Exported Types
      • STM32H747I_DISCOVERY_SD
        • Exported Variables
        • Exported Functions
        • Exported Types
        • Exported_Constants Exported Constants
      • STM32H747I_DISCOVERY_SDRAM
        • Exported Variables
        • Private Variables
        • Exported_Functions
        • Exported Constants
      • STM32H747I_DISCOVERY_TS
        • Private Variables
        • Exported Functions
        • Exported Constants
        • Exported Types
        • Imported Variables


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to manage LEDs,
00006   *          push-buttons, external SDRAM, external QSPI Flash,
00007   *          available on STM32H747I-Discovery board (MB1248) from
00008   *          STMicroelectronics.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00013   * All rights reserved.</center></h2>
00014   *
00015   * This software component is licensed by ST under BSD 3-Clause license,
00016   * the "License"; You may not use this file except in compliance with the
00017   * License. You may obtain a copy of the License at:
00018   *                        opensource.org/licenses/BSD-3-Clause
00019   *
00020   ******************************************************************************
00021   */
00022
00023 /* Includes ------------------------------------------------------------------*/
00024 #include "stm32h747i_discovery.h"
00025
00026 /** @defgroup BSP BSP
00027   * @{
00028   */
00029
00030 /** @defgroup STM32H747I_DISCOVERY STM32H747I_DISCOVERY
00031   * @{
00032   */
00033
00034 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL STM32H747I_DISCOVERY_LOW_LEVEL
00035   * @{
00036   */
00037
00038 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Private_Defines Private Defines
00039   * @{
00040   */
00041 /**
00042  * @brief STM32H747I Discovery BSP Driver version number V1.0.0
00043    */
00044 #define __STM32H747I_DISCOVERY_BSP_VERSION_MAIN   (0x01) /*!< [31:24] main version */
00045 #define __STM32H747I_DISCOVERY_BSP_VERSION_SUB1   (0x00) /*!< [23:16] sub1 version */
00046 #define __STM32H747I_DISCOVERY_BSP_VERSION_SUB2   (0x00) /*!< [15:8]  sub2 version */
00047 #define __STM32H747I_DISCOVERY_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00048 #define __STM32H747I_DISCOVERY_BSP_VERSION        ((__STM32H747I_DISCOVERY_BSP_VERSION_MAIN << 24)\
00049                                                   |(__STM32H747I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
00050                                                   |(__STM32H747I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
00051                                                   |(__STM32H747I_DISCOVERY_BSP_VERSION_RC))
00052 /**
00053   * @}
00054   */
00055
00056
00057 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Private_Variables Private Variables
00058   * @{
00059   */
00060
00061 GPIO_TypeDef* GPIO_PORT[LEDn] = {LED1_GPIO_PORT,
00062                                  LED2_GPIO_PORT,
00063                                  LED3_GPIO_PORT,
00064                                  LED4_GPIO_PORT};
00065
00066 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00067                                  LED2_PIN,
00068                                  LED3_PIN,
00069                                  LED4_PIN};
00070
00071 GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT };
00072
00073 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN };
00074
00075 const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn };
00076
00077 GPIO_TypeDef* JOY_PORT[JOYn] =   {SEL_JOY_GPIO_PORT,
00078                                   DOWN_JOY_GPIO_PORT,
00079                                   LEFT_JOY_GPIO_PORT,
00080                                   RIGHT_JOY_GPIO_PORT,
00081                                   UP_JOY_GPIO_PORT};
00082
00083 const uint16_t JOY_PIN[JOYn] =   {SEL_JOY_PIN,
00084                                   DOWN_JOY_PIN,
00085                                   LEFT_JOY_PIN,
00086                                   RIGHT_JOY_PIN,
00087                                   UP_JOY_PIN};
00088
00089 const uint8_t JOY_IRQn[JOYn] =   {SEL_JOY_EXTI_IRQn,
00090                                   DOWN_JOY_EXTI_IRQn,
00091                                   LEFT_JOY_EXTI_IRQn,
00092                                   RIGHT_JOY_EXTI_IRQn,
00093                                   UP_JOY_EXTI_IRQn};
00094
00095 static I2C_HandleTypeDef heval_I2c = {0};
00096
00097 /**
00098   * @}
00099   */
00100
00101 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Private_FunctionPrototypes Private FunctionPrototypes
00102   * @{
00103   */
00104 static void     I2Cx_MspInit(void);
00105 static void     I2Cx_Init(void);
00106 static void     I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00107 static uint8_t  I2Cx_Read(uint8_t Addr, uint8_t Reg);
00108 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00109 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00110 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00111 static void     I2Cx_Error(uint8_t Addr);
00112
00113 /* HDMI IO functions */
00114 void            HDMI_IO_Init(void);
00115 void            HDMI_IO_Delay(uint32_t Delay);
00116 void            HDMI_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00117 uint8_t         HDMI_IO_Read(uint8_t Addr, uint8_t Reg);
00118
00119 /* AUDIO IO functions */
00120 void            AUDIO_IO_Init(void);
00121 void            AUDIO_IO_DeInit(void);
00122 void            AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00123 uint16_t        AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
00124 void            AUDIO_IO_Delay(uint32_t Delay);
00125
00126 /* CAMERA IO functions */
00127 void            CAMERA_IO_Init(void);
00128 void            CAMERA_Delay(uint32_t Delay);
00129 void            CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00130 uint16_t        CAMERA_IO_Read(uint8_t Addr, uint16_t Reg);
00131
00132 /* I2C EEPROM IO function */
00133 void                EEPROM_IO_Init(void);
00134 HAL_StatusTypeDef   EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00135 HAL_StatusTypeDef   EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00136 HAL_StatusTypeDef   EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00137
00138 /* TouchScreen (TS) IO functions */
00139 void     TS_IO_Init(void);
00140 void     TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00141 uint8_t  TS_IO_Read(uint8_t Addr, uint8_t Reg);
00142 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00143 void     TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00144 void     TS_IO_Delay(uint32_t Delay);
00145
00146 /* LCD Display IO functions */
00147 void OTM8009A_IO_Delay(uint32_t Delay);
00148 /**
00149   * @}
00150   */
00151
00152 /** @defgroup STM32H747I_DISCOVERY_BSP_Exported_Functions BSP Exported Functions
00153   * @{
00154   */
00155
00156   /**
00157   * @brief  This method returns the STM32H747I Discovery BSP Driver revision
00158   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00159   */
00160 uint32_t BSP_GetVersion(void)
00161 {
00162   return __STM32H747I_DISCOVERY_BSP_VERSION;
00163 }
00164
00165 /**
00166   * @brief  Configures LED GPIO.
00167   * @param  Led: LED to be configured.
00168   *          This parameter can be one of the following values:
00169   *            @arg  LED1
00170   *            @arg  LED2
00171   *            @arg  LED3
00172   *            @arg  LED4
00173   * @retval None
00174   */
00175 void BSP_LED_Init(Led_TypeDef Led)
00176 {
00177   GPIO_InitTypeDef  GPIO_InitStruct;
00178
00179   /* Enable the GPIO_LED clock */
00180   LEDx_GPIO_CLK_ENABLE();
00181
00182   /* Configure the GPIO_LED pin */
00183   GPIO_InitStruct.Pin = GPIO_PIN[Led];
00184   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
00185   GPIO_InitStruct.Pull = GPIO_PULLUP;
00186   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00187
00188   HAL_GPIO_Init(GPIO_PORT[Led], &GPIO_InitStruct);
00189
00190   /* By default, turn off LED */
00191   HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
00192 }
00193
00194
00195 /**
00196   * @brief  DeInit LEDs.
00197   * @param  Led: LED to be configured.
00198   *          This parameter can be one of the following values:
00199   *            @arg  LED1
00200   *            @arg  LED2
00201   *            @arg  LED3
00202   *            @arg  LED4
00203   * @note Led DeInit does not disable the GPIO clock
00204   * @retval None
00205   */
00206 void BSP_LED_DeInit(Led_TypeDef Led)
00207 {
00208     /* Turn off LED */
00209     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_RESET);
00210     /* Configure the GPIO_LED pin */
00211     HAL_GPIO_DeInit(GPIO_PORT[Led], GPIO_PIN[Led]);
00212 }
00213
00214 /**
00215   * @brief  Turns selected LED On.
00216   * @param  Led: LED to be set on
00217   *          This parameter can be one of the following values:
00218   *            @arg  LED1
00219   *            @arg  LED2
00220   *            @arg  LED3
00221   *            @arg  LED4
00222   * @retval None
00223   */
00224 void BSP_LED_On(Led_TypeDef Led)
00225 {
00226   HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_RESET);
00227 }
00228
00229 /**
00230   * @brief  Turns selected LED Off.
00231   * @param  Led: LED to be set off
00232   *          This parameter can be one of the following values:
00233   *            @arg  LED1
00234   *            @arg  LED2
00235   *            @arg  LED3
00236   *            @arg  LED4
00237   * @retval None
00238   */
00239 void BSP_LED_Off(Led_TypeDef Led)
00240 {
00241   HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
00242 }
00243
00244 /**
00245   * @brief  Toggles the selected LED.
00246   * @param  Led: LED to be toggled
00247   *          This parameter can be one of the following values:
00248   *            @arg  LED1
00249   *            @arg  LED2
00250   *            @arg  LED3
00251   *            @arg  LED4
00252   * @retval None
00253   */
00254 void BSP_LED_Toggle(Led_TypeDef Led)
00255 {
00256   HAL_GPIO_TogglePin(GPIO_PORT[Led], GPIO_PIN[Led]);
00257 }
00258
00259 /**
00260   * @brief  Configures button GPIO and EXTI Line.
00261   * @param  Button: Button to be configured
00262   *          This parameter can be one of the following values:
00263   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00264   *            @arg  BUTTON_USER: User Push Button
00265   * @param  Button_Mode: Button mode
00266   *          This parameter can be one of the following values:
00267   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00268   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00269   *                                    with interrupt generation capability
00270   * @retval None
00271   */
00272 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
00273 {
00274   GPIO_InitTypeDef GPIO_InitStruct;
00275
00276   /* Enable the BUTTON clock */
00277   BUTTON_GPIO_CLK_ENABLE();
00278
00279   if(Button_Mode == BUTTON_MODE_GPIO)
00280   {
00281     /* Configure Button pin as input */
00282     GPIO_InitStruct.Pin = BUTTON_PIN[Button];
00283     GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
00284     GPIO_InitStruct.Pull = GPIO_NOPULL;
00285     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00286     HAL_GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStruct);
00287   }
00288
00289   if(Button_Mode == BUTTON_MODE_EXTI)
00290   {
00291     /* Configure Button pin as input with External interrupt */
00292     GPIO_InitStruct.Pin = BUTTON_PIN[Button];
00293     GPIO_InitStruct.Pull = GPIO_NOPULL;
00294     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00295
00296     GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
00297
00298     HAL_GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStruct);
00299
00300     /* Enable and set Button EXTI Interrupt to the lowest priority */
00301     HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
00302     HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00303   }
00304 }
00305
00306 /**
00307   * @brief  Push Button DeInit.
00308   * @param  Button: Button to be configured
00309   *          This parameter can be one of the following values:
00310   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00311   *            @arg  BUTTON_USER: User Push Button
00312   * @note PB DeInit does not disable the GPIO clock
00313   * @retval None
00314   */
00315 void BSP_PB_DeInit(Button_TypeDef Button)
00316 {
00317     GPIO_InitTypeDef gpio_init_structure;
00318
00319     gpio_init_structure.Pin = BUTTON_PIN[Button];
00320     HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00321     HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00322 }
00323
00324
00325 /**
00326   * @brief  Returns the selected button state.
00327   * @param  Button: Button to be checked
00328   *          This parameter can be one of the following values:
00329   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00330   *            @arg  BUTTON_USER: User Push Button
00331   * @retval The Button GPIO pin value
00332   */
00333 uint32_t BSP_PB_GetState(Button_TypeDef Button)
00334 {
00335   return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00336 }
00337
00338 /**
00339   * @brief  Configures all joystick's buttons in GPIO or EXTI modes.
00340   * @param  Joy_Mode: Joystick mode.
00341   *    This parameter can be one of the following values:
00342   *     @arg  JOY_MODE_GPIO: Joystick pins will be used as simple IOs
00343   *     @arg  JOY_MODE_EXTI: Joystick pins will be connected to EXTI line
00344   *                                 with interrupt generation capability
00345   * @retval HAL_OK: if all initializations are OK. Other value if error.
00346   */
00347 uint8_t BSP_JOY_Init(JOYMode_TypeDef Joy_Mode)
00348 {
00349   JOYState_TypeDef joykey;
00350   GPIO_InitTypeDef GPIO_InitStruct;
00351
00352   /* Initialized the Joystick. */
00353   for(joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00354   {
00355     /* Enable the JOY clock */
00356     JOYx_GPIO_CLK_ENABLE(joykey);
00357
00358     GPIO_InitStruct.Pin = JOY_PIN[joykey];
00359     GPIO_InitStruct.Pull = GPIO_PULLUP;
00360     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00361
00362     if (Joy_Mode == JOY_MODE_GPIO)
00363     {
00364       /* Configure Joy pin as input */
00365       GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
00366       HAL_GPIO_Init(JOY_PORT[joykey], &GPIO_InitStruct);
00367     }
00368     else if (Joy_Mode == JOY_MODE_EXTI)
00369     {
00370       /* Configure Joy pin as input with External interrupt */
00371       GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
00372       HAL_GPIO_Init(JOY_PORT[joykey], &GPIO_InitStruct);
00373
00374       /* Enable and set Joy EXTI Interrupt to the lowest priority */
00375       HAL_NVIC_SetPriority((IRQn_Type)(JOY_IRQn[joykey]), 0x0F, 0x00);
00376       HAL_NVIC_EnableIRQ((IRQn_Type)(JOY_IRQn[joykey]));
00377     }
00378   }
00379
00380   return HAL_OK;
00381 }
00382
00383 /**
00384   * @brief  Un-configures all GPIOs used as joystick's buttons.
00385   * @retval None.
00386   */
00387 void BSP_JOY_DeInit(void)
00388 {
00389   JOYState_TypeDef joykey;
00390
00391   /* Initialized the Joystick. */
00392   for(joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00393   {
00394     /* Enable the JOY clock */
00395     JOYx_GPIO_CLK_ENABLE(joykey);
00396
00397     HAL_GPIO_DeInit(JOY_PORT[joykey], JOY_PIN[joykey]);
00398   }
00399 }
00400
00401 /**
00402 * @brief  Returns the current joystick status.
00403 * @retval Code of the joystick key pressed
00404 *          This code can be one of the following values:
00405 *            @arg  JOY_NONE
00406 *            @arg  JOY_SEL
00407 *            @arg  JOY_DOWN
00408 *            @arg  JOY_LEFT
00409 *            @arg  JOY_RIGHT
00410 *            @arg  JOY_UP
00411 */
00412 JOYState_TypeDef BSP_JOY_GetState(void)
00413 {
00414   JOYState_TypeDef joykey;
00415
00416   for (joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00417   {
00418     if (HAL_GPIO_ReadPin(JOY_PORT[joykey], JOY_PIN[joykey]) == GPIO_PIN_RESET)
00419     {
00420       /* Return Code Joystick key pressed */
00421       return joykey;
00422     }
00423   }
00424
00425   /* No Joystick key pressed */
00426   return JOY_NONE;
00427 }
00428
00429 /**
00430   * @}
00431   */
00432
00433 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Private_Functions Private Functions
00434   * @{
00435   */
00436 /*******************************************************************************
00437                             BUS OPERATIONS
00438 *******************************************************************************/
00439
00440 /******************************* I2C Routines *********************************/
00441 /**
00442   * @brief  Initializes I2C MSP.
00443   * @retval None
00444   */
00445 static void I2Cx_MspInit(void)
00446 {
00447   GPIO_InitTypeDef  gpio_init_structure;
00448   RCC_PeriphCLKInitTypeDef  RCC_PeriphClkInit;
00449
00450   /* Configure the I2C clock source */
00451   RCC_PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_I2C123;
00452   RCC_PeriphClkInit.I2c123ClockSelection = RCC_I2C123CLKSOURCE_D2PCLK1;
00453   HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit);
00454
00455   /* set STOPWUCK in RCC_CFGR */
00456   __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);
00457
00458   /*** Configure the GPIOs ***/
00459   /* Enable GPIO clock */
00460   DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
00461
00462   /* Configure I2C Tx as alternate function */
00463   gpio_init_structure.Pin = DISCOVERY_I2Cx_SCL_PIN;
00464   gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00465   gpio_init_structure.Pull = GPIO_NOPULL;
00466   gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00467   gpio_init_structure.Alternate = DISCOVERY_I2Cx_SCL_SDA_AF;
00468   HAL_GPIO_Init(DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00469
00470   /* Configure I2C Rx as alternate function */
00471   gpio_init_structure.Pin = DISCOVERY_I2Cx_SDA_PIN;
00472   HAL_GPIO_Init(DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00473
00474   /*** Configure the I2C peripheral ***/
00475   /* Enable I2C clock */
00476   DISCOVERY_I2Cx_CLK_ENABLE();
00477
00478   /* Force the I2C peripheral clock reset */
00479   DISCOVERY_I2Cx_FORCE_RESET();
00480
00481   /* Release the I2C peripheral clock reset */
00482   DISCOVERY_I2Cx_RELEASE_RESET();
00483
00484   /* Enable and set I2Cx Interrupt to a lower priority */
00485   HAL_NVIC_SetPriority(DISCOVERY_I2Cx_EV_IRQn, 0x0F, 0);
00486   HAL_NVIC_EnableIRQ(DISCOVERY_I2Cx_EV_IRQn);
00487
00488   /* Enable and set I2Cx Interrupt to a lower priority */
00489   HAL_NVIC_SetPriority(DISCOVERY_I2Cx_ER_IRQn, 0x0F, 0);
00490   HAL_NVIC_EnableIRQ(DISCOVERY_I2Cx_ER_IRQn);
00491 }
00492
00493 /**
00494   * @brief  Initializes I2C HAL.
00495   * @retval None
00496   */
00497 static void I2Cx_Init(void)
00498 {
00499   if(HAL_I2C_GetState(&heval_I2c) == HAL_I2C_STATE_RESET)
00500   {
00501     heval_I2c.Instance              = DISCOVERY_I2Cx;
00502     heval_I2c.Init.Timing           = DISCOVERY_I2Cx_TIMING;
00503     heval_I2c.Init.OwnAddress1      = 0x72;
00504     heval_I2c.Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00505     heval_I2c.Init.DualAddressMode  = I2C_DUALADDRESS_ENABLE;
00506     heval_I2c.Init.OwnAddress2      = 0;
00507     heval_I2c.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
00508     heval_I2c.Init.GeneralCallMode  = I2C_GENERALCALL_ENABLE;
00509     heval_I2c.Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00510
00511     /* Init the I2C */
00512     I2Cx_MspInit();
00513     HAL_I2C_Init(&heval_I2c);
00514   }
00515 }
00516
00517 /**
00518   * @brief  Writes a single data.
00519   * @param  Addr: I2C address
00520   * @param  Reg: Register address
00521   * @param  Value: Data to be written
00522   * @retval None
00523   */
00524 static void I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00525 {
00526   HAL_StatusTypeDef status = HAL_OK;
00527
00528   status = HAL_I2C_Mem_Write(&heval_I2c, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 100);
00529
00530   /* Check the communication status */
00531   if(status != HAL_OK)
00532   {
00533     /* Execute user timeout callback */
00534     I2Cx_Error(Addr);
00535   }
00536 }
00537
00538 /**
00539   * @brief  Reads a single data.
00540   * @param  Addr: I2C address
00541   * @param  Reg: Register address
00542   * @retval Read data
00543   */
00544 static uint8_t I2Cx_Read(uint8_t Addr, uint8_t Reg)
00545 {
00546   HAL_StatusTypeDef status = HAL_OK;
00547   uint8_t Value = 0;
00548
00549   status = HAL_I2C_Mem_Read(&heval_I2c, Addr, Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 1000);
00550
00551   /* Check the communication status */
00552   if(status != HAL_OK)
00553   {
00554     /* Execute user timeout callback */
00555     I2Cx_Error(Addr);
00556   }
00557   return Value;
00558 }
00559
00560 /**
00561   * @brief  Reads multiple data.
00562   * @param  Addr: I2C address
00563   * @param  Reg: Reg address
00564   * @param  MemAddress: memory address
00565   * @param  Buffer: Pointer to data buffer
00566   * @param  Length: Length of the data
00567   * @retval HAL status
00568   */
00569 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00570 {
00571   HAL_StatusTypeDef status = HAL_OK;
00572
00573   status = HAL_I2C_Mem_Read(&heval_I2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00574
00575   /* Check the communication status */
00576   if(status != HAL_OK)
00577   {
00578     /* I2C error occurred */
00579     I2Cx_Error(Addr);
00580   }
00581   return status;
00582 }
00583
00584 /**
00585   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00586   * @param  Addr: Device address on BUS Bus.
00587   * @param  Reg: The target register address to write
00588   * @param  MemAddress: memory address
00589   * @param  Buffer: The target register value to be written
00590   * @param  Length: buffer size to be written
00591   * @retval HAL status
00592   */
00593 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00594 {
00595   HAL_StatusTypeDef status = HAL_OK;
00596
00597   status = HAL_I2C_Mem_Write(&heval_I2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00598
00599   /* Check the communication status */
00600   if(status != HAL_OK)
00601   {
00602     /* Re-Initiaize the I2C Bus */
00603     I2Cx_Error(Addr);
00604   }
00605   return status;
00606 }
00607
00608 /**
00609   * @brief  Checks if target device is ready for communication.
00610   * @note   This function is used with Memory devices
00611   * @param  DevAddress: Target device address
00612   * @param  Trials: Number of trials
00613   * @retval HAL status
00614   */
00615 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00616 {
00617   return (HAL_I2C_IsDeviceReady(&heval_I2c, DevAddress, Trials, 1000));
00618 }
00619
00620 /**
00621   * @brief  Manages error callback by re-initializing I2C.
00622   * @param  Addr: I2C Address
00623   * @retval None
00624   */
00625 static void I2Cx_Error(uint8_t Addr)
00626 {
00627   /* De-initialize the I2C comunication bus */
00628   HAL_I2C_DeInit(&heval_I2c);
00629
00630   /* Re-Initialize the I2C communication bus */
00631   I2Cx_Init();
00632 }
00633
00634 /*******************************************************************************
00635                             LINK OPERATIONS
00636 *******************************************************************************/
00637
00638 /********************************* LINK AUDIO *********************************/
00639
00640 /**
00641   * @brief  Initializes Audio low level.
00642   * @retval None
00643   */
00644 void AUDIO_IO_Init(void)
00645 {
00646   I2Cx_Init();
00647 }
00648
00649 /**
00650   * @brief  De-Initializes Audio low level.
00651   * @retval None
00652   */
00653 void AUDIO_IO_DeInit(void)
00654 {
00655 }
00656
00657 /**
00658   * @brief  Writes a single data.
00659   * @param  Addr: I2C address
00660   * @param  Reg: Reg address
00661   * @param  Value: Data to be written
00662   * @retval None
00663   */
00664 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
00665 {
00666   uint16_t tmp = Value;
00667
00668   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
00669
00670   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
00671
00672   I2Cx_WriteMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
00673 }
00674
00675 /**
00676   * @brief  Reads a single data.
00677   * @param  Addr: I2C address
00678   * @param  Reg: Reg address
00679   * @retval Data to be read
00680   */
00681 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
00682 {
00683   uint16_t read_value = 0, tmp = 0;
00684
00685   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
00686
00687   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
00688
00689   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
00690
00691   read_value = tmp;
00692
00693   return read_value;
00694 }
00695
00696 /**
00697   * @brief  AUDIO Codec delay
00698   * @param  Delay: Delay in ms
00699   * @retval None
00700   */
00701 void AUDIO_IO_Delay(uint32_t Delay)
00702 {
00703   HAL_Delay(Delay);
00704 }
00705
00706 /********************************* LINK CAMERA ********************************/
00707
00708 /**
00709   * @brief  Initializes Camera low level.
00710   * @retval None
00711   */
00712 void CAMERA_IO_Init(void)
00713 {
00714   I2Cx_Init();
00715 }
00716
00717 /**
00718   * @brief  Camera writes single data.
00719   * @param  Addr: I2C address
00720   * @param  Reg: Register address
00721   * @param  Value: Data to be written
00722   * @retval None
00723   */
00724 void CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
00725 {
00726
00727   I2Cx_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
00728
00729 }
00730
00731 /**
00732   * @brief  Camera reads single data.
00733   * @param  Addr: I2C address
00734   * @param  Reg: Register address
00735   * @retval Read data
00736   */
00737 uint16_t CAMERA_IO_Read(uint8_t Addr, uint16_t Reg)
00738 {
00739
00740   uint16_t Read_Value = 0;
00741
00742   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Read_Value, 1);
00743
00744   return Read_Value;
00745
00746 }
00747
00748 /**
00749   * @brief  Camera delay
00750   * @param  Delay: Delay in ms
00751   * @retval None
00752   */
00753 void CAMERA_Delay(uint32_t Delay)
00754 {
00755   HAL_Delay(Delay);
00756 }
00757
00758 /******************************** LINK I2C EEPROM *****************************/
00759
00760 /**
00761   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00762   * @retval None
00763   */
00764 void EEPROM_IO_Init(void)
00765 {
00766   I2Cx_Init();
00767 }
00768
00769 /**
00770   * @brief  Write data to I2C EEPROM driver in using DMA channel.
00771   * @param  DevAddress: Target device address
00772   * @param  MemAddress: Internal memory address
00773   * @param  pBuffer: Pointer to data buffer
00774   * @param  BufferSize: Amount of data to be sent
00775   * @retval HAL status
00776   */
00777 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00778 {
00779   return (I2Cx_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00780 }
00781
00782 /**
00783   * @brief  Read data from I2C EEPROM driver in using DMA channel.
00784   * @param  DevAddress: Target device address
00785   * @param  MemAddress: Internal memory address
00786   * @param  pBuffer: Pointer to data buffer
00787   * @param  BufferSize: Amount of data to be read
00788   * @retval HAL status
00789   */
00790 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00791 {
00792   return (I2Cx_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00793 }
00794
00795 /**
00796   * @brief  Checks if target device is ready for communication.
00797   * @note   This function is used with Memory devices
00798   * @param  DevAddress: Target device address
00799   * @param  Trials: Number of trials
00800   * @retval HAL status
00801   */
00802 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00803 {
00804   return (I2Cx_IsDeviceReady(DevAddress, Trials));
00805 }
00806
00807 /******************************** LINK TS (TouchScreen) *****************************/
00808
00809 /**
00810   * @brief  Initialize I2C communication
00811   *         channel from MCU to TouchScreen (TS).
00812   */
00813 void TS_IO_Init(void)
00814 {
00815   I2Cx_Init();
00816 }
00817
00818 /**
00819   * @brief  Writes single data with I2C communication
00820   *         channel from MCU to TouchScreen.
00821   * @param  Addr: I2C address
00822   * @param  Reg: Register address
00823   * @param  Value: Data to be written
00824   */
00825 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00826 {
00827   I2Cx_Write(Addr, Reg, Value);
00828 }
00829
00830 /**
00831   * @brief  Reads single data with I2C communication
00832   *         channel from TouchScreen.
00833   * @param  Addr: I2C address
00834   * @param  Reg: Register address
00835   * @retval Read data
00836   */
00837 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
00838 {
00839   return I2Cx_Read(Addr, Reg);
00840 }
00841
00842 /**
00843   * @brief  Reads multiple data with I2C communication
00844   *         channel from TouchScreen.
00845   * @param  Addr: I2C address
00846   * @param  Reg: Register address
00847   * @param  Buffer: Pointer to data buffer
00848   * @param  Length: Length of the data
00849   * @retval Number of read data
00850   */
00851 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
00852 {
00853  return I2Cx_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
00854 }
00855
00856 /**
00857   * @brief  Writes multiple data with I2C communication
00858   *         channel from MCU to TouchScreen.
00859   * @param  Addr: I2C address
00860   * @param  Reg: Register address
00861   * @param  Buffer: Pointer to data buffer
00862   * @param  Length: Length of the data
00863   * @retval None
00864   */
00865 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
00866 {
00867   I2Cx_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
00868 }
00869
00870 /**
00871   * @brief  Delay function used in TouchScreen low level driver.
00872   * @param  Delay: Delay in ms
00873   * @retval None
00874   */
00875 void TS_IO_Delay(uint32_t Delay)
00876 {
00877   HAL_Delay(Delay);
00878 }
00879
00880 /**************************** LINK OTM8009A (Display driver) ******************/
00881 /**
00882   * @brief  OTM8009A delay
00883   * @param  Delay: Delay in ms
00884   */
00885 void OTM8009A_IO_Delay(uint32_t Delay)
00886 {
00887   HAL_Delay(Delay);
00888 }
00889
00890 #if defined(USE_LCD_HDMI)
00891 /**************************** LINK ADV7533 DSI-HDMI (Display driver) **********/
00892 /**
00893   * @brief  Initializes HDMI IO low level.
00894   * @retval None
00895   */
00896 void HDMI_IO_Init(void)
00897 {
00898   I2Cx_Init();
00899 }
00900
00901 /**
00902   * @brief  HDMI writes single data.
00903   * @param  Addr: I2C address
00904   * @param  Reg: Register address
00905   * @param  Value: Data to be written
00906   * @retval None
00907   */
00908 void HDMI_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00909 {
00910   I2Cx_Write(Addr, Reg, Value);
00911 }
00912
00913 /**
00914   * @brief  Reads single data with I2C communication
00915   *         channel from HDMI bridge.
00916   * @param  Addr: I2C address
00917   * @param  Reg: Register address
00918   * @retval Read data
00919   */
00920 uint8_t HDMI_IO_Read(uint8_t Addr, uint8_t Reg)
00921 {
00922   return I2Cx_Read(Addr, Reg);
00923 }
00924
00925 /**
00926   * @brief  HDMI delay
00927   * @param  Delay: Delay in ms
00928   * @retval None
00929   */
00930 void HDMI_IO_Delay(uint32_t Delay)
00931 {
00932   HAL_Delay(Delay);
00933 }
00934 #endif /* USE_LCD_HDMI */
00935
00936 /**
00937   * @}
00938   */
00939
00940 /**
00941   * @}
00942   */
00943 /**
00944   * @}
00945   */
00946
00947 /**
00948   * @}
00949   */
00950
00951 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32H747I-Discovery LEDs,
00006   *          push-buttons hardware resources.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_H
00023 #define __STM32H747I_DISCOVERY_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32h7xx_hal.h"
00031
00032 /** @addtogroup BSP
00033   * @{
00034   */
00035
00036 /** @addtogroup STM32H747I_DISCOVERY
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32H747I_DISCOVERY_LOW_LEVEL
00041   * @{
00042   */
00043
00044 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Types Exported Types
00045  * @{
00046  */
00047
00048 /** @brief Led_TypeDef
00049   *  STM32H747I_DISCOVERY board leds definitions.
00050   */
00051 typedef enum
00052 {
00053   LED1 = 0,
00054   LED_GREEN = LED1,
00055   LED2 = 1,
00056   LED_ORANGE = LED2,
00057   LED3 = 2,
00058   LED_RED = LED3,
00059   LED4 = 3,
00060   LED_BLUE = LED4
00061 } Led_TypeDef;
00062
00063 /** @brief Button_TypeDef
00064   *  STM32H747I_DISCOVERY board Buttons definitions.
00065   */
00066 typedef enum
00067 {
00068   BUTTON_WAKEUP = 0,
00069 } Button_TypeDef;
00070
00071 #define BUTTON_USER BUTTON_WAKEUP
00072
00073 /** @brief ButtonMode_TypeDef
00074   *  STM32H747I_DISCOVERY board Buttons Modes definitions.
00075   */
00076 typedef enum
00077 {
00078   BUTTON_MODE_GPIO = 0,
00079   BUTTON_MODE_EXTI = 1
00080 } ButtonMode_TypeDef;
00081
00082
00083 typedef enum
00084 {
00085   PB_SET = 0,
00086   PB_RESET = !PB_SET
00087 } ButtonValue_TypeDef;
00088
00089 typedef enum
00090 {
00091   JOY_MODE_GPIO = 0,
00092   JOY_MODE_EXTI = 1
00093 } JOYMode_TypeDef;
00094
00095 typedef enum
00096 {
00097   JOY_SEL   = 0,
00098   JOY_DOWN  = 1,
00099   JOY_LEFT  = 2,
00100   JOY_RIGHT = 3,
00101   JOY_UP    = 4,
00102   JOY_NONE  = 5
00103 } JOYState_TypeDef;
00104
00105 /** @brief DISCO_Status_TypeDef
00106   *  STM32H747I_DISCO board Status return possible values.
00107   */
00108 typedef enum
00109 {
00110   DISCO_OK    = 0,
00111   DISCO_ERROR = 1
00112 } DISCO_Status_TypeDef;
00113
00114 /**
00115   * @}
00116   */
00117
00118 /** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Constants Exported Constants
00119   * @{
00120   */
00121
00122 /**
00123   * @brief  Define for STM32H747I_DISCOVERY board
00124   */
00125 #if !defined (USE_STM32H747I_DISCO)
00126  #define USE_STM32H747I_DISCO
00127 #endif
00128
00129 #define LEDn                             ((uint32_t)4)
00130
00131 #define LED1_GPIO_PORT                   GPIOI
00132 #define LED1_PIN                         GPIO_PIN_12
00133
00134 #define LED2_GPIO_PORT                   GPIOI
00135 #define LED2_PIN                         GPIO_PIN_13
00136
00137 #define LED3_GPIO_PORT                   GPIOI
00138 #define LED3_PIN                         GPIO_PIN_14
00139
00140 #define LED4_GPIO_PORT                   GPIOI
00141 #define LED4_PIN                         GPIO_PIN_15
00142
00143 #define LEDx_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOI_CLK_ENABLE()
00144 #define LEDx_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOI_CLK_DISABLE()
00145
00146 /* Only one User/Wakeup button */
00147 #define BUTTONn                             ((uint8_t)1)
00148
00149 /**
00150   * @brief Wakeup push-button
00151   */
00152 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_13
00153 #define WAKEUP_BUTTON_GPIO_PORT             GPIOC
00154 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOC_CLK_ENABLE()
00155 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOC_CLK_DISABLE()
00156 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI15_10_IRQn
00157
00158 /* Define the USER button as an alias of the Wakeup button */
00159 #define USER_BUTTON_PIN                   WAKEUP_BUTTON_PIN
00160 #define USER_BUTTON_GPIO_PORT             WAKEUP_BUTTON_GPIO_PORT
00161 #define USER_BUTTON_GPIO_CLK_ENABLE()     WAKEUP_BUTTON_GPIO_CLK_ENABLE()
00162 #define USER_BUTTON_GPIO_CLK_DISABLE()    WAKEUP_BUTTON_GPIO_CLK_DISABLE()
00163 #define USER_BUTTON_EXTI_IRQn             WAKEUP_BUTTON_EXTI_IRQn
00164
00165 #define BUTTON_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOC_CLK_ENABLE()
00166
00167 #define JOYn                              ((uint8_t)5)
00168
00169 /**
00170  * @brief Joystick Selection push-button
00171  */
00172 #define SEL_JOY_PIN                       GPIO_PIN_2
00173 #define SEL_JOY_GPIO_PORT                 GPIOK
00174 #define SEL_JOY_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOK_CLK_ENABLE()
00175 #define SEL_JOY_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOK_CLK_DISABLE()
00176 #define SEL_JOY_EXTI_IRQn                 EXTI2_IRQn
00177
00178 /**
00179 * @brief Joystick Down push-button
00180 */
00181 #define DOWN_JOY_PIN                      GPIO_PIN_3
00182 #define DOWN_JOY_GPIO_PORT                GPIOK
00183 #define DOWN_JOY_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOK_CLK_ENABLE()
00184 #define DOWN_JOY_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOK_CLK_DISABLE()
00185 #define DOWN_JOY_EXTI_IRQn                EXTI3_IRQn
00186
00187 /**
00188 * @brief Joystick Left push-button
00189 */
00190 #define LEFT_JOY_PIN                      GPIO_PIN_4
00191 #define LEFT_JOY_GPIO_PORT                GPIOK
00192 #define LEFT_JOY_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOK_CLK_ENABLE()
00193 #define LEFT_JOY_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOK_CLK_DISABLE()
00194 #define LEFT_JOY_EXTI_IRQn                EXTI4_IRQn
00195
00196 /**
00197  * @brief Joystick Right push-button
00198  */
00199 #define RIGHT_JOY_PIN                     GPIO_PIN_5
00200 #define RIGHT_JOY_GPIO_PORT               GPIOK
00201 #define RIGHT_JOY_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOK_CLK_ENABLE()
00202 #define RIGHT_JOY_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOK_CLK_DISABLE()
00203 #define RIGHT_JOY_EXTI_IRQn               EXTI9_5_IRQn
00204
00205 /**
00206 * @brief Joystick Up push-button
00207 */
00208 #define UP_JOY_PIN                        GPIO_PIN_6
00209 #define UP_JOY_GPIO_PORT                  GPIOK
00210 #define UP_JOY_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOK_CLK_ENABLE()
00211 #define UP_JOY_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOK_CLK_DISABLE()
00212 #define UP_JOY_EXTI_IRQn                  EXTI9_5_IRQn
00213
00214 #define JOYx_GPIO_CLK_ENABLE(__JOY__)     do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_ENABLE();   } else \
00215                                                if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_ENABLE();  } else \
00216                                                if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_ENABLE();  } else \
00217                                                if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_ENABLE(); } else \
00218                                                if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_ENABLE(); }  } while(0)
00219
00220 #define JOYx_GPIO_CLK_DISABLE(__JOY__)    do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_DISABLE();   } else \
00221                                                if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_DISABLE();  } else \
00222                                                if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_DISABLE();  } else \
00223                                                if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_DISABLE(); } else \
00224                                                if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_DISABLE(); }  } while(0)
00225
00226 #define JOY_ALL_PINS                      (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
00227
00228
00229 /**
00230   * @brief USB OTG HS Over Current signal
00231   */
00232 #define OTG_HS_OVER_CURRENT_PIN                  GPIO_PIN_1
00233 #define OTG_HS_OVER_CURRENT_PORT                 GPIOJ
00234 #define OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE()    __HAL_RCC_GPIOJ_CLK_ENABLE()
00235
00236 /**
00237   * @brief SD-detect signal
00238   */
00239 #define SD_DETECT_PIN                        ((uint32_t)GPIO_PIN_8)
00240 #define SD_DETECT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOI)
00241 #define SD_DETECT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOI_CLK_ENABLE()
00242 #define SD_DETECT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOI_CLK_DISABLE()
00243 #define SD_DETECT_EXTI_IRQn                  EXTI9_5_IRQn
00244
00245 /**
00246   * @brief TS_INT signal from TouchScreen when it is configured in interrupt mode
00247   * GPIOI13 is used for that purpose on Manta Dragon Discovery board
00248   */
00249 #define TS_INT_PIN                        ((uint32_t)GPIO_PIN_7)
00250 #define TS_INT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOK)
00251 #define TS_INT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOK_CLK_ENABLE()
00252 #define TS_INT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOK_CLK_DISABLE()
00253 #define TS_INT_EXTI_IRQn                  EXTI9_5_IRQn
00254
00255 /**
00256   * @brief TouchScreen FT6206 Slave I2C address
00257   */
00258 #define TS_I2C_ADDRESS                   ((uint16_t)0x54)
00259 #define TS3510_I2C_ADDRESS               ((uint16_t)0x80)
00260
00261 /**
00262   * @brief Audio I2C Slave address
00263   */
00264 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x34)
00265
00266 #define CAMERA_I2C_ADDRESS               ((uint16_t)0x60)
00267
00268 /**
00269   * @brief User can use this section to tailor I2C4/I2C4 instance used and associated
00270   * resources (audio codec).
00271   * Definition for I2C4 clock resources
00272   */
00273 #define DISCOVERY_I2Cx                             I2C4
00274 #define DISCOVERY_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C4_CLK_ENABLE()
00275 #define DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOD_CLK_ENABLE()
00276
00277 #define DISCOVERY_I2Cx_FORCE_RESET()               __HAL_RCC_I2C4_FORCE_RESET()
00278 #define DISCOVERY_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C4_RELEASE_RESET()
00279
00280 /** @brief Definition for I2C4 Pins
00281   */
00282 #define DISCOVERY_I2Cx_SCL_PIN                     GPIO_PIN_12 /*!< PD12 */
00283 #define DISCOVERY_I2Cx_SDA_PIN                     GPIO_PIN_13 /*!< PD13 */
00284 #define DISCOVERY_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C4
00285 #define DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT           GPIOD
00286 /** @brief Definition of I2C4 interrupt requests
00287   */
00288 #define DISCOVERY_I2Cx_EV_IRQn                     I2C4_EV_IRQn
00289 #define DISCOVERY_I2Cx_ER_IRQn                     I2C4_ER_IRQn
00290
00291 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00292 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */
00293 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
00294 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */
00295 /* this value might be adapted when next Rev Birdie board is available */
00296 #ifndef DISCOVERY_I2Cx_TIMING
00297 #define DISCOVERY_I2Cx_TIMING                      ((uint32_t)0x40912732)
00298 #endif /* DISCOVERY_I2Cx_TIMING */
00299
00300 /**
00301   * @}
00302   */
00303
00304
00305 /** @addtogroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions
00306   * @{
00307   */
00308 uint32_t         BSP_GetVersion(void);
00309 void             BSP_LED_Init(Led_TypeDef Led);
00310 void             BSP_LED_DeInit(Led_TypeDef Led);
00311 void             BSP_LED_On(Led_TypeDef Led);
00312 void             BSP_LED_Off(Led_TypeDef Led);
00313 void             BSP_LED_Toggle(Led_TypeDef Led);
00314 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00315 void             BSP_PB_DeInit(Button_TypeDef Button);
00316 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00317 uint8_t          BSP_JOY_Init(JOYMode_TypeDef Joy_Mode);
00318 void             BSP_JOY_DeInit(void);
00319 JOYState_TypeDef BSP_JOY_GetState(void);
00320
00321 /**
00322   * @}
00323   */
00324
00325 /**
00326   * @}
00327   */
00328
00329 /**
00330   * @}
00331   */
00332
00333 /**
00334   * @}
00335   */
00336
00337
00338 #ifdef __cplusplus
00339 }
00340 #endif
00341
00342 #endif /* __STM32H747I_DISCOVERY_H */
00343
00344 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_audio.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_audio.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_audio.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides the Audio driver for the STM32H747I-DISCOVERY
00006   *          board.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    + This driver supports STM32H7xx devices on STM32H747I-DISCOVERY (MB1248) Discovery boards.
00011    + Call the function BSP_AUDIO_OUT_Init(
00012                                     OutputDevice: physical output mode (OUTPUT_DEVICE_SPEAKER,
00013                                                   OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH)
00014                                     Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
00015                                     AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
00016                                                   this parameter is relative to the audio file/stream type.
00017                                    )
00018       This function configures all the hardware required for the audio application (codec, I2C, SAI,
00019       GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
00020       If the returned value is different from AUDIO_OK or the function is stuck then the communication with
00021       the codec has failed (try to un-plug the power or reset device in this case).
00022       - OUTPUT_DEVICE_SPEAKER  : only speaker will be set as output for the audio stream.
00023       - OUTPUT_DEVICE_HEADPHONE: only headphones will be set as output for the audio stream.
00024       - OUTPUT_DEVICE_BOTH     : both Speaker and Headphone are used as outputs for the audio stream
00025                                  at the same time.
00026       Note. On STM32H747I-DISCOVERY SAI_DMA is configured in CIRCULAR mode. Due to this the application
00027         does NOT need to call BSP_AUDIO_OUT_ChangeBuffer() to assure streaming.
00028    + Call the function BSP_AUDIO_OUT_Play(
00029                                   pBuffer: pointer to the audio data file address
00030                                   Size   : size of the buffer to be sent in Bytes
00031                                  )
00032       to start playing (for the first time) from the audio file/stream.
00033    + Call the function BSP_AUDIO_OUT_Pause() to pause playing
00034    + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
00035        Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00036           for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00037        Note. This function should be called only when the audio file is played or paused (not stopped).
00038    + For each mode, you may need to implement the relative callback functions into your code.
00039       The Callback functions are named BSP_AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
00040       the stm32h747i_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
00041    + To Stop playing, to modify the volume level, the frequency, the audio frame slot,
00042       the device output mode the mute or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
00043       AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetOutputMode(),
00044       BSP_AUDIO_OUT_SetMute() and BSP_AUDIO_OUT_Stop().
00045
00046    + Call the function BSP_AUDIO_IN_Init(
00047                                     AudioFreq: Audio frequency in Hz (8000, 16000, 22500, 32000...)
00048                                                   this parameter is relative to the audio file/stream type.
00049                                     BitRes: Bit resolution fixed to 16bit
00050                                     ChnlNbr: Number of channel to be configured for the DFSDM peripheral
00051                                    )
00052       This function configures all the hardware required for the audio in application (channels,
00053       Clock source for SAI PDM periphiral, GPIOs, DMA and interrupt if needed).
00054       This function returns AUDIO_OK if configuration is OK.If the returned value is different from AUDIO_OK then
00055       the configuration should be wrong.
00056    + Call the function BSP_AUDIO_IN_AllocScratch(
00057                                         pScratch: pointer to scratch tables
00058                                         size: size of scratch buffer)
00059      This function must be called before BSP_AUDIO_IN_RECORD() to allocate buffer scratch for each DFSDM channel
00060      and its size.
00061      Note: These buffers scratch are used as intermidiate buffers to collect data within final record buffer.
00062            size is the total size of the four buffers scratch; If size is 512 then the size of each is 128.
00063            This function must be called after BSP_AUDIO_IN_Init()
00064    + Call the function BSP_AUDIO_IN_RECORD(
00065                                   pBuf: pointer to the recorded audio data file address
00066                                   Size: size of the buffer to be written in Bytes
00067                                  )
00068       to start recording from microphones.
00069
00070    + Call the function BSP_AUDIO_IN_Pause() to pause recording
00071    + Call the function BSP_AUDIO_IN_Resume() to recording playing.
00072        Note. After calling BSP_AUDIO_IN_Pause() function for pause, only BSP_AUDIO_IN_Resume() should be called
00073           for resume (it is not allowed to call BSP_AUDIO_IN_RECORD() in this case).
00074    + Call the function BSP_AUDIO_IN_Stop() to stop recording
00075    + For each mode, you may need to implement the relative callback functions into your code.
00076       The Callback functions are named BSP_AUDIO_IN_XXX_CallBack() and only their prototypes are declared in
00077       the stm32h747i_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
00078    + Call the function BSP_AUDIO_IN_SelectInterface(uint32_t Interface) to select one of the two interfaces
00079      available on the STM32H747I-Discovery board: SAI or PDM. This function is to be called before BSP_AUDIO_IN_InitEx().
00080    + Call the function BSP_AUDIO_IN_GetInterface() to get the current used interface.
00081    + Call the function BSP_AUDIO_IN_PDMToPCM_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
00082      to init PDM filters if the libPDMFilter is used for audio data filtering.
00083    + Call the function BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf) to filter PDM data to PCM format
00084      if the libPDMFilter library is used for audio data filtering.
00085
00086   Driver architecture:
00087   --------------------
00088    + This driver provides the High Audio Layer: consists of the function API exported in the stm32h747i_discovery_audio.h file
00089      (BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play() ...)
00090    + This driver provide also the Media Access Layer (MAL): which consists of functions allowing to access the media containing/
00091      providing the audio file/stream. These functions are also included as local functions into
00092      the stm32h747i_discovery_audio.c file (DFSDMx_Init(), DFSDMx_DeInit(), SAIx_Init() and SAIx_DeInit())
00093
00094   Known Limitations:
00095   ------------------
00096    1- If the TDM Format used to play in parallel 2 audio Stream (the first Stream is configured in codec SLOT0 and second
00097       Stream in SLOT1) the Pause/Resume, volume and mute feature will control the both streams.
00098    2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
00099       File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
00100    3- Supports only Stereo audio streaming.
00101    4- Supports only 16-bits audio data size.
00102   @endverbatim
00103   ******************************************************************************
00104   * @attention
00105   *
00106   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00107   * All rights reserved.</center></h2>
00108   *
00109   * This software component is licensed by ST under BSD 3-Clause license,
00110   * the "License"; You may not use this file except in compliance with the
00111   * License. You may obtain a copy of the License at:
00112   *                        opensource.org/licenses/BSD-3-Clause
00113   *
00114   ******************************************************************************
00115   */
00116 /* Includes ------------------------------------------------------------------*/
00117 #include "stm32h747i_discovery_audio.h"
00118
00119 /** @addtogroup BSP
00120   * @{
00121   */
00122
00123 /** @addtogroup STM32H747I_DISCOVERY
00124   * @{
00125   */
00126
00127 /** @defgroup STM32H747I_DISCOVERY_AUDIO STM32H747I_DISCOVERY_AUDIO
00128   * @brief This file includes the low layer driver for wm8994 Audio Codec
00129   *        available on STM32H747I-DISCOVERY discovery board(MB1248).
00130   * @{
00131   */
00132
00133 /** @defgroup STM32H747I_DISCOVERY_AUDIO_Private_Variables Private Variables
00134   * @{
00135   */
00136 /* PLAY */
00137 AUDIO_DrvTypeDef                *audio_drv;
00138 SAI_HandleTypeDef               haudio_out_sai;
00139 SAI_HandleTypeDef               haudio_in_sai;
00140
00141 /* RECORD */
00142 AUDIOIN_ContextTypeDef          hAudioIn;
00143
00144
00145
00146 /* Audio in Volume value */
00147 __IO uint16_t                   AudioInVolume = DEFAULT_AUDIO_IN_VOLUME;
00148
00149 /* PDM filters params */
00150 PDM_Filter_Handler_t  PDM_FilterHandler[2];
00151 PDM_Filter_Config_t   PDM_FilterConfig[2];
00152
00153 /**
00154   * @}
00155   */
00156
00157 /** @defgroup STM32H747I_DISCOVERY_AUDIO_Private_Function_Prototypes Private FunctionPrototypes
00158   * @{
00159   */
00160 static void SAIx_Out_Init(uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq);
00161 static void SAIx_Out_DeInit(SAI_HandleTypeDef *hsai);
00162 static void SAIx_In_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00163 static void SAIx_In_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00164 static void SAIx_In_Init(uint32_t SaiInMode, uint32_t SlotActive, uint32_t AudioFreq);
00165 static void SAIx_In_DeInit(SAI_HandleTypeDef *hsai);
00166
00167 /**
00168   * @}
00169   */
00170
00171 /** @defgroup STM32H747I_DISCOVERY_AUDIO_OUT_Exported_Functions OUT Exported Functions
00172   * @{
00173   */
00174
00175 /**
00176   * @brief  Configures the audio Out peripheral.
00177   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00178   *                       or OUTPUT_DEVICE_BOTH.
00179   * @param  Volume: Initial volume level (from 0 (Mute) to 100 (Max))
00180   * @param  AudioFreq: Audio frequency used to play the audio stream.
00181   * @retval AUDIO_OK if correct communication, else wrong communication
00182   */
00183 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
00184 {
00185   uint8_t ret = AUDIO_ERROR;
00186   uint32_t deviceid = 0x00;
00187   uint32_t slot_active;
00188
00189   /* Initialize SAI1 sub_block A as MASTER TX */
00190   haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00191
00192   /* Disable SAI */
00193   SAIx_Out_DeInit(&haudio_out_sai);
00194
00195   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00196   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00197
00198   /* SAI data transfer preparation:
00199   Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00200
00201   if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00202   {
00203     /* Init the SAI MSP: this __weak function can be redefined by the application*/
00204     BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00205   }
00206
00207   /* Init SAI as master RX output */
00208   slot_active = CODEC_AUDIOFRAME_SLOT_0123;
00209   SAIx_Out_Init(SAI_MODEMASTER_TX, slot_active, AudioFreq);
00210
00211   /* wm8994 codec initialization */
00212   deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00213
00214   if((deviceid) == WM8994_ID)
00215   {
00216     /* Reset the Codec Registers */
00217     wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00218     /* Initialize the audio driver structure */
00219     audio_drv = &wm8994_drv;
00220     ret = AUDIO_OK;
00221   }
00222   else
00223   {
00224     ret = AUDIO_ERROR;
00225   }
00226
00227   if(ret == AUDIO_OK)
00228   {
00229     /* Initialize the codec internal registers */
00230     audio_drv->Init(AUDIO_I2C_ADDRESS, OutputDevice, Volume, AudioFreq);
00231   }
00232
00233   return ret;
00234 }
00235
00236 /**
00237   * @brief  Starts playing audio stream from a data buffer for a determined size.
00238   * @param  pBuffer: Pointer to the buffer
00239   * @param  Size: Number of audio data BYTES.
00240   * @retval AUDIO_OK if correct communication, else wrong communication
00241   */
00242 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size)
00243 {
00244   /* Call the audio Codec Play function */
00245   if(audio_drv->Play(AUDIO_I2C_ADDRESS, pBuffer, Size) != 0)
00246   {
00247     return AUDIO_ERROR;
00248   }
00249   else
00250   {
00251     /* Update the Media layer and enable it for play */
00252     HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pBuffer, DMA_MAX(Size / AUDIODATA_SIZE));
00253
00254     return AUDIO_OK;
00255   }
00256 }
00257
00258 /**
00259   * @brief  Sends n-Bytes on the SAI interface.
00260   * @param  pData: pointer on data address
00261   * @param  Size: number of data to be written
00262   * @retval None
00263   */
00264 void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
00265 {
00266    HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pData, Size);
00267 }
00268
00269 /**
00270   * @brief  This function Pauses the audio file stream. In case
00271   *         of using DMA, the DMA Pause feature is used.
00272   * @warning When calling BSP_AUDIO_OUT_Pause() function for pause, only
00273   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00274   *          function for resume could lead to unexpected behaviour).
00275   * @retval AUDIO_OK if correct communication, else wrong communication
00276   */
00277 uint8_t BSP_AUDIO_OUT_Pause(void)
00278 {
00279   /* Call the Audio Codec Pause/Resume function */
00280   if(audio_drv->Pause(AUDIO_I2C_ADDRESS) != 0)
00281   {
00282     return AUDIO_ERROR;
00283   }
00284   else
00285   {
00286     /* Call the Media layer pause function */
00287     HAL_SAI_DMAPause(&haudio_out_sai);
00288
00289     /* Return AUDIO_OK when all operations are correctly done */
00290     return AUDIO_OK;
00291   }
00292 }
00293
00294 /**
00295   * @brief   Resumes the audio file stream.
00296   * @warning When calling BSP_AUDIO_OUT_Pause() function for pause, only
00297   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00298   *          function for resume could lead to unexpected behaviour).
00299   * @retval AUDIO_OK if correct communication, else wrong communication
00300   */
00301 uint8_t BSP_AUDIO_OUT_Resume(void)
00302 {
00303   /* Call the Audio Codec Pause/Resume function */
00304   if(audio_drv->Resume(AUDIO_I2C_ADDRESS) != 0)
00305   {
00306     return AUDIO_ERROR;
00307   }
00308   else
00309   {
00310     /* Call the Media layer pause/resume function */
00311     HAL_SAI_DMAResume(&haudio_out_sai);
00312
00313     /* Return AUDIO_OK when all operations are correctly done */
00314     return AUDIO_OK;
00315   }
00316 }
00317
00318 /**
00319   * @brief  Stops audio playing and Power down the Audio Codec.
00320   * @param  Option: could be one of the following parameters
00321   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00322   *                            Then no need to reconfigure the Codec after power on.
00323   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00324   *                            Then need to reconfigure the Codec after power on.
00325   * @retval AUDIO_OK if correct communication, else wrong communication
00326   */
00327 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
00328 {
00329   /* Call the Media layer stop function */
00330   HAL_SAI_DMAStop(&haudio_out_sai);
00331
00332   /* Call Audio Codec Stop function */
00333   if(audio_drv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
00334   {
00335     return AUDIO_ERROR;
00336   }
00337   else
00338   {
00339     if(Option == CODEC_PDWN_HW)
00340     {
00341       /* Wait at least 100us */
00342       HAL_Delay(1);
00343     }
00344     /* Return AUDIO_OK when all operations are correctly done */
00345     return AUDIO_OK;
00346   }
00347 }
00348
00349 /**
00350   * @brief  Controls the current audio volume level.
00351   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00352   *         Mute and 100 for Max volume level).
00353   * @retval AUDIO_OK if correct communication, else wrong communication
00354   */
00355 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
00356 {
00357   /* Call the codec volume control function with converted volume value */
00358   if(audio_drv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
00359   {
00360     return AUDIO_ERROR;
00361   }
00362   else
00363   {
00364     /* Return AUDIO_OK when all operations are correctly done */
00365     return AUDIO_OK;
00366   }
00367 }
00368
00369 /**
00370   * @brief  Enables or disables the MUTE mode by software
00371   * @param  Cmd: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to
00372   *         unmute the codec and restore previous volume level.
00373   * @retval AUDIO_OK if correct communication, else wrong communication
00374   */
00375 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
00376 {
00377   /* Call the Codec Mute function */
00378   if(audio_drv->SetMute(AUDIO_I2C_ADDRESS, Cmd) != 0)
00379   {
00380     return AUDIO_ERROR;
00381   }
00382   else
00383   {
00384     /* Return AUDIO_OK when all operations are correctly done */
00385     return AUDIO_OK;
00386   }
00387 }
00388
00389 /**
00390   * @brief  Switch dynamically (while audio file is played) the output target
00391   *         (speaker or headphone).
00392   * @param  Output: The audio output target: OUTPUT_DEVICE_SPEAKER,
00393   *         OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
00394   * @retval AUDIO_OK if correct communication, else wrong communication
00395   */
00396 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output)
00397 {
00398   /* Call the Codec output device function */
00399   if(audio_drv->SetOutputMode(AUDIO_I2C_ADDRESS, Output) != 0)
00400   {
00401     return AUDIO_ERROR;
00402   }
00403   else
00404   {
00405     /* Return AUDIO_OK when all operations are correctly done */
00406     return AUDIO_OK;
00407   }
00408 }
00409
00410 /**
00411   * @brief  Updates the audio frequency.
00412   * @param  AudioFreq: Audio frequency used to play the audio stream.
00413   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00414   *         audio frequency.
00415   * @retval None
00416   */
00417 void BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq)
00418 {
00419   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00420   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00421
00422   /* Disable SAI peripheral to allow access to SAI internal registers */
00423   __HAL_SAI_DISABLE(&haudio_out_sai);
00424
00425   /* Update the SAI audio frequency configuration */
00426   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00427   HAL_SAI_Init(&haudio_out_sai);
00428
00429   /* Enable SAI peripheral to generate MCLK */
00430   __HAL_SAI_ENABLE(&haudio_out_sai);
00431 }
00432
00433 /**
00434   * @brief  Updates the Audio frame slot configuration.
00435   * @param  AudioFrameSlot: specifies the audio Frame slot
00436   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00437   *         audio frame slot.
00438   * @retval None
00439   */
00440 void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
00441 {
00442   /* Disable SAI peripheral to allow access to SAI internal registers */
00443   __HAL_SAI_DISABLE(&haudio_out_sai);
00444
00445   /* Update the SAI audio frame slot configuration */
00446   haudio_out_sai.SlotInit.SlotActive = AudioFrameSlot;
00447   HAL_SAI_Init(&haudio_out_sai);
00448
00449   /* Enable SAI peripheral to generate MCLK */
00450   __HAL_SAI_ENABLE(&haudio_out_sai);
00451 }
00452
00453 /**
00454   * @brief  De-initializes the audio out peripheral.
00455   * @retval None
00456   */
00457 void BSP_AUDIO_OUT_DeInit(void)
00458 {
00459   SAIx_Out_DeInit(&haudio_out_sai);
00460   /* DeInit the SAI MSP : this __weak function can be rewritten by the application */
00461   BSP_AUDIO_OUT_MspDeInit(&haudio_out_sai, NULL);
00462 }
00463
00464 /**
00465   * @brief  Manages the DMA full Transfer complete event.
00466   * @retval None
00467   */
00468 __weak void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
00469 {
00470 }
00471
00472 /**
00473   * @brief  Manages the DMA Half Transfer complete event.
00474   * @retval None
00475   */
00476 __weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
00477 {
00478 }
00479
00480 /**
00481   * @brief  Manages the DMA FIFO error event.
00482   * @retval None
00483   */
00484 __weak void BSP_AUDIO_OUT_Error_CallBack(void)
00485 {
00486 }
00487
00488 /**
00489   * @brief  Initializes BSP_AUDIO_OUT MSP.
00490   * @param  hsai: SAI handle
00491   * @param  Params: pointer on additional configuration parameters, can be NULL.
00492   * @retval None
00493   */
00494 __weak void BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params)
00495 {
00496   static DMA_HandleTypeDef hdma_sai_tx;
00497   GPIO_InitTypeDef  gpio_init_structure;
00498
00499   /* Enable SAI clock */
00500   AUDIO_OUT_SAIx_CLK_ENABLE();
00501
00502   /* CODEC_SAI pins configuration: FS, SCK and SD pins */
00503   /* Enable FS, SCK and SD clocks */
00504   AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE();
00505   /* Enable FS, SCK and SD pins */
00506   gpio_init_structure.Pin = AUDIO_OUT_SAIx_FS_PIN | AUDIO_OUT_SAIx_SCK_PIN | AUDIO_OUT_SAIx_SD_PIN;
00507   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00508   gpio_init_structure.Pull = GPIO_NOPULL;
00509   gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00510   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_AF;
00511   HAL_GPIO_Init(AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT, &gpio_init_structure);
00512
00513   /* Enable MCLK clock */
00514   AUDIO_OUT_SAIx_MCLK_ENABLE();
00515   /* Enable MCLK pin */
00516   gpio_init_structure.Pin = AUDIO_OUT_SAIx_MCLK_PIN;
00517   HAL_GPIO_Init(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, &gpio_init_structure);
00518
00519   /* Enable the DMA clock */
00520   AUDIO_OUT_SAIx_DMAx_CLK_ENABLE();
00521
00522   if(hsai->Instance == AUDIO_OUT_SAIx)
00523   {
00524     /* Configure the hdma_saiTx handle parameters */
00525     hdma_sai_tx.Init.Request             = AUDIO_OUT_SAIx_DMAx_REQUEST;
00526     hdma_sai_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00527     hdma_sai_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
00528     hdma_sai_tx.Init.MemInc              = DMA_MINC_ENABLE;
00529     hdma_sai_tx.Init.PeriphDataAlignment = AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE;
00530     hdma_sai_tx.Init.MemDataAlignment    = AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE;
00531     hdma_sai_tx.Init.Mode                = DMA_CIRCULAR;
00532     hdma_sai_tx.Init.Priority            = DMA_PRIORITY_HIGH;
00533     hdma_sai_tx.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00534     hdma_sai_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00535     hdma_sai_tx.Init.MemBurst            = DMA_MBURST_SINGLE;
00536     hdma_sai_tx.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00537
00538     hdma_sai_tx.Instance = AUDIO_OUT_SAIx_DMAx_STREAM;
00539
00540     /* Associate the DMA handle */
00541     __HAL_LINKDMA(hsai, hdmatx, hdma_sai_tx);
00542
00543     /* Deinitialize the Stream for new transfer */
00544     HAL_DMA_DeInit(&hdma_sai_tx);
00545
00546     /* Configure the DMA Stream */
00547     HAL_DMA_Init(&hdma_sai_tx);
00548   }
00549
00550   /* SAI DMA IRQ Channel configuration */
00551   HAL_NVIC_SetPriority(AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_IRQ_PREPRIO, 0);
00552   HAL_NVIC_EnableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
00553 }
00554
00555 /**
00556   * @brief  Deinitializes SAI MSP.
00557   * @param  hsai: SAI handle
00558   * @param  Params: pointer on additional configuration parameters, can be NULL.
00559   * @retval None
00560   */
00561 __weak void BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
00562 {
00563     GPIO_InitTypeDef  gpio_init_structure;
00564
00565     /* SAI DMA IRQ Channel deactivation */
00566     HAL_NVIC_DisableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
00567
00568     if(hsai->Instance == AUDIO_OUT_SAIx)
00569     {
00570       /* Deinitialize the DMA stream */
00571       HAL_DMA_DeInit(hsai->hdmatx);
00572     }
00573
00574     /* Disable SAI peripheral */
00575     __HAL_SAI_DISABLE(hsai);
00576
00577     /* Deactivates CODEC_SAI pins FS, SCK, MCK and SD by putting them in input mode */
00578     gpio_init_structure.Pin = AUDIO_OUT_SAIx_FS_PIN | AUDIO_OUT_SAIx_SCK_PIN | AUDIO_OUT_SAIx_SD_PIN;
00579     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT, gpio_init_structure.Pin);
00580
00581     gpio_init_structure.Pin = AUDIO_OUT_SAIx_MCLK_PIN;
00582     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, gpio_init_structure.Pin);
00583
00584     /* Disable SAI clock */
00585     AUDIO_OUT_SAIx_CLK_DISABLE();
00586
00587     /* GPIO pins clock and DMA clock can be shut down in the applic
00588        by surcharging this __weak function */
00589 }
00590
00591 /**
00592   * @brief  Clock Config.
00593   * @param  hsai: might be required to set audio peripheral predivider if any.
00594   * @param  AudioFreq: Audio frequency used to play the audio stream.
00595   * @param  Params: pointer on additional configuration parameters, can be NULL.
00596   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
00597   *         Being __weak it can be overwritten by the application
00598   * @retval None
00599   */
00600 __weak void BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
00601 {
00602   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00603
00604   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00605
00606   /* Set the PLL configuration according to the audio frequency */
00607   if((AudioFreq == AUDIO_FREQUENCY_11K) || (AudioFreq == AUDIO_FREQUENCY_22K) || (AudioFreq == AUDIO_FREQUENCY_44K))
00608   {
00609     /* SAI clock config:
00610        PLL2_VCO Input = HSE_VALUE/PLL2M = 1 Mhz
00611        PLL2_VCO Output = PLL2_VCO Input * PLL2N = 429 Mhz
00612        SAI_CLK_x = PLL2_VCO Output/PLL2P = 429/38 = 11.289 Mhz */
00613     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
00614     rcc_ex_clk_init_struct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLL2;
00615     rcc_ex_clk_init_struct.PLL2.PLL2P = 38;
00616     rcc_ex_clk_init_struct.PLL2.PLL2Q = 1;
00617     rcc_ex_clk_init_struct.PLL2.PLL2R = 1;
00618     rcc_ex_clk_init_struct.PLL2.PLL2N = 429;
00619     rcc_ex_clk_init_struct.PLL2.PLL2M = 25;
00620     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00621   }
00622   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_48K, AUDIO_FREQUENCY_96K */
00623   {
00624     /* SAI clock config:
00625        PLL2_VCO Input = HSE_VALUE/PLL2M = 1 Mhz
00626        PLL2_VCO Output = PLL2_VCO Input * PLL2N = 344 Mhz
00627        SAI_CLK_x = PLL2_VCO Output/PLL2P = 344/7 = 49.142 Mhz */
00628     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
00629     rcc_ex_clk_init_struct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLL2;
00630     rcc_ex_clk_init_struct.PLL2.PLL2P = 7;
00631     rcc_ex_clk_init_struct.PLL2.PLL2Q = 1;
00632     rcc_ex_clk_init_struct.PLL2.PLL2R = 1;
00633     rcc_ex_clk_init_struct.PLL2.PLL2N = 344;
00634     rcc_ex_clk_init_struct.PLL2.PLL2M = 25;
00635     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00636   }
00637 }
00638 /**
00639   * @}
00640   */
00641
00642 /** @defgroup STM32H747I_DISCOVERY_AUDIO_OUT_Private_Functions OUT Private Functions
00643   * @{
00644   */
00645
00646 /*******************************************************************************
00647                             HAL Callbacks
00648 *******************************************************************************/
00649 /**
00650   * @brief  Tx Transfer completed callbacks.
00651   * @param  hsai: SAI handle
00652   * @retval None
00653   */
00654 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
00655 {
00656   /* Manage the remaining file size and new address offset: This function
00657      should be coded by user (its prototype is already declared in stm32h747i_discovery_audio.h) */
00658   BSP_AUDIO_OUT_TransferComplete_CallBack();
00659 }
00660
00661 /**
00662   * @brief  Tx Half Transfer completed callbacks.
00663   * @param  hsai: SAI handle
00664   * @retval None
00665   */
00666 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
00667 {
00668   /* Manage the remaining file size and new address offset: This function
00669      should be coded by user (its prototype is already declared in stm32h747i_discovery_audio.h) */
00670   BSP_AUDIO_OUT_HalfTransfer_CallBack();
00671 }
00672
00673 /**
00674   * @brief  SAI error callbacks.
00675   * @param  hsai: SAI handle
00676   * @retval None
00677   */
00678 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
00679 {
00680   if(hsai->Instance == AUDIO_OUT_SAIx)
00681   {
00682     BSP_AUDIO_OUT_Error_CallBack();
00683   }
00684   else
00685   {
00686     BSP_AUDIO_IN_Error_CallBack();
00687   }
00688 }
00689
00690 /*******************************************************************************
00691                             Static Functions
00692 *******************************************************************************/
00693
00694 /**
00695   * @brief  Initializes the Audio Codec audio interface (SAI).
00696   * @param  SaiOutMode: Audio mode to be configured for the SAI peripheral.
00697   * @param  SlotActive: Audio active slot to be configured for the SAI peripheral.
00698   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00699   * @note   The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123
00700   *         and user can update this configuration using
00701   * @retval None
00702   */
00703 static void SAIx_Out_Init(uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
00704 {
00705   /* Disable SAI peripheral to allow access to SAI internal registers */
00706   __HAL_SAI_DISABLE(&haudio_out_sai);
00707
00708   /* Configure SAI_Block_x
00709   LSBFirst: Disabled
00710   DataSize: 16 */
00711   haudio_out_sai.Init.MonoStereoMode = SAI_STEREOMODE;
00712   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00713   haudio_out_sai.Init.AudioMode = SaiOutMode;
00714   haudio_out_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;
00715   haudio_out_sai.Init.Protocol = SAI_FREE_PROTOCOL;
00716   haudio_out_sai.Init.DataSize = SAI_DATASIZE_16;
00717   haudio_out_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
00718   haudio_out_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_RISINGEDGE;
00719   haudio_out_sai.Init.Synchro = SAI_ASYNCHRONOUS;
00720   haudio_out_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE;
00721   haudio_out_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
00722   haudio_out_sai.Init.SynchroExt     = SAI_SYNCEXT_DISABLE;
00723   haudio_out_sai.Init.CompandingMode = SAI_NOCOMPANDING;
00724   haudio_out_sai.Init.TriState       = SAI_OUTPUT_NOTRELEASED;
00725   haudio_out_sai.Init.Mckdiv         = 0;
00726   haudio_out_sai.Init.MckOverSampling = SAI_MCK_OVERSAMPLING_DISABLE;
00727   haudio_out_sai.Init.PdmInit.Activation = DISABLE;
00728   haudio_out_sai.Init.PdmInit.ClockEnable = 0;
00729   haudio_out_sai.Init.PdmInit.MicPairsNbr = 0;
00730
00731   /* Configure SAI_Block_x Frame
00732   Frame Length: 64
00733   Frame active Length: 32
00734   FS Definition: Start frame + Channel Side identification
00735   FS Polarity: FS active Low
00736   FS Offset: FS asserted one bit before the first bit of slot 0 */
00737   haudio_out_sai.FrameInit.FrameLength = 128;
00738   haudio_out_sai.FrameInit.ActiveFrameLength = 64;
00739   haudio_out_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
00740   haudio_out_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
00741   haudio_out_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
00742
00743   /* Configure SAI Block_x Slot
00744   Slot First Bit Offset: 0
00745   Slot Size  : 16
00746   Slot Number: 4
00747   Slot Active: All slot actives */
00748   haudio_out_sai.SlotInit.FirstBitOffset = 0;
00749   haudio_out_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
00750   haudio_out_sai.SlotInit.SlotNumber = 4;
00751   haudio_out_sai.SlotInit.SlotActive = SlotActive;
00752   HAL_SAI_Init(&haudio_out_sai);
00753
00754   /* Enable SAI peripheral to generate MCLK */
00755   __HAL_SAI_ENABLE(&haudio_out_sai);
00756 }
00757
00758 /**
00759   * @brief  Deinitializes the Audio Codec audio interface (SAI).
00760   * @retval None
00761   */
00762 static void SAIx_Out_DeInit(SAI_HandleTypeDef *hsai)
00763 {
00764   /* Disable SAI peripheral */
00765   __HAL_SAI_DISABLE(hsai);
00766
00767   HAL_SAI_DeInit(hsai);
00768 }
00769
00770 /**
00771   * @}
00772   */
00773
00774 /** @defgroup STM32H747I_DISCOVERY_AUDIO_IN_Exported_Functions IN Exported Functions
00775   * @{
00776   */
00777
00778 /**
00779   * @brief  Initialize wave recording.
00780   * @param  AudioFreq: Audio frequency to be configured for the DFSDM peripheral.
00781   * @param  BitRes: Audio frequency to be configured for the DFSDM peripheral.
00782   * @param  ChnlNbr: Audio frequency to be configured for the DFSDM peripheral.
00783   * @retval AUDIO_OK if correct communication, else wrong communication
00784   */
00785 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00786 {
00787   /* Set audio in interface to default one */
00788   BSP_AUDIO_IN_SelectInterface(AUDIO_IN_INTERFACE_PDM);
00789   return  BSP_AUDIO_IN_InitEx(INPUT_DEVICE_DIGITAL_MIC, AudioFreq, BitRes, ChnlNbr);
00790 }
00791
00792 /**
00793   * @brief  Initialize wave recording.
00794   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MIC or INPUT_DEVICE_ANALOG_MIC.
00795   * @param  AudioFreq: Audio frequency to be configured.
00796   * @param  BitRes: Audio bit resolution to be configured..
00797   * @param  ChnlNbr: Number of channel to be configured.
00798   * @retval AUDIO_OK if correct communication, else wrong communication
00799   */
00800 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00801 {
00802   uint8_t ret = AUDIO_OK;
00803   uint32_t slot_active;
00804
00805   /* Store the audio record context */
00806   hAudioIn.Frequency     = AudioFreq;
00807   hAudioIn.BitResolution = BitRes;
00808   hAudioIn.InputDevice = InputDevice;
00809   hAudioIn.ChannelNbr = ChnlNbr;
00810
00811   if(hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC)
00812   {
00813     if(hAudioIn.Interface == AUDIO_IN_INTERFACE_SAI)
00814     {
00815       /* Initialize SAI1 block B as SLAVE RX synchrounous with SAI1 block A */
00816       haudio_in_sai.Instance = AUDIO_IN_SAIx;
00817
00818       /* Disable SAI */
00819       SAIx_In_DeInit(&haudio_in_sai);
00820
00821       /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00822       BSP_AUDIO_IN_ClockConfig(AudioFreq, NULL); /* Clock config is shared between AUDIO IN and OUT */
00823
00824       /* SAI data transfer preparation:
00825       Prepare the Media to be used for the audio transfer from SAI peripheral to memory */
00826       if(HAL_SAI_GetState(&haudio_in_sai) == HAL_SAI_STATE_RESET)
00827       {
00828         /* Init the SAI MSP: this __weak function can be redefined by the application*/
00829         BSP_AUDIO_IN_MspInit();
00830       }
00831
00832       /* Configure SAI in master mode :
00833        *   - SAI1_block_B in slave RX mode synchronous from SAI1_block_A
00834        */
00835       slot_active = CODEC_AUDIOFRAME_SLOT_13;
00836       SAIx_In_Init(SAI_MODESLAVE_RX, slot_active, AudioFreq);
00837     }
00838     else if(hAudioIn.Interface == AUDIO_IN_INTERFACE_PDM)
00839     {
00840       /* Initialize SAI1 block A as MASTER RX */
00841       haudio_in_sai.Instance = AUDIO_IN_SAI_PDMx;
00842
00843       /* Disable SAI */
00844       SAIx_In_DeInit(&haudio_in_sai);
00845
00846       /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00847       BSP_AUDIO_IN_ClockConfig(AudioFreq, NULL);
00848
00849       /* SAI data transfer preparation:
00850       Prepare the Media to be used for the audio transfer from SAI peripheral to memory */
00851       /* Initialize the haudio_in_sai Instance parameter */
00852
00853       if(HAL_SAI_GetState(&haudio_in_sai) == HAL_SAI_STATE_RESET)
00854       {
00855         /* Init the SAI MSP: this __weak function can be redefined by the application*/
00856         BSP_AUDIO_IN_MspInit();
00857       }
00858
00859       /* Configure SAI in master mode :
00860        *   - SAI1_block_A in master RX mode
00861        */
00862       slot_active = CODEC_AUDIOFRAME_SLOT_0;
00863       SAIx_In_Init(SAI_MODEMASTER_RX, slot_active, AudioFreq);
00864
00865       if(BSP_AUDIO_IN_PDMToPCM_Init(AudioFreq, hAudioIn.ChannelNbr, hAudioIn.ChannelNbr) != AUDIO_OK)
00866       {
00867         ret = AUDIO_ERROR;
00868       }
00869     }
00870     else
00871     {
00872       ret = AUDIO_ERROR;
00873     }
00874   }
00875   else
00876   {
00877     /* Analog Input */
00878     ret = AUDIO_ERROR;
00879   }
00880
00881   /* Return AUDIO_OK when all operations are correctly done */
00882   return ret;
00883 }
00884
00885 /**
00886   * @brief  Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
00887   * @param  InputDevice: The microphone to be configured. Can be INPUT_DEVICE_DIGITAL_MIC1..INPUT_DEVICE_DIGITAL_MIC5
00888   * @param  Params: pointer on additional configuration parameters, can be NULL.
00889   * @retval AUDIO_OK if correct communication, else wrong communication
00890   */
00891 __weak uint8_t BSP_AUDIO_IN_ConfigDigitalMic(uint32_t InputDevice, void *Params)
00892 {
00893   /* Prevent unused argument(s) compilation warning */
00894   UNUSED(Params);
00895
00896   /* Default configuration of DFSDM filters and channels */
00897   return(BSP_AUDIO_IN_ConfigMicDefault(InputDevice));
00898   /* Note: This function can be called at application level and default configuration
00899            can be ovewritten to fit user's need */
00900 }
00901
00902 /**
00903   * @brief  Initializes wave recording and playback in parallel.
00904   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MICROPHONE_2
00905   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00906   *                       or OUTPUT_DEVICE_BOTH.
00907   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00908   * @param  BitRes: Audio frequency to be configured.
00909   * @param  ChnlNbr: Channel number.
00910   * @retval AUDIO_OK if correct communication, else wrong communication
00911   */
00912 uint8_t BSP_AUDIO_IN_OUT_Init(uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00913 {
00914   uint32_t slot_active;
00915   uint32_t deviceid = 0, ret = AUDIO_OK;
00916
00917   /* Store the audio record context */
00918   hAudioIn.Frequency     = AudioFreq;
00919   hAudioIn.BitResolution = BitRes;
00920   hAudioIn.InputDevice = InputDevice;
00921   hAudioIn.ChannelNbr = ChnlNbr;
00922
00923   /* Input device is Digital MIC2 and Codec interface is SAI */
00924   if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MICROPHONE_2)
00925   {
00926     haudio_in_sai.Instance = AUDIO_IN_SAIx;
00927     haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00928
00929     /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00930     BSP_AUDIO_OUT_ClockConfig(&haudio_in_sai, AudioFreq, NULL);
00931     /* SAI data transfer preparation:
00932     Prepare the Media to be used for the audio transfer from SAI peripheral to memory */
00933     if(HAL_SAI_GetState(&haudio_in_sai) == HAL_SAI_STATE_RESET)
00934     {
00935       /* Init the SAI MSP: this __weak function can be redefined by the application*/
00936       BSP_AUDIO_IN_MspInit();
00937     }
00938
00939     /* SAI data transfer preparation:
00940     Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00941     if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00942     {
00943       /* Init the SAI MSP: this __weak function can be redefined by the application*/
00944       BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00945     }
00946
00947     /* Configure SAI in master TX mode :
00948     *   - SAI1_block_A in master TX mode
00949     *   - SAI1_block_B in slave RX mode synchronous from SAI1_block_A
00950     */
00951     slot_active = CODEC_AUDIOFRAME_SLOT_13;
00952     SAIx_In_Init(SAI_MODESLAVE_RX, slot_active, AudioFreq);
00953
00954     slot_active = CODEC_AUDIOFRAME_SLOT_02;
00955     SAIx_Out_Init(SAI_MODEMASTER_TX, slot_active, AudioFreq);
00956
00957     /* wm8994 codec initialization */
00958     deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00959
00960     if((deviceid) == WM8994_ID)
00961     {
00962       /* Reset the Codec Registers */
00963       wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00964       /* Initialize the audio driver structure */
00965       audio_drv = &wm8994_drv;
00966       ret = AUDIO_OK;
00967     }
00968     else
00969     {
00970       ret = AUDIO_ERROR;
00971     }
00972
00973     if(ret == AUDIO_OK)
00974     {
00975       /* Initialize the codec internal registers */
00976       audio_drv->Init(AUDIO_I2C_ADDRESS, InputDevice|OutputDevice, 90, AudioFreq);
00977     }
00978   }
00979   else
00980   {
00981     ret = AUDIO_ERROR;
00982   }
00983
00984   /* Return AUDIO_OK when all operations are correctly done */
00985   return ret;
00986 }
00987
00988 /**
00989   * @brief  Link digital mic to specified source
00990   * @param  Interface : Audio In interface for Digital mic. It can be:
00991   *                       AUDIO_IN_INTERFACE_SAI
00992   *                       AUDIO_IN_INTERFACE_PDM
00993   * @retval None
00994   */
00995 void BSP_AUDIO_IN_SelectInterface(uint32_t Interface)
00996 {
00997   hAudioIn.Interface = Interface;
00998 }
00999
01000 /**
01001   * @brief  Get digital mic interface
01002   * @retval Digital mic interface.
01003   */
01004 uint32_t BSP_AUDIO_IN_GetInterface(void)
01005 {
01006   return (hAudioIn.Interface);
01007 }
01008
01009 /**
01010   * @brief  Return audio in channel number
01011   * @retval Number of channel
01012   */
01013 uint8_t BSP_AUDIO_IN_GetChannelNumber(void)
01014 {
01015   return hAudioIn.ChannelNbr;
01016 }
01017
01018 /**
01019   * @brief  Start audio recording.
01020   * @param  pBuf: Main buffer pointer for the recorded data storing
01021   * @param  size: Current size of the recorded buffer
01022   * @retval AUDIO_OK if correct communication, else wrong communication
01023   */
01024 uint8_t BSP_AUDIO_IN_Record(uint16_t *pBuf, uint32_t size)
01025 {
01026   /* Start the process receive DMA */
01027   if(HAL_OK != HAL_SAI_Receive_DMA(&haudio_in_sai, (uint8_t*)pBuf, size))
01028   {
01029     return AUDIO_ERROR;
01030   }
01031
01032   /* Return AUDIO_OK when all operations are correctly done */
01033   return AUDIO_OK;
01034 }
01035
01036 /**
01037   * @brief  Stop audio recording.
01038   * @retval AUDIO_OK if correct communication, else wrong communication
01039   */
01040 uint8_t BSP_AUDIO_IN_Stop(void)
01041 {
01042   /* Call the Media layer stop function */
01043   HAL_SAI_DMAStop(&haudio_in_sai);
01044
01045   /* Return AUDIO_OK when all operations are correctly done */
01046   return AUDIO_OK;
01047 }
01048
01049 /**
01050   * @brief  Pause the audio file stream.
01051   * @retval AUDIO_OK if correct communication, else wrong communication
01052   */
01053 uint8_t BSP_AUDIO_IN_Pause(void)
01054 {
01055   if (hAudioIn.InputDevice == INPUT_DEVICE_ANALOG_MIC)
01056   {
01057     return AUDIO_ERROR;
01058   }
01059   else
01060   {
01061      /* Call the Media layer pause function */
01062     HAL_SAI_DMAPause(&haudio_in_sai);
01063   }
01064
01065   /* Return AUDIO_OK when all operations are correctly done */
01066   return AUDIO_OK;
01067 }
01068
01069 /**
01070   * @brief  Resume the audio file stream.
01071   * @retval AUDIO_OK if correct communication, else wrong communication
01072   */
01073 uint8_t BSP_AUDIO_IN_Resume(void)
01074 {
01075   if (hAudioIn.InputDevice == INPUT_DEVICE_ANALOG_MIC)
01076   {
01077     return AUDIO_ERROR;
01078   }
01079   else
01080   {
01081      /* Call the Media layer resume function */
01082     HAL_SAI_DMAResume(&haudio_in_sai);
01083   }
01084
01085   /* Return AUDIO_OK when all operations are correctly done */
01086   return AUDIO_OK;
01087 }
01088
01089 /**
01090   * @brief  Controls the audio in volume level.
01091   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
01092   *         Mute and 100 for Max volume level).
01093   * @retval AUDIO_OK if correct communication, else wrong communication
01094   */
01095 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume)
01096 {
01097   /* Set the Global variable AudioInVolume  */
01098   AudioInVolume = Volume;
01099
01100   /* Return AUDIO_OK when all operations are correctly done */
01101   return AUDIO_OK;
01102 }
01103
01104 /**
01105   * @brief  Deinit the audio IN peripherals.
01106   * @retval None
01107   */
01108 void BSP_AUDIO_IN_DeInit(void)
01109 {
01110   SAIx_In_DeInit(&haudio_in_sai);
01111
01112   BSP_AUDIO_IN_MspDeInit();
01113 }
01114
01115 /**
01116 * @brief  Initialize the PDM library.
01117 * @param  AudioFreq: Audio sampling frequency
01118 * @param  ChnlNbrIn: Number of input audio channels in the PDM buffer
01119 * @param  ChnlNbrOut: Number of desired output audio channels in the  resulting PCM buffer
01120 * @retval None
01121 */
01122 uint8_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
01123 {
01124   uint32_t index = 0;
01125
01126   /* Enable CRC peripheral to unlock the PDM library */
01127   __HAL_RCC_CRC_CLK_ENABLE();
01128
01129   for(index = 0; index < ChnlNbrIn; index++)
01130   {
01131     /* Init PDM filters */
01132     PDM_FilterHandler[index].bit_order  = PDM_FILTER_BIT_ORDER_MSB;
01133     PDM_FilterHandler[index].endianness = PDM_FILTER_ENDIANNESS_LE;
01134     PDM_FilterHandler[index].high_pass_tap = 2122358088;
01135     PDM_FilterHandler[index].out_ptr_channels = ChnlNbrOut;
01136     PDM_FilterHandler[index].in_ptr_channels  = ChnlNbrIn;
01137     PDM_Filter_Init((PDM_Filter_Handler_t *)(&PDM_FilterHandler[index]));
01138
01139     /* PDM lib config phase */
01140     PDM_FilterConfig[index].output_samples_number = AudioFreq/1000;
01141     PDM_FilterConfig[index].mic_gain = 24;
01142     PDM_FilterConfig[index].decimation_factor = PDM_FILTER_DEC_FACTOR_64;
01143     PDM_Filter_setConfig((PDM_Filter_Handler_t *)&PDM_FilterHandler[index], &PDM_FilterConfig[index]);
01144   }
01145
01146   return AUDIO_OK;
01147 }
01148
01149
01150 /**
01151 * @brief  Converts audio format from PDM to PCM.
01152
01153 * @param  PDMBuf: Pointer to PDM buffer data
01154 * @param  PCMBuf: Pointer to PCM buffer data
01155 * @retval AUDIO_OK in case of success, AUDIO_ERROR otherwise
01156 */
01157 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf)
01158 {
01159   uint32_t index = 0;
01160
01161   for(index = 0; index < hAudioIn.ChannelNbr; index++)
01162   {
01163     PDM_Filter(&((uint8_t*)(PDMBuf))[index], (uint16_t*)&(PCMBuf[index]), &PDM_FilterHandler[index]);
01164   }
01165
01166   return AUDIO_OK;
01167 }
01168
01169 /**
01170   * @brief  User callback when record buffer is filled.
01171   * @retval None
01172   */
01173 __weak void BSP_AUDIO_IN_TransferComplete_CallBack(void)
01174 {
01175   /* This function should be implemented by the user application.
01176      It is called into this driver when the current buffer is filled
01177      to prepare the next buffer pointer and its size. */
01178 }
01179
01180 /**
01181   * @brief  Manages the DMA Half Transfer complete event.
01182   * @retval None
01183   */
01184 __weak void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
01185 {
01186   /* This function should be implemented by the user application.
01187      It is called into this driver when the current buffer is filled
01188      to prepare the next buffer pointer and its size. */
01189 }
01190
01191 /**
01192   * @brief  User callback when record buffer is filled.
01193   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MIC1 or INPUT_DEVICE_DIGITAL_MIC2
01194   */
01195 __weak void BSP_AUDIO_IN_TransferComplete_CallBackEx(uint32_t InputDevice)
01196 {
01197   /* This function should be implemented by the user application.
01198      It is called into this driver when the current buffer is filled
01199      to prepare the next buffer pointer and its size. */
01200 }
01201
01202 /**
01203   * @brief  User callback when record buffer is filled.
01204   * @param InputDevice: INPUT_DEVICE_DIGITAL_MIC1 or INPUT_DEVICE_DIGITAL_MIC2
01205   */
01206 __weak void BSP_AUDIO_IN_HalfTransfer_CallBackEx(uint32_t InputDevice)
01207 {
01208   /* This function should be implemented by the user application.
01209      It is called into this driver when the current buffer is filled
01210      to prepare the next buffer pointer and its size. */
01211 }
01212
01213 /**
01214   * @brief  Audio IN Error callback function.
01215   * @retval None
01216   */
01217 __weak void BSP_AUDIO_IN_Error_CallBack(void)
01218 {
01219   /* This function is called when an Interrupt due to transfer error on or peripheral
01220      error occurs. */
01221 }
01222
01223 /**
01224   * @brief  Initialize BSP_AUDIO_IN MSP.
01225   * @retval None
01226   */
01227 __weak void BSP_AUDIO_IN_MspInit(void)
01228 {
01229   SAIx_In_MspInit(&haudio_in_sai, NULL);
01230 }
01231
01232 /**
01233   * @brief  DeInitialize BSP_AUDIO_IN MSP.
01234   * @retval None
01235   */
01236 __weak void BSP_AUDIO_IN_MspDeInit(void)
01237 {
01238   SAIx_In_MspDeInit(&haudio_in_sai, NULL);
01239 }
01240
01241 /**
01242   * @brief  Clock Config.
01243   * @param  AudioFreq: Audio frequency used to play the audio stream.
01244   * @param  Params: pointer on additional configuration parameters, can be NULL.
01245   * @note   This API is called by BSP_AUDIO_IN_Init()
01246   *         Being __weak it can be overwritten by the application
01247   * @retval None
01248   */
01249 __weak void BSP_AUDIO_IN_ClockConfig(uint32_t AudioFreq, void *Params)
01250 {
01251   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
01252
01253   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
01254
01255   /* Set the PLL configuration according to the audio frequency */
01256   if((AudioFreq == AUDIO_FREQUENCY_11K) || (AudioFreq == AUDIO_FREQUENCY_22K) || (AudioFreq == AUDIO_FREQUENCY_44K))
01257   {
01258     /* SAI clock config:
01259        PLL2_VCO Input = HSE_VALUE/PLL2M = 1 Mhz
01260        PLL2_VCO Output = PLL2_VCO Input * PLL2N = 429 Mhz
01261        SAI_CLK_x = PLL2_VCO Output/PLL2P = 429/38 = 11.289 Mhz */
01262     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
01263     rcc_ex_clk_init_struct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLL2;
01264     rcc_ex_clk_init_struct.PLL2.PLL2P = 38;
01265     rcc_ex_clk_init_struct.PLL2.PLL2Q = 1;
01266     rcc_ex_clk_init_struct.PLL2.PLL2R = 1;
01267     rcc_ex_clk_init_struct.PLL2.PLL2N = 429;
01268     rcc_ex_clk_init_struct.PLL2.PLL2M = 25;
01269     if (hAudioIn.Interface == AUDIO_IN_INTERFACE_PDM)
01270     {
01271       rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI4A;
01272       rcc_ex_clk_init_struct.Sai4AClockSelection = RCC_SAI4ACLKSOURCE_PLL2;
01273     }
01274     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
01275
01276   }
01277   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_32K, AUDIO_FREQUENCY_48K, AUDIO_FREQUENCY_96K */
01278   {
01279     /* SAI clock config:
01280        PLL2_VCO Input = HSE_VALUE/PLL2M = 1 Mhz
01281        PLL2_VCO Output = PLL2_VCO Input * PLL2N = 344 Mhz
01282        SAI_CLK_x = PLL2_VCO Output/PLL2P = 344/7 = 49.142 Mhz */
01283     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
01284     rcc_ex_clk_init_struct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLL2;
01285     rcc_ex_clk_init_struct.PLL2.PLL2P = 7;
01286     rcc_ex_clk_init_struct.PLL2.PLL2Q = 1;
01287     rcc_ex_clk_init_struct.PLL2.PLL2R = 1;
01288     rcc_ex_clk_init_struct.PLL2.PLL2N = 344;
01289     rcc_ex_clk_init_struct.PLL2.PLL2M = 25;
01290     if (hAudioIn.Interface == AUDIO_IN_INTERFACE_PDM)
01291     {
01292       rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI4A;
01293       rcc_ex_clk_init_struct.Sai4AClockSelection = RCC_SAI4ACLKSOURCE_PLL2;
01294     }
01295     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
01296   }
01297 }
01298 /**
01299   * @}
01300   */
01301
01302
01303 /** @defgroup STM32H747I_DISCOVERY_AUDIO_IN_Private_Functions IN Private Functions
01304   * @{
01305   */
01306
01307 /*******************************************************************************
01308                             HAL Callbacks
01309 *******************************************************************************/
01310
01311 /**
01312   * @brief  Half reception complete callback.
01313   * @param  hsai: SAI handle.
01314   * @retval None
01315   */
01316 void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
01317 {
01318   /* Manage the remaining file size and new address offset: This function should be coded by user */
01319   BSP_AUDIO_IN_HalfTransfer_CallBack();
01320 }
01321
01322 /**
01323   * @brief  Reception complete callback.
01324   * @param  hsai: SAI handle.
01325   * @retval None
01326   */
01327 void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
01328 {
01329   /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
01330   BSP_AUDIO_IN_TransferComplete_CallBack();
01331 }
01332
01333 /*******************************************************************************
01334                             Static Functions
01335 *******************************************************************************/
01336 /**
01337   * @brief  Initializes SAI Audio IN MSP.
01338   * @param  hsai: SAI handle
01339   * @param  Params: pointer on additional configuration parameters, can be NULL.
01340   * @retval None
01341   */
01342 static void SAIx_In_MspInit(SAI_HandleTypeDef *hsai, void *Params)
01343 {
01344   static DMA_HandleTypeDef hdma_sai_rx;
01345   GPIO_InitTypeDef  gpio_init_structure;
01346
01347   if(hsai->Instance == AUDIO_IN_SAI_PDMx)
01348   {
01349      /* Enable SAI clock */
01350     AUDIO_IN_SAI_PDMx_CLK_ENABLE();
01351
01352     AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE();
01353     AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE();
01354
01355     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_CLK_IN_PIN;
01356     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01357     gpio_init_structure.Pull = GPIO_NOPULL;
01358     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01359     gpio_init_structure.Alternate = AUDIO_IN_SAI_PDMx_DATA_CLK_AF;
01360     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_CLK_IN_PORT, &gpio_init_structure);
01361
01362     gpio_init_structure.Pull = GPIO_PULLUP;
01363     gpio_init_structure.Speed = GPIO_SPEED_FREQ_MEDIUM;
01364     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_DATA_IN_PIN;
01365     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_DATA_IN_PORT, &gpio_init_structure);
01366
01367     AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE();
01368
01369     /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
01370     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_FS_PIN | AUDIO_IN_SAI_PDMx_SCK_PIN;
01371     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01372     gpio_init_structure.Pull = GPIO_NOPULL;
01373     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01374     gpio_init_structure.Alternate = AUDIO_IN_SAI_PDMx_FS_SCK_AF;
01375     HAL_GPIO_Init(AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT, &gpio_init_structure);
01376
01377     /* Enable the DMA clock */
01378     AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE();
01379
01380     /* Configure the hdma_sai_rx handle parameters */
01381     hdma_sai_rx.Init.Request             = AUDIO_IN_SAI_PDMx_DMAx_REQUEST;
01382     hdma_sai_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01383     hdma_sai_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01384     hdma_sai_rx.Init.MemInc              = DMA_MINC_ENABLE;
01385     hdma_sai_rx.Init.PeriphDataAlignment = AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE;
01386     hdma_sai_rx.Init.MemDataAlignment    = AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE;
01387     hdma_sai_rx.Init.Mode                = DMA_CIRCULAR;
01388     hdma_sai_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01389     hdma_sai_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01390     hdma_sai_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01391     hdma_sai_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01392     hdma_sai_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01393
01394     hdma_sai_rx.Instance = AUDIO_IN_SAI_PDMx_DMAx_STREAM;
01395
01396     /* Associate the DMA handle */
01397     __HAL_LINKDMA(hsai, hdmarx, hdma_sai_rx);
01398
01399     /* Deinitialize the Stream for new transfer */
01400     HAL_DMA_DeInit(&hdma_sai_rx);
01401
01402     /* Configure the DMA Stream */
01403     HAL_DMA_Init(&hdma_sai_rx);
01404
01405     /* SAI DMA IRQ Channel configuration */
01406     HAL_NVIC_SetPriority(AUDIO_IN_SAI_PDMx_DMAx_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01407     HAL_NVIC_EnableIRQ(AUDIO_IN_SAI_PDMx_DMAx_IRQ);
01408   }
01409   else
01410   {
01411     /* Enable SAI clock */
01412     AUDIO_IN_SAIx_CLK_ENABLE();
01413
01414     /* Enable SD GPIO clock */
01415     AUDIO_IN_SAIx_SD_ENABLE();
01416     /* CODEC_SAI pin configuration: SD pin */
01417     gpio_init_structure.Pin = AUDIO_IN_SAIx_SD_PIN;
01418     gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01419     gpio_init_structure.Pull = GPIO_NOPULL;
01420     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01421     gpio_init_structure.Alternate = AUDIO_IN_SAIx_AF;
01422     HAL_GPIO_Init(AUDIO_IN_SAIx_SD_GPIO_PORT, &gpio_init_structure);
01423
01424     /* Enable Audio INT GPIO clock */
01425     AUDIO_IN_INT_GPIO_ENABLE();
01426     /* Audio INT pin configuration: input */
01427     gpio_init_structure.Pin = AUDIO_IN_INT_GPIO_PIN;
01428     gpio_init_structure.Mode = GPIO_MODE_INPUT;
01429     gpio_init_structure.Pull = GPIO_NOPULL;
01430     gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
01431     HAL_GPIO_Init(AUDIO_IN_INT_GPIO_PORT, &gpio_init_structure);
01432
01433     /* Enable the DMA clock */
01434     AUDIO_IN_SAIx_DMAx_CLK_ENABLE();
01435
01436     /* Configure the hdma_sai_rx handle parameters */
01437     hdma_sai_rx.Init.Request             = AUDIO_IN_SAIx_DMAx_REQUEST;
01438     hdma_sai_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01439     hdma_sai_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01440     hdma_sai_rx.Init.MemInc              = DMA_MINC_ENABLE;
01441     hdma_sai_rx.Init.PeriphDataAlignment = AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE;
01442     hdma_sai_rx.Init.MemDataAlignment    = AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE;
01443     hdma_sai_rx.Init.Mode                = DMA_CIRCULAR;
01444     hdma_sai_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01445     hdma_sai_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01446     hdma_sai_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01447     hdma_sai_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01448     hdma_sai_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01449
01450     hdma_sai_rx.Instance = AUDIO_IN_SAIx_DMAx_STREAM;
01451
01452     /* Associate the DMA handle */
01453     __HAL_LINKDMA(hsai, hdmarx, hdma_sai_rx);
01454
01455     /* Deinitialize the Stream for new transfer */
01456     HAL_DMA_DeInit(&hdma_sai_rx);
01457
01458     /* Configure the DMA Stream */
01459     HAL_DMA_Init(&hdma_sai_rx);
01460
01461     /* SAI DMA IRQ Channel configuration */
01462     HAL_NVIC_SetPriority(AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01463     HAL_NVIC_EnableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01464
01465     /* Audio INT IRQ Channel configuration */
01466     HAL_NVIC_SetPriority(AUDIO_IN_INT_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01467     HAL_NVIC_EnableIRQ(AUDIO_IN_INT_IRQ);
01468   }
01469 }
01470
01471 /**
01472   * @brief  De-Initializes SAI Audio IN MSP.
01473   * @param  hsai: SAI handle
01474   * @param  Params: pointer on additional configuration parameters, can be NULL.
01475   * @retval None
01476   */
01477 static void SAIx_In_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
01478 {
01479   GPIO_InitTypeDef  gpio_init_structure;
01480
01481   if(hsai->Instance == AUDIO_IN_SAI_PDMx)
01482   {
01483     /* Deinitialize the DMA stream */
01484     HAL_DMA_Abort(hsai->hdmarx);
01485
01486     HAL_SAI_DeInit(hsai);
01487     /* Disable SAI peripheral */
01488     __HAL_SAI_DISABLE(hsai);
01489
01490     /* Deinitialize the DMA stream */
01491     HAL_DMA_DeInit(hsai->hdmarx);
01492
01493     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_CLK_IN_PIN;
01494     HAL_GPIO_DeInit(AUDIO_IN_SAI_PDMx_CLK_IN_PORT, gpio_init_structure.Pin);
01495
01496     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_DATA_IN_PIN;
01497     HAL_GPIO_DeInit(AUDIO_IN_SAI_PDMx_DATA_IN_PORT, gpio_init_structure.Pin);
01498
01499     /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
01500     gpio_init_structure.Pin = AUDIO_IN_SAI_PDMx_FS_PIN | AUDIO_IN_SAI_PDMx_SCK_PIN;
01501     HAL_GPIO_DeInit(AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT, gpio_init_structure.Pin);
01502
01503     /* Disable SAI clock */
01504     AUDIO_IN_SAI_PDMx_CLK_DISABLE();
01505   }
01506   else
01507   {
01508     /* SAI DMA IRQ Channel deactivation */
01509     HAL_NVIC_DisableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01510
01511     if(hsai->Instance == AUDIO_IN_SAIx)
01512     {
01513       /* Deinitialize the DMA stream */
01514       HAL_DMA_DeInit(hsai->hdmatx);
01515     }
01516
01517     /* Disable SAI peripheral */
01518     __HAL_SAI_DISABLE(hsai);
01519
01520     /* Deactivates CODEC_SAI pin SD by putting them in input mode */
01521     gpio_init_structure.Pin = AUDIO_IN_SAIx_SD_PIN;
01522     HAL_GPIO_DeInit(AUDIO_IN_SAIx_SD_GPIO_PORT, gpio_init_structure.Pin);
01523
01524     gpio_init_structure.Pin = AUDIO_IN_INT_GPIO_PIN;
01525     HAL_GPIO_DeInit(AUDIO_IN_INT_GPIO_PORT, gpio_init_structure.Pin);
01526
01527     /* Disable SAI clock */
01528     AUDIO_IN_SAIx_CLK_DISABLE();
01529   }
01530 }
01531
01532 /**
01533   * @brief  Initializes the Audio Codec audio interface (SAI).
01534   * @param  SaiInMode: Audio mode to be configured for the SAI peripheral.
01535   * @param  SlotActive: Audio active slot to be configured for the SAI peripheral.
01536   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
01537   * @retval None
01538   */
01539 static void SAIx_In_Init(uint32_t SaiInMode, uint32_t SlotActive, uint32_t AudioFreq)
01540 {
01541   /* Disable SAI peripheral to allow access to SAI internal registers */
01542   __HAL_SAI_DISABLE(&haudio_in_sai);
01543
01544   /* Configure SAI_Block_x
01545   LSBFirst: Disabled
01546   DataSize: 16 */
01547   haudio_in_sai.Init.MonoStereoMode = SAI_STEREOMODE;
01548   haudio_in_sai.Init.AudioFrequency = AudioFreq;
01549   haudio_in_sai.Init.AudioMode      = SaiInMode;
01550   haudio_in_sai.Init.NoDivider      = SAI_MASTERDIVIDER_ENABLE;
01551   haudio_in_sai.Init.Protocol       = SAI_FREE_PROTOCOL;
01552   haudio_in_sai.Init.DataSize       = SAI_DATASIZE_16;
01553   haudio_in_sai.Init.FirstBit       = SAI_FIRSTBIT_MSB;
01554   haudio_in_sai.Init.ClockStrobing  = SAI_CLOCKSTROBING_RISINGEDGE;
01555   haudio_in_sai.Init.Synchro        = SAI_SYNCHRONOUS;
01556   haudio_in_sai.Init.OutputDrive    = SAI_OUTPUTDRIVE_DISABLE;
01557   haudio_in_sai.Init.FIFOThreshold  = SAI_FIFOTHRESHOLD_1QF;
01558   haudio_in_sai.Init.SynchroExt     = SAI_SYNCEXT_DISABLE;
01559   haudio_in_sai.Init.CompandingMode = SAI_NOCOMPANDING;
01560   haudio_in_sai.Init.TriState       = SAI_OUTPUT_RELEASED;
01561   haudio_in_sai.Init.Mckdiv         = 0;
01562   haudio_in_sai.Init.MckOverSampling = SAI_MCK_OVERSAMPLING_DISABLE;
01563   haudio_in_sai.Init.PdmInit.Activation  = DISABLE;
01564
01565   /* Configure SAI_Block_x Frame
01566   Frame Length: 64
01567   Frame active Length: 32
01568   FS Definition: Start frame + Channel Side identification
01569   FS Polarity: FS active Low
01570   FS Offset: FS asserted one bit before the first bit of slot 0 */
01571   haudio_in_sai.FrameInit.FrameLength       = 128;
01572   haudio_in_sai.FrameInit.ActiveFrameLength = 64;
01573   haudio_in_sai.FrameInit.FSDefinition      = SAI_FS_CHANNEL_IDENTIFICATION;
01574   haudio_in_sai.FrameInit.FSPolarity        = SAI_FS_ACTIVE_LOW;
01575   haudio_in_sai.FrameInit.FSOffset          = SAI_FS_BEFOREFIRSTBIT;
01576
01577   /* Configure SAI Block_x Slot
01578   Slot First Bit Offset: 0
01579   Slot Size  : 16
01580   Slot Number: 4
01581   Slot Active: All slot active */
01582   haudio_in_sai.SlotInit.FirstBitOffset = 0;
01583   haudio_in_sai.SlotInit.SlotSize       = SAI_SLOTSIZE_DATASIZE;
01584   haudio_in_sai.SlotInit.SlotNumber     = 4;
01585   haudio_in_sai.SlotInit.SlotActive     = SlotActive;
01586
01587   if(hAudioIn.Interface == AUDIO_IN_INTERFACE_PDM)
01588   {
01589     haudio_in_sai.Init.AudioFrequency      = AudioFreq * 8;
01590     haudio_in_sai.Init.Synchro             = SAI_ASYNCHRONOUS;
01591     haudio_in_sai.Init.NoDivider           = SAI_MASTERDIVIDER_DISABLE;
01592
01593     haudio_in_sai.Init.PdmInit.Activation  = ENABLE;
01594     haudio_in_sai.Init.PdmInit.MicPairsNbr = 1;
01595     haudio_in_sai.Init.PdmInit.ClockEnable = SAI_PDM_CLOCK1_ENABLE;
01596     haudio_in_sai.Init.FirstBit            = SAI_FIRSTBIT_LSB;
01597     haudio_in_sai.Init.ClockStrobing       = SAI_CLOCKSTROBING_FALLINGEDGE;
01598
01599     haudio_in_sai.FrameInit.FrameLength       = 16;
01600     haudio_in_sai.FrameInit.ActiveFrameLength = 1;
01601     haudio_in_sai.FrameInit.FSDefinition      = SAI_FS_STARTFRAME;
01602     haudio_in_sai.FrameInit.FSPolarity        = SAI_FS_ACTIVE_HIGH;
01603     haudio_in_sai.FrameInit.FSOffset          = SAI_FS_FIRSTBIT;
01604
01605     haudio_in_sai.SlotInit.SlotNumber     = 1;
01606     haudio_in_sai.SlotInit.SlotActive     = SlotActive;
01607   }
01608
01609   HAL_SAI_Init(&haudio_in_sai);
01610
01611   /* Enable SAI peripheral */
01612   __HAL_SAI_ENABLE(&haudio_in_sai);
01613 }
01614
01615 /**
01616   * @brief  De-initializes the output Audio Codec audio interface (SAI).
01617   * @retval None
01618   */
01619 static void SAIx_In_DeInit(SAI_HandleTypeDef *hsai)
01620 {
01621   /* Disable SAI peripheral */
01622   __HAL_SAI_DISABLE(hsai);
01623
01624   HAL_SAI_DeInit(hsai);
01625 }
01626
01627 /**
01628   * @}
01629   */
01630
01631 /**
01632   * @}
01633   */
01634
01635 /**
01636   * @}
01637   */
01638
01639 /**
01640   * @}
01641   */
01642
01643 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_audio.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_audio.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_audio.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_AUDIO_H
00023 #define __STM32H747I_DISCOVERY_AUDIO_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 /* Include audio component Driver */
00031 #include "../Components/wm8994/wm8994.h"
00032 #include "stm32h747i_discovery.h"
00033 #include <stdlib.h>
00034 /* Include PDM to PCM lib header file */
00035 #include "pdm2pcm_glo.h"
00036
00037 /** @addtogroup BSP
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32H747I_DISCOVERY
00042   * @{
00043   */
00044
00045 /** @addtogroup STM32H747I_DISCOVERY_AUDIO
00046   * @{
00047   */
00048
00049 /** @defgroup STM32H747I_DISCOVERY_AUDIO_Exported_Types Exported Types
00050   * @{
00051   */
00052 typedef struct
00053 {
00054   uint32_t               Frequency;      /* Record Frequency */
00055   uint32_t               BitResolution;  /* Record bit resolution */
00056   uint32_t               ChannelNbr;     /* Record Channel Number */
00057   uint16_t               *pRecBuf;       /* Pointer to record user buffer */
00058   uint32_t               RecSize;        /* Size to record in mono, double size to record in stereo */
00059   uint32_t               InputDevice;    /* Audio Input Device */
00060   uint32_t               Interface;      /* Audio Input Interface */
00061   uint32_t               MultiBuffMode;  /* Multi buffer mode selection */
00062 }AUDIOIN_ContextTypeDef;
00063 /**
00064   * @}
00065   */
00066
00067 /** @defgroup STM32H747I_DISCOVERY_AUDIO_Exported_Constants Exported Constants
00068   * @{
00069   */
00070 #define BSP_AUDIO_FREQUENCY_96K         SAI_AUDIO_FREQUENCY_96K
00071 #define BSP_AUDIO_FREQUENCY_48K         SAI_AUDIO_FREQUENCY_48K
00072 #define BSP_AUDIO_FREQUENCY_44K         SAI_AUDIO_FREQUENCY_44K
00073 #define BSP_AUDIO_FREQUENCY_32K         SAI_AUDIO_FREQUENCY_32K
00074 #define BSP_AUDIO_FREQUENCY_22K         SAI_AUDIO_FREQUENCY_22K
00075 #define BSP_AUDIO_FREQUENCY_16K         SAI_AUDIO_FREQUENCY_16K
00076 #define BSP_AUDIO_FREQUENCY_11K         SAI_AUDIO_FREQUENCY_11K
00077 #define BSP_AUDIO_FREQUENCY_8K          SAI_AUDIO_FREQUENCY_8K
00078
00079 /*------------------------------------------------------------------------------
00080                           USER SAI defines parameters
00081  -----------------------------------------------------------------------------*/
00082 /** In W8994 codec the Audio frame contains 4 slots : TDM Mode
00083   * TDM format :
00084   * +------------------|------------------|--------------------|-------------------+
00085   * | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right  | CODEC_SLOT1 Right |
00086   * +------------------------------------------------------------------------------+
00087   */
00088 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */
00089 #define CODEC_AUDIOFRAME_SLOT_0123                   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
00090
00091 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */
00092 #define CODEC_AUDIOFRAME_SLOT_02                     SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
00093 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */
00094 #define CODEC_AUDIOFRAME_SLOT_13                     SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
00095 /* To have an audio stream in SAI PDM input Slot 0 must be activated */
00096 #define CODEC_AUDIOFRAME_SLOT_0                      SAI_SLOTACTIVE_0
00097
00098 /*------------------------------------------------------------------------------
00099                         AUDIO OUT CONFIGURATION
00100 ------------------------------------------------------------------------------*/
00101 /* SAI peripheral configuration defines */
00102 #define AUDIO_OUT_SAIx                           SAI1_Block_A
00103 #define AUDIO_OUT_SAIx_CLK_ENABLE()              __HAL_RCC_SAI1_CLK_ENABLE()
00104 #define AUDIO_OUT_SAIx_CLK_DISABLE()             __HAL_RCC_SAI1_CLK_DISABLE()
00105 #define AUDIO_OUT_SAIx_AF                        GPIO_AF6_SAI1
00106
00107 #define AUDIO_OUT_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOG_CLK_ENABLE()
00108 #define AUDIO_OUT_SAIx_MCLK_GPIO_PORT            GPIOG
00109 #define AUDIO_OUT_SAIx_MCLK_PIN                  GPIO_PIN_7
00110 #define AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE()        __HAL_RCC_GPIOE_CLK_ENABLE()
00111 #define AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT       GPIOE
00112 #define AUDIO_OUT_SAIx_FS_PIN                    GPIO_PIN_4
00113 #define AUDIO_OUT_SAIx_SCK_PIN                   GPIO_PIN_5
00114 #define AUDIO_OUT_SAIx_SD_PIN                    GPIO_PIN_6
00115
00116 /* SAI DMA Stream definitions */
00117 #define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00118 #define AUDIO_OUT_SAIx_DMAx_STREAM               DMA2_Stream1
00119 #define AUDIO_OUT_SAIx_DMAx_REQUEST              DMA_REQUEST_SAI1_A
00120 #define AUDIO_OUT_SAIx_DMAx_IRQ                  DMA2_Stream1_IRQn
00121 #define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00122 #define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00123 #define AUDIO_OUT_SAIx_DMAx_IRQHandler           DMA2_Stream1_IRQHandler
00124
00125 /* Select the interrupt preemption priority and subpriority for the DMA interrupt */
00126 #define AUDIO_OUT_IRQ_PREPRIO                    ((uint32_t)0x0E)
00127
00128 /*------------------------------------------------------------------------------
00129                         AUDIO IN CONFIGURATION
00130 ------------------------------------------------------------------------------*/
00131 /* SAI peripheral configuration defines */
00132 #define AUDIO_IN_SAIx                           SAI1_Block_B
00133 #define AUDIO_IN_SAIx_CLK_ENABLE()              __HAL_RCC_SAI1_CLK_ENABLE()
00134 #define AUDIO_IN_SAIx_CLK_DISABLE()             __HAL_RCC_SAI1_CLK_DISABLE()
00135 #define AUDIO_IN_SAIx_AF                        GPIO_AF6_SAI1
00136 #define AUDIO_IN_SAIx_SD_ENABLE()               __HAL_RCC_GPIOE_CLK_ENABLE()
00137 #define AUDIO_IN_SAIx_SD_GPIO_PORT              GPIOE
00138 #define AUDIO_IN_SAIx_SD_PIN                    GPIO_PIN_3
00139
00140 /* SAI DMA Stream definitions */
00141 #define AUDIO_IN_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00142 #define AUDIO_IN_SAIx_DMAx_STREAM               DMA2_Stream4
00143 #define AUDIO_IN_SAIx_DMAx_REQUEST              DMA_REQUEST_SAI1_B
00144 #define AUDIO_IN_SAIx_DMAx_IRQ                  DMA2_Stream4_IRQn
00145 #define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00146 #define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00147
00148 #define AUDIO_IN_SAIx_DMAx_IRQHandler           DMA2_Stream4_IRQHandler
00149
00150 #define AUDIO_IN_INT_GPIO_ENABLE()               __HAL_RCC_GPIOJ_CLK_ENABLE()
00151 #define AUDIO_IN_INT_GPIO_PORT                   GPIOJ
00152 #define AUDIO_IN_INT_GPIO_PIN                    GPIO_PIN_15
00153 #define AUDIO_IN_INT_IRQ                         EXTI15_10_IRQn
00154
00155 /* SAI PDM input definitions */
00156 #define AUDIO_IN_SAI_PDMx                       SAI4_Block_A
00157 #define AUDIO_IN_SAI_PDMx_CLK_ENABLE()          __HAL_RCC_SAI4_CLK_ENABLE()
00158 #define AUDIO_IN_SAI_PDMx_CLK_DISABLE()         __HAL_RCC_SAI4_CLK_DISABLE()
00159 #define AUDIO_IN_SAI_PDMx_FS_SCK_AF             GPIO_AF8_SAI4
00160 #define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE()       __HAL_RCC_GPIOE_CLK_ENABLE()
00161 #define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT      GPIOE
00162 #define AUDIO_IN_SAI_PDMx_FS_PIN                GPIO_PIN_4
00163 #define AUDIO_IN_SAI_PDMx_SCK_PIN               GPIO_PIN_5
00164
00165 #define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE()       __HAL_RCC_GPIOE_CLK_ENABLE()
00166 #define AUDIO_IN_SAI_PDMx_CLK_IN_PIN            GPIO_PIN_2
00167 #define AUDIO_IN_SAI_PDMx_CLK_IN_PORT           GPIOE
00168 #define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE()      __HAL_RCC_GPIOC_CLK_ENABLE()
00169 #define AUDIO_IN_SAI_PDMx_DATA_IN_PIN           GPIO_PIN_1
00170 #define AUDIO_IN_SAI_PDMx_DATA_IN_PORT          GPIOC
00171 #define AUDIO_IN_SAI_PDMx_DATA_CLK_AF           GPIO_AF10_SAI4
00172 #define AUDIO_IN_SAI_PDMx_IRQHandler            SAI4_IRQHandler
00173 #define AUDIO_IN_SAI_PDMx_IRQ                   SAI4_IRQn
00174
00175 /* SAI PDM DMA Stream definitions */
00176 #define AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE()         __HAL_RCC_BDMA_CLK_ENABLE()
00177 #define AUDIO_IN_SAI_PDMx_DMAx_STREAM               BDMA_Channel1
00178 #define AUDIO_IN_SAI_PDMx_DMAx_REQUEST              BDMA_REQUEST_SAI4_A
00179 #define AUDIO_IN_SAI_PDMx_DMAx_IRQ                  BDMA_Channel1_IRQn
00180 #define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00181 #define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00182 #define AUDIO_IN_SAI_PDMx_DMAx_IRQHandler           BDMA_Channel1_IRQHandler
00183
00184 /* Select the interrupt preemption priority and subpriority for the DMA interrupt */
00185 #define AUDIO_IN_IRQ_PREPRIO                ((uint32_t)0x0F)
00186
00187
00188 /*------------------------------------------------------------------------------
00189              CONFIGURATION: Audio Driver Configuration parameters
00190 ------------------------------------------------------------------------------*/
00191
00192 #define AUDIODATA_SIZE                      ((uint32_t)2)   /* 16-bits audio data size */
00193
00194 /* Audio status definition */
00195 #define AUDIO_OK                            ((uint8_t)0)
00196 #define AUDIO_ERROR                         ((uint8_t)1)
00197 #define AUDIO_TIMEOUT                       ((uint8_t)2)
00198
00199 /* Audio In default settings */
00200 #define DEFAULT_AUDIO_IN_FREQ               BSP_AUDIO_FREQUENCY_16K
00201 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     ((uint8_t)16)
00202 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        ((uint8_t)2)
00203 #define DEFAULT_AUDIO_IN_VOLUME             ((uint16_t)64)
00204
00205 /*------------------------------------------------------------------------------
00206                             OUTPUT DEVICES definition
00207 ------------------------------------------------------------------------------*/
00208 /* Alias on existing output devices to adapt for 2 headphones output */
00209 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
00210 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
00211
00212 /*------------------------------------------------------------------------------
00213                            INPUT DEVICES definition
00214 ------------------------------------------------------------------------------*/
00215 /* Analog microphone input from 3.5 audio jack connector */
00216 #define INPUT_DEVICE_ANALOG_MIC        ((uint32_t)0x00000001)
00217 /* MP34DT01TR digital microphone on PCB top side */
00218 #define INPUT_DEVICE_DIGITAL_MIC1      ((uint32_t)0x00000010)
00219 #define INPUT_DEVICE_DIGITAL_MIC2      ((uint32_t)0x00000020)
00220 #define INPUT_DEVICE_DIGITAL_MIC       ((uint32_t)(INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2))
00221
00222 /* Audio In interface for Digital mic */
00223 #define AUDIO_IN_INTERFACE_SAI        ((uint16_t)0)
00224 #define AUDIO_IN_INTERFACE_PDM        ((uint16_t)1)
00225
00226 /**
00227   * @}
00228   */
00229
00230 /** @defgroup STM32H747I_DISCOVERY_AUDIO_Exported_Macros Exported Macros
00231   * @{
00232   */
00233 #define DMA_MAX_SIZE         0xFFFF
00234 #define DMA_MAX(x)           (((x) <= DMA_MAX_SIZE)? (x):DMA_MAX_SIZE)
00235 #define POS_VAL(VAL)         (POSITION_VAL(VAL) - 4)
00236 /**
00237   * @}
00238   */
00239
00240 /** @addtogroup STM32H747I_DISCOVERY_AUDIO_OUT_Exported_Functions
00241   * @{
00242   */
00243 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00244 void    BSP_AUDIO_OUT_DeInit(void);
00245 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size);
00246 void    BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00247 uint8_t BSP_AUDIO_OUT_Pause(void);
00248 uint8_t BSP_AUDIO_OUT_Resume(void);
00249 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00250 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00251 void    BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00252 void    BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot);
00253 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00254 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00255
00256 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00257 /* This function is called when the requested data has been completely transferred.*/
00258 void    BSP_AUDIO_OUT_TransferComplete_CallBack(void);
00259
00260 /* This function is called when half of the requested buffer has been transferred. */
00261 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(void);
00262
00263 /* This function is called when an Interrupt due to transfer error on or peripheral
00264    error occurs. */
00265 void    BSP_AUDIO_OUT_Error_CallBack(void);
00266
00267 /* These function can be modified in case the current settings (e.g. DMA stream)
00268    need to be changed for specific application needs */
00269 void  BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params);
00270 void  BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00271 void  BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00272
00273 /**
00274   * @}
00275   */
00276
00277 /** @addtogroup STM32H747I_DISCOVERY_AUDIO_IN_Exported_Functions
00278   * @{
00279   */
00280 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00281 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00282 uint8_t BSP_AUDIO_IN_ConfigMicDefault(uint32_t InputDevice);
00283 uint8_t BSP_AUDIO_IN_ConfigDigitalMic(uint32_t InputDevice, void *Params);
00284 uint8_t BSP_AUDIO_IN_AllocScratch (int32_t *pScratch, uint32_t size);
00285 uint8_t BSP_AUDIO_IN_Record(uint16_t *pBuf, uint32_t Size);
00286 uint8_t BSP_AUDIO_IN_RecordEx(uint32_t *pBuf, uint32_t Size);
00287 uint8_t BSP_AUDIO_IN_SetFrequency(uint32_t AudioFreq);
00288 uint8_t BSP_AUDIO_IN_Stop(void);
00289 uint8_t BSP_AUDIO_IN_StopEx(uint32_t InputDevice);
00290 uint8_t BSP_AUDIO_IN_Pause(void);
00291 uint8_t BSP_AUDIO_IN_PauseEx(uint32_t InputDevice);
00292 uint8_t BSP_AUDIO_IN_Resume(void);
00293 uint8_t BSP_AUDIO_IN_ResumeEx(uint32_t *pBuf, uint32_t InputDevice);
00294 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume);
00295 void    BSP_AUDIO_IN_DeInit(void);
00296 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf);
00297 uint8_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut);
00298 void    BSP_AUDIO_IN_SelectInterface(uint32_t Interface);
00299 uint32_t BSP_AUDIO_IN_GetInterface(void);
00300 uint8_t BSP_AUDIO_IN_OUT_Init(uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00301 uint8_t BSP_AUDIO_IN_GetChannelNumber(void);
00302 void    BSP_AUDIO_IN_Error_Callback(void);
00303
00304 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00305 /* This function should be implemented by the user application.
00306    It is called into this driver when the current buffer is filled to prepare the next
00307    buffer pointer and its size. */
00308 void    BSP_AUDIO_IN_TransferComplete_CallBack(void);
00309 void    BSP_AUDIO_IN_HalfTransfer_CallBack(void);
00310 void    BSP_AUDIO_IN_TransferComplete_CallBackEx(uint32_t InputDevice);
00311 void    BSP_AUDIO_IN_HalfTransfer_CallBackEx(uint32_t InputDevice);
00312
00313 /* This function is called when an Interrupt due to transfer error on or peripheral
00314    error occurs. */
00315 void    BSP_AUDIO_IN_Error_CallBack(void);
00316
00317 /* These function can be modified in case the current settings (e.g. DMA stream)
00318    need to be changed for specific application needs */
00319 void BSP_AUDIO_IN_ClockConfig(uint32_t AudioFreq, void *Params);
00320 void BSP_AUDIO_IN_MspInit(void);
00321 void BSP_AUDIO_IN_MspDeInit(void);
00322
00323 /**
00324   * @}
00325   */
00326
00327 /**
00328   * @}
00329   */
00330
00331 /**
00332   * @}
00333   */
00334 /**
00335   * @}
00336   */
00337
00338 #ifdef __cplusplus
00339 }
00340 #endif
00341
00342 #endif /* __STM32H747I_DISCOVERY_AUDIO_H */
00343
00344 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_camera.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_camera.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Camera modules mounted on
00006   *          STM32H747I-DISCOVERY board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info: ------------------------------------------------------------------
00022                                    User NOTES
00023 1. How to use this driver:
00024 --------------------------
00025    - This driver is used to drive the camera.
00026    - The OV9655 component driver MUST be included with this driver.
00027
00028 2. Driver description:
00029 ---------------------
00030   + Initialization steps:
00031      o Initialize the camera using the BSP_CAMERA_Init() function.
00032      o Start the camera capture/snapshot using the CAMERA_Start() function.
00033      o Suspend, resume or stop the camera capture using the following functions:
00034       - BSP_CAMERA_Suspend()
00035       - BSP_CAMERA_Resume()
00036       - BSP_CAMERA_Stop()
00037
00038   + Options
00039      o Increase or decrease on the fly the brightness and/or contrast
00040        using the following function:
00041        - BSP_CAMERA_ContrastBrightnessConfig
00042      o Add a special effect on the fly using the following functions:
00043        - BSP_CAMERA_BlackWhiteConfig()
00044        - BSP_CAMERA_ColorEffectConfig()
00045
00046 ------------------------------------------------------------------------------*/
00047
00048 /* Includes ------------------------------------------------------------------*/
00049 #include "stm32h747i_discovery_camera.h"
00050
00051
00052 /** @addtogroup BSP
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32H747I_DISCOVERY
00057   * @{
00058   */
00059
00060 /** @defgroup STM32H747I_DISCOVERY_CAMERA STM32H747I_DISCOVERY_CAMERA
00061   * @{
00062   */
00063
00064 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Exported_Variables Exported Variables
00065   * @{
00066   */
00067 DCMI_HandleTypeDef  hdcmi_discovery;
00068 CAMERA_DrvTypeDef   *camera_drv;
00069 /**
00070   * @}
00071   */
00072
00073 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Private_Variables Private Variables
00074   * @{
00075   */
00076 /* Camera current resolution naming (QQVGA, VGA, ...) */
00077 static uint32_t CameraCurrentResolution;
00078
00079 /* Camera image rotation on LCD Displayed frame buffer */
00080 uint32_t CameraRotation = CAMERA_ROTATION_INVALID;
00081
00082 /* Camera module I2C HW address */
00083 static uint32_t CameraHwAddress;
00084 /**
00085   * @}
00086   */
00087
00088 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Private_FunctionPrototypes Private FunctionPrototypes
00089   * @{
00090   */
00091 static uint32_t GetSize(uint32_t Resolution);
00092 /**
00093   * @}
00094   */
00095
00096 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Exported_Functions Exported Functions
00097   * @{
00098   */
00099
00100 /**
00101   * @brief  Set Camera image rotation on LCD Displayed frame buffer.
00102   * @param  rotation : uint32_t rotation of camera image in preview buffer sent to LCD
00103   *         need to be of type Camera_ImageRotationTypeDef
00104   * @retval Camera status
00105   */
00106 uint8_t BSP_CAMERA_SetRotation(uint32_t rotation)
00107 {
00108   uint8_t status = CAMERA_ERROR;
00109
00110   if(rotation < CAMERA_ROTATION_INVALID)
00111   {
00112     /* Set Camera image rotation on LCD Displayed frame buffer */
00113     CameraRotation = rotation;
00114     status = CAMERA_OK;
00115   }
00116
00117   return status;
00118 }
00119
00120 /**
00121   * @brief  Get Camera image rotation on LCD Displayed frame buffer.
00122   * @retval rotation : uint32_t value of type Camera_ImageRotationTypeDef
00123   */
00124 uint32_t BSP_CAMERA_GetRotation(void)
00125 {
00126   return(CameraRotation);
00127 }
00128
00129 /**
00130   * @brief  Initializes the camera.
00131   * @param  Resolution : camera sensor requested resolution (x, y) : standard resolution
00132   *         naming QQVGA, QVGA, VGA ...
00133   * @retval Camera status
00134   */
00135 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
00136 {
00137   DCMI_HandleTypeDef *phdcmi;
00138   uint8_t status = CAMERA_ERROR;
00139
00140   /* Get the DCMI handle structure */
00141   phdcmi = &hdcmi_discovery;
00142
00143   /*** Configures the DCMI to interface with the camera module ***/
00144   /* DCMI configuration */
00145   phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
00146   phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_LOW;
00147   phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
00148   phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
00149   phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
00150   phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
00151   phdcmi->Instance              = DCMI;
00152
00153   /* Power up camera */
00154   BSP_CAMERA_PwrUp();
00155
00156   /* Read ID of Camera module via I2C */
00157   if(ov9655_ReadID(CAMERA_I2C_ADDRESS) == OV9655_ID)
00158   {
00159     /* Initialize the camera driver structure */
00160     camera_drv = &ov9655_drv;
00161     CameraHwAddress = CAMERA_I2C_ADDRESS;
00162
00163     /* DCMI Initialization */
00164     BSP_CAMERA_MspInit(&hdcmi_discovery, NULL);
00165     HAL_DCMI_Init(phdcmi);
00166
00167     /* Camera Module Initialization via I2C to the wanted 'Resolution' */
00168     if (Resolution == CAMERA_R480x272)
00169     {     /* For 480x272 resolution, the OV9655 sensor is set to VGA resolution
00170            * as OV9655 doesn't supports 480x272 resolution,
00171            * then DCMI is configured to output a 480x272 cropped window */
00172       camera_drv->Init(CameraHwAddress, CAMERA_R640x480);
00173       HAL_DCMI_ConfigCROP(phdcmi,           /* Crop in the middle of the VGA picture */
00174                          (CAMERA_VGA_RES_X - CAMERA_480x272_RES_X)/2,
00175                          (CAMERA_VGA_RES_Y - CAMERA_480x272_RES_Y)/2,
00176                          (CAMERA_480x272_RES_X * 2) - 1,
00177                           CAMERA_480x272_RES_Y - 1);
00178       HAL_DCMI_EnableCROP(phdcmi);
00179     }
00180     else
00181     {
00182       camera_drv->Init(CameraHwAddress, Resolution);
00183       HAL_DCMI_DisableCROP(phdcmi);
00184     }
00185
00186     CameraCurrentResolution = Resolution;
00187
00188     /* Return CAMERA_OK status */
00189     status = CAMERA_OK;
00190   }
00191   else
00192   {
00193     /* Return CAMERA_NOT_SUPPORTED status */
00194     status = CAMERA_NOT_SUPPORTED;
00195   }
00196
00197   return status;
00198 }
00199
00200
00201 /**
00202   * @brief  DeInitializes the camera.
00203   * @retval Camera status
00204   */
00205 uint8_t BSP_CAMERA_DeInit(void)
00206 {
00207   hdcmi_discovery.Instance              = DCMI;
00208
00209   HAL_DCMI_DeInit(&hdcmi_discovery);
00210   BSP_CAMERA_MspDeInit(&hdcmi_discovery, NULL);
00211   return CAMERA_OK;
00212 }
00213
00214 /**
00215   * @brief  Starts the camera capture in continuous mode.
00216   * @param  buff: pointer to the camera output buffer
00217   * @retval None
00218   */
00219 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
00220 {
00221   /* Start the camera capture */
00222   HAL_DCMI_Start_DMA(&hdcmi_discovery, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
00223 }
00224
00225 /**
00226   * @brief  Starts the camera capture in snapshot mode.
00227   * @param  buff: pointer to the camera output buffer
00228   * @retval None
00229   */
00230 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
00231 {
00232   /* Start the camera capture */
00233   HAL_DCMI_Start_DMA(&hdcmi_discovery, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
00234 }
00235
00236 /**
00237   * @brief Suspend the CAMERA capture
00238   * @retval None
00239   */
00240 void BSP_CAMERA_Suspend(void)
00241 {
00242   /* Suspend the Camera Capture */
00243   HAL_DCMI_Suspend(&hdcmi_discovery);
00244 }
00245
00246 /**
00247   * @brief Resume the CAMERA capture
00248   * @retval None
00249   */
00250 void BSP_CAMERA_Resume(void)
00251 {
00252   /* Start the Camera Capture */
00253   HAL_DCMI_Resume(&hdcmi_discovery);
00254 }
00255
00256 /**
00257   * @brief  Stop the CAMERA capture
00258   * @retval Camera status
00259   */
00260 uint8_t BSP_CAMERA_Stop(void)
00261 {
00262   uint8_t status = CAMERA_ERROR;
00263
00264   if(HAL_DCMI_Stop(&hdcmi_discovery) == HAL_OK)
00265   {
00266      status = CAMERA_OK;
00267   }
00268
00269   /* Set Camera in Power Down */
00270   BSP_CAMERA_PwrDown();
00271
00272   return status;
00273 }
00274
00275 /**
00276   * @brief  CANERA power up
00277   * @retval None
00278   */
00279 void BSP_CAMERA_PwrUp(void)
00280 {
00281   GPIO_InitTypeDef gpio_init_structure;
00282
00283   /* Enable GPIO clock */
00284   __HAL_RCC_GPIOJ_CLK_ENABLE();
00285
00286   /*** Configure the GPIO ***/
00287   /* Configure DCMI GPIO as alternate function */
00288   gpio_init_structure.Pin       = GPIO_PIN_14;
00289   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
00290   gpio_init_structure.Pull      = GPIO_NOPULL;
00291   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00292   HAL_GPIO_Init(GPIOJ, &gpio_init_structure);
00293
00294   /* De-assert the camera POWER_DOWN pin (active high) */
00295   HAL_GPIO_WritePin(GPIOJ, GPIO_PIN_14, GPIO_PIN_RESET);
00296
00297   HAL_Delay(3);     /* POWER_DOWN de-asserted during 3ms */
00298 }
00299
00300 /**
00301   * @brief  CAMERA power down
00302   * @retval None
00303   */
00304 void BSP_CAMERA_PwrDown(void)
00305 {
00306   GPIO_InitTypeDef gpio_init_structure;
00307
00308   /* Enable GPIO clock */
00309   __HAL_RCC_GPIOJ_CLK_ENABLE();
00310
00311   /*** Configure the GPIO ***/
00312   /* Configure DCMI GPIO as alternate function */
00313   gpio_init_structure.Pin       = GPIO_PIN_14;
00314   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
00315   gpio_init_structure.Pull      = GPIO_NOPULL;
00316   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00317   HAL_GPIO_Init(GPIOJ, &gpio_init_structure);
00318
00319   /* Assert the camera POWER_DOWN pin (active high) */
00320   HAL_GPIO_WritePin(GPIOJ, GPIO_PIN_14, GPIO_PIN_SET);
00321 }
00322
00323 /**
00324   * @brief  Configures the camera contrast and brightness.
00325   * @param  contrast_level: Contrast level
00326   *          This parameter can be one of the following values:
00327   *            @arg  CAMERA_CONTRAST_LEVEL4: for contrast +2
00328   *            @arg  CAMERA_CONTRAST_LEVEL3: for contrast +1
00329   *            @arg  CAMERA_CONTRAST_LEVEL2: for contrast  0
00330   *            @arg  CAMERA_CONTRAST_LEVEL1: for contrast -1
00331   *            @arg  CAMERA_CONTRAST_LEVEL0: for contrast -2
00332   * @param  brightness_level: Contrast level
00333   *          This parameter can be one of the following values:
00334   *            @arg  CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
00335   *            @arg  CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
00336   *            @arg  CAMERA_BRIGHTNESS_LEVEL2: for brightness  0
00337   *            @arg  CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
00338   *            @arg  CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
00339   */
00340 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
00341 {
00342   if(camera_drv->Config != NULL)
00343   {
00344     camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
00345   }
00346 }
00347
00348 /**
00349   * @brief  Configures the camera white balance.
00350   * @param  Mode: black_white mode
00351   *          This parameter can be one of the following values:
00352   *            @arg  CAMERA_BLACK_WHITE_BW
00353   *            @arg  CAMERA_BLACK_WHITE_NEGATIVE
00354   *            @arg  CAMERA_BLACK_WHITE_BW_NEGATIVE
00355   *            @arg  CAMERA_BLACK_WHITE_NORMAL
00356   */
00357 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
00358 {
00359   if(camera_drv->Config != NULL)
00360   {
00361     camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
00362   }
00363 }
00364
00365 /**
00366   * @brief  Configures the camera color effect.
00367   * @param  Effect: Color effect
00368   *          This parameter can be one of the following values:
00369   *            @arg  CAMERA_COLOR_EFFECT_ANTIQUE
00370   *            @arg  CAMERA_COLOR_EFFECT_BLUE
00371   *            @arg  CAMERA_COLOR_EFFECT_GREEN
00372   *            @arg  CAMERA_COLOR_EFFECT_RED
00373   * @retval None
00374   */
00375 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
00376 {
00377   if(camera_drv->Config != NULL)
00378   {
00379     camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
00380   }
00381 }
00382
00383 /**
00384   * @brief  Get the capture size in pixels unit.
00385   * @param  Resolution: the current resolution.
00386   * @retval capture size in pixels unit.
00387   */
00388 static uint32_t GetSize(uint32_t Resolution)
00389 {
00390   uint32_t size = 0;
00391
00392   /* Get capture size */
00393   switch (Resolution)
00394   {
00395   case CAMERA_R160x120:
00396     {
00397       size =  0x2580;
00398     }
00399     break;
00400   case CAMERA_R320x240:
00401     {
00402       size =  0x9600;
00403     }
00404     break;
00405   case CAMERA_R480x272:
00406     {
00407       size =  0xFF00;
00408     }
00409     break;
00410   case CAMERA_R640x480:
00411     {
00412       size =  0x25800;
00413     }
00414     break;
00415   default:
00416     {
00417       break;
00418     }
00419   }
00420
00421   return size;
00422 }
00423
00424 /**
00425   * @brief  Initializes the DCMI MSP.
00426   * @param  hdcmi: HDMI handle
00427   * @param  Params : pointer on additional configuration parameters, can be NULL.
00428   * @retval None
00429   */
00430 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00431 {
00432   static DMA_HandleTypeDef hdma_handler;
00433   GPIO_InitTypeDef gpio_init_structure;
00434
00435   /*** Enable peripherals and GPIO clocks ***/
00436   /* Enable DCMI clock */
00437   __HAL_RCC_DCMI_CLK_ENABLE();
00438
00439   /* Enable DMA clock */
00440   CAMERA_DCMI_DMAx_CLK_ENABLE();
00441
00442   /* Enable GPIO clocks */
00443   __HAL_RCC_GPIOA_CLK_ENABLE();
00444   __HAL_RCC_GPIOB_CLK_ENABLE();
00445   __HAL_RCC_GPIOC_CLK_ENABLE();
00446   __HAL_RCC_GPIOD_CLK_ENABLE();
00447   __HAL_RCC_GPIOG_CLK_ENABLE();
00448
00449   /*** Configure the GPIO ***/
00450   /* Configure DCMI GPIO as alternate function */
00451   gpio_init_structure.Pin       = GPIO_PIN_4 | GPIO_PIN_6;
00452   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00453   gpio_init_structure.Pull      = GPIO_PULLUP;
00454   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00455   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00456   HAL_GPIO_Init(GPIOA, &gpio_init_structure);
00457
00458   gpio_init_structure.Pin       = GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9;
00459   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00460   gpio_init_structure.Pull      = GPIO_PULLUP;
00461   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00462   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00463   HAL_GPIO_Init(GPIOB, &gpio_init_structure);
00464
00465   gpio_init_structure.Pin       = GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_9 | GPIO_PIN_11;
00466   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00467   gpio_init_structure.Pull      = GPIO_PULLUP;
00468   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00469   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00470   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00471
00472   gpio_init_structure.Pin       = GPIO_PIN_3;
00473   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00474   gpio_init_structure.Pull      = GPIO_PULLUP;
00475   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00476   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00477   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00478
00479   gpio_init_structure.Pin       = GPIO_PIN_10;
00480   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00481   gpio_init_structure.Pull      = GPIO_PULLUP;
00482   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00483   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00484   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00485
00486   /*** Configure the DMA ***/
00487   /* Set the parameters to be configured */
00488   hdma_handler.Init.Request             = DMA_REQUEST_DCMI;
00489   hdma_handler.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00490   hdma_handler.Init.PeriphInc           = DMA_PINC_DISABLE;
00491   hdma_handler.Init.MemInc              = DMA_MINC_ENABLE;
00492   hdma_handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00493   hdma_handler.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00494   hdma_handler.Init.Mode                = DMA_CIRCULAR;
00495   hdma_handler.Init.Priority            = DMA_PRIORITY_HIGH;
00496   hdma_handler.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00497   hdma_handler.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00498   hdma_handler.Init.MemBurst            = DMA_MBURST_SINGLE;
00499   hdma_handler.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00500
00501   hdma_handler.Instance = CAMERA_DCMI_DMAx_STREAM;
00502
00503   /* Associate the initialized DMA handle to the DCMI handle */
00504   __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_handler);
00505
00506   /*** Configure the NVIC for DCMI and DMA ***/
00507   /* NVIC configuration for DCMI transfer complete interrupt */
00508   HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0);
00509   HAL_NVIC_EnableIRQ(DCMI_IRQn);
00510
00511   /* NVIC configuration for DMA transfer complete interrupt */
00512   HAL_NVIC_SetPriority(CAMERA_DCMI_DMAx_IRQ, 0x0F, 0);
00513   HAL_NVIC_EnableIRQ(CAMERA_DCMI_DMAx_IRQ);
00514
00515   /* Configure the DMA stream */
00516   HAL_DMA_Init(hdcmi->DMA_Handle);
00517 }
00518
00519 /**
00520   * @brief  DeInitializes the DCMI MSP.
00521   * @param  hdcmi: HDMI handle
00522   * @param  Params : pointer on additional configuration parameters, can be NULL.
00523   * @retval None
00524   */
00525 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00526 {
00527   /* Disable NVIC  for DCMI transfer complete interrupt */
00528   HAL_NVIC_DisableIRQ(DCMI_IRQn);
00529
00530   /* Disable NVIC for DMA2 transfer complete interrupt */
00531   HAL_NVIC_DisableIRQ(CAMERA_DCMI_DMAx_IRQ);
00532
00533   /* Configure the DMA stream */
00534   HAL_DMA_DeInit(hdcmi->DMA_Handle);
00535
00536   /* Disable DCMI clock */
00537   __HAL_RCC_DCMI_CLK_DISABLE();
00538
00539   /* GPIO pins clock and DMA clock can be shut down in the application
00540      by surcharging this __weak function */
00541 }
00542
00543 /**
00544   * @brief  Line event callback
00545   * @param  hdcmi: pointer to the DCMI handle
00546   * @retval None
00547   */
00548 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
00549 {
00550   BSP_CAMERA_LineEventCallback();
00551 }
00552
00553 /**
00554   * @brief  Line Event callback.
00555   * @retval None
00556   */
00557 __weak void BSP_CAMERA_LineEventCallback(void)
00558 {
00559   /* NOTE : This function Should not be modified, when the callback is needed,
00560             the HAL_DCMI_LineEventCallback could be implemented in the user file
00561    */
00562 }
00563
00564 /**
00565   * @brief  VSYNC event callback
00566   * @param  hdcmi: pointer to the DCMI handle
00567   * @retval None
00568   */
00569 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
00570 {
00571   BSP_CAMERA_VsyncEventCallback();
00572 }
00573
00574 /**
00575   * @brief  VSYNC Event callback.
00576   * @retval None
00577   */
00578 __weak void BSP_CAMERA_VsyncEventCallback(void)
00579 {
00580   /* NOTE : This function Should not be modified, when the callback is needed,
00581             the HAL_DCMI_VsyncEventCallback could be implemented in the user file
00582    */
00583 }
00584
00585 /**
00586   * @brief  Frame event callback
00587   * @param  hdcmi: pointer to the DCMI handle
00588   * @retval None
00589   */
00590 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
00591 {
00592   BSP_CAMERA_FrameEventCallback();
00593 }
00594
00595 /**
00596   * @brief  Frame Event callback.
00597   * @retval None
00598   */
00599 __weak void BSP_CAMERA_FrameEventCallback(void)
00600 {
00601   /* NOTE : This function Should not be modified, when the callback is needed,
00602             the HAL_DCMI_FrameEventCallback could be implemented in the user file
00603    */
00604 }
00605
00606 /**
00607   * @brief  Error callback
00608   * @param  hdcmi: pointer to the DCMI handle
00609   * @retval None
00610   */
00611 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
00612 {
00613   BSP_CAMERA_ErrorCallback();
00614 }
00615
00616 /**
00617   * @brief  Error callback.
00618   * @retval None
00619   */
00620 __weak void BSP_CAMERA_ErrorCallback(void)
00621 {
00622   /* NOTE : This function Should not be modified, when the callback is needed,
00623             the HAL_DCMI_ErrorCallback could be implemented in the user file
00624    */
00625 }
00626
00627 /**
00628   * @}
00629   */
00630
00631 /**
00632   * @}
00633   */
00634
00635 /**
00636   * @}
00637   */
00638
00639 /**
00640   * @}
00641   */
00642
00643 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_camera.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_camera.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the STM32H747I_DISCOVERY_camera.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_CAMERA_H
00023 #define __STM32H747I_DISCOVERY_CAMERA_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 /* Include Camera component Driver */
00031 #include "../Components/ov9655/ov9655.h"
00032 #include "stm32h747i_discovery.h"
00033
00034 /** @addtogroup BSP
00035   * @{
00036   */
00037
00038 /** @addtogroup STM32H747I_DISCOVERY
00039   * @{
00040   */
00041
00042 /** @addtogroup STM32H747I_DISCOVERY_CAMERA
00043   * @{
00044   */
00045
00046 /** @defgroup STM32H747I_DISCOVERY_CAMERA_Exported_Constants Exported Constants
00047   * @{
00048   */
00049
00050 /**
00051   * @brief  Camera State structures definition
00052   */
00053 #define CAMERA_OK             0x00
00054 #define CAMERA_ERROR          0x01
00055 #define CAMERA_TIMEOUT        0x02
00056 #define CAMERA_NOT_DETECTED   0x03
00057 #define CAMERA_NOT_SUPPORTED  0x04
00058
00059 /**
00060   * @brief  Camera Image rotation definition
00061   *         in frame buffer for LCD Display.
00062   */
00063 #define CAMERA_NO_ROTATION        0x00
00064 #define CAMERA_ROTATION_90        0x01
00065 #define CAMERA_ROTATION_INVALID   0x02
00066
00067 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00068 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00069 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00070 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00071
00072 #define CAMERA_VGA_RES_X          640
00073 #define CAMERA_VGA_RES_Y          480
00074 #define CAMERA_480x272_RES_X      480
00075 #define CAMERA_480x272_RES_Y      272
00076 #define CAMERA_QVGA_RES_X         320
00077 #define CAMERA_QVGA_RES_Y         240
00078 #define CAMERA_QQVGA_RES_X        160
00079 #define CAMERA_QQVGA_RES_Y        120
00080
00081 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00082 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Stream3_IRQHandler
00083
00084 /* DCMI DMA Stream definitions */
00085 #define CAMERA_DCMI_DMAx_CLK_ENABLE         __HAL_RCC_DMA2_CLK_ENABLE
00086 #define CAMERA_DCMI_DMAx_STREAM             DMA2_Stream3
00087 #define CAMERA_DCMI_DMAx_IRQ                DMA2_Stream3_IRQn
00088
00089 /**
00090   * @brief  CAMERA FB_StartAddress
00091   */
00092 #define CAMERA_FB_START_ADDRESS       ((uint32_t)0xD0600000)
00093
00094 /**
00095   * @}
00096   */
00097
00098 /** @addtogroup STM32H747I_DISCOVERY_CAMERA_Exported_Functions
00099   * @{
00100   */
00101 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00102 uint8_t BSP_CAMERA_DeInit(void);
00103 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00104 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00105 void    BSP_CAMERA_Suspend(void);
00106 void    BSP_CAMERA_Resume(void);
00107 uint8_t BSP_CAMERA_Stop(void);
00108 void    BSP_CAMERA_PwrUp(void);
00109 void    BSP_CAMERA_PwrDown(void);
00110 void    BSP_CAMERA_LineEventCallback(void);
00111 void    BSP_CAMERA_VsyncEventCallback(void);
00112 void    BSP_CAMERA_FrameEventCallback(void);
00113 void    BSP_CAMERA_ErrorCallback(void);
00114
00115 /* Camera features functions prototype */
00116 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00117 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00118 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00119
00120 /* These functions can be modified in case the current settings (e.g. DMA stream)
00121    need to be changed for specific application needs */
00122 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00123 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00124 uint8_t  BSP_CAMERA_SetRotation(uint32_t rotation);
00125 uint32_t BSP_CAMERA_GetRotation(void);
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135 /**
00136   * @}
00137   */
00138
00139 /**
00140   * @}
00141   */
00142
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146
00147 #endif /* __STM32H747I_DISCOVERY_CAMERA_H */
00148
00149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_lcd.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_lcd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_lcd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00006   *          mounted on STM32H747I_DISCOVERY board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info: ------------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive directly in video mode a LCD TFT using the DSI interface.
00026      The following IPs are implied : DSI Host IP block working
00027      in conjunction to the LTDC controller.
00028    - This driver is linked by construction to LCD KoD mounted on board MB1166.
00029
00030 2. Driver description:
00031 ---------------------
00032   + Initialization steps:
00033      o Initialize the LCD using the BSP_LCD_Init() function.
00034      o Select the LCD layer to be used using the BSP_LCD_SelectLayer() function.
00035      o Enable the LCD display using the BSP_LCD_DisplayOn() function.
00036
00037   + Options
00038      o Configure and enable the color keying functionality using the
00039        BSP_LCD_SetColorKeying() function.
00040      o Modify in the fly the transparency and/or the frame buffer address
00041        using the following functions:
00042        - BSP_LCD_SetTransparency()
00043        - BSP_LCD_SetLayerAddress()
00044
00045   + Display on LCD
00046      o Clear the whole LCD using BSP_LCD_Clear() function or only one specified string
00047        line using the BSP_LCD_ClearStringLine() function.
00048      o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
00049        function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
00050      o Display a string line on the specified position (x,y in pixel) and align mode
00051        using the BSP_LCD_DisplayStringAtLine() function.
00052      o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00053        on LCD using the available set of functions.
00054
00055 ------------------------------------------------------------------------------*/
00056
00057 /* Includes ------------------------------------------------------------------*/
00058 #include "stm32h747i_discovery_lcd.h"
00059 #include "../../../Utilities/Fonts/fonts.h"
00060 #include "../../../Utilities/Fonts/font24.c"
00061 #include "../../../Utilities/Fonts/font20.c"
00062 #include "../../../Utilities/Fonts/font16.c"
00063 #include "../../../Utilities/Fonts/font12.c"
00064 #include "../../../Utilities/Fonts/font8.c"
00065
00066 /** @addtogroup BSP
00067   * @{
00068   */
00069
00070 /** @addtogroup STM32H747I_DISCOVERY
00071   * @{
00072   */
00073
00074 /** @defgroup STM32H747I_DISCOVERY_LCD STM32H747I_DISCOVERY_LCD
00075   * @{
00076   */
00077
00078 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_Defines Private Defines
00079   * @{
00080   */
00081
00082 #if defined(USE_LCD_HDMI)
00083 #define HDMI_ASPECT_RATIO_16_9  ADV7533_ASPECT_RATIO_16_9
00084 #define HDMI_ASPECT_RATIO_4_3   ADV7533_ASPECT_RATIO_4_3
00085 #endif /* USE_LCD_HDMI */
00086 #define LCD_DSI_ID              0x11
00087 #define LCD_DSI_ADDRESS         TS_I2C_ADDRESS
00088 #define LCD_DSI_ID_REG          0xA8
00089 /**
00090   * @}
00091   */
00092
00093 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_Types Private Types
00094   * @{
00095   */
00096
00097 #if defined(USE_LCD_HDMI)
00098 /**
00099   * @brief  DSI timming params used for different HDMI adpater
00100   */
00101 typedef struct
00102 {
00103   uint16_t      HACT;
00104   uint16_t      HSYNC;
00105   uint16_t      HBP;
00106   uint16_t      HFP;
00107   uint16_t      VACT;
00108   uint16_t      VSYNC;
00109   uint16_t      VBP;
00110   uint16_t      VFP;
00111   uint8_t       ASPECT_RATIO;
00112   uint8_t       RGB_CODING;
00113 } HDMI_FormatTypeDef;
00114
00115 /**
00116   * @brief  DSI packet params used for different HDMI adpater
00117   */
00118 typedef struct
00119 {
00120   uint16_t      NullPacketSize;
00121   uint16_t      NumberOfChunks;
00122   uint16_t      PacketSize;
00123 } HDMI_DSIPacketTypeDef;
00124
00125 /**
00126   * @brief  LTDC PLL params used for different HDMI adpater
00127   */
00128 typedef struct
00129 {
00130   uint16_t      PLL_LTDC_N;
00131   uint16_t      PLL_LTDC_R;
00132   uint32_t      PCLK;
00133   uint16_t      IDF;
00134   uint16_t      NDIV;
00135   uint16_t      ODF;
00136   uint16_t      LaneByteClock;
00137   uint16_t      TXEscapeCkdiv;
00138 } HDMI_PLLConfigTypeDef;
00139
00140 #endif /* USE_LCD_HDMI */
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_Macros Private Macros
00146   * @{
00147   */
00148 #define ABS(X)                 ((X) > 0 ? (X) : -(X))
00149 #define POLY_X(Z)              ((int32_t)((Points + (Z))->X))
00150 #define POLY_Y(Z)              ((int32_t)((Points + (Z))->Y))
00151 /**
00152   * @}
00153   */
00154
00155 /** @defgroup STM32H747I_DISCOVERY_LCD_Exported_Variables Exported Variables
00156   * @{
00157   */
00158 DMA2D_HandleTypeDef hdma2d_discovery;
00159 LTDC_HandleTypeDef  hltdc_discovery;
00160 DSI_HandleTypeDef hdsi_discovery;
00161
00162 /**
00163   * @}
00164   */
00165
00166 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_Variables Private Variables
00167   * @{
00168   */
00169 static DSI_VidCfgTypeDef hdsivideo_handle;
00170 uint32_t lcd_x_size = OTM8009A_800X480_WIDTH;
00171 uint32_t lcd_y_size = OTM8009A_800X480_HEIGHT;
00172
00173 #if defined(USE_LCD_HDMI)
00174 /**
00175   * @brief  DSI timming used for different HDMI resolution (720x480 and 720x576)
00176   */
00177 HDMI_FormatTypeDef HDMI_Format[2] =
00178 {
00179 /* HA   HS  HB  HF  VA   VS VB  VF  ASPECT                BPP */
00180   {720, 62, 60, 30, 480, 6, 19, 9, HDMI_ASPECT_RATIO_4_3, LCD_DSI_PIXEL_DATA_FMT_RBG888},
00181   {720, 64, 68, 12, 576, 5, 39, 5, HDMI_ASPECT_RATIO_16_9, LCD_DSI_PIXEL_DATA_FMT_RBG888}
00182
00183 };
00184
00185 /**
00186   * @brief  DSI packet size used for different HDMI resolution (720x480 and 720x576)
00187   */
00188 HDMI_DSIPacketTypeDef HDMI_DSIPacket[2] =
00189 {
00190   /* NP NC VP */
00191   {0, 1, 720},
00192   {0, 1, 720}
00193 };
00194
00195 /**
00196   * @brief  LTDC PLL settings used for different HDMI resolution (720x480 and 720x576)
00197   */
00198 HDMI_PLLConfigTypeDef HDMI_PLLConfig[4] =
00199 {
00200 /* N   DIV Pclk   IDF              NDIV ODF               LBClk TXEscapeCkdiv*/
00201   {13, 12, 27083, DSI_PLL_IN_DIV5, 65, DSI_PLL_OUT_DIV1, 40625, 3},
00202   {13, 12, 27083, DSI_PLL_IN_DIV5, 65, DSI_PLL_OUT_DIV1, 40625, 3},
00203
00204 };
00205 #endif /* USE_LCD_HDMI */
00206
00207 /**
00208   * @brief  Default Active LTDC Layer in which drawing is made is LTDC Layer Background
00209   */
00210 static uint32_t  ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND;
00211
00212 /**
00213   * @brief  Current Drawing Layer properties variable
00214   */
00215 static LCD_DrawPropTypeDef DrawProp[LTDC_MAX_LAYER_NUMBER];
00216 /**
00217   * @}
00218   */
00219
00220 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_FunctionPrototypes Private FunctionPrototypes
00221   * @{
00222   */
00223 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c);
00224 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3);
00225 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex);
00226 static void LL_ConvertLineToARGB8888(void * pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode);
00227 static uint16_t LCD_IO_GetID(void);
00228 /**
00229   * @}
00230   */
00231
00232 /** @defgroup STM32H747I_DISCOVERY_LCD_Exported_Functions Exported Functions
00233   * @{
00234   */
00235
00236 /**
00237   * @brief  Initializes the DSI LCD.
00238   * @retval LCD state
00239   */
00240 uint8_t BSP_LCD_Init(void)
00241 {
00242   return (BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE));
00243 }
00244
00245 /**
00246   * @brief  Initializes the DSI LCD.
00247   * The ititialization is done as below:
00248   *     - DSI PLL ititialization
00249   *     - DSI ititialization
00250   *     - LTDC ititialization
00251   *     - OTM8009A LCD Display IC Driver ititialization
00252   * @param orientation Display orientation
00253   * @retval LCD state
00254   */
00255 uint8_t BSP_LCD_InitEx(LCD_OrientationTypeDef orientation)
00256 {
00257   DSI_PLLInitTypeDef dsiPllInit;
00258   DSI_PHY_TimerTypeDef  PhyTimings;
00259   static RCC_PeriphCLKInitTypeDef  PeriphClkInitStruct;
00260   uint32_t LcdClock  = 26400; /*!< LcdClk = 26400 kHz */
00261   uint16_t read_id = 0;
00262
00263   uint32_t laneByteClk_kHz = 0;
00264   uint32_t                   VSA; /*!< Vertical start active time in units of lines */
00265   uint32_t                   VBP; /*!< Vertical Back Porch time in units of lines */
00266   uint32_t                   VFP; /*!< Vertical Front Porch time in units of lines */
00267   uint32_t                   VACT; /*!< Vertical Active time in units of lines = imageSize Y in pixels to display */
00268   uint32_t                   HSA; /*!< Horizontal start active time in units of lcdClk */
00269   uint32_t                   HBP; /*!< Horizontal Back Porch time in units of lcdClk */
00270   uint32_t                   HFP; /*!< Horizontal Front Porch time in units of lcdClk */
00271   uint32_t                   HACT; /*!< Horizontal Active time in units of lcdClk = imageSize X in pixels to display */
00272
00273   /* Toggle Hardware Reset of the DSI LCD using
00274   * its XRES signal (active low) */
00275   BSP_LCD_Reset();
00276
00277   /* Check the connected monitor */
00278   read_id = LCD_IO_GetID();
00279
00280 #if defined(USE_LCD_HDMI)
00281   if(read_id == ADV7533_ID)
00282   {
00283     return BSP_LCD_HDMIInitEx(HDMI_FORMAT_720_576);
00284   }
00285   else if(read_id != LCD_DSI_ID)
00286   {
00287     return LCD_ERROR;
00288   }
00289 #else
00290   if(read_id != LCD_DSI_ID)
00291   {
00292     return LCD_ERROR;
00293   }
00294 #endif /* USE_LCD_HDMI */
00295
00296   /* Call first MSP Initialize only in case of first initialization
00297   * This will set IP blocks LTDC, DSI and DMA2D
00298   * - out of reset
00299   * - clocked
00300   * - NVIC IRQ related to IP blocks enabled
00301   */
00302   BSP_LCD_MspInit();
00303
00304 /*************************DSI Initialization***********************************/
00305
00306   /* Base address of DSI Host/Wrapper registers to be set before calling De-Init */
00307   hdsi_discovery.Instance = DSI;
00308
00309   HAL_DSI_DeInit(&(hdsi_discovery));
00310
00311   dsiPllInit.PLLNDIV  = 100;
00312   dsiPllInit.PLLIDF   = DSI_PLL_IN_DIV5;
00313   dsiPllInit.PLLODF  = DSI_PLL_OUT_DIV1;
00314   laneByteClk_kHz = 62500; /* 500 MHz / 8 = 62.5 MHz = 62500 kHz */
00315
00316   /* Set number of Lanes */
00317   hdsi_discovery.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
00318
00319   /* TXEscapeCkdiv = f(LaneByteClk)/15.62 = 4 */
00320   hdsi_discovery.Init.TXEscapeCkdiv = laneByteClk_kHz/15620;
00321
00322   HAL_DSI_Init(&(hdsi_discovery), &(dsiPllInit));
00323
00324   /* Timing parameters for all Video modes
00325   * Set Timing parameters of LTDC depending on its chosen orientation
00326   */
00327   if(orientation == LCD_ORIENTATION_PORTRAIT)
00328   {
00329     lcd_x_size = OTM8009A_480X800_WIDTH;  /* 480 */
00330     lcd_y_size = OTM8009A_480X800_HEIGHT; /* 800 */
00331   }
00332   else
00333   {
00334     /* lcd_orientation == LCD_ORIENTATION_LANDSCAPE */
00335     lcd_x_size = OTM8009A_800X480_WIDTH;  /* 800 */
00336     lcd_y_size = OTM8009A_800X480_HEIGHT; /* 480 */
00337   }
00338
00339   HACT = lcd_x_size;
00340   VACT = lcd_y_size;
00341
00342   /* The following values are same for portrait and landscape orientations */
00343   VSA  = OTM8009A_480X800_VSYNC;        /* 10 */
00344   VBP  = OTM8009A_480X800_VBP;          /* 15 */
00345   VFP  = OTM8009A_480X800_VFP;          /* 16 */
00346   HSA  = OTM8009A_480X800_HSYNC;        /* 2 */
00347   HBP  = OTM8009A_480X800_HBP;          /* 20 */
00348   HFP  = OTM8009A_480X800_HFP;          /* 20 */
00349
00350
00351   hdsivideo_handle.VirtualChannelID = LCD_OTM8009A_ID;
00352   hdsivideo_handle.ColorCoding = LCD_DSI_PIXEL_DATA_FMT_RBG888;
00353   hdsivideo_handle.VSPolarity = DSI_VSYNC_ACTIVE_HIGH;
00354   hdsivideo_handle.HSPolarity = DSI_HSYNC_ACTIVE_HIGH;
00355   hdsivideo_handle.DEPolarity = DSI_DATA_ENABLE_ACTIVE_HIGH;
00356   hdsivideo_handle.Mode = DSI_VID_MODE_BURST; /* Mode Video burst ie : one LgP per line */
00357   hdsivideo_handle.NullPacketSize = 0xFFF;
00358   hdsivideo_handle.NumberOfChunks = 0;
00359   hdsivideo_handle.PacketSize                = HACT; /* Value depending on display orientation choice portrait/landscape */
00360   hdsivideo_handle.HorizontalSyncActive = (HSA * laneByteClk_kHz)/LcdClock;
00361   hdsivideo_handle.HorizontalBackPorch = (HBP * laneByteClk_kHz)/LcdClock;
00362   hdsivideo_handle.HorizontalLine = ((HACT + HSA + HBP + HFP) * laneByteClk_kHz)/LcdClock; /* Value depending on display orientation choice portrait/landscape */
00363   hdsivideo_handle.VerticalSyncActive        = VSA;
00364   hdsivideo_handle.VerticalBackPorch         = VBP;
00365   hdsivideo_handle.VerticalFrontPorch        = VFP;
00366   hdsivideo_handle.VerticalActive            = VACT; /* Value depending on display orientation choice portrait/landscape */
00367
00368   /* Enable or disable sending LP command while streaming is active in video mode */
00369   hdsivideo_handle.LPCommandEnable = DSI_LP_COMMAND_ENABLE; /* Enable sending commands in mode LP (Low Power) */
00370
00371   /* Largest packet size possible to transmit in LP mode in VSA, VBP, VFP regions */
00372   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00373   hdsivideo_handle.LPLargestPacketSize = 16;
00374
00375   /* Largest packet size possible to transmit in LP mode in HFP region during VACT period */
00376   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00377   hdsivideo_handle.LPVACTLargestPacketSize = 0;
00378
00379
00380   /* Specify for each region of the video frame, if the transmission of command in LP mode is allowed in this region */
00381   /* while streaming is active in video mode                                                                         */
00382   hdsivideo_handle.LPHorizontalFrontPorchEnable = DSI_LP_HFP_ENABLE;   /* Allow sending LP commands during HFP period */
00383   hdsivideo_handle.LPHorizontalBackPorchEnable  = DSI_LP_HBP_ENABLE;   /* Allow sending LP commands during HBP period */
00384   hdsivideo_handle.LPVerticalActiveEnable = DSI_LP_VACT_ENABLE;  /* Allow sending LP commands during VACT period */
00385   hdsivideo_handle.LPVerticalFrontPorchEnable = DSI_LP_VFP_ENABLE;   /* Allow sending LP commands during VFP period */
00386   hdsivideo_handle.LPVerticalBackPorchEnable = DSI_LP_VBP_ENABLE;   /* Allow sending LP commands during VBP period */
00387   hdsivideo_handle.LPVerticalSyncActiveEnable = DSI_LP_VSYNC_ENABLE; /* Allow sending LP commands during VSync = VSA period */
00388
00389   /* Configure DSI Video mode timings with settings set above */
00390   HAL_DSI_ConfigVideoMode(&(hdsi_discovery), &(hdsivideo_handle));
00391
00392   /* Configure DSI PHY HS2LP and LP2HS timings */
00393   PhyTimings.ClockLaneHS2LPTime = 35;
00394   PhyTimings.ClockLaneLP2HSTime = 35;
00395   PhyTimings.DataLaneHS2LPTime = 35;
00396   PhyTimings.DataLaneLP2HSTime = 35;
00397   PhyTimings.DataLaneMaxReadTime = 0;
00398   PhyTimings.StopWaitTime = 10;
00399   HAL_DSI_ConfigPhyTimer(&hdsi_discovery, &PhyTimings);
00400
00401 /*************************End DSI Initialization*******************************/
00402
00403
00404 /************************LTDC Initialization***********************************/
00405
00406   /* Timing Configuration */
00407   hltdc_discovery.Init.HorizontalSync = (HSA - 1);
00408   hltdc_discovery.Init.AccumulatedHBP = (HSA + HBP - 1);
00409   hltdc_discovery.Init.AccumulatedActiveW = (lcd_x_size + HSA + HBP - 1);
00410   hltdc_discovery.Init.TotalWidth = (lcd_x_size + HSA + HBP + HFP - 1);
00411
00412   /* Initialize the LCD pixel width and pixel height */
00413   hltdc_discovery.LayerCfg->ImageWidth  = lcd_x_size;
00414   hltdc_discovery.LayerCfg->ImageHeight = lcd_y_size;
00415
00416
00417   /* LCD clock configuration */
00418   /* PLL3_VCO Input = HSE_VALUE/PLL3M = 5 Mhz */
00419   /* PLL3_VCO Output = PLL3_VCO Input * PLL3N = 480 Mhz */
00420   /* PLLLCDCLK = PLL3_VCO Output/PLL3R = 480/18 = 26.666 Mhz */
00421   /* LTDC clock frequency = PLLLCDCLK = 26.666 Mhz */
00422   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
00423   PeriphClkInitStruct.PLL3.PLL3M = 5;
00424   PeriphClkInitStruct.PLL3.PLL3N = 96;
00425   PeriphClkInitStruct.PLL3.PLL3P = 2;
00426   PeriphClkInitStruct.PLL3.PLL3Q = 10;
00427   PeriphClkInitStruct.PLL3.PLL3R = 18;
00428   HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
00429
00430   /* Background value */
00431   hltdc_discovery.Init.Backcolor.Blue = 0;
00432   hltdc_discovery.Init.Backcolor.Green = 0;
00433   hltdc_discovery.Init.Backcolor.Red = 0;
00434   hltdc_discovery.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00435   hltdc_discovery.Instance = LTDC;
00436
00437   /* Get LTDC Configuration from DSI Configuration */
00438   HAL_LTDC_StructInitFromVideoConfig(&(hltdc_discovery), &(hdsivideo_handle));
00439
00440   /* Initialize the LTDC */
00441   HAL_LTDC_Init(&hltdc_discovery);
00442
00443   /* Enable the DSI host and wrapper : after LTDC */
00444   /* To avoid any synchronization issue, the DSI shall be started after enabling the LTDC */
00445   HAL_DSI_Start(&hdsi_discovery);
00446
00447 #if !defined(DATA_IN_ExtSDRAM)
00448   /* Initialize the SDRAM */
00449   BSP_SDRAM_Init();
00450 #endif /* DATA_IN_ExtSDRAM */
00451
00452   /* Initialize the font */
00453   BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00454
00455 /************************End LTDC Initialization*******************************/
00456
00457
00458 /***********************OTM8009A Initialization********************************/
00459
00460   /* Initialize the OTM8009A LCD Display IC Driver (KoD LCD IC Driver)
00461   *  depending on configuration set in 'hdsivideo_handle'.
00462   */
00463   OTM8009A_Init(OTM8009A_FORMAT_RGB888, orientation);
00464
00465 /***********************End OTM8009A Initialization****************************/
00466
00467   return LCD_OK;
00468 }
00469
00470 #if defined(USE_LCD_HDMI)
00471 /**
00472   * @brief  Initializes the DSI for HDMI monitor.
00473   * The ititialization is done as below:
00474   *     - DSI PLL ititialization
00475   *     - DSI ititialization
00476   *     - LTDC ititialization
00477   *     - DSI-HDMI ADV7533 adapter device ititialization
00478   * @param  format : HDMI format could be HDMI_FORMAT_720_480 or HDMI_FORMAT_720_576
00479   * @retval LCD state
00480   */
00481 uint8_t BSP_LCD_HDMIInitEx(uint8_t format)
00482 {
00483   /************************ADV7533 Initialization******************************/
00484
00485   /* Initialize the ADV7533 HDMI Bridge
00486      depending on configuration set in 'hdsivideo_handle'. */
00487   adv7533ConfigTypeDef adv7533_config;
00488
00489   adv7533_config.DSI_LANES = 2;
00490   adv7533_config.HACT = HDMI_Format[format].HACT;
00491   adv7533_config.HSYNC = HDMI_Format[format].HSYNC;
00492   adv7533_config.HBP = HDMI_Format[format].HBP;
00493   adv7533_config.HFP = HDMI_Format[format].HFP;
00494   adv7533_config.VACT = HDMI_Format[format].VACT;
00495   adv7533_config.VSYNC = HDMI_Format[format].VSYNC;
00496   adv7533_config.VBP = HDMI_Format[format].VBP;
00497   adv7533_config.VFP = HDMI_Format[format].VFP;
00498
00499   ADV7533_Init();
00500   ADV7533_Configure(&adv7533_config);
00501   ADV7533_PowerOn();
00502
00503 /************************ Update hdmi_x_size and hdmi_y_size *****************/
00504   lcd_x_size = HDMI_Format[format].HACT;
00505   lcd_y_size = HDMI_Format[format].VACT;
00506
00507 /***********************End ADV7533 Initialization****************************/
00508
00509   DSI_PLLInitTypeDef dsiPllInit;
00510   DSI_PHY_TimerTypeDef dsiPhyInit;
00511   static RCC_PeriphCLKInitTypeDef  PeriphClkInitStruct;
00512
00513   /* Call first MSP Initialize only in case of first initialization
00514   * This will set IP blocks LTDC and DSI
00515   * - out of reset
00516   * - clocked
00517   * - NVIC IRQ related to IP blocks enabled
00518   */
00519   BSP_LCD_MspInit();
00520
00521 /*************************DSI Initialization***********************************/
00522
00523   /* Base address of DSI Host/Wrapper registers to be set before calling De-Init */
00524   hdsi_discovery.Instance = DSI;
00525
00526   HAL_DSI_DeInit(&(hdsi_discovery));
00527
00528   /* Configure the DSI PLL */
00529   dsiPllInit.PLLNDIV    = HDMI_PLLConfig[format].NDIV;
00530   dsiPllInit.PLLIDF     = HDMI_PLLConfig[format].IDF;
00531   dsiPllInit.PLLODF     = HDMI_PLLConfig[format].ODF;
00532
00533   /* Set number of Lanes */
00534   hdsi_discovery.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
00535   /* Set the TX escape clock division ratio */
00536   hdsi_discovery.Init.TXEscapeCkdiv = HDMI_PLLConfig[format].TXEscapeCkdiv;
00537   /* Disable the automatic clock lane control (the ADV7533 must be clocked) */
00538   hdsi_discovery.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;
00539
00540   /* Init the DSI */
00541   HAL_DSI_Init(&hdsi_discovery, &dsiPllInit);
00542
00543   /* Configure the D-PHY Timings */
00544   dsiPhyInit.ClockLaneHS2LPTime = 0x14;
00545   dsiPhyInit.ClockLaneLP2HSTime = 0x14;
00546   dsiPhyInit.DataLaneHS2LPTime = 0x0A;
00547   dsiPhyInit.DataLaneLP2HSTime = 0x0A;
00548   dsiPhyInit.DataLaneMaxReadTime = 0x00;
00549   dsiPhyInit.StopWaitTime = 0x0;
00550   HAL_DSI_ConfigPhyTimer(&hdsi_discovery, &dsiPhyInit);
00551
00552   /* Virutal channel used by the ADV7533 */
00553   hdsivideo_handle.VirtualChannelID     = HDMI_ADV7533_ID;
00554
00555   /* Timing parameters for Video modes
00556      Set Timing parameters of DSI depending on its chosen format */
00557   hdsivideo_handle.ColorCoding          = HDMI_Format[format].RGB_CODING;
00558   hdsivideo_handle.LooselyPacked        = DSI_LOOSELY_PACKED_DISABLE;
00559   hdsivideo_handle.VSPolarity           = DSI_VSYNC_ACTIVE_LOW;
00560   hdsivideo_handle.HSPolarity           = DSI_HSYNC_ACTIVE_LOW;
00561   hdsivideo_handle.DEPolarity           = DSI_DATA_ENABLE_ACTIVE_HIGH;
00562   hdsivideo_handle.Mode                 = DSI_VID_MODE_NB_PULSES;
00563   hdsivideo_handle.NullPacketSize       = HDMI_DSIPacket[format].NullPacketSize;
00564   hdsivideo_handle.NumberOfChunks       = HDMI_DSIPacket[format].NumberOfChunks;
00565   hdsivideo_handle.PacketSize           = HDMI_DSIPacket[format].PacketSize;
00566   hdsivideo_handle.HorizontalSyncActive = HDMI_Format[format].HSYNC*HDMI_PLLConfig[format].LaneByteClock/HDMI_PLLConfig[format].PCLK;
00567   hdsivideo_handle.HorizontalBackPorch  = HDMI_Format[format].HBP*HDMI_PLLConfig[format].LaneByteClock/HDMI_PLLConfig[format].PCLK;
00568   hdsivideo_handle.HorizontalLine       = (HDMI_Format[format].HACT + HDMI_Format[format].HSYNC + HDMI_Format[format].HBP + HDMI_Format[format].HFP)*HDMI_PLLConfig[format].LaneByteClock/HDMI_PLLConfig[format].PCLK;
00569   hdsivideo_handle.VerticalSyncActive   = HDMI_Format[format].VSYNC;
00570   hdsivideo_handle.VerticalBackPorch    = HDMI_Format[format].VBP;
00571   hdsivideo_handle.VerticalFrontPorch   = HDMI_Format[format].VFP;
00572   hdsivideo_handle.VerticalActive       = HDMI_Format[format].VACT;
00573
00574   /* Enable or disable sending LP command while streaming is active in video mode */
00575   hdsivideo_handle.LPCommandEnable      = DSI_LP_COMMAND_DISABLE; /* Enable sending commands in mode LP (Low Power) */
00576
00577   /* Largest packet size possible to transmit in LP mode in VSA, VBP, VFP regions */
00578   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00579   hdsivideo_handle.LPLargestPacketSize          = 4;
00580
00581   /* Largest packet size possible to transmit in LP mode in HFP region during VACT period */
00582   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00583   hdsivideo_handle.LPVACTLargestPacketSize      = 4;
00584
00585   /* Specify for each region, if the going in LP mode is allowed */
00586   /* while streaming is active in video mode                     */
00587   hdsivideo_handle.LPHorizontalFrontPorchEnable = DSI_LP_HFP_DISABLE;
00588   hdsivideo_handle.LPHorizontalBackPorchEnable  = DSI_LP_HBP_DISABLE;
00589   hdsivideo_handle.LPVerticalActiveEnable       = DSI_LP_VACT_DISABLE;
00590   hdsivideo_handle.LPVerticalFrontPorchEnable   = DSI_LP_VFP_DISABLE;
00591   hdsivideo_handle.LPVerticalBackPorchEnable    = DSI_LP_VBP_DISABLE;
00592   hdsivideo_handle.LPVerticalSyncActiveEnable   = DSI_LP_VSYNC_DISABLE;
00593
00594   /* No acknoledge at the end of a frame */
00595   hdsivideo_handle.FrameBTAAcknowledgeEnable    = DSI_FBTAA_DISABLE;
00596
00597   /* Configure DSI Video mode timings with settings set above */
00598   HAL_DSI_ConfigVideoMode(&hdsi_discovery, &hdsivideo_handle);
00599
00600   /* Enable the DSI host and wrapper : but LTDC is not started yet at this stage */
00601   HAL_DSI_Start(&hdsi_discovery);
00602
00603 /*************************End DSI Initialization*******************************/
00604
00605
00606 /************************LTDC Initialization***********************************/
00607
00608   /* LCD clock configuration */
00609   /* LCD clock configuration */
00610   /* PLL3_VCO Input = HSE_VALUE/PLL3M = 25 Mhz */
00611   /* PLL3_VCO Output = PLL3_VCO Input * PLL3N */
00612   /* PLLLCDCLK = PLL3_VCO Output/PLL3R */
00613   /* LTDC clock frequency = PLLLCDCLK */
00614   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
00615   PeriphClkInitStruct.PLL3.PLL3M = 1;
00616   PeriphClkInitStruct.PLL3.PLL3N = HDMI_PLLConfig[format].PLL_LTDC_N;
00617   PeriphClkInitStruct.PLL3.PLL3P = 2;
00618   PeriphClkInitStruct.PLL3.PLL3Q = 2;
00619   PeriphClkInitStruct.PLL3.PLL3R = HDMI_PLLConfig[format].PLL_LTDC_R;
00620   HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
00621
00622   /* Base address of LTDC registers to be set before calling De-Init */
00623   hltdc_discovery.Instance = LTDC;
00624
00625   HAL_LTDC_DeInit(&(hltdc_discovery));
00626
00627   /* Timing Configuration */
00628   hltdc_discovery.Init.HorizontalSync = (HDMI_Format[format].HSYNC - 1);
00629   hltdc_discovery.Init.AccumulatedHBP = (HDMI_Format[format].HSYNC + HDMI_Format[format].HBP - 1);
00630   hltdc_discovery.Init.AccumulatedActiveW = (HDMI_Format[format].HACT + HDMI_Format[format].HSYNC + HDMI_Format[format].HBP - 1);
00631   hltdc_discovery.Init.TotalWidth = (HDMI_Format[format].HACT + HDMI_Format[format].HSYNC + HDMI_Format[format].HBP + HDMI_Format[format].HFP - 1);
00632   hltdc_discovery.Init.VerticalSync = (HDMI_Format[format].VSYNC - 1);
00633   hltdc_discovery.Init.AccumulatedVBP = (HDMI_Format[format].VSYNC + HDMI_Format[format].VBP - 1);
00634   hltdc_discovery.Init.AccumulatedActiveH = (HDMI_Format[format].VACT + HDMI_Format[format].VSYNC + HDMI_Format[format].VBP - 1);
00635   hltdc_discovery.Init.TotalHeigh = (HDMI_Format[format].VACT + HDMI_Format[format].VSYNC + HDMI_Format[format].VBP + HDMI_Format[format].VFP - 1);
00636
00637   /* background value */
00638   hltdc_discovery.Init.Backcolor.Blue = 0x00;
00639   hltdc_discovery.Init.Backcolor.Green = 0xFF;
00640   hltdc_discovery.Init.Backcolor.Red = 0xFF;
00641
00642   /* Polarity */
00643   hltdc_discovery.Init.HSPolarity = LTDC_HSPOLARITY_AL;
00644   hltdc_discovery.Init.VSPolarity = LTDC_VSPOLARITY_AL;
00645   hltdc_discovery.Init.DEPolarity = LTDC_DEPOLARITY_AL;
00646   hltdc_discovery.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00647
00648   /* Initialize & Start the LTDC */
00649   HAL_LTDC_Init(&hltdc_discovery);
00650
00651 #if !defined(DATA_IN_ExtSDRAM)
00652   /* Initialize the SDRAM */
00653   BSP_SDRAM_Init();
00654 #endif /* DATA_IN_ExtSDRAM */
00655
00656   /* Initialize the font */
00657   BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00658 /************************End LTDC Initialization*******************************/
00659
00660     return LCD_OK;
00661 }
00662 #endif /* USE_LCD_HDMI */
00663
00664 /**
00665   * @brief  BSP LCD Reset
00666   *         Hw reset the LCD DSI activating its XRES signal (active low for some time)
00667   *         and deactivating it later.
00668   * @retval None
00669   */
00670 void BSP_LCD_Reset(void)
00671 {
00672   GPIO_InitTypeDef  gpio_init_structure;
00673
00674   __HAL_RCC_GPIOG_CLK_ENABLE();
00675
00676     /* Configure the GPIO on PG3 */
00677     gpio_init_structure.Pin   = GPIO_PIN_3;
00678     gpio_init_structure.Mode  = GPIO_MODE_OUTPUT_PP;
00679     gpio_init_structure.Pull  = GPIO_PULLUP;
00680     gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00681
00682     HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00683
00684     /* Activate XRES active low */
00685     HAL_GPIO_WritePin(GPIOG, GPIO_PIN_3, GPIO_PIN_RESET);
00686
00687     HAL_Delay(20); /* wait 20 ms */
00688
00689     /* Desactivate XRES */
00690     HAL_GPIO_WritePin(GPIOG, GPIO_PIN_3, GPIO_PIN_SET);
00691
00692     /* Wait for 10ms after releasing XRES before sending commands */
00693     HAL_Delay(10);
00694 }
00695
00696 /**
00697   * @brief  Gets the LCD X size.
00698   * @retval Used LCD X size
00699   */
00700 uint32_t BSP_LCD_GetXSize(void)
00701 {
00702   return (lcd_x_size);
00703 }
00704
00705 /**
00706   * @brief  Gets the LCD Y size.
00707   * @retval Used LCD Y size
00708   */
00709 uint32_t BSP_LCD_GetYSize(void)
00710 {
00711   return (lcd_y_size);
00712 }
00713
00714 /**
00715   * @brief  Set the LCD X size.
00716   * @param  imageWidthPixels : uint32_t image width in pixels unit
00717   * @retval None
00718   */
00719 void BSP_LCD_SetXSize(uint32_t imageWidthPixels)
00720 {
00721   hltdc_discovery.LayerCfg[ActiveLayer].ImageWidth = imageWidthPixels;
00722 }
00723
00724 /**
00725   * @brief  Set the LCD Y size.
00726   * @param  imageHeightPixels : uint32_t image height in lines unit
00727   */
00728 void BSP_LCD_SetYSize(uint32_t imageHeightPixels)
00729 {
00730   hltdc_discovery.LayerCfg[ActiveLayer].ImageHeight = imageHeightPixels;
00731 }
00732
00733
00734 /**
00735   * @brief  Initializes the LCD layers.
00736   * @param  LayerIndex: Layer foreground or background
00737   * @param  FB_Address: Layer frame buffer
00738   * @retval None
00739   */
00740 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
00741 {
00742     LCD_LayerCfgTypeDef  Layercfg;
00743
00744   /* Layer Init */
00745   Layercfg.WindowX0 = 0;
00746   Layercfg.WindowX1 = BSP_LCD_GetXSize();
00747   Layercfg.WindowY0 = 0;
00748   Layercfg.WindowY1 = BSP_LCD_GetYSize();
00749   Layercfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
00750   Layercfg.FBStartAdress = FB_Address;
00751   Layercfg.Alpha = 255;
00752   Layercfg.Alpha0 = 0;
00753   Layercfg.Backcolor.Blue = 0;
00754   Layercfg.Backcolor.Green = 0;
00755   Layercfg.Backcolor.Red = 0;
00756   Layercfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00757   Layercfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00758   Layercfg.ImageWidth = BSP_LCD_GetXSize();
00759   Layercfg.ImageHeight = BSP_LCD_GetYSize();
00760
00761   HAL_LTDC_ConfigLayer(&hltdc_discovery, &Layercfg, LayerIndex);
00762
00763   DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE;
00764   DrawProp[LayerIndex].pFont     = &Font24;
00765   DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK;
00766 }
00767
00768
00769 /**
00770   * @brief  Selects the LCD Layer.
00771   * @param  LayerIndex: Layer foreground or background
00772   */
00773 void BSP_LCD_SelectLayer(uint32_t LayerIndex)
00774 {
00775   ActiveLayer = LayerIndex;
00776 }
00777
00778 /**
00779   * @brief  Sets an LCD Layer visible
00780   * @param  LayerIndex: Visible Layer
00781   * @param  State: New state of the specified layer
00782   *          This parameter can be one of the following values:
00783   *            @arg  ENABLE
00784   *            @arg  DISABLE
00785   */
00786 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State)
00787 {
00788   if(State == ENABLE)
00789   {
00790     __HAL_LTDC_LAYER_ENABLE(&(hltdc_discovery), LayerIndex);
00791   }
00792   else
00793   {
00794     __HAL_LTDC_LAYER_DISABLE(&(hltdc_discovery), LayerIndex);
00795   }
00796   __HAL_LTDC_RELOAD_CONFIG(&(hltdc_discovery));
00797
00798 }
00799
00800 /**
00801   * @brief  Configures the transparency.
00802   * @param  LayerIndex: Layer foreground or background.
00803   * @param  Transparency: Transparency
00804   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00805   */
00806 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency)
00807 {
00808
00809   HAL_LTDC_SetAlpha(&(hltdc_discovery), Transparency, LayerIndex);
00810
00811 }
00812
00813 /**
00814   * @brief  Sets an LCD layer frame buffer address.
00815   * @param  LayerIndex: Layer foreground or background
00816   * @param  Address: New LCD frame buffer value
00817   */
00818 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address)
00819 {
00820
00821   HAL_LTDC_SetAddress(&(hltdc_discovery), Address, LayerIndex);
00822
00823 }
00824
00825 /**
00826   * @brief  Sets display window.
00827   * @param  LayerIndex: Layer index
00828   * @param  Xpos: LCD X position
00829   * @param  Ypos: LCD Y position
00830   * @param  Width: LCD window width
00831   * @param  Height: LCD window height
00832   */
00833 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00834 {
00835   /* Reconfigure the layer size */
00836   HAL_LTDC_SetWindowSize(&(hltdc_discovery), Width, Height, LayerIndex);
00837
00838   /* Reconfigure the layer position */
00839   HAL_LTDC_SetWindowPosition(&(hltdc_discovery), Xpos, Ypos, LayerIndex);
00840
00841 }
00842
00843 /**
00844   * @brief  Configures and sets the color keying.
00845   * @param  LayerIndex: Layer foreground or background
00846   * @param  RGBValue: Color reference
00847   */
00848 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue)
00849 {
00850   /* Configure and Enable the color Keying for LCD Layer */
00851   HAL_LTDC_ConfigColorKeying(&(hltdc_discovery), RGBValue, LayerIndex);
00852   HAL_LTDC_EnableColorKeying(&(hltdc_discovery), LayerIndex);
00853 }
00854
00855 /**
00856   * @brief  Disables the color keying.
00857   * @param  LayerIndex: Layer foreground or background
00858   */
00859 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex)
00860 {
00861   /* Disable the color Keying for LCD Layer */
00862   HAL_LTDC_DisableColorKeying(&(hltdc_discovery), LayerIndex);
00863 }
00864
00865 /**
00866   * @brief  Sets the LCD text color.
00867   * @param  Color: Text color code ARGB(8-8-8-8)
00868   */
00869 void BSP_LCD_SetTextColor(uint32_t Color)
00870 {
00871   DrawProp[ActiveLayer].TextColor = Color;
00872 }
00873
00874 /**
00875   * @brief  Gets the LCD text color.
00876   * @retval Used text color.
00877   */
00878 uint32_t BSP_LCD_GetTextColor(void)
00879 {
00880   return DrawProp[ActiveLayer].TextColor;
00881 }
00882
00883 /**
00884   * @brief  Sets the LCD background color.
00885   * @param  Color: Layer background color code ARGB(8-8-8-8)
00886   */
00887 void BSP_LCD_SetBackColor(uint32_t Color)
00888 {
00889   DrawProp[ActiveLayer].BackColor = Color;
00890 }
00891
00892 /**
00893   * @brief  Gets the LCD background color.
00894   * @retval Used background color
00895   */
00896 uint32_t BSP_LCD_GetBackColor(void)
00897 {
00898   return DrawProp[ActiveLayer].BackColor;
00899 }
00900
00901 /**
00902   * @brief  Sets the LCD text font.
00903   * @param  fonts: Layer font to be used
00904   */
00905 void BSP_LCD_SetFont(sFONT *fonts)
00906 {
00907   DrawProp[ActiveLayer].pFont = fonts;
00908 }
00909
00910 /**
00911   * @brief  Gets the LCD text font.
00912   * @retval Used layer font
00913   */
00914 sFONT *BSP_LCD_GetFont(void)
00915 {
00916   return DrawProp[ActiveLayer].pFont;
00917 }
00918
00919 /**
00920   * @brief  Reads an LCD pixel.
00921   * @param  Xpos: X position
00922   * @param  Ypos: Y position
00923   * @retval RGB pixel color
00924   */
00925 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
00926 {
00927   uint32_t ret = 0;
00928
00929   if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
00930   {
00931     /* Read data value from SDRAM memory */
00932     ret = *(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00933   }
00934   else if(hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888)
00935   {
00936     /* Read data value from SDRAM memory */
00937     ret = (*(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF);
00938   }
00939   else if((hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
00940           (hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
00941           (hltdc_discovery.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_AL88))
00942   {
00943     /* Read data value from SDRAM memory */
00944     ret = *(__IO uint16_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00945   }
00946   else
00947   {
00948     /* Read data value from SDRAM memory */
00949     ret = *(__IO uint8_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00950   }
00951
00952   return ret;
00953 }
00954
00955 /**
00956   * @brief  Clears the whole currently active layer of LTDC.
00957   * @param  Color: Color of the background
00958   * @retval None
00959   */
00960 void BSP_LCD_Clear(uint32_t Color)
00961 {
00962   /* Clear the LCD */
00963   LL_FillBuffer(ActiveLayer, (uint32_t *)(hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);
00964 }
00965
00966 /**
00967   * @brief  Clears the selected line in currently active layer.
00968   * @param  Line: Line to be cleared
00969   * @retval None
00970   */
00971 void BSP_LCD_ClearStringLine(uint32_t Line)
00972 {
00973   uint32_t color_backup = DrawProp[ActiveLayer].TextColor;
00974   DrawProp[ActiveLayer].TextColor = DrawProp[ActiveLayer].BackColor;
00975
00976   /* Draw rectangle with background color */
00977   BSP_LCD_FillRect(0, (Line * DrawProp[ActiveLayer].pFont->Height), BSP_LCD_GetXSize(), DrawProp[ActiveLayer].pFont->Height);
00978
00979   DrawProp[ActiveLayer].TextColor = color_backup;
00980   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
00981 }
00982
00983 /**
00984   * @brief  Displays one character in currently active layer.
00985   * @param  Xpos: Start column address
00986   * @param  Ypos: Line where to display the character shape.
00987   * @param  Ascii: Character ascii code
00988   *           This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
00989   * @retval None
00990   */
00991 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00992 {
00993   DrawChar(Xpos, Ypos, &DrawProp[ActiveLayer].pFont->table[(Ascii-' ') *\
00994     DrawProp[ActiveLayer].pFont->Height * ((DrawProp[ActiveLayer].pFont->Width + 7) / 8)]);
00995 }
00996
00997 /**
00998   * @brief  Displays characters in currently active layer.
00999   * @param  Xpos: X position (in pixel)
01000   * @param  Ypos: Y position (in pixel)
01001   * @param  Text: Pointer to string to display on LCD
01002   * @param  Mode: Display mode
01003   *          This parameter can be one of the following values:
01004   *            @arg  CENTER_MODE
01005   *            @arg  RIGHT_MODE
01006   *            @arg  LEFT_MODE
01007   * @retval None
01008   */
01009 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
01010 {
01011   uint16_t refcolumn = 1, i = 0;
01012   uint32_t size = 0, xsize = 0;
01013   uint8_t  *ptr = Text;
01014
01015   /* Get the text size */
01016   while (*ptr++) size ++ ;
01017
01018   /* Characters number per line */
01019   xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
01020
01021   switch (Mode)
01022   {
01023   case CENTER_MODE:
01024     {
01025       refcolumn = Xpos + ((xsize - size)* DrawProp[ActiveLayer].pFont->Width) / 2;
01026       break;
01027     }
01028   case LEFT_MODE:
01029     {
01030       refcolumn = Xpos;
01031       break;
01032     }
01033   case RIGHT_MODE:
01034     {
01035       refcolumn = - Xpos + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
01036       break;
01037     }
01038   default:
01039     {
01040       refcolumn = Xpos;
01041       break;
01042     }
01043   }
01044
01045   /* Check that the Start column is located in the screen */
01046   if ((refcolumn < 1) || (refcolumn >= 0x8000))
01047   {
01048     refcolumn = 1;
01049   }
01050
01051   /* Send the string character by character on LCD */
01052   while ((*Text != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
01053   {
01054     /* Display one character on LCD */
01055     BSP_LCD_DisplayChar(refcolumn, Ypos, *Text);
01056     /* Decrement the column position by 16 */
01057     refcolumn += DrawProp[ActiveLayer].pFont->Width;
01058
01059     /* Point on the next character */
01060     Text++;
01061     i++;
01062   }
01063
01064 }
01065
01066 /**
01067   * @brief  Displays a maximum of 60 characters on the LCD.
01068   * @param  Line: Line where to display the character shape
01069   * @param  ptr: Pointer to string to display on LCD
01070   * @retval None
01071   */
01072 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
01073 {
01074   BSP_LCD_DisplayStringAt(0, LINE(Line), ptr, LEFT_MODE);
01075 }
01076
01077 /**
01078   * @brief  Draws an horizontal line in currently active layer.
01079   * @param  Xpos: X position
01080   * @param  Ypos: Y position
01081   * @param  Length: Line length
01082   * @retval None
01083   */
01084 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
01085 {
01086   uint32_t  Xaddress = 0;
01087
01088   /* Get the line address */
01089   Xaddress = (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01090
01091   /* Write line */
01092   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, DrawProp[ActiveLayer].TextColor);
01093 }
01094
01095 /**
01096   * @brief  Draws a vertical line in currently active layer.
01097   * @param  Xpos: X position
01098   * @param  Ypos: Y position
01099   * @param  Length: Line length
01100   * @retval None
01101   */
01102 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
01103 {
01104   uint32_t  Xaddress = 0;
01105
01106   /* Get the line address */
01107   Xaddress = (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01108
01109   /* Write line */
01110   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, 1, Length, (BSP_LCD_GetXSize() - 1), DrawProp[ActiveLayer].TextColor);
01111 }
01112
01113 /**
01114   * @brief  Draws an uni-line (between two points) in currently active layer.
01115   * @param  x1: Point 1 X position
01116   * @param  y1: Point 1 Y position
01117   * @param  x2: Point 2 X position
01118   * @param  y2: Point 2 Y position
01119   * @retval None
01120   */
01121 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
01122 {
01123   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01124   yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
01125   curpixel = 0;
01126
01127   deltax = ABS(x2 - x1);        /* The difference between the x's */
01128   deltay = ABS(y2 - y1);        /* The difference between the y's */
01129   x = x1;                       /* Start x off at the first pixel */
01130   y = y1;                       /* Start y off at the first pixel */
01131
01132   if (x2 >= x1)                 /* The x-values are increasing */
01133   {
01134     xinc1 = 1;
01135     xinc2 = 1;
01136   }
01137   else                          /* The x-values are decreasing */
01138   {
01139     xinc1 = -1;
01140     xinc2 = -1;
01141   }
01142
01143   if (y2 >= y1)                 /* The y-values are increasing */
01144   {
01145     yinc1 = 1;
01146     yinc2 = 1;
01147   }
01148   else                          /* The y-values are decreasing */
01149   {
01150     yinc1 = -1;
01151     yinc2 = -1;
01152   }
01153
01154   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01155   {
01156     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01157     yinc2 = 0;                  /* Don't change the y for every iteration */
01158     den = deltax;
01159     num = deltax / 2;
01160     numadd = deltay;
01161     numpixels = deltax;         /* There are more x-values than y-values */
01162   }
01163   else                          /* There is at least one y-value for every x-value */
01164   {
01165     xinc2 = 0;                  /* Don't change the x for every iteration */
01166     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01167     den = deltay;
01168     num = deltay / 2;
01169     numadd = deltax;
01170     numpixels = deltay;         /* There are more y-values than x-values */
01171   }
01172
01173   for (curpixel = 0; curpixel <= numpixels; curpixel++)
01174   {
01175     BSP_LCD_DrawPixel(x, y, DrawProp[ActiveLayer].TextColor);   /* Draw the current pixel */
01176     num += numadd;                            /* Increase the numerator by the top of the fraction */
01177     if (num >= den)                           /* Check if numerator >= denominator */
01178     {
01179       num -= den;                             /* Calculate the new numerator value */
01180       x += xinc1;                             /* Change the x as appropriate */
01181       y += yinc1;                             /* Change the y as appropriate */
01182     }
01183     x += xinc2;                               /* Change the x as appropriate */
01184     y += yinc2;                               /* Change the y as appropriate */
01185   }
01186 }
01187
01188 /**
01189   * @brief  Draws a rectangle in currently active layer.
01190   * @param  Xpos: X position
01191   * @param  Ypos: Y position
01192   * @param  Width: Rectangle width
01193   * @param  Height: Rectangle height
01194   * @retval None
01195   */
01196 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01197 {
01198   /* Draw horizontal lines */
01199   BSP_LCD_DrawHLine(Xpos, Ypos, Width);
01200   BSP_LCD_DrawHLine(Xpos, (Ypos+ Height), Width);
01201
01202   /* Draw vertical lines */
01203   BSP_LCD_DrawVLine(Xpos, Ypos, Height);
01204   BSP_LCD_DrawVLine((Xpos + Width), Ypos, Height);
01205 }
01206
01207 /**
01208   * @brief  Draws a circle in currently active layer.
01209   * @param  Xpos: X position
01210   * @param  Ypos: Y position
01211   * @param  Radius: Circle radius
01212   * @retval None
01213   */
01214 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
01215 {
01216   int32_t   D;    /* Decision Variable */
01217   uint32_t  CurX; /* Current X Value */
01218   uint32_t  CurY; /* Current Y Value */
01219
01220   D = 3 - (Radius << 1);
01221   CurX = 0;
01222   CurY = Radius;
01223
01224   while (CurX <= CurY)
01225   {
01226     BSP_LCD_DrawPixel((Xpos + CurX), (Ypos - CurY), DrawProp[ActiveLayer].TextColor);
01227
01228     BSP_LCD_DrawPixel((Xpos - CurX), (Ypos - CurY), DrawProp[ActiveLayer].TextColor);
01229
01230     BSP_LCD_DrawPixel((Xpos + CurY), (Ypos - CurX), DrawProp[ActiveLayer].TextColor);
01231
01232     BSP_LCD_DrawPixel((Xpos - CurY), (Ypos - CurX), DrawProp[ActiveLayer].TextColor);
01233
01234     BSP_LCD_DrawPixel((Xpos + CurX), (Ypos + CurY), DrawProp[ActiveLayer].TextColor);
01235
01236     BSP_LCD_DrawPixel((Xpos - CurX), (Ypos + CurY), DrawProp[ActiveLayer].TextColor);
01237
01238     BSP_LCD_DrawPixel((Xpos + CurY), (Ypos + CurX), DrawProp[ActiveLayer].TextColor);
01239
01240     BSP_LCD_DrawPixel((Xpos - CurY), (Ypos + CurX), DrawProp[ActiveLayer].TextColor);
01241
01242     if (D < 0)
01243     {
01244       D += (CurX << 2) + 6;
01245     }
01246     else
01247     {
01248       D += ((CurX - CurY) << 2) + 10;
01249       CurY--;
01250     }
01251     CurX++;
01252   }
01253 }
01254
01255 /**
01256   * @brief  Draws an poly-line (between many points) in currently active layer.
01257   * @param  Points: Pointer to the points array
01258   * @param  PointCount: Number of points
01259   * @retval None
01260   */
01261 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount)
01262 {
01263   int16_t X = 0, Y = 0;
01264
01265   if(PointCount < 2)
01266   {
01267     return;
01268   }
01269
01270   BSP_LCD_DrawLine(Points->X, Points->Y, (Points+PointCount-1)->X, (Points+PointCount-1)->Y);
01271
01272   while(--PointCount)
01273   {
01274     X = Points->X;
01275     Y = Points->Y;
01276     Points++;
01277     BSP_LCD_DrawLine(X, Y, Points->X, Points->Y);
01278   }
01279 }
01280
01281 /**
01282   * @brief  Draws an ellipse on LCD in currently active layer.
01283   * @param  Xpos: X position
01284   * @param  Ypos: Y position
01285   * @param  XRadius: Ellipse X radius
01286   * @param  YRadius: Ellipse Y radius
01287   * @retval None
01288   */
01289 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01290 {
01291   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01292   float K = 0, rad1 = 0, rad2 = 0;
01293
01294   rad1 = XRadius;
01295   rad2 = YRadius;
01296
01297   K = (float)(rad2/rad1);
01298
01299   do {
01300     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/K)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
01301     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/K)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
01302     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/K)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
01303     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/K)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
01304
01305     e2 = err;
01306     if (e2 <= x) {
01307       err += ++x*2+1;
01308       if (-y == x && e2 <= y) e2 = 0;
01309     }
01310     if (e2 > y) err += ++y*2+1;
01311   }
01312   while (y <= 0);
01313 }
01314
01315 /**
01316   * @brief  Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.
01317   * @param  Xpos: Bmp X position in the LCD
01318   * @param  Ypos: Bmp Y position in the LCD
01319   * @param  pbmp: Pointer to Bmp picture address in the internal Flash
01320   * @retval None
01321   */
01322 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
01323 {
01324   uint32_t index = 0, width = 0, height = 0, bit_pixel = 0;
01325   uint32_t Address;
01326   uint32_t InputColorMode = 0;
01327
01328   /* Get bitmap data address offset */
01329   index = *(__IO uint16_t *) (pbmp + 10);
01330   index |= (*(__IO uint16_t *) (pbmp + 12)) << 16;
01331
01332   /* Read bitmap width */
01333   width = *(uint16_t *) (pbmp + 18);
01334   width |= (*(uint16_t *) (pbmp + 20)) << 16;
01335
01336   /* Read bitmap height */
01337   height = *(uint16_t *) (pbmp + 22);
01338   height |= (*(uint16_t *) (pbmp + 24)) << 16;
01339
01340   /* Read bit/pixel */
01341   bit_pixel = *(uint16_t *) (pbmp + 28);
01342
01343   /* Set the address */
01344   Address = hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (((BSP_LCD_GetXSize()*Ypos) + Xpos)*(4));
01345
01346   /* Get the layer pixel format */
01347   if ((bit_pixel/8) == 4)
01348   {
01349     InputColorMode = DMA2D_INPUT_ARGB8888;
01350   }
01351   else if ((bit_pixel/8) == 2)
01352   {
01353     InputColorMode = DMA2D_INPUT_RGB565;
01354   }
01355   else
01356   {
01357     InputColorMode = DMA2D_INPUT_RGB888;
01358   }
01359
01360   /* Bypass the bitmap header */
01361   pbmp += (index + (width * (height - 1) * (bit_pixel/8)));
01362
01363   /* Convert picture to ARGB8888 pixel format */
01364   for(index=0; index < height; index++)
01365   {
01366     /* Pixel format conversion */
01367     LL_ConvertLineToARGB8888((uint32_t *)pbmp, (uint32_t *)Address, width, InputColorMode);
01368
01369     /* Increment the source and destination buffers */
01370     Address+=  (BSP_LCD_GetXSize()*4);
01371     pbmp -= width*(bit_pixel/8);
01372   }
01373 }
01374
01375 /**
01376   * @brief  Draws a full rectangle in currently active layer.
01377   * @param  Xpos: X position
01378   * @param  Ypos: Y position
01379   * @param  Width: Rectangle width
01380   * @param  Height: Rectangle height
01381   * @retval None
01382   */
01383 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01384 {
01385   uint32_t  Xaddress = 0;
01386
01387   /* Set the text color */
01388   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01389
01390   /* Get the rectangle start address */
01391   Xaddress = (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01392
01393   /* Fill the rectangle */
01394   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Width, Height, (BSP_LCD_GetXSize() - Width), DrawProp[ActiveLayer].TextColor);
01395 }
01396
01397 /**
01398   * @brief  Draws a full circle in currently active layer.
01399   * @param  Xpos: X position
01400   * @param  Ypos: Y position
01401   * @param  Radius: Circle radius
01402   * @retval None
01403   */
01404 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
01405 {
01406   int32_t  D;     /* Decision Variable */
01407   uint32_t  CurX; /* Current X Value */
01408   uint32_t  CurY; /* Current Y Value */
01409
01410   D = 3 - (Radius << 1);
01411
01412   CurX = 0;
01413   CurY = Radius;
01414
01415   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01416
01417   while (CurX <= CurY)
01418   {
01419     if(CurY > 0)
01420     {
01421       BSP_LCD_DrawHLine(Xpos - CurY, Ypos + CurX, 2*CurY);
01422       BSP_LCD_DrawHLine(Xpos - CurY, Ypos - CurX, 2*CurY);
01423     }
01424
01425     if(CurX > 0)
01426     {
01427       BSP_LCD_DrawHLine(Xpos - CurX, Ypos - CurY, 2*CurX);
01428       BSP_LCD_DrawHLine(Xpos - CurX, Ypos + CurY, 2*CurX);
01429     }
01430     if (D < 0)
01431     {
01432       D += (CurX << 2) + 6;
01433     }
01434     else
01435     {
01436       D += ((CurX - CurY) << 2) + 10;
01437       CurY--;
01438     }
01439     CurX++;
01440   }
01441
01442   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01443   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
01444 }
01445
01446 /**
01447   * @brief  Draws a full poly-line (between many points) in currently active layer.
01448   * @param  Points: Pointer to the points array
01449   * @param  PointCount: Number of points
01450   * @retval None
01451   */
01452 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount)
01453 {
01454   int16_t X = 0, Y = 0, X2 = 0, Y2 = 0, X_center = 0, Y_center = 0, X_first = 0, Y_first = 0, pixelX = 0, pixelY = 0, counter = 0;
01455   uint16_t  IMAGE_LEFT = 0, IMAGE_RIGHT = 0, IMAGE_TOP = 0, IMAGE_BOTTOM = 0;
01456
01457   IMAGE_LEFT = IMAGE_RIGHT = Points->X;
01458   IMAGE_TOP= IMAGE_BOTTOM = Points->Y;
01459
01460   for(counter = 1; counter < PointCount; counter++)
01461   {
01462     pixelX = POLY_X(counter);
01463     if(pixelX < IMAGE_LEFT)
01464     {
01465       IMAGE_LEFT = pixelX;
01466     }
01467     if(pixelX > IMAGE_RIGHT)
01468     {
01469       IMAGE_RIGHT = pixelX;
01470     }
01471
01472     pixelY = POLY_Y(counter);
01473     if(pixelY < IMAGE_TOP)
01474     {
01475       IMAGE_TOP = pixelY;
01476     }
01477     if(pixelY > IMAGE_BOTTOM)
01478     {
01479       IMAGE_BOTTOM = pixelY;
01480     }
01481   }
01482
01483   if(PointCount < 2)
01484   {
01485     return;
01486   }
01487
01488   X_center = (IMAGE_LEFT + IMAGE_RIGHT)/2;
01489   Y_center = (IMAGE_BOTTOM + IMAGE_TOP)/2;
01490
01491   X_first = Points->X;
01492   Y_first = Points->Y;
01493
01494   while(--PointCount)
01495   {
01496     X = Points->X;
01497     Y = Points->Y;
01498     Points++;
01499     X2 = Points->X;
01500     Y2 = Points->Y;
01501
01502     FillTriangle(X, X2, X_center, Y, Y2, Y_center);
01503     FillTriangle(X, X_center, X2, Y, Y_center, Y2);
01504     FillTriangle(X_center, X2, X, Y_center, Y2, Y);
01505   }
01506
01507   FillTriangle(X_first, X2, X_center, Y_first, Y2, Y_center);
01508   FillTriangle(X_first, X_center, X2, Y_first, Y_center, Y2);
01509   FillTriangle(X_center, X2, X_first, Y_center, Y2, Y_first);
01510 }
01511
01512 /**
01513   * @brief  Draws a full ellipse in currently active layer.
01514   * @param  Xpos: X position
01515   * @param  Ypos: Y position
01516   * @param  XRadius: Ellipse X radius
01517   * @param  YRadius: Ellipse Y radius
01518   * @retval None
01519   */
01520 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01521 {
01522   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01523   float K = 0, rad1 = 0, rad2 = 0;
01524
01525   rad1 = XRadius;
01526   rad2 = YRadius;
01527
01528   K = (float)(rad2/rad1);
01529
01530   do
01531   {
01532     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/K)), (Ypos+y), (2*(uint16_t)(x/K) + 1));
01533     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/K)), (Ypos-y), (2*(uint16_t)(x/K) + 1));
01534
01535     e2 = err;
01536     if (e2 <= x)
01537     {
01538       err += ++x*2+1;
01539       if (-y == x && e2 <= y) e2 = 0;
01540     }
01541     if (e2 > y) err += ++y*2+1;
01542   }
01543   while (y <= 0);
01544 }
01545
01546 /**
01547   * @brief  Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().
01548   *         Exit DSI ULPM mode if was allowed and configured in Dsi Configuration.
01549   * @retval None
01550   */
01551 void BSP_LCD_DisplayOn(void)
01552 {
01553 #if defined(USE_LCD_HDMI)
01554   if(ADV7533_ID == adv7533_drv.ReadID(ADV7533_CEC_DSI_I2C_ADDR))
01555   {
01556     return ; /* Not supported for HDMI display */
01557   }
01558   else
01559 #endif /* USE_LCD_HDMI */
01560   {
01561
01562     /* Send Display on DCS command to display */
01563     HAL_DSI_ShortWrite(&(hdsi_discovery),
01564                        hdsivideo_handle.VirtualChannelID,
01565                        DSI_DCS_SHORT_PKT_WRITE_P1,
01566                        OTM8009A_CMD_DISPON,
01567                        0x00);
01568   }
01569
01570 }
01571
01572 /**
01573   * @brief  Switch Off the display.
01574   *         Enter DSI ULPM mode if was allowed and configured in Dsi Configuration.
01575   * @retval None
01576   */
01577 void BSP_LCD_DisplayOff(void)
01578 {
01579 #if defined(USE_LCD_HDMI)
01580   if(ADV7533_ID == adv7533_drv.ReadID(ADV7533_CEC_DSI_I2C_ADDR))
01581   {
01582     return ; /* Not supported for HDMI yet */
01583   }
01584   else
01585 #endif /* USE_LCD_HDMI */
01586   {
01587     /* Send Display off DCS Command to display */
01588     HAL_DSI_ShortWrite(&(hdsi_discovery),
01589                        hdsivideo_handle.VirtualChannelID,
01590                        DSI_DCS_SHORT_PKT_WRITE_P1,
01591                        OTM8009A_CMD_DISPOFF,
01592                        0x00);
01593   }
01594
01595 }
01596
01597 /**
01598   * @brief  Set the brightness value
01599   * @param  BrightnessValue: [00: Min (black), 100 Max]
01600   * @retval None
01601   */
01602 void BSP_LCD_SetBrightness(uint8_t BrightnessValue)
01603 {
01604 #if defined(USE_LCD_HDMI)
01605   if(ADV7533_ID == adv7533_drv.ReadID(ADV7533_CEC_DSI_I2C_ADDR))
01606   {
01607     return ;  /* Not supported for HDMI display */
01608   }
01609   else
01610 #endif /* USE_LCD_HDMI */
01611   {
01612     /* Send Display on DCS command to display */
01613     HAL_DSI_ShortWrite(&hdsi_discovery,
01614                        LCD_OTM8009A_ID,
01615                        DSI_DCS_SHORT_PKT_WRITE_P1,
01616                        OTM8009A_CMD_WRDISBV, (uint16_t)(BrightnessValue * 255)/100);
01617   }
01618
01619 }
01620
01621 /**
01622   * @brief  DCS or Generic short/long write command
01623   * @param  NbrParams: Number of parameters. It indicates the write command mode:
01624   *                 If inferior to 2, a long write command is performed else short.
01625   * @param  pParams: Pointer to parameter values table.
01626   * @retval None
01627   */
01628 void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams)
01629 {
01630   if(NbrParams <= 1)
01631   {
01632    HAL_DSI_ShortWrite(&hdsi_discovery, LCD_OTM8009A_ID, DSI_DCS_SHORT_PKT_WRITE_P1, pParams[0], pParams[1]);
01633   }
01634   else
01635   {
01636    HAL_DSI_LongWrite(&hdsi_discovery,  LCD_OTM8009A_ID, DSI_DCS_LONG_PKT_WRITE, NbrParams, pParams[NbrParams], pParams);
01637   }
01638 }
01639
01640 /**
01641   * @brief  Returns the ID of connected screen by checking the HDMI
01642   *        (adv7533 component) ID or LCD DSI (via TS ID) ID.
01643   * @retval LCD ID
01644   */
01645 static uint16_t LCD_IO_GetID(void)
01646 {
01647 #if defined(USE_LCD_HDMI)
01648   HDMI_IO_Init();
01649
01650   HDMI_IO_Delay(60);
01651
01652   if(ADV7533_ID == adv7533_drv.ReadID(ADV7533_CEC_DSI_I2C_ADDR))
01653   {
01654     return ADV7533_ID;
01655   }
01656   else if(HDMI_IO_Read(LCD_DSI_ADDRESS, LCD_DSI_ID_REG) == LCD_DSI_ID)
01657   {
01658     return LCD_DSI_ID;
01659   }
01660   else
01661   {
01662     return 0;
01663   }
01664 #else
01665   return LCD_DSI_ID;
01666 #endif /* USE_LCD_HDMI */
01667
01668 }
01669
01670 /*******************************************************************************
01671                        LTDC, DMA2D and DSI BSP Routines
01672 *******************************************************************************/
01673 /**
01674   * @brief  De-Initializes the BSP LCD Msp
01675   *         Application can surcharge if needed this function implementation.
01676   * @retval None
01677   */
01678 __weak void BSP_LCD_MspDeInit(void)
01679 {
01680   /** @brief Disable IRQ of LTDC IP */
01681   HAL_NVIC_DisableIRQ(LTDC_IRQn);
01682
01683   /** @brief Disable IRQ of DMA2D IP */
01684   HAL_NVIC_DisableIRQ(DMA2D_IRQn);
01685
01686   /** @brief Disable IRQ of DSI IP */
01687   HAL_NVIC_DisableIRQ(DSI_IRQn);
01688
01689   /** @brief Force and let in reset state LTDC, DMA2D and DSI Host + Wrapper IPs */
01690   __HAL_RCC_LTDC_FORCE_RESET();
01691   __HAL_RCC_DMA2D_FORCE_RESET();
01692   __HAL_RCC_DSI_FORCE_RESET();
01693
01694   /** @brief Disable the LTDC, DMA2D and DSI Host and Wrapper clocks */
01695   __HAL_RCC_LTDC_CLK_DISABLE();
01696   __HAL_RCC_DMA2D_CLK_DISABLE();
01697   __HAL_RCC_DSI_CLK_DISABLE();
01698 }
01699
01700 /**
01701   * @brief  Initialize the BSP LCD Msp.
01702   *         Application can surcharge if needed this function implementation
01703   * @retval None
01704   */
01705 __weak void BSP_LCD_MspInit(void)
01706 {
01707   /** @brief Enable the LTDC clock */
01708   __HAL_RCC_LTDC_CLK_ENABLE();
01709
01710   /** @brief Toggle Sw reset of LTDC IP */
01711   __HAL_RCC_LTDC_FORCE_RESET();
01712   __HAL_RCC_LTDC_RELEASE_RESET();
01713
01714   /** @brief Enable the DMA2D clock */
01715   __HAL_RCC_DMA2D_CLK_ENABLE();
01716
01717   /** @brief Toggle Sw reset of DMA2D IP */
01718   __HAL_RCC_DMA2D_FORCE_RESET();
01719   __HAL_RCC_DMA2D_RELEASE_RESET();
01720
01721   /** @brief Enable DSI Host and wrapper clocks */
01722   __HAL_RCC_DSI_CLK_ENABLE();
01723
01724   /** @brief Soft Reset the DSI Host and wrapper */
01725   __HAL_RCC_DSI_FORCE_RESET();
01726   __HAL_RCC_DSI_RELEASE_RESET();
01727
01728   /** @brief NVIC configuration for LTDC interrupt that is now enabled */
01729   HAL_NVIC_SetPriority(LTDC_IRQn, 0x0F, 0);
01730   HAL_NVIC_EnableIRQ(LTDC_IRQn);
01731
01732   /** @brief NVIC configuration for DMA2D interrupt that is now enabled */
01733   HAL_NVIC_SetPriority(DMA2D_IRQn, 0x0F, 0);
01734   HAL_NVIC_EnableIRQ(DMA2D_IRQn);
01735
01736   /** @brief NVIC configuration for DSI interrupt that is now enabled */
01737   HAL_NVIC_SetPriority(DSI_IRQn, 0x0F, 0);
01738   HAL_NVIC_EnableIRQ(DSI_IRQn);
01739 }
01740
01741 /**
01742   * @brief  Draws a pixel on LCD.
01743   * @param  Xpos: X position
01744   * @param  Ypos: Y position
01745   * @param  RGB_Code: Pixel color in ARGB mode (8-8-8-8)
01746   * @retval None
01747   */
01748 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
01749 {
01750   /* Write data value to all SDRAM memory */
01751   *(__IO uint32_t*) (hltdc_discovery.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
01752 }
01753 /**
01754   * @}
01755   */
01756
01757 /** @defgroup STM32H747I_DISCOVERY_LCD_Private_Functions Private Functions
01758   * @{
01759   */
01760
01761 /**
01762   * @brief  Draws a character on LCD.
01763   * @param  Xpos: Line where to display the character shape
01764   * @param  Ypos: Start column address
01765   * @param  c: Pointer to the character data
01766   * @retval None
01767   */
01768 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
01769 {
01770   uint32_t i = 0, j = 0;
01771   uint16_t height, width;
01772   uint8_t  offset;
01773   uint8_t  *pchar;
01774   uint32_t line;
01775
01776   height = DrawProp[ActiveLayer].pFont->Height;
01777   width  = DrawProp[ActiveLayer].pFont->Width;
01778
01779   offset =  8 *((width + 7)/8) -  width ;
01780
01781   for(i = 0; i < height; i++)
01782   {
01783     pchar = ((uint8_t *)c + (width + 7)/8 * i);
01784
01785     switch(((width + 7)/8))
01786     {
01787
01788     case 1:
01789       line =  pchar[0];
01790       break;
01791
01792     case 2:
01793       line =  (pchar[0]<< 8) | pchar[1];
01794       break;
01795
01796     case 3:
01797     default:
01798       line =  (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];
01799       break;
01800     }
01801
01802     for (j = 0; j < width; j++)
01803     {
01804       if(line & (1 << (width- j + offset- 1)))
01805       {
01806         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].TextColor);
01807       }
01808       else
01809       {
01810         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].BackColor);
01811       }
01812     }
01813     Ypos++;
01814   }
01815 }
01816
01817 /**
01818   * @brief  Fills a triangle (between 3 points).
01819   * @param  x1: Point 1 X position
01820   * @param  y1: Point 1 Y position
01821   * @param  x2: Point 2 X position
01822   * @param  y2: Point 2 Y position
01823   * @param  x3: Point 3 X position
01824   * @param  y3: Point 3 Y position
01825   * @retval None
01826   */
01827 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
01828 {
01829   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01830   yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
01831   curpixel = 0;
01832
01833   deltax = ABS(x2 - x1);        /* The difference between the x's */
01834   deltay = ABS(y2 - y1);        /* The difference between the y's */
01835   x = x1;                       /* Start x off at the first pixel */
01836   y = y1;                       /* Start y off at the first pixel */
01837
01838   if (x2 >= x1)                 /* The x-values are increasing */
01839   {
01840     xinc1 = 1;
01841     xinc2 = 1;
01842   }
01843   else                          /* The x-values are decreasing */
01844   {
01845     xinc1 = -1;
01846     xinc2 = -1;
01847   }
01848
01849   if (y2 >= y1)                 /* The y-values are increasing */
01850   {
01851     yinc1 = 1;
01852     yinc2 = 1;
01853   }
01854   else                          /* The y-values are decreasing */
01855   {
01856     yinc1 = -1;
01857     yinc2 = -1;
01858   }
01859
01860   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01861   {
01862     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01863     yinc2 = 0;                  /* Don't change the y for every iteration */
01864     den = deltax;
01865     num = deltax / 2;
01866     numadd = deltay;
01867     numpixels = deltax;         /* There are more x-values than y-values */
01868   }
01869   else                          /* There is at least one y-value for every x-value */
01870   {
01871     xinc2 = 0;                  /* Don't change the x for every iteration */
01872     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01873     den = deltay;
01874     num = deltay / 2;
01875     numadd = deltax;
01876     numpixels = deltay;         /* There are more y-values than x-values */
01877   }
01878
01879   for (curpixel = 0; curpixel <= numpixels; curpixel++)
01880   {
01881     BSP_LCD_DrawLine(x, y, x3, y3);
01882
01883     num += numadd;              /* Increase the numerator by the top of the fraction */
01884     if (num >= den)             /* Check if numerator >= denominator */
01885     {
01886       num -= den;               /* Calculate the new numerator value */
01887       x += xinc1;               /* Change the x as appropriate */
01888       y += yinc1;               /* Change the y as appropriate */
01889     }
01890     x += xinc2;                 /* Change the x as appropriate */
01891     y += yinc2;                 /* Change the y as appropriate */
01892   }
01893 }
01894
01895 /**
01896   * @brief  Fills a buffer.
01897   * @param  LayerIndex: Layer index
01898   * @param  pDst: Pointer to destination buffer
01899   * @param  xSize: Buffer width
01900   * @param  ySize: Buffer height
01901   * @param  OffLine: Offset
01902   * @param  ColorIndex: Color index
01903   * @retval None
01904   */
01905 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
01906 {
01907   /* Register to memory mode with ARGB8888 as color Mode */
01908   hdma2d_discovery.Init.Mode         = DMA2D_R2M;
01909   hdma2d_discovery.Init.ColorMode    = DMA2D_OUTPUT_ARGB8888;
01910   hdma2d_discovery.Init.OutputOffset = OffLine;
01911
01912   hdma2d_discovery.Instance = DMA2D;
01913
01914   /* DMA2D Initialization */
01915   if(HAL_DMA2D_Init(&hdma2d_discovery) == HAL_OK)
01916   {
01917     if(HAL_DMA2D_ConfigLayer(&hdma2d_discovery, 1) == HAL_OK)
01918     {
01919       if (HAL_DMA2D_Start(&hdma2d_discovery, ColorIndex, (uint32_t)pDst, xSize, ySize) == HAL_OK)
01920       {
01921         /* Polling For DMA transfer */
01922         HAL_DMA2D_PollForTransfer(&hdma2d_discovery, 25);
01923       }
01924     }
01925   }
01926 }
01927
01928 /**
01929   * @brief  Converts a line to an ARGB8888 pixel format.
01930   * @param  pSrc: Pointer to source buffer
01931   * @param  pDst: Output color
01932   * @param  xSize: Buffer width
01933   * @param  ColorMode: Input color mode
01934   * @retval None
01935   */
01936 static void LL_ConvertLineToARGB8888(void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
01937 {
01938   /* Configure the DMA2D Mode, Color Mode and output offset */
01939   hdma2d_discovery.Init.Mode         = DMA2D_M2M_PFC;
01940   hdma2d_discovery.Init.ColorMode    = DMA2D_OUTPUT_ARGB8888;
01941   hdma2d_discovery.Init.OutputOffset = 0;
01942
01943   /* Foreground Configuration */
01944   hdma2d_discovery.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
01945   hdma2d_discovery.LayerCfg[1].InputAlpha = 0xFF;
01946   hdma2d_discovery.LayerCfg[1].InputColorMode = ColorMode;
01947   hdma2d_discovery.LayerCfg[1].InputOffset = 0;
01948
01949   hdma2d_discovery.Instance = DMA2D;
01950
01951   /* DMA2D Initialization */
01952   if(HAL_DMA2D_Init(&hdma2d_discovery) == HAL_OK)
01953   {
01954     if(HAL_DMA2D_ConfigLayer(&hdma2d_discovery, 1) == HAL_OK)
01955     {
01956       if (HAL_DMA2D_Start(&hdma2d_discovery, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1) == HAL_OK)
01957       {
01958         /* Polling For DMA transfer */
01959         HAL_DMA2D_PollForTransfer(&hdma2d_discovery, 25);
01960       }
01961     }
01962   }
01963 }
01964
01965 /**
01966   * @}
01967   */
01968
01969 /**
01970   * @}
01971   */
01972
01973 /**
01974   * @}
01975   */
01976
01977 /**
01978   * @}
01979   */
01980
01981 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_lcd.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_LCD_H
00023 #define __STM32H747I_DISCOVERY_LCD_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 /* Include LCD component Driver */
00031
00032 /* Include OTM8009A LCD Driver IC driver code */
00033 #include "../Components/otm8009a/otm8009a.h"
00034
00035 #if defined(USE_LCD_HDMI)
00036 /* Include ADV7533 HDMI Driver IC driver code */
00037 #include "../Components/adv7533/adv7533.h"
00038 #endif /* USE_LCD_HDMI */
00039
00040 /* Include SDRAM Driver */
00041 #include "stm32h747i_discovery_sdram.h"
00042 #include "stm32h747i_discovery.h"
00043
00044 #include "../../../Utilities/Fonts/fonts.h"
00045
00046 #include <string.h> /* use of memset() */
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32H747I_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32H747I_DISCOVERY_LCD
00057   * @{
00058   */
00059
00060 /** @defgroup STM32H747I_DISCOVERY_LCD_Exported_Constants Exported Constants
00061   * @{
00062   */
00063 #define BSP_LCD_DMA2D_IRQHandler        DMA2D_IRQHandler
00064 #define BSP_LCD_DSI_IRQHandler          DSI_IRQHandler
00065 #define BSP_LCD_LTDC_IRQHandler         LTDC_IRQHandler
00066 #define BSP_LCD_LTDC_ER_IRQHandler      LTDC_ER_IRQHandler
00067
00068
00069 #define LCD_LayerCfgTypeDef    LTDC_LayerCfgTypeDef
00070 /**
00071   * @brief  LCD FB_StartAddress
00072   */
00073 #define LCD_FB_START_ADDRESS       ((uint32_t)0xD0000000)
00074
00075 /** @brief Maximum number of LTDC layers
00076  */
00077 #define LTDC_MAX_LAYER_NUMBER             ((uint32_t) 2)
00078
00079 /** @brief LTDC Background layer index
00080  */
00081 #define LTDC_ACTIVE_LAYER_BACKGROUND      ((uint32_t) 0)
00082
00083 /** @brief LTDC Foreground layer index
00084  */
00085 #define LTDC_ACTIVE_LAYER_FOREGROUND      ((uint32_t) 1)
00086
00087 /** @brief Number of LTDC layers
00088  */
00089 #define LTDC_NB_OF_LAYERS                 ((uint32_t) 2)
00090
00091 /** @brief LTDC Default used layer index
00092  */
00093 #define LTDC_DEFAULT_ACTIVE_LAYER         LTDC_ACTIVE_LAYER_FOREGROUND
00094
00095 /**
00096   * @brief  LCD status structure definition
00097   */
00098 #define   LCD_OK         0x00
00099 #define   LCD_ERROR      0x01
00100 #define   LCD_TIMEOUT    0x02
00101
00102 /**
00103   * @brief  LCD Display OTM8009A ID
00104   */
00105 #define LCD_OTM8009A_ID  ((uint32_t) 0)
00106
00107 #if defined(USE_LCD_HDMI)
00108 /**
00109   * @brief  HDMI ADV7533 DSI Virtual Channel  ID
00110   */
00111 #define HDMI_ADV7533_ID  ((uint32_t) 0)
00112
00113 /**
00114   * @brief  HDMI Foramt
00115   */
00116 #define HDMI_FORMAT_720_480   ((uint8_t) 0x00) /*720_480 format choice of HDMI display */
00117 #define HDMI_FORMAT_720_576   ((uint8_t) 0x01) /*720_576 format choice of HDMI display*/
00118
00119 #endif /* USE_LCD_HDMI */
00120
00121 /**
00122   * @brief  LCD color definitions values
00123   * in ARGB8888 format.
00124   */
00125
00126 /** @brief Blue value in ARGB8888 format
00127  */
00128 #define LCD_COLOR_BLUE          ((uint32_t) 0xFF0000FF)
00129
00130 /** @brief Green value in ARGB8888 format
00131  */
00132 #define LCD_COLOR_GREEN         ((uint32_t) 0xFF00FF00)
00133
00134 /** @brief Red value in ARGB8888 format
00135  */
00136 #define LCD_COLOR_RED           ((uint32_t) 0xFFFF0000)
00137
00138 /** @brief Cyan value in ARGB8888 format
00139  */
00140 #define LCD_COLOR_CYAN          ((uint32_t) 0xFF00FFFF)
00141
00142 /** @brief Magenta value in ARGB8888 format
00143  */
00144 #define LCD_COLOR_MAGENTA       ((uint32_t) 0xFFFF00FF)
00145
00146 /** @brief Yellow value in ARGB8888 format
00147  */
00148 #define LCD_COLOR_YELLOW        ((uint32_t) 0xFFFFFF00)
00149
00150 /** @brief Light Blue value in ARGB8888 format
00151  */
00152 #define LCD_COLOR_LIGHTBLUE     ((uint32_t) 0xFF8080FF)
00153
00154 /** @brief Light Green value in ARGB8888 format
00155  */
00156 #define LCD_COLOR_LIGHTGREEN    ((uint32_t) 0xFF80FF80)
00157
00158 /** @brief Light Red value in ARGB8888 format
00159  */
00160 #define LCD_COLOR_LIGHTRED      ((uint32_t) 0xFFFF8080)
00161
00162 /** @brief Light Cyan value in ARGB8888 format
00163  */
00164 #define LCD_COLOR_LIGHTCYAN     ((uint32_t) 0xFF80FFFF)
00165
00166 /** @brief Light Magenta value in ARGB8888 format
00167  */
00168 #define LCD_COLOR_LIGHTMAGENTA  ((uint32_t) 0xFFFF80FF)
00169
00170 /** @brief Light Yellow value in ARGB8888 format
00171  */
00172 #define LCD_COLOR_LIGHTYELLOW   ((uint32_t) 0xFFFFFF80)
00173
00174 /** @brief Dark Blue value in ARGB8888 format
00175  */
00176 #define LCD_COLOR_DARKBLUE      ((uint32_t) 0xFF000080)
00177
00178 /** @brief Light Dark Green value in ARGB8888 format
00179  */
00180 #define LCD_COLOR_DARKGREEN     ((uint32_t) 0xFF008000)
00181
00182 /** @brief Light Dark Red value in ARGB8888 format
00183  */
00184 #define LCD_COLOR_DARKRED       ((uint32_t) 0xFF800000)
00185
00186 /** @brief Dark Cyan value in ARGB8888 format
00187  */
00188 #define LCD_COLOR_DARKCYAN      ((uint32_t) 0xFF008080)
00189
00190 /** @brief Dark Magenta value in ARGB8888 format
00191  */
00192 #define LCD_COLOR_DARKMAGENTA   ((uint32_t) 0xFF800080)
00193
00194 /** @brief Dark Yellow value in ARGB8888 format
00195  */
00196 #define LCD_COLOR_DARKYELLOW    ((uint32_t) 0xFF808000)
00197
00198 /** @brief White value in ARGB8888 format
00199  */
00200 #define LCD_COLOR_WHITE         ((uint32_t) 0xFFFFFFFF)
00201
00202 /** @brief Light Gray value in ARGB8888 format
00203  */
00204 #define LCD_COLOR_LIGHTGRAY     ((uint32_t) 0xFFD3D3D3)
00205
00206 /** @brief Gray value in ARGB8888 format
00207  */
00208 #define LCD_COLOR_GRAY          ((uint32_t) 0xFF808080)
00209
00210 /** @brief Dark Gray value in ARGB8888 format
00211  */
00212 #define LCD_COLOR_DARKGRAY      ((uint32_t) 0xFF404040)
00213
00214 /** @brief Black value in ARGB8888 format
00215  */
00216 #define LCD_COLOR_BLACK         ((uint32_t) 0xFF000000)
00217
00218 /** @brief Brown value in ARGB8888 format
00219  */
00220 #define LCD_COLOR_BROWN         ((uint32_t) 0xFFA52A2A)
00221
00222 /** @brief Orange value in ARGB8888 format
00223  */
00224 #define LCD_COLOR_ORANGE        ((uint32_t) 0xFFFFA500)
00225
00226 /** @brief Transparent value in ARGB8888 format
00227  */
00228 #define LCD_COLOR_TRANSPARENT   ((uint32_t) 0xFF000000)
00229
00230 /**
00231   * @brief LCD default font
00232   */
00233 #define LCD_DEFAULT_FONT        Font24
00234
00235 /**
00236  *  @brief  Possible values of
00237  *  pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets
00238  */
00239
00240 #define   LCD_DSI_PIXEL_DATA_FMT_RBG888  DSI_RGB888 /*!< DSI packet pixel format chosen is RGB888 : 24 bpp */
00241 #define   LCD_DSI_PIXEL_DATA_FMT_RBG565  DSI_RGB565 /*!< DSI packet pixel format chosen is RGB565 : 16 bpp */
00242
00243 /**
00244   * @}
00245   */
00246
00247 /** @defgroup STM32H747I_DISCOVERY_LCD_Exported_Types Exported Types
00248   * @{
00249   */
00250
00251 /**
00252   * @brief  LCD Drawing main properties
00253   */
00254 typedef struct
00255 {
00256   uint32_t TextColor; /*!< Specifies the color of text */
00257   uint32_t BackColor; /*!< Specifies the background color below the text */
00258   sFONT    *pFont;    /*!< Specifies the font used for the text */
00259
00260 } LCD_DrawPropTypeDef;
00261
00262 /**
00263   * @brief  LCD Drawing point (pixel) geometric definition
00264   */
00265 typedef struct
00266 {
00267   int16_t X; /*!< geometric X position of drawing */
00268   int16_t Y; /*!< geometric Y position of drawing */
00269
00270 } Point;
00271
00272 /**
00273   * @brief  Pointer on LCD Drawing point (pixel) geometric definition
00274   */
00275 typedef Point * pPoint;
00276
00277 /**
00278   * @brief  LCD drawing Line alignment mode definitions
00279   */
00280 typedef enum
00281 {
00282   CENTER_MODE             = 0x01,    /*!< Center mode */
00283   RIGHT_MODE              = 0x02,    /*!< Right mode  */
00284   LEFT_MODE               = 0x03     /*!< Left mode   */
00285
00286 } Text_AlignModeTypdef;
00287
00288
00289 /**
00290   *  @brief LCD_OrientationTypeDef
00291   *  Possible values of Display Orientation
00292   */
00293 typedef enum
00294 {
00295   LCD_ORIENTATION_PORTRAIT  = 0x00, /*!< Portrait orientation choice of LCD screen  */
00296   LCD_ORIENTATION_LANDSCAPE = 0x01, /*!< Landscape orientation choice of LCD screen */
00297   LCD_ORIENTATION_INVALID   = 0x02  /*!< Invalid orientation choice of LCD screen   */
00298 } LCD_OrientationTypeDef;
00299
00300 /**
00301   * @}
00302   */
00303
00304 /** @addtogroup STM32H747I_DISCOVERY_LCD_Exported_Functions
00305   * @{
00306   */
00307 uint8_t  BSP_LCD_Init(void);
00308 uint8_t  BSP_LCD_InitEx(LCD_OrientationTypeDef orientation);
00309
00310 #if defined(USE_LCD_HDMI)
00311 uint8_t  BSP_LCD_HDMIInitEx(uint8_t format);
00312 #endif /* USE_LCD_HDMI */
00313
00314 void     BSP_LCD_MspDeInit(void);
00315 void     BSP_LCD_MspInit(void);
00316 void     BSP_LCD_Reset(void);
00317
00318 uint32_t BSP_LCD_GetXSize(void);
00319 uint32_t BSP_LCD_GetYSize(void);
00320 void     BSP_LCD_SetXSize(uint32_t imageWidthPixels);
00321 void     BSP_LCD_SetYSize(uint32_t imageHeightPixels);
00322
00323 void     BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address);
00324 void     BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
00325 void     BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
00326 void     BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
00327 void     BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
00328 void     BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00329
00330 void     BSP_LCD_SelectLayer(uint32_t LayerIndex);
00331 void     BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
00332
00333 void     BSP_LCD_SetTextColor(uint32_t Color);
00334 uint32_t BSP_LCD_GetTextColor(void);
00335 void     BSP_LCD_SetBackColor(uint32_t Color);
00336 uint32_t BSP_LCD_GetBackColor(void);
00337 void     BSP_LCD_SetFont(sFONT *fonts);
00338 sFONT    *BSP_LCD_GetFont(void);
00339
00340 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00341 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
00342 void     BSP_LCD_Clear(uint32_t Color);
00343 void     BSP_LCD_ClearStringLine(uint32_t Line);
00344 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00345 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
00346 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00347
00348 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00349 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00350 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00351 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00352 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00353 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00354 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00355 void     BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
00356
00357 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00358 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00359 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00360 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00361
00362 void     BSP_LCD_DisplayOff(void);
00363 void     BSP_LCD_DisplayOn(void);
00364 void     BSP_LCD_SetBrightness(uint8_t BrightnessValue);
00365 /**
00366   * @}
00367   */
00368
00369 /** @addtogroup STM32H747I_DISCOVERY_LCD_Exported_Variables
00370   * @{
00371   */
00372
00373 /* @brief DMA2D handle variable */
00374 extern DMA2D_HandleTypeDef hdma2d_discovery;
00375
00376 /**
00377   * @}
00378   */
00379
00380 /**
00381   * @}
00382   */
00383
00384 /**
00385   * @}
00386   */
00387
00388 /**
00389   * @}
00390   */
00391
00392 /**
00393   * @}
00394   */
00395
00396 #ifdef __cplusplus
00397 }
00398 #endif
00399
00400 #endif /* __STM32H747I_DISCOVERY_LCD_H */
00401
00402 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_qspi.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_qspi.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_qspi.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the MT25TL01G QSPI
00006   *          memory mounted on STM32H747I-DISCOVERY board.
00007   @verbatim
00008   ==============================================================================
00009                      ##### How to use this driver #####
00010   ==============================================================================
00011   [..]
00012    (#) This driver is used to drive the MT25TL01G QSPI external
00013        memory mounted on STM32H747I-DISCOVERY board.
00014
00015    (#) This driver need a specific component driver (MT25TL01G) to be included with.
00016
00017    (#) Initialization steps:
00018        (++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
00019             function includes the MSP layer hardware resources initialization and the
00020             QSPI interface with the external memory.
00021
00022    (#) QSPI memory operations
00023        (++) QSPI 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_QSPI_Read()/BSP_QSPI_Write().
00027        (++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
00028             (see the QSPI memory data sheet)
00029        (++) Perform erase block operation using the function BSP_QSPI_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_QSPI_Erase_Chip().
00032        (++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
00033             (see the QSPI memory data sheet)
00034   @endverbatim
00035   ******************************************************************************
00036   * @attention
00037   *
00038   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00039   * All rights reserved.</center></h2>
00040   *
00041   * This software component is licensed by ST under BSD 3-Clause license,
00042   * the "License"; You may not use this file except in compliance with the
00043   * License. You may obtain a copy of the License at:
00044   *                        opensource.org/licenses/BSD-3-Clause
00045   *
00046   ******************************************************************************
00047   */
00048
00049 /* Includes ------------------------------------------------------------------*/
00050 #include "stm32h747i_discovery_qspi.h"
00051
00052 /** @addtogroup BSP
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32H747I_DISCOVERY
00057   * @{
00058   */
00059
00060 /** @defgroup STM32H747I_DISCOVERY_QSPI STM32H747I_DISCOVERY_QSPI
00061   * @{
00062   */
00063
00064
00065 /* Private variables ---------------------------------------------------------*/
00066
00067 /** @defgroup STM32H747I_DISCOVERY_QSPI_Private_Variables Private Variables
00068   * @{
00069   */
00070 QSPI_HandleTypeDef QSPIHandle;
00071
00072 /**
00073   * @}
00074   */
00075
00076 /* Private functions ---------------------------------------------------------*/
00077
00078 /** @defgroup STM32H747I_DISCOVERY_QSPI_Private_Functions Private Functions
00079   * @{
00080   */
00081 static uint8_t QSPI_ResetMemory          (QSPI_HandleTypeDef *hqspi);
00082 static uint8_t QSPI_EnterFourBytesAddress(QSPI_HandleTypeDef *hqspi);
00083 static uint8_t QSPI_DummyCyclesCfg       (QSPI_HandleTypeDef *hqspi);
00084 static uint8_t QSPI_WriteEnable          (QSPI_HandleTypeDef *hqspi);
00085 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
00086 static uint8_t QSPI_EnterQPI(QSPI_HandleTypeDef *hqspi);
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32H747I_DISCOVERY_QSPI_Exported_Functions Exported Functions
00092   * @{
00093   */
00094
00095 /**
00096   * @brief  Initializes the QSPI interface.
00097   * @retval QSPI memory status
00098   */
00099 uint8_t BSP_QSPI_Init(void)
00100 {
00101   QSPIHandle.Instance = QUADSPI;
00102
00103   /* Call the DeInit function to reset the driver */
00104   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00105   {
00106     return QSPI_ERROR;
00107   }
00108
00109   /* System level initialization */
00110   BSP_QSPI_MspInit(&QSPIHandle, NULL);
00111
00112   /* QSPI initialization */
00113   /* ClockPrescaler set to 1, so QSPI clock = 200MHz / (1+2) = 66MHz */
00114   QSPIHandle.Init.ClockPrescaler     = 2;
00115   QSPIHandle.Init.FifoThreshold      = 1;
00116   QSPIHandle.Init.SampleShifting     = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
00117   QSPIHandle.Init.FlashSize          = POSITION_VAL(MT25TL01G_FLASH_SIZE) - 1;
00118   QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_3_CYCLE;
00119   QSPIHandle.Init.ClockMode          = QSPI_CLOCK_MODE_0;
00120   QSPIHandle.Init.FlashID            = QSPI_FLASH_ID_2;
00121   QSPIHandle.Init.DualFlash          = QSPI_DUALFLASH_ENABLE;
00122
00123   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00124   {
00125     return QSPI_ERROR;
00126   }
00127
00128   /* QSPI memory reset */
00129   if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
00130   {
00131     return QSPI_NOT_SUPPORTED;
00132   }
00133
00134   /* Set the QSPI memory in 4-bytes address mode */
00135   if (QSPI_EnterFourBytesAddress(&QSPIHandle) != QSPI_OK)
00136   {
00137     return QSPI_NOT_SUPPORTED;
00138   }
00139
00140   /* Configuration of the dummy cycles on QSPI memory side */
00141   if (QSPI_DummyCyclesCfg(&QSPIHandle) != QSPI_OK)
00142   {
00143     return QSPI_NOT_SUPPORTED;
00144   }
00145
00146   return QSPI_OK;
00147 }
00148
00149 /**
00150   * @brief  De-Initializes the QSPI interface.
00151   * @retval QSPI memory status
00152   */
00153 uint8_t BSP_QSPI_DeInit(void)
00154 {
00155   QSPIHandle.Instance = QUADSPI;
00156
00157   /* Call the DeInit function to reset the driver */
00158   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00159   {
00160     return QSPI_ERROR;
00161   }
00162
00163   /* System level De-initialization */
00164   BSP_QSPI_MspDeInit(&QSPIHandle, NULL);
00165
00166   return QSPI_OK;
00167 }
00168
00169 /**
00170   * @brief  Reads an amount of data from the QSPI memory.
00171   * @param  pData: Pointer to data to be read
00172   * @param  ReadAddr: Read start address
00173   * @param  Size: Size of data to read
00174   * @retval QSPI memory status
00175   */
00176 uint8_t BSP_QSPI_Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
00177 {
00178   QSPI_CommandTypeDef s_command;
00179
00180   /* Initialize the read command */
00181   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00182   s_command.Instruction       = QUAD_INOUT_FAST_READ_DTR_CMD; /* DTR QUAD INPUT/OUTPUT FAST READ and 4-BYTE DTR FAST READ commands */
00183   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00184   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00185   s_command.Address           = ReadAddr;
00186   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00187   s_command.DataMode          = QSPI_DATA_4_LINES;
00188   s_command.DummyCycles       = MT25TL01G_DUMMY_CYCLES_READ_QUAD_DTR - 1;
00189   s_command.NbData            = Size;
00190   s_command.DdrMode           = QSPI_DDR_MODE_ENABLE;
00191   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_HALF_CLK_DELAY;
00192   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00193
00194   /* Configure the command */
00195   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00196   {
00197     return QSPI_ERROR;
00198   }
00199
00200   /* Reception of the data */
00201   if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00202   {
00203     return QSPI_ERROR;
00204   }
00205
00206   return QSPI_OK;
00207 }
00208
00209 /**
00210   * @brief  Writes an amount of data to the QSPI memory.
00211   * @param  pData: Pointer to data to be written
00212   * @param  WriteAddr: Write start address
00213   * @param  Size: Size of data to write
00214   * @retval QSPI memory status
00215   */
00216 uint8_t BSP_QSPI_Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
00217 {
00218   QSPI_CommandTypeDef s_command;
00219   uint32_t end_addr, current_size, current_addr;
00220
00221   /* Calculation of the size between the write address and the end of the page */
00222   current_size = MT25TL01G_PAGE_SIZE - (WriteAddr % MT25TL01G_PAGE_SIZE);
00223
00224   /* Check if the size of the data is less than the remaining place in the page */
00225   if (current_size > Size)
00226   {
00227     current_size = Size;
00228   }
00229
00230   /* Initialize the address variables */
00231   current_addr = WriteAddr;
00232   end_addr = WriteAddr + Size;
00233
00234   /* Initialize the program command */
00235   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00236   s_command.Instruction       = QUAD_IN_FAST_PROG_4_BYTE_ADDR_CMD;
00237   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00238   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00239   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00240   s_command.DataMode          = QSPI_DATA_4_LINES;
00241   s_command.DummyCycles       = 0;
00242   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00243   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00244   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00245
00246   /* Perform the write page by page */
00247   do
00248   {
00249     s_command.Address = current_addr;
00250     s_command.NbData  = current_size;
00251
00252     /* Enable write operations */
00253     if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00254     {
00255       return QSPI_ERROR;
00256     }
00257
00258     /* Configure the command */
00259     if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00260     {
00261       return QSPI_ERROR;
00262     }
00263
00264     /* Transmission of the data */
00265     if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00266     {
00267       return QSPI_ERROR;
00268     }
00269
00270     /* Configure automatic polling mode to wait for end of program */
00271     if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00272     {
00273       return QSPI_ERROR;
00274     }
00275
00276     /* Update the address and size variables for next page programming */
00277     current_addr += current_size;
00278     pData += current_size;
00279     current_size = ((current_addr + MT25TL01G_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : MT25TL01G_PAGE_SIZE;
00280   } while (current_addr < end_addr);
00281
00282   return QSPI_OK;
00283 }
00284
00285 /**
00286   * @brief  Erases the specified block of the QSPI memory.
00287   * @param  BlockAddress: Block address to erase
00288   * @retval QSPI memory status
00289   */
00290 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
00291 {
00292   QSPI_CommandTypeDef s_command;
00293
00294   /* Initialize the erase command */
00295   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00296   s_command.Instruction       = SUBSECTOR_ERASE_4_BYTE_ADDR_CMD;
00297   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00298   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00299   s_command.Address           = BlockAddress;
00300   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00301   s_command.DataMode          = QSPI_DATA_NONE;
00302   s_command.DummyCycles       = 0;
00303   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00304   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00305   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00306
00307   /* Enable write operations */
00308   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00309   {
00310     return QSPI_ERROR;
00311   }
00312
00313   /* Send the command */
00314   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00315   {
00316     return QSPI_ERROR;
00317   }
00318
00319   /* Configure automatic polling mode to wait for end of erase */
00320   if (QSPI_AutoPollingMemReady(&QSPIHandle, MT25TL01G_SUBSECTOR_ERASE_MAX_TIME) != QSPI_OK)
00321   {
00322     return QSPI_ERROR;
00323   }
00324
00325   return QSPI_OK;
00326 }
00327
00328 /**
00329   * @brief  Erases the entire QSPI memory.
00330   * @retval QSPI memory status
00331   */
00332 uint8_t BSP_QSPI_Erase_Chip(void)
00333 {
00334   QSPI_CommandTypeDef s_command;
00335
00336   /* Initialize the erase command */
00337   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00338   s_command.Instruction       = DIE_ERASE_CMD;
00339   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00340   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00341   s_command.DataMode          = QSPI_DATA_NONE;
00342   s_command.DummyCycles       = 0;
00343   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00344   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00345   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00346
00347   /* Enable write operations */
00348   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00349   {
00350     return QSPI_ERROR;
00351   }
00352
00353   /* Send the command */
00354   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00355   {
00356     return QSPI_ERROR;
00357   }
00358
00359   /* Configure automatic polling mode to wait for end of erase */
00360   if (QSPI_AutoPollingMemReady(&QSPIHandle, MT25TL01G_DIE_ERASE_MAX_TIME) != QSPI_OK)
00361   {
00362     return QSPI_ERROR;
00363   }
00364
00365   return QSPI_OK;
00366 }
00367
00368 /**
00369   * @brief  Reads current status of the QSPI memory.
00370   * @retval QSPI memory status
00371   */
00372 uint8_t BSP_QSPI_GetStatus(void)
00373 {
00374   QSPI_CommandTypeDef s_command;
00375   uint16_t reg;
00376
00377   /* Initialize the read flag status register command */
00378   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00379   s_command.Instruction       = READ_FLAG_STATUS_REG_CMD;
00380   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00381   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00382   s_command.DataMode          = QSPI_DATA_4_LINES;
00383   s_command.DummyCycles       = 0;
00384   s_command.NbData            = 1;
00385   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00386   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00387   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00388
00389   /* Configure the command */
00390   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00391   {
00392     return QSPI_ERROR;
00393   }
00394
00395   /* Reception of the data */
00396   if (HAL_QSPI_Receive(&QSPIHandle, (uint8_t*)(&reg), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00397   {
00398     return QSPI_ERROR;
00399   }
00400
00401   /* Check the value of the register */
00402   if ((reg & (MT25TL01G_FSR_PRERR | MT25TL01G_FSR_PGERR | MT25TL01G_FSR_ERERR)) != 0)
00403   {
00404     return QSPI_ERROR;
00405   }
00406   else if ((reg & (MT25TL01G_FSR_PGSUS | MT25TL01G_FSR_ERSUS)) != 0)
00407   {
00408     return QSPI_SUSPENDED;
00409   }
00410   else if ((reg & MT25TL01G_FSR_READY) != 0)
00411   {
00412     return QSPI_OK;
00413   }
00414   else
00415   {
00416     return QSPI_BUSY;
00417   }
00418 }
00419
00420 /**
00421   * @brief  Return the configuration of the QSPI memory.
00422   * @param  pInfo: pointer on the configuration structure
00423   * @retval QSPI memory status
00424   */
00425 uint8_t BSP_QSPI_GetInfo(QSPI_Info* pInfo)
00426 {
00427   /* Configure the structure with the memory configuration */
00428   pInfo->FlashSize          = MT25TL01G_FLASH_SIZE;
00429   pInfo->EraseSectorSize    = (2 * MT25TL01G_SUBSECTOR_SIZE);
00430   pInfo->ProgPageSize       = MT25TL01G_PAGE_SIZE;
00431   pInfo->EraseSectorsNumber = (MT25TL01G_FLASH_SIZE/pInfo->EraseSectorSize);
00432   pInfo->ProgPagesNumber    = (MT25TL01G_FLASH_SIZE/pInfo->ProgPageSize);
00433
00434   return QSPI_OK;
00435 }
00436
00437 /**
00438   * @brief  Configure the QSPI in memory-mapped mode
00439   * @retval QSPI memory status
00440   */
00441 uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
00442 {
00443   QSPI_CommandTypeDef      s_command;
00444   QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
00445
00446   /* Configure the command for the read instruction */
00447   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00448   s_command.Instruction       = QUAD_INOUT_FAST_READ_DTR_CMD; /* DTR QUAD INPUT/OUTPUT FAST READ and 4-BYTE DTR FAST READ commands */
00449   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00450   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00451   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00452   s_command.DataMode          = QSPI_DATA_4_LINES;
00453   s_command.DummyCycles       = MT25TL01G_DUMMY_CYCLES_READ_QUAD_DTR - 1;
00454
00455   s_command.DdrMode           = QSPI_DDR_MODE_ENABLE;
00456   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_HALF_CLK_DELAY;
00457   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00458
00459   /* Configure the memory mapped mode */
00460   s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
00461   s_mem_mapped_cfg.TimeOutPeriod     = 0;
00462
00463   if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
00464   {
00465     return QSPI_ERROR;
00466   }
00467
00468   return QSPI_OK;
00469 }
00470
00471 /**
00472   * @brief QSPI MSP Initialization
00473   *        This function configures the hardware resources used in this example:
00474   *           - Peripheral's clock enable
00475   *           - Peripheral's GPIO Configuration
00476   *           - NVIC configuration for QSPI interrupt
00477   * @retval None
00478   */
00479 __weak void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params)
00480 {
00481   GPIO_InitTypeDef gpio_init_structure;
00482
00483   /*##-1- Enable peripherals and GPIO Clocks #################################*/
00484   /* Enable the QuadSPI memory interface clock */
00485   QSPI_CLK_ENABLE();
00486   /* Reset the QuadSPI memory interface */
00487   QSPI_FORCE_RESET();
00488   QSPI_RELEASE_RESET();
00489   /* Enable GPIO clocks */
00490   QSPI_CLK_GPIO_CLK_ENABLE();
00491   QSPI_BK1_CS_GPIO_CLK_ENABLE();
00492   QSPI_BK1_D0_GPIO_CLK_ENABLE();
00493   QSPI_BK1_D1_GPIO_CLK_ENABLE();
00494   QSPI_BK1_D2_GPIO_CLK_ENABLE();
00495   QSPI_BK1_D3_GPIO_CLK_ENABLE();
00496
00497   QSPI_BK2_CS_GPIO_CLK_ENABLE();
00498   QSPI_BK2_D0_GPIO_CLK_ENABLE();
00499   QSPI_BK2_D1_GPIO_CLK_ENABLE();
00500   QSPI_BK2_D2_GPIO_CLK_ENABLE();
00501   QSPI_BK2_D3_GPIO_CLK_ENABLE();
00502
00503   /*##-2- Configure peripheral GPIO ##########################################*/
00504   /* QSPI CLK GPIO pin configuration  */
00505   gpio_init_structure.Pin       = QSPI_CLK_PIN;
00506   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00507   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00508   gpio_init_structure.Pull      = GPIO_NOPULL;
00509   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00510   HAL_GPIO_Init(QSPI_CLK_GPIO_PORT, &gpio_init_structure);
00511
00512   /* QSPI CS GPIO pin configuration  */
00513   gpio_init_structure.Pin       = QSPI_BK1_CS_PIN;
00514   gpio_init_structure.Pull      = GPIO_PULLUP;
00515   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00516   HAL_GPIO_Init(QSPI_BK1_CS_GPIO_PORT, &gpio_init_structure);
00517
00518   /* QSPI D0 GPIO pin configuration  */
00519   gpio_init_structure.Pin       = QSPI_BK1_D0_PIN;
00520   gpio_init_structure.Pull      = GPIO_NOPULL;
00521   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00522   HAL_GPIO_Init(QSPI_BK1_D0_GPIO_PORT, &gpio_init_structure);
00523
00524   gpio_init_structure.Pin       = QSPI_BK2_D0_PIN;
00525   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00526   HAL_GPIO_Init(QSPI_BK2_D0_GPIO_PORT, &gpio_init_structure);
00527
00528   /* QSPI D1 GPIO pin configuration  */
00529   gpio_init_structure.Pin       = QSPI_BK1_D1_PIN;
00530   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00531   HAL_GPIO_Init(QSPI_BK1_D1_GPIO_PORT, &gpio_init_structure);
00532
00533   gpio_init_structure.Pin       = QSPI_BK2_D1_PIN;
00534   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00535   HAL_GPIO_Init(QSPI_BK2_D1_GPIO_PORT, &gpio_init_structure);
00536
00537   /* QSPI D2 GPIO pin configuration  */
00538   gpio_init_structure.Pin       = QSPI_BK1_D2_PIN;
00539   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00540   HAL_GPIO_Init(QSPI_BK1_D2_GPIO_PORT, &gpio_init_structure);
00541
00542   gpio_init_structure.Pin       = QSPI_BK2_D2_PIN;
00543   HAL_GPIO_Init(QSPI_BK2_D2_GPIO_PORT, &gpio_init_structure);
00544
00545   /* QSPI D3 GPIO pin configuration  */
00546   gpio_init_structure.Pin       = QSPI_BK1_D3_PIN;
00547   HAL_GPIO_Init(QSPI_BK1_D3_GPIO_PORT, &gpio_init_structure);
00548
00549   gpio_init_structure.Pin       = QSPI_BK2_D3_PIN;
00550   HAL_GPIO_Init(QSPI_BK2_D3_GPIO_PORT, &gpio_init_structure);
00551
00552   /*##-3- Configure the NVIC for QSPI #########################################*/
00553   /* NVIC configuration for QSPI interrupt */
00554   HAL_NVIC_SetPriority(QUADSPI_IRQn, 0x0F, 0);
00555   HAL_NVIC_EnableIRQ(QUADSPI_IRQn);
00556
00557 }
00558
00559 /**
00560   * @brief QSPI MSP De-Initialization
00561   *        This function frees the hardware resources used in this example:
00562   *          - Disable the Peripheral's clock
00563   *          - Revert GPIO and NVIC configuration to their default state
00564   * @retval None
00565   */
00566 __weak void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params)
00567 {
00568   /*##-1- Disable the NVIC for QSPI ###########################################*/
00569   HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
00570
00571   /*##-2- Disable peripherals and GPIO Clocks ################################*/
00572   /* De-Configure QSPI pins */
00573   HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
00574   HAL_GPIO_DeInit(QSPI_BK1_CS_GPIO_PORT, QSPI_BK1_CS_PIN);
00575   HAL_GPIO_DeInit(QSPI_BK1_D0_GPIO_PORT, QSPI_BK1_D0_PIN);
00576   HAL_GPIO_DeInit(QSPI_BK1_D1_GPIO_PORT, QSPI_BK1_D1_PIN);
00577   HAL_GPIO_DeInit(QSPI_BK1_D2_GPIO_PORT, QSPI_BK1_D2_PIN);
00578   HAL_GPIO_DeInit(QSPI_BK1_D3_GPIO_PORT, QSPI_BK1_D3_PIN);
00579
00580   HAL_GPIO_DeInit(QSPI_BK2_CS_GPIO_PORT, QSPI_BK2_CS_PIN);
00581   HAL_GPIO_DeInit(QSPI_BK2_D0_GPIO_PORT, QSPI_BK2_D0_PIN);
00582   HAL_GPIO_DeInit(QSPI_BK2_D1_GPIO_PORT, QSPI_BK2_D1_PIN);
00583   HAL_GPIO_DeInit(QSPI_BK2_D2_GPIO_PORT, QSPI_BK2_D2_PIN);
00584   HAL_GPIO_DeInit(QSPI_BK2_D3_GPIO_PORT, QSPI_BK2_D3_PIN);
00585
00586   /*##-3- Reset peripherals ##################################################*/
00587   /* Reset the QuadSPI memory interface */
00588   QSPI_FORCE_RESET();
00589   QSPI_RELEASE_RESET();
00590
00591   /* Disable the QuadSPI memory interface clock */
00592   QSPI_CLK_DISABLE();
00593 }
00594
00595 /**
00596   * @}
00597   */
00598
00599 /** @defgroup STM32H747I_DISCOVERY_QSPI_Private_Functions Private Functions
00600   * @{
00601   */
00602
00603 /**
00604   * @brief  This function reset the QSPI memory.
00605   * @param  hqspi: QSPI handle
00606   * @retval None
00607   */
00608 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
00609 {
00610   QSPI_CommandTypeDef s_command;
00611
00612   /* Initialize the reset enable command */
00613   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00614   s_command.Instruction       = RESET_ENABLE_CMD;
00615   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00616   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00617   s_command.DataMode          = QSPI_DATA_NONE;
00618   s_command.DummyCycles       = 0;
00619   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00620   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00621   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00622
00623   /* Send the command */
00624   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00625   {
00626     return QSPI_ERROR;
00627   }
00628
00629   /* Send the reset memory command */
00630   s_command.Instruction = RESET_MEMORY_CMD;
00631   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00632   {
00633     return QSPI_ERROR;
00634   }
00635
00636   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00637   s_command.Instruction       = RESET_ENABLE_CMD;
00638   /* Send the command */
00639   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00640   {
00641     return QSPI_ERROR;
00642   }
00643
00644   /* Send the reset memory command */
00645   s_command.Instruction = RESET_MEMORY_CMD;
00646   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00647   {
00648     return QSPI_ERROR;
00649   }
00650
00651   /* Enter QSPI memory in QPI mode */
00652   if(QSPI_EnterQPI(&QSPIHandle) != QSPI_OK)
00653   {
00654     return QSPI_ERROR;
00655   }
00656
00657   /* Configure automatic polling mode to wait the memory is ready */
00658   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00659   {
00660     return QSPI_ERROR;
00661   }
00662
00663   return QSPI_OK;
00664 }
00665
00666 /**
00667   * @brief  This function set the QSPI memory in 4-byte address mode
00668   * @param  hqspi: QSPI handle
00669   * @retval None
00670   */
00671 static uint8_t QSPI_EnterFourBytesAddress(QSPI_HandleTypeDef *hqspi)
00672 {
00673   QSPI_CommandTypeDef s_command;
00674
00675   /* Initialize the command */
00676   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00677   s_command.Instruction       = ENTER_4_BYTE_ADDR_MODE_CMD;
00678   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00679   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00680   s_command.DataMode          = QSPI_DATA_NONE;
00681   s_command.DummyCycles       = 0;
00682   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00683   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00684   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00685
00686   /* Enable write operations */
00687   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00688   {
00689     return QSPI_ERROR;
00690   }
00691
00692   /* Send the command */
00693   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00694   {
00695     return QSPI_ERROR;
00696   }
00697
00698   /* Configure automatic polling mode to wait the memory is ready */
00699   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00700   {
00701     return QSPI_ERROR;
00702   }
00703
00704   return QSPI_OK;
00705 }
00706
00707 /**
00708   * @brief  This function configure the dummy cycles on memory side.
00709   * @param  hqspi: QSPI handle
00710   * @retval None
00711   */
00712 static uint8_t QSPI_DummyCyclesCfg(QSPI_HandleTypeDef *hqspi)
00713 {
00714   QSPI_CommandTypeDef s_command;
00715   uint16_t reg = 0;
00716
00717   /* Initialize the read volatile configuration register command */
00718   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00719   s_command.Instruction       = READ_VOL_CFG_REG_CMD;
00720   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00721   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00722   s_command.DataMode          = QSPI_DATA_4_LINES;
00723   s_command.DummyCycles       = 0;
00724   s_command.NbData            = 2;
00725   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00726   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00727   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00728
00729   /* Configure the command */
00730   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00731   {
00732     return QSPI_ERROR;
00733   }
00734
00735   /* Reception of the data */
00736   if (HAL_QSPI_Receive(hqspi, (uint8_t *)(&reg), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00737   {
00738     return QSPI_ERROR;
00739   }
00740
00741   /* Enable write operations */
00742   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00743   {
00744     return QSPI_ERROR;
00745   }
00746
00747   /* Update volatile configuration register (with new dummy cycles) */
00748   s_command.Instruction = WRITE_VOL_CFG_REG_CMD;
00749   MODIFY_REG(reg, 0xF0F0, ((MT25TL01G_DUMMY_CYCLES_READ_QUAD << 4) |
00750                                (MT25TL01G_DUMMY_CYCLES_READ_QUAD << 12)));
00751
00752   /* Configure the write volatile configuration register command */
00753   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00754   {
00755     return QSPI_ERROR;
00756   }
00757
00758   /* Transmission of the data */
00759   if (HAL_QSPI_Transmit(hqspi, (uint8_t *)(&reg), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00760   {
00761     return QSPI_ERROR;
00762   }
00763
00764   return QSPI_OK;
00765 }
00766
00767 /**
00768   * @brief  This function send a Write Enable and wait it is effective.
00769   * @param  hqspi: QSPI handle
00770   * @retval None
00771   */
00772 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
00773 {
00774   QSPI_CommandTypeDef     s_command;
00775   QSPI_AutoPollingTypeDef s_config;
00776
00777   /* Enable write operations */
00778   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00779   s_command.Instruction       = WRITE_ENABLE_CMD;
00780   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00781   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00782   s_command.DataMode          = QSPI_DATA_NONE;
00783   s_command.DummyCycles       = 0;
00784   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00785   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00786   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00787
00788   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00789   {
00790     return QSPI_ERROR;
00791   }
00792
00793   /* Configure automatic polling mode to wait for write enabling */
00794   s_config.Match           = MT25TL01G_SR_WREN | (MT25TL01G_SR_WREN << 8);
00795   s_config.Mask            = MT25TL01G_SR_WREN | (MT25TL01G_SR_WREN << 8);
00796   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00797   s_config.StatusBytesSize = 2;
00798   s_config.Interval        = 0x10;
00799   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00800
00801   s_command.Instruction    = READ_STATUS_REG_CMD;
00802   s_command.DataMode       = QSPI_DATA_4_LINES;
00803
00804   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00805   {
00806     return QSPI_ERROR;
00807   }
00808
00809   return QSPI_OK;
00810 }
00811
00812 /**
00813   * @brief  This function read the SR of the memory and wait the EOP.
00814   * @param  hqspi: QSPI handle
00815   * @param  Timeout: timeout in ms
00816   * @retval None
00817   */
00818 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
00819 {
00820   QSPI_CommandTypeDef     s_command;
00821   QSPI_AutoPollingTypeDef s_config;
00822
00823   /* Configure automatic polling mode to wait for memory ready */
00824   s_command.InstructionMode   = QSPI_INSTRUCTION_4_LINES;
00825   s_command.Instruction       = READ_STATUS_REG_CMD;
00826   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00827   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00828   s_command.DataMode          = QSPI_DATA_4_LINES;
00829   s_command.DummyCycles       = 2;
00830   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00831   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00832   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00833
00834   s_config.Match           = 0;
00835   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00836   s_config.Interval        = 0x10;
00837   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00838   s_config.Mask            = MT25TL01G_SR_WIP | (MT25TL01G_SR_WIP <<8);
00839   s_config.StatusBytesSize = 2;
00840
00841   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, Timeout) != HAL_OK)
00842   {
00843     return QSPI_ERROR;
00844   }
00845
00846   return QSPI_OK;
00847 }
00848
00849 /**
00850   * @brief  This function enter the QPSI memory in QPI mode
00851   * @param  hqspi QSPI handle
00852   * @retval QSPI status
00853   */
00854 static uint8_t QSPI_EnterQPI(QSPI_HandleTypeDef *hqspi)
00855 {
00856   QSPI_CommandTypeDef s_command;
00857
00858   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00859   s_command.Instruction       = ENTER_QUAD_CMD;
00860   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00861   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00862   s_command.DataMode          = QSPI_DATA_NONE;
00863   s_command.DummyCycles       = 0;
00864   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00865   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00866   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00867
00868   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00869   {
00870     return QSPI_ERROR;
00871   }
00872
00873   return QSPI_OK;
00874 }
00875
00876 /**
00877   * @}
00878   */
00879
00880 /**
00881   * @}
00882   */
00883
00884 /**
00885   * @}
00886   */
00887
00888 /**
00889   * @}
00890   */
00891
00892 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00893


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_qspi.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_qspi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_qspi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /** @addtogroup BSP
00022   * @{
00023   */
00024
00025 /** @addtogroup STM32H747I_DISCOVERY
00026   * @{
00027   */
00028
00029 /* Define to prevent recursive inclusion -------------------------------------*/
00030 #ifndef __STM32H747I_DISCOVERY_QSPI_H
00031 #define __STM32H747I_DISCOVERY_QSPI_H
00032
00033 #ifdef __cplusplus
00034  extern "C" {
00035 #endif
00036
00037 /* Includes ------------------------------------------------------------------*/
00038 #include "stm32h7xx_hal.h"
00039 #include "../Components/mt25tl01g/mt25tl01g.h"
00040
00041 /** @addtogroup STM32H747I_DISCOVERY_QSPI
00042   * @{
00043   */
00044
00045 /* Exported constants --------------------------------------------------------*/
00046 /** @defgroup STM32H747I_DISCOVERY_QSPI_Exported_Constants Exported Constants
00047   * @{
00048   */
00049 /* QSPI Error codes */
00050 #define QSPI_OK            ((uint8_t)0x00)
00051 #define QSPI_ERROR         ((uint8_t)0x01)
00052 #define QSPI_BUSY          ((uint8_t)0x02)
00053 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00054 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00055 #define QSPI_PROTECTED     ((uint8_t)0x10)
00056
00057 /* Definition for QSPI clock resources */
00058 #define QSPI_CLK_ENABLE()              __HAL_RCC_QSPI_CLK_ENABLE()
00059 #define QSPI_CLK_DISABLE()             __HAL_RCC_QSPI_CLK_DISABLE()
00060 #define QSPI_CLK_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00061 #define QSPI_BK1_CS_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOG_CLK_ENABLE()
00062 #define QSPI_BK1_D0_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOD_CLK_ENABLE()
00063 #define QSPI_BK1_D1_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00064 #define QSPI_BK1_D2_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00065 #define QSPI_BK1_D3_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00066 #define QSPI_BK2_CS_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOG_CLK_ENABLE()
00067 #define QSPI_BK2_D0_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOH_CLK_ENABLE()
00068 #define QSPI_BK2_D1_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOH_CLK_ENABLE()
00069 #define QSPI_BK2_D2_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOG_CLK_ENABLE()
00070 #define QSPI_BK2_D3_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOG_CLK_ENABLE()
00071
00072
00073 #define QSPI_FORCE_RESET()         __HAL_RCC_QSPI_FORCE_RESET()
00074 #define QSPI_RELEASE_RESET()       __HAL_RCC_QSPI_RELEASE_RESET()
00075
00076 /* Definition for QSPI Pins */
00077 #define QSPI_CLK_PIN               GPIO_PIN_2
00078 #define QSPI_CLK_GPIO_PORT         GPIOB
00079 /* Bank 1 */
00080 #define QSPI_BK1_CS_PIN            GPIO_PIN_6
00081 #define QSPI_BK1_CS_GPIO_PORT      GPIOG
00082 #define QSPI_BK1_D0_PIN            GPIO_PIN_11
00083 #define QSPI_BK1_D0_GPIO_PORT      GPIOD
00084 #define QSPI_BK1_D1_PIN            GPIO_PIN_9
00085 #define QSPI_BK1_D1_GPIO_PORT      GPIOF
00086 #define QSPI_BK1_D2_PIN            GPIO_PIN_7
00087 #define QSPI_BK1_D2_GPIO_PORT      GPIOF
00088 #define QSPI_BK1_D3_PIN            GPIO_PIN_6
00089 #define QSPI_BK1_D3_GPIO_PORT      GPIOF
00090
00091 /* Bank 2 */
00092 #define QSPI_BK2_CS_PIN            GPIO_PIN_6
00093 #define QSPI_BK2_CS_GPIO_PORT      GPIOG
00094 #define QSPI_BK2_D0_PIN            GPIO_PIN_2
00095 #define QSPI_BK2_D0_GPIO_PORT      GPIOH
00096 #define QSPI_BK2_D1_PIN            GPIO_PIN_3
00097 #define QSPI_BK2_D1_GPIO_PORT      GPIOH
00098 #define QSPI_BK2_D2_PIN            GPIO_PIN_9
00099 #define QSPI_BK2_D2_GPIO_PORT      GPIOG
00100 #define QSPI_BK2_D3_PIN            GPIO_PIN_14
00101 #define QSPI_BK2_D3_GPIO_PORT      GPIOG
00102
00103
00104 /* MT25TL01G Micron memory */
00105 /* Size of the flash */
00106 #define QSPI_FLASH_SIZE            26     /* Address bus width to access whole memory space */
00107 #define QSPI_PAGE_SIZE             256
00108
00109 /* QSPI Base Address */
00110 #define QSPI_BASE_ADDRESS          0x90000000
00111
00112 /**
00113   * @}
00114   */
00115
00116 /* Exported types ------------------------------------------------------------*/
00117 /** @defgroup STM32H747I_DISCOVERY_QSPI_Exported_Types Exported Types
00118   * @{
00119   */
00120 /* QSPI Info */
00121 typedef struct {
00122   uint32_t FlashSize;          /*!< Size of the flash */
00123   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation */
00124   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00125   uint32_t ProgPageSize;       /*!< Size of pages for the program operation */
00126   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00127 } QSPI_Info;
00128
00129 /**
00130   * @}
00131   */
00132
00133
00134 /* Exported functions --------------------------------------------------------*/
00135 /** @addtogroup STM32H747I_DISCOVERY_QSPI_Exported_Functions
00136   * @{
00137   */
00138 uint8_t BSP_QSPI_Init       (void);
00139 uint8_t BSP_QSPI_DeInit     (void);
00140 uint8_t BSP_QSPI_Read       (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00141 uint8_t BSP_QSPI_Write      (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00142 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00143 uint8_t BSP_QSPI_Erase_Chip (void);
00144 uint8_t BSP_QSPI_GetStatus  (void);
00145 uint8_t BSP_QSPI_GetInfo    (QSPI_Info* pInfo);
00146 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00147
00148 /* These functions can be modified in case the current settings
00149    need to be changed for specific application needs */
00150 void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params);
00151 void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params);
00152
00153 /**
00154   * @}
00155   */
00156
00157 /**
00158   * @}
00159   */
00160
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164
00165 #endif /* __STM32H747I_DISCOVERY_QSPI_H */
00166 /**
00167   * @}
00168   */
00169
00170 /**
00171   * @}
00172   */
00173
00174 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sd.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_sd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_sd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the uSD card driver mounted on STM32H747I-DISCOVERY
00006   *          board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info : -----------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive the micro SD external card mounted on STM32412G-DISCOVERY
00026      board.
00027    - This driver does not need a specific component driver for the micro SD device
00028      to be included with.
00029
00030 2. Driver description:
00031 ---------------------
00032   + Initialization steps:
00033      o Initialize the micro SD card using the BSP_SD_Init() function. This
00034        function includes the MSP layer hardware resources initialization and the
00035        SDIO interface configuration to interface with the external micro SD. It
00036        also includes the micro SD initialization sequence.
00037      o To check the SD card presence you can use the function BSP_SD_IsDetected() which
00038        returns the detection status
00039      o If SD presence detection interrupt mode is desired, you must configure the
00040        SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt
00041        is generated as an external interrupt whenever the micro SD card is
00042        plugged/unplugged in/from the board.
00043      o The function BSP_SD_GetCardInfo() is used to get the micro SD card information
00044        which is stored in the structure "HAL_SD_CardInfoTypedef".
00045
00046   + Micro SD card operations
00047      o The micro SD card can be accessed with read/write block(s) operations once
00048        it is ready for access. The access can be performed whether using the polling
00049        mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA
00050        transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
00051      o The DMA transfer complete is used with interrupt mode. Once the SD transfer
00052        is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
00053        the DMA Tx/Rx transfer complete are handled using the functions
00054        SD_DMA_Tx_IRQHandler()/SD_DMA_Rx_IRQHandler() that should be defined by user.
00055        The corresponding user callbacks are implemented by the user at application level.
00056      o The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
00057        the number of blocks to erase.
00058      o The SD runtime status is returned when calling the function BSP_SD_GetStatus().
00059
00060 ------------------------------------------------------------------------------*/
00061
00062 /* Includes ------------------------------------------------------------------*/
00063 #include "stm32h747i_discovery_sd.h"
00064
00065 /** @addtogroup BSP
00066   * @{
00067   */
00068
00069 /** @addtogroup STM32H747I_DISCOVERY
00070   * @{
00071   */
00072
00073 /** @defgroup STM32H747I_DISCOVERY_SD STM32H747I_DISCOVERY_SD
00074   * @{
00075   */
00076
00077 /** @defgroup STM32H747I_DISCOVERY_SD_Exported_Variables Exported Variables
00078   * @{
00079   */
00080 SD_HandleTypeDef uSdHandle;
00081 /**
00082   * @}
00083   */
00084
00085 /** @defgroup STM32H747I_DISCOVERY_SD_Exported_Functions Exported Functions
00086   * @{
00087   */
00088
00089 /**
00090   * @brief  Initializes the SD card device.
00091   * @retval SD status
00092   */
00093 uint8_t BSP_SD_Init(void)
00094 {
00095   uint8_t sd_state = MSD_OK;
00096
00097   /* uSD device interface configuration */
00098   uSdHandle.Instance = SDMMC1;
00099
00100   uSdHandle.Init.ClockDiv            = 4;
00101   uSdHandle.Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00102   uSdHandle.Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00103   uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
00104   uSdHandle.Init.BusWide             = SDMMC_BUS_WIDE_4B;
00105
00106   /* Check if SD card is present */
00107   if(BSP_SD_IsDetected() != SD_PRESENT)
00108   {
00109     return MSD_ERROR_SD_NOT_PRESENT;
00110   }
00111
00112   /* Msp SD initialization */
00113   BSP_SD_MspInit(&uSdHandle, NULL);
00114
00115   /* HAL SD initialization */
00116   if(HAL_SD_Init(&uSdHandle) != HAL_OK)
00117   {
00118     sd_state = MSD_ERROR;
00119   }
00120
00121   return  sd_state;
00122 }
00123
00124 /**
00125   * @brief  DeInitializes the SD card device.
00126   * @retval SD status
00127   */
00128 uint8_t BSP_SD_DeInit(void)
00129 {
00130   uint8_t sd_state = MSD_OK;
00131
00132   uSdHandle.Instance = SDMMC1;
00133
00134   /* HAL SD deinitialization */
00135   if(HAL_SD_DeInit(&uSdHandle) != HAL_OK)
00136   {
00137     sd_state = MSD_ERROR;
00138   }
00139
00140   /* Msp SD deinitialization */
00141   uSdHandle.Instance = SDMMC1;
00142   BSP_SD_MspDeInit(&uSdHandle, NULL);
00143
00144   return  sd_state;
00145 }
00146
00147 /**
00148   * @brief  Configures Interrupt mode for SD1 detection pin.
00149   * @retval Returns 0
00150   */
00151 uint8_t BSP_SD_ITConfig(void)
00152 {
00153   GPIO_InitTypeDef gpio_init_structure;
00154
00155   /* Configure Interrupt mode for SD detection pin */
00156   gpio_init_structure.Pin = SD_DETECT_PIN;
00157   gpio_init_structure.Pull = GPIO_PULLUP;
00158   gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00159   gpio_init_structure.Mode = GPIO_MODE_IT_RISING_FALLING;
00160   HAL_GPIO_Init(SD_DETECT_GPIO_PORT, &gpio_init_structure);
00161
00162   /* Enable and set SD detect EXTI Interrupt to the lowest priority */
00163   HAL_NVIC_SetPriority((IRQn_Type)(SD_DETECT_EXTI_IRQn), 0x0F, 0x00);
00164   HAL_NVIC_EnableIRQ((IRQn_Type)(SD_DETECT_EXTI_IRQn));
00165
00166   return MSD_OK;
00167 }
00168
00169 /**
00170  * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00171  * @retval Returns if SD is detected or not
00172  */
00173 uint8_t BSP_SD_IsDetected(void)
00174 {
00175   __IO uint8_t status = SD_PRESENT;
00176
00177
00178   /* Check SD card detect pin */
00179   if (HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) == GPIO_PIN_SET)
00180   {
00181     status = SD_NOT_PRESENT;
00182   }
00183
00184   return status;
00185 }
00186
00187 /**
00188   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00189   * @param  pData: Pointer to the buffer that will contain the data to transmit
00190   * @param  ReadAddr: Address from where data is to be read
00191   * @param  NumOfBlocks: Number of SD blocks to read
00192   * @param  Timeout: Timeout for read operation
00193   * @retval SD status
00194   */
00195 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00196 {
00197
00198   if( HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) == HAL_OK)
00199   {
00200     return MSD_OK;
00201   }
00202   else
00203   {
00204     return MSD_ERROR;
00205   }
00206
00207 }
00208
00209 /**
00210   * @brief  Writes block(s) to a specified address in an SD card, in polling mode.
00211   * @param  pData: Pointer to the buffer that will contain the data to transmit
00212   * @param  WriteAddr: Address from where data is to be written
00213   * @param  NumOfBlocks: Number of SD blocks to write
00214   * @param  Timeout: Timeout for write operation
00215   * @retval SD status
00216   */
00217 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00218 {
00219
00220   if( HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) == HAL_OK)
00221   {
00222     return MSD_OK;
00223   }
00224   else
00225   {
00226     return MSD_ERROR;
00227   }
00228 }
00229
00230 /**
00231   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00232   * @param  pData: Pointer to the buffer that will contain the data to transmit
00233   * @param  ReadAddr: Address from where data is to be read
00234   * @param  NumOfBlocks: Number of SD blocks to read
00235   * @retval SD status
00236   */
00237 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
00238 {
00239
00240   if( HAL_SD_ReadBlocks_DMA(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks) == HAL_OK)
00241   {
00242     return MSD_OK;
00243   }
00244   else
00245   {
00246     return MSD_ERROR;
00247   }
00248 }
00249
00250 /**
00251   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00252   * @param  pData: Pointer to the buffer that will contain the data to transmit
00253   * @param  WriteAddr: Address from where data is to be written
00254   * @param  NumOfBlocks: Number of SD blocks to write
00255   * @retval SD status
00256   */
00257 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
00258 {
00259
00260   if( HAL_SD_WriteBlocks_DMA(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks) == HAL_OK)
00261   {
00262     return MSD_OK;
00263   }
00264   else
00265   {
00266     return MSD_ERROR;
00267   }
00268
00269 }
00270
00271 /**
00272   * @brief  Erases the specified memory area of the given SD card.
00273   * @param  StartAddr: Start byte address
00274   * @param  EndAddr: End byte address
00275   * @retval SD status
00276   */
00277 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
00278 {
00279
00280   if( HAL_SD_Erase(&uSdHandle, StartAddr, EndAddr) == HAL_OK)
00281   {
00282     return MSD_OK;
00283   }
00284   else
00285   {
00286     return MSD_ERROR;
00287   }
00288 }
00289
00290 /**
00291   * @brief  Initializes the SD MSP.
00292   * @param  hsd SD handle
00293   * @param  Params User parameters
00294   * @retval None
00295   */
00296 __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
00297 {
00298   /* __weak function can be modified by the application */
00299
00300   GPIO_InitTypeDef gpio_init_structure;
00301
00302   /* SD pins are in conflict with Camera pins on the Disco board
00303            therefore Camera must be power down before using the BSP SD
00304            To power down the camera , Set GPIOJ pin 14 to high
00305         */
00306
00307   /* Enable GPIO J clock */
00308   __HAL_RCC_GPIOJ_CLK_ENABLE();
00309
00310   gpio_init_structure.Pin       = GPIO_PIN_14;
00311   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
00312   gpio_init_structure.Pull      = GPIO_NOPULL;
00313   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00314   HAL_GPIO_Init(GPIOJ, &gpio_init_structure);
00315
00316   /* Set the camera POWER_DOWN pin (active high) */
00317   HAL_GPIO_WritePin(GPIOJ, GPIO_PIN_14, GPIO_PIN_SET);
00318
00319   /* Enable SDIO clock */
00320   __HAL_RCC_SDMMC1_CLK_ENABLE();
00321
00322
00323   /* Enable GPIOs clock */
00324   __HAL_RCC_GPIOB_CLK_ENABLE();
00325   __HAL_RCC_GPIOC_CLK_ENABLE();
00326   __HAL_RCC_GPIOD_CLK_ENABLE();
00327
00328
00329   /* Common GPIO configuration */
00330   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00331   gpio_init_structure.Pull      = GPIO_PULLUP;
00332   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00333   gpio_init_structure.Alternate = GPIO_AF12_SDIO1;
00334
00335   /* SDMMC GPIO CLKIN PB8, D0 PC8, D1 PC9, D2 PC10, D3 PC11, CK PC12, CMD PD2 */
00336   /* GPIOC configuration */
00337   gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00338
00339   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00340
00341   /* GPIOD configuration */
00342   gpio_init_structure.Pin = GPIO_PIN_2;
00343   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00344
00345
00346
00347   /* NVIC configuration for SDIO interrupts */
00348   HAL_NVIC_SetPriority(SDMMC1_IRQn, 5, 0);
00349   HAL_NVIC_EnableIRQ(SDMMC1_IRQn);
00350
00351 }
00352
00353 /**
00354   * @brief  DeInitializes the SD MSP.
00355   * @param  hsd SD handle
00356   * @param  Params User parameters
00357   * @retval None
00358   */
00359 __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
00360 {
00361     /* Disable NVIC for SDIO interrupts */
00362     HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
00363
00364     /* DeInit GPIO pins can be done in the application
00365        (by surcharging this __weak function) */
00366
00367     /* Disable SDMMC1 clock */
00368     __HAL_RCC_SDMMC1_CLK_DISABLE();
00369
00370     /* GPIO pins clock and DMA clocks can be shut down in the application
00371        by surcharging this __weak function */
00372 }
00373
00374 /**
00375   * @brief  Handles SD card interrupt request.
00376   * @retval None
00377   */
00378 void BSP_SD_IRQHandler(void)
00379 {
00380   HAL_SD_IRQHandler(&uSdHandle);
00381 }
00382
00383 /**
00384   * @brief  Gets the current SD card data status.
00385   * @retval Data transfer state.
00386   *          This value can be one of the following values:
00387   *            @arg  SD_TRANSFER_OK: No data transfer is acting
00388   *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
00389   *            @arg  SD_TRANSFER_ERROR: Data transfer error
00390   */
00391 uint8_t BSP_SD_GetCardState(void)
00392 {
00393   return((HAL_SD_GetCardState(&uSdHandle) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY);
00394 }
00395
00396 /**
00397   * @brief  Get SD information about specific SD card.
00398   * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
00399   * @retval None
00400   */
00401 void BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo)
00402 {
00403   HAL_SD_GetCardInfo(&uSdHandle, CardInfo);
00404 }
00405
00406 /**
00407   * @brief SD Abort callbacks
00408   * @param hsd SD handle
00409   * @retval None
00410   */
00411 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00412 {
00413   BSP_SD_AbortCallback();
00414 }
00415
00416
00417 /**
00418   * @brief Tx Transfer completed callbacks
00419   * @param hsd SD handle
00420   * @retval None
00421   */
00422 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00423 {
00424   BSP_SD_WriteCpltCallback();
00425 }
00426
00427 /**
00428   * @brief Rx Transfer completed callbacks
00429   * @param hsd SD handle
00430   * @retval None
00431   */
00432 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00433 {
00434   BSP_SD_ReadCpltCallback();
00435 }
00436
00437 /**
00438   * @brief BSP SD Abort callbacks
00439   * @retval None
00440   */
00441 __weak void BSP_SD_AbortCallback(void)
00442 {
00443
00444 }
00445
00446 /**
00447   * @brief BSP Tx Transfer completed callbacks
00448   * @retval None
00449   */
00450 __weak void BSP_SD_WriteCpltCallback(void)
00451 {
00452
00453 }
00454
00455 /**
00456   * @brief BSP Rx Transfer completed callbacks
00457   * @retval None
00458   */
00459 __weak void BSP_SD_ReadCpltCallback(void)
00460 {
00461
00462 }
00463 /**
00464   * @}
00465   */
00466
00467 /**
00468   * @}
00469   */
00470
00471 /**
00472   * @}
00473   */
00474
00475 /**
00476   * @}
00477   */
00478
00479 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sd.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_sd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_SD_H
00023 #define __STM32H747I_DISCOVERY_SD_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32h7xx_hal.h"
00031 #include "stm32h747i_discovery.h"
00032
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036
00037 /** @addtogroup STM32H747I_DISCOVERY
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32H747I_DISCOVERY_SD
00042   * @{
00043   */
00044
00045 /** @defgroup STM32H747I_DISCOVERY_SD_Exported_Types Exported Types
00046   * @{
00047   */
00048
00049 /**
00050   * @brief SD Card information structure
00051   */
00052 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00053 /**
00054   * @}
00055   */
00056
00057 /** @defgroup STM32H747I_DISCOVERY_SD_ Exported_Constants Exported Constants
00058   * @{
00059   */
00060 /**
00061   * @brief  SD status structure definition
00062   */
00063 #define   MSD_OK                        ((uint8_t)0x00)
00064 #define   MSD_ERROR                     ((uint8_t)0x01)
00065 #define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00066
00067 /**
00068   * @brief  SD transfer state definition
00069   */
00070 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00071 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00072
00073
00074 #define SD_PRESENT               ((uint8_t)0x01)
00075 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00076
00077 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00078
00079 /**
00080   * @}
00081   */
00082
00083
00084 /** @addtogroup STM32H747I_DISCOVERY_SD_Exported_Functions
00085   * @{
00086   */
00087 uint8_t BSP_SD_Init(void);
00088 uint8_t BSP_SD_DeInit(void);
00089 uint8_t BSP_SD_ITConfig(void);
00090
00091 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00092 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00093 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00094 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00095 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00096 uint8_t BSP_SD_GetCardState(void);
00097 void    BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo);
00098 uint8_t BSP_SD_IsDetected(void);
00099 void    BSP_SD_IRQHandler(void);
00100
00101 /* These functions can be modified in case the current settings (e.g. DMA stream)
00102    need to be changed for specific application needs */
00103 void    BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00104 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00105 void    BSP_SD_AbortCallback(void);
00106 void    BSP_SD_WriteCpltCallback(void);
00107 void    BSP_SD_ReadCpltCallback(void);
00108
00109
00110 /**
00111   * @}
00112   */
00113
00114 /**
00115   * @}
00116   */
00117
00118 /**
00119   * @}
00120   */
00121
00122 /**
00123   * @}
00124   */
00125
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129
00130 #endif /* __STM32H747I_DISCOVERY_SD_H */
00131
00132 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sdram.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_sdram.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_sdram.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the SDRAM driver for the MT48LC4M32B2B5-6A memory
00006   *          device mounted on STM32H747I-DISCOVERY boards.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the MT48LC4M32B2B5-6A SDRAM external memory mounted
00011      on STM32H747I-DISCOVERY board.
00012    - This driver does not need a specific component driver for the SDRAM device
00013      to be included with.
00014
00015   Driver description:
00016   ------------------
00017   + Initialization steps:
00018      o Initialize the SDRAM external memory using the BSP_SDRAM_Init() function. This
00019        function includes the MSP layer hardware resources initialization and the
00020        FMC controller configuration to interface with the external SDRAM memory.
00021      o It contains the SDRAM initialization sequence to program the SDRAM external
00022        device using the function BSP_SDRAM_Initialization_sequence(). Note that this
00023        sequence is standard for all SDRAM devices, but can include some differences
00024        from a device to another. If it is the case, the right sequence should be
00025        implemented separately.
00026
00027   + SDRAM read/write operations
00028      o SDRAM external memory can be accessed with read/write operations once it is
00029        initialized.
00030        Read/write operation can be performed with AHB access using the functions
00031        BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by MDMA transfer using the functions
00032        BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
00033      o The AHB access is performed with 32-bit width transaction, the MDMA transfer
00034        configuration is fixed at single (no burst) word transfer (see the
00035        SDRAM_MspInit() static function).
00036      o User can implement his own functions for read/write access with his desired
00037        configurations.
00038      o If interrupt mode is used for MDMA transfer, the function BSP_SDRAM_MDMA_IRQHandler()
00039        is called in IRQ handler file, to serve the generated interrupt once the MDMA
00040        transfer is complete.
00041      o You can send a command to the SDRAM device in runtime using the function
00042        BSP_SDRAM_Sendcmd(), and giving the desired command as parameter chosen between
00043        the predefined commands of the "FMC_SDRAM_CommandTypeDef" structure.
00044   @endverbatim
00045   ******************************************************************************
00046   * @attention
00047   *
00048   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00049   * All rights reserved.</center></h2>
00050   *
00051   * This software component is licensed by ST under BSD 3-Clause license,
00052   * the "License"; You may not use this file except in compliance with the
00053   * License. You may obtain a copy of the License at:
00054   *                        opensource.org/licenses/BSD-3-Clause
00055   *
00056   ******************************************************************************
00057   */
00058
00059 /* Includes ------------------------------------------------------------------*/
00060 #include "stm32h747i_discovery_sdram.h"
00061
00062 /** @addtogroup BSP
00063   * @{
00064   */
00065
00066 /** @addtogroup STM32H747I_DISCOVERY
00067   * @{
00068   */
00069
00070 /** @defgroup STM32H747I_DISCOVERY_SDRAM STM32H747I_DISCOVERY_SDRAM
00071   * @{
00072   */
00073
00074 /** @defgroup STM32H747I_DISCOVERY_SDRAM_Exported_Variables Exported Variables
00075   * @{
00076   */
00077 SDRAM_HandleTypeDef sdramHandle;
00078 /**
00079   * @}
00080   */
00081
00082 /** @defgroup STM32H747I_DISCOVERY_SDRAM_Private_Variables Private Variables
00083   * @{
00084   */
00085 static FMC_SDRAM_TimingTypeDef Timing;
00086 static FMC_SDRAM_CommandTypeDef Command;
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32H747I_DISCOVERY_SDRAM_Exported_Functions Exported_Functions
00092   * @{
00093   */
00094
00095 /**
00096   * @brief  Initializes the SDRAM device.
00097   * @retval SDRAM status
00098   */
00099 uint8_t BSP_SDRAM_Init(void)
00100 {
00101   static uint8_t sdramstatus = SDRAM_OK;
00102   /* SDRAM device configuration */
00103   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00104
00105   /* Timing configuration for 100Mhz as SDRAM clock frequency (System clock is up to 200Mhz) */
00106   Timing.LoadToActiveDelay    = 2;
00107   Timing.ExitSelfRefreshDelay = 7;
00108   Timing.SelfRefreshTime      = 4;
00109   Timing.RowCycleDelay        = 7;
00110   Timing.WriteRecoveryTime    = 2;
00111   Timing.RPDelay              = 2;
00112   Timing.RCDDelay             = 2;
00113
00114   sdramHandle.Init.SDBank             = FMC_SDRAM_BANK2;
00115   sdramHandle.Init.ColumnBitsNumber   = FMC_SDRAM_COLUMN_BITS_NUM_9;
00116   sdramHandle.Init.RowBitsNumber      = FMC_SDRAM_ROW_BITS_NUM_12;
00117   sdramHandle.Init.MemoryDataWidth    = SDRAM_MEMORY_WIDTH;
00118   sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
00119   sdramHandle.Init.CASLatency         = FMC_SDRAM_CAS_LATENCY_3;
00120   sdramHandle.Init.WriteProtection    = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
00121   sdramHandle.Init.SDClockPeriod      = SDCLOCK_PERIOD;
00122   sdramHandle.Init.ReadBurst          = FMC_SDRAM_RBURST_ENABLE;
00123   sdramHandle.Init.ReadPipeDelay      = FMC_SDRAM_RPIPE_DELAY_0;
00124
00125   /* SDRAM controller initialization */
00126
00127   BSP_SDRAM_MspInit(&sdramHandle, NULL); /* __weak function can be rewritten by the application */
00128
00129   if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)
00130   {
00131     sdramstatus = SDRAM_ERROR;
00132   }
00133   else
00134   {
00135     /* SDRAM initialization sequence */
00136     BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);
00137   }
00138
00139   return sdramstatus;
00140 }
00141
00142 /**
00143   * @brief  DeInitializes the SDRAM device.
00144   * @retval SDRAM status
00145   */
00146 uint8_t BSP_SDRAM_DeInit(void)
00147 {
00148   static uint8_t sdramstatus = SDRAM_OK;
00149   /* SDRAM device de-initialization */
00150   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00151
00152   if(HAL_SDRAM_DeInit(&sdramHandle) != HAL_OK)
00153   {
00154     sdramstatus = SDRAM_ERROR;
00155   }
00156   else
00157   {
00158     /* SDRAM controller de-initialization */
00159     BSP_SDRAM_MspDeInit(&sdramHandle, NULL);
00160   }
00161
00162   return sdramstatus;
00163 }
00164
00165 /**
00166   * @brief  Programs the SDRAM device.
00167   * @param  RefreshCount: SDRAM refresh counter value
00168   * @retval None
00169   */
00170 void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
00171 {
00172   __IO uint32_t tmpmrd = 0;
00173
00174   /* Step 1: Configure a clock configuration enable command */
00175   Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
00176   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK2;
00177   Command.AutoRefreshNumber      = 1;
00178   Command.ModeRegisterDefinition = 0;
00179
00180   /* Send the command */
00181   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00182
00183   /* Step 2: Insert 100 us minimum delay */
00184   /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
00185   HAL_Delay(1);
00186
00187   /* Step 3: Configure a PALL (precharge all) command */
00188   Command.CommandMode            = FMC_SDRAM_CMD_PALL;
00189   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK2;
00190   Command.AutoRefreshNumber      = 1;
00191   Command.ModeRegisterDefinition = 0;
00192
00193   /* Send the command */
00194   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00195
00196   /* Step 4: Configure an Auto Refresh command */
00197   Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
00198   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK2;
00199   Command.AutoRefreshNumber      = 8;
00200   Command.ModeRegisterDefinition = 0;
00201
00202   /* Send the command */
00203   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00204
00205   /* Step 5: Program the external memory mode register */
00206   tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |\
00207                      SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |\
00208                      SDRAM_MODEREG_CAS_LATENCY_3           |\
00209                      SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
00210                      SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
00211
00212   Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
00213   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK2;
00214   Command.AutoRefreshNumber      = 1;
00215   Command.ModeRegisterDefinition = tmpmrd;
00216
00217   /* Send the command */
00218   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00219
00220   /* Step 6: Set the refresh rate counter */
00221   /* Set the device refresh rate */
00222   HAL_SDRAM_ProgramRefreshRate(&sdramHandle, RefreshCount);
00223 }
00224
00225 /**
00226   * @brief  Reads an amount of data from the SDRAM memory in polling mode.
00227   * @param  uwStartAddress: Read start address
00228   * @param  pData: Pointer to data to be read
00229   * @param  uwDataSize: Size of read data from the memory
00230   * @retval SDRAM status
00231   */
00232 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00233 {
00234   if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00235   {
00236     return SDRAM_ERROR;
00237   }
00238   else
00239   {
00240     return SDRAM_OK;
00241   }
00242 }
00243
00244 /**
00245   * @brief  Reads an amount of data from the SDRAM memory in DMA mode.
00246   * @param  uwStartAddress: Read start address
00247   * @param  pData: Pointer to data to be read
00248   * @param  uwDataSize: Size of read data from the memory
00249   * @retval SDRAM status
00250   */
00251 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00252 {
00253   if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00254   {
00255     return SDRAM_ERROR;
00256   }
00257   else
00258   {
00259     return SDRAM_OK;
00260   }
00261 }
00262
00263 /**
00264   * @brief  Writes an amount of data to the SDRAM memory in polling mode.
00265   * @param  uwStartAddress: Write start address
00266   * @param  pData: Pointer to data to be written
00267   * @param  uwDataSize: Size of written data from the memory
00268   * @retval SDRAM status
00269   */
00270 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00271 {
00272   if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00273   {
00274     return SDRAM_ERROR;
00275   }
00276   else
00277   {
00278     return SDRAM_OK;
00279   }
00280 }
00281
00282 /**
00283   * @brief  Writes an amount of data to the SDRAM memory in DMA mode.
00284   * @param  uwStartAddress: Write start address
00285   * @param  pData: Pointer to data to be written
00286   * @param  uwDataSize: Size of written data from the memory
00287   * @retval SDRAM status
00288   */
00289 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00290 {
00291   if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00292   {
00293     return SDRAM_ERROR;
00294   }
00295   else
00296   {
00297     return SDRAM_OK;
00298   }
00299 }
00300
00301 /**
00302   * @brief  Sends command to the SDRAM bank.
00303   * @param  SdramCmd: Pointer to SDRAM command structure
00304   * @retval SDRAM status
00305   */
00306 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
00307 {
00308   if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK)
00309   {
00310     return SDRAM_ERROR;
00311   }
00312   else
00313   {
00314     return SDRAM_OK;
00315   }
00316 }
00317
00318 /**
00319   * @brief  Initializes SDRAM MSP.
00320   * @param  hsdram SDRAM handle
00321   * @param  Params User parameters
00322   * @retval None
00323   */
00324 __weak void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00325 {
00326   static MDMA_HandleTypeDef mdma_handle;
00327   GPIO_InitTypeDef gpio_init_structure;
00328
00329   /* Enable FMC clock */
00330   __HAL_RCC_FMC_CLK_ENABLE();
00331
00332   /* Enable chosen MDMAx clock */
00333   __MDMAx_CLK_ENABLE();
00334
00335   /* Enable GPIOs clock */
00336   __HAL_RCC_GPIOD_CLK_ENABLE();
00337   __HAL_RCC_GPIOE_CLK_ENABLE();
00338   __HAL_RCC_GPIOF_CLK_ENABLE();
00339   __HAL_RCC_GPIOG_CLK_ENABLE();
00340   __HAL_RCC_GPIOH_CLK_ENABLE();
00341   __HAL_RCC_GPIOI_CLK_ENABLE();
00342
00343   /* Common GPIO configuration */
00344   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00345   gpio_init_structure.Pull      = GPIO_PULLUP;
00346   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00347   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00348
00349   /* GPIOD configuration */
00350   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8| GPIO_PIN_9 | GPIO_PIN_10 |\
00351                               GPIO_PIN_14 | GPIO_PIN_15;
00352
00353
00354   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00355
00356   /* GPIOE configuration */
00357   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7| GPIO_PIN_8 | GPIO_PIN_9 |\
00358                               GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00359                               GPIO_PIN_15;
00360
00361   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00362
00363   /* GPIOF configuration */
00364   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4 |\
00365                               GPIO_PIN_5 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00366                               GPIO_PIN_15;
00367
00368   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00369
00370   /* GPIOG configuration */
00371   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 /*| GPIO_PIN_3 */|\
00372                               GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_15;
00373   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00374
00375   /* GPIOH configuration */
00376   gpio_init_structure.Pin   = GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 |\
00377                               GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00378                               GPIO_PIN_15;
00379   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00380
00381   /* GPIOI configuration */
00382   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 |\
00383                               GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_9 | GPIO_PIN_10;
00384   HAL_GPIO_Init(GPIOI, &gpio_init_structure);
00385
00386   /* Configure common MDMA parameters */
00387   mdma_handle.Init.Request = MDMA_REQUEST_SW;
00388   mdma_handle.Init.TransferTriggerMode = MDMA_BLOCK_TRANSFER;
00389   mdma_handle.Init.Priority = MDMA_PRIORITY_HIGH;
00390   mdma_handle.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE;
00391   mdma_handle.Init.SourceInc = MDMA_SRC_INC_WORD;
00392   mdma_handle.Init.DestinationInc = MDMA_DEST_INC_WORD;
00393   mdma_handle.Init.SourceDataSize = MDMA_SRC_DATASIZE_WORD;
00394   mdma_handle.Init.DestDataSize = MDMA_DEST_DATASIZE_WORD;
00395   mdma_handle.Init.DataAlignment = MDMA_DATAALIGN_PACKENABLE;
00396   mdma_handle.Init.SourceBurst = MDMA_SOURCE_BURST_SINGLE;
00397   mdma_handle.Init.DestBurst = MDMA_DEST_BURST_SINGLE;
00398   mdma_handle.Init.BufferTransferLength = 128;
00399   mdma_handle.Init.SourceBlockAddressOffset = 0;
00400   mdma_handle.Init.DestBlockAddressOffset = 0;
00401
00402
00403   mdma_handle.Instance = SDRAM_MDMAx_CHANNEL;
00404
00405    /* Associate the DMA handle */
00406   __HAL_LINKDMA(hsdram, hmdma, mdma_handle);
00407
00408   /* Deinitialize the stream for new transfer */
00409   HAL_MDMA_DeInit(&mdma_handle);
00410
00411   /* Configure the DMA stream */
00412   HAL_MDMA_Init(&mdma_handle);
00413
00414   /* NVIC configuration for DMA transfer complete interrupt */
00415   HAL_NVIC_SetPriority(SDRAM_MDMAx_IRQn, 0x0F, 0);
00416   HAL_NVIC_EnableIRQ(SDRAM_MDMAx_IRQn);
00417 }
00418
00419 /**
00420   * @brief  DeInitializes SDRAM MSP.
00421   * @param  hsdram SDRAM handle
00422   * @param  Params User parameters
00423   * @retval None
00424   */
00425 __weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00426 {
00427     static MDMA_HandleTypeDef mdma_handle;
00428
00429     /* Disable NVIC configuration for DMA interrupt */
00430     HAL_NVIC_DisableIRQ(SDRAM_MDMAx_IRQn);
00431
00432     /* Deinitialize the stream for new transfer */
00433     mdma_handle.Instance = SDRAM_MDMAx_CHANNEL;
00434     HAL_MDMA_DeInit(&mdma_handle);
00435
00436     /* GPIO pins clock, FMC clock and MDMA clock can be shut down in the applications
00437        by surcharging this __weak function */
00438 }
00439
00440 /**
00441   * @}
00442   */
00443
00444 /**
00445   * @}
00446   */
00447
00448 /**
00449   * @}
00450   */
00451
00452 /**
00453   * @}
00454   */
00455
00456 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_sdram.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_sdram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_sdram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_sdram.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_SDRAM_H
00023 #define __STM32H747I_DISCOVERY_SDRAM_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32h7xx_hal.h"
00031
00032 /** @addtogroup BSP
00033   * @{
00034   */
00035
00036 /** @addtogroup STM32H747I_DISCOVERY
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32H747I_DISCOVERY_SDRAM
00041   * @{
00042   */
00043
00044 /** @defgroup STM32H747I_DISCOVERY_SDRAM_Exported_Constants Exported Constants
00045   * @{
00046   */
00047 /**
00048   * @brief  SDRAM status structure definition
00049   */
00050 #define   SDRAM_OK         ((uint8_t)0x00)
00051 #define   SDRAM_ERROR      ((uint8_t)0x01)
00052
00053 #define SDRAM_DEVICE_ADDR  ((uint32_t)0xD0000000)
00054 #define SDRAM_DEVICE_SIZE  ((uint32_t)0x2000000)  /* SDRAM device size in MBytes */
00055
00056 /* #define SDRAM_MEMORY_WIDTH            FMC_SDRAM_MEM_BUS_WIDTH_8  */
00057 /* #define SDRAM_MEMORY_WIDTH            FMC_SDRAM_MEM_BUS_WIDTH_16 */
00058 #define SDRAM_MEMORY_WIDTH               FMC_SDRAM_MEM_BUS_WIDTH_32
00059
00060 #define SDCLOCK_PERIOD                   FMC_SDRAM_CLOCK_PERIOD_2
00061 /* #define SDCLOCK_PERIOD                FMC_SDRAM_CLOCK_PERIOD_3 */
00062
00063 #define REFRESH_COUNT                    ((uint32_t)0x0603)   /* SDRAM refresh counter (100Mhz SD clock) */
00064
00065 #define SDRAM_TIMEOUT                    ((uint32_t)0xFFFF)
00066
00067 /* DMA definitions for SDRAM DMA transfer */
00068 #define __MDMAx_CLK_ENABLE                 __HAL_RCC_MDMA_CLK_ENABLE
00069 #define __MDMAx_CLK_DISABLE                __HAL_RCC_MDMA_CLK_DISABLE
00070 #define SDRAM_MDMAx_CHANNEL               MDMA_Channel0
00071 #define SDRAM_MDMAx_IRQn                  MDMA_IRQn
00072
00073
00074 /**
00075   * @brief  FMC SDRAM Mode definition register defines
00076   */
00077 #define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
00078 #define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
00079 #define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
00080 #define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
00081 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
00082 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
00083 #define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
00084 #define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
00085 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
00086 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
00087 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)
00088 /**
00089   * @}
00090   */
00091
00092
00093 /** @addtogroup STM32H747I_DISCOVERY_SDRAM_Exported_Functions
00094   * @{
00095   */
00096 uint8_t BSP_SDRAM_Init(void);
00097 uint8_t BSP_SDRAM_DeInit(void);
00098 void    BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
00099 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00100 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00101 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00102 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00103 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
00104
00105 /* These functions can be modified in case the current settings (e.g. DMA stream)
00106    need to be changed for specific application needs */
00107 void    BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00108 void    BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00109
00110
00111 /**
00112   * @}
00113   */
00114
00115 /**
00116   * @}
00117   */
00118
00119 /**
00120   * @}
00121   */
00122
00123 /**
00124   * @}
00125   */
00126
00127 #ifdef __cplusplus
00128 }
00129 #endif
00130
00131 #endif /* __STM32H747I_DISCOVERY_SDRAM_H */
00132
00133 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_ts.c Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_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 STM32H747I_DISCOVERY discovery board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info : -----------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive the touch screen module of the STM32H747I_DISCOVERY
00026      discovery board on the K.O.D Optica Technology 480x800 TFT-LCD mounted on
00027      MB1166 daughter board. The touch screen driver IC inside the K.O.D module KM-040TMP-02
00028      is a FT6206 by Focal Tech.
00029
00030 2. Driver description:
00031 ---------------------
00032   + Initialization steps:
00033      o Initialize the TS module using the BSP_TS_Init() function. This
00034        function includes the MSP layer hardware resources initialization and the
00035        communication layer configuration to start the TS use. The LCD size properties
00036        (x and y) are passed as parameters.
00037      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00038        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00039        as an external interrupt whenever a touch is detected.
00040        The interrupt mode internally uses the IO functionalities driver driven by
00041        the IO expander, to configure the IT line.
00042
00043   + Touch screen use
00044      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00045        used. This function returns information about the last LCD touch occurred
00046        in the TS_StateTypeDef structure.
00047      o The IT is handled using the corresponding external interrupt IRQ handler,
00048        the user IT callback treatment is implemented on the same external interrupt
00049        callback.
00050
00051 ------------------------------------------------------------------------------*/
00052
00053 /* Includes ------------------------------------------------------------------*/
00054 #include "stm32h747i_discovery.h"
00055 #include "stm32h747i_discovery_ts.h"
00056
00057 /** @addtogroup BSP
00058   * @{
00059   */
00060
00061 /** @addtogroup STM32H747I_DISCOVERY
00062   * @{
00063   */
00064
00065 /** @defgroup STM32H747I_DISCOVERY_TS STM32H747I_DISCOVERY_TS
00066   * @{
00067   */
00068
00069 /** @defgroup STM32H747I_DISCOVERY_TS_Private_Variables Private Variables
00070   * @{
00071   */
00072 static TS_DrvTypeDef *ts_driver;
00073 static uint8_t  ts_orientation;
00074 static uint8_t  I2C_Address = 0;
00075
00076 /* Table for touchscreen event information display on LCD : table indexed on enum @ref TS_TouchEventTypeDef information */
00077 char * ts_event_string_tab[TOUCH_EVENT_NB_MAX] = { "None",
00078                                                    "Press down",
00079                                                    "Lift up",
00080                                                    "Contact"
00081                                                   };
00082
00083 /* Table for touchscreen gesture Id information display on LCD : table indexed on enum @ref TS_GestureIdTypeDef information */
00084 char * ts_gesture_id_string_tab[GEST_ID_NB_MAX] = { "None",
00085                                                     "Move Up",
00086                                                     "Move Right",
00087                                                     "Move Down",
00088                                                     "Move Left",
00089                                                     "Zoom In",
00090                                                     "Zoom Out"
00091                                                   };
00092
00093 /**
00094   * @}
00095   */
00096
00097 /** @defgroup STM32H747I_DISCOVERY_TS_Exported_Functions Exported Functions
00098   * @{
00099   */
00100
00101 /**
00102   * @brief  Initializes and configures the touch screen functionalities and
00103   *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00104   * @param  ts_SizeX : Maximum X size of the TS area on LCD
00105   * @param  ts_SizeY : Maximum Y size of the TS area on LCD
00106   * @retval TS_OK if all initializations are OK. Other value if error.
00107   */
00108 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
00109 {
00110   uint8_t ts_status = TS_OK;
00111
00112   /* Note : I2C_Address is un-initialized here, but is not used at all in init function */
00113   /* but the prototype of Init() is like that in template and should be respected       */
00114
00115   /* Initialize the communication channel to sensor (I2C) if necessary */
00116   /* that is initialization is done only once after a power up         */
00117   ft6x06_ts_drv.Init(I2C_Address);
00118
00119   /* Scan FT6x06 TouchScreen IC controller ID register by I2C Read */
00120   /* Verify this is a FT6x06, otherwise this is an error case      */
00121   if(ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS) == FT6206_ID_VALUE)
00122   {
00123     /* Found FT6206 : Initialize the TS driver structure */
00124     ts_driver = &ft6x06_ts_drv;
00125
00126     I2C_Address    = TS_I2C_ADDRESS;
00127
00128     /* Get LCD chosen orientation */
00129     if(ts_SizeX < ts_SizeY)
00130     {
00131       ts_orientation = TS_SWAP_NONE;
00132     }
00133     else
00134     {
00135       ts_orientation = TS_SWAP_XY | TS_SWAP_Y;
00136     }
00137
00138     if(ts_status == TS_OK)
00139     {
00140       /* Software reset the TouchScreen */
00141       ts_driver->Reset(I2C_Address);
00142
00143       /* Calibrate, Configure and Start the TouchScreen driver */
00144       ts_driver->Start(I2C_Address);
00145
00146     } /* of if(ts_status == TS_OK) */
00147   }
00148   else
00149   {
00150     ts_status = TS_DEVICE_NOT_FOUND;
00151   }
00152
00153   return (ts_status);
00154 }
00155
00156 /**
00157   * @brief  Configures and enables the touch screen interrupts.
00158   * @retval TS_OK if all initializations are OK. Other value if error.
00159   */
00160 uint8_t BSP_TS_ITConfig(void)
00161 {
00162   uint8_t ts_status = TS_OK;
00163   GPIO_InitTypeDef gpio_init_structure;
00164
00165   /* Msp Init of GPIO used for TS_INT pin coming from TouchScreen driver IC FT6x06 */
00166   /* When touchscreen is operated in interrupt mode */
00167   BSP_TS_INT_MspInit();
00168
00169   /* Configure Interrupt mode for TS_INT pin falling edge : when a new touch is available */
00170   /* TS_INT pin is active on low level on new touch available */
00171   gpio_init_structure.Pin = TS_INT_PIN;
00172   gpio_init_structure.Pull = GPIO_PULLUP;
00173   gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00174   gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00175   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00176
00177   /* Enable and set the TS_INT EXTI Interrupt to an intermediate priority */
00178   HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x0F, 0x00);
00179   HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00180
00181   /* Enable the TS in interrupt mode */
00182   /* In that case the INT output of FT6206 when new touch is available */
00183   /* is active on low level and directed on EXTI */
00184   ts_driver->EnableIT(I2C_Address);
00185
00186   return (ts_status);
00187 }
00188
00189 /**
00190   * @brief  Returns status and positions of the touch screen.
00191   * @param  TS_State: Pointer to touch screen current state structure
00192   * @retval TS_OK if all initializations are OK. Other value if error.
00193   */
00194 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00195 {
00196   static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0};
00197   static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0};
00198   uint8_t ts_status = TS_OK;
00199   uint16_t tmp;
00200   uint16_t Raw_x[TS_MAX_NB_TOUCH];
00201   uint16_t Raw_y[TS_MAX_NB_TOUCH];
00202   uint16_t xDiff;
00203   uint16_t yDiff;
00204   uint32_t index;
00205 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00206   uint32_t weight = 0;
00207   uint32_t area = 0;
00208   uint32_t event = 0;
00209 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00210
00211   /* Check and update the number of touches active detected */
00212   TS_State->touchDetected = ts_driver->DetectTouch(I2C_Address);
00213   if(TS_State->touchDetected)
00214   {
00215     for(index=0; index < TS_State->touchDetected; index++)
00216     {
00217       /* Get each touch coordinates */
00218       ts_driver->GetXY(I2C_Address, &(Raw_x[index]), &(Raw_y[index]));
00219
00220       if(ts_orientation & TS_SWAP_XY)
00221       {
00222         tmp = Raw_x[index];
00223         Raw_x[index] = Raw_y[index];
00224         Raw_y[index] = tmp;
00225       }
00226
00227       if(ts_orientation & TS_SWAP_X)
00228       {
00229         Raw_x[index] = FT_6206_MAX_WIDTH - 1 - Raw_x[index];
00230       }
00231
00232       if(ts_orientation & TS_SWAP_Y)
00233       {
00234         Raw_y[index] = FT_6206_MAX_HEIGHT - 1 - Raw_y[index];
00235       }
00236
00237       xDiff = Raw_x[index] > _x[index]? (Raw_x[index] - _x[index]): (_x[index] - Raw_x[index]);
00238       yDiff = Raw_y[index] > _y[index]? (Raw_y[index] - _y[index]): (_y[index] - Raw_y[index]);
00239
00240       if ((xDiff + yDiff) > 5)
00241       {
00242         _x[index] = Raw_x[index];
00243         _y[index] = Raw_y[index];
00244       }
00245
00246
00247       TS_State->touchX[index] = _x[index];
00248       TS_State->touchY[index] = _y[index];
00249
00250 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00251
00252       /* Get touch info related to the current touch */
00253       ft6x06_TS_GetTouchInfo(I2C_Address, index, &weight, &area, &event);
00254
00255       /* Update TS_State structure */
00256       TS_State->touchWeight[index] = weight;
00257       TS_State->touchArea[index]   = area;
00258
00259       /* Remap touch event */
00260       switch(event)
00261       {
00262         case FT6206_TOUCH_EVT_FLAG_PRESS_DOWN  :
00263           TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN;
00264           break;
00265         case FT6206_TOUCH_EVT_FLAG_LIFT_UP :
00266           TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP;
00267           break;
00268         case FT6206_TOUCH_EVT_FLAG_CONTACT :
00269           TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT;
00270           break;
00271         case FT6206_TOUCH_EVT_FLAG_NO_EVENT :
00272           TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00273           break;
00274         default :
00275           ts_status = TS_ERROR;
00276           break;
00277       } /* of switch(event) */
00278
00279 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00280
00281     } /* of for(index=0; index < TS_State->touchDetected; index++) */
00282
00283 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00284     /* Get gesture Id */
00285     ts_status = BSP_TS_Get_GestureId(TS_State);
00286 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00287
00288   } /* end of if(TS_State->touchDetected != 0) */
00289
00290   return (ts_status);
00291 }
00292
00293 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00294 /**
00295   * @brief  Update gesture Id following a touch detected.
00296   * @param  TS_State: Pointer to touch screen current state structure
00297   * @retval TS_OK if all initializations are OK. Other value if error.
00298   */
00299 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State)
00300 {
00301   uint32_t gestureId = 0;
00302   uint8_t  ts_status = TS_OK;
00303
00304   /* Get gesture Id */
00305   ft6x06_TS_GetGestureID(I2C_Address, &gestureId);
00306
00307   /* Remap gesture Id to a TS_GestureIdTypeDef value */
00308   switch(gestureId)
00309   {
00310     case FT6206_GEST_ID_NO_GESTURE :
00311       TS_State->gestureId = GEST_ID_NO_GESTURE;
00312       break;
00313     case FT6206_GEST_ID_MOVE_UP :
00314       TS_State->gestureId = GEST_ID_MOVE_UP;
00315       break;
00316     case FT6206_GEST_ID_MOVE_RIGHT :
00317       TS_State->gestureId = GEST_ID_MOVE_RIGHT;
00318       break;
00319     case FT6206_GEST_ID_MOVE_DOWN :
00320       TS_State->gestureId = GEST_ID_MOVE_DOWN;
00321       break;
00322     case FT6206_GEST_ID_MOVE_LEFT :
00323       TS_State->gestureId = GEST_ID_MOVE_LEFT;
00324       break;
00325     case FT6206_GEST_ID_ZOOM_IN :
00326       TS_State->gestureId = GEST_ID_ZOOM_IN;
00327       break;
00328     case FT6206_GEST_ID_ZOOM_OUT :
00329       TS_State->gestureId = GEST_ID_ZOOM_OUT;
00330       break;
00331     default :
00332       ts_status = TS_ERROR;
00333       break;
00334   } /* of switch(gestureId) */
00335
00336   return(ts_status);
00337 }
00338 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00339
00340
00341 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00342 /**
00343   * @brief  Function used to reset all touch data before a new acquisition
00344   *         of touch information.
00345   * @param  TS_State: Pointer to touch screen current state structure
00346   * @retval TS_OK if OK, TE_ERROR if problem found.
00347   */
00348 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State)
00349 {
00350   uint8_t ts_status = TS_ERROR;
00351   uint32_t index;
00352
00353   if (TS_State != (TS_StateTypeDef *)NULL)
00354   {
00355     TS_State->gestureId = GEST_ID_NO_GESTURE;
00356     TS_State->touchDetected = 0;
00357
00358     for(index = 0; index < TS_MAX_NB_TOUCH; index++)
00359     {
00360       TS_State->touchX[index]       = 0;
00361       TS_State->touchY[index]       = 0;
00362       TS_State->touchArea[index]    = 0;
00363       TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00364       TS_State->touchWeight[index]  = 0;
00365     }
00366
00367     ts_status = TS_OK;
00368
00369   } /* of if (TS_State != (TS_StateTypeDef *)NULL) */
00370
00371   return (ts_status);
00372 }
00373 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00374
00375 /**
00376   * @brief  Initializes the TS_INT pin MSP.
00377   * @retval None
00378   */
00379 __weak void BSP_TS_INT_MspInit(void)
00380 {
00381   GPIO_InitTypeDef  gpio_init_structure;
00382
00383   TS_INT_GPIO_CLK_ENABLE();
00384
00385   /* GPIO configuration in input for TouchScreen interrupt signal on TS_INT pin */
00386   gpio_init_structure.Pin       = TS_INT_PIN;
00387
00388   gpio_init_structure.Mode      = GPIO_MODE_INPUT;
00389   gpio_init_structure.Pull      = GPIO_PULLUP;
00390   gpio_init_structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00391   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00392 }
00393
00394 /**
00395   * @}
00396   */
00397
00398 /**
00399   * @}
00400   */
00401
00402 /**
00403   * @}
00404   */
00405
00406 /**
00407   * @}
00408   */
00409
00410 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: stm32h747i_discovery_ts.h Source File

  • Firmware
  • Drivers
  • BSP
  • STM32H747I-Discovery
stm32h747i_discovery_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h747i_discovery_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32h747i_discovery_ts.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32H747I_DISCOVERY_TS_H
00023 #define __STM32H747I_DISCOVERY_TS_H
00024
00025 #ifdef __cplusplus
00026  extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32h747i_discovery.h"
00031 #include "stm32h747i_discovery_lcd.h"
00032
00033 /* Include TouchScreen component driver */
00034 #include "../Components/ft6x06/ft6x06.h"
00035
00036 /** @addtogroup BSP
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32H747I_DISCOVERY
00041   * @{
00042   */
00043
00044 /** @addtogroup STM32H747I_DISCOVERY_TS
00045   * @{
00046   */
00047
00048  /** @defgroup STM32H747I_DISCOVERY_TS_Exported_Constants Exported Constants
00049    * @{
00050    */
00051 /** @brief With FT6206 : maximum 2 touches detected simultaneously
00052   */
00053 #define TS_MAX_NB_TOUCH                 ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
00054
00055 #define TS_NO_IRQ_PENDING               ((uint8_t) 0)
00056 #define TS_IRQ_PENDING                  ((uint8_t) 1)
00057
00058 #define TS_SWAP_NONE                    ((uint8_t) 0x01)
00059 #define TS_SWAP_X                       ((uint8_t) 0x02)
00060 #define TS_SWAP_Y                       ((uint8_t) 0x04)
00061 #define TS_SWAP_XY                      ((uint8_t) 0x08)
00062
00063  /**
00064    * @}
00065    */
00066
00067 /** @defgroup STM32H747I_DISCOVERY_TS_Exported_Types Exported Types
00068   * @{
00069   */
00070 /**
00071 *  @brief TS_StateTypeDef
00072 *  Define TS State structure
00073 */
00074 typedef struct
00075 {
00076   uint8_t  touchDetected;                /*!< Total number of active touches detected at last scan */
00077   uint16_t touchX[TS_MAX_NB_TOUCH];      /*!< Touch X[0], X[1] coordinates on 12 bits */
00078   uint16_t touchY[TS_MAX_NB_TOUCH];      /*!< Touch Y[0], Y[1] coordinates on 12 bits */
00079
00080 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00081   uint8_t  touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */
00082   uint8_t  touchEventId[TS_MAX_NB_TOUCH];     /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
00083   uint8_t  touchArea[TS_MAX_NB_TOUCH];   /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */
00084   uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
00085 #endif  /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00086
00087 } TS_StateTypeDef;
00088
00089 /**
00090  *  @brief TS_StatusTypeDef
00091  *  Define BSP_TS_xxx() functions possible return value,
00092  *  when status is returned by those functions.
00093  */
00094 typedef enum
00095 {
00096   TS_OK                = 0x00, /*!< Touch Ok */
00097   TS_ERROR             = 0x01, /*!< Touch Error */
00098   TS_TIMEOUT           = 0x02, /*!< Touch Timeout */
00099   TS_DEVICE_NOT_FOUND  = 0x03  /*!< Touchscreen device not found */
00100 } TS_StatusTypeDef;
00101
00102 /**
00103  *  @brief TS_GestureIdTypeDef
00104  *  Define Possible managed gesture identification values returned by touch screen
00105  *  driver.
00106  */
00107 typedef enum
00108 {
00109   GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
00110   GEST_ID_MOVE_UP    = 0x01, /*!< Gesture Move Up */
00111   GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
00112   GEST_ID_MOVE_DOWN  = 0x03, /*!< Gesture Move Down */
00113   GEST_ID_MOVE_LEFT  = 0x04, /*!< Gesture Move Left */
00114   GEST_ID_ZOOM_IN    = 0x05, /*!< Gesture Zoom In */
00115   GEST_ID_ZOOM_OUT   = 0x06, /*!< Gesture Zoom Out */
00116   GEST_ID_NB_MAX     = 0x07 /*!< max number of gesture id */
00117 } TS_GestureIdTypeDef;
00118
00119 /**
00120  *  @brief TS_TouchEventTypeDef
00121  *  Define Possible touch events kind as returned values
00122  *  by touch screen IC Driver.
00123  */
00124 typedef enum
00125 {
00126   TOUCH_EVENT_NO_EVT        = 0x00, /*!< Touch Event : undetermined */
00127   TOUCH_EVENT_PRESS_DOWN    = 0x01, /*!< Touch Event Press Down */
00128   TOUCH_EVENT_LIFT_UP       = 0x02, /*!< Touch Event Lift Up */
00129   TOUCH_EVENT_CONTACT       = 0x03, /*!< Touch Event Contact */
00130   TOUCH_EVENT_NB_MAX        = 0x04  /*!< max number of touch events kind */
00131 } TS_TouchEventTypeDef;
00132
00133 /**
00134   * @}
00135   */
00136
00137 /** @defgroup STM32H747I_DISCOVERY_TS_Imported_Variables Imported Variables
00138   * @{
00139   */
00140 /**
00141  *  @brief Table for touchscreen event information display on LCD :
00142  *  table indexed on enum @ref TS_TouchEventTypeDef information
00143  */
00144 extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
00145
00146 /**
00147  *  @brief Table for touchscreen gesture Id information display on LCD : table indexed
00148  *  on enum @ref TS_GestureIdTypeDef information
00149  */
00150 extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
00151 /**
00152   * @}
00153   */
00154
00155 /** @addtogroup STM32H747I_DISCOVERY_TS_Exported_Functions
00156   * @{
00157   */
00158 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
00159 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00160
00161 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00162 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
00163 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);
00164 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00165
00166 uint8_t BSP_TS_ITConfig(void);
00167
00168 /* These __weak function can be surcharged by application code in case the current settings
00169    need to be changed for specific (example GPIO allocation) */
00170 void BSP_TS_INT_MspInit(void);
00171
00172 /**
00173   * @}
00174   */
00175
00176 /**
00177   * @}
00178   */
00179
00180 /**
00181   * @}
00182   */
00183
00184 /**
00185   * @}
00186   */
00187
00188
00189 #ifdef __cplusplus
00190 }
00191 #endif
00192
00193 #endif /* __STM32H747I_DISCOVERY_TS_H */
00194
00195 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32H747I-Discovery BSP User Manual: userManualMainpage.txt File Reference

userManualMainpage.txt File Reference