STM32746G-Discovery BSP User Manual: STM32746G-Discovery BSP Drivers

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

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32746G-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
05/26/2017 | V1.0 |  | STM32746G-Discovery Board
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions

  • Data Structures
  • Files
  • Directories
STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions
STM32746G_DISCOVERY_LOW_LEVEL
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Private Defines

Defines
STM32746G_DISCOVERY_LOW_LEVEL Private Defines
STM32746G_DISCOVERY_LOW_LEVEL

Defines

#define | __STM32746G_DISCO_BSP_VERSION_MAIN (0x02)
STM32746G DISCOVERY BSP Driver version number V2.0.0.
#define | __STM32746G_DISCO_BSP_VERSION_SUB1 (0x00)
#define | __STM32746G_DISCO_BSP_VERSION_SUB2 (0x00)
#define | __STM32746G_DISCO_BSP_VERSION_RC (0x00)
#define | __STM32746G_DISCO_BSP_VERSION

Define Documentation

#define __STM32746G_DISCO_BSP_VERSION
Value:
((__STM32746G_DISCO_BSP_VERSION_MAIN << 24)\
                                             |(__STM32746G_DISCO_BSP_VERSION_SUB1 << 16)\
                                             |(__STM32746G_DISCO_BSP_VERSION_SUB2 << 8 )\
                                             |(__STM32746G_DISCO_BSP_VERSION_RC))

Definition at line 77 of file stm32746g_discovery.c.

Referenced by BSP_GetVersion().

#define __STM32746G_DISCO_BSP_VERSION_MAIN (0x02)

STM32746G DISCOVERY BSP Driver version number V2.0.0.

[31:24] main version

Definition at line 73 of file stm32746g_discovery.c.

#define __STM32746G_DISCO_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 76 of file stm32746g_discovery.c.

#define __STM32746G_DISCO_BSP_VERSION_SUB1 (0x00)

[23:16] sub1 version

Definition at line 74 of file stm32746g_discovery.c.

#define __STM32746G_DISCO_BSP_VERSION_SUB2 (0x00)

[15:8] sub2 version

Definition at line 75 of file stm32746g_discovery.c.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Private Macros

STM32746G_DISCOVERY_LOW_LEVEL Private Macros
STM32746G_DISCOVERY_LOW_LEVEL
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Private Variables

Variables
STM32746G_DISCOVERY_LOW_LEVEL Private Variables
STM32746G_DISCOVERY_LOW_LEVEL

Variables

const uint32_t | GPIO_PIN [LEDn] = {LED1_PIN}
GPIO_TypeDef * | BUTTON_PORT [BUTTONn]
const uint16_t | BUTTON_PIN [BUTTONn]
const uint16_t | BUTTON_IRQn [BUTTONn]
USART_TypeDef * | COM_USART [COMn] = {DISCOVERY_COM1}
GPIO_TypeDef * | COM_TX_PORT [COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {DISCOVERY_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {DISCOVERY_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {DISCOVERY_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {DISCOVERY_COM1_RX_AF}
static I2C_HandleTypeDef | hI2cAudioHandler = {0}
static I2C_HandleTypeDef | hI2cExtHandler = {0}

Variable Documentation

const uint16_t BUTTON_IRQn[BUTTONn]
Initial value:
 {WAKEUP_BUTTON_EXTI_IRQn,
                                       TAMPER_BUTTON_EXTI_IRQn,
                                       KEY_BUTTON_EXTI_IRQn}

Definition at line 106 of file stm32746g_discovery.c.

Referenced by BSP_PB_DeInit(), and BSP_PB_Init().

const uint16_t BUTTON_PIN[BUTTONn]
Initial value:
 {WAKEUP_BUTTON_PIN,
                                      TAMPER_BUTTON_PIN,
                                      KEY_BUTTON_PIN}

Definition at line 102 of file stm32746g_discovery.c.

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

GPIO_TypeDef* BUTTON_PORT[BUTTONn]
Initial value:
 {WAKEUP_BUTTON_GPIO_PORT,
                                      TAMPER_BUTTON_GPIO_PORT,
                                      KEY_BUTTON_GPIO_PORT}

Definition at line 98 of file stm32746g_discovery.c.

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

const uint16_t COM_RX_AF[COMn] = {DISCOVERY_COM1_RX_AF}

Definition at line 122 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

const uint16_t COM_RX_PIN[COMn] = {DISCOVERY_COM1_RX_PIN}

Definition at line 118 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_RX_PORT[COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}

Definition at line 114 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_AF[COMn] = {DISCOVERY_COM1_TX_AF}

Definition at line 120 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_PIN[COMn] = {DISCOVERY_COM1_TX_PIN}

Definition at line 116 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_TX_PORT[COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}

Definition at line 112 of file stm32746g_discovery.c.

Referenced by BSP_COM_Init().

USART_TypeDef* COM_USART[COMn] = {DISCOVERY_COM1}

Definition at line 110 of file stm32746g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

const uint32_t GPIO_PIN[LEDn] = {LED1_PIN}

Definition at line 96 of file stm32746g_discovery.c.

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

I2C_HandleTypeDef hI2cAudioHandler = {0} [static]

Definition at line 124 of file stm32746g_discovery.c.

Referenced by AUDIO_IO_Init(), AUDIO_IO_Read(), AUDIO_IO_Write(), I2Cx_Init(), I2Cx_MspInit(), TS_IO_Init(), TS_IO_Read(), and TS_IO_Write().

I2C_HandleTypeDef hI2cExtHandler = {0} [static]

Definition at line 125 of file stm32746g_discovery.c.

Referenced by CAMERA_IO_Init(), CAMERA_IO_Read(), CAMERA_IO_Write(), EEPROM_IO_Init(), EEPROM_IO_IsDeviceReady(), EEPROM_IO_ReadData(), and EEPROM_IO_WriteData().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes

STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes
STM32746G_DISCOVERY_LOW_LEVEL
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions

Functions
STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions
STM32746G_DISCOVERY_LOW_LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32746G DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 ButtonMode)
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.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
static void | I2Cx_MspInit (I2C_HandleTypeDef *i2c_handler)
Initializes I2C MSP.
static void | I2Cx_Init (I2C_HandleTypeDef *i2c_handler)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (I2C_HandleTypeDef *i2c_handler, 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 (I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
Manages error callback by re-initializing I2C.
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
Deinitializes 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, uint8_t Reg, uint8_t Value)
Camera writes single data.
uint8_t | CAMERA_IO_Read (uint8_t Addr, uint8_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_Init (void)
Initializes Touchscreen low level.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
void | TS_IO_Delay (uint32_t Delay)
TS delay.

Function Documentation

void AUDIO_IO_DeInit ( void )

Deinitializes Audio low level.

Return values:
None

Definition at line 688 of file stm32746g_discovery.c.

void AUDIO_IO_Delay ( uint32_t Delay )

AUDIO Codec delay.

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

Definition at line 736 of file stm32746g_discovery.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Return values:
None

Definition at line 679 of file stm32746g_discovery.c.

References hI2cAudioHandler, and 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 716 of file stm32746g_discovery.c.

References hI2cAudioHandler, and 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 699 of file stm32746g_discovery.c.

References hI2cAudioHandler, and I2Cx_WriteMultiple().

void BSP_COM_DeInit | ( | COM_TypeDef | COM,
 |  | UART_HandleTypeDef * | huart
 | ) |  |

DeInit COM port.

Parameters:
COM,: COM port to be configured. This parameter can be one of the following values:
  • COM1
  • COM2
huart,: Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values:
None

Definition at line 440 of file stm32746g_discovery.c.

References COM_USART, and DISCOVERY_COMx_CLK_DISABLE.

void BSP_COM_Init | ( | COM_TypeDef | COM,
 |  | UART_HandleTypeDef * | huart
 | ) |  |

Configures COM port.

Parameters:
COM,: COM port to be configured. This parameter can be one of the following values:
  • COM1
  • COM2
huart,: Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values:
None

Definition at line 400 of file stm32746g_discovery.c.

References COM_RX_AF, COM_RX_PIN, COM_RX_PORT, COM_TX_AF, COM_TX_PIN, COM_TX_PORT, COM_USART, DISCOVERY_COMx_CLK_ENABLE, DISCOVERY_COMx_RX_GPIO_CLK_ENABLE, and DISCOVERY_COMx_TX_GPIO_CLK_ENABLE.

uint32_t BSP_GetVersion ( void )

This method returns the STM32746G DISCOVERY BSP Driver revision.

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

Definition at line 178 of file stm32746g_discovery.c.

References __STM32746G_DISCO_BSP_VERSION.

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

Definition at line 222 of file stm32746g_discovery.c.

References GPIO_PIN, LED1, and LED1_GPIO_PORT.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED on GPIO.

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

Definition at line 190 of file stm32746g_discovery.c.

References GPIO_PIN, LED1, LED1_GPIO_CLK_ENABLE, and LED1_GPIO_PORT.

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
Return values:
None

Definition at line 263 of file stm32746g_discovery.c.

References GPIO_PIN, LED1, and LED1_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
Return values:
None

Definition at line 245 of file stm32746g_discovery.c.

References GPIO_PIN, LED1, and LED1_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
Return values:
None

Definition at line 281 of file stm32746g_discovery.c.

References GPIO_PIN, LED1, and LED1_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_TAMPER: Tamper Push Button
  • BUTTON_KEY: Key Push Button
Note:
On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "User" on the board serigraphy.
PB DeInit does not disable the GPIO clock
Return values:
None

Definition at line 363 of file stm32746g_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_TAMPER: Tamper Push Button
  • BUTTON_KEY: Key Push Button
Note:
On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "User" on the board serigraphy.
Return values:
The Button GPIO pin value

Definition at line 385 of file stm32746g_discovery.c.

References BUTTON_PIN, and BUTTON_PORT.

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

Configures button GPIO and EXTI Line.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_TAMPER: Tamper Push Button
  • BUTTON_KEY: Key Push Button
ButtonMode,: Button mode This parameter can be one of the following values:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability
Note:
On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "User" on the board serigraphy.
Return values:
None

Definition at line 309 of file stm32746g_discovery.c.

References BUTTON_IRQn, BUTTON_MODE_EXTI, BUTTON_MODE_GPIO, BUTTON_PIN, BUTTON_PORT, BUTTON_WAKEUP, and BUTTONx_GPIO_CLK_ENABLE.

void CAMERA_Delay ( uint32_t Delay )

Camera delay.

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

Definition at line 784 of file stm32746g_discovery.c.

void CAMERA_IO_Init ( void )

Initializes Camera low level.

Return values:
None

Definition at line 747 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_Init().

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

Camera reads single data.

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

Definition at line 770 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_ReadMultiple().

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

Camera writes single data.

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

Definition at line 759 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_WriteMultiple().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Return values:
None

Definition at line 795 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_Init().

Referenced by BSP_EEPROM_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 833 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_IsDeviceReady().

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

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 821 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_ReadMultiple().

Referenced by BSP_EEPROM_ReadBuffer().

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 808 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().

static void I2Cx_Error | ( | I2C_HandleTypeDef * | i2c_handler,
 |  | uint8_t | Addr
 | ) |  | [static]

Manages error callback by re-initializing I2C.

Parameters:
i2c_handler : I2C handler
Addr,: I2C Address
Return values:
None

Definition at line 660 of file stm32746g_discovery.c.

References I2Cx_Init().

Referenced by I2Cx_ReadMultiple(), and I2Cx_WriteMultiple().

static void I2Cx_Init ( I2C_HandleTypeDef * i2c_handler ) [static]

Initializes I2C HAL.

Parameters:
i2c_handler : I2C handler
Return values:
None

Definition at line 553 of file stm32746g_discovery.c.

References DISCOVERY_AUDIO_I2Cx, DISCOVERY_EXT_I2Cx, hI2cAudioHandler, 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 | ( | I2C_HandleTypeDef * | i2c_handler,
 |  | uint16_t | DevAddress,
 |  | uint32_t | Trials
 | ) |  | [static]

Checks if target device is ready for communication.

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

Definition at line 649 of file stm32746g_discovery.c.

Referenced by EEPROM_IO_IsDeviceReady().

static void I2Cx_MspInit ( I2C_HandleTypeDef * i2c_handler ) [static]

Initializes I2C MSP.

Parameters:
i2c_handler : I2C handler
Return values:
None

Definition at line 466 of file stm32746g_discovery.c.

References DISCOVERY_AUDIO_I2Cx_CLK_ENABLE, DISCOVERY_AUDIO_I2Cx_ER_IRQn, DISCOVERY_AUDIO_I2Cx_EV_IRQn, DISCOVERY_AUDIO_I2Cx_FORCE_RESET, DISCOVERY_AUDIO_I2Cx_RELEASE_RESET, DISCOVERY_AUDIO_I2Cx_SCL_PIN, DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF, DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE, DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT, DISCOVERY_AUDIO_I2Cx_SDA_PIN, DISCOVERY_EXT_I2Cx_CLK_ENABLE, DISCOVERY_EXT_I2Cx_ER_IRQn, DISCOVERY_EXT_I2Cx_EV_IRQn, DISCOVERY_EXT_I2Cx_FORCE_RESET, DISCOVERY_EXT_I2Cx_RELEASE_RESET, DISCOVERY_EXT_I2Cx_SCL_PIN, DISCOVERY_EXT_I2Cx_SCL_SDA_AF, DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE, DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT, DISCOVERY_EXT_I2Cx_SDA_PIN, and hI2cAudioHandler.

Referenced by I2Cx_Init().

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

Reads multiple data.

Parameters:
i2c_handler : I2C handler
Addr,: I2C address
Reg,: Reg address
MemAddress,: Memory address
Buffer,: Pointer to data buffer
Length,: Length of the data
Return values:
Number of read data

Definition at line 591 of file stm32746g_discovery.c.

References I2Cx_Error().

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

static HAL_StatusTypeDef I2Cx_WriteMultiple | ( | I2C_HandleTypeDef * | i2c_handler,
 |  | 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:
i2c_handler : I2C handler
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 621 of file stm32746g_discovery.c.

References I2Cx_Error().

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

void TS_IO_Delay ( uint32_t Delay )

TS delay.

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

Definition at line 881 of file stm32746g_discovery.c.

void TS_IO_Init ( void )

Initializes Touchscreen low level.

Return values:
None

Definition at line 844 of file stm32746g_discovery.c.

References hI2cAudioHandler, and I2Cx_Init().

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

Reads a single data.

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

Definition at line 867 of file stm32746g_discovery.c.

References hI2cAudioHandler, and I2Cx_ReadMultiple().

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

Writes a single data.

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

Definition at line 856 of file stm32746g_discovery.c.

References hI2cAudioHandler, and I2Cx_WriteMultiple().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Exported Types

Enumerations
STM32746G_DISCOVERY_LOW_LEVEL Exported Types
STM32746G_DISCOVERY_LOW_LEVEL

Enumerations

enum | Led_TypeDef { LED1 = 0, LED_GREEN = LED1 }
enum | Button_TypeDef { BUTTON_WAKEUP = 0, BUTTON_TAMPER = 1, BUTTON_KEY = 2 }
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
enum | COM_TypeDef { COM1 = 0, COM2 = 1 }

Enumeration Type Documentation

enum Button_TypeDef
Enumerator:
BUTTON_WAKEUP
BUTTON_TAMPER
BUTTON_KEY

Definition at line 69 of file stm32746g_discovery.h.

enum ButtonMode_TypeDef
Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 76 of file stm32746g_discovery.h.

enum COM_TypeDef
Enumerator:
COM1
COM2

Definition at line 82 of file stm32746g_discovery.h.

enum Led_TypeDef
Enumerator:
LED1
LED_GREEN

Definition at line 63 of file stm32746g_discovery.h.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL_LED

Defines
STM32746G_DISCOVERY_LOW_LEVEL_LED
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants

Define for STM32746G_DISCOVERY board. More...

Defines

#define | LEDn ((uint8_t)1)
#define | LED1_GPIO_PORT GPIOI
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_1

Detailed Description

Define for STM32746G_DISCOVERY board.

Define Documentation

#define LED1_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 110 of file stm32746g_discovery.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 109 of file stm32746g_discovery.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT GPIOI

Definition at line 108 of file stm32746g_discovery.h.

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

#define LED1_PIN GPIO_PIN_1

Definition at line 111 of file stm32746g_discovery.h.

#define LEDn ((uint8_t)1)

Definition at line 106 of file stm32746g_discovery.h.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL_BUTTON

Defines
STM32746G_DISCOVERY_LOW_LEVEL_BUTTON
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants

Defines

#define | BUTTONn ((uint8_t)3)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_11
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOI
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | TAMPER_BUTTON_PIN GPIO_PIN_11
Tamper push-button.
#define | TAMPER_BUTTON_GPIO_PORT GPIOI
#define | TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | KEY_BUTTON_PIN GPIO_PIN_11
Key push-button.
#define | KEY_BUTTON_GPIO_PORT GPIOI
#define | KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | BUTTONx_GPIO_CLK_ENABLE(__INDEX__)
#define | BUTTONx_GPIO_CLK_DISABLE(__INDEX__)

Define Documentation

#define BUTTONn ((uint8_t)3)

Definition at line 120 of file stm32746g_discovery.h.

#define BUTTONx_GPIO_CLK_DISABLE ( __INDEX__ )
Value:
(((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\
                                                ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE())

Definition at line 153 of file stm32746g_discovery.h.

#define BUTTONx_GPIO_CLK_ENABLE ( __INDEX__ )
Value:
do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\
                                                   if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\
                                                                                KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0)

Definition at line 149 of file stm32746g_discovery.h.

Referenced by BSP_PB_Init().

#define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 147 of file stm32746g_discovery.h.

#define KEY_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 146 of file stm32746g_discovery.h.

#define KEY_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 145 of file stm32746g_discovery.h.

#define KEY_BUTTON_GPIO_PORT GPIOI

Definition at line 144 of file stm32746g_discovery.h.

#define KEY_BUTTON_PIN GPIO_PIN_11

Key push-button.

Definition at line 143 of file stm32746g_discovery.h.

#define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 138 of file stm32746g_discovery.h.

#define TAMPER_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 137 of file stm32746g_discovery.h.

#define TAMPER_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 136 of file stm32746g_discovery.h.

#define TAMPER_BUTTON_GPIO_PORT GPIOI

Definition at line 135 of file stm32746g_discovery.h.

#define TAMPER_BUTTON_PIN GPIO_PIN_11

Tamper push-button.

Definition at line 134 of file stm32746g_discovery.h.

#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 129 of file stm32746g_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 128 of file stm32746g_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 127 of file stm32746g_discovery.h.

#define WAKEUP_BUTTON_GPIO_PORT GPIOI

Definition at line 126 of file stm32746g_discovery.h.

#define WAKEUP_BUTTON_PIN GPIO_PIN_11

Wakeup push-button.

Definition at line 125 of file stm32746g_discovery.h.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL

Defines
STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants

Defines

#define | SIGNALn ((uint8_t)1)
#define | SD_DETECT_PIN GPIO_PIN_13
SD-detect signal.
#define | SD_DETECT_GPIO_PORT GPIOC
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI15_10_IRQn
#define | TS_INT_PIN GPIO_PIN_13
Touch screen interrupt signal.
#define | TS_INT_GPIO_PORT GPIOI
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI15_10_IRQn

Define Documentation

#define SD_DETECT_EXTI_IRQn EXTI15_10_IRQn

Definition at line 172 of file stm32746g_discovery.h.

Referenced by BSP_SD_ITConfig().

#define SD_DETECT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 171 of file stm32746g_discovery.h.

#define SD_DETECT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 170 of file stm32746g_discovery.h.

Referenced by BSP_SD_Detect_MspInit().

#define SD_DETECT_GPIO_PORT GPIOC

Definition at line 169 of file stm32746g_discovery.h.

Referenced by BSP_SD_Detect_MspInit(), BSP_SD_IsDetected(), and BSP_SD_ITConfig().

#define SD_DETECT_PIN GPIO_PIN_13

SD-detect signal.

Definition at line 168 of file stm32746g_discovery.h.

Referenced by BSP_SD_Detect_MspInit(), BSP_SD_IsDetected(), and BSP_SD_ITConfig().

#define SIGNALn ((uint8_t)1)

Definition at line 163 of file stm32746g_discovery.h.

#define TS_INT_EXTI_IRQn EXTI15_10_IRQn

Definition at line 181 of file stm32746g_discovery.h.

Referenced by BSP_TS_ITConfig().

#define TS_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 180 of file stm32746g_discovery.h.

#define TS_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 179 of file stm32746g_discovery.h.

#define TS_INT_GPIO_PORT GPIOI

Definition at line 178 of file stm32746g_discovery.h.

Referenced by BSP_TS_ITConfig().

#define TS_INT_PIN GPIO_PIN_13

Touch screen interrupt signal.

Definition at line 177 of file stm32746g_discovery.h.

Referenced by BSP_TS_ITConfig().

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL_COM

Defines
STM32746G_DISCOVERY_LOW_LEVEL_COM
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants

Defines

#define | COMn ((uint8_t)1)
#define | DISCOVERY_COM1 USART1
Definition for COM port1, connected to USART1.
#define | DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
#define | DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_PIN GPIO_PIN_9
#define | DISCOVERY_COM1_TX_GPIO_PORT GPIOA
#define | DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_AF GPIO_AF7_USART1
#define | DISCOVERY_COM1_RX_PIN GPIO_PIN_7
#define | DISCOVERY_COM1_RX_GPIO_PORT GPIOB
#define | DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_COM1_RX_AF GPIO_AF7_USART1
#define | DISCOVERY_COM1_IRQn USART1_IRQn
#define | DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0)
#define | LCD_I2C_ADDRESS ((uint16_t)0x70)
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x60)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
#define | TS_I2C_ADDRESS ((uint16_t)0x70)
#define | DISCOVERY_AUDIO_I2Cx I2C3
#define | DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE()
#define | DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_7
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOH
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3
#define | DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_8
#define | DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C3_EV_IRQn
#define | DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C3_ER_IRQn
#define | DISCOVERY_EXT_I2Cx I2C1
#define | DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9
#define | DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn

Define Documentation

#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)

Definition at line 226 of file stm32746g_discovery.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), 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 CAMERA_I2C_ADDRESS ((uint16_t)0x60)

Definition at line 225 of file stm32746g_discovery.h.

Referenced by BSP_CAMERA_Init().

#define COMn ((uint8_t)1)

Definition at line 190 of file stm32746g_discovery.h.

#define DISCOVERY_AUDIO_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 244 of file stm32746g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx I2C3

Definition at line 242 of file stm32746g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C3_CLK_ENABLE()

Definition at line 243 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C3_ER_IRQn

Definition at line 258 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C3_EV_IRQn

Definition at line 257 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C3_FORCE_RESET()

Definition at line 247 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C3_RELEASE_RESET()

Definition at line 248 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_7

Definition at line 251 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3

Definition at line 253 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 245 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOH

Definition at line 252 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_8

Definition at line 254 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_COM1 USART1

Definition for COM port1, connected to USART1.

Definition at line 195 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_CLK_DISABLE ( ) __HAL_RCC_USART1_CLK_DISABLE()

Definition at line 197 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_CLK_ENABLE ( ) __HAL_RCC_USART1_CLK_ENABLE()

Definition at line 196 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_IRQn USART1_IRQn

Definition at line 211 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_RX_AF GPIO_AF7_USART1

Definition at line 209 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 208 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 207 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_PORT GPIOB

Definition at line 206 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_RX_PIN GPIO_PIN_7

Definition at line 205 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_TX_AF GPIO_AF7_USART1

Definition at line 203 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 202 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 201 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_PORT GPIOA

Definition at line 200 of file stm32746g_discovery.h.

#define DISCOVERY_COM1_TX_PIN GPIO_PIN_9

Definition at line 199 of file stm32746g_discovery.h.

#define DISCOVERY_COMx_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0)

Definition at line 214 of file stm32746g_discovery.h.

Referenced by BSP_COM_DeInit().

#define DISCOVERY_COMx_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0)

Definition at line 213 of file stm32746g_discovery.h.

Referenced by BSP_COM_Init().

#define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0)

Definition at line 220 of file stm32746g_discovery.h.

#define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0)

Definition at line 219 of file stm32746g_discovery.h.

Referenced by BSP_COM_Init().

#define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0)

Definition at line 217 of file stm32746g_discovery.h.

#define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0)

Definition at line 216 of file stm32746g_discovery.h.

Referenced by BSP_COM_Init().

#define DISCOVERY_EXT_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 263 of file stm32746g_discovery.h.

#define DISCOVERY_EXT_I2Cx I2C1

Definition at line 261 of file stm32746g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_EXT_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 262 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn

Definition at line 277 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn

Definition at line 276 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 266 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 267 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8

Definition at line 270 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 272 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 264 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB

Definition at line 271 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9

Definition at line 273 of file stm32746g_discovery.h.

Referenced by I2Cx_MspInit().

#define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)

Definition at line 227 of file stm32746g_discovery.h.

Referenced by BSP_EEPROM_Init().

#define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)

Definition at line 228 of file stm32746g_discovery.h.

Referenced by BSP_EEPROM_Init().

#define LCD_I2C_ADDRESS ((uint16_t)0x70)

Definition at line 224 of file stm32746g_discovery.h.

#define TS_I2C_ADDRESS ((uint16_t)0x70)

Definition at line 229 of file stm32746g_discovery.h.

Referenced by BSP_TS_Init().

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Exported Macros

STM32746G_DISCOVERY_LOW_LEVEL Exported Macros
STM32746G_DISCOVERY_LOW_LEVEL
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Private Types

STM32746G_DISCOVERY AUDIO Private Types
STM32746G_DISCOVERY AUDIO
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Private Defines

STM32746G_DISCOVERY AUDIO Private Defines
STM32746G_DISCOVERY AUDIO
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Private Macros

STM32746G_DISCOVERY AUDIO Private Macros
STM32746G_DISCOVERY AUDIO
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Private Variables

Variables
STM32746G_DISCOVERY AUDIO Private Variables
STM32746G_DISCOVERY AUDIO

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai = {0}
SAI_HandleTypeDef | haudio_in_sai = {0}
TIM_HandleTypeDef | haudio_tim
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Variable Documentation

AUDIO_DrvTypeDef* audio_drv

Definition at line 144 of file stm32746g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), 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().

uint16_t __IO AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Definition at line 149 of file stm32746g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_SetVolume().

SAI_HandleTypeDef haudio_in_sai = {0}

Definition at line 146 of file stm32746g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_SAI_ErrorCallback(), SAIx_In_DeInit(), and SAIx_In_Init().

SAI_HandleTypeDef haudio_out_sai = {0}

Definition at line 145 of file stm32746g_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(), HAL_SAI_ErrorCallback(), SAIx_In_Init(), SAIx_Out_DeInit(), and SAIx_Out_Init().

TIM_HandleTypeDef haudio_tim

Definition at line 147 of file stm32746g_discovery_audio.c.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Private Function Prototypes

STM32746G_DISCOVERY AUDIO Private Function Prototypes
STM32746G_DISCOVERY AUDIO
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO Out Exported Functions

Functions
STM32746G_DISCOVERY AUDIO Out Exported Functions
STM32746G_DISCOVERY AUDIO

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
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)
This function 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)
Deinit the audio peripherals.
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (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.
static void | SAIx_Out_Init (uint32_t AudioFreq)
Initializes the output Audio Codec audio interface (SAI).
static void | SAIx_Out_DeInit (void)
Deinitializes the output Audio Codec audio interface (SAI).

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 254 of file stm32746g_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
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 665 of file stm32746g_discovery_audio.c.

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

void BSP_AUDIO_OUT_DeInit ( void )

Deinit the audio peripherals.

Return values:
None

Definition at line 451 of file stm32746g_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 527 of file stm32746g_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 519 of file stm32746g_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 peripherals.

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.
Note:
The I2S PLL input clock must be done in the user application.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 179 of file stm32746g_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_SAIx, BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), 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
Return values:
None

Definition at line 620 of file stm32746g_discovery_audio.c.

References AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_CLK_DISABLE, AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_SAIx_FS_GPIO_PORT, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SCK_SD_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
Return values:
None

Definition at line 537 of file stm32746g_discovery_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_OUT_SAIx, AUDIO_OUT_SAIx_CLK_ENABLE, AUDIO_OUT_SAIx_DMAx_CHANNEL, 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_STREAM, AUDIO_OUT_SAIx_FS_ENABLE, AUDIO_OUT_SAIx_FS_GPIO_PORT, AUDIO_OUT_SAIx_FS_PIN, AUDIO_OUT_SAIx_FS_SD_MCLK_AF, AUDIO_OUT_SAIx_MCLK_ENABLE, AUDIO_OUT_SAIx_MCLK_GPIO_PORT, AUDIO_OUT_SAIx_MCLK_PIN, AUDIO_OUT_SAIx_SCK_AF, AUDIO_OUT_SAIx_SCK_PIN, AUDIO_OUT_SAIx_SCK_SD_ENABLE, AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT, and AUDIO_OUT_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_InitEx(), 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.

Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behaviour).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 267 of file stm32746g_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 in BYTES unit. In memory, first element is for left channel, second element is for right channel
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 232 of file stm32746g_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 )

This function Resumes the audio file stream.

Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behaviour).
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 291 of file stm32746g_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 This parameter can be one of the following values
  • CODEC_AUDIOFRAME_SLOT_0123
  • CODEC_AUDIOFRAME_SLOT_02
  • CODEC_AUDIOFRAME_SLOT_13
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frame slot.
Return values:
None

Definition at line 434 of file stm32746g_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 407 of file stm32746g_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 365 of file stm32746g_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 386 of file stm32746g_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 345 of file stm32746g_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 317 of file stm32746g_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 511 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_TxCpltCallback().

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 487 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_IN_Error_CallBack(), BSP_AUDIO_OUT_Error_CallBack(), haudio_in_sai, and haudio_out_sai.

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 463 of file stm32746g_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 475 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_OUT_HalfTransfer_CallBack().

static void SAIx_Out_DeInit ( void ) [static]

Deinitializes the output Audio Codec audio interface (SAI).

Return values:
None

Definition at line 770 of file stm32746g_discovery_audio.c.

References AUDIO_OUT_SAIx, and haudio_out_sai.

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

static void SAIx_Out_Init ( uint32_t AudioFreq ) [static]

Initializes the output Audio Codec audio interface (SAI).

Parameters:
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 714 of file stm32746g_discovery_audio.c.

References AUDIO_OUT_SAIx, CODEC_AUDIOFRAME_SLOT_0123, and haudio_out_sai.

Referenced by BSP_AUDIO_OUT_Init().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO Out Private Functions

Functions
STM32746G_DISCOVERY_AUDIO Out Private Functions
STM32746G_DISCOVERY AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_OUT_Init (uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (uint32_t Option)
Stops audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pauses the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resumes 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.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Rx Transfer completed callbacks.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Rx Half Transfer completed callbacks.
__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_Error_CallBack (void)
Audio IN Error callback function.
__weak void | BSP_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
static void | SAIx_In_Init (uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the input Audio Codec audio interface (SAI).
static void | SAIx_In_DeInit (void)
Deinitializes the output Audio Codec audio interface (SAI).

Function Documentation

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 1064 of file stm32746g_discovery_audio.c.

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

__weak void BSP_AUDIO_IN_Error_CallBack ( void )

Audio IN Error callback function.

Return values:
None

Definition at line 1120 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

__weak void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1109 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_RxHalfCpltCallback().

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

Initializes wave recording.

Parameters:
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 796 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_IN_InitEx().

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

Initializes wave recording.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MICROPHONE_2 or INPUT_DEVICE_INPUT_LINE_1
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 809 of file stm32746g_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, SAIx_In_DeInit(), and SAIx_In_Init().

Referenced by BSP_AUDIO_IN_Init().

__weak void BSP_AUDIO_IN_MspDeInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  |

DeInitializes BSP_AUDIO_IN MSP.

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

Definition at line 1205 of file stm32746g_discovery_audio.c.

References 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_DeInit().

__weak void BSP_AUDIO_IN_MspInit | ( | SAI_HandleTypeDef * | hsai,
 |  | void * | Params
 | ) |  |

Initializes BSP_AUDIO_IN MSP.

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

Definition at line 1132 of file stm32746g_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_SAIx, AUDIO_IN_SAIx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_CHANNEL, 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_STREAM, AUDIO_IN_SAIx_SD_AF, AUDIO_IN_SAIx_SD_ENABLE, AUDIO_IN_SAIx_SD_GPIO_PORT, and AUDIO_IN_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

uint8_t BSP_AUDIO_IN_OUT_Init | ( | uint16_t | InputDevice,
 |  | uint16_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 887 of file stm32746g_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, AUDIO_OUT_SAIx, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, haudio_out_sai, SAIx_In_DeInit(), SAIx_In_Init(), and SAIx_Out_DeInit().

uint8_t BSP_AUDIO_IN_Pause ( void )

Pauses the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1019 of file stm32746g_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

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

Starts audio recording.

Parameters:
pbuf,: Main buffer pointer for the recorded data storing
size,: size of the recorded buffer in number of elements (typically number of half-words) Be careful that it is not the same unit than BSP_AUDIO_OUT_Play function
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 971 of file stm32746g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_Resume ( void )

Resumes the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1031 of file stm32746g_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t Volume )

Controls the audio in volume level.

Parameters:
Volume,: Volume level in range 0(Mute)..80(+0dB)..100(+17.625dB)
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1044 of file stm32746g_discovery_audio.c.

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

uint8_t BSP_AUDIO_IN_Stop ( uint32_t Option )

Stops audio recording.

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 993 of file stm32746g_discovery_audio.c.

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

__weak void BSP_AUDIO_IN_TransferComplete_CallBack ( void )

User callback when record buffer is filled.

Return values:
None

Definition at line 1098 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_RxCpltCallback().

void HAL_SAI_RxCpltCallback ( SAI_HandleTypeDef * hsai )

Rx Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 1076 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_IN_TransferComplete_CallBack().

void HAL_SAI_RxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

Rx Half Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 1087 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_IN_HalfTransfer_CallBack().

static void SAIx_In_DeInit ( void ) [static]

Deinitializes the output Audio Codec audio interface (SAI).

Return values:
None

Definition at line 1352 of file stm32746g_discovery_audio.c.

References AUDIO_IN_SAIx, and haudio_in_sai.

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

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

Initializes the input Audio Codec audio interface (SAI).

Parameters:
SaiOutMode,: SAI_MODEMASTER_TX (for record and playback in parallel) or SAI_MODEMASTER_RX (for record only).
SlotActive,: CODEC_AUDIOFRAME_SLOT_02 or CODEC_AUDIOFRAME_SLOT_13
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
Return values:
None

Definition at line 1247 of file stm32746g_discovery_audio.c.

References AUDIO_IN_SAIx, AUDIO_OUT_SAIx, haudio_in_sai, and haudio_out_sai.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO Exported Types

STM32746G_DISCOVERY_AUDIO Exported Types
STM32746G_DISCOVERY AUDIO
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO Exported Constants

Defines
STM32746G_DISCOVERY_AUDIO Exported Constants
STM32746G_DISCOVERY AUDIO

Defines

#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_OUT_SAIx SAI2_Block_A
#define | AUDIO_OUT_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_OUT_SAIx_SCK_AF GPIO_AF10_SAI2
#define | AUDIO_OUT_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_4
#define | AUDIO_OUT_SAIx_SCK_SD_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_FS_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream4
#define | AUDIO_OUT_SAIx_DMAx_CHANNEL DMA_CHANNEL_3
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream4_IRQn
#define | AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | DMA_MAX_SZE ((uint16_t)0xFFFF)
#define | AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_IN_SAIx SAI2_Block_B
#define | AUDIO_IN_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_IN_SAIx_SD_AF GPIO_AF10_SAI2
#define | AUDIO_IN_SAIx_SD_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_IN_SAIx_SD_GPIO_PORT GPIOG
#define | AUDIO_IN_SAIx_SD_PIN GPIO_PIN_10
#define | AUDIO_IN_INT_GPIO_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | AUDIO_IN_INT_GPIO_PORT GPIOH
#define | AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15
#define | AUDIO_IN_INT_IRQ EXTI15_10_IRQn
#define | AUDIO_IN_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream7
#define | AUDIO_IN_SAIx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream7_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_Stream7_IRQHandler
#define | AUDIO_IN_INT_IRQHandler EXTI15_10_IRQHandler
#define | AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) /* Select the preemption priority level(0 is the highest) */
#define | AUDIODATA_SIZE ((uint16_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 I2S_AUDIOFREQ_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2) /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)
#define | CODEC_RESET_DELAY ((uint8_t)5)
#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */

Define Documentation

#define AUDIO_ERROR ((uint8_t)1)

Definition at line 162 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_IN_Record(), 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_IN_INT_GPIO_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 135 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15

Definition at line 137 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_INT_GPIO_PORT GPIOH

Definition at line 136 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_INT_IRQ EXTI15_10_IRQn

Definition at line 138 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_INT_IRQHandler EXTI15_10_IRQHandler

Definition at line 149 of file stm32746g_discovery_audio.h.

#define AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) /* Select the preemption priority level(0 is the highest) */

Definition at line 152 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx SAI2_Block_B

Definition at line 126 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_MspDeInit(), BSP_AUDIO_IN_MspInit(), BSP_AUDIO_IN_OUT_Init(), SAIx_In_DeInit(), and SAIx_In_Init().

#define AUDIO_IN_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI2_CLK_DISABLE()

Definition at line 128 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit().

#define AUDIO_IN_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI2_CLK_ENABLE()

Definition at line 127 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 143 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 141 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream7_IRQn

Definition at line 144 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream7_IRQHandler

Definition at line 148 of file stm32746g_discovery_audio.h.

#define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 146 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 145 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream7

Definition at line 142 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_SD_AF GPIO_AF10_SAI2

Definition at line 129 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_SD_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 131 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_SD_GPIO_PORT GPIOG

Definition at line 132 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_IN_SAIx_SD_PIN GPIO_PIN_10

Definition at line 133 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_OK ((uint8_t)0)

Definition at line 161 of file stm32746g_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_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) /* Select the preemption priority level(0 is the highest) */

Definition at line 120 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx SAI2_Block_A

Definition at line 91 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_OUT_Init(), BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_MspDeInit(), BSP_AUDIO_OUT_MspInit(), SAIx_In_Init(), SAIx_Out_DeInit(), and SAIx_Out_Init().

#define AUDIO_OUT_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI2_CLK_DISABLE()

Definition at line 93 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit().

#define AUDIO_OUT_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI2_CLK_ENABLE()

Definition at line 92 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_CHANNEL DMA_CHANNEL_3

Definition at line 111 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 109 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream4_IRQn

Definition at line 112 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler

Definition at line 117 of file stm32746g_discovery_audio.h.

#define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 114 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 113 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream4

Definition at line 110 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_FS_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 104 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOI

Definition at line 105 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_7

Definition at line 106 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2

Definition at line 95 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 97 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOI

Definition at line 98 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_4

Definition at line 99 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SCK_AF GPIO_AF10_SAI2

Definition at line 94 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5

Definition at line 102 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SCK_SD_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 100 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT GPIOI

Definition at line 101 of file stm32746g_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 103 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_TIMEOUT ((uint8_t)2)

Definition at line 163 of file stm32746g_discovery_audio.h.

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

Definition at line 158 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

Definition at line 84 of file stm32746g_discovery_audio.h.

Referenced by SAIx_Out_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 86 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 88 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

#define CODEC_RESET_DELAY ((uint8_t)5)

Definition at line 176 of file stm32746g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)

Definition at line 167 of file stm32746g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2) /* Mono = 1, Stereo = 2 */

Definition at line 168 of file stm32746g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_FREQ I2S_AUDIOFREQ_16K

Definition at line 166 of file stm32746g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)

Definition at line 169 of file stm32746g_discovery_audio.h.

#define DMA_MAX_SZE ((uint16_t)0xFFFF)

Definition at line 115 of file stm32746g_discovery_audio.h.

#define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE

Definition at line 183 of file stm32746g_discovery_audio.h.

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

Definition at line 184 of file stm32746g_discovery_audio.h.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO Exported Variables

Variables
STM32746G_DISCOVERY_AUDIO Exported Variables
STM32746G_DISCOVERY AUDIO

Variables

__IO uint16_t AudioInVolume

Variable Documentation

__IO uint16_t AudioInVolume

Definition at line 149 of file stm32746g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_SetVolume().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO Exported Macros

Defines
STM32746G_DISCOVERY_AUDIO Exported Macros
STM32746G_DISCOVERY AUDIO

Defines

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

Define Documentation

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

Definition at line 201 of file stm32746g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_AUDIO_IN Exported Functions

Functions
STM32746G_DISCOVERY_AUDIO_IN Exported Functions
STM32746G_DISCOVERY AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_OUT_Init (uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (uint32_t Option)
Stops audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pauses the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resumes 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.
void | BSP_AUDIO_IN_TransferComplete_CallBack (void)
User callback when record buffer is filled.
void | BSP_AUDIO_IN_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
void | BSP_AUDIO_IN_Error_CallBack (void)
Audio IN Error callback function.
void | BSP_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
DeInitializes BSP_AUDIO_IN MSP.

Function Documentation

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 1064 of file stm32746g_discovery_audio.c.

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

void BSP_AUDIO_IN_Error_CallBack ( void )

Audio IN Error callback function.

Return values:
None

Definition at line 1120 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1109 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_RxHalfCpltCallback().

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

Initializes wave recording.

Parameters:
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 796 of file stm32746g_discovery_audio.c.

References BSP_AUDIO_IN_InitEx().

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

Initializes wave recording.

Parameters:
InputDevice,: INPUT_DEVICE_DIGITAL_MICROPHONE_2 or INPUT_DEVICE_INPUT_LINE_1
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 809 of file stm32746g_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, SAIx_In_DeInit(), and SAIx_In_Init().

Referenced by BSP_AUDIO_IN_Init().

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

DeInitializes BSP_AUDIO_IN MSP.

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

Definition at line 1205 of file stm32746g_discovery_audio.c.

References 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_DeInit().

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

Initializes BSP_AUDIO_IN MSP.

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

Definition at line 1132 of file stm32746g_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_SAIx, AUDIO_IN_SAIx_CLK_ENABLE, AUDIO_IN_SAIx_DMAx_CHANNEL, 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_STREAM, AUDIO_IN_SAIx_SD_AF, AUDIO_IN_SAIx_SD_ENABLE, AUDIO_IN_SAIx_SD_GPIO_PORT, and AUDIO_IN_SAIx_SD_PIN.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_OUT_Init().

uint8_t BSP_AUDIO_IN_OUT_Init | ( | uint16_t | InputDevice,
 |  | uint16_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 887 of file stm32746g_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, AUDIO_OUT_SAIx, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, haudio_out_sai, SAIx_In_DeInit(), SAIx_In_Init(), and SAIx_Out_DeInit().

uint8_t BSP_AUDIO_IN_Pause ( void )

Pauses the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1019 of file stm32746g_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

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

Starts audio recording.

Parameters:
pbuf,: Main buffer pointer for the recorded data storing
size,: size of the recorded buffer in number of elements (typically number of half-words) Be careful that it is not the same unit than BSP_AUDIO_OUT_Play function
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 971 of file stm32746g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_Resume ( void )

Resumes the audio file stream.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1031 of file stm32746g_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t Volume )

Controls the audio in volume level.

Parameters:
Volume,: Volume level in range 0(Mute)..80(+0dB)..100(+17.625dB)
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 1044 of file stm32746g_discovery_audio.c.

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

uint8_t BSP_AUDIO_IN_Stop ( uint32_t Option )

Stops audio recording.

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 993 of file stm32746g_discovery_audio.c.

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

void BSP_AUDIO_IN_TransferComplete_CallBack ( void )

User callback when record buffer is filled.

Return values:
None

Definition at line 1098 of file stm32746g_discovery_audio.c.

Referenced by HAL_SAI_RxCpltCallback().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY QSPI Private Variables

Variables
STM32746G_DISCOVERY QSPI Private Variables
STM32746G-Discovery QSPI

Variables

QSPI_HandleTypeDef QSPIHandle

Variable Documentation

QSPI_HandleTypeDef QSPIHandle

Definition at line 94 of file stm32746g_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(), and BSP_QSPI_Write().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY QSPI Private Functions

Functions
STM32746G_DISCOVERY QSPI Private Functions
STM32746G-Discovery QSPI

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
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.
__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

__weak 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 576 of file stm32746g_discovery_qspi.c.

References QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_PORT, QSPI_D3_PIN, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_DeInit().

__weak 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 510 of file stm32746g_discovery_qspi.c.

References QSPI_CLK_ENABLE, QSPI_CLK_GPIO_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_CLK_ENABLE, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_CLK_ENABLE, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_CLK_ENABLE, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_CLK_ENABLE, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_CLK_ENABLE, QSPI_D3_GPIO_PORT, QSPI_D3_PIN, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_Init().

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
Return values:
None

Definition at line 751 of file stm32746g_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Write(), 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 646 of file stm32746g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

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 604 of file stm32746g_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, and QSPI_OK.

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 705 of file stm32746g_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

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


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY QSPI Exported Functions

Functions
STM32746G_DISCOVERY QSPI Exported Functions
STM32746G-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.
void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
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 171 of file stm32746g_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 465 of file stm32746g_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 314 of file stm32746g_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 356 of file stm32746g_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 449 of file stm32746g_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 396 of file stm32746g_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 124 of file stm32746g_discovery_qspi.c.

References BSP_QSPI_MspInit(), QSPI_DummyCyclesCfg(), 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 576 of file stm32746g_discovery_qspi.c.

References QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_PORT, QSPI_D3_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 510 of file stm32746g_discovery_qspi.c.

References QSPI_CLK_ENABLE, QSPI_CLK_GPIO_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_CLK_ENABLE, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_CLK_ENABLE, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_CLK_ENABLE, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_CLK_ENABLE, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_CLK_ENABLE, QSPI_D3_GPIO_PORT, QSPI_D3_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 194 of file stm32746g_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 240 of file stm32746g_discovery_qspi.c.

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


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_QSPI Exported Constants

Defines
STM32746G_DISCOVERY_QSPI Exported Constants
STM32746G-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_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
#define | QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
#define | QSPI_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | QSPI_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_FORCE_RESET() __HAL_RCC_QSPI_FORCE_RESET()
#define | QSPI_RELEASE_RESET() __HAL_RCC_QSPI_RELEASE_RESET()
#define | QSPI_CS_PIN GPIO_PIN_6
#define | QSPI_CS_GPIO_PORT GPIOB
#define | QSPI_CLK_PIN GPIO_PIN_2
#define | QSPI_CLK_GPIO_PORT GPIOB
#define | QSPI_D0_PIN GPIO_PIN_11
#define | QSPI_D0_GPIO_PORT GPIOD
#define | QSPI_D1_PIN GPIO_PIN_12
#define | QSPI_D1_GPIO_PORT GPIOD
#define | QSPI_D2_PIN GPIO_PIN_2
#define | QSPI_D2_GPIO_PORT GPIOE
#define | QSPI_D3_PIN GPIO_PIN_13
#define | QSPI_D3_GPIO_PORT GPIOD
#define | QSPI_FLASH_SIZE 23 /* Address bus width to access whole memory space */
#define | QSPI_PAGE_SIZE 256
#define | BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode

Define Documentation

#define BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode

Definition at line 107 of file stm32746g_discovery_qspi.h.

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 69 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().

#define QSPI_CLK_DISABLE ( ) __HAL_RCC_QSPI_CLK_DISABLE()

Definition at line 76 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_CLK_ENABLE ( ) __HAL_RCC_QSPI_CLK_ENABLE()

Definition at line 75 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 78 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_PORT GPIOB

Definition at line 91 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CLK_PIN GPIO_PIN_2

Definition at line 90 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 77 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_PORT GPIOB

Definition at line 89 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CS_PIN GPIO_PIN_6

Definition at line 88 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 79 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D0_GPIO_PORT GPIOD

Definition at line 93 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D0_PIN GPIO_PIN_11

Definition at line 92 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 80 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D1_GPIO_PORT GPIOD

Definition at line 95 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D1_PIN GPIO_PIN_12

Definition at line 94 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 81 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D2_GPIO_PORT GPIOE

Definition at line 97 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D2_PIN GPIO_PIN_2

Definition at line 96 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 82 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D3_GPIO_PORT GPIOD

Definition at line 99 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D3_PIN GPIO_PIN_13

Definition at line 98 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_ERROR ((uint8_t)0x01)

Definition at line 68 of file stm32746g_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_ResetMemory(), and QSPI_WriteEnable().

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

Definition at line 103 of file stm32746g_discovery_qspi.h.

#define QSPI_FORCE_RESET ( ) __HAL_RCC_QSPI_FORCE_RESET()

Definition at line 84 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)

Definition at line 70 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

Definition at line 67 of file stm32746g_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_ResetMemory(), and QSPI_WriteEnable().

#define QSPI_PAGE_SIZE 256

Definition at line 104 of file stm32746g_discovery_qspi.h.

#define QSPI_RELEASE_RESET ( ) __HAL_RCC_QSPI_RELEASE_RESET()

Definition at line 85 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_SUSPENDED ((uint8_t)0x08)

Definition at line 71 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().


STM32746G-Discovery BSP User Manual: QSPI_Info Struct Reference

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

#include <stm32746g_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 117 of file stm32746g_discovery_qspi.h.

Field Documentation

uint32_t QSPI_Info::EraseSectorSize

Size of sectors for the erase operation

Definition at line 119 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::EraseSectorsNumber

Number of sectors for the erase operation

Definition at line 120 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::FlashSize

Size of the flash

Definition at line 118 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPageSize

Size of pages for the program operation

Definition at line 121 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPagesNumber

Number of pages for the program operation

Definition at line 122 of file stm32746g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

The documentation for this struct was generated from the following file:
  • stm32746g_discovery_qspi.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Private Types Definitions

STM32746G_DISCOVERY_SD Private Types Definitions
STM32746G_DISCOVERY_SD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Private Defines

STM32746G_DISCOVERY_SD Private Defines
STM32746G_DISCOVERY_SD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Private Macros

STM32746G_DISCOVERY_SD Private Macros
STM32746G_DISCOVERY_SD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Private Variables

Variables
STM32746G_DISCOVERY_SD Private Variables
STM32746G_DISCOVERY_SD

Variables

SD_HandleTypeDef uSdHandle

Variable Documentation

SD_HandleTypeDef uSdHandle

Definition at line 126 of file stm32746g_discovery_sd.c.

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


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Private Function Prototypes

STM32746G_DISCOVERY_SD Private Function Prototypes
STM32746G_DISCOVERY_SD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Exported Functions

Functions
STM32746G_DISCOVERY_SD Exported Functions
STM32746G_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 SD 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_Detect_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (HAL_SD_CardInfoTypeDef *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 567 of file stm32746g_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 198 of file stm32746g_discovery_sd.c.

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

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

Initializes the SD Detect pin MSP.

Parameters:
hsd,: SD handle
Params
Return values:
None

Definition at line 459 of file stm32746g_discovery_sd.c.

References SD_DETECT_GPIO_CLK_ENABLE, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

Referenced by BSP_SD_Init().

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 342 of file stm32746g_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( HAL_SD_CardInfoTypeDef * CardInfo )

Get SD information about specific SD card.

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

Definition at line 527 of file stm32746g_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

Definition at line 516 of file stm32746g_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 147 of file stm32746g_discovery_sd.c.

References BSP_SD_Detect_MspInit(), BSP_SD_IsDetected(), BSP_SD_MspInit(), MSD_ERROR, MSD_ERROR_SD_NOT_PRESENT, MSD_OK, SD_PRESENT, and 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 243 of file stm32746g_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 SD detection pin.

Return values:
Returns MSD_OK

Definition at line 221 of file stm32746g_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
Return values:
None

Definition at line 479 of file stm32746g_discovery_sd.c.

References SD_DMAx_Rx_IRQn, SD_DMAx_Rx_STREAM, SD_DMAx_Tx_IRQn, and SD_DMAx_Tx_STREAM.

Referenced by BSP_SD_DeInit().

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

Initializes the SD MSP.

Parameters:
hsd,: SD handle
Params
Return values:
None

Definition at line 360 of file stm32746g_discovery_sd.c.

References __DMAx_TxRx_CLK_ENABLE, SD_DMAx_Rx_CHANNEL, SD_DMAx_Rx_IRQn, SD_DMAx_Rx_STREAM, SD_DMAx_Tx_CHANNEL, SD_DMAx_Tx_IRQn, and SD_DMAx_Tx_STREAM.

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 264 of file stm32746g_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 303 of file stm32746g_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 585 of file stm32746g_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 284 of file stm32746g_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 323 of file stm32746g_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 576 of file stm32746g_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 538 of file stm32746g_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 558 of file stm32746g_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 548 of file stm32746g_discovery_sd.c.

References BSP_SD_WriteCpltCallback().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Exported Types

Defines
STM32746G_DISCOVERY_SD Exported Types
STM32746G_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 67 of file stm32746g_discovery_sd.h.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Exported Constants

Defines
STM32746G_DISCOVERY_SD Exported Constants
STM32746G_DISCOVERY_SD

Defines

#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SD_DATATIMEOUT ((uint32_t)100000000)
#define | __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Tx_STREAM DMA2_Stream6
#define | SD_DMAx_Rx_STREAM DMA2_Stream3
#define | SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | BSP_SDMMC_IRQHandler SDMMC1_IRQHandler
#define | BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler
#define | SD_DetectIRQHandler() HAL_GPIO_EXTI_IRQHandler(SD_DETECT_PIN)

Define Documentation

#define __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 94 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 103 of file stm32746g_discovery_sd.h.

#define BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 102 of file stm32746g_discovery_sd.h.

#define BSP_SDMMC_IRQHandler SDMMC1_IRQHandler

Definition at line 101 of file stm32746g_discovery_sd.h.

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 91 of file stm32746g_discovery_sd.h.

#define SD_DetectIRQHandler ( ) HAL_GPIO_EXTI_IRQHandler(SD_DETECT_PIN)

Definition at line 104 of file stm32746g_discovery_sd.h.

#define SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4

Definition at line 96 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn

Definition at line 100 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Rx_STREAM DMA2_Stream3

Definition at line 98 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4

Definition at line 95 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn

Definition at line 99 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_STREAM DMA2_Stream6

Definition at line 97 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_NOT_PRESENT ((uint8_t)0x00)

Definition at line 89 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 88 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_Init(), and BSP_SD_IsDetected().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD Exported Macro

STM32746G_DISCOVERY_SD Exported Macro
STM32746G_DISCOVERY_SD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SD

Modules | Defines
STM32746G_DISCOVERY_SD
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_SD Private Types Definitions
STM32746G_DISCOVERY_SD Private Defines
STM32746G_DISCOVERY_SD Private Macros
STM32746G_DISCOVERY_SD Private Variables
STM32746G_DISCOVERY_SD Private Function Prototypes
STM32746G_DISCOVERY_SD Exported Functions
STM32746G_DISCOVERY_SD Exported Types
STM32746G_DISCOVERY_SD Exported Constants
STM32746G_DISCOVERY_SD Exported Macro

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 Documentation

#define MSD_ERROR ((uint8_t)0x01)

Definition at line 76 of file stm32746g_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 77 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

Definition at line 75 of file stm32746g_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_TRANSFER_BUSY ((uint8_t)0x01)

Definition at line 83 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK ((uint8_t)0x00)

SD transfer state definition.

Definition at line 82 of file stm32746g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Private Types Definitions

STM32746G_DISCOVERY_SDRAM Private Types Definitions
STM32746G_DISCOVERY_SDRAM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Private Defines

STM32746G_DISCOVERY_SDRAM Private Defines
STM32746G_DISCOVERY_SDRAM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Private Macros

STM32746G_DISCOVERY_SDRAM Private Macros
STM32746G_DISCOVERY_SDRAM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Private Variables

Variables
STM32746G_DISCOVERY_SDRAM Private Variables
STM32746G_DISCOVERY_SDRAM

Variables

SDRAM_HandleTypeDef | sdramHandle
static FMC_SDRAM_TimingTypeDef | Timing
static FMC_SDRAM_CommandTypeDef | Command

Variable Documentation

FMC_SDRAM_CommandTypeDef Command [static]

Definition at line 126 of file stm32746g_discovery_sdram.c.

Referenced by BSP_SDRAM_Initialization_sequence().

SDRAM_HandleTypeDef sdramHandle

Definition at line 124 of file stm32746g_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().

FMC_SDRAM_TimingTypeDef Timing [static]

Definition at line 125 of file stm32746g_discovery_sdram.c.

Referenced by BSP_SDRAM_Init().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Private Function Prototypes

STM32746G_DISCOVERY_SDRAM Private Function Prototypes
STM32746G_DISCOVERY_SDRAM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Exported Functions

Functions
STM32746G_DISCOVERY_SDRAM Exported Functions
STM32746G_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 195 of file stm32746g_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 146 of file stm32746g_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_Init().

void BSP_SDRAM_Initialization_sequence ( uint32_t RefreshCount )

Programs the SDRAM device.

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

Definition at line 221 of file stm32746g_discovery_sdram.c.

References Command, SDRAM_MODEREG_BURST_LENGTH_1, SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL, SDRAM_MODEREG_CAS_LATENCY_2, 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
Return values:
None

Definition at line 466 of file stm32746g_discovery_sdram.c.

References SDRAM_DMAx_IRQn, and SDRAM_DMAx_STREAM.

Referenced by BSP_SDRAM_DeInit().

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

Initializes SDRAM MSP.

Parameters:
hsdram,: SDRAM handle
Params
Return values:
None

Definition at line 375 of file stm32746g_discovery_sdram.c.

References __DMAx_CLK_ENABLE, SDRAM_DMAx_CHANNEL, SDRAM_DMAx_IRQn, and SDRAM_DMAx_STREAM.

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 283 of file stm32746g_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 302 of file stm32746g_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 357 of file stm32746g_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 321 of file stm32746g_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 340 of file stm32746g_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Exported Constants

Defines
STM32746G_DISCOVERY_SDRAM Exported Constants
STM32746G_DISCOVERY_SDRAM Exported Types

Defines

#define | SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)
#define | SDRAM_DEVICE_SIZE ((uint32_t)0x800000) /* SDRAM device size in MBytes */
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16
#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 | __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SDRAM_DMAx_CHANNEL DMA_CHANNEL_0
#define | SDRAM_DMAx_STREAM DMA2_Stream0
#define | SDRAM_DMAx_IRQn DMA2_Stream0_IRQn
#define | BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler

Define Documentation

#define __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE

Definition at line 88 of file stm32746g_discovery_sdram.h.

#define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 87 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler

Definition at line 92 of file stm32746g_discovery_sdram.h.

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

Definition at line 82 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2

Definition at line 79 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)

Definition at line 73 of file stm32746g_discovery_sdram.h.

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

Definition at line 74 of file stm32746g_discovery_sdram.h.

#define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 89 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn

Definition at line 91 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_DMAx_STREAM DMA2_Stream0

Definition at line 90 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16

Definition at line 77 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)

Definition at line 84 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence(), and BSP_SDRAM_Sendcmd().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Exported Types

Modules | Defines
STM32746G_DISCOVERY_SDRAM Exported Types
STM32746G_DISCOVERY_SDRAM

Modules

STM32746G_DISCOVERY_SDRAM Exported Constants

Defines

#define | SDRAM_OK ((uint8_t)0x00)
SDRAM status structure definition.
#define | SDRAM_ERROR ((uint8_t)0x01)
#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 SDRAM_ERROR ((uint8_t)0x01)

Definition at line 68 of file stm32746g_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_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)

FMC SDRAM Mode definition register defines.

Definition at line 100 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)

Definition at line 101 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)

Definition at line 102 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)

Definition at line 103 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)

Definition at line 105 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)

Definition at line 104 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)

Definition at line 106 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)

Definition at line 107 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)

Definition at line 108 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)

Definition at line 109 of file stm32746g_discovery_sdram.h.

#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Definition at line 110 of file stm32746g_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_OK ((uint8_t)0x00)

SDRAM status structure definition.

Definition at line 67 of file stm32746g_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().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM Exported Macro

STM32746G_DISCOVERY_SDRAM Exported Macro
STM32746G_DISCOVERY_SDRAM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Types Definitions

STM32746G_DISCOVERY_TS Types Definitions
STM32746G_DISCOVERY_TS
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Types Defines

STM32746G_DISCOVERY_TS Types Defines
STM32746G_DISCOVERY_TS
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Private Macros

STM32746G_DISCOVERY_TS Private Macros
STM32746G_DISCOVERY_TS
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Imported Variables

Variables
STM32746G_DISCOVERY_TS Imported Variables
STM32746G_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.

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.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Private Variables

Variables
STM32746G_DISCOVERY_TS Private Variables
STM32746G_DISCOVERY_TS

Variables

static TS_DrvTypeDef * | tsDriver
static uint16_t | tsXBoundary
static uint16_t | tsYBoundary
static uint8_t | tsOrientation
static uint8_t | I2cAddress

Variable Documentation

uint8_t I2cAddress [static]

Definition at line 123 of file stm32746g_discovery_ts.c.

Referenced by BSP_TS_Get_GestureId(), BSP_TS_GetState(), BSP_TS_Init(), BSP_TS_ITClear(), BSP_TS_ITConfig(), and BSP_TS_ITGetStatus().

TS_DrvTypeDef* tsDriver [static]

Definition at line 120 of file stm32746g_discovery_ts.c.

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

uint8_t tsOrientation [static]

Definition at line 122 of file stm32746g_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsXBoundary [static]

Definition at line 121 of file stm32746g_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsYBoundary [static]

Definition at line 121 of file stm32746g_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Private Function Prototypes

STM32746G_DISCOVERY_TS Private Function Prototypes
STM32746G_DISCOVERY_TS
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: TS Private Functions

Functions
TS Private Functions
STM32746G_DISCOVERY_TS Exported Functions

Functions

uint8_t BSP_TS_ResetTouchData (TS_StateTypeDef *TS_State)
Function used to reset all touch data before a new acquisition of touch information.

Function Documentation

uint8_t BSP_TS_ResetTouchData ( TS_StateTypeDef * TS_State )

Function used to reset all touch data before a new acquisition of touch information.

Parameters:
TS_State,: Pointer to touch screen current state structure
Return values:
TS_OK if OK, TE_ERROR if problem found.

Definition at line 404 of file stm32746g_discovery_ts.c.

References GEST_ID_NO_GESTURE, TS_StateTypeDef::gestureId, TOUCH_EVENT_NO_EVT, TS_StateTypeDef::touchArea, TS_StateTypeDef::touchDetected, TS_StateTypeDef::touchEventId, TS_StateTypeDef::touchWeight, TS_StateTypeDef::touchX, TS_StateTypeDef::touchY, TS_ERROR, TS_MAX_NB_TOUCH, and TS_OK.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Exported Functions

Modules | Functions
STM32746G_DISCOVERY_TS Exported Functions
STM32746G_DISCOVERY_TS

Modules

TS Private Functions

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_DeInit (void)
DeInitializes the TouchScreen.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITGetStatus (void)
Gets the touch screen interrupt status.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_Get_GestureId (TS_StateTypeDef *TS_State)
Update gesture Id following a touch detected.
void | BSP_TS_ITClear (void)
Clears all touch screen interrupts.
uint8_t | BSP_TS_ResetTouchData (TS_StateTypeDef *TS_State)
Function used to reset all touch data before a new acquisition of touch information.

Function Documentation

uint8_t BSP_TS_DeInit ( void )

DeInitializes the TouchScreen.

Return values:
TS state

Definition at line 176 of file stm32746g_discovery_ts.c.

References TS_OK.

uint8_t BSP_TS_Get_GestureId ( TS_StateTypeDef * TS_State )

Update gesture Id following a touch detected.

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 342 of file stm32746g_discovery_ts.c.

References GEST_ID_MOVE_DOWN, GEST_ID_MOVE_LEFT, GEST_ID_MOVE_RIGHT, GEST_ID_MOVE_UP, GEST_ID_NO_GESTURE, GEST_ID_ZOOM_IN, GEST_ID_ZOOM_OUT, TS_StateTypeDef::gestureId, I2cAddress, TS_ERROR, and TS_OK.

Referenced by BSP_TS_GetState().

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 222 of file stm32746g_discovery_ts.c.

References BSP_TS_Get_GestureId(), I2cAddress, TOUCH_EVENT_CONTACT, TOUCH_EVENT_LIFT_UP, TOUCH_EVENT_NO_EVT, TOUCH_EVENT_PRESS_DOWN, TS_StateTypeDef::touchArea, TS_StateTypeDef::touchDetected, TS_StateTypeDef::touchEventId, TS_StateTypeDef::touchWeight, TS_StateTypeDef::touchX, TS_StateTypeDef::touchY, TS_ERROR, TS_MAX_NB_TOUCH, TS_OK, TS_SWAP_NONE, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, tsOrientation, tsXBoundary, and tsYBoundary.

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 146 of file stm32746g_discovery_ts.c.

References I2cAddress, TS_DEVICE_NOT_FOUND, TS_I2C_ADDRESS, TS_OK, TS_SWAP_XY, tsDriver, tsOrientation, tsXBoundary, and tsYBoundary.

void BSP_TS_ITClear ( void )

Clears all touch screen interrupts.

Definition at line 386 of file stm32746g_discovery_ts.c.

References I2cAddress, and tsDriver.

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 186 of file stm32746g_discovery_ts.c.

References I2cAddress, TS_INT_EXTI_IRQn, TS_INT_GPIO_PORT, TS_INT_PIN, TS_OK, and tsDriver.

uint8_t BSP_TS_ITGetStatus ( void )

Gets the touch screen interrupt status.

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

Definition at line 211 of file stm32746g_discovery_ts.c.

References I2cAddress, and tsDriver.

uint8_t BSP_TS_ResetTouchData ( TS_StateTypeDef * TS_State )

Function used to reset all touch data before a new acquisition of touch information.

Parameters:
TS_State,: Pointer to touch screen current state structure
Return values:
TS_OK if OK, TE_ERROR if problem found.

Definition at line 404 of file stm32746g_discovery_ts.c.

References GEST_ID_NO_GESTURE, TS_StateTypeDef::gestureId, TOUCH_EVENT_NO_EVT, TS_StateTypeDef::touchArea, TS_StateTypeDef::touchDetected, TS_StateTypeDef::touchEventId, TS_StateTypeDef::touchWeight, TS_StateTypeDef::touchX, TS_StateTypeDef::touchY, TS_ERROR, TS_MAX_NB_TOUCH, and TS_OK.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Exported Constants

Defines | Enumerations
STM32746G_DISCOVERY_TS Exported Constants
STM32746G_DISCOVERY_TS

Defines

#define | TS_MAX_NB_TOUCH ((uint32_t) FT5336_MAX_DETECTABLE_TOUCH)
With FT5336 : maximum 5 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 }
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...

Define Documentation

#define TS_IRQ_PENDING ((uint8_t) 1)

Definition at line 71 of file stm32746g_discovery_ts.h.

#define TS_MAX_NB_TOUCH ((uint32_t) FT5336_MAX_DETECTABLE_TOUCH)

With FT5336 : maximum 5 touches detected simultaneously.

Definition at line 68 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

#define TS_NO_IRQ_PENDING ((uint8_t) 0)

Definition at line 70 of file stm32746g_discovery_ts.h.

#define TS_SWAP_NONE ((uint8_t) 0x01)

Definition at line 73 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_X ((uint8_t) 0x02)

Definition at line 74 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_XY ((uint8_t) 0x08)

Definition at line 76 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

#define TS_SWAP_Y ((uint8_t) 0x04)

Definition at line 75 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState().

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 125 of file stm32746g_discovery_ts.h.

enum TS_StatusTypeDef
Enumerator:
TS_OK

Touch Ok

TS_ERROR

Touch Error

TS_TIMEOUT

Touch Timeout

TS_DEVICE_NOT_FOUND

Touchscreen device not found

Definition at line 112 of file stm32746g_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 143 of file stm32746g_discovery_ts.h.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: TS_StateTypeDef Struct Reference

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

TS_StateTypeDef Define TS State structure. More...

#include <stm32746g_discovery_ts.h>

Data Fields

uint8_t | touchDetected
uint16_t | touchX [TS_MAX_NB_TOUCH]
uint16_t | touchY [TS_MAX_NB_TOUCH]
uint8_t | touchWeight [TS_MAX_NB_TOUCH]
uint8_t | touchEventId [TS_MAX_NB_TOUCH]
uint8_t | touchArea [TS_MAX_NB_TOUCH]
uint32_t | gestureId

Detailed Description

TS_StateTypeDef Define TS State structure.

Definition at line 89 of file stm32746g_discovery_ts.h.

Field Documentation

uint32_t TS_StateTypeDef::gestureId

type of gesture detected : take value of type TS_GestureIdTypeDef

Definition at line 99 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_Get_GestureId(), and BSP_TS_ResetTouchData().

uint8_t TS_StateTypeDef::touchArea[TS_MAX_NB_TOUCH]

Touch_Area[0], Touch_Area[1] : touch area of each touch

Definition at line 98 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

uint8_t TS_StateTypeDef::touchDetected

Total number of active touches detected at last scan

Definition at line 91 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

uint8_t TS_StateTypeDef::touchEventId[TS_MAX_NB_TOUCH]

Touch_EventId[0], Touch_EventId[1] : take value of type TS_TouchEventTypeDef

Definition at line 97 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

uint8_t TS_StateTypeDef::touchWeight[TS_MAX_NB_TOUCH]

Touch_Weight[0], Touch_Weight[1] : weight property of touches

Definition at line 96 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

uint16_t TS_StateTypeDef::touchX[TS_MAX_NB_TOUCH]

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

Definition at line 92 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

uint16_t TS_StateTypeDef::touchY[TS_MAX_NB_TOUCH]

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

Definition at line 93 of file stm32746g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_ResetTouchData().

The documentation for this struct was generated from the following file:
  • stm32746g_discovery_ts.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Private Types Definitions

STM32746G_DISCOVERY_CAMERA Private Types Definitions
STM32746G_DISCOVERY_CAMERA
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Private Defines

Defines
STM32746G_DISCOVERY_CAMERA Private Defines
STM32746G_DISCOVERY_CAMERA

Defines

#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 Documentation

#define CAMERA_480x272_RES_X 480

Definition at line 99 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

#define CAMERA_480x272_RES_Y 272

Definition at line 100 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

#define CAMERA_QQVGA_RES_X 160

Definition at line 103 of file stm32746g_discovery_camera.c.

#define CAMERA_QQVGA_RES_Y 120

Definition at line 104 of file stm32746g_discovery_camera.c.

#define CAMERA_QVGA_RES_X 320

Definition at line 101 of file stm32746g_discovery_camera.c.

#define CAMERA_QVGA_RES_Y 240

Definition at line 102 of file stm32746g_discovery_camera.c.

#define CAMERA_VGA_RES_X 640

Definition at line 97 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

#define CAMERA_VGA_RES_Y 480

Definition at line 98 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Private Macros

STM32746G_DISCOVERY_CAMERA Private Macros
STM32746G_DISCOVERY_CAMERA
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Private Variables

Variables
STM32746G_DISCOVERY_CAMERA Private Variables
STM32746G_DISCOVERY_CAMERA

Variables

DCMI_HandleTypeDef | hDcmiHandler
CAMERA_DrvTypeDef * | camera_drv
static uint32_t | CameraCurrentResolution
static uint32_t | CameraHwAddress

Variable Documentation

CAMERA_DrvTypeDef* camera_drv

Definition at line 120 of file stm32746g_discovery_camera.c.

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

uint32_t CameraCurrentResolution [static]

Definition at line 122 of file stm32746g_discovery_camera.c.

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

uint32_t CameraHwAddress [static]

Definition at line 125 of file stm32746g_discovery_camera.c.

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

DCMI_HandleTypeDef hDcmiHandler

Definition at line 119 of file stm32746g_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().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Private Function Prototypes

STM32746G_DISCOVERY_CAMERA Private Function Prototypes
STM32746G_DISCOVERY_CAMERA
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Exported Functions

Functions
STM32746G_DISCOVERY_CAMERA Exported Functions
STM32746G_DISCOVERY_CAMERA

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.
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
Return values:
None

Definition at line 371 of file stm32746g_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 389 of file stm32746g_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 231 of file stm32746g_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiHandler.

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
Return values:
None

Definition at line 353 of file stm32746g_discovery_camera.c.

References camera_drv, and CameraHwAddress.

uint8_t BSP_CAMERA_DeInit ( void )

DeInitializes the camera.

Return values:
Camera status

Definition at line 217 of file stm32746g_discovery_camera.c.

References BSP_CAMERA_MspDeInit(), CAMERA_OK, and hDcmiHandler.

void BSP_CAMERA_ErrorCallback ( void )

Error callback.

Return values:
None

Definition at line 636 of file stm32746g_discovery_camera.c.

Referenced by HAL_DCMI_ErrorCallback().

void BSP_CAMERA_FrameEventCallback ( void )

Frame Event callback.

Return values:
None

Definition at line 615 of file stm32746g_discovery_camera.c.

Referenced by HAL_DCMI_FrameEventCallback().

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 148 of file stm32746g_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 hDcmiHandler.

void BSP_CAMERA_LineEventCallback ( void )

Line Event callback.

Return values:
None

Definition at line 573 of file stm32746g_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
Return values:
None

Definition at line 541 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_DeInit().

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

Initializes the DCMI MSP.

Parameters:
hdcmi,: HDMI handle
Params
Return values:
None

Definition at line 444 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_PwrDown ( void )

CAMERA power down.

Return values:
None

Definition at line 316 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Stop().

void BSP_CAMERA_PwrUp ( void )

CANERA power up.

Return values:
None

Definition at line 291 of file stm32746g_discovery_camera.c.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_Resume ( void )

Resume the CAMERA capture.

Return values:
None

Definition at line 262 of file stm32746g_discovery_camera.c.

References hDcmiHandler.

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 242 of file stm32746g_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiHandler.

uint8_t BSP_CAMERA_Stop ( void )

Stop the CAMERA capture.

Return values:
Camera status

Definition at line 272 of file stm32746g_discovery_camera.c.

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

void BSP_CAMERA_Suspend ( void )

Suspend the CAMERA capture.

Return values:
None

Definition at line 252 of file stm32746g_discovery_camera.c.

References hDcmiHandler.

void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 594 of file stm32746g_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 402 of file stm32746g_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 627 of file stm32746g_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 606 of file stm32746g_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 564 of file stm32746g_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 585 of file stm32746g_discovery_camera.c.

References BSP_CAMERA_VsyncEventCallback().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Exported Types

Defines | Enumerations
STM32746G_DISCOVERY_CAMERA Exported Types
STM32746G_DISCOVERY_CAMERA

Defines

#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 */

Enumerations

enum Camera_StatusTypeDef {
CAMERA_OK = 0x00, CAMERA_ERROR = 0x01, CAMERA_TIMEOUT = 0x02, CAMERA_NOT_DETECTED = 0x03,
CAMERA_NOT_SUPPORTED = 0x04
}
Camera State structures definition. More...

Define Documentation

#define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */

Definition at line 79 of file stm32746g_discovery_camera.h.

#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */

Definition at line 80 of file stm32746g_discovery_camera.h.

#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */

Definition at line 81 of file stm32746g_discovery_camera.h.

#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Definition at line 82 of file stm32746g_discovery_camera.h.

Enumeration Type Documentation

enum Camera_StatusTypeDef

Camera State structures definition.

Enumerator:
CAMERA_OK
CAMERA_ERROR
CAMERA_TIMEOUT
CAMERA_NOT_DETECTED
CAMERA_NOT_SUPPORTED

Definition at line 69 of file stm32746g_discovery_camera.h.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA Exported Constants

Defines
STM32746G_DISCOVERY_CAMERA Exported Constants
STM32746G_DISCOVERY_CAMERA

Defines

#define | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Stream1_IRQHandler

Define Documentation

#define BSP_CAMERA_DMA_IRQHandler DMA2_Stream1_IRQHandler

Definition at line 91 of file stm32746g_discovery_camera.h.

#define BSP_CAMERA_IRQHandler DCMI_IRQHandler

Definition at line 90 of file stm32746g_discovery_camera.h.


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Private Types

STM32746G_DISCOVERY_EEPROM Private Types
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Private Defines

STM32746G_DISCOVERY_EEPROM Private Defines
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Private Macros

STM32746G_DISCOVERY_EEPROM Private Macros
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Private Variables

Variables
STM32746G_DISCOVERY_EEPROM Private Variables
STM32746G_DISCOVERY_EEPROM

Variables

__IO uint16_t | EEPROMAddress = 0
__IO uint16_t | EEPROMDataRead
__IO uint8_t | EEPROMDataWrite

Variable Documentation

__IO uint16_t EEPROMAddress = 0

Definition at line 131 of file stm32746g_discovery_eeprom.c.

Referenced by BSP_EEPROM_Init(), BSP_EEPROM_ReadBuffer(), BSP_EEPROM_WaitEepromStandbyState(), and BSP_EEPROM_WritePage().

__IO uint16_t EEPROMDataRead

Definition at line 132 of file stm32746g_discovery_eeprom.c.

Referenced by BSP_EEPROM_ReadBuffer().

__IO uint8_t EEPROMDataWrite

Definition at line 133 of file stm32746g_discovery_eeprom.c.

Referenced by BSP_EEPROM_WritePage().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Private Function Prototypes

STM32746G_DISCOVERY_EEPROM Private Function Prototypes
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Exported Functions

Functions
STM32746G_DISCOVERY_EEPROM Exported Functions
STM32746G_DISCOVERY_EEPROM

Functions

uint32_t | BSP_EEPROM_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
uint8_t | BSP_EEPROM_DeInit (void)
DeInitializes the EEPROM.
uint32_t | BSP_EEPROM_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint16_t *NumByteToRead)
Reads a block of data from the EEPROM.
uint32_t | BSP_EEPROM_WritePage (uint8_t *pBuffer, uint16_t WriteAddr, uint8_t *NumByteToWrite)
Writes more than one byte to the EEPROM with a single WRITE cycle.
uint32_t | BSP_EEPROM_WriteBuffer (uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
Writes buffer of data to the I2C EEPROM.
uint32_t | BSP_EEPROM_WaitEepromStandbyState (void)
Wait for EEPROM Standby state.
__weak void | BSP_EEPROM_TIMEOUT_UserCallback (void)
Basic management of the timeout situation.
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.

Function Documentation

uint8_t BSP_EEPROM_DeInit ( void )

DeInitializes the EEPROM.

Return values:
EEPROM state

Definition at line 181 of file stm32746g_discovery_eeprom.c.

References EEPROM_OK.

uint32_t BSP_EEPROM_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Note:
There are 2 different versions of M24LR64 (A01 & A02). Then try to connect on 1st one (EEPROM_I2C_ADDRESS_A01) and if problem, check the 2nd one (EEPROM_I2C_ADDRESS_A02)
Return values:
EEPROM_OK (0) if operation is correctly performed, else return value different from EEPROM_OK (0)

Definition at line 158 of file stm32746g_discovery_eeprom.c.

References EEPROM_FAIL, EEPROM_I2C_ADDRESS_A01, EEPROM_I2C_ADDRESS_A02, EEPROM_IO_Init(), EEPROM_IO_IsDeviceReady(), EEPROM_MAX_TRIALS, EEPROM_OK, and EEPROMAddress.

uint32_t BSP_EEPROM_ReadBuffer | ( | uint8_t * | pBuffer,
 |  | uint16_t | ReadAddr,
 |  | uint16_t * | NumByteToRead
 | ) |  |

Reads a block of data from the EEPROM.

Parameters:
pBuffer,: pointer to the buffer that receives the data read from the EEPROM.
ReadAddr,: EEPROM's internal address to start reading from.
NumByteToRead,: pointer to the variable holding number of bytes to be read from the EEPROM.
Note:
The variable pointed by NumByteToRead is reset to 0 when all the data are read from the EEPROM. Application should monitor this variable in order know when the transfer is complete.
Return values:
EEPROM_OK (0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 202 of file stm32746g_discovery_eeprom.c.

References BSP_EEPROM_TIMEOUT_UserCallback(), EEPROM_FAIL, EEPROM_IO_ReadData(), EEPROM_OK, EEPROMAddress, and EEPROMDataRead.

void BSP_EEPROM_TIMEOUT_UserCallback ( void )

Basic management of the timeout situation.

Return values:
None

Definition at line 457 of file stm32746g_discovery_eeprom.c.

Referenced by BSP_EEPROM_ReadBuffer(), BSP_EEPROM_WaitEepromStandbyState(), and BSP_EEPROM_WritePage().

uint32_t BSP_EEPROM_WaitEepromStandbyState ( void )

Wait for EEPROM Standby state.

Note:
This function allows to wait and check that EEPROM has finished the last operation. It is mostly used after Write operation: after receiving the buffer to be written, the EEPROM may need additional time to actually perform the write operation. During this time, it doesn't answer to I2C packets addressed to it. Once the write operation is complete the EEPROM responds to its address.
Return values:
EEPROM_OK (0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 441 of file stm32746g_discovery_eeprom.c.

References BSP_EEPROM_TIMEOUT_UserCallback(), EEPROM_IO_IsDeviceReady(), EEPROM_MAX_TRIALS, EEPROM_OK, EEPROM_TIMEOUT, and EEPROMAddress.

Referenced by BSP_EEPROM_WritePage().

uint32_t BSP_EEPROM_WriteBuffer | ( | uint8_t * | pBuffer,
 |  | uint16_t | WriteAddr,
 |  | uint16_t | NumByteToWrite
 | ) |  |

Writes buffer of data to the I2C EEPROM.

Parameters:
pBuffer,: pointer to the buffer containing the data to be written to the EEPROM.
WriteAddr,: EEPROM's internal address to write to.
NumByteToWrite,: number of bytes to write to the EEPROM.
Return values:
EEPROM_OK (0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 284 of file stm32746g_discovery_eeprom.c.

References BSP_EEPROM_WritePage(), EEPROM_OK, and EEPROM_PAGESIZE.

uint32_t BSP_EEPROM_WritePage | ( | uint8_t * | pBuffer,
 |  | uint16_t | WriteAddr,
 |  | uint8_t * | NumByteToWrite
 | ) |  |

Writes more than one byte to the EEPROM with a single WRITE cycle.

Note:
The number of bytes (combined to write start address) must not cross the EEPROM page boundary. This function can only write into the boundaries of an EEPROM page. This function doesn't check on boundaries condition (in this driver the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is responsible of checking on Page boundaries).
Parameters:
pBuffer,: pointer to the buffer containing the data to be written to the EEPROM.
WriteAddr,: EEPROM's internal address to write to.
NumByteToWrite,: pointer to the variable holding number of bytes to be written into the EEPROM.
Note:
The variable pointed by NumByteToWrite is reset to 0 when all the data are written to the EEPROM. Application should monitor this variable in order know when the transfer is complete.
This function just configure the communication and enable the DMA channel to transfer data. Meanwhile, the user application may perform other tasks in parallel.
Return values:
EEPROM_OK (0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 249 of file stm32746g_discovery_eeprom.c.

References BSP_EEPROM_TIMEOUT_UserCallback(), BSP_EEPROM_WaitEepromStandbyState(), EEPROM_FAIL, EEPROM_IO_WriteData(), EEPROM_OK, EEPROMAddress, and EEPROMDataWrite.

Referenced by BSP_EEPROM_WriteBuffer().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Return values:
None

Definition at line 795 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_Init().

Referenced by BSP_EEPROM_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 833 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_IsDeviceReady().

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

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 821 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_ReadMultiple().

Referenced by BSP_EEPROM_ReadBuffer().

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 808 of file stm32746g_discovery.c.

References hI2cExtHandler, and I2Cx_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Exported Types

STM32746G_DISCOVERY_EEPROM Exported Types
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Exported Constants

Defines
STM32746G_DISCOVERY_EEPROM Exported Constants
STM32746G_DISCOVERY_EEPROM

Defines

#define | EEPROM_PAGESIZE ((uint8_t)4)
#define | EEPROM_MAX_SIZE ((uint16_t)0x2000) /* 64Kbit */
#define | EEPROM_MAX_TRIALS ((uint32_t)3000)
#define | EEPROM_OK ((uint32_t)0)
#define | EEPROM_FAIL ((uint32_t)1)
#define | EEPROM_TIMEOUT ((uint32_t)2)

Define Documentation

#define EEPROM_FAIL ((uint32_t)1)

Definition at line 80 of file stm32746g_discovery_eeprom.h.

Referenced by BSP_EEPROM_Init(), BSP_EEPROM_ReadBuffer(), and BSP_EEPROM_WritePage().

#define EEPROM_MAX_SIZE ((uint16_t)0x2000) /* 64Kbit */

Definition at line 73 of file stm32746g_discovery_eeprom.h.

#define EEPROM_MAX_TRIALS ((uint32_t)3000)

Definition at line 77 of file stm32746g_discovery_eeprom.h.

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

#define EEPROM_OK ((uint32_t)0)

Definition at line 79 of file stm32746g_discovery_eeprom.h.

Referenced by BSP_EEPROM_DeInit(), BSP_EEPROM_Init(), BSP_EEPROM_ReadBuffer(), BSP_EEPROM_WaitEepromStandbyState(), BSP_EEPROM_WriteBuffer(), and BSP_EEPROM_WritePage().

#define EEPROM_PAGESIZE ((uint8_t)4)

Definition at line 72 of file stm32746g_discovery_eeprom.h.

Referenced by BSP_EEPROM_WriteBuffer().

#define EEPROM_TIMEOUT ((uint32_t)2)

Definition at line 81 of file stm32746g_discovery_eeprom.h.

Referenced by BSP_EEPROM_WaitEepromStandbyState().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM Exported Macros

STM32746G_DISCOVERY_EEPROM Exported Macros
STM32746G_DISCOVERY_EEPROM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Private Types Definitions

STM32746G_DISCOVERY_LCD Private Types Definitions
STM32746G_DISCOVERY_LCD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY LCD Private Defines

Defines
STM32746G_DISCOVERY LCD Private Defines
STM32746G_DISCOVERY_LCD

Defines

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

Define Documentation

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

Definition at line 118 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().

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

Definition at line 119 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Private Macros

Defines
STM32746G_DISCOVERY_LCD Private Macros
STM32746G_DISCOVERY_LCD

Defines

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

Define Documentation

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

Definition at line 127 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_DrawLine(), and FillTriangle().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Private Variables

Variables
STM32746G_DISCOVERY_LCD Private Variables
STM32746G_DISCOVERY_LCD

Variables

LTDC_HandleTypeDef | hLtdcHandler
static DMA2D_HandleTypeDef | hDma2dHandler
static uint32_t | ActiveLayer = 0
static LCD_DrawPropTypeDef | DrawProp [MAX_LAYER_NUMBER]

Variable Documentation

uint32_t ActiveLayer = 0 [static]

Definition at line 139 of file stm32746g_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_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_ReadPixel(), BSP_LCD_SelectLayer(), BSP_LCD_SetBackColor(), BSP_LCD_SetFont(), BSP_LCD_SetTextColor(), BSP_LCD_SetXSize(), BSP_LCD_SetYSize(), DrawChar(), and LL_FillBuffer().

LCD_DrawPropTypeDef DrawProp[MAX_LAYER_NUMBER] [static]

Definition at line 140 of file stm32746g_discovery_lcd.c.

DMA2D_HandleTypeDef hDma2dHandler [static]

Definition at line 136 of file stm32746g_discovery_lcd.c.

Referenced by LL_ConvertLineToARGB8888(), and LL_FillBuffer().

LTDC_HandleTypeDef hLtdcHandler

Definition at line 135 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_Clear(), BSP_LCD_DeInit(), BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawPixel(), BSP_LCD_DrawVLine(), BSP_LCD_FillRect(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_Init(), BSP_LCD_LayerDefaultInit(), BSP_LCD_LayerRgb565Init(), BSP_LCD_ReadPixel(), BSP_LCD_Reload(), BSP_LCD_ResetColorKeying(), BSP_LCD_ResetColorKeying_NoReload(), BSP_LCD_SetColorKeying(), BSP_LCD_SetColorKeying_NoReload(), BSP_LCD_SetLayerAddress(), BSP_LCD_SetLayerAddress_NoReload(), BSP_LCD_SetLayerVisible(), BSP_LCD_SetLayerVisible_NoReload(), BSP_LCD_SetLayerWindow(), BSP_LCD_SetLayerWindow_NoReload(), BSP_LCD_SetTransparency(), BSP_LCD_SetTransparency_NoReload(), BSP_LCD_SetXSize(), BSP_LCD_SetYSize(), and LL_FillBuffer().


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Private Function Prototypes

STM32746G_DISCOVERY_LCD Private Function Prototypes
STM32746G_DISCOVERY_LCD
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Exported Functions

Functions
STM32746G_DISCOVERY_LCD Exported Functions
STM32746G_DISCOVERY_LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
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 layer in ARGB8888 format (32 bits per pixel).
void | BSP_LCD_LayerRgb565Init (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layer in RGB565 format (16 bits per pixel).
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_SetLayerVisible_NoReload (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible without reloading.
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetTransparency_NoReload (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency without reloading.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetLayerAddress_NoReload (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address without reloading.
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_SetLayerWindow_NoReload (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window without reloading.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_SetColorKeying_NoReload (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying without reloading.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_ResetColorKeying_NoReload (uint32_t LayerIndex)
Disables the color keying without reloading.
void | BSP_LCD_Reload (uint32_t ReloadType)
Disables the color keying without reloading.
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 hole LCD.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
Displays characters on the LCD.
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.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_DisplayOff (void)
Disables the display.
__weak void | BSP_LCD_MspInit (LTDC_HandleTypeDef *hltdc, void *Params)
Initializes the LTDC MSP.
__weak void | BSP_LCD_MspDeInit (LTDC_HandleTypeDef *hltdc, void *Params)
DeInitializes BSP_LCD MSP.
__weak void | BSP_LCD_ClockConfig (LTDC_HandleTypeDef *hltdc, void *Params)
Clock Config.
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

void BSP_LCD_Clear ( uint32_t Color )

Clears the hole LCD.

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

Definition at line 643 of file stm32746g_discovery_lcd.c.

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

void BSP_LCD_ClearStringLine ( uint32_t Line )

Clears the selected line.

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

Definition at line 654 of file stm32746g_discovery_lcd.c.

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

void BSP_LCD_ClockConfig | ( | LTDC_HandleTypeDef * | hltdc,
 |  | void * | Params
 | ) |  |

Clock Config.

Parameters:
hltdc,: LTDC handle
Params
Note:
This API is called by BSP_LCD_Init() Being __weak it can be overwritten by the application
Return values:
None

Definition at line 1418 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_Init().

uint8_t BSP_LCD_DeInit ( void )

DeInitializes the LCD.

Return values:
LCD state

Definition at line 226 of file stm32746g_discovery_lcd.c.

References BSP_LCD_MspDeInit(), hLtdcHandler, and LCD_OK.

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

Displays one character.

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 674 of file stm32746g_discovery_lcd.c.

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

Referenced by BSP_LCD_DisplayStringAt().

void BSP_LCD_DisplayOff ( void )

Disables the display.

Return values:
None

Definition at line 1283 of file stm32746g_discovery_lcd.c.

References hLtdcHandler, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_GPIO_PORT, and LCD_DISP_PIN.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Return values:
None

Definition at line 1271 of file stm32746g_discovery_lcd.c.

References hLtdcHandler, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_GPIO_PORT, and LCD_DISP_PIN.

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

Displays characters on the LCD.

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 692 of file stm32746g_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 753 of file stm32746g_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 in ARGB888 format (32 bits per pixel).

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 1037 of file stm32746g_discovery_lcd.c.

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

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

Draws a circle.

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

Definition at line 909 of file stm32746g_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.

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

Definition at line 984 of file stm32746g_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.

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

Definition at line 765 of file stm32746g_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcHandler, 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).

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 816 of file stm32746g_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 1017 of file stm32746g_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcHandler.

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).

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

Definition at line 956 of file stm32746g_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.

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

Definition at line 891 of file stm32746g_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.

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

Definition at line 790 of file stm32746g_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcHandler, 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.

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

Definition at line 1125 of file stm32746g_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.

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

Definition at line 1241 of file stm32746g_discovery_lcd.c.

References BSP_LCD_DrawHLine().

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

Draws a full poly-line (between many points).

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

Definition at line 1173 of file stm32746g_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.

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

Definition at line 1098 of file stm32746g_discovery_lcd.c.

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

Referenced by BSP_LCD_ClearStringLine().

uint32_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Return values:
Used background colour

Definition at line 578 of file stm32746g_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 597 of file stm32746g_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 559 of file stm32746g_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 247 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and hLtdcHandler.

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(), BSP_LCD_LayerRgb565Init(), and BSP_LCD_ReadPixel().

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Return values:
Used LCD Y size

Definition at line 256 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and hLtdcHandler.

Referenced by BSP_LCD_Clear(), BSP_LCD_LayerDefaultInit(), and BSP_LCD_LayerRgb565Init().

uint8_t BSP_LCD_Init ( void )

Initializes the LCD.

Return values:
LCD state

Definition at line 164 of file stm32746g_discovery_lcd.c.

References BSP_LCD_ClockConfig(), BSP_LCD_MspInit(), BSP_LCD_SetFont(), BSP_SDRAM_Init(), hLtdcHandler, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DEFAULT_FONT, LCD_DISP_GPIO_PORT, LCD_DISP_PIN, and LCD_OK.

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

Initializes the LCD layer in ARGB8888 format (32 bits per pixel).

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

Definition at line 287 of file stm32746g_discovery_lcd.c.

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

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

Initializes the LCD layer in RGB565 format (16 bits per pixel).

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

Definition at line 321 of file stm32746g_discovery_lcd.c.

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

void BSP_LCD_MspDeInit | ( | LTDC_HandleTypeDef * | hltdc,
 |  | void * | Params
 | ) |  |

DeInitializes BSP_LCD MSP.

Parameters:
hltdc,: LTDC handle
Params
Return values:
None

Definition at line 1369 of file stm32746g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit().

void BSP_LCD_MspInit | ( | LTDC_HandleTypeDef * | hltdc,
 |  | void * | Params
 | ) |  |

Initializes the LTDC MSP.

Parameters:
hltdc,: LTDC handle
Params
Return values:
None

Definition at line 1297 of file stm32746g_discovery_lcd.c.

References LCD_BL_CTRL_GPIO_CLK_ENABLE, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DISP_GPIO_CLK_ENABLE, LCD_DISP_GPIO_PORT, and LCD_DISP_PIN.

Referenced by BSP_LCD_Init().

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 608 of file stm32746g_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcHandler.

void BSP_LCD_Reload ( uint32_t ReloadType )

Disables the color keying without reloading.

Parameters:
ReloadType,: can be one of the following values
  • LCD_RELOAD_IMMEDIATE
  • LCD_RELOAD_VERTICAL_BLANKING
Return values:
None

Definition at line 540 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_ResetColorKeying ( uint32_t LayerIndex )

Disables the color keying.

Parameters:
LayerIndex,: Layer foreground or background
Return values:
None

Definition at line 516 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_ResetColorKeying_NoReload ( uint32_t LayerIndex )

Disables the color keying without reloading.

Parameters:
LayerIndex,: Layer foreground or background
Return values:
None

Definition at line 527 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_SelectLayer ( uint32_t LayerIndex )

Selects the LCD Layer.

Parameters:
LayerIndex,: Layer foreground or background
Return values:
None

Definition at line 354 of file stm32746g_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)
Return values:
None

Definition at line 569 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::BackColor.

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
Return values:
None

Definition at line 491 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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

Configures and sets the color keying without reloading.

Parameters:
LayerIndex,: Layer foreground or background
RGBValue,: Color reference
Return values:
None

Definition at line 504 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

Parameters:
fonts,: Layer font to be used
Return values:
None

Definition at line 588 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_Init().

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
Return values:
None

Definition at line 433 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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

Sets an LCD layer frame buffer address without reloading.

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

Definition at line 444 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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
Return values:
None

Definition at line 368 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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

Sets an LCD Layer visible without reloading.

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

Definition at line 390 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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
Return values:
None

Definition at line 458 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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

Sets display window without reloading.

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

Definition at line 476 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_SetTextColor ( uint32_t Color )

Sets the LCD text color.

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

Definition at line 550 of file stm32746g_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
Return values:
None

Definition at line 410 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

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

Configures the transparency without reloading.

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

Definition at line 422 of file stm32746g_discovery_lcd.c.

References hLtdcHandler.

void BSP_LCD_SetXSize ( uint32_t imageWidthPixels )

Set the LCD X size.

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

Definition at line 266 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and hLtdcHandler.

void BSP_LCD_SetYSize ( uint32_t imageHeightPixels )

Set the LCD Y size.

Parameters:
imageHeightPixels : image height in lines unit
Return values:
None

Definition at line 276 of file stm32746g_discovery_lcd.c.

References ActiveLayer, and hLtdcHandler.

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 1446 of file stm32746g_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 1505 of file stm32746g_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 1621 of file stm32746g_discovery_lcd.c.

References hDma2dHandler.

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 1583 of file stm32746g_discovery_lcd.c.

References ActiveLayer, hDma2dHandler, and hLtdcHandler.

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


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Exported Types

Data Structures | Typedefs | Enumerations
STM32746G_DISCOVERY_LCD Exported Types
STM32746G_DISCOVERY_LCD

Data Structures

struct | LCD_DrawPropTypeDef
struct | Point

Typedefs

typedef struct Point * | pPoint

Enumerations

enum | Text_AlignModeTypdef { CENTER_MODE = 0x01, RIGHT_MODE = 0x02, LEFT_MODE = 0x03 }
Line mode structures definition. More...

Typedef Documentation

typedef struct Point * pPoint

Enumeration Type Documentation

enum Text_AlignModeTypdef

Line mode structures definition.

Enumerator:
CENTER_MODE
RIGHT_MODE
LEFT_MODE

Definition at line 87 of file stm32746g_discovery_lcd.h.


STM32746G-Discovery BSP User Manual: LCD_DrawPropTypeDef Struct Reference

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

#include <stm32746g_discovery_lcd.h>

Data Fields

uint32_t | TextColor
uint32_t | BackColor
sFONT * | pFont

Detailed Description

Definition at line 71 of file stm32746g_discovery_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Definition at line 74 of file stm32746g_discovery_lcd.h.

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

sFONT* LCD_DrawPropTypeDef::pFont

Definition at line 75 of file stm32746g_discovery_lcd.h.

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

uint32_t LCD_DrawPropTypeDef::TextColor

Definition at line 73 of file stm32746g_discovery_lcd.h.

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

The documentation for this struct was generated from the following file:
  • stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Point Struct Reference

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

#include <stm32746g_discovery_lcd.h>

Data Fields

int16_t | X
int16_t | Y

Detailed Description

Definition at line 78 of file stm32746g_discovery_lcd.h.

Field Documentation

int16_t Point::X

Definition at line 80 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

Definition at line 81 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

The documentation for this struct was generated from the following file:
  • stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD Exported Constants

Defines
STM32746G_DISCOVERY_LCD Exported Constants
STM32746G_DISCOVERY_LCD

Defines

#define | MAX_LAYER_NUMBER ((uint32_t)2)
#define | LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
#define | LTDC_ACTIVE_LAYER ((uint32_t)1) /* Layer 1 */
#define | LCD_OK ((uint8_t)0x00)
LCD status structure definition.
#define | LCD_ERROR ((uint8_t)0x01)
#define | LCD_TIMEOUT ((uint8_t)0x02)
#define | LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)
LCD FB_StartAddress.
#define | LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)
LCD color.
#define | LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)
#define | LCD_COLOR_RED ((uint32_t)0xFFFF0000)
#define | LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)
#define | LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)
#define | LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)
#define | LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)
#define | LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)
#define | LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)
#define | LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)
#define | LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)
#define | LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)
#define | LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)
#define | LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)
#define | LCD_COLOR_DARKRED ((uint32_t)0xFF800000)
#define | LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)
#define | LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)
#define | LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)
#define | LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)
#define | LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)
#define | LCD_COLOR_GRAY ((uint32_t)0xFF808080)
#define | LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)
#define | LCD_COLOR_BLACK ((uint32_t)0xFF000000)
#define | LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)
#define | LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)
#define | LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)
#define | LCD_DEFAULT_FONT Font24
LCD default font.
#define | LCD_RELOAD_IMMEDIATE ((uint32_t)LTDC_SRCR_IMR)
LCD Reload Types.
#define | LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)
#define | LCD_DISP_PIN GPIO_PIN_12
LCD special pins.
#define | LCD_DISP_GPIO_PORT GPIOI
#define | LCD_DISP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LCD_DISP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_3
#define | LCD_BL_CTRL_GPIO_PORT GPIOK
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()

Define Documentation

#define LCD_BL_CTRL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 173 of file stm32746g_discovery_lcd.h.

#define LCD_BL_CTRL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 172 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit().

#define LCD_BL_CTRL_GPIO_PORT GPIOK

Definition at line 171 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_Init(), and BSP_LCD_MspInit().

#define LCD_BL_CTRL_PIN GPIO_PIN_3

Definition at line 170 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_Init(), and BSP_LCD_MspInit().

#define LCD_COLOR_BLACK ((uint32_t)0xFF000000)

Definition at line 143 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit(), and BSP_LCD_LayerRgb565Init().

#define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)

LCD color.

Definition at line 121 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)

Definition at line 144 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)

Definition at line 124 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)

Definition at line 133 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)

Definition at line 136 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)

Definition at line 142 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)

Definition at line 134 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)

Definition at line 137 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKRED ((uint32_t)0xFF800000)

Definition at line 135 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)

Definition at line 138 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_GRAY ((uint32_t)0xFF808080)

Definition at line 141 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)

Definition at line 122 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)

Definition at line 127 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)

Definition at line 130 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)

Definition at line 140 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)

Definition at line 128 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)

Definition at line 131 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)

Definition at line 129 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)

Definition at line 132 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)

Definition at line 125 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)

Definition at line 145 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_RED ((uint32_t)0xFFFF0000)

Definition at line 123 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)

Definition at line 146 of file stm32746g_discovery_lcd.h.

#define LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)

Definition at line 139 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit(), and BSP_LCD_LayerRgb565Init().

#define LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)

Definition at line 126 of file stm32746g_discovery_lcd.h.

#define LCD_DEFAULT_FONT Font24

LCD default font.

Definition at line 151 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_Init().

#define LCD_DISP_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 167 of file stm32746g_discovery_lcd.h.

#define LCD_DISP_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 166 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit().

#define LCD_DISP_GPIO_PORT GPIOI

Definition at line 165 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_Init(), and BSP_LCD_MspInit().

#define LCD_DISP_PIN GPIO_PIN_12

LCD special pins.

Definition at line 164 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_Init(), and BSP_LCD_MspInit().

#define LCD_ERROR ((uint8_t)0x01)

Definition at line 110 of file stm32746g_discovery_lcd.h.

#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)

LCD FB_StartAddress.

Definition at line 116 of file stm32746g_discovery_lcd.h.

#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef

Definition at line 103 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit(), and BSP_LCD_LayerRgb565Init().

#define LCD_OK ((uint8_t)0x00)

LCD status structure definition.

Definition at line 109 of file stm32746g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), and BSP_LCD_Init().

#define LCD_RELOAD_IMMEDIATE ((uint32_t)LTDC_SRCR_IMR)

LCD Reload Types.

Definition at line 156 of file stm32746g_discovery_lcd.h.

#define LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)

Definition at line 157 of file stm32746g_discovery_lcd.h.

#define LCD_TIMEOUT ((uint8_t)0x02)

Definition at line 111 of file stm32746g_discovery_lcd.h.

#define LTDC_ACTIVE_LAYER ((uint32_t)1) /* Layer 1 */

Definition at line 105 of file stm32746g_discovery_lcd.h.

#define MAX_LAYER_NUMBER ((uint32_t)2)

Definition at line 101 of file stm32746g_discovery_lcd.h.


STM32746G-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
  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info
  • FlashSize : QSPI_Info
  • gestureId : TS_StateTypeDef
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • TextColor : LCD_DrawPropTypeDef
  • touchArea : TS_StateTypeDef
  • touchDetected : TS_StateTypeDef
  • touchEventId : TS_StateTypeDef
  • touchWeight : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • BackColor : LCD_DrawPropTypeDef
  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info
  • FlashSize : QSPI_Info
  • gestureId : TS_StateTypeDef
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • TextColor : LCD_DrawPropTypeDef
  • touchArea : TS_StateTypeDef
  • touchDetected : TS_StateTypeDef
  • touchEventId : TS_StateTypeDef
  • touchWeight : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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:

- _ -

  • __DMAx_CLK_DISABLE : stm32746g_discovery_sdram.h
  • __DMAx_CLK_ENABLE : stm32746g_discovery_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32746g_discovery_sd.h
  • __STM32746G_DISCO_BSP_VERSION : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_MAIN : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_RC : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_SUB1 : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_SUB2 : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery_lcd.c
  • ActiveLayer : stm32746g_discovery_lcd.c
  • audio_drv : stm32746g_discovery_audio.c
  • AUDIO_ERROR : stm32746g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32746g_discovery.h
  • AUDIO_IN_INT_GPIO_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PIN : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_IRQ : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CHANNEL : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_AF : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32746g_discovery_audio.h
  • AUDIO_IO_DeInit() : stm32746g_discovery.c
  • AUDIO_IO_Delay() : stm32746g_discovery.c
  • AUDIO_IO_Init() : stm32746g_discovery.c
  • AUDIO_IO_Read() : stm32746g_discovery.c
  • AUDIO_IO_Write() : stm32746g_discovery.c
  • AUDIO_OK : stm32746g_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CHANNEL : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_SD_MCLK_AF : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_AF : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_SD_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32746g_discovery_audio.h
  • AUDIO_TIMEOUT : stm32746g_discovery_audio.h
  • AUDIODATA_SIZE : stm32746g_discovery_audio.h
  • AudioInVolume : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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_IN_DeInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Error_CallBack() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Init() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_InitEx() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_OUT_Init() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_Pause() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Record() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Stop() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_ClockConfig() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_MspDeInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_MspInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32746g_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_DMA_IRQHandler : stm32746g_discovery_camera.h
  • BSP_CAMERA_ErrorCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Init() : stm32746g_discovery_camera.c
  • BSP_CAMERA_IRQHandler : stm32746g_discovery_camera.h
  • BSP_CAMERA_LineEventCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32746g_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32746g_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32746g_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32746g_discovery_camera.c
  • BSP_COM_DeInit() : stm32746g_discovery.c
  • BSP_COM_Init() : stm32746g_discovery.c
  • BSP_EEPROM_DeInit() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_Init() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_ReadBuffer() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WaitEepromStandbyState() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WriteBuffer() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WritePage() : stm32746g_discovery_eeprom.c
  • BSP_GetVersion() : stm32746g_discovery.c
  • BSP_LCD_Clear() : stm32746g_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_ClockConfig() : stm32746g_discovery_lcd.c
  • BSP_LCD_DeInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillCircle() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_Init() : stm32746g_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_LayerRgb565Init() : stm32746g_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32746g_discovery_lcd.c
  • BSP_LCD_Reload() : stm32746g_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32746g_discovery_lcd.c
  • BSP_LCD_ResetColorKeying_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetColorKeying_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTransparency_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32746g_discovery_lcd.c
  • BSP_LED_DeInit() : stm32746g_discovery.c
  • BSP_LED_Init() : stm32746g_discovery.c
  • BSP_LED_Off() : stm32746g_discovery.c
  • BSP_LED_On() : stm32746g_discovery.c
  • BSP_LED_Toggle() : stm32746g_discovery.c
  • BSP_PB_DeInit() : stm32746g_discovery.c
  • BSP_PB_GetState() : stm32746g_discovery.c
  • BSP_PB_Init() : stm32746g_discovery.c
  • BSP_QSPI_DeInit() : stm32746g_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32746g_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32746g_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Init() : stm32746g_discovery_qspi.c
  • BSP_QSPI_MemoryMappedMode : stm32746g_discovery_qspi.h
  • BSP_QSPI_MspDeInit() : stm32746g_discovery_qspi.h , stm32746g_discovery_qspi.c
  • BSP_QSPI_MspInit() : stm32746g_discovery_qspi.h , stm32746g_discovery_qspi.c
  • BSP_QSPI_Read() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Write() : stm32746g_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32746g_discovery_sd.c
  • BSP_SD_CardInfo : stm32746g_discovery_sd.h
  • BSP_SD_DeInit() : stm32746g_discovery_sd.c
  • BSP_SD_Detect_MspInit() : stm32746g_discovery_sd.c
  • BSP_SD_Erase() : stm32746g_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32746g_discovery_sd.c
  • BSP_SD_GetCardState() : stm32746g_discovery_sd.c
  • BSP_SD_Init() : stm32746g_discovery_sd.c
  • BSP_SD_IsDetected() : stm32746g_discovery_sd.c
  • BSP_SD_ITConfig() : stm32746g_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32746g_discovery_sd.c
  • BSP_SD_MspInit() : stm32746g_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32746g_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32746g_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32746g_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32746g_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32746g_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32746g_discovery_sd.c
  • BSP_SDMMC_DMA_Rx_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDMMC_DMA_Tx_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDMMC_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDRAM_DeInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_DMA_IRQHandler : stm32746g_discovery_sdram.h
  • BSP_SDRAM_Init() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32746g_discovery_sdram.c
  • BSP_TS_DeInit() : stm32746g_discovery_ts.c
  • BSP_TS_Get_GestureId() : stm32746g_discovery_ts.c
  • BSP_TS_GetState() : stm32746g_discovery_ts.c
  • BSP_TS_Init() : stm32746g_discovery_ts.c
  • BSP_TS_ITClear() : stm32746g_discovery_ts.c
  • BSP_TS_ITConfig() : stm32746g_discovery_ts.c
  • BSP_TS_ITGetStatus() : stm32746g_discovery_ts.c
  • BSP_TS_ResetTouchData() : stm32746g_discovery_ts.c , stm32746g_discovery_ts.h
  • BUTTON_IRQn : stm32746g_discovery.c
  • BUTTON_KEY : stm32746g_discovery.h
  • BUTTON_MODE_EXTI : stm32746g_discovery.h
  • BUTTON_MODE_GPIO : stm32746g_discovery.h
  • BUTTON_PIN : stm32746g_discovery.c
  • BUTTON_PORT : stm32746g_discovery.c
  • BUTTON_TAMPER : stm32746g_discovery.h
  • Button_TypeDef : stm32746g_discovery.h
  • BUTTON_WAKEUP : stm32746g_discovery.h
  • ButtonMode_TypeDef : stm32746g_discovery.h
  • BUTTONn : stm32746g_discovery.h
  • BUTTONx_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • BUTTONx_GPIO_CLK_ENABLE : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery_camera.c
  • CAMERA_480x272_RES_Y : stm32746g_discovery_camera.c
  • CAMERA_Delay() : stm32746g_discovery.c
  • camera_drv : stm32746g_discovery_camera.c
  • CAMERA_ERROR : stm32746g_discovery_camera.h
  • CAMERA_I2C_ADDRESS : stm32746g_discovery.h
  • CAMERA_IO_Init() : stm32746g_discovery.c
  • CAMERA_IO_Read() : stm32746g_discovery.c
  • CAMERA_IO_Write() : stm32746g_discovery.c
  • CAMERA_NOT_DETECTED : stm32746g_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32746g_discovery_camera.h
  • CAMERA_OK : stm32746g_discovery_camera.h
  • CAMERA_QQVGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_QQVGA_RES_Y : stm32746g_discovery_camera.c
  • CAMERA_QVGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_QVGA_RES_Y : stm32746g_discovery_camera.c
  • Camera_StatusTypeDef : stm32746g_discovery_camera.h
  • CAMERA_TIMEOUT : stm32746g_discovery_camera.h
  • CAMERA_VGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_VGA_RES_Y : stm32746g_discovery_camera.c
  • CameraCurrentResolution : stm32746g_discovery_camera.c
  • CameraHwAddress : stm32746g_discovery_camera.c
  • CENTER_MODE : stm32746g_discovery_lcd.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32746g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32746g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32746g_discovery_audio.h
  • CODEC_RESET_DELAY : stm32746g_discovery_audio.h
  • COM1 : stm32746g_discovery.h
  • COM2 : stm32746g_discovery.h
  • COM_RX_AF : stm32746g_discovery.c
  • COM_RX_PIN : stm32746g_discovery.c
  • COM_RX_PORT : stm32746g_discovery.c
  • COM_TX_AF : stm32746g_discovery.c
  • COM_TX_PIN : stm32746g_discovery.c
  • COM_TX_PORT : stm32746g_discovery.c
  • COM_TypeDef : stm32746g_discovery.h
  • COM_USART : stm32746g_discovery.c
  • Command : stm32746g_discovery_sdram.c
  • COMn : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32746g_discovery_audio.h
  • DISCOVERY_AUDIO_DMAx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_ER_IRQn : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_EV_IRQn : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_FORCE_RESET : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_RELEASE_RESET : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_PIN : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SDA_PIN : stm32746g_discovery.h
  • DISCOVERY_COM1 : stm32746g_discovery.h
  • DISCOVERY_COM1_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_IRQn : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_AF : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_PIN : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_AF : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_PIN : stm32746g_discovery.h
  • DISCOVERY_COMx_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_DMAx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_ER_IRQn : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_EV_IRQn : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_FORCE_RESET : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_RELEASE_RESET : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_PIN : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_AF : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_PIN : stm32746g_discovery.h
  • DMA_MAX : stm32746g_discovery_audio.h
  • DMA_MAX_SZE : stm32746g_discovery_audio.h
  • DrawChar() : stm32746g_discovery_lcd.c
  • DrawProp : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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_FAIL : stm32746g_discovery_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32746g_discovery.h
  • EEPROM_I2C_ADDRESS_A02 : stm32746g_discovery.h
  • EEPROM_IO_Init() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_IO_ReadData() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_IO_WriteData() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_MAX_SIZE : stm32746g_discovery_eeprom.h
  • EEPROM_MAX_TRIALS : stm32746g_discovery_eeprom.h
  • EEPROM_OK : stm32746g_discovery_eeprom.h
  • EEPROM_PAGESIZE : stm32746g_discovery_eeprom.h
  • EEPROM_TIMEOUT : stm32746g_discovery_eeprom.h
  • EEPROMAddress : stm32746g_discovery_eeprom.c
  • EEPROMDataRead : stm32746g_discovery_eeprom.c
  • EEPROMDataWrite : stm32746g_discovery_eeprom.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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() : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery_ts.h
  • GEST_ID_MOVE_LEFT : stm32746g_discovery_ts.h
  • GEST_ID_MOVE_RIGHT : stm32746g_discovery_ts.h
  • GEST_ID_MOVE_UP : stm32746g_discovery_ts.h
  • GEST_ID_NB_MAX : stm32746g_discovery_ts.h
  • GEST_ID_NO_GESTURE : stm32746g_discovery_ts.h
  • GEST_ID_ZOOM_IN : stm32746g_discovery_ts.h
  • GEST_ID_ZOOM_OUT : stm32746g_discovery_ts.h
  • GetSize() : stm32746g_discovery_camera.c
  • GPIO_PIN : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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() : stm32746g_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32746g_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32746g_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32746g_discovery_camera.c
  • HAL_SAI_ErrorCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32746g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32746g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32746g_discovery_sd.c
  • haudio_in_sai : stm32746g_discovery_audio.c
  • haudio_out_sai : stm32746g_discovery_audio.c
  • haudio_tim : stm32746g_discovery_audio.c
  • hDcmiHandler : stm32746g_discovery_camera.c
  • hDma2dHandler : stm32746g_discovery_lcd.c
  • hI2cAudioHandler : stm32746g_discovery.c
  • hI2cExtHandler : stm32746g_discovery.c
  • hLtdcHandler : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • I2cAddress : stm32746g_discovery_ts.c
  • I2Cx_Error() : stm32746g_discovery.c
  • I2Cx_Init() : stm32746g_discovery.c
  • I2Cx_IsDeviceReady() : stm32746g_discovery.c
  • I2Cx_MspInit() : stm32746g_discovery.c
  • I2Cx_ReadMultiple() : stm32746g_discovery.c
  • I2Cx_WriteMultiple() : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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:

- k -

  • KEY_BUTTON_EXTI_IRQn : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • KEY_BUTTON_PIN : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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_BL_CTRL_GPIO_CLK_DISABLE : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32746g_discovery_lcd.h
  • LCD_COLOR_BLACK : stm32746g_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32746g_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32746g_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32746g_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32746g_discovery_lcd.h
  • LCD_COLOR_RED : stm32746g_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32746g_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32746g_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32746g_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_CLK_DISABLE : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_CLK_ENABLE : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_PORT : stm32746g_discovery_lcd.h
  • LCD_DISP_PIN : stm32746g_discovery_lcd.h
  • LCD_ERROR : stm32746g_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32746g_discovery_lcd.h
  • LCD_I2C_ADDRESS : stm32746g_discovery.h
  • LCD_LayerCfgTypeDef : stm32746g_discovery_lcd.h
  • LCD_OK : stm32746g_discovery_lcd.h
  • LCD_RELOAD_IMMEDIATE : stm32746g_discovery_lcd.h
  • LCD_RELOAD_VERTICAL_BLANKING : stm32746g_discovery_lcd.h
  • LCD_TIMEOUT : stm32746g_discovery_lcd.h
  • LED1 : stm32746g_discovery.h
  • LED1_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • LED1_GPIO_PORT : stm32746g_discovery.h
  • LED1_PIN : stm32746g_discovery.h
  • LED_GREEN : stm32746g_discovery.h
  • Led_TypeDef : stm32746g_discovery.h
  • LEDn : stm32746g_discovery.h
  • LEFT_MODE : stm32746g_discovery_lcd.h
  • LL_ConvertLineToARGB8888() : stm32746g_discovery_lcd.c
  • LL_FillBuffer() : stm32746g_discovery_lcd.c
  • LTDC_ACTIVE_LAYER : stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • MAX_LAYER_NUMBER : stm32746g_discovery_lcd.h
  • MSD_ERROR : stm32746g_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32746g_discovery_sd.h
  • MSD_OK : stm32746g_discovery_sd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • OUTPUT_DEVICE_HEADPHONE1 : stm32746g_discovery_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32746g_discovery_audio.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • POLY_X : stm32746g_discovery_lcd.c
  • POLY_Y : stm32746g_discovery_lcd.c
  • pPoint : stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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() : stm32746g_discovery_qspi.c
  • QSPI_BUSY : stm32746g_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_CLK_PIN : stm32746g_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CS_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_CS_PIN : stm32746g_discovery_qspi.h
  • QSPI_D0_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D0_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D0_PIN : stm32746g_discovery_qspi.h
  • QSPI_D1_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D1_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D1_PIN : stm32746g_discovery_qspi.h
  • QSPI_D2_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D2_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D2_PIN : stm32746g_discovery_qspi.h
  • QSPI_D3_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D3_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D3_PIN : stm32746g_discovery_qspi.h
  • QSPI_DummyCyclesCfg() : stm32746g_discovery_qspi.c
  • QSPI_ERROR : stm32746g_discovery_qspi.h
  • QSPI_FLASH_SIZE : stm32746g_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32746g_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32746g_discovery_qspi.h
  • QSPI_OK : stm32746g_discovery_qspi.h
  • QSPI_PAGE_SIZE : stm32746g_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32746g_discovery_qspi.h
  • QSPI_ResetMemory() : stm32746g_discovery_qspi.c
  • QSPI_SUSPENDED : stm32746g_discovery_qspi.h
  • QSPI_WriteEnable() : stm32746g_discovery_qspi.c
  • QSPIHandle : stm32746g_discovery_qspi.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery_sdram.h
  • RESOLUTION_R160x120 : stm32746g_discovery_camera.h
  • RESOLUTION_R320x240 : stm32746g_discovery_camera.h
  • RESOLUTION_R480x272 : stm32746g_discovery_camera.h
  • RESOLUTION_R640x480 : stm32746g_discovery_camera.h
  • RIGHT_MODE : stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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() : stm32746g_discovery_audio.c
  • SAIx_In_Init() : stm32746g_discovery_audio.c
  • SAIx_Out_DeInit() : stm32746g_discovery_audio.c
  • SAIx_Out_Init() : stm32746g_discovery_audio.c
  • SD_DATATIMEOUT : stm32746g_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32746g_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • SD_DETECT_GPIO_PORT : stm32746g_discovery.h
  • SD_DETECT_PIN : stm32746g_discovery.h
  • SD_DetectIRQHandler : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_IRQn : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_STREAM : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_IRQn : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_STREAM : stm32746g_discovery_sd.h
  • SD_NOT_PRESENT : stm32746g_discovery_sd.h
  • SD_PRESENT : stm32746g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32746g_discovery_sd.h
  • SD_TRANSFER_OK : stm32746g_discovery_sd.h
  • SDCLOCK_PERIOD : stm32746g_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32746g_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_IRQn : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_STREAM : stm32746g_discovery_sdram.h
  • SDRAM_ERROR : stm32746g_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32746g_discovery_sdram.h
  • SDRAM_OK : stm32746g_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32746g_discovery_sdram.h
  • sdramHandle : stm32746g_discovery_sdram.c
  • SIGNALn : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • TAMPER_BUTTON_EXTI_IRQn : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • TAMPER_BUTTON_PIN : stm32746g_discovery.h
  • Text_AlignModeTypdef : stm32746g_discovery_lcd.h
  • Timing : stm32746g_discovery_sdram.c
  • TOUCH_EVENT_CONTACT : stm32746g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32746g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32746g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32746g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32746g_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32746g_discovery_ts.h
  • TS_ERROR : stm32746g_discovery_ts.h
  • ts_event_string_tab : stm32746g_discovery_ts.h
  • ts_gesture_id_string_tab : stm32746g_discovery_ts.h
  • TS_GestureIdTypeDef : stm32746g_discovery_ts.h
  • TS_I2C_ADDRESS : stm32746g_discovery.h
  • TS_INT_EXTI_IRQn : stm32746g_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • TS_INT_GPIO_PORT : stm32746g_discovery.h
  • TS_INT_PIN : stm32746g_discovery.h
  • TS_IO_Delay() : stm32746g_discovery.c
  • TS_IO_Init() : stm32746g_discovery.c
  • TS_IO_Read() : stm32746g_discovery.c
  • TS_IO_Write() : stm32746g_discovery.c
  • TS_IRQ_PENDING : stm32746g_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32746g_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32746g_discovery_ts.h
  • TS_OK : stm32746g_discovery_ts.h
  • TS_StatusTypeDef : stm32746g_discovery_ts.h
  • TS_SWAP_NONE : stm32746g_discovery_ts.h
  • TS_SWAP_X : stm32746g_discovery_ts.h
  • TS_SWAP_XY : stm32746g_discovery_ts.h
  • TS_SWAP_Y : stm32746g_discovery_ts.h
  • TS_TIMEOUT : stm32746g_discovery_ts.h
  • TS_TouchEventTypeDef : stm32746g_discovery_ts.h
  • tsDriver : stm32746g_discovery_ts.c
  • tsOrientation : stm32746g_discovery_ts.c
  • tsXBoundary : stm32746g_discovery_ts.c
  • tsYBoundary : stm32746g_discovery_ts.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 -

  • uSdHandle : stm32746g_discovery_sd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • 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 : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • WAKEUP_BUTTON_PIN : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- a -

  • AUDIO_IO_DeInit() : stm32746g_discovery.c
  • AUDIO_IO_Delay() : stm32746g_discovery.c
  • AUDIO_IO_Init() : stm32746g_discovery.c
  • AUDIO_IO_Read() : stm32746g_discovery.c
  • AUDIO_IO_Write() : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_IN_DeInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Error_CallBack() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Init() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_InitEx() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_OUT_Init() : stm32746g_discovery_audio.h , stm32746g_discovery_audio.c
  • BSP_AUDIO_IN_Pause() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Record() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_Stop() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_ClockConfig() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Error_CallBack() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_MspDeInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_MspInit() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32746g_discovery_audio.c
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32746g_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32746g_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_ErrorCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Init() : stm32746g_discovery_camera.c
  • BSP_CAMERA_LineEventCallback() : stm32746g_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32746g_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32746g_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32746g_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32746g_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32746g_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32746g_discovery_camera.c
  • BSP_COM_DeInit() : stm32746g_discovery.c
  • BSP_COM_Init() : stm32746g_discovery.c
  • BSP_EEPROM_DeInit() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_Init() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_ReadBuffer() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WaitEepromStandbyState() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WriteBuffer() : stm32746g_discovery_eeprom.c
  • BSP_EEPROM_WritePage() : stm32746g_discovery_eeprom.c
  • BSP_GetVersion() : stm32746g_discovery.c
  • BSP_LCD_Clear() : stm32746g_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_ClockConfig() : stm32746g_discovery_lcd.c
  • BSP_LCD_DeInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32746g_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32746g_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillCircle() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32746g_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_Init() : stm32746g_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_LayerRgb565Init() : stm32746g_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32746g_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32746g_discovery_lcd.c
  • BSP_LCD_Reload() : stm32746g_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32746g_discovery_lcd.c
  • BSP_LCD_ResetColorKeying_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetColorKeying_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerAddress_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerVisible_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetLayerWindow_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetTransparency_NoReload() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32746g_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32746g_discovery_lcd.c
  • BSP_LED_DeInit() : stm32746g_discovery.c
  • BSP_LED_Init() : stm32746g_discovery.c
  • BSP_LED_Off() : stm32746g_discovery.c
  • BSP_LED_On() : stm32746g_discovery.c
  • BSP_LED_Toggle() : stm32746g_discovery.c
  • BSP_PB_DeInit() : stm32746g_discovery.c
  • BSP_PB_GetState() : stm32746g_discovery.c
  • BSP_PB_Init() : stm32746g_discovery.c
  • BSP_QSPI_DeInit() : stm32746g_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32746g_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32746g_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Init() : stm32746g_discovery_qspi.c
  • BSP_QSPI_MspDeInit() : stm32746g_discovery_qspi.h , stm32746g_discovery_qspi.c
  • BSP_QSPI_MspInit() : stm32746g_discovery_qspi.c , stm32746g_discovery_qspi.h
  • BSP_QSPI_Read() : stm32746g_discovery_qspi.c
  • BSP_QSPI_Write() : stm32746g_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32746g_discovery_sd.c
  • BSP_SD_DeInit() : stm32746g_discovery_sd.c
  • BSP_SD_Detect_MspInit() : stm32746g_discovery_sd.c
  • BSP_SD_Erase() : stm32746g_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32746g_discovery_sd.c
  • BSP_SD_GetCardState() : stm32746g_discovery_sd.c
  • BSP_SD_Init() : stm32746g_discovery_sd.c
  • BSP_SD_IsDetected() : stm32746g_discovery_sd.c
  • BSP_SD_ITConfig() : stm32746g_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32746g_discovery_sd.c
  • BSP_SD_MspInit() : stm32746g_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32746g_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32746g_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32746g_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32746g_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32746g_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32746g_discovery_sd.c
  • BSP_SDRAM_DeInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_Init() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32746g_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32746g_discovery_sdram.c
  • BSP_TS_DeInit() : stm32746g_discovery_ts.c
  • BSP_TS_Get_GestureId() : stm32746g_discovery_ts.c
  • BSP_TS_GetState() : stm32746g_discovery_ts.c
  • BSP_TS_Init() : stm32746g_discovery_ts.c
  • BSP_TS_ITClear() : stm32746g_discovery_ts.c
  • BSP_TS_ITConfig() : stm32746g_discovery_ts.c
  • BSP_TS_ITGetStatus() : stm32746g_discovery_ts.c
  • BSP_TS_ResetTouchData() : stm32746g_discovery_ts.c , stm32746g_discovery_ts.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- c -

  • CAMERA_Delay() : stm32746g_discovery.c
  • CAMERA_IO_Init() : stm32746g_discovery.c
  • CAMERA_IO_Read() : stm32746g_discovery.c
  • CAMERA_IO_Write() : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- d -

  • DrawChar() : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- e -

  • EEPROM_IO_Init() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32746g_discovery_eeprom.h , stm32746g_discovery.c
  • EEPROM_IO_ReadData() : stm32746g_discovery.c , stm32746g_discovery_eeprom.h
  • EEPROM_IO_WriteData() : stm32746g_discovery_eeprom.h , stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- f -

  • FillTriangle() : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- g -

  • GetSize() : stm32746g_discovery_camera.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- h -

  • HAL_DCMI_ErrorCallback() : stm32746g_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32746g_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32746g_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32746g_discovery_camera.c
  • HAL_SAI_ErrorCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32746g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32746g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32746g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32746g_discovery_sd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- i -

  • I2Cx_Error() : stm32746g_discovery.c
  • I2Cx_Init() : stm32746g_discovery.c
  • I2Cx_IsDeviceReady() : stm32746g_discovery.c
  • I2Cx_MspInit() : stm32746g_discovery.c
  • I2Cx_ReadMultiple() : stm32746g_discovery.c
  • I2Cx_WriteMultiple() : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- l -

  • LL_ConvertLineToARGB8888() : stm32746g_discovery_lcd.c
  • LL_FillBuffer() : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- q -

  • QSPI_AutoPollingMemReady() : stm32746g_discovery_qspi.c
  • QSPI_DummyCyclesCfg() : stm32746g_discovery_qspi.c
  • QSPI_ResetMemory() : stm32746g_discovery_qspi.c
  • QSPI_WriteEnable() : stm32746g_discovery_qspi.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- s -

  • SAIx_In_DeInit() : stm32746g_discovery_audio.c
  • SAIx_In_Init() : stm32746g_discovery_audio.c
  • SAIx_Out_DeInit() : stm32746g_discovery_audio.c
  • SAIx_Out_Init() : stm32746g_discovery_audio.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

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

- t -

  • TS_IO_Delay() : stm32746g_discovery.c
  • TS_IO_Init() : stm32746g_discovery.c
  • TS_IO_Read() : stm32746g_discovery.c
  • TS_IO_Write() : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • q
  • s
  • t
  • u

- a -

  • ActiveLayer : stm32746g_discovery_lcd.c
  • audio_drv : stm32746g_discovery_audio.c
  • AudioInVolume : stm32746g_discovery_audio.c , stm32746g_discovery_audio.h

- b -

  • BUTTON_IRQn : stm32746g_discovery.c
  • BUTTON_PIN : stm32746g_discovery.c
  • BUTTON_PORT : stm32746g_discovery.c

- c -

  • camera_drv : stm32746g_discovery_camera.c
  • CameraCurrentResolution : stm32746g_discovery_camera.c
  • CameraHwAddress : stm32746g_discovery_camera.c
  • COM_RX_AF : stm32746g_discovery.c
  • COM_RX_PIN : stm32746g_discovery.c
  • COM_RX_PORT : stm32746g_discovery.c
  • COM_TX_AF : stm32746g_discovery.c
  • COM_TX_PIN : stm32746g_discovery.c
  • COM_TX_PORT : stm32746g_discovery.c
  • COM_USART : stm32746g_discovery.c
  • Command : stm32746g_discovery_sdram.c

- d -

  • DrawProp : stm32746g_discovery_lcd.c

- e -

  • EEPROMAddress : stm32746g_discovery_eeprom.c
  • EEPROMDataRead : stm32746g_discovery_eeprom.c
  • EEPROMDataWrite : stm32746g_discovery_eeprom.c

- g -

  • GPIO_PIN : stm32746g_discovery.c

- h -

  • haudio_in_sai : stm32746g_discovery_audio.c
  • haudio_out_sai : stm32746g_discovery_audio.c
  • haudio_tim : stm32746g_discovery_audio.c
  • hDcmiHandler : stm32746g_discovery_camera.c
  • hDma2dHandler : stm32746g_discovery_lcd.c
  • hI2cAudioHandler : stm32746g_discovery.c
  • hI2cExtHandler : stm32746g_discovery.c
  • hLtdcHandler : stm32746g_discovery_lcd.c

- i -

  • I2cAddress : stm32746g_discovery_ts.c

- q -

  • QSPIHandle : stm32746g_discovery_qspi.c

- s -

  • sdramHandle : stm32746g_discovery_sdram.c

- t -

  • Timing : stm32746g_discovery_sdram.c
  • ts_event_string_tab : stm32746g_discovery_ts.h
  • ts_gesture_id_string_tab : stm32746g_discovery_ts.h
  • tsDriver : stm32746g_discovery_ts.c
  • tsOrientation : stm32746g_discovery_ts.c
  • tsXBoundary : stm32746g_discovery_ts.c
  • tsYBoundary : stm32746g_discovery_ts.c

- u -

  • uSdHandle : stm32746g_discovery_sd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • pPoint : stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Button_TypeDef : stm32746g_discovery.h
  • ButtonMode_TypeDef : stm32746g_discovery.h
  • Camera_StatusTypeDef : stm32746g_discovery_camera.h
  • COM_TypeDef : stm32746g_discovery.h
  • Led_TypeDef : stm32746g_discovery.h
  • Text_AlignModeTypdef : stm32746g_discovery_lcd.h
  • TS_GestureIdTypeDef : stm32746g_discovery_ts.h
  • TS_StatusTypeDef : stm32746g_discovery_ts.h
  • TS_TouchEventTypeDef : stm32746g_discovery_ts.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • c
  • g
  • l
  • r
  • t

- b -

  • BUTTON_KEY : stm32746g_discovery.h
  • BUTTON_MODE_EXTI : stm32746g_discovery.h
  • BUTTON_MODE_GPIO : stm32746g_discovery.h
  • BUTTON_TAMPER : stm32746g_discovery.h
  • BUTTON_WAKEUP : stm32746g_discovery.h

- c -

  • CAMERA_ERROR : stm32746g_discovery_camera.h
  • CAMERA_NOT_DETECTED : stm32746g_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32746g_discovery_camera.h
  • CAMERA_OK : stm32746g_discovery_camera.h
  • CAMERA_TIMEOUT : stm32746g_discovery_camera.h
  • CENTER_MODE : stm32746g_discovery_lcd.h
  • COM1 : stm32746g_discovery.h
  • COM2 : stm32746g_discovery.h

- g -

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

- l -

  • LED1 : stm32746g_discovery.h
  • LED_GREEN : stm32746g_discovery.h
  • LEFT_MODE : stm32746g_discovery_lcd.h

- r -

  • RIGHT_MODE : stm32746g_discovery_lcd.h

- t -

  • TOUCH_EVENT_CONTACT : stm32746g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32746g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32746g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32746g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32746g_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32746g_discovery_ts.h
  • TS_ERROR : stm32746g_discovery_ts.h
  • TS_OK : stm32746g_discovery_ts.h
  • TS_TIMEOUT : stm32746g_discovery_ts.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- _ -

  • __DMAx_CLK_DISABLE : stm32746g_discovery_sdram.h
  • __DMAx_CLK_ENABLE : stm32746g_discovery_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32746g_discovery_sd.h
  • __STM32746G_DISCO_BSP_VERSION : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_MAIN : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_RC : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_SUB1 : stm32746g_discovery.c
  • __STM32746G_DISCO_BSP_VERSION_SUB2 : stm32746g_discovery.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- a -

  • ABS : stm32746g_discovery_lcd.c
  • AUDIO_ERROR : stm32746g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32746g_discovery.h
  • AUDIO_IN_INT_GPIO_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PIN : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_IRQ : stm32746g_discovery_audio.h
  • AUDIO_IN_INT_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_DISABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CHANNEL : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQ : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_DMAx_STREAM : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_AF : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_IN_SAIx_SD_PIN : stm32746g_discovery_audio.h
  • AUDIO_OK : stm32746g_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_DISABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CHANNEL : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_CLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQ : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_IRQHandler : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_DMAx_STREAM : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_FS_SD_MCLK_AF : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_MCLK_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_AF : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_PIN : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_SD_ENABLE : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT : stm32746g_discovery_audio.h
  • AUDIO_OUT_SAIx_SD_PIN : stm32746g_discovery_audio.h
  • AUDIO_TIMEOUT : stm32746g_discovery_audio.h
  • AUDIODATA_SIZE : stm32746g_discovery_audio.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- b -

  • BSP_CAMERA_DMA_IRQHandler : stm32746g_discovery_camera.h
  • BSP_CAMERA_IRQHandler : stm32746g_discovery_camera.h
  • BSP_QSPI_MemoryMappedMode : stm32746g_discovery_qspi.h
  • BSP_SD_CardInfo : stm32746g_discovery_sd.h
  • BSP_SDMMC_DMA_Rx_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDMMC_DMA_Tx_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDMMC_IRQHandler : stm32746g_discovery_sd.h
  • BSP_SDRAM_DMA_IRQHandler : stm32746g_discovery_sdram.h
  • BUTTONn : stm32746g_discovery.h
  • BUTTONx_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • BUTTONx_GPIO_CLK_ENABLE : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- c -

  • CAMERA_480x272_RES_X : stm32746g_discovery_camera.c
  • CAMERA_480x272_RES_Y : stm32746g_discovery_camera.c
  • CAMERA_I2C_ADDRESS : stm32746g_discovery.h
  • CAMERA_QQVGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_QQVGA_RES_Y : stm32746g_discovery_camera.c
  • CAMERA_QVGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_QVGA_RES_Y : stm32746g_discovery_camera.c
  • CAMERA_VGA_RES_X : stm32746g_discovery_camera.c
  • CAMERA_VGA_RES_Y : stm32746g_discovery_camera.c
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32746g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32746g_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32746g_discovery_audio.h
  • CODEC_RESET_DELAY : stm32746g_discovery_audio.h
  • COMn : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32746g_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32746g_discovery_audio.h
  • DISCOVERY_AUDIO_DMAx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_ER_IRQn : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_EV_IRQn : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_FORCE_RESET : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_RELEASE_RESET : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_PIN : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SDA_PIN : stm32746g_discovery.h
  • DISCOVERY_COM1 : stm32746g_discovery.h
  • DISCOVERY_COM1_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_IRQn : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_AF : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_COM1_RX_PIN : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_AF : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_COM1_TX_PIN : stm32746g_discovery.h
  • DISCOVERY_COMx_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_DMAx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_ER_IRQn : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_EV_IRQn : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_FORCE_RESET : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_RELEASE_RESET : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_PIN : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_AF : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT : stm32746g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_PIN : stm32746g_discovery.h
  • DMA_MAX : stm32746g_discovery_audio.h
  • DMA_MAX_SZE : stm32746g_discovery_audio.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- e -

  • EEPROM_FAIL : stm32746g_discovery_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32746g_discovery.h
  • EEPROM_I2C_ADDRESS_A02 : stm32746g_discovery.h
  • EEPROM_MAX_SIZE : stm32746g_discovery_eeprom.h
  • EEPROM_MAX_TRIALS : stm32746g_discovery_eeprom.h
  • EEPROM_OK : stm32746g_discovery_eeprom.h
  • EEPROM_PAGESIZE : stm32746g_discovery_eeprom.h
  • EEPROM_TIMEOUT : stm32746g_discovery_eeprom.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- k -

  • KEY_BUTTON_EXTI_IRQn : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • KEY_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • KEY_BUTTON_PIN : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- l -

  • LCD_BL_CTRL_GPIO_CLK_DISABLE : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32746g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32746g_discovery_lcd.h
  • LCD_COLOR_BLACK : stm32746g_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32746g_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32746g_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32746g_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32746g_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32746g_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32746g_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32746g_discovery_lcd.h
  • LCD_COLOR_RED : stm32746g_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32746g_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32746g_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32746g_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_CLK_DISABLE : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_CLK_ENABLE : stm32746g_discovery_lcd.h
  • LCD_DISP_GPIO_PORT : stm32746g_discovery_lcd.h
  • LCD_DISP_PIN : stm32746g_discovery_lcd.h
  • LCD_ERROR : stm32746g_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32746g_discovery_lcd.h
  • LCD_I2C_ADDRESS : stm32746g_discovery.h
  • LCD_LayerCfgTypeDef : stm32746g_discovery_lcd.h
  • LCD_OK : stm32746g_discovery_lcd.h
  • LCD_RELOAD_IMMEDIATE : stm32746g_discovery_lcd.h
  • LCD_RELOAD_VERTICAL_BLANKING : stm32746g_discovery_lcd.h
  • LCD_TIMEOUT : stm32746g_discovery_lcd.h
  • LED1_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • LED1_GPIO_PORT : stm32746g_discovery.h
  • LED1_PIN : stm32746g_discovery.h
  • LEDn : stm32746g_discovery.h
  • LTDC_ACTIVE_LAYER : stm32746g_discovery_lcd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- m -

  • MAX_LAYER_NUMBER : stm32746g_discovery_lcd.h
  • MSD_ERROR : stm32746g_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32746g_discovery_sd.h
  • MSD_OK : stm32746g_discovery_sd.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- o -

  • OUTPUT_DEVICE_HEADPHONE1 : stm32746g_discovery_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32746g_discovery_audio.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- p -

  • POLY_X : stm32746g_discovery_lcd.c
  • POLY_Y : stm32746g_discovery_lcd.c
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- q -

  • QSPI_BUSY : stm32746g_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_CLK_PIN : stm32746g_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_CS_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_CS_PIN : stm32746g_discovery_qspi.h
  • QSPI_D0_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D0_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D0_PIN : stm32746g_discovery_qspi.h
  • QSPI_D1_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D1_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D1_PIN : stm32746g_discovery_qspi.h
  • QSPI_D2_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D2_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D2_PIN : stm32746g_discovery_qspi.h
  • QSPI_D3_GPIO_CLK_ENABLE : stm32746g_discovery_qspi.h
  • QSPI_D3_GPIO_PORT : stm32746g_discovery_qspi.h
  • QSPI_D3_PIN : stm32746g_discovery_qspi.h
  • QSPI_ERROR : stm32746g_discovery_qspi.h
  • QSPI_FLASH_SIZE : stm32746g_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32746g_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32746g_discovery_qspi.h
  • QSPI_OK : stm32746g_discovery_qspi.h
  • QSPI_PAGE_SIZE : stm32746g_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32746g_discovery_qspi.h
  • QSPI_SUSPENDED : stm32746g_discovery_qspi.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- r -

  • REFRESH_COUNT : stm32746g_discovery_sdram.h
  • RESOLUTION_R160x120 : stm32746g_discovery_camera.h
  • RESOLUTION_R320x240 : stm32746g_discovery_camera.h
  • RESOLUTION_R480x272 : stm32746g_discovery_camera.h
  • RESOLUTION_R640x480 : stm32746g_discovery_camera.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- s -

  • SD_DATATIMEOUT : stm32746g_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32746g_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • SD_DETECT_GPIO_PORT : stm32746g_discovery.h
  • SD_DETECT_PIN : stm32746g_discovery.h
  • SD_DetectIRQHandler : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_IRQn : stm32746g_discovery_sd.h
  • SD_DMAx_Rx_STREAM : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_IRQn : stm32746g_discovery_sd.h
  • SD_DMAx_Tx_STREAM : stm32746g_discovery_sd.h
  • SD_NOT_PRESENT : stm32746g_discovery_sd.h
  • SD_PRESENT : stm32746g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32746g_discovery_sd.h
  • SD_TRANSFER_OK : stm32746g_discovery_sd.h
  • SDCLOCK_PERIOD : stm32746g_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32746g_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_IRQn : stm32746g_discovery_sdram.h
  • SDRAM_DMAx_STREAM : stm32746g_discovery_sdram.h
  • SDRAM_ERROR : stm32746g_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32746g_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32746g_discovery_sdram.h
  • SDRAM_OK : stm32746g_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32746g_discovery_sdram.h
  • SIGNALn : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- t -

  • TAMPER_BUTTON_EXTI_IRQn : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • TAMPER_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • TAMPER_BUTTON_PIN : stm32746g_discovery.h
  • TS_I2C_ADDRESS : stm32746g_discovery.h
  • TS_INT_EXTI_IRQn : stm32746g_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • TS_INT_GPIO_PORT : stm32746g_discovery.h
  • TS_INT_PIN : stm32746g_discovery.h
  • TS_IRQ_PENDING : stm32746g_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32746g_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32746g_discovery_ts.h
  • TS_SWAP_NONE : stm32746g_discovery_ts.h
  • TS_SWAP_X : stm32746g_discovery_ts.h
  • TS_SWAP_XY : stm32746g_discovery_ts.h
  • TS_SWAP_Y : stm32746g_discovery_ts.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • k
  • l
  • m
  • o
  • p
  • q
  • r
  • s
  • t
  • w

- w -

  • WAKEUP_BUTTON_EXTI_IRQn : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32746g_discovery.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32746g_discovery.h
  • WAKEUP_BUTTON_PIN : stm32746g_discovery.h
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: stm32746g_discovery.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions | Variables
stm32746g_discovery.c File Reference

This file provides a set of firmware functions to manage LEDs, push-buttons and COM ports available on STM32746G-Discovery board(MB1191) from STMicroelectronics. More...

#include "stm32746g_discovery.h"

Go to the source code of this file.

Defines

#define | __STM32746G_DISCO_BSP_VERSION_MAIN (0x02)
STM32746G DISCOVERY BSP Driver version number V2.0.0.
#define | __STM32746G_DISCO_BSP_VERSION_SUB1 (0x00)
#define | __STM32746G_DISCO_BSP_VERSION_SUB2 (0x00)
#define | __STM32746G_DISCO_BSP_VERSION_RC (0x00)
#define | __STM32746G_DISCO_BSP_VERSION

Functions

static void | I2Cx_MspInit (I2C_HandleTypeDef *i2c_handler)
Initializes I2C MSP.
static void | I2Cx_Init (I2C_HandleTypeDef *i2c_handler)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (I2C_HandleTypeDef *i2c_handler, 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 (I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
Manages error callback by re-initializing I2C.
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
Deinitializes 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 | TS_IO_Init (void)
Initializes Touchscreen low level.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
void | TS_IO_Delay (uint32_t Delay)
TS 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, uint8_t Reg, uint8_t Value)
Camera writes single data.
uint8_t | CAMERA_IO_Read (uint8_t Addr, uint8_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.
uint32_t | BSP_GetVersion (void)
This method returns the STM32746G DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 ButtonMode)
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.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.

Variables

const uint32_t | GPIO_PIN [LEDn] = {LED1_PIN}
GPIO_TypeDef * | BUTTON_PORT [BUTTONn]
const uint16_t | BUTTON_PIN [BUTTONn]
const uint16_t | BUTTON_IRQn [BUTTONn]
USART_TypeDef * | COM_USART [COMn] = {DISCOVERY_COM1}
GPIO_TypeDef * | COM_TX_PORT [COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {DISCOVERY_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {DISCOVERY_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {DISCOVERY_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {DISCOVERY_COM1_RX_AF}
static I2C_HandleTypeDef | hI2cAudioHandler = {0}
static I2C_HandleTypeDef | hI2cExtHandler = {0}

Detailed Description

This file provides a set of firmware functions to manage LEDs, push-buttons and COM ports available on STM32746G-Discovery board(MB1191) from STMicroelectronics.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Enumerations | Functions
stm32746g_discovery.h File Reference

This file contains definitions for STM32746G_DISCOVERY's LEDs, push-buttons and COM ports hardware resources. More...

#include "stm32f7xx_hal.h"

Go to the source code of this file.

Defines

#define | LEDn ((uint8_t)1)
#define | LED1_GPIO_PORT GPIOI
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_1
#define | BUTTONn ((uint8_t)3)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_11
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOI
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | TAMPER_BUTTON_PIN GPIO_PIN_11
Tamper push-button.
#define | TAMPER_BUTTON_GPIO_PORT GPIOI
#define | TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | KEY_BUTTON_PIN GPIO_PIN_11
Key push-button.
#define | KEY_BUTTON_GPIO_PORT GPIOI
#define | KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | BUTTONx_GPIO_CLK_ENABLE(__INDEX__)
#define | BUTTONx_GPIO_CLK_DISABLE(__INDEX__)
#define | SIGNALn ((uint8_t)1)
#define | SD_DETECT_PIN GPIO_PIN_13
SD-detect signal.
#define | SD_DETECT_GPIO_PORT GPIOC
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI15_10_IRQn
#define | TS_INT_PIN GPIO_PIN_13
Touch screen interrupt signal.
#define | TS_INT_GPIO_PORT GPIOI
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI15_10_IRQn
#define | COMn ((uint8_t)1)
#define | DISCOVERY_COM1 USART1
Definition for COM port1, connected to USART1.
#define | DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
#define | DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_PIN GPIO_PIN_9
#define | DISCOVERY_COM1_TX_GPIO_PORT GPIOA
#define | DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_AF GPIO_AF7_USART1
#define | DISCOVERY_COM1_RX_PIN GPIO_PIN_7
#define | DISCOVERY_COM1_RX_GPIO_PORT GPIOB
#define | DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_COM1_RX_AF GPIO_AF7_USART1
#define | DISCOVERY_COM1_IRQn USART1_IRQn
#define | DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0)
#define | LCD_I2C_ADDRESS ((uint16_t)0x70)
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x60)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
#define | TS_I2C_ADDRESS ((uint16_t)0x70)
#define | DISCOVERY_AUDIO_I2Cx I2C3
#define | DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE()
#define | DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_7
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOH
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3
#define | DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_8
#define | DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C3_EV_IRQn
#define | DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C3_ER_IRQn
#define | DISCOVERY_EXT_I2Cx I2C1
#define | DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9
#define | DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn

Enumerations

enum | Led_TypeDef { LED1 = 0, LED_GREEN = LED1 }
enum | Button_TypeDef { BUTTON_WAKEUP = 0, BUTTON_TAMPER = 1, BUTTON_KEY = 2 }
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
enum | COM_TypeDef { COM1 = 0, COM2 = 1 }

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32746G DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on 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 ButtonMode)
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.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.

Detailed Description

This file contains definitions for STM32746G_DISCOVERY's LEDs, push-buttons and COM ports hardware resources.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_audio.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_audio.c File Reference

This file provides the Audio driver for the STM32746G-Discovery board. More...

#include "stm32746g_discovery_audio.h"

Go to the source code of this file.

Functions

static void | SAIx_Out_Init (uint32_t AudioFreq)
Initializes the output Audio Codec audio interface (SAI).
static void | SAIx_Out_DeInit (void)
Deinitializes the output Audio Codec audio interface (SAI).
static void | SAIx_In_Init (uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
Initializes the input Audio Codec audio interface (SAI).
static void | SAIx_In_DeInit (void)
Deinitializes 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 peripherals.
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)
This function 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)
Deinit the audio peripherals.
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (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.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_OUT_Init (uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (uint32_t Option)
Stops audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pauses the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resumes 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.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
Rx Transfer completed callbacks.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Rx Half Transfer completed callbacks.
__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_Error_CallBack (void)
Audio IN Error callback function.
__weak void | BSP_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
DeInitializes BSP_AUDIO_IN MSP.

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai = {0}
SAI_HandleTypeDef | haudio_in_sai = {0}
TIM_HandleTypeDef | haudio_tim
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Detailed Description

This file provides the Audio driver for the STM32746G-Discovery board.

Author:
MCD Application Team
    How To use this driver:
    -----------------------
       + This driver supports STM32F7xx devices on STM32746G-Discovery (MB1191) board.
       + 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 or the MFX 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 STM32746G-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_DISCOVERY_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 AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
          the stm32746g_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().
       + The driver API and the callback functions are at the end of the stm32746g_discovery_audio.h file.

    Driver architecture:
    --------------------
       + This driver provides the High Audio Layer: consists of the function API exported in the stm32746g_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 stm32746g_discovery_audio_codec.c file (SAIx_Out_Init() and SAIx_Out_DeInit(), SAIx_In_Init() and SAIx_In_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) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_audio.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_audio.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions | Variables
stm32746g_discovery_audio.h File Reference

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

#include "../Components/wm8994/wm8994.h"
#include "stm32746g_discovery.h"

Go to the source code of this file.

Defines

#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_OUT_SAIx SAI2_Block_A
#define | AUDIO_OUT_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_OUT_SAIx_SCK_AF GPIO_AF10_SAI2
#define | AUDIO_OUT_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2
#define | AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_4
#define | AUDIO_OUT_SAIx_SCK_SD_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_OUT_SAIx_FS_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_FS_GPIO_PORT GPIOI
#define | AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_7
#define | AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream4
#define | AUDIO_OUT_SAIx_DMAx_CHANNEL DMA_CHANNEL_3
#define | AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream4_IRQn
#define | AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | DMA_MAX_SZE ((uint16_t)0xFFFF)
#define | AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_IN_SAIx SAI2_Block_B
#define | AUDIO_IN_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_IN_SAIx_SD_AF GPIO_AF10_SAI2
#define | AUDIO_IN_SAIx_SD_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_IN_SAIx_SD_GPIO_PORT GPIOG
#define | AUDIO_IN_SAIx_SD_PIN GPIO_PIN_10
#define | AUDIO_IN_INT_GPIO_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | AUDIO_IN_INT_GPIO_PORT GPIOH
#define | AUDIO_IN_INT_GPIO_PIN GPIO_PIN_15
#define | AUDIO_IN_INT_IRQ EXTI15_10_IRQn
#define | AUDIO_IN_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream7
#define | AUDIO_IN_SAIx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream7_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_Stream7_IRQHandler
#define | AUDIO_IN_INT_IRQHandler EXTI15_10_IRQHandler
#define | AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) /* Select the preemption priority level(0 is the highest) */
#define | AUDIODATA_SIZE ((uint16_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 I2S_AUDIOFREQ_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2) /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)
#define | CODEC_RESET_DELAY ((uint8_t)5)
#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
#define | DMA_MAX(x) (((x) <= DMA_MAX_SZE)? (x):DMA_MAX_SZE)

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
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)
This function 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).
void | BSP_AUDIO_OUT_DeInit (void)
Deinit the audio peripherals.
__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)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_OUT_Init (uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording and playback in parallel.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (uint32_t Option)
Stops audio recording.
uint8_t | BSP_AUDIO_IN_Pause (void)
Pauses the audio file stream.
uint8_t | BSP_AUDIO_IN_Resume (void)
Resumes 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.
void | BSP_AUDIO_IN_TransferComplete_CallBack (void)
User callback when record buffer is filled.
void | BSP_AUDIO_IN_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
void | BSP_AUDIO_IN_Error_CallBack (void)
Audio IN Error callback function.
void | BSP_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
DeInitializes BSP_AUDIO_IN MSP.

Variables

__IO uint16_t | AudioInVolume

Detailed Description

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

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_audio.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_camera.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions | Variables
stm32746g_discovery_camera.c File Reference

This file includes the driver for Camera modules mounted on STM32746G-Discovery board. More...

#include "stm32746g_discovery_camera.h"
#include "stm32746g_discovery.h"

Go to the source code of this file.

Defines

#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

Functions

static uint32_t | GetSize (uint32_t resolution)
Get the capture size in pixels unit.
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 | hDcmiHandler
CAMERA_DrvTypeDef * | camera_drv
static uint32_t | CameraCurrentResolution
static uint32_t | CameraHwAddress

Detailed Description

This file includes the driver for Camera modules mounted on STM32746G-Discovery board.

Author:
MCD Application Team
    How to use this driver:
    ------------------------
     - This driver is used to drive the camera.
     - The OV9655 component driver MUST be included with this driver.

    Driver description:
    -------------------
    + Initialization steps:
       o Initialize the camera using the BSP_CAMERA_Init() function.
       o Start the camera capture/snapshot using the CAMERA_Start() function.
       o Suspend, resume or stop the camera capture using the following functions:
        - BSP_CAMERA_Suspend()
        - BSP_CAMERA_Resume()
        - BSP_CAMERA_Stop()

    + Options
       o Increase or decrease on the fly the brightness and/or contrast
         using the following function:
         - BSP_CAMERA_ContrastBrightnessConfig
       o Add a special effect on the fly using the following functions:
         - BSP_CAMERA_BlackWhiteConfig()
         - BSP_CAMERA_ColorEffectConfig()
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_camera.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_camera.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Enumerations | Functions
stm32746g_discovery_camera.h File Reference

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

#include "../Components/ov9655/ov9655.h"
#include "stm32746g_discovery.h"

Go to the source code of this file.

Defines

#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 | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Stream1_IRQHandler

Enumerations

enum Camera_StatusTypeDef {
CAMERA_OK = 0x00, CAMERA_ERROR = 0x01, CAMERA_TIMEOUT = 0x02, CAMERA_NOT_DETECTED = 0x03,
CAMERA_NOT_SUPPORTED = 0x04
}
Camera State structures definition. More...

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.

Detailed Description

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

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_camera.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_eeprom.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_eeprom.c File Reference

This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory. More...

#include "stm32746g_discovery_eeprom.h"

Go to the source code of this file.

Functions

uint32_t | BSP_EEPROM_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
uint8_t | BSP_EEPROM_DeInit (void)
DeInitializes the EEPROM.
uint32_t | BSP_EEPROM_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint16_t *NumByteToRead)
Reads a block of data from the EEPROM.
uint32_t | BSP_EEPROM_WritePage (uint8_t *pBuffer, uint16_t WriteAddr, uint8_t *NumByteToWrite)
Writes more than one byte to the EEPROM with a single WRITE cycle.
uint32_t | BSP_EEPROM_WriteBuffer (uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
Writes buffer of data to the I2C EEPROM.
uint32_t | BSP_EEPROM_WaitEepromStandbyState (void)
Wait for EEPROM Standby state.
__weak void | BSP_EEPROM_TIMEOUT_UserCallback (void)
Basic management of the timeout situation.

Variables

__IO uint16_t | EEPROMAddress = 0
__IO uint16_t | EEPROMDataRead
__IO uint8_t | EEPROMDataWrite

Detailed Description

This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory.

Author:
MCD Application Team
             To be able to use this driver, the switch EE_M24LR64 must be defined
             in your toolchain compiler preprocessor

             ===================================================================
             Notes:
              - The I2C EEPROM memory (M24LR64) is available on separate daughter
                board ANT7-M24LR-A, which is not provided with the STM32746G_DISCOVERY
                board.
                To use this driver you have to connect the ANT7-M24LR-A to CN3
                connector of STM32746G_DISCOVERY board.
             ===================================================================

             It implements a high level communication layer for read and write
             from/to this memory. The needed STM32F7xx hardware resources (I2C and
             GPIO) are defined in stm32746g_discovery.h file, and the initialization is
             performed in EEPROM_IO_Init() function declared in stm32746g_discovery.c
             file.
             You can easily tailor this driver to any other development board,
             by just adapting the defines for hardware resources and
             EEPROM_IO_Init() function.

             @note In this driver, basic read and write functions (BSP_EEPROM_ReadBuffer()
                   and BSP_EEPROM_WritePage()) use DMA mode to perform the data
                   transfer to/from EEPROM memory.

            @note   Regarding BSP_EEPROM_WritePage(), it is an optimized function to perform
                   small write (less than 1 page) BUT the number of bytes (combined to write start address) must not
                   cross the EEPROM page boundary. This function can only writes into
                   the boundaries of an EEPROM page.
                   This function doesn't check on boundaries condition (in this driver
                   the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
                   responsible of checking on Page boundaries).

        +-----------------------------------------------------------------+
        |               Pin assignment for M24LR64 EEPROM                 |
        +---------------------------------------+-----------+-------------+
        |  STM32F7xx I2C Pins                   |   EEPROM  |   Pin       |
        +---------------------------------------+-----------+-------------+
        | .                                     |   E0(GND) |    1  (0V)  |
        | .                                     |   AC0     |    2        |
        | .                                     |   AC1     |    3        |
        | .                                     |   VSS     |    4  (0V)  |
        | SDA                                   |   SDA     |    5        |
        | SCL                                   |   SCL     |    6        |
        | .                                     |   E1(GND) |    7  (0V)  |
        | .                                     |   VDD     |    8 (3.3V) |
        +---------------------------------------+-----------+-------------+
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_eeprom.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_eeprom.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions
stm32746g_discovery_eeprom.h File Reference

This file contains all the functions prototypes for the stm32746g_discovery_eeprom.c firmware driver. More...

#include "stm32746g_discovery.h"

Go to the source code of this file.

Defines

#define | EEPROM_PAGESIZE ((uint8_t)4)
#define | EEPROM_MAX_SIZE ((uint16_t)0x2000) /* 64Kbit */
#define | EEPROM_MAX_TRIALS ((uint32_t)3000)
#define | EEPROM_OK ((uint32_t)0)
#define | EEPROM_FAIL ((uint32_t)1)
#define | EEPROM_TIMEOUT ((uint32_t)2)

Functions

uint32_t | BSP_EEPROM_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
uint8_t | BSP_EEPROM_DeInit (void)
DeInitializes the EEPROM.
uint32_t | BSP_EEPROM_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint16_t *NumByteToRead)
Reads a block of data from the EEPROM.
uint32_t | BSP_EEPROM_WritePage (uint8_t *pBuffer, uint16_t WriteAddr, uint8_t *NumByteToWrite)
Writes more than one byte to the EEPROM with a single WRITE cycle.
uint32_t | BSP_EEPROM_WriteBuffer (uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
Writes buffer of data to the I2C EEPROM.
uint32_t | BSP_EEPROM_WaitEepromStandbyState (void)
Wait for EEPROM Standby state.
__weak void | BSP_EEPROM_TIMEOUT_UserCallback (void)
Basic management of the timeout situation.
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.

Detailed Description

This file contains all the functions prototypes for the stm32746g_discovery_eeprom.c firmware driver.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_eeprom.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_lcd.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions | Variables
stm32746g_discovery_lcd.c File Reference

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

#include "stm32746g_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 | POLY_X(Z) ((int32_t)((Points + Z)->X))
#define | POLY_Y(Z) ((int32_t)((Points + Z)->Y))
#define | ABS(X) ((X) > 0 ? (X) : -(X))

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.
uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
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 layer in ARGB8888 format (32 bits per pixel).
void | BSP_LCD_LayerRgb565Init (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layer in RGB565 format (16 bits per pixel).
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_SetLayerVisible_NoReload (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible without reloading.
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetTransparency_NoReload (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency without reloading.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetLayerAddress_NoReload (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address without reloading.
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_SetLayerWindow_NoReload (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window without reloading.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_SetColorKeying_NoReload (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying without reloading.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_ResetColorKeying_NoReload (uint32_t LayerIndex)
Disables the color keying without reloading.
void | BSP_LCD_Reload (uint32_t ReloadType)
Disables the color keying without reloading.
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 hole LCD.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
Displays characters on the LCD.
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.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_DisplayOff (void)
Disables the display.
__weak void | BSP_LCD_MspInit (LTDC_HandleTypeDef *hltdc, void *Params)
Initializes the LTDC MSP.
__weak void | BSP_LCD_MspDeInit (LTDC_HandleTypeDef *hltdc, void *Params)
DeInitializes BSP_LCD MSP.
__weak void | BSP_LCD_ClockConfig (LTDC_HandleTypeDef *hltdc, void *Params)
Clock Config.

Variables

LTDC_HandleTypeDef | hLtdcHandler
static DMA2D_HandleTypeDef | hDma2dHandler
static uint32_t | ActiveLayer = 0
static LCD_DrawPropTypeDef | DrawProp [MAX_LAYER_NUMBER]

Detailed Description

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

Author:
MCD Application Team
  1. How To use this driver:
  --------------------------
     - This driver is used to drive directly an LCD TFT using the LTDC controller.
     - This driver uses timing and setting for RK043FN48H LCD.

  2. Driver description:
  ---------------------
    + Initialization steps:
       o Initialize the LCD using the BSP_LCD_Init() function.
       o Apply the Layer configuration using the BSP_LCD_LayerDefaultInit() function.
       o Select the LCD layer to be used using the BSP_LCD_SelectLayer() function.
       o Enable the LCD display using the BSP_LCD_DisplayOn() function.

    + Options
       o Configure and enable the color keying functionality using the
         BSP_LCD_SetColorKeying() function.
       o Modify in the fly the transparency and/or the frame buffer address
         using the following functions:
         - BSP_LCD_SetTransparency()
         - BSP_LCD_SetLayerAddress()

    + Display on LCD
       o Clear the hole LCD using BSP_LCD_Clear() function or only one specified string
         line using the BSP_LCD_ClearStringLine() function.
       o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
         function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
       o Display a string line on the specified position (x,y in pixel) and align mode
         using the BSP_LCD_DisplayStringAtLine() function.
       o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
         on LCD using the available set of functions.
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_lcd.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_lcd.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Data Structures | Defines | Typedefs | Enumerations | Functions
stm32746g_discovery_lcd.h File Reference

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

#include "../Components/rk043fn48h/rk043fn48h.h"
#include "stm32746g_discovery_sdram.h"
#include "stm32746g_discovery.h"
#include "../../../Utilities/Fonts/fonts.h"

Go to the source code of this file.

Data Structures

struct | LCD_DrawPropTypeDef
struct | Point

Defines

#define | MAX_LAYER_NUMBER ((uint32_t)2)
#define | LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
#define | LTDC_ACTIVE_LAYER ((uint32_t)1) /* Layer 1 */
#define | LCD_OK ((uint8_t)0x00)
LCD status structure definition.
#define | LCD_ERROR ((uint8_t)0x01)
#define | LCD_TIMEOUT ((uint8_t)0x02)
#define | LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)
LCD FB_StartAddress.
#define | LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)
LCD color.
#define | LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)
#define | LCD_COLOR_RED ((uint32_t)0xFFFF0000)
#define | LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)
#define | LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)
#define | LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)
#define | LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)
#define | LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)
#define | LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)
#define | LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)
#define | LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)
#define | LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)
#define | LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)
#define | LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)
#define | LCD_COLOR_DARKRED ((uint32_t)0xFF800000)
#define | LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)
#define | LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)
#define | LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)
#define | LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)
#define | LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)
#define | LCD_COLOR_GRAY ((uint32_t)0xFF808080)
#define | LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)
#define | LCD_COLOR_BLACK ((uint32_t)0xFF000000)
#define | LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)
#define | LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)
#define | LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)
#define | LCD_DEFAULT_FONT Font24
LCD default font.
#define | LCD_RELOAD_IMMEDIATE ((uint32_t)LTDC_SRCR_IMR)
LCD Reload Types.
#define | LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)
#define | LCD_DISP_PIN GPIO_PIN_12
LCD special pins.
#define | LCD_DISP_GPIO_PORT GPIOI
#define | LCD_DISP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LCD_DISP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_3
#define | LCD_BL_CTRL_GPIO_PORT GPIOK
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()

Typedefs

typedef struct Point * | pPoint

Enumerations

enum | Text_AlignModeTypdef { CENTER_MODE = 0x01, RIGHT_MODE = 0x02, LEFT_MODE = 0x03 }
Line mode structures definition. More...

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
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 layer in ARGB8888 format (32 bits per pixel).
void | BSP_LCD_LayerRgb565Init (uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layer in RGB565 format (16 bits per pixel).
void | BSP_LCD_SetTransparency (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency.
void | BSP_LCD_SetTransparency_NoReload (uint32_t LayerIndex, uint8_t Transparency)
Configures the transparency without reloading.
void | BSP_LCD_SetLayerAddress (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address.
void | BSP_LCD_SetLayerAddress_NoReload (uint32_t LayerIndex, uint32_t Address)
Sets an LCD layer frame buffer address without reloading.
void | BSP_LCD_SetColorKeying (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying.
void | BSP_LCD_SetColorKeying_NoReload (uint32_t LayerIndex, uint32_t RGBValue)
Configures and sets the color keying without reloading.
void | BSP_LCD_ResetColorKeying (uint32_t LayerIndex)
Disables the color keying.
void | BSP_LCD_ResetColorKeying_NoReload (uint32_t LayerIndex)
Disables the color keying without reloading.
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_SetLayerWindow_NoReload (uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window without reloading.
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_SetLayerVisible_NoReload (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible without reloading.
void | BSP_LCD_Reload (uint32_t ReloadType)
Disables the color keying without reloading.
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 hole LCD.
void | BSP_LCD_ClearStringLine (uint32_t Line)
Clears the selected line.
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 on the LCD.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawBitmap (uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOff (void)
Disables the display.
void | BSP_LCD_DisplayOn (void)
Enables the display.
__weak void | BSP_LCD_MspInit (LTDC_HandleTypeDef *hltdc, void *Params)
Initializes the LTDC MSP.
__weak void | BSP_LCD_MspDeInit (LTDC_HandleTypeDef *hltdc, void *Params)
DeInitializes BSP_LCD MSP.
__weak void | BSP_LCD_ClockConfig (LTDC_HandleTypeDef *hltdc, void *Params)
Clock Config.

Detailed Description

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

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_lcd.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_qspi.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_qspi.c File Reference

This file includes a standard driver for the N25Q128A QSPI memory mounted on STM32746G-Discovery board. More...

#include "stm32746g_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_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.
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 N25Q128A QSPI memory mounted on STM32746G-Discovery board.

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

   (#) This driver need a specific component driver (N25Q128A) 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) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_qspi.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_qspi.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Data Structures | Defines | Functions
stm32746g_discovery_qspi.h File Reference

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

#include "stm32f7xx_hal.h"
#include "../Components/n25q128a/n25q128a.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_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
#define | QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
#define | QSPI_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | QSPI_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | QSPI_FORCE_RESET() __HAL_RCC_QSPI_FORCE_RESET()
#define | QSPI_RELEASE_RESET() __HAL_RCC_QSPI_RELEASE_RESET()
#define | QSPI_CS_PIN GPIO_PIN_6
#define | QSPI_CS_GPIO_PORT GPIOB
#define | QSPI_CLK_PIN GPIO_PIN_2
#define | QSPI_CLK_GPIO_PORT GPIOB
#define | QSPI_D0_PIN GPIO_PIN_11
#define | QSPI_D0_GPIO_PORT GPIOD
#define | QSPI_D1_PIN GPIO_PIN_12
#define | QSPI_D1_GPIO_PORT GPIOD
#define | QSPI_D2_PIN GPIO_PIN_2
#define | QSPI_D2_GPIO_PORT GPIOE
#define | QSPI_D3_PIN GPIO_PIN_13
#define | QSPI_D3_GPIO_PORT GPIOD
#define | QSPI_FLASH_SIZE 23 /* Address bus width to access whole memory space */
#define | QSPI_PAGE_SIZE 256
#define | BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode

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.
void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
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 stm32746g_discovery_qspi.c driver.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_qspi.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sd.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_sd.c File Reference

This file includes the uSD card driver mounted on STM32746G-Discovery board. More...

#include "stm32746g_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 SD 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_Detect_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (HAL_SD_CardInfoTypeDef *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 STM32746G-Discovery board.

Author:
MCD Application Team
   1. How To use this driver:
   --------------------------
      - This driver is used to drive the micro SD external card mounted on STM32746G-Discovery
        board.
      - This driver does not need a specific component driver for the micro SD device
        to be included with.

   2. Driver description:
   ---------------------
     + Initialization steps:
        o Initialize the micro SD card using the BSP_SD_Init() function. This
          function includes the MSP layer hardware resources initialization and the
          SDIO interface configuration to interface with the external micro SD. It
          also includes the micro SD initialization sequence.
        o To check the SD card presence you can use the function BSP_SD_IsDetected() which
          returns the detection status
        o If SD presence detection interrupt mode is desired, you must configure the
          SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt
          is generated as an external interrupt whenever the micro SD card is
          plugged/unplugged in/from the board.
        o The function BSP_SD_GetCardInfo() is used to get the micro SD card information
          which is stored in the structure "HAL_SD_CardInfoTypedef".

     + Micro SD card operations
        o The micro SD card can be accessed with read/write block(s) operations once
          it is ready for access. The access can be performed whether using the polling
          mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA
          transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
        o The DMA transfer complete is used with interrupt mode. Once the SD transfer
          is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
          the DMA Tx/Rx transfer complete are handled using the functions
          BSP_SD_DMA_Tx_IRQHandler()/BSP_SD_DMA_Rx_IRQHandler(). The corresponding user callbacks
          are implemented by the user at application level.
        o The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
          the number of blocks to erase.
        o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_sd.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sd.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions
stm32746g_discovery_sd.h File Reference

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

#include "stm32746g_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)
#define | __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Tx_STREAM DMA2_Stream6
#define | SD_DMAx_Rx_STREAM DMA2_Stream3
#define | SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | BSP_SDMMC_IRQHandler SDMMC1_IRQHandler
#define | BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler
#define | SD_DetectIRQHandler() HAL_GPIO_EXTI_IRQHandler(SD_DETECT_PIN)

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 SD 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 (HAL_SD_CardInfoTypeDef *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.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_Detect_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin 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 stm32746g_discovery_sd.c driver.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_sd.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sdram.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_sdram.c File Reference

This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32746G-Discovery board. More...

#include "stm32746g_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-7 memory device mounted on STM32746G-Discovery board.

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

   2. 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 DMA transfer using the functions
          BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
        o The AHB access is performed with 32-bit width transaction, the DMA 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 DMA transfer, the function BSP_SDRAM_DMA_IRQHandler()
          is called in IRQ handler file, to serve the generated interrupt once the DMA
          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) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_sdram.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sdram.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Defines | Functions
stm32746g_discovery_sdram.h File Reference

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

#include "stm32f7xx_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)0xC0000000)
#define | SDRAM_DEVICE_SIZE ((uint32_t)0x800000) /* SDRAM device size in MBytes */
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16
#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 | __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SDRAM_DMAx_CHANNEL DMA_CHANNEL_0
#define | SDRAM_DMAx_STREAM DMA2_Stream0
#define | SDRAM_DMAx_IRQn DMA2_Stream0_IRQn
#define | BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler
#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 stm32746g_discovery_sdram.c driver.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_sdram.h.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_ts.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Functions | Variables
stm32746g_discovery_ts.c File Reference

This file provides a set of functions needed to manage the Touch Screen on STM32746G-Discovery board. More...

#include "stm32746g_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_DeInit (void)
DeInitializes the TouchScreen.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITGetStatus (void)
Gets the touch screen interrupt status.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_Get_GestureId (TS_StateTypeDef *TS_State)
Update gesture Id following a touch detected.
void | BSP_TS_ITClear (void)
Clears all touch screen interrupts.
uint8_t | BSP_TS_ResetTouchData (TS_StateTypeDef *TS_State)
Function used to reset all touch data before a new acquisition of touch information.

Variables

static TS_DrvTypeDef * | tsDriver
static uint16_t | tsXBoundary
static uint16_t | tsYBoundary
static uint8_t | tsOrientation
static uint8_t | I2cAddress

Detailed Description

This file provides a set of functions needed to manage the Touch Screen on STM32746G-Discovery board.

Author:
MCD Application Team
   1. How To use this driver:
   --------------------------
      - This driver is used to drive the touch screen module of the STM32746G-Discovery
        board on the RK043FN48H-CT672B 480x272 LCD screen with capacitive touch screen.
      - The FT5336 component driver must be included in project files according to
        the touch screen driver present on this board.

   2. Driver description:
   ---------------------
     + Initialization steps:
        o Initialize the TS module using the BSP_TS_Init() function. This
          function includes the MSP layer hardware resources initialization and the
          communication layer configuration to start the TS use. The LCD size properties
          (x and y) are passed as parameters.
        o If TS interrupt mode is desired, you must configure the TS interrupt mode
          by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
          as an external interrupt whenever a touch is detected.
          The interrupt mode internally uses the IO functionalities driver driven by
          the IO expander, to configure the IT line.

     + Touch screen use
        o The touch screen state is captured whenever the function BSP_TS_GetState() is
          used. This function returns information about the last LCD touch occurred
          in the TS_StateTypeDef structure.
        o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
          the interrupt status. To clear the IT pending bits, you should call the
          function BSP_TS_ITClear().
        o The IT is handled using the corresponding external interrupt IRQ handler,
          the user IT callback treatment is implemented on the same external interrupt
          callback.
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_ts.c.


STM32746G-Discovery BSP User Manual: stm32746g_discovery_ts.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
Data Structures | Defines | Enumerations | Functions | Variables
stm32746g_discovery_ts.h File Reference

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

#include "stm32746g_discovery.h"
#include "../Components/ft5336/ft5336.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) FT5336_MAX_DETECTABLE_TOUCH)
With FT5336 : maximum 5 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 }
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_DeInit (void)
DeInitializes the TouchScreen.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_Get_GestureId (TS_StateTypeDef *TS_State)
Update gesture Id following a touch detected.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITGetStatus (void)
Gets the touch screen interrupt status.
void | BSP_TS_ITClear (void)
Clears all touch screen interrupts.
uint8_t | BSP_TS_ResetTouchData (TS_StateTypeDef *TS_State)
Function used to reset all touch data before a new acquisition of touch information.

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 stm32746g_discovery_ts.c driver.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32746g_discovery_ts.h.


STM32746G-Discovery BSP User Manual: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
LCD_DrawPropTypeDef |
Point |
QSPI_Info |
TS_StateTypeDef | TS_StateTypeDef Define TS State structure
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
L | P | Q | T
L
P
Q
T
LCD_DrawPropTypeDef Point QSPI_Info TS_StateTypeDef
L | P | Q | T
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32F746G-Discovery/Trunk/Drivers/ Directory Reference

  • Drivers
Drivers Directory Reference

Directories

directory BSP
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32F746G-Discovery/Trunk/Drivers/BSP/ Directory Reference

  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32746G-Discovery
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32F746G-Discovery/Trunk/Drivers/BSP/STM32746G-Discovery/ Directory Reference

  • Drivers
  • BSP
  • STM32746G-Discovery
STM32746G-Discovery Directory Reference

Files

file | stm32746g_discovery.c [code]

This file provides a set of firmware functions to manage LEDs, push-buttons and COM ports available on STM32746G-Discovery board(MB1191) from STMicroelectronics.

file | stm32746g_discovery.h [code]

This file contains definitions for STM32746G_DISCOVERY's LEDs, push-buttons and COM ports hardware resources.

file | stm32746g_discovery_audio.c [code]

This file provides the Audio driver for the STM32746G-Discovery board.

file | stm32746g_discovery_audio.h [code]

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

file | stm32746g_discovery_camera.c [code]

This file includes the driver for Camera modules mounted on STM32746G-Discovery board.

file | stm32746g_discovery_camera.h [code]

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

file | stm32746g_discovery_eeprom.c [code]

This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory.

file | stm32746g_discovery_eeprom.h [code]

This file contains all the functions prototypes for the stm32746g_discovery_eeprom.c firmware driver.

file | stm32746g_discovery_lcd.c [code]

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

file | stm32746g_discovery_lcd.h [code]

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

file | stm32746g_discovery_qspi.c [code]

This file includes a standard driver for the N25Q128A QSPI memory mounted on STM32746G-Discovery board.

file | stm32746g_discovery_qspi.h [code]

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

file | stm32746g_discovery_sd.c [code]

This file includes the uSD card driver mounted on STM32746G-Discovery board.

file | stm32746g_discovery_sd.h [code]

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

file | stm32746g_discovery_sdram.c [code]

This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32746G-Discovery board.

file | stm32746g_discovery_sdram.h [code]

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

file | stm32746g_discovery_ts.c [code]

This file provides a set of functions needed to manage the Touch Screen on STM32746G-Discovery board.

file | stm32746g_discovery_ts.h [code]

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

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Drivers
    • BSP
      • STM32746G-Discovery
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32746g_discovery.c [code] | This file provides a set of firmware functions to manage LEDs, push-buttons and COM ports available on STM32746G-Discovery board(MB1191) from STMicroelectronics
stm32746g_discovery.h [code] | This file contains definitions for STM32746G_DISCOVERY's LEDs, push-buttons and COM ports hardware resources
stm32746g_discovery_audio.c [code] | This file provides the Audio driver for the STM32746G-Discovery board
stm32746g_discovery_audio.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_audio.c driver
stm32746g_discovery_camera.c [code] | This file includes the driver for Camera modules mounted on STM32746G-Discovery board
stm32746g_discovery_camera.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_camera.c driver
stm32746g_discovery_eeprom.c [code] | This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory
stm32746g_discovery_eeprom.h [code] | This file contains all the functions prototypes for the stm32746g_discovery_eeprom.c firmware driver
stm32746g_discovery_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32746G-Discovery board
stm32746g_discovery_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_lcd.c driver
stm32746g_discovery_qspi.c [code] | This file includes a standard driver for the N25Q128A QSPI memory mounted on STM32746G-Discovery board
stm32746g_discovery_qspi.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_qspi.c driver
stm32746g_discovery_sd.c [code] | This file includes the uSD card driver mounted on STM32746G-Discovery board
stm32746g_discovery_sd.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_sd.c driver
stm32746g_discovery_sdram.c [code] | This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32746G-Discovery board
stm32746g_discovery_sdram.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_sdram.c driver
stm32746g_discovery_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32746G-Discovery board
stm32746g_discovery_ts.h [code] | This file contains the common defines and functions prototypes for the stm32746g_discovery_ts.c driver
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: BSP

Modules
BSP

Modules

STM32746G_DISCOVERY
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY

Modules
STM32746G_DISCOVERY
BSP

Modules

STM32746G_DISCOVERY_LOW_LEVEL
STM32746G_DISCOVERY AUDIO

This file includes the low layer driver for wm8994 Audio Codec available on STM32746G-Discovery board(MB1191).

STM32746G-Discovery QSPI
STM32746G_DISCOVERY_SD
STM32746G_DISCOVERY_SDRAM
STM32746G_DISCOVERY_TS
STM32746G_DISCOVERY_CAMERA
STM32746G_DISCOVERY_EEPROM

This file includes the I2C EEPROM driver of STM32746G-Discovery board.

STM32746G_DISCOVERY_LCD
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY AUDIO

Modules
STM32746G_DISCOVERY AUDIO
STM32746G_DISCOVERY

This file includes the low layer driver for wm8994 Audio Codec available on STM32746G-Discovery board(MB1191). More...

Modules

STM32746G_DISCOVERY AUDIO Private Types
STM32746G_DISCOVERY AUDIO Private Defines
STM32746G_DISCOVERY AUDIO Private Macros
STM32746G_DISCOVERY AUDIO Private Variables
STM32746G_DISCOVERY AUDIO Private Function Prototypes
STM32746G_DISCOVERY AUDIO Out Exported Functions
STM32746G_DISCOVERY_AUDIO Out Private Functions
STM32746G_DISCOVERY_AUDIO Exported Types
STM32746G_DISCOVERY_AUDIO Exported Constants
STM32746G_DISCOVERY_AUDIO Exported Variables
STM32746G_DISCOVERY_AUDIO Exported Macros
STM32746G_DISCOVERY_AUDIO_IN Exported Functions

Detailed Description

This file includes the low layer driver for wm8994 Audio Codec available on STM32746G-Discovery board(MB1191).


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_CAMERA

Modules
STM32746G_DISCOVERY_CAMERA
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_CAMERA Private Types Definitions
STM32746G_DISCOVERY_CAMERA Private Defines
STM32746G_DISCOVERY_CAMERA Private Macros
STM32746G_DISCOVERY_CAMERA Private Variables
STM32746G_DISCOVERY_CAMERA Private Function Prototypes
STM32746G_DISCOVERY_CAMERA Exported Functions
STM32746G_DISCOVERY_CAMERA Exported Types
STM32746G_DISCOVERY_CAMERA Exported Constants
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_EEPROM

Modules
STM32746G_DISCOVERY_EEPROM
STM32746G_DISCOVERY

This file includes the I2C EEPROM driver of STM32746G-Discovery board. More...

Modules

STM32746G_DISCOVERY_EEPROM Private Types
STM32746G_DISCOVERY_EEPROM Private Defines
STM32746G_DISCOVERY_EEPROM Private Macros
STM32746G_DISCOVERY_EEPROM Private Variables
STM32746G_DISCOVERY_EEPROM Private Function Prototypes
STM32746G_DISCOVERY_EEPROM Exported Functions
STM32746G_DISCOVERY_EEPROM Exported Types
STM32746G_DISCOVERY_EEPROM Exported Constants
STM32746G_DISCOVERY_EEPROM Exported Macros

Detailed Description

This file includes the I2C EEPROM driver of STM32746G-Discovery board.

Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LCD

Modules
STM32746G_DISCOVERY_LCD
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_LCD Private Types Definitions
STM32746G_DISCOVERY LCD Private Defines
STM32746G_DISCOVERY_LCD Private Macros
STM32746G_DISCOVERY_LCD Private Variables
STM32746G_DISCOVERY_LCD Private Function Prototypes
STM32746G_DISCOVERY_LCD Exported Functions
STM32746G_DISCOVERY_LCD Exported Types
STM32746G_DISCOVERY_LCD Exported Constants
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL

Modules
STM32746G_DISCOVERY_LOW_LEVEL
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions
STM32746G_DISCOVERY_LOW_LEVEL Private Defines
STM32746G_DISCOVERY_LOW_LEVEL Private Macros
STM32746G_DISCOVERY_LOW_LEVEL Private Variables
STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes
STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions
STM32746G_DISCOVERY_LOW_LEVEL Exported Types
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants
STM32746G_DISCOVERY_LOW_LEVEL Exported Macros


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_LOW_LEVEL Exported Constants

Modules
STM32746G_DISCOVERY_LOW_LEVEL Exported Constants
STM32746G_DISCOVERY_LOW_LEVEL

Modules

STM32746G_DISCOVERY_LOW_LEVEL_LED

Define for STM32746G_DISCOVERY board.

STM32746G_DISCOVERY_LOW_LEVEL_BUTTON
STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL
STM32746G_DISCOVERY_LOW_LEVEL_COM
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G-Discovery QSPI

Modules
STM32746G-Discovery QSPI
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY QSPI Private Variables
STM32746G_DISCOVERY QSPI Private Functions
STM32746G_DISCOVERY QSPI Exported Functions
STM32746G_DISCOVERY_QSPI Exported Constants
STM32746G_DISCOVERY_QSPI Exported Types
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_QSPI Exported Types

Data Structures
STM32746G_DISCOVERY_QSPI Exported Types
STM32746G-Discovery QSPI

Data Structures

struct QSPI_Info


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_SDRAM

Modules
STM32746G_DISCOVERY_SDRAM
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_SDRAM Private Types Definitions
STM32746G_DISCOVERY_SDRAM Private Defines
STM32746G_DISCOVERY_SDRAM Private Macros
STM32746G_DISCOVERY_SDRAM Private Variables
STM32746G_DISCOVERY_SDRAM Private Function Prototypes
STM32746G_DISCOVERY_SDRAM Exported Functions
STM32746G_DISCOVERY_SDRAM Exported Types
STM32746G_DISCOVERY_SDRAM Exported Macro
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS

Modules
STM32746G_DISCOVERY_TS
STM32746G_DISCOVERY

Modules

STM32746G_DISCOVERY_TS Types Definitions
STM32746G_DISCOVERY_TS Types Defines
STM32746G_DISCOVERY_TS Private Macros
STM32746G_DISCOVERY_TS Imported Variables
STM32746G_DISCOVERY_TS Private Variables
STM32746G_DISCOVERY_TS Private Function Prototypes
STM32746G_DISCOVERY_TS Exported Functions
STM32746G_DISCOVERY_TS Exported Constants
STM32746G_DISCOVERY_TS Exported Types
Generated on Fri May 26 2017 15:57:30 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: STM32746G_DISCOVERY_TS Exported Types

Data Structures
STM32746G_DISCOVERY_TS Exported Types
STM32746G_DISCOVERY_TS

Data Structures

struct TS_StateTypeDef
TS_StateTypeDef Define TS State structure. More...
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • STM32746G_DISCOVERY
      • STM32746G_DISCOVERY_LOW_LEVEL
        • STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions
        • STM32746G_DISCOVERY_LOW_LEVEL Private Defines
        • STM32746G_DISCOVERY_LOW_LEVEL Private Macros
        • STM32746G_DISCOVERY_LOW_LEVEL Private Variables
        • STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes
        • STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions
        • STM32746G_DISCOVERY_LOW_LEVEL Exported Types
        • STM32746G_DISCOVERY_LOW_LEVEL Exported Constants
          • STM32746G_DISCOVERY_LOW_LEVEL_LED
          • STM32746G_DISCOVERY_LOW_LEVEL_BUTTON
          • STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL
          • STM32746G_DISCOVERY_LOW_LEVEL_COM
        • STM32746G_DISCOVERY_LOW_LEVEL Exported Macros
      • STM32746G_DISCOVERY AUDIO
        • STM32746G_DISCOVERY AUDIO Private Types
        • STM32746G_DISCOVERY AUDIO Private Defines
        • STM32746G_DISCOVERY AUDIO Private Macros
        • STM32746G_DISCOVERY AUDIO Private Variables
        • STM32746G_DISCOVERY AUDIO Private Function Prototypes
        • STM32746G_DISCOVERY AUDIO Out Exported Functions
        • STM32746G_DISCOVERY_AUDIO Out Private Functions
        • STM32746G_DISCOVERY_AUDIO Exported Types
        • STM32746G_DISCOVERY_AUDIO Exported Constants
        • STM32746G_DISCOVERY_AUDIO Exported Variables
        • STM32746G_DISCOVERY_AUDIO Exported Macros
        • STM32746G_DISCOVERY_AUDIO_IN Exported Functions
      • STM32746G-Discovery QSPI
        • STM32746G_DISCOVERY QSPI Private Variables
        • STM32746G_DISCOVERY QSPI Private Functions
        • STM32746G_DISCOVERY QSPI Exported Functions
        • STM32746G_DISCOVERY_QSPI Exported Constants
        • STM32746G_DISCOVERY_QSPI Exported Types
      • STM32746G_DISCOVERY_SD
        • STM32746G_DISCOVERY_SD Private Types Definitions
        • STM32746G_DISCOVERY_SD Private Defines
        • STM32746G_DISCOVERY_SD Private Macros
        • STM32746G_DISCOVERY_SD Private Variables
        • STM32746G_DISCOVERY_SD Private Function Prototypes
        • STM32746G_DISCOVERY_SD Exported Functions
        • STM32746G_DISCOVERY_SD Exported Types
        • STM32746G_DISCOVERY_SD Exported Constants
        • STM32746G_DISCOVERY_SD Exported Macro
      • STM32746G_DISCOVERY_SDRAM
        • STM32746G_DISCOVERY_SDRAM Private Types Definitions
        • STM32746G_DISCOVERY_SDRAM Private Defines
        • STM32746G_DISCOVERY_SDRAM Private Macros
        • STM32746G_DISCOVERY_SDRAM Private Variables
        • STM32746G_DISCOVERY_SDRAM Private Function Prototypes
        • STM32746G_DISCOVERY_SDRAM Exported Functions
        • STM32746G_DISCOVERY_SDRAM Exported Types
          • STM32746G_DISCOVERY_SDRAM Exported Constants
        • STM32746G_DISCOVERY_SDRAM Exported Macro
      • STM32746G_DISCOVERY_TS
        • STM32746G_DISCOVERY_TS Types Definitions
        • STM32746G_DISCOVERY_TS Types Defines
        • STM32746G_DISCOVERY_TS Private Macros
        • STM32746G_DISCOVERY_TS Imported Variables
        • STM32746G_DISCOVERY_TS Private Variables
        • STM32746G_DISCOVERY_TS Private Function Prototypes
        • STM32746G_DISCOVERY_TS Exported Functions
          • TS Private Functions
        • STM32746G_DISCOVERY_TS Exported Constants
        • STM32746G_DISCOVERY_TS Exported Types
      • STM32746G_DISCOVERY_CAMERA
        • STM32746G_DISCOVERY_CAMERA Private Types Definitions
        • STM32746G_DISCOVERY_CAMERA Private Defines
        • STM32746G_DISCOVERY_CAMERA Private Macros
        • STM32746G_DISCOVERY_CAMERA Private Variables
        • STM32746G_DISCOVERY_CAMERA Private Function Prototypes
        • STM32746G_DISCOVERY_CAMERA Exported Functions
        • STM32746G_DISCOVERY_CAMERA Exported Types
        • STM32746G_DISCOVERY_CAMERA Exported Constants
      • STM32746G_DISCOVERY_EEPROM
        • STM32746G_DISCOVERY_EEPROM Private Types
        • STM32746G_DISCOVERY_EEPROM Private Defines
        • STM32746G_DISCOVERY_EEPROM Private Macros
        • STM32746G_DISCOVERY_EEPROM Private Variables
        • STM32746G_DISCOVERY_EEPROM Private Function Prototypes
        • STM32746G_DISCOVERY_EEPROM Exported Functions
        • STM32746G_DISCOVERY_EEPROM Exported Types
        • STM32746G_DISCOVERY_EEPROM Exported Constants
        • STM32746G_DISCOVERY_EEPROM Exported Macros
      • STM32746G_DISCOVERY_LCD
        • STM32746G_DISCOVERY_LCD Private Types Definitions
        • STM32746G_DISCOVERY LCD Private Defines
        • STM32746G_DISCOVERY_LCD Private Macros
        • STM32746G_DISCOVERY_LCD Private Variables
        • STM32746G_DISCOVERY_LCD Private Function Prototypes
        • STM32746G_DISCOVERY_LCD Exported Functions
        • STM32746G_DISCOVERY_LCD Exported Types
        • STM32746G_DISCOVERY_LCD Exported Constants
Generated on Fri May 26 2017 15:57:31 for STM32746G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32746G-Discovery BSP User Manual: stm32746g_discovery.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to manage LEDs,
00006   *          push-buttons and COM ports available on STM32746G-Discovery
00007   *          board(MB1191) from STMicroelectronics.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without modification,
00014   * are permitted provided that the following conditions are met:
00015   *   1. Redistributions of source code must retain the above copyright notice,
00016   *      this list of conditions and the following disclaimer.
00017   *   2. Redistributions in binary form must reproduce the above copyright notice,
00018   *      this list of conditions and the following disclaimer in the documentation
00019   *      and/or other materials provided with the distribution.
00020   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00021   *      may be used to endorse or promote products derived from this software
00022   *      without specific prior written permission.
00023   *
00024   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00028   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00030   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034   *
00035   ******************************************************************************
00036   */
00037
00038 /* Dependencies
00039 - stm32f7xx_hal_cortex.c
00040 - stm32f7xx_hal_gpio.c
00041 - stm32f7xx_hal_uart.c
00042 - stm32f7xx_hal_i2c.c
00043 EndDependencies */
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32746g_discovery.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32746G_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL STM32746G_DISCOVERY_LOW_LEVEL
00057   * @{
00058   */
00059
00060 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_TypesDefinitions STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions
00061   * @{
00062   */
00063 /**
00064   * @}
00065   */
00066
00067 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Defines STM32746G_DISCOVERY_LOW_LEVEL Private Defines
00068   * @{
00069   */
00070 /**
00071  * @brief STM32746G DISCOVERY BSP Driver version number V2.0.0
00072    */
00073 #define __STM32746G_DISCO_BSP_VERSION_MAIN   (0x02) /*!< [31:24] main version */
00074 #define __STM32746G_DISCO_BSP_VERSION_SUB1   (0x00) /*!< [23:16] sub1 version */
00075 #define __STM32746G_DISCO_BSP_VERSION_SUB2   (0x00) /*!< [15:8]  sub2 version */
00076 #define __STM32746G_DISCO_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00077 #define __STM32746G_DISCO_BSP_VERSION         ((__STM32746G_DISCO_BSP_VERSION_MAIN << 24)\
00078                                              |(__STM32746G_DISCO_BSP_VERSION_SUB1 << 16)\
00079                                              |(__STM32746G_DISCO_BSP_VERSION_SUB2 << 8 )\
00080                                              |(__STM32746G_DISCO_BSP_VERSION_RC))
00081 /**
00082   * @}
00083   */
00084
00085 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Macros STM32746G_DISCOVERY_LOW_LEVEL Private Macros
00086   * @{
00087   */
00088 /**
00089   * @}
00090   */
00091
00092 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Variables STM32746G_DISCOVERY_LOW_LEVEL Private Variables
00093   * @{
00094   */
00095
00096 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN};
00097
00098 GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT,
00099                                       TAMPER_BUTTON_GPIO_PORT,
00100                                       KEY_BUTTON_GPIO_PORT};
00101
00102 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN,
00103                                       TAMPER_BUTTON_PIN,
00104                                       KEY_BUTTON_PIN};
00105
00106 const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn,
00107                                        TAMPER_BUTTON_EXTI_IRQn,
00108                                        KEY_BUTTON_EXTI_IRQn};
00109
00110 USART_TypeDef* COM_USART[COMn] = {DISCOVERY_COM1};
00111
00112 GPIO_TypeDef* COM_TX_PORT[COMn] = {DISCOVERY_COM1_TX_GPIO_PORT};
00113
00114 GPIO_TypeDef* COM_RX_PORT[COMn] = {DISCOVERY_COM1_RX_GPIO_PORT};
00115
00116 const uint16_t COM_TX_PIN[COMn] = {DISCOVERY_COM1_TX_PIN};
00117
00118 const uint16_t COM_RX_PIN[COMn] = {DISCOVERY_COM1_RX_PIN};
00119
00120 const uint16_t COM_TX_AF[COMn] = {DISCOVERY_COM1_TX_AF};
00121
00122 const uint16_t COM_RX_AF[COMn] = {DISCOVERY_COM1_RX_AF};
00123
00124 static I2C_HandleTypeDef hI2cAudioHandler = {0};
00125 static I2C_HandleTypeDef hI2cExtHandler = {0};
00126
00127 /**
00128   * @}
00129   */
00130
00131 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_FunctionPrototypes STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes
00132   * @{
00133   */
00134 static void     I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler);
00135 static void     I2Cx_Init(I2C_HandleTypeDef *i2c_handler);
00136
00137 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00138 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00139 static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials);
00140 static void              I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr);
00141
00142 /* AUDIO IO functions */
00143 void            AUDIO_IO_Init(void);
00144 void            AUDIO_IO_DeInit(void);
00145 void            AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00146 uint16_t        AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
00147 void            AUDIO_IO_Delay(uint32_t Delay);
00148
00149 /* TOUCHSCREEN IO functions */
00150 void            TS_IO_Init(void);
00151 void            TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00152 uint8_t         TS_IO_Read(uint8_t Addr, uint8_t Reg);
00153 void            TS_IO_Delay(uint32_t Delay);
00154
00155 /* CAMERA IO functions */
00156 void            CAMERA_IO_Init(void);
00157 void            CAMERA_Delay(uint32_t Delay);
00158 void            CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00159 uint8_t         CAMERA_IO_Read(uint8_t Addr, uint8_t Reg);
00160
00161 /* I2C EEPROM IO function */
00162 void                EEPROM_IO_Init(void);
00163 HAL_StatusTypeDef   EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00164 HAL_StatusTypeDef   EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00165 HAL_StatusTypeDef   EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00166 /**
00167   * @}
00168   */
00169
00170 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Functions STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions
00171   * @{
00172   */
00173
00174   /**
00175   * @brief  This method returns the STM32746G DISCOVERY BSP Driver revision
00176   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00177   */
00178 uint32_t BSP_GetVersion(void)
00179 {
00180   return __STM32746G_DISCO_BSP_VERSION;
00181 }
00182
00183 /**
00184   * @brief  Configures LED on GPIO.
00185   * @param  Led: LED to be configured.
00186   *          This parameter can be one of the following values:
00187   *            @arg  LED1
00188   * @retval None
00189   */
00190 void BSP_LED_Init(Led_TypeDef Led)
00191 {
00192   GPIO_InitTypeDef  gpio_init_structure;
00193   GPIO_TypeDef*     gpio_led;
00194
00195   if (Led == LED1)
00196   {
00197     gpio_led = LED1_GPIO_PORT;
00198     /* Enable the GPIO_LED clock */
00199     LED1_GPIO_CLK_ENABLE();
00200
00201     /* Configure the GPIO_LED pin */
00202     gpio_init_structure.Pin = GPIO_PIN[Led];
00203     gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
00204     gpio_init_structure.Pull = GPIO_PULLUP;
00205     gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00206
00207     HAL_GPIO_Init(gpio_led, &gpio_init_structure);
00208
00209     /* By default, turn off LED */
00210     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00211   }
00212 }
00213
00214 /**
00215   * @brief  DeInit LEDs.
00216   * @param  Led: LED to be configured.
00217   *          This parameter can be one of the following values:
00218   *            @arg  LED1
00219   * @note Led DeInit does not disable the GPIO clock
00220   * @retval None
00221   */
00222 void BSP_LED_DeInit(Led_TypeDef Led)
00223 {
00224   GPIO_InitTypeDef  gpio_init_structure;
00225   GPIO_TypeDef*     gpio_led;
00226
00227   if (Led == LED1)
00228   {
00229     gpio_led = LED1_GPIO_PORT;
00230     /* Turn off LED */
00231     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00232     /* Configure the GPIO_LED pin */
00233     gpio_init_structure.Pin = GPIO_PIN[Led];
00234     HAL_GPIO_DeInit(gpio_led, gpio_init_structure.Pin);
00235   }
00236 }
00237
00238 /**
00239   * @brief  Turns selected LED On.
00240   * @param  Led: LED to be set on
00241   *          This parameter can be one of the following values:
00242   *            @arg  LED1
00243   * @retval None
00244   */
00245 void BSP_LED_On(Led_TypeDef Led)
00246 {
00247   GPIO_TypeDef*     gpio_led;
00248
00249   if (Led == LED1)      /* Switch On LED connected to GPIO */
00250   {
00251     gpio_led = LED1_GPIO_PORT;
00252     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
00253   }
00254 }
00255
00256 /**
00257   * @brief  Turns selected LED Off.
00258   * @param  Led: LED to be set off
00259   *          This parameter can be one of the following values:
00260   *            @arg  LED1
00261   * @retval None
00262   */
00263 void BSP_LED_Off(Led_TypeDef Led)
00264 {
00265   GPIO_TypeDef*     gpio_led;
00266
00267   if (Led == LED1) /* Switch Off LED connected to GPIO */
00268   {
00269     gpio_led = LED1_GPIO_PORT;
00270     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00271   }
00272 }
00273
00274 /**
00275   * @brief  Toggles the selected LED.
00276   * @param  Led: LED to be toggled
00277   *          This parameter can be one of the following values:
00278   *            @arg  LED1
00279   * @retval None
00280   */
00281 void BSP_LED_Toggle(Led_TypeDef Led)
00282 {
00283   GPIO_TypeDef*     gpio_led;
00284
00285   if (Led == LED1)      /* Toggle LED connected to GPIO */
00286   {
00287     gpio_led = LED1_GPIO_PORT;
00288     HAL_GPIO_TogglePin(gpio_led, GPIO_PIN[Led]);
00289   }
00290 }
00291
00292 /**
00293   * @brief  Configures button GPIO and EXTI Line.
00294   * @param  Button: Button to be configured
00295   *          This parameter can be one of the following values:
00296   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00297   *            @arg  BUTTON_TAMPER: Tamper Push Button
00298   *            @arg  BUTTON_KEY: Key Push Button
00299   * @param  ButtonMode: Button mode
00300   *          This parameter can be one of the following values:
00301   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00302   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00303   *                                    with interrupt generation capability
00304   * @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
00305   *       are mapped on the same push button named "User"
00306   *       on the board serigraphy.
00307   * @retval None
00308   */
00309 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
00310 {
00311   GPIO_InitTypeDef gpio_init_structure;
00312
00313   /* Enable the BUTTON clock */
00314   BUTTONx_GPIO_CLK_ENABLE(Button);
00315
00316   if(ButtonMode == BUTTON_MODE_GPIO)
00317   {
00318     /* Configure Button pin as input */
00319     gpio_init_structure.Pin = BUTTON_PIN[Button];
00320     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00321     gpio_init_structure.Pull = GPIO_NOPULL;
00322     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00323     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00324   }
00325
00326   if(ButtonMode == BUTTON_MODE_EXTI)
00327   {
00328     /* Configure Button pin as input with External interrupt */
00329     gpio_init_structure.Pin = BUTTON_PIN[Button];
00330     gpio_init_structure.Pull = GPIO_NOPULL;
00331     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00332
00333     if(Button != BUTTON_WAKEUP)
00334     {
00335       gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00336     }
00337     else
00338     {
00339       gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00340     }
00341
00342     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00343
00344     /* Enable and set Button EXTI Interrupt to the lowest priority */
00345     HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
00346     HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00347   }
00348 }
00349
00350 /**
00351   * @brief  Push Button DeInit.
00352   * @param  Button: Button to be configured
00353   *          This parameter can be one of the following values:
00354   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00355   *            @arg  BUTTON_TAMPER: Tamper Push Button
00356   *            @arg  BUTTON_KEY: Key Push Button
00357   * @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
00358   *       are mapped on the same push button named "User"
00359   *       on the board serigraphy.
00360   * @note PB DeInit does not disable the GPIO clock
00361   * @retval None
00362   */
00363 void BSP_PB_DeInit(Button_TypeDef Button)
00364 {
00365     GPIO_InitTypeDef gpio_init_structure;
00366
00367     gpio_init_structure.Pin = BUTTON_PIN[Button];
00368     HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00369     HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00370 }
00371
00372
00373 /**
00374   * @brief  Returns the selected button state.
00375   * @param  Button: Button to be checked
00376   *          This parameter can be one of the following values:
00377   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00378   *            @arg  BUTTON_TAMPER: Tamper Push Button
00379   *            @arg  BUTTON_KEY: Key Push Button
00380   * @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
00381   *       are mapped on the same push button named "User"
00382   *       on the board serigraphy.
00383   * @retval The Button GPIO pin value
00384   */
00385 uint32_t BSP_PB_GetState(Button_TypeDef Button)
00386 {
00387   return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00388 }
00389
00390 /**
00391   * @brief  Configures COM port.
00392   * @param  COM: COM port to be configured.
00393   *          This parameter can be one of the following values:
00394   *            @arg  COM1
00395   *            @arg  COM2
00396   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00397   *                configuration information for the specified USART peripheral.
00398   * @retval None
00399   */
00400 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart)
00401 {
00402   GPIO_InitTypeDef gpio_init_structure;
00403
00404   /* Enable GPIO clock */
00405   DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(COM);
00406   DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(COM);
00407
00408   /* Enable USART clock */
00409   DISCOVERY_COMx_CLK_ENABLE(COM);
00410
00411   /* Configure USART Tx as alternate function */
00412   gpio_init_structure.Pin = COM_TX_PIN[COM];
00413   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00414   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00415   gpio_init_structure.Pull = GPIO_PULLUP;
00416   gpio_init_structure.Alternate = COM_TX_AF[COM];
00417   HAL_GPIO_Init(COM_TX_PORT[COM], &gpio_init_structure);
00418
00419   /* Configure USART Rx as alternate function */
00420   gpio_init_structure.Pin = COM_RX_PIN[COM];
00421   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00422   gpio_init_structure.Alternate = COM_RX_AF[COM];
00423   HAL_GPIO_Init(COM_RX_PORT[COM], &gpio_init_structure);
00424
00425   /* USART configuration */
00426   huart->Instance = COM_USART[COM];
00427   HAL_UART_Init(huart);
00428 }
00429
00430 /**
00431   * @brief  DeInit COM port.
00432   * @param  COM: COM port to be configured.
00433   *          This parameter can be one of the following values:
00434   *            @arg  COM1
00435   *            @arg  COM2
00436   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00437   *                configuration information for the specified USART peripheral.
00438   * @retval None
00439   */
00440 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart)
00441 {
00442   /* USART configuration */
00443   huart->Instance = COM_USART[COM];
00444   HAL_UART_DeInit(huart);
00445
00446   /* Enable USART clock */
00447   DISCOVERY_COMx_CLK_DISABLE(COM);
00448
00449   /* DeInit GPIO pins can be done in the application
00450      (by surcharging this __weak function) */
00451
00452   /* GPIO pins clock, DMA clock can be shut down in the application
00453      by surcharging this __weak function */
00454 }
00455
00456 /*******************************************************************************
00457                             BUS OPERATIONS
00458 *******************************************************************************/
00459
00460 /******************************* I2C Routines *********************************/
00461 /**
00462   * @brief  Initializes I2C MSP.
00463   * @param  i2c_handler : I2C handler
00464   * @retval None
00465   */
00466 static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler)
00467 {
00468   GPIO_InitTypeDef  gpio_init_structure;
00469
00470   if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
00471   {
00472     /* AUDIO and LCD I2C MSP init */
00473
00474     /*** Configure the GPIOs ***/
00475     /* Enable GPIO clock */
00476     DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
00477
00478     /* Configure I2C Tx as alternate function */
00479     gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SCL_PIN;
00480     gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00481     gpio_init_structure.Pull = GPIO_NOPULL;
00482     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00483     gpio_init_structure.Alternate = DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF;
00484     HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00485
00486     /* Configure I2C Rx as alternate function */
00487     gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SDA_PIN;
00488     HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00489
00490     /*** Configure the I2C peripheral ***/
00491     /* Enable I2C clock */
00492     DISCOVERY_AUDIO_I2Cx_CLK_ENABLE();
00493
00494     /* Force the I2C peripheral clock reset */
00495     DISCOVERY_AUDIO_I2Cx_FORCE_RESET();
00496
00497     /* Release the I2C peripheral clock reset */
00498     DISCOVERY_AUDIO_I2Cx_RELEASE_RESET();
00499
00500     /* Enable and set I2Cx Interrupt to a lower priority */
00501     HAL_NVIC_SetPriority(DISCOVERY_AUDIO_I2Cx_EV_IRQn, 0x0F, 0);
00502     HAL_NVIC_EnableIRQ(DISCOVERY_AUDIO_I2Cx_EV_IRQn);
00503
00504     /* Enable and set I2Cx Interrupt to a lower priority */
00505     HAL_NVIC_SetPriority(DISCOVERY_AUDIO_I2Cx_ER_IRQn, 0x0F, 0);
00506     HAL_NVIC_EnableIRQ(DISCOVERY_AUDIO_I2Cx_ER_IRQn);
00507   }
00508   else
00509   {
00510     /* External, camera and Arduino connector I2C MSP init */
00511
00512     /*** Configure the GPIOs ***/
00513     /* Enable GPIO clock */
00514     DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
00515
00516     /* Configure I2C Tx as alternate function */
00517     gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SCL_PIN;
00518     gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00519     gpio_init_structure.Pull = GPIO_NOPULL;
00520     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00521     gpio_init_structure.Alternate = DISCOVERY_EXT_I2Cx_SCL_SDA_AF;
00522     HAL_GPIO_Init(DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00523
00524     /* Configure I2C Rx as alternate function */
00525     gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SDA_PIN;
00526     HAL_GPIO_Init(DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00527
00528     /*** Configure the I2C peripheral ***/
00529     /* Enable I2C clock */
00530     DISCOVERY_EXT_I2Cx_CLK_ENABLE();
00531
00532     /* Force the I2C peripheral clock reset */
00533     DISCOVERY_EXT_I2Cx_FORCE_RESET();
00534
00535     /* Release the I2C peripheral clock reset */
00536     DISCOVERY_EXT_I2Cx_RELEASE_RESET();
00537
00538     /* Enable and set I2Cx Interrupt to a lower priority */
00539     HAL_NVIC_SetPriority(DISCOVERY_EXT_I2Cx_EV_IRQn, 0x0F, 0);
00540     HAL_NVIC_EnableIRQ(DISCOVERY_EXT_I2Cx_EV_IRQn);
00541
00542     /* Enable and set I2Cx Interrupt to a lower priority */
00543     HAL_NVIC_SetPriority(DISCOVERY_EXT_I2Cx_ER_IRQn, 0x0F, 0);
00544     HAL_NVIC_EnableIRQ(DISCOVERY_EXT_I2Cx_ER_IRQn);
00545   }
00546 }
00547
00548 /**
00549   * @brief  Initializes I2C HAL.
00550   * @param  i2c_handler : I2C handler
00551   * @retval None
00552   */
00553 static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler)
00554 {
00555   if(HAL_I2C_GetState(i2c_handler) == HAL_I2C_STATE_RESET)
00556   {
00557     if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
00558     {
00559       /* Audio and LCD I2C configuration */
00560       i2c_handler->Instance = DISCOVERY_AUDIO_I2Cx;
00561     }
00562     else
00563     {
00564       /* External, camera and Arduino connector  I2C configuration */
00565       i2c_handler->Instance = DISCOVERY_EXT_I2Cx;
00566     }
00567     i2c_handler->Init.Timing           = DISCOVERY_I2Cx_TIMING;
00568     i2c_handler->Init.OwnAddress1      = 0;
00569     i2c_handler->Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00570     i2c_handler->Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00571     i2c_handler->Init.OwnAddress2      = 0;
00572     i2c_handler->Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00573     i2c_handler->Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00574
00575     /* Init the I2C */
00576     I2Cx_MspInit(i2c_handler);
00577     HAL_I2C_Init(i2c_handler);
00578   }
00579 }
00580
00581 /**
00582   * @brief  Reads multiple data.
00583   * @param  i2c_handler : I2C handler
00584   * @param  Addr: I2C address
00585   * @param  Reg: Reg address
00586   * @param  MemAddress: Memory address
00587   * @param  Buffer: Pointer to data buffer
00588   * @param  Length: Length of the data
00589   * @retval Number of read data
00590   */
00591 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler,
00592                                            uint8_t Addr,
00593                                            uint16_t Reg,
00594                                            uint16_t MemAddress,
00595                                            uint8_t *Buffer,
00596                                            uint16_t Length)
00597 {
00598   HAL_StatusTypeDef status = HAL_OK;
00599
00600   status = HAL_I2C_Mem_Read(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00601
00602   /* Check the communication status */
00603   if(status != HAL_OK)
00604   {
00605     /* I2C error occurred */
00606     I2Cx_Error(i2c_handler, Addr);
00607   }
00608   return status;
00609 }
00610
00611 /**
00612   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00613   * @param  i2c_handler : I2C handler
00614   * @param  Addr: Device address on BUS Bus.
00615   * @param  Reg: The target register address to write
00616   * @param  MemAddress: Memory address
00617   * @param  Buffer: The target register value to be written
00618   * @param  Length: buffer size to be written
00619   * @retval HAL status
00620   */
00621 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler,
00622                                             uint8_t Addr,
00623                                             uint16_t Reg,
00624                                             uint16_t MemAddress,
00625                                             uint8_t *Buffer,
00626                                             uint16_t Length)
00627 {
00628   HAL_StatusTypeDef status = HAL_OK;
00629
00630   status = HAL_I2C_Mem_Write(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00631
00632   /* Check the communication status */
00633   if(status != HAL_OK)
00634   {
00635     /* Re-Initiaize the I2C Bus */
00636     I2Cx_Error(i2c_handler, Addr);
00637   }
00638   return status;
00639 }
00640
00641 /**
00642   * @brief  Checks if target device is ready for communication.
00643   * @note   This function is used with Memory devices
00644   * @param  i2c_handler : I2C handler
00645   * @param  DevAddress: Target device address
00646   * @param  Trials: Number of trials
00647   * @retval HAL status
00648   */
00649 static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
00650 {
00651   return (HAL_I2C_IsDeviceReady(i2c_handler, DevAddress, Trials, 1000));
00652 }
00653
00654 /**
00655   * @brief  Manages error callback by re-initializing I2C.
00656   * @param  i2c_handler : I2C handler
00657   * @param  Addr: I2C Address
00658   * @retval None
00659   */
00660 static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
00661 {
00662   /* De-initialize the I2C communication bus */
00663   HAL_I2C_DeInit(i2c_handler);
00664
00665   /* Re-Initialize the I2C communication bus */
00666   I2Cx_Init(i2c_handler);
00667 }
00668
00669 /*******************************************************************************
00670                             LINK OPERATIONS
00671 *******************************************************************************/
00672
00673 /********************************* LINK AUDIO *********************************/
00674
00675 /**
00676   * @brief  Initializes Audio low level.
00677   * @retval None
00678   */
00679 void AUDIO_IO_Init(void)
00680 {
00681   I2Cx_Init(&hI2cAudioHandler);
00682 }
00683
00684 /**
00685   * @brief  Deinitializes Audio low level.
00686   * @retval None
00687   */
00688 void AUDIO_IO_DeInit(void)
00689 {
00690 }
00691
00692 /**
00693   * @brief  Writes a single data.
00694   * @param  Addr: I2C address
00695   * @param  Reg: Reg address
00696   * @param  Value: Data to be written
00697   * @retval None
00698   */
00699 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
00700 {
00701   uint16_t tmp = Value;
00702
00703   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
00704
00705   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
00706
00707   I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
00708 }
00709
00710 /**
00711   * @brief  Reads a single data.
00712   * @param  Addr: I2C address
00713   * @param  Reg: Reg address
00714   * @retval Data to be read
00715   */
00716 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
00717 {
00718   uint16_t read_value = 0, tmp = 0;
00719
00720   I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
00721
00722   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
00723
00724   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
00725
00726   read_value = tmp;
00727
00728   return read_value;
00729 }
00730
00731 /**
00732   * @brief  AUDIO Codec delay
00733   * @param  Delay: Delay in ms
00734   * @retval None
00735   */
00736 void AUDIO_IO_Delay(uint32_t Delay)
00737 {
00738   HAL_Delay(Delay);
00739 }
00740
00741 /********************************* LINK CAMERA ********************************/
00742
00743 /**
00744   * @brief  Initializes Camera low level.
00745   * @retval None
00746   */
00747 void CAMERA_IO_Init(void)
00748 {
00749   I2Cx_Init(&hI2cExtHandler);
00750 }
00751
00752 /**
00753   * @brief  Camera writes single data.
00754   * @param  Addr: I2C address
00755   * @param  Reg: Register address
00756   * @param  Value: Data to be written
00757   * @retval None
00758   */
00759 void CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00760 {
00761   I2Cx_WriteMultiple(&hI2cExtHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
00762 }
00763
00764 /**
00765   * @brief  Camera reads single data.
00766   * @param  Addr: I2C address
00767   * @param  Reg: Register address
00768   * @retval Read data
00769   */
00770 uint8_t CAMERA_IO_Read(uint8_t Addr, uint8_t Reg)
00771 {
00772   uint8_t read_value = 0;
00773
00774   I2Cx_ReadMultiple(&hI2cExtHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
00775
00776   return read_value;
00777 }
00778
00779 /**
00780   * @brief  Camera delay
00781   * @param  Delay: Delay in ms
00782   * @retval None
00783   */
00784 void CAMERA_Delay(uint32_t Delay)
00785 {
00786   HAL_Delay(Delay);
00787 }
00788
00789 /******************************** LINK I2C EEPROM *****************************/
00790
00791 /**
00792   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00793   * @retval None
00794   */
00795 void EEPROM_IO_Init(void)
00796 {
00797   I2Cx_Init(&hI2cExtHandler);
00798 }
00799
00800 /**
00801   * @brief  Write data to I2C EEPROM driver in using DMA channel.
00802   * @param  DevAddress: Target device address
00803   * @param  MemAddress: Internal memory address
00804   * @param  pBuffer: Pointer to data buffer
00805   * @param  BufferSize: Amount of data to be sent
00806   * @retval HAL status
00807   */
00808 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00809 {
00810   return (I2Cx_WriteMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00811 }
00812
00813 /**
00814   * @brief  Read data from I2C EEPROM driver in using DMA channel.
00815   * @param  DevAddress: Target device address
00816   * @param  MemAddress: Internal memory address
00817   * @param  pBuffer: Pointer to data buffer
00818   * @param  BufferSize: Amount of data to be read
00819   * @retval HAL status
00820   */
00821 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00822 {
00823   return (I2Cx_ReadMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00824 }
00825
00826 /**
00827   * @brief  Checks if target device is ready for communication.
00828   * @note   This function is used with Memory devices
00829   * @param  DevAddress: Target device address
00830   * @param  Trials: Number of trials
00831   * @retval HAL status
00832   */
00833 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00834 {
00835   return (I2Cx_IsDeviceReady(&hI2cExtHandler, DevAddress, Trials));
00836 }
00837
00838 /********************************* LINK TOUCHSCREEN *********************************/
00839
00840 /**
00841   * @brief  Initializes Touchscreen low level.
00842   * @retval None
00843   */
00844 void TS_IO_Init(void)
00845 {
00846   I2Cx_Init(&hI2cAudioHandler);
00847 }
00848
00849 /**
00850   * @brief  Writes a single data.
00851   * @param  Addr: I2C address
00852   * @param  Reg: Reg address
00853   * @param  Value: Data to be written
00854   * @retval None
00855   */
00856 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00857 {
00858   I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
00859 }
00860
00861 /**
00862   * @brief  Reads a single data.
00863   * @param  Addr: I2C address
00864   * @param  Reg: Reg address
00865   * @retval Data to be read
00866   */
00867 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
00868 {
00869   uint8_t read_value = 0;
00870
00871   I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
00872
00873   return read_value;
00874 }
00875
00876 /**
00877   * @brief  TS delay
00878   * @param  Delay: Delay in ms
00879   * @retval None
00880   */
00881 void TS_IO_Delay(uint32_t Delay)
00882 {
00883   HAL_Delay(Delay);
00884 }
00885
00886 /**
00887   * @}
00888   */
00889
00890 /**
00891   * @}
00892   */
00893
00894 /**
00895   * @}
00896   */
00897
00898 /**
00899   * @}
00900   */
00901
00902 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32746G_DISCOVERY's LEDs,
00006   *          push-buttons and COM ports hardware resources.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_H
00039 #define __STM32746G_DISCOVERY_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32f7xx_hal.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32746G_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL
00057   * @{
00058   */
00059
00060 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Types STM32746G_DISCOVERY_LOW_LEVEL Exported Types
00061   * @{
00062   */
00063 typedef enum
00064 {
00065 LED1 = 0,
00066 LED_GREEN = LED1,
00067 }Led_TypeDef;
00068
00069 typedef enum
00070 {
00071   BUTTON_WAKEUP = 0,
00072   BUTTON_TAMPER = 1,
00073   BUTTON_KEY = 2
00074 }Button_TypeDef;
00075
00076 typedef enum
00077 {
00078   BUTTON_MODE_GPIO = 0,
00079   BUTTON_MODE_EXTI = 1
00080 }ButtonMode_TypeDef;
00081
00082 typedef enum
00083 {
00084   COM1 = 0,
00085   COM2 = 1
00086 }COM_TypeDef;
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Constants STM32746G_DISCOVERY_LOW_LEVEL Exported Constants
00092   * @{
00093   */
00094
00095 /**
00096   * @brief  Define for STM32746G_DISCOVERY board
00097   */
00098 #if !defined (USE_STM32746G_DISCO)
00099  #define USE_STM32746G_DISCO
00100 #endif
00101
00102 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_LED
00103   * @{
00104   */
00105
00106 #define LEDn                             ((uint8_t)1)
00107
00108 #define LED1_GPIO_PORT                   GPIOI
00109 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOI_CLK_ENABLE()
00110 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOI_CLK_DISABLE()
00111 #define LED1_PIN                         GPIO_PIN_1
00112
00113 /**
00114   * @}
00115   */
00116
00117 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_BUTTON
00118   * @{
00119   */
00120 #define BUTTONn                             ((uint8_t)3)
00121
00122 /**
00123   * @brief Wakeup push-button
00124   */
00125 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_11
00126 #define WAKEUP_BUTTON_GPIO_PORT             GPIOI
00127 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOI_CLK_ENABLE()
00128 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOI_CLK_DISABLE()
00129 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI15_10_IRQn
00130
00131 /**
00132   * @brief Tamper push-button
00133   */
00134 #define TAMPER_BUTTON_PIN                    GPIO_PIN_11
00135 #define TAMPER_BUTTON_GPIO_PORT              GPIOI
00136 #define TAMPER_BUTTON_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOI_CLK_ENABLE()
00137 #define TAMPER_BUTTON_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOI_CLK_DISABLE()
00138 #define TAMPER_BUTTON_EXTI_IRQn              EXTI15_10_IRQn
00139
00140 /**
00141   * @brief Key push-button
00142   */
00143 #define KEY_BUTTON_PIN                       GPIO_PIN_11
00144 #define KEY_BUTTON_GPIO_PORT                 GPIOI
00145 #define KEY_BUTTON_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOI_CLK_ENABLE()
00146 #define KEY_BUTTON_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOI_CLK_DISABLE()
00147 #define KEY_BUTTON_EXTI_IRQn                 EXTI15_10_IRQn
00148
00149 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\
00150                                                    if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\
00151                                                                                                                         KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0)
00152
00153 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__)    (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\
00154                                                 ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE())
00155
00156 /**
00157   * @}
00158   */
00159
00160 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL
00161   * @{
00162   */
00163 #define SIGNALn                             ((uint8_t)1)
00164
00165 /**
00166   * @brief SD-detect signal
00167   */
00168 #define SD_DETECT_PIN                        GPIO_PIN_13
00169 #define SD_DETECT_GPIO_PORT                  GPIOC
00170 #define SD_DETECT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOC_CLK_ENABLE()
00171 #define SD_DETECT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOC_CLK_DISABLE()
00172 #define SD_DETECT_EXTI_IRQn                  EXTI15_10_IRQn
00173
00174 /**
00175   * @brief Touch screen interrupt signal
00176   */
00177 #define TS_INT_PIN                           GPIO_PIN_13
00178 #define TS_INT_GPIO_PORT                     GPIOI
00179 #define TS_INT_GPIO_CLK_ENABLE()             __HAL_RCC_GPIOI_CLK_ENABLE()
00180 #define TS_INT_GPIO_CLK_DISABLE()            __HAL_RCC_GPIOI_CLK_DISABLE()
00181 #define TS_INT_EXTI_IRQn                     EXTI15_10_IRQn
00182
00183 /**
00184   * @}
00185   */
00186
00187 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_COM
00188   * @{
00189   */
00190 #define COMn                             ((uint8_t)1)
00191
00192 /**
00193  * @brief Definition for COM port1, connected to USART1
00194  */
00195 #define DISCOVERY_COM1                          USART1
00196 #define DISCOVERY_COM1_CLK_ENABLE()             __HAL_RCC_USART1_CLK_ENABLE()
00197 #define DISCOVERY_COM1_CLK_DISABLE()            __HAL_RCC_USART1_CLK_DISABLE()
00198
00199 #define DISCOVERY_COM1_TX_PIN                   GPIO_PIN_9
00200 #define DISCOVERY_COM1_TX_GPIO_PORT             GPIOA
00201 #define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00202 #define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00203 #define DISCOVERY_COM1_TX_AF                    GPIO_AF7_USART1
00204
00205 #define DISCOVERY_COM1_RX_PIN                   GPIO_PIN_7
00206 #define DISCOVERY_COM1_RX_GPIO_PORT             GPIOB
00207 #define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00208 #define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOB_CLK_DISABLE()
00209 #define DISCOVERY_COM1_RX_AF                    GPIO_AF7_USART1
00210
00211 #define DISCOVERY_COM1_IRQn                     USART1_IRQn
00212
00213 #define DISCOVERY_COMx_CLK_ENABLE(__INDEX__)            do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0)
00214 #define DISCOVERY_COMx_CLK_DISABLE(__INDEX__)           (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0)
00215
00216 #define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
00217 #define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0)
00218
00219 #define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
00220 #define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0)
00221
00222 /* Exported constant IO ------------------------------------------------------*/
00223
00224 #define LCD_I2C_ADDRESS                  ((uint16_t)0x70)
00225 #define CAMERA_I2C_ADDRESS               ((uint16_t)0x60)
00226 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x34)
00227 #define EEPROM_I2C_ADDRESS_A01           ((uint16_t)0xA0)
00228 #define EEPROM_I2C_ADDRESS_A02           ((uint16_t)0xA6)
00229 #define TS_I2C_ADDRESS                   ((uint16_t)0x70)
00230
00231 /* I2C clock speed configuration (in Hz)
00232    WARNING:
00233    Make sure that this define is not already declared in other files (ie.
00234    stm32746g_discovery.h file). It can be used in parallel by other modules. */
00235 #ifndef I2C_SPEED
00236  #define I2C_SPEED                       ((uint32_t)100000)
00237 #endif /* I2C_SPEED */
00238
00239 /* User can use this section to tailor I2Cx/I2Cx instance used and associated
00240    resources */
00241 /* Definition for AUDIO and LCD I2Cx resources */
00242 #define DISCOVERY_AUDIO_I2Cx                             I2C3
00243 #define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C3_CLK_ENABLE()
00244 #define DISCOVERY_AUDIO_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00245 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
00246
00247 #define DISCOVERY_AUDIO_I2Cx_FORCE_RESET()               __HAL_RCC_I2C3_FORCE_RESET()
00248 #define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C3_RELEASE_RESET()
00249
00250 /* Definition for I2Cx Pins */
00251 #define DISCOVERY_AUDIO_I2Cx_SCL_PIN                     GPIO_PIN_7
00252 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT           GPIOH
00253 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C3
00254 #define DISCOVERY_AUDIO_I2Cx_SDA_PIN                     GPIO_PIN_8
00255
00256 /* I2C interrupt requests */
00257 #define DISCOVERY_AUDIO_I2Cx_EV_IRQn                     I2C3_EV_IRQn
00258 #define DISCOVERY_AUDIO_I2Cx_ER_IRQn                     I2C3_ER_IRQn
00259
00260 /* Definition for external, camera and Arduino connector I2Cx resources */
00261 #define DISCOVERY_EXT_I2Cx                               I2C1
00262 #define DISCOVERY_EXT_I2Cx_CLK_ENABLE()                  __HAL_RCC_I2C1_CLK_ENABLE()
00263 #define DISCOVERY_EXT_DMAx_CLK_ENABLE()                  __HAL_RCC_DMA1_CLK_ENABLE()
00264 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00265
00266 #define DISCOVERY_EXT_I2Cx_FORCE_RESET()                 __HAL_RCC_I2C1_FORCE_RESET()
00267 #define DISCOVERY_EXT_I2Cx_RELEASE_RESET()               __HAL_RCC_I2C1_RELEASE_RESET()
00268
00269 /* Definition for I2Cx Pins */
00270 #define DISCOVERY_EXT_I2Cx_SCL_PIN                       GPIO_PIN_8
00271 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT             GPIOB
00272 #define DISCOVERY_EXT_I2Cx_SCL_SDA_AF                    GPIO_AF4_I2C1
00273 #define DISCOVERY_EXT_I2Cx_SDA_PIN                       GPIO_PIN_9
00274
00275 /* I2C interrupt requests */
00276 #define DISCOVERY_EXT_I2Cx_EV_IRQn                       I2C1_EV_IRQn
00277 #define DISCOVERY_EXT_I2Cx_ER_IRQn                       I2C1_ER_IRQn
00278
00279 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00280 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */
00281 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
00282 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */
00283 #ifndef DISCOVERY_I2Cx_TIMING
00284 #define DISCOVERY_I2Cx_TIMING                      ((uint32_t)0x40912732)
00285 #endif /* DISCOVERY_I2Cx_TIMING */
00286
00287 /**
00288   * @}
00289   */
00290
00291 /**
00292   * @}
00293   */
00294
00295 /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Macros STM32746G_DISCOVERY_LOW_LEVEL Exported Macros
00296   * @{
00297   */
00298 /**
00299   * @}
00300   */
00301
00302 /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Functions
00303   * @{
00304   */
00305 uint32_t  BSP_GetVersion(void);
00306 void      BSP_LED_Init(Led_TypeDef Led);
00307 void      BSP_LED_DeInit(Led_TypeDef Led);
00308 void      BSP_LED_On(Led_TypeDef Led);
00309 void      BSP_LED_Off(Led_TypeDef Led);
00310 void      BSP_LED_Toggle(Led_TypeDef Led);
00311 void      BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00312 void      BSP_PB_DeInit(Button_TypeDef Button);
00313 uint32_t  BSP_PB_GetState(Button_TypeDef Button);
00314 void      BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart);
00315 void      BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
00316
00317 /**
00318   * @}
00319   */
00320
00321 /**
00322   * @}
00323   */
00324
00325 /**
00326   * @}
00327   */
00328
00329 /**
00330   * @}
00331   */
00332
00333 #ifdef __cplusplus
00334 }
00335 #endif
00336
00337 #endif /* __STM32746G_DISCOVERY_H */
00338
00339 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_audio.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_audio.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_audio.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides the Audio driver for the STM32746G-Discovery board.
00006   @verbatim
00007     How To use this driver:
00008     -----------------------
00009        + This driver supports STM32F7xx devices on STM32746G-Discovery (MB1191) board.
00010        + Call the function BSP_AUDIO_OUT_Init(
00011                                         OutputDevice: physical output mode (OUTPUT_DEVICE_SPEAKER,
00012                                                       OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH)
00013                                         Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
00014                                         AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
00015                                                       this parameter is relative to the audio file/stream type.
00016                                        )
00017           This function configures all the hardware required for the audio application (codec, I2C, SAI,
00018           GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
00019           If the returned value is different from AUDIO_OK or the function is stuck then the communication with
00020           the codec or the MFX has failed (try to un-plug the power or reset device in this case).
00021           - OUTPUT_DEVICE_SPEAKER  : only speaker will be set as output for the audio stream.
00022           - OUTPUT_DEVICE_HEADPHONE: only headphones will be set as output for the audio stream.
00023           - OUTPUT_DEVICE_BOTH     : both Speaker and Headphone are used as outputs for the audio stream
00024                                      at the same time.
00025           Note. On STM32746G-Discovery SAI_DMA is configured in CIRCULAR mode. Due to this the application
00026             does NOT need to call BSP_AUDIO_OUT_ChangeBuffer() to assure streaming.
00027        + Call the function BSP_DISCOVERY_AUDIO_OUT_Play(
00028                                       pBuffer: pointer to the audio data file address
00029                                       Size   : size of the buffer to be sent in Bytes
00030                                      )
00031           to start playing (for the first time) from the audio file/stream.
00032        + Call the function BSP_AUDIO_OUT_Pause() to pause playing
00033        + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
00034            Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00035               for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00036            Note. This function should be called only when the audio file is played or paused (not stopped).
00037        + For each mode, you may need to implement the relative callback functions into your code.
00038           The Callback functions are named AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
00039           the stm32746g_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
00040        + To Stop playing, to modify the volume level, the frequency, the audio frame slot,
00041           the device output mode the mute or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
00042           AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetOutputMode(),
00043           BSP_AUDIO_OUT_SetMute() and BSP_AUDIO_OUT_Stop().
00044        + The driver API and the callback functions are at the end of the stm32746g_discovery_audio.h file.
00045
00046     Driver architecture:
00047     --------------------
00048        + This driver provides the High Audio Layer: consists of the function API exported in the stm32746g_discovery_audio.h file
00049          (BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play() ...)
00050        + This driver provide also the Media Access Layer (MAL): which consists of functions allowing to access the media containing/
00051          providing the audio file/stream. These functions are also included as local functions into
00052          the stm32746g_discovery_audio_codec.c file (SAIx_Out_Init() and SAIx_Out_DeInit(), SAIx_In_Init() and SAIx_In_DeInit())
00053
00054     Known Limitations:
00055     ------------------
00056        1- If the TDM Format used to play in parallel 2 audio Stream (the first Stream is configured in codec SLOT0 and second
00057           Stream in SLOT1) the Pause/Resume, volume and mute feature will control the both streams.
00058        2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
00059           File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
00060        3- Supports only Stereo audio streaming.
00061        4- Supports only 16-bits audio data size.
00062   @endverbatim
00063   ******************************************************************************
00064   * @attention
00065   *
00066   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00067   *
00068   * Redistribution and use in source and binary forms, with or without modification,
00069   * are permitted provided that the following conditions are met:
00070   *   1. Redistributions of source code must retain the above copyright notice,
00071   *      this list of conditions and the following disclaimer.
00072   *   2. Redistributions in binary form must reproduce the above copyright notice,
00073   *      this list of conditions and the following disclaimer in the documentation
00074   *      and/or other materials provided with the distribution.
00075   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00076   *      may be used to endorse or promote products derived from this software
00077   *      without specific prior written permission.
00078   *
00079   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00080   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00081   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00082   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00083   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00084   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00085   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00086   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00087   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00088   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00089   *
00090   ******************************************************************************
00091   */
00092
00093 /* Dependencies
00094 - stm32746g_discovery.c
00095 - stm32f7xx_hal_sai.c
00096 - stm32f7xx_hal_dma.c
00097 - stm32f7xx_hal_gpio.c
00098 - stm32f7xx_hal_cortex.c
00099 - stm32f7xx_hal_rcc_ex.h
00100 - wm8994.c
00101 EndDependencies */
00102
00103 /* Includes ------------------------------------------------------------------*/
00104 #include "stm32746g_discovery_audio.h"
00105
00106 /** @addtogroup BSP
00107   * @{
00108   */
00109
00110 /** @addtogroup STM32746G_DISCOVERY
00111   * @{
00112   */
00113
00114 /** @defgroup STM32746G_DISCOVERY_AUDIO STM32746G_DISCOVERY AUDIO
00115   * @brief This file includes the low layer driver for wm8994 Audio Codec
00116   *        available on STM32746G-Discovery board(MB1191).
00117   * @{
00118   */
00119
00120 /** @defgroup STM32746G_DISCOVERY_AUDIO_Private_Types STM32746G_DISCOVERY AUDIO Private Types
00121   * @{
00122   */
00123 /**
00124   * @}
00125   */
00126
00127 /** @defgroup STM32746G_DISCOVERY_AUDIO_Private_Defines STM32746G_DISCOVERY AUDIO Private Defines
00128   * @{
00129   */
00130 /**
00131   * @}
00132   */
00133
00134 /** @defgroup STM32746G_DISCOVERY_AUDIO_Private_Macros STM32746G_DISCOVERY AUDIO Private Macros
00135   * @{
00136   */
00137 /**
00138   * @}
00139   */
00140
00141 /** @defgroup STM32746G_DISCOVERY_AUDIO_Private_Variables STM32746G_DISCOVERY AUDIO Private Variables
00142   * @{
00143   */
00144 AUDIO_DrvTypeDef          *audio_drv;
00145 SAI_HandleTypeDef         haudio_out_sai={0};
00146 SAI_HandleTypeDef         haudio_in_sai={0};
00147 TIM_HandleTypeDef         haudio_tim;
00148
00149 uint16_t __IO AudioInVolume = DEFAULT_AUDIO_IN_VOLUME;
00150
00151 /**
00152   * @}
00153   */
00154
00155 /** @defgroup STM32746G_DISCOVERY_AUDIO_Private_Function_Prototypes STM32746G_DISCOVERY AUDIO Private Function Prototypes
00156   * @{
00157   */
00158 static void SAIx_Out_Init(uint32_t AudioFreq);
00159 static void SAIx_Out_DeInit(void);
00160 static void SAIx_In_Init(uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq);
00161 static void SAIx_In_DeInit(void);
00162 /**
00163   * @}
00164   */
00165
00166 /** @defgroup STM32746G_DISCOVERY_AUDIO_OUT_Exported_Functions STM32746G_DISCOVERY AUDIO Out Exported Functions
00167   * @{
00168   */
00169
00170 /**
00171   * @brief  Configures the audio peripherals.
00172   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00173   *                       or OUTPUT_DEVICE_BOTH.
00174   * @param  Volume: Initial volume level (from 0 (Mute) to 100 (Max))
00175   * @param  AudioFreq: Audio frequency used to play the audio stream.
00176   * @note   The I2S PLL input clock must be done in the user application.
00177   * @retval AUDIO_OK if correct communication, else wrong communication
00178   */
00179 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
00180 {
00181   uint8_t ret = AUDIO_ERROR;
00182   uint32_t deviceid = 0x00;
00183
00184   /* Disable SAI */
00185   SAIx_Out_DeInit();
00186
00187   /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00188   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00189
00190   /* SAI data transfer preparation:
00191   Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00192   haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00193   if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00194   {
00195     /* Init the SAI MSP: this __weak function can be redefined by the application*/
00196     BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00197   }
00198   SAIx_Out_Init(AudioFreq);
00199
00200   /* wm8994 codec initialization */
00201   deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00202
00203   if((deviceid) == WM8994_ID)
00204   {
00205     /* Reset the Codec Registers */
00206     wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00207     /* Initialize the audio driver structure */
00208     audio_drv = &wm8994_drv;
00209     ret = AUDIO_OK;
00210   }
00211   else
00212   {
00213     ret = AUDIO_ERROR;
00214   }
00215
00216   if(ret == AUDIO_OK)
00217   {
00218     /* Initialize the codec internal registers */
00219     audio_drv->Init(AUDIO_I2C_ADDRESS, OutputDevice, Volume, AudioFreq);
00220   }
00221
00222   return ret;
00223 }
00224
00225 /**
00226   * @brief  Starts playing audio stream from a data buffer for a determined size.
00227   * @param  pBuffer: Pointer to the buffer
00228   * @param  Size: Number of audio data in BYTES unit.
00229   *         In memory, first element is for left channel, second element is for right channel
00230   * @retval AUDIO_OK if correct communication, else wrong communication
00231   */
00232 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size)
00233 {
00234   /* Call the audio Codec Play function */
00235   if(audio_drv->Play(AUDIO_I2C_ADDRESS, pBuffer, Size) != 0)
00236   {
00237     return AUDIO_ERROR;
00238   }
00239   else
00240   {
00241     /* Update the Media layer and enable it for play */
00242     HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pBuffer, DMA_MAX(Size / AUDIODATA_SIZE));
00243
00244     return AUDIO_OK;
00245   }
00246 }
00247
00248 /**
00249   * @brief  Sends n-Bytes on the SAI interface.
00250   * @param  pData: pointer on data address
00251   * @param  Size: number of data to be written
00252   * @retval None
00253   */
00254 void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
00255 {
00256    HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pData, Size);
00257 }
00258
00259 /**
00260   * @brief  This function Pauses the audio file stream. In case
00261   *         of using DMA, the DMA Pause feature is used.
00262   * @note When calling BSP_AUDIO_OUT_Pause() function for pause, only
00263   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00264   *          function for resume could lead to unexpected behaviour).
00265   * @retval AUDIO_OK if correct communication, else wrong communication
00266   */
00267 uint8_t BSP_AUDIO_OUT_Pause(void)
00268 {
00269   /* Call the Audio Codec Pause/Resume function */
00270   if(audio_drv->Pause(AUDIO_I2C_ADDRESS) != 0)
00271   {
00272     return AUDIO_ERROR;
00273   }
00274   else
00275   {
00276     /* Call the Media layer pause function */
00277     HAL_SAI_DMAPause(&haudio_out_sai);
00278
00279     /* Return AUDIO_OK when all operations are correctly done */
00280     return AUDIO_OK;
00281   }
00282 }
00283
00284 /**
00285   * @brief  This function  Resumes the audio file stream.
00286   * @note When calling BSP_AUDIO_OUT_Pause() function for pause, only
00287   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00288   *          function for resume could lead to unexpected behaviour).
00289   * @retval AUDIO_OK if correct communication, else wrong communication
00290   */
00291 uint8_t BSP_AUDIO_OUT_Resume(void)
00292 {
00293   /* Call the Audio Codec Pause/Resume function */
00294   if(audio_drv->Resume(AUDIO_I2C_ADDRESS) != 0)
00295   {
00296     return AUDIO_ERROR;
00297   }
00298   else
00299   {
00300     /* Call the Media layer pause/resume function */
00301     HAL_SAI_DMAResume(&haudio_out_sai);
00302
00303     /* Return AUDIO_OK when all operations are correctly done */
00304     return AUDIO_OK;
00305   }
00306 }
00307
00308 /**
00309   * @brief  Stops audio playing and Power down the Audio Codec.
00310   * @param  Option: could be one of the following parameters
00311   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00312   *                            Then no need to reconfigure the Codec after power on.
00313   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00314   *                            Then need to reconfigure the Codec after power on.
00315   * @retval AUDIO_OK if correct communication, else wrong communication
00316   */
00317 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
00318 {
00319   /* Call the Media layer stop function */
00320   HAL_SAI_DMAStop(&haudio_out_sai);
00321
00322   /* Call Audio Codec Stop function */
00323   if(audio_drv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
00324   {
00325     return AUDIO_ERROR;
00326   }
00327   else
00328   {
00329     if(Option == CODEC_PDWN_HW)
00330     {
00331       /* Wait at least 100us */
00332       HAL_Delay(1);
00333     }
00334     /* Return AUDIO_OK when all operations are correctly done */
00335     return AUDIO_OK;
00336   }
00337 }
00338
00339 /**
00340   * @brief  Controls the current audio volume level.
00341   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00342   *         Mute and 100 for Max volume level).
00343   * @retval AUDIO_OK if correct communication, else wrong communication
00344   */
00345 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
00346 {
00347   /* Call the codec volume control function with converted volume value */
00348   if(audio_drv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
00349   {
00350     return AUDIO_ERROR;
00351   }
00352   else
00353   {
00354     /* Return AUDIO_OK when all operations are correctly done */
00355     return AUDIO_OK;
00356   }
00357 }
00358
00359 /**
00360   * @brief  Enables or disables the MUTE mode by software
00361   * @param  Cmd: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to
00362   *         unmute the codec and restore previous volume level.
00363   * @retval AUDIO_OK if correct communication, else wrong communication
00364   */
00365 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
00366 {
00367   /* Call the Codec Mute function */
00368   if(audio_drv->SetMute(AUDIO_I2C_ADDRESS, Cmd) != 0)
00369   {
00370     return AUDIO_ERROR;
00371   }
00372   else
00373   {
00374     /* Return AUDIO_OK when all operations are correctly done */
00375     return AUDIO_OK;
00376   }
00377 }
00378
00379 /**
00380   * @brief  Switch dynamically (while audio file is played) the output target
00381   *         (speaker or headphone).
00382   * @param  Output: The audio output target: OUTPUT_DEVICE_SPEAKER,
00383   *         OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
00384   * @retval AUDIO_OK if correct communication, else wrong communication
00385   */
00386 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output)
00387 {
00388   /* Call the Codec output device function */
00389   if(audio_drv->SetOutputMode(AUDIO_I2C_ADDRESS, Output) != 0)
00390   {
00391     return AUDIO_ERROR;
00392   }
00393   else
00394   {
00395     /* Return AUDIO_OK when all operations are correctly done */
00396     return AUDIO_OK;
00397   }
00398 }
00399
00400 /**
00401   * @brief  Updates the audio frequency.
00402   * @param  AudioFreq: Audio frequency used to play the audio stream.
00403   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00404   *         audio frequency.
00405   * @retval None
00406   */
00407 void BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq)
00408 {
00409   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00410   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00411
00412   /* Disable SAI peripheral to allow access to SAI internal registers */
00413   __HAL_SAI_DISABLE(&haudio_out_sai);
00414
00415   /* Update the SAI audio frequency configuration */
00416   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00417   HAL_SAI_Init(&haudio_out_sai);
00418
00419   /* Enable SAI peripheral to generate MCLK */
00420   __HAL_SAI_ENABLE(&haudio_out_sai);
00421 }
00422
00423 /**
00424   * @brief  Updates the Audio frame slot configuration.
00425   * @param  AudioFrameSlot: specifies the audio Frame slot
00426   *         This parameter can be one of the following values
00427   *            @arg CODEC_AUDIOFRAME_SLOT_0123
00428   *            @arg CODEC_AUDIOFRAME_SLOT_02
00429   *            @arg CODEC_AUDIOFRAME_SLOT_13
00430   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00431   *         audio frame slot.
00432   * @retval None
00433   */
00434 void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
00435 {
00436   /* Disable SAI peripheral to allow access to SAI internal registers */
00437   __HAL_SAI_DISABLE(&haudio_out_sai);
00438
00439   /* Update the SAI audio frame slot configuration */
00440   haudio_out_sai.SlotInit.SlotActive = AudioFrameSlot;
00441   HAL_SAI_Init(&haudio_out_sai);
00442
00443   /* Enable SAI peripheral to generate MCLK */
00444   __HAL_SAI_ENABLE(&haudio_out_sai);
00445 }
00446
00447 /**
00448   * @brief  Deinit the audio peripherals.
00449   * @retval None
00450   */
00451 void BSP_AUDIO_OUT_DeInit(void)
00452 {
00453   SAIx_Out_DeInit();
00454   /* DeInit the SAI MSP : this __weak function can be rewritten by the application */
00455   BSP_AUDIO_OUT_MspDeInit(&haudio_out_sai, NULL);
00456 }
00457
00458 /**
00459   * @brief  Tx Transfer completed callbacks.
00460   * @param  hsai: SAI handle
00461   * @retval None
00462   */
00463 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
00464 {
00465   /* Manage the remaining file size and new address offset: This function
00466      should be coded by user (its prototype is already declared in stm32746g_discovery_audio.h) */
00467   BSP_AUDIO_OUT_TransferComplete_CallBack();
00468 }
00469
00470 /**
00471   * @brief  Tx Half Transfer completed callbacks.
00472   * @param  hsai: SAI handle
00473   * @retval None
00474   */
00475 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
00476 {
00477   /* Manage the remaining file size and new address offset: This function
00478      should be coded by user (its prototype is already declared in stm32746g_discovery_audio.h) */
00479   BSP_AUDIO_OUT_HalfTransfer_CallBack();
00480 }
00481
00482 /**
00483   * @brief  SAI error callbacks.
00484   * @param  hsai: SAI handle
00485   * @retval None
00486   */
00487 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
00488 {
00489   HAL_SAI_StateTypeDef audio_out_state;
00490   HAL_SAI_StateTypeDef audio_in_state;
00491
00492   audio_out_state = HAL_SAI_GetState(&haudio_out_sai);
00493   audio_in_state = HAL_SAI_GetState(&haudio_in_sai);
00494
00495   /* Determines if it is an audio out or audio in error */
00496   if ((audio_out_state == HAL_SAI_STATE_BUSY) || (audio_out_state == HAL_SAI_STATE_BUSY_TX))
00497   {
00498     BSP_AUDIO_OUT_Error_CallBack();
00499   }
00500
00501   if ((audio_in_state == HAL_SAI_STATE_BUSY) || (audio_in_state == HAL_SAI_STATE_BUSY_RX))
00502   {
00503     BSP_AUDIO_IN_Error_CallBack();
00504   }
00505 }
00506
00507 /**
00508   * @brief  Manages the DMA full Transfer complete event.
00509   * @retval None
00510   */
00511 __weak void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
00512 {
00513 }
00514
00515 /**
00516   * @brief  Manages the DMA Half Transfer complete event.
00517   * @retval None
00518   */
00519 __weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
00520 {
00521 }
00522
00523 /**
00524   * @brief  Manages the DMA FIFO error event.
00525   * @retval None
00526   */
00527 __weak void BSP_AUDIO_OUT_Error_CallBack(void)
00528 {
00529 }
00530
00531 /**
00532   * @brief  Initializes BSP_AUDIO_OUT MSP.
00533   * @param  hsai: SAI handle
00534   * @param  Params
00535   * @retval None
00536   */
00537 __weak void BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params)
00538 {
00539   static DMA_HandleTypeDef hdma_sai_tx;
00540   GPIO_InitTypeDef  gpio_init_structure;
00541
00542   /* Enable SAI clock */
00543   AUDIO_OUT_SAIx_CLK_ENABLE();
00544
00545   /* Enable GPIO clock */
00546   AUDIO_OUT_SAIx_MCLK_ENABLE();
00547   AUDIO_OUT_SAIx_SCK_SD_ENABLE();
00548   AUDIO_OUT_SAIx_FS_ENABLE();
00549   /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
00550   gpio_init_structure.Pin = AUDIO_OUT_SAIx_FS_PIN;
00551   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00552   gpio_init_structure.Pull = GPIO_NOPULL;
00553   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00554   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_FS_SD_MCLK_AF;
00555   HAL_GPIO_Init(AUDIO_OUT_SAIx_FS_GPIO_PORT, &gpio_init_structure);
00556
00557   gpio_init_structure.Pin = AUDIO_OUT_SAIx_SCK_PIN;
00558   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00559   gpio_init_structure.Pull = GPIO_NOPULL;
00560   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00561   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_SCK_AF;
00562   HAL_GPIO_Init(AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT, &gpio_init_structure);
00563
00564   gpio_init_structure.Pin =  AUDIO_OUT_SAIx_SD_PIN;
00565   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00566   gpio_init_structure.Pull = GPIO_NOPULL;
00567   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00568   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_FS_SD_MCLK_AF;
00569   HAL_GPIO_Init(AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT, &gpio_init_structure);
00570
00571   gpio_init_structure.Pin = AUDIO_OUT_SAIx_MCLK_PIN;
00572   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00573   gpio_init_structure.Pull = GPIO_NOPULL;
00574   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00575   gpio_init_structure.Alternate = AUDIO_OUT_SAIx_FS_SD_MCLK_AF;
00576   HAL_GPIO_Init(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, &gpio_init_structure);
00577
00578   /* Enable the DMA clock */
00579   AUDIO_OUT_SAIx_DMAx_CLK_ENABLE();
00580
00581   if(hsai->Instance == AUDIO_OUT_SAIx)
00582   {
00583     /* Configure the hdma_saiTx handle parameters */
00584     hdma_sai_tx.Init.Channel             = AUDIO_OUT_SAIx_DMAx_CHANNEL;
00585     hdma_sai_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00586     hdma_sai_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
00587     hdma_sai_tx.Init.MemInc              = DMA_MINC_ENABLE;
00588     hdma_sai_tx.Init.PeriphDataAlignment = AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE;
00589     hdma_sai_tx.Init.MemDataAlignment    = AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE;
00590     hdma_sai_tx.Init.Mode                = DMA_CIRCULAR;
00591     hdma_sai_tx.Init.Priority            = DMA_PRIORITY_HIGH;
00592     hdma_sai_tx.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00593     hdma_sai_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00594     hdma_sai_tx.Init.MemBurst            = DMA_MBURST_SINGLE;
00595     hdma_sai_tx.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00596
00597     hdma_sai_tx.Instance = AUDIO_OUT_SAIx_DMAx_STREAM;
00598
00599     /* Associate the DMA handle */
00600     __HAL_LINKDMA(hsai, hdmatx, hdma_sai_tx);
00601
00602     /* Deinitialize the Stream for new transfer */
00603     HAL_DMA_DeInit(&hdma_sai_tx);
00604
00605     /* Configure the DMA Stream */
00606     HAL_DMA_Init(&hdma_sai_tx);
00607   }
00608
00609   /* SAI DMA IRQ Channel configuration */
00610   HAL_NVIC_SetPriority(AUDIO_OUT_SAIx_DMAx_IRQ, AUDIO_OUT_IRQ_PREPRIO, 0);
00611   HAL_NVIC_EnableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
00612 }
00613
00614 /**
00615   * @brief  Deinitializes SAI MSP.
00616   * @param  hsai: SAI handle
00617   * @param  Params
00618   * @retval None
00619   */
00620 __weak void BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
00621 {
00622     GPIO_InitTypeDef  gpio_init_structure;
00623
00624     /* SAI DMA IRQ Channel deactivation */
00625     HAL_NVIC_DisableIRQ(AUDIO_OUT_SAIx_DMAx_IRQ);
00626
00627     if(hsai->Instance == AUDIO_OUT_SAIx)
00628     {
00629       /* Deinitialize the DMA stream */
00630       HAL_DMA_DeInit(hsai->hdmatx);
00631     }
00632
00633     /* Disable SAI peripheral */
00634     __HAL_SAI_DISABLE(hsai);
00635
00636     /* Deactives CODEC_SAI pins FS, SCK, MCK and SD by putting them in input mode */
00637     gpio_init_structure.Pin = AUDIO_OUT_SAIx_FS_PIN;
00638     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_FS_GPIO_PORT, gpio_init_structure.Pin);
00639
00640     gpio_init_structure.Pin = AUDIO_OUT_SAIx_SCK_PIN;
00641     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT, gpio_init_structure.Pin);
00642
00643     gpio_init_structure.Pin =  AUDIO_OUT_SAIx_SD_PIN;
00644     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT, gpio_init_structure.Pin);
00645
00646     gpio_init_structure.Pin = AUDIO_OUT_SAIx_MCLK_PIN;
00647     HAL_GPIO_DeInit(AUDIO_OUT_SAIx_MCLK_GPIO_PORT, gpio_init_structure.Pin);
00648
00649     /* Disable SAI clock */
00650     AUDIO_OUT_SAIx_CLK_DISABLE();
00651
00652     /* GPIO pins clock and DMA clock can be shut down in the application
00653        by surcharging this __weak function */
00654 }
00655
00656 /**
00657   * @brief  Clock Config.
00658   * @param  hsai: might be required to set audio peripheral predivider if any.
00659   * @param  AudioFreq: Audio frequency used to play the audio stream.
00660   * @param  Params
00661   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
00662   *         Being __weak it can be overwritten by the application
00663   * @retval None
00664   */
00665 __weak void BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
00666 {
00667   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00668
00669   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00670
00671   /* Set the PLL configuration according to the audio frequency */
00672   if((AudioFreq == AUDIO_FREQUENCY_11K) || (AudioFreq == AUDIO_FREQUENCY_22K) || (AudioFreq == AUDIO_FREQUENCY_44K))
00673   {
00674     /* Configure PLLI2S prescalers */
00675     /* PLLI2S_VCO: VCO_429M
00676     I2S_CLK(first level) = PLLI2S_VCO/PLLI2SQ = 429/2 = 214.5 Mhz
00677     I2S_CLK_x = I2S_CLK(first level)/PLLI2SDIVQ = 214.5/19 = 11.289 Mhz */
00678     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI2;
00679     rcc_ex_clk_init_struct.Sai2ClockSelection = RCC_SAI2CLKSOURCE_PLLI2S;
00680     rcc_ex_clk_init_struct.PLLI2S.PLLI2SN = 429;
00681     rcc_ex_clk_init_struct.PLLI2S.PLLI2SQ = 2;
00682     rcc_ex_clk_init_struct.PLLI2SDivQ = 19;
00683
00684     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00685
00686   }
00687   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_48K), AUDIO_FREQUENCY_96K */
00688   {
00689     /* I2S clock config
00690     PLLI2S_VCO: VCO_344M
00691     I2S_CLK(first level) = PLLI2S_VCO/PLLI2SQ = 344/7 = 49.142 Mhz
00692     I2S_CLK_x = I2S_CLK(first level)/PLLI2SDIVQ = 49.142/1 = 49.142 Mhz */
00693     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI2;
00694     rcc_ex_clk_init_struct.Sai2ClockSelection = RCC_SAI2CLKSOURCE_PLLI2S;
00695     rcc_ex_clk_init_struct.PLLI2S.PLLI2SN = 344;
00696     rcc_ex_clk_init_struct.PLLI2S.PLLI2SQ = 7;
00697     rcc_ex_clk_init_struct.PLLI2SDivQ = 1;
00698
00699     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00700   }
00701 }
00702
00703 /*******************************************************************************
00704                             Static Functions
00705 *******************************************************************************/
00706
00707 /**
00708   * @brief  Initializes the output Audio Codec audio interface (SAI).
00709   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00710   * @note   The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123
00711   *         and user can update this configuration using
00712   * @retval None
00713   */
00714 static void SAIx_Out_Init(uint32_t AudioFreq)
00715 {
00716   /* Initialize the haudio_out_sai Instance parameter */
00717   haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00718
00719   /* Disable SAI peripheral to allow access to SAI internal registers */
00720   __HAL_SAI_DISABLE(&haudio_out_sai);
00721
00722   /* Configure SAI_Block_x
00723   LSBFirst: Disabled
00724   DataSize: 16 */
00725   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00726   haudio_out_sai.Init.AudioMode = SAI_MODEMASTER_TX;
00727   haudio_out_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLED;
00728   haudio_out_sai.Init.Protocol = SAI_FREE_PROTOCOL;
00729   haudio_out_sai.Init.DataSize = SAI_DATASIZE_16;
00730   haudio_out_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
00731   haudio_out_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_RISINGEDGE;
00732   haudio_out_sai.Init.Synchro = SAI_ASYNCHRONOUS;
00733   haudio_out_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLED;
00734   haudio_out_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
00735
00736   /* Configure SAI_Block_x Frame
00737   Frame Length: 64
00738   Frame active Length: 32
00739   FS Definition: Start frame + Channel Side identification
00740   FS Polarity: FS active Low
00741   FS Offset: FS asserted one bit before the first bit of slot 0 */
00742   haudio_out_sai.FrameInit.FrameLength = 64;
00743   haudio_out_sai.FrameInit.ActiveFrameLength = 32;
00744   haudio_out_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
00745   haudio_out_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
00746   haudio_out_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
00747
00748   /* Configure SAI Block_x Slot
00749   Slot First Bit Offset: 0
00750   Slot Size  : 16
00751   Slot Number: 4
00752   Slot Active: All slot actives */
00753   haudio_out_sai.SlotInit.FirstBitOffset = 0;
00754   haudio_out_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
00755   haudio_out_sai.SlotInit.SlotNumber = 4;
00756   haudio_out_sai.SlotInit.SlotActive = CODEC_AUDIOFRAME_SLOT_0123;
00757
00758   HAL_SAI_Init(&haudio_out_sai);
00759
00760   /* Enable SAI peripheral to generate MCLK */
00761   __HAL_SAI_ENABLE(&haudio_out_sai);
00762 }
00763
00764
00765
00766 /**
00767   * @brief  Deinitializes the output Audio Codec audio interface (SAI).
00768   * @retval None
00769   */
00770 static void SAIx_Out_DeInit(void)
00771 {
00772   /* Initialize the haudio_out_sai Instance parameter */
00773   haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00774
00775   /* Disable SAI peripheral */
00776   __HAL_SAI_DISABLE(&haudio_out_sai);
00777
00778   HAL_SAI_DeInit(&haudio_out_sai);
00779 }
00780
00781 /**
00782   * @}
00783   */
00784
00785 /** @defgroup STM32746G_DISCOVERY_AUDIO_Out_Private_Functions STM32746G_DISCOVERY_AUDIO Out Private Functions
00786   * @{
00787   */
00788
00789 /**
00790   * @brief  Initializes wave recording.
00791   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00792   * @param  BitRes: Audio frequency to be configured.
00793   * @param  ChnlNbr: Channel number.
00794   * @retval AUDIO_OK if correct communication, else wrong communication
00795   */
00796 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00797 {
00798   return BSP_AUDIO_IN_InitEx(INPUT_DEVICE_DIGITAL_MICROPHONE_2, AudioFreq, BitRes, ChnlNbr);
00799 }
00800
00801 /**
00802   * @brief  Initializes wave recording.
00803   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MICROPHONE_2 or INPUT_DEVICE_INPUT_LINE_1
00804   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00805   * @param  BitRes: Audio frequency to be configured.
00806   * @param  ChnlNbr: Channel number.
00807   * @retval AUDIO_OK if correct communication, else wrong communication
00808   */
00809 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00810 {
00811   uint8_t ret = AUDIO_ERROR;
00812   uint32_t deviceid = 0x00;
00813   uint32_t slot_active;
00814
00815   if ((InputDevice != INPUT_DEVICE_INPUT_LINE_1) &&       /* Only INPUT_LINE_1 and MICROPHONE_2 inputs supported */
00816       (InputDevice != INPUT_DEVICE_DIGITAL_MICROPHONE_2))
00817   {
00818     ret = AUDIO_ERROR;
00819   }
00820   else
00821   {
00822     /* Disable SAI */
00823     SAIx_In_DeInit();
00824
00825     /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00826     BSP_AUDIO_OUT_ClockConfig(&haudio_in_sai, AudioFreq, NULL); /* Clock config is shared between AUDIO IN and OUT */
00827
00828     /* SAI data transfer preparation:
00829     Prepare the Media to be used for the audio transfer from SAI peripheral to memory */
00830     haudio_in_sai.Instance = AUDIO_IN_SAIx;
00831     if(HAL_SAI_GetState(&haudio_in_sai) == HAL_SAI_STATE_RESET)
00832     {
00833       /* Init the SAI MSP: this __weak function can be redefined by the application*/
00834       BSP_AUDIO_OUT_MspInit(&haudio_in_sai, NULL);  /* Initialize GPIOs for SAI2 block A Master signals */
00835       BSP_AUDIO_IN_MspInit(&haudio_in_sai, NULL);
00836     }
00837
00838     /* Configure SAI in master RX mode :
00839      *   - SAI2_block_A in master RX mode
00840      *   - SAI2_block_B in slave RX mode synchronous from SAI2_block_A
00841      */
00842     if (InputDevice == INPUT_DEVICE_DIGITAL_MICROPHONE_2)
00843     {
00844       slot_active = CODEC_AUDIOFRAME_SLOT_13;
00845     }
00846     else
00847     {
00848       slot_active = CODEC_AUDIOFRAME_SLOT_02;
00849     }
00850     SAIx_In_Init(SAI_MODEMASTER_RX, slot_active, AudioFreq);
00851
00852     /* wm8994 codec initialization */
00853     deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00854
00855     if((deviceid) == WM8994_ID)
00856     {
00857       /* Reset the Codec Registers */
00858       wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00859       /* Initialize the audio driver structure */
00860       audio_drv = &wm8994_drv;
00861       ret = AUDIO_OK;
00862     }
00863     else
00864     {
00865       ret = AUDIO_ERROR;
00866     }
00867
00868     if(ret == AUDIO_OK)
00869     {
00870       /* Initialize the codec internal registers */
00871       audio_drv->Init(AUDIO_I2C_ADDRESS, InputDevice, 100, AudioFreq);
00872     }
00873   }
00874   return ret;
00875 }
00876
00877 /**
00878   * @brief  Initializes wave recording and playback in parallel.
00879   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MICROPHONE_2
00880   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00881   *                       or OUTPUT_DEVICE_BOTH.
00882   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00883   * @param  BitRes: Audio frequency to be configured.
00884   * @param  ChnlNbr: Channel number.
00885   * @retval AUDIO_OK if correct communication, else wrong communication
00886   */
00887 uint8_t BSP_AUDIO_IN_OUT_Init(uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00888 {
00889   uint8_t ret = AUDIO_ERROR;
00890   uint32_t deviceid = 0x00;
00891   uint32_t slot_active;
00892
00893   if (InputDevice != INPUT_DEVICE_DIGITAL_MICROPHONE_2)  /* Only MICROPHONE_2 input supported */
00894   {
00895     ret = AUDIO_ERROR;
00896   }
00897   else
00898   {
00899     /* Disable SAI */
00900     SAIx_In_DeInit();
00901     SAIx_Out_DeInit();
00902
00903     /* PLL clock is set depending on the AudioFreq (44.1khz vs 48khz groups) */
00904     BSP_AUDIO_OUT_ClockConfig(&haudio_in_sai, AudioFreq, NULL); /* Clock config is shared between AUDIO IN and OUT */
00905
00906     /* SAI data transfer preparation:
00907     Prepare the Media to be used for the audio transfer from SAI peripheral to memory */
00908     haudio_in_sai.Instance = AUDIO_IN_SAIx;
00909     if(HAL_SAI_GetState(&haudio_in_sai) == HAL_SAI_STATE_RESET)
00910     {
00911       /* Init the SAI MSP: this __weak function can be redefined by the application*/
00912       BSP_AUDIO_IN_MspInit(&haudio_in_sai, NULL);
00913     }
00914
00915     /* SAI data transfer preparation:
00916     Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00917     haudio_out_sai.Instance = AUDIO_OUT_SAIx;
00918     if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00919     {
00920       /* Init the SAI MSP: this __weak function can be redefined by the application*/
00921       BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00922     }
00923
00924     /* Configure SAI in master mode :
00925      *   - SAI2_block_A in master TX mode
00926      *   - SAI2_block_B in slave RX mode synchronous from SAI2_block_A
00927      */
00928     if (InputDevice == INPUT_DEVICE_DIGITAL_MICROPHONE_2)
00929     {
00930       slot_active = CODEC_AUDIOFRAME_SLOT_13;
00931     }
00932     else
00933     {
00934       slot_active = CODEC_AUDIOFRAME_SLOT_02;
00935     }
00936     SAIx_In_Init(SAI_MODEMASTER_TX, slot_active, AudioFreq);
00937
00938     /* wm8994 codec initialization */
00939     deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00940
00941     if((deviceid) == WM8994_ID)
00942     {
00943       /* Reset the Codec Registers */
00944       wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00945       /* Initialize the audio driver structure */
00946       audio_drv = &wm8994_drv;
00947       ret = AUDIO_OK;
00948     }
00949     else
00950     {
00951       ret = AUDIO_ERROR;
00952     }
00953
00954     if(ret == AUDIO_OK)
00955     {
00956       /* Initialize the codec internal registers */
00957       audio_drv->Init(AUDIO_I2C_ADDRESS, InputDevice | OutputDevice, 100, AudioFreq);
00958     }
00959   }
00960   return ret;
00961 }
00962
00963
00964 /**
00965   * @brief  Starts audio recording.
00966   * @param  pbuf: Main buffer pointer for the recorded data storing
00967   * @param  size: size of the recorded buffer in number of elements (typically number of half-words)
00968   *               Be careful that it is not the same unit than BSP_AUDIO_OUT_Play function
00969   * @retval AUDIO_OK if correct communication, else wrong communication
00970   */
00971 uint8_t  BSP_AUDIO_IN_Record(uint16_t* pbuf, uint32_t size)
00972 {
00973   uint32_t ret = AUDIO_ERROR;
00974
00975   /* Start the process receive DMA */
00976   HAL_SAI_Receive_DMA(&haudio_in_sai, (uint8_t*)pbuf, size);
00977
00978   /* Return AUDIO_OK when all operations are correctly done */
00979   ret = AUDIO_OK;
00980
00981   return ret;
00982 }
00983
00984 /**
00985   * @brief  Stops audio recording.
00986   * @param  Option: could be one of the following parameters
00987   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00988   *                            Then no need to reconfigure the Codec after power on.
00989   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00990   *                            Then need to reconfigure the Codec after power on.
00991   * @retval AUDIO_OK if correct communication, else wrong communication
00992   */
00993 uint8_t BSP_AUDIO_IN_Stop(uint32_t Option)
00994 {
00995   /* Call the Media layer stop function */
00996   HAL_SAI_DMAStop(&haudio_in_sai);
00997
00998   /* Call Audio Codec Stop function */
00999   if(audio_drv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
01000   {
01001     return AUDIO_ERROR;
01002   }
01003   else
01004   {
01005     if(Option == CODEC_PDWN_HW)
01006     {
01007       /* Wait at least 100us */
01008       HAL_Delay(1);
01009     }
01010     /* Return AUDIO_OK when all operations are correctly done */
01011     return AUDIO_OK;
01012   }
01013 }
01014
01015 /**
01016   * @brief  Pauses the audio file stream.
01017   * @retval AUDIO_OK if correct communication, else wrong communication
01018   */
01019 uint8_t BSP_AUDIO_IN_Pause(void)
01020 {
01021   /* Call the Media layer pause function */
01022   HAL_SAI_DMAPause(&haudio_in_sai);
01023   /* Return AUDIO_OK when all operations are correctly done */
01024   return AUDIO_OK;
01025 }
01026
01027 /**
01028   * @brief  Resumes the audio file stream.
01029   * @retval AUDIO_OK if correct communication, else wrong communication
01030   */
01031 uint8_t BSP_AUDIO_IN_Resume(void)
01032 {
01033   /* Call the Media layer pause/resume function */
01034   HAL_SAI_DMAResume(&haudio_in_sai);
01035   /* Return AUDIO_OK when all operations are correctly done */
01036   return AUDIO_OK;
01037 }
01038
01039 /**
01040   * @brief  Controls the audio in volume level.
01041   * @param  Volume: Volume level in range 0(Mute)..80(+0dB)..100(+17.625dB)
01042   * @retval AUDIO_OK if correct communication, else wrong communication
01043   */
01044 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume)
01045 {
01046   /* Call the codec volume control function with converted volume value */
01047   if(audio_drv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
01048   {
01049     return AUDIO_ERROR;
01050   }
01051   else
01052   {
01053     /* Set the Global variable AudioInVolume  */
01054     AudioInVolume = Volume;
01055     /* Return AUDIO_OK when all operations are correctly done */
01056     return AUDIO_OK;
01057   }
01058 }
01059
01060 /**
01061   * @brief  Deinit the audio IN peripherals.
01062   * @retval None
01063   */
01064 void BSP_AUDIO_IN_DeInit(void)
01065 {
01066   SAIx_In_DeInit();
01067   /* DeInit the SAI MSP : this __weak function can be rewritten by the application */
01068   BSP_AUDIO_IN_MspDeInit(&haudio_in_sai, NULL);
01069 }
01070
01071  /**
01072   * @brief  Rx Transfer completed callbacks.
01073   * @param  hsai: SAI handle
01074   * @retval None
01075   */
01076 void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
01077 {
01078   /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
01079   BSP_AUDIO_IN_TransferComplete_CallBack();
01080 }
01081
01082 /**
01083   * @brief  Rx Half Transfer completed callbacks.
01084   * @param  hsai: SAI handle
01085   * @retval None
01086   */
01087 void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
01088 {
01089   /* Manage the remaining file size and new address offset: This function
01090      should be coded by user (its prototype is already declared in stm32746g_discovery_audio.h) */
01091   BSP_AUDIO_IN_HalfTransfer_CallBack();
01092 }
01093
01094 /**
01095   * @brief  User callback when record buffer is filled.
01096   * @retval None
01097   */
01098 __weak void BSP_AUDIO_IN_TransferComplete_CallBack(void)
01099 {
01100   /* This function should be implemented by the user application.
01101      It is called into this driver when the current buffer is filled
01102      to prepare the next buffer pointer and its size. */
01103 }
01104
01105 /**
01106   * @brief  Manages the DMA Half Transfer complete event.
01107   * @retval None
01108   */
01109 __weak void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
01110 {
01111   /* This function should be implemented by the user application.
01112      It is called into this driver when the current buffer is filled
01113      to prepare the next buffer pointer and its size. */
01114 }
01115
01116 /**
01117   * @brief  Audio IN Error callback function.
01118   * @retval None
01119   */
01120 __weak void BSP_AUDIO_IN_Error_CallBack(void)
01121 {
01122   /* This function is called when an Interrupt due to transfer error on or peripheral
01123      error occurs. */
01124 }
01125
01126 /**
01127   * @brief  Initializes BSP_AUDIO_IN MSP.
01128   * @param  hsai: SAI handle
01129   * @param  Params
01130   * @retval None
01131   */
01132 __weak void BSP_AUDIO_IN_MspInit(SAI_HandleTypeDef *hsai, void *Params)
01133 {
01134   static DMA_HandleTypeDef hdma_sai_rx;
01135   GPIO_InitTypeDef  gpio_init_structure;
01136
01137   /* Enable SAI clock */
01138   AUDIO_IN_SAIx_CLK_ENABLE();
01139
01140   /* Enable SD GPIO clock */
01141   AUDIO_IN_SAIx_SD_ENABLE();
01142   /* CODEC_SAI pin configuration: SD pin */
01143   gpio_init_structure.Pin = AUDIO_IN_SAIx_SD_PIN;
01144   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01145   gpio_init_structure.Pull = GPIO_NOPULL;
01146   gpio_init_structure.Speed = GPIO_SPEED_FAST;
01147   gpio_init_structure.Alternate = AUDIO_IN_SAIx_SD_AF;
01148   HAL_GPIO_Init(AUDIO_IN_SAIx_SD_GPIO_PORT, &gpio_init_structure);
01149
01150   /* Enable Audio INT GPIO clock */
01151   AUDIO_IN_INT_GPIO_ENABLE();
01152   /* Audio INT pin configuration: input */
01153   gpio_init_structure.Pin = AUDIO_IN_INT_GPIO_PIN;
01154   gpio_init_structure.Mode = GPIO_MODE_INPUT;
01155   gpio_init_structure.Pull = GPIO_NOPULL;
01156   gpio_init_structure.Speed = GPIO_SPEED_FAST;
01157   HAL_GPIO_Init(AUDIO_IN_INT_GPIO_PORT, &gpio_init_structure);
01158
01159   /* Enable the DMA clock */
01160   AUDIO_IN_SAIx_DMAx_CLK_ENABLE();
01161
01162   if(hsai->Instance == AUDIO_IN_SAIx)
01163   {
01164     /* Configure the hdma_sai_rx handle parameters */
01165     hdma_sai_rx.Init.Channel             = AUDIO_IN_SAIx_DMAx_CHANNEL;
01166     hdma_sai_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01167     hdma_sai_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01168     hdma_sai_rx.Init.MemInc              = DMA_MINC_ENABLE;
01169     hdma_sai_rx.Init.PeriphDataAlignment = AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE;
01170     hdma_sai_rx.Init.MemDataAlignment    = AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE;
01171     hdma_sai_rx.Init.Mode                = DMA_CIRCULAR;
01172     hdma_sai_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01173     hdma_sai_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01174     hdma_sai_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01175     hdma_sai_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01176     hdma_sai_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01177
01178     hdma_sai_rx.Instance = AUDIO_IN_SAIx_DMAx_STREAM;
01179
01180     /* Associate the DMA handle */
01181     __HAL_LINKDMA(hsai, hdmarx, hdma_sai_rx);
01182
01183     /* Deinitialize the Stream for new transfer */
01184     HAL_DMA_DeInit(&hdma_sai_rx);
01185
01186     /* Configure the DMA Stream */
01187     HAL_DMA_Init(&hdma_sai_rx);
01188   }
01189
01190   /* SAI DMA IRQ Channel configuration */
01191   HAL_NVIC_SetPriority(AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01192   HAL_NVIC_EnableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01193
01194   /* Audio INT IRQ Channel configuration */
01195   HAL_NVIC_SetPriority(AUDIO_IN_INT_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01196   HAL_NVIC_EnableIRQ(AUDIO_IN_INT_IRQ);
01197 }
01198
01199 /**
01200   * @brief  DeInitializes BSP_AUDIO_IN MSP.
01201   * @param  hsai: SAI handle
01202   * @param  Params
01203   * @retval None
01204   */
01205 __weak void BSP_AUDIO_IN_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
01206 {
01207   GPIO_InitTypeDef  gpio_init_structure;
01208
01209   static DMA_HandleTypeDef hdma_sai_rx;
01210
01211   /* SAI IN DMA IRQ Channel deactivation */
01212   HAL_NVIC_DisableIRQ(AUDIO_IN_SAIx_DMAx_IRQ);
01213
01214   if(hsai->Instance == AUDIO_IN_SAIx)
01215   {
01216     /* Deinitialize the Stream for new transfer */
01217     HAL_DMA_DeInit(&hdma_sai_rx);
01218   }
01219
01220  /* Disable SAI block */
01221   __HAL_SAI_DISABLE(hsai);
01222
01223   /* Disable pin: SD pin */
01224   gpio_init_structure.Pin = AUDIO_IN_SAIx_SD_PIN;
01225   HAL_GPIO_DeInit(AUDIO_IN_SAIx_SD_GPIO_PORT, gpio_init_structure.Pin);
01226
01227   /* Disable SAI clock */
01228   AUDIO_IN_SAIx_CLK_DISABLE();
01229
01230   /* GPIO pins clock and DMA clock can be shut down in the application
01231      by surcharging this __weak function */
01232 }
01233
01234
01235 /*******************************************************************************
01236                             Static Functions
01237 *******************************************************************************/
01238
01239 /**
01240   * @brief  Initializes the input Audio Codec audio interface (SAI).
01241   * @param  SaiOutMode: SAI_MODEMASTER_TX (for record and playback in parallel)
01242   *                     or SAI_MODEMASTER_RX (for record only).
01243   * @param  SlotActive: CODEC_AUDIOFRAME_SLOT_02 or CODEC_AUDIOFRAME_SLOT_13
01244   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
01245   * @retval None
01246   */
01247 static void SAIx_In_Init(uint32_t SaiOutMode, uint32_t SlotActive, uint32_t AudioFreq)
01248 {
01249   /* Initialize SAI2 block A in MASTER RX */
01250   /* Initialize the haudio_out_sai Instance parameter */
01251   haudio_out_sai.Instance = AUDIO_OUT_SAIx;
01252
01253   /* Disable SAI peripheral to allow access to SAI internal registers */
01254   __HAL_SAI_DISABLE(&haudio_out_sai);
01255
01256   /* Configure SAI_Block_x
01257   LSBFirst: Disabled
01258   DataSize: 16 */
01259   haudio_out_sai.Init.AudioFrequency = AudioFreq;
01260   haudio_out_sai.Init.AudioMode = SaiOutMode;
01261   haudio_out_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLED;
01262   haudio_out_sai.Init.Protocol = SAI_FREE_PROTOCOL;
01263   haudio_out_sai.Init.DataSize = SAI_DATASIZE_16;
01264   haudio_out_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
01265   haudio_out_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_RISINGEDGE;
01266   haudio_out_sai.Init.Synchro = SAI_ASYNCHRONOUS;
01267   haudio_out_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLED;
01268   haudio_out_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
01269
01270   /* Configure SAI_Block_x Frame
01271   Frame Length: 64
01272   Frame active Length: 32
01273   FS Definition: Start frame + Channel Side identification
01274   FS Polarity: FS active Low
01275   FS Offset: FS asserted one bit before the first bit of slot 0 */
01276   haudio_out_sai.FrameInit.FrameLength = 64;
01277   haudio_out_sai.FrameInit.ActiveFrameLength = 32;
01278   haudio_out_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
01279   haudio_out_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
01280   haudio_out_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
01281
01282   /* Configure SAI Block_x Slot
01283   Slot First Bit Offset: 0
01284   Slot Size  : 16
01285   Slot Number: 4
01286   Slot Active: All slot actives */
01287   haudio_out_sai.SlotInit.FirstBitOffset = 0;
01288   haudio_out_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
01289   haudio_out_sai.SlotInit.SlotNumber = 4;
01290   haudio_out_sai.SlotInit.SlotActive = SlotActive;
01291
01292   HAL_SAI_Init(&haudio_out_sai);
01293
01294   /* Initialize SAI2 block B in SLAVE RX synchronous from SAI2 block A */
01295   /* Initialize the haudio_in_sai Instance parameter */
01296   haudio_in_sai.Instance = AUDIO_IN_SAIx;
01297
01298   /* Disable SAI peripheral to allow access to SAI internal registers */
01299   __HAL_SAI_DISABLE(&haudio_in_sai);
01300
01301   /* Configure SAI_Block_x
01302   LSBFirst: Disabled
01303   DataSize: 16 */
01304   haudio_in_sai.Init.AudioFrequency = AudioFreq;
01305   haudio_in_sai.Init.AudioMode = SAI_MODESLAVE_RX;
01306   haudio_in_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLED;
01307   haudio_in_sai.Init.Protocol = SAI_FREE_PROTOCOL;
01308   haudio_in_sai.Init.DataSize = SAI_DATASIZE_16;
01309   haudio_in_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
01310   haudio_in_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_RISINGEDGE;
01311   haudio_in_sai.Init.Synchro = SAI_SYNCHRONOUS;
01312   haudio_in_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLED;
01313   haudio_in_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
01314
01315   /* Configure SAI_Block_x Frame
01316   Frame Length: 64
01317   Frame active Length: 32
01318   FS Definition: Start frame + Channel Side identification
01319   FS Polarity: FS active Low
01320   FS Offset: FS asserted one bit before the first bit of slot 0 */
01321   haudio_in_sai.FrameInit.FrameLength = 64;
01322   haudio_in_sai.FrameInit.ActiveFrameLength = 32;
01323   haudio_in_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
01324   haudio_in_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
01325   haudio_in_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
01326
01327   /* Configure SAI Block_x Slot
01328   Slot First Bit Offset: 0
01329   Slot Size  : 16
01330   Slot Number: 4
01331   Slot Active: All slot active */
01332   haudio_in_sai.SlotInit.FirstBitOffset = 0;
01333   haudio_in_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
01334   haudio_in_sai.SlotInit.SlotNumber = 4;
01335   haudio_in_sai.SlotInit.SlotActive = SlotActive;
01336
01337   HAL_SAI_Init(&haudio_in_sai);
01338
01339   /* Enable SAI peripheral to generate MCLK */
01340   __HAL_SAI_ENABLE(&haudio_out_sai);
01341
01342   /* Enable SAI peripheral */
01343   __HAL_SAI_ENABLE(&haudio_in_sai);
01344 }
01345
01346
01347
01348 /**
01349   * @brief  Deinitializes the output Audio Codec audio interface (SAI).
01350   * @retval None
01351   */
01352 static void SAIx_In_DeInit(void)
01353 {
01354   /* Initialize the haudio_in_sai Instance parameter */
01355   haudio_in_sai.Instance = AUDIO_IN_SAIx;
01356
01357   /* Disable SAI peripheral */
01358   __HAL_SAI_DISABLE(&haudio_in_sai);
01359
01360   HAL_SAI_DeInit(&haudio_in_sai);
01361 }
01362
01363
01364 /**
01365   * @}
01366   */
01367
01368 /**
01369   * @}
01370   */
01371
01372 /**
01373   * @}
01374   */
01375
01376 /**
01377   * @}
01378   */
01379
01380 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_audio.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_audio.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_audio.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_AUDIO_H
00039 #define __STM32746G_DISCOVERY_AUDIO_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include audio component Driver */
00047 #include "../Components/wm8994/wm8994.h"
00048 #include "stm32746g_discovery.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32746G_DISCOVERY
00055   * @{
00056   */
00057
00058 /** @defgroup STM32746G_DISCOVERY_AUDIO STM32746G_DISCOVERY_AUDIO
00059   * @{
00060   */
00061
00062 /** @defgroup STM32746G_DISCOVERY_AUDIO_Exported_Types STM32746G_DISCOVERY_AUDIO Exported Types
00063   * @{
00064   */
00065 /**
00066   * @}
00067   */
00068
00069 /** @defgroup STM32746G_DISCOVERY_AUDIO_Exported_Constants STM32746G_DISCOVERY_AUDIO Exported Constants
00070   * @{
00071   */
00072
00073 /*------------------------------------------------------------------------------
00074                           USER SAI defines parameters
00075  -----------------------------------------------------------------------------*/
00076 /*  CODEC_AudioFrame_SLOT_TDMMode
00077    In W8994 codec the Audio frame contains 4 slots : TDM Mode
00078    TDM format :
00079    +------------------|------------------|--------------------|-------------------+
00080    | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right  | CODEC_SLOT1 Right |
00081    +------------------------------------------------------------------------------+
00082   */
00083 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */
00084 #define CODEC_AUDIOFRAME_SLOT_0123           SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
00085 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */
00086 #define CODEC_AUDIOFRAME_SLOT_02             SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
00087 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */
00088 #define CODEC_AUDIOFRAME_SLOT_13             SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
00089
00090 /* SAI OUT peripheral configuration defines */
00091 #define AUDIO_OUT_SAIx                           SAI2_Block_A
00092 #define AUDIO_OUT_SAIx_CLK_ENABLE()              __HAL_RCC_SAI2_CLK_ENABLE()
00093 #define AUDIO_OUT_SAIx_CLK_DISABLE()             __HAL_RCC_SAI2_CLK_DISABLE()
00094 #define AUDIO_OUT_SAIx_SCK_AF                    GPIO_AF10_SAI2
00095 #define AUDIO_OUT_SAIx_FS_SD_MCLK_AF             GPIO_AF10_SAI2
00096
00097 #define AUDIO_OUT_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOI_CLK_ENABLE()
00098 #define AUDIO_OUT_SAIx_MCLK_GPIO_PORT            GPIOI
00099 #define AUDIO_OUT_SAIx_MCLK_PIN                  GPIO_PIN_4
00100 #define AUDIO_OUT_SAIx_SCK_SD_ENABLE()           __HAL_RCC_GPIOI_CLK_ENABLE()
00101 #define AUDIO_OUT_SAIx_SCK_SD_GPIO_PORT          GPIOI
00102 #define AUDIO_OUT_SAIx_SCK_PIN                   GPIO_PIN_5
00103 #define AUDIO_OUT_SAIx_SD_PIN                    GPIO_PIN_6
00104 #define AUDIO_OUT_SAIx_FS_ENABLE()               __HAL_RCC_GPIOI_CLK_ENABLE()
00105 #define AUDIO_OUT_SAIx_FS_GPIO_PORT              GPIOI
00106 #define AUDIO_OUT_SAIx_FS_PIN                    GPIO_PIN_7
00107
00108 /* SAI DMA Stream definitions */
00109 #define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00110 #define AUDIO_OUT_SAIx_DMAx_STREAM               DMA2_Stream4
00111 #define AUDIO_OUT_SAIx_DMAx_CHANNEL              DMA_CHANNEL_3
00112 #define AUDIO_OUT_SAIx_DMAx_IRQ                  DMA2_Stream4_IRQn
00113 #define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00114 #define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00115 #define DMA_MAX_SZE                              ((uint16_t)0xFFFF)
00116
00117 #define AUDIO_OUT_SAIx_DMAx_IRQHandler           DMA2_Stream4_IRQHandler
00118
00119 /* Select the interrupt preemption priority for the DMA interrupt */
00120 #define AUDIO_OUT_IRQ_PREPRIO                    ((uint32_t)0x0E)   /* Select the preemption priority level(0 is the highest) */
00121
00122 /*------------------------------------------------------------------------------
00123                         AUDIO IN CONFIGURATION
00124 ------------------------------------------------------------------------------*/
00125 /* SAI IN peripheral configuration defines */
00126 #define AUDIO_IN_SAIx                            SAI2_Block_B
00127 #define AUDIO_IN_SAIx_CLK_ENABLE()               __HAL_RCC_SAI2_CLK_ENABLE()
00128 #define AUDIO_IN_SAIx_CLK_DISABLE()              __HAL_RCC_SAI2_CLK_DISABLE()
00129 #define AUDIO_IN_SAIx_SD_AF                      GPIO_AF10_SAI2
00130
00131 #define AUDIO_IN_SAIx_SD_ENABLE()                __HAL_RCC_GPIOG_CLK_ENABLE()
00132 #define AUDIO_IN_SAIx_SD_GPIO_PORT               GPIOG
00133 #define AUDIO_IN_SAIx_SD_PIN                     GPIO_PIN_10
00134
00135 #define AUDIO_IN_INT_GPIO_ENABLE()               __HAL_RCC_GPIOH_CLK_ENABLE()
00136 #define AUDIO_IN_INT_GPIO_PORT                   GPIOH
00137 #define AUDIO_IN_INT_GPIO_PIN                    GPIO_PIN_15
00138 #define AUDIO_IN_INT_IRQ                         EXTI15_10_IRQn
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_Stream7
00143 #define AUDIO_IN_SAIx_DMAx_CHANNEL               DMA_CHANNEL_0
00144 #define AUDIO_IN_SAIx_DMAx_IRQ                   DMA2_Stream7_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_Stream7_IRQHandler
00149 #define AUDIO_IN_INT_IRQHandler                  EXTI15_10_IRQHandler
00150
00151 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
00152 #define AUDIO_IN_IRQ_PREPRIO                     ((uint32_t)0x0F)   /* Select the preemption priority level(0 is the highest) */
00153
00154 /*------------------------------------------------------------------------------
00155              CONFIGURATION: Audio Driver Configuration parameters
00156 ------------------------------------------------------------------------------*/
00157
00158 #define AUDIODATA_SIZE                      ((uint16_t)2)   /* 16-bits audio data size */
00159
00160 /* Audio status definition */
00161 #define AUDIO_OK                            ((uint8_t)0)
00162 #define AUDIO_ERROR                         ((uint8_t)1)
00163 #define AUDIO_TIMEOUT                       ((uint8_t)2)
00164
00165 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
00166 #define DEFAULT_AUDIO_IN_FREQ               I2S_AUDIOFREQ_16K
00167 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     ((uint8_t)16)
00168 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        ((uint8_t)2) /* Mono = 1, Stereo = 2 */
00169 #define DEFAULT_AUDIO_IN_VOLUME             ((uint16_t)64)
00170
00171 /*------------------------------------------------------------------------------
00172                     OPTIONAL Configuration defines parameters
00173 ------------------------------------------------------------------------------*/
00174
00175 /* Delay for the Codec to be correctly reset */
00176 #define CODEC_RESET_DELAY                   ((uint8_t)5)
00177
00178
00179 /*------------------------------------------------------------------------------
00180                             OUTPUT DEVICES definition
00181 ------------------------------------------------------------------------------*/
00182 /* Alias on existing output devices to adapt for 2 headphones output */
00183 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
00184 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
00185
00186 /**
00187   * @}
00188   */
00189
00190 /** @defgroup STM32746G_DISCOVERY_AUDIO_Exported_Variables STM32746G_DISCOVERY_AUDIO Exported Variables
00191   * @{
00192   */
00193 extern __IO uint16_t AudioInVolume;
00194  /**
00195   * @}
00196   */
00197
00198 /** @defgroup STM32746G_DISCOVERY_AUDIO_Exported_Macros STM32746G_DISCOVERY_AUDIO Exported Macros
00199   * @{
00200   */
00201 #define DMA_MAX(x)           (((x) <= DMA_MAX_SZE)? (x):DMA_MAX_SZE)
00202 /**
00203   * @}
00204   */
00205
00206 /** @addtogroup STM32746G_DISCOVERY_AUDIO_OUT_Exported_Functions
00207   * @{
00208   */
00209 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00210 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size);
00211 void    BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00212 uint8_t BSP_AUDIO_OUT_Pause(void);
00213 uint8_t BSP_AUDIO_OUT_Resume(void);
00214 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00215 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00216 void    BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00217 void    BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot);
00218 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00219 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00220 void    BSP_AUDIO_OUT_DeInit(void);
00221
00222 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00223 /* This function is called when the requested data has been completely transferred.*/
00224 void    BSP_AUDIO_OUT_TransferComplete_CallBack(void);
00225
00226 /* This function is called when half of the requested buffer has been transferred. */
00227 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(void);
00228
00229 /* This function is called when an Interrupt due to transfer error on or peripheral
00230    error occurs. */
00231 void    BSP_AUDIO_OUT_Error_CallBack(void);
00232
00233 /* These function can be modified in case the current settings (e.g. DMA stream)
00234    need to be changed for specific application needs */
00235 void  BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params);
00236 void  BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00237 void  BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00238
00239 /**
00240   * @}
00241   */
00242
00243 /** @defgroup STM32746G_DISCOVERY_AUDIO_IN_Exported_Functions STM32746G_DISCOVERY_AUDIO_IN Exported Functions
00244   * @{
00245   */
00246 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00247 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00248 uint8_t BSP_AUDIO_IN_OUT_Init(uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00249 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
00250 uint8_t BSP_AUDIO_IN_Stop(uint32_t Option);
00251 uint8_t BSP_AUDIO_IN_Pause(void);
00252 uint8_t BSP_AUDIO_IN_Resume(void);
00253 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume);
00254 void    BSP_AUDIO_IN_DeInit(void);
00255 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00256 /* This function should be implemented by the user application.
00257    It is called into this driver when the current buffer is filled to prepare the next
00258    buffer pointer and its size. */
00259 void    BSP_AUDIO_IN_TransferComplete_CallBack(void);
00260 void    BSP_AUDIO_IN_HalfTransfer_CallBack(void);
00261
00262 /* This function is called when an Interrupt due to transfer error on or peripheral
00263    error occurs. */
00264 void    BSP_AUDIO_IN_Error_CallBack(void);
00265
00266 /* These function can be modified in case the current settings (e.g. DMA stream)
00267    need to be changed for specific application needs */
00268 void  BSP_AUDIO_IN_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00269 void  BSP_AUDIO_IN_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00270
00271 /**
00272   * @}
00273   */
00274
00275 /**
00276   * @}
00277   */
00278
00279 /**
00280   * @}
00281   */
00282
00283 /**
00284   * @}
00285   */
00286
00287 #ifdef __cplusplus
00288 }
00289 #endif
00290
00291 #endif /* __STM32746G_DISCOVERY_AUDIO_H */
00292
00293 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_camera.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_camera.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_camera.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Camera modules mounted on
00006   *          STM32746G-Discovery board.
00007   @verbatim
00008     How to use this driver:
00009     ------------------------
00010      - This driver is used to drive the camera.
00011      - The OV9655 component driver MUST be included with this driver.
00012
00013     Driver description:
00014     -------------------
00015     + Initialization steps:
00016        o Initialize the camera using the BSP_CAMERA_Init() function.
00017        o Start the camera capture/snapshot using the CAMERA_Start() function.
00018        o Suspend, resume or stop the camera capture using the following functions:
00019         - BSP_CAMERA_Suspend()
00020         - BSP_CAMERA_Resume()
00021         - BSP_CAMERA_Stop()
00022
00023     + Options
00024        o Increase or decrease on the fly the brightness and/or contrast
00025          using the following function:
00026          - BSP_CAMERA_ContrastBrightnessConfig
00027        o Add a special effect on the fly using the following functions:
00028          - BSP_CAMERA_BlackWhiteConfig()
00029          - BSP_CAMERA_ColorEffectConfig()
00030   @endverbatim
00031   ******************************************************************************
00032   * @attention
00033   *
00034   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00035   *
00036   * Redistribution and use in source and binary forms, with or without modification,
00037   * are permitted provided that the following conditions are met:
00038   *   1. Redistributions of source code must retain the above copyright notice,
00039   *      this list of conditions and the following disclaimer.
00040   *   2. Redistributions in binary form must reproduce the above copyright notice,
00041   *      this list of conditions and the following disclaimer in the documentation
00042   *      and/or other materials provided with the distribution.
00043   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00044   *      may be used to endorse or promote products derived from this software
00045   *      without specific prior written permission.
00046   *
00047   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00048   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00049   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00050   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00051   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00052   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00053   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00054   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00055   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00056   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00057   *
00058   ******************************************************************************
00059   */
00060
00061 /* Dependencies
00062 - stm32746g_discovery.c
00063 - stm32f7xx_hal_dcmi.c
00064 - stm32f7xx_hal_dma.c
00065 - stm32f7xx_hal_gpio.c
00066 - stm32f7xx_hal_cortex.c
00067 - stm32f7xx_hal_rcc_ex.h
00068 - ov9655.c
00069 EndDependencies */
00070
00071 /* Includes ------------------------------------------------------------------*/
00072 #include "stm32746g_discovery_camera.h"
00073 #include "stm32746g_discovery.h"
00074
00075 /** @addtogroup BSP
00076   * @{
00077   */
00078
00079 /** @addtogroup STM32746G_DISCOVERY
00080   * @{
00081   */
00082
00083 /** @addtogroup STM32746G_DISCOVERY_CAMERA
00084   * @{
00085   */
00086
00087 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_TypesDefinitions STM32746G_DISCOVERY_CAMERA Private Types Definitions
00088   * @{
00089   */
00090 /**
00091   * @}
00092   */
00093
00094 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Defines STM32746G_DISCOVERY_CAMERA Private Defines
00095   * @{
00096   */
00097 #define CAMERA_VGA_RES_X          640
00098 #define CAMERA_VGA_RES_Y          480
00099 #define CAMERA_480x272_RES_X      480
00100 #define CAMERA_480x272_RES_Y      272
00101 #define CAMERA_QVGA_RES_X         320
00102 #define CAMERA_QVGA_RES_Y         240
00103 #define CAMERA_QQVGA_RES_X        160
00104 #define CAMERA_QQVGA_RES_Y        120
00105 /**
00106   * @}
00107   */
00108
00109 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Macros STM32746G_DISCOVERY_CAMERA Private Macros
00110   * @{
00111   */
00112 /**
00113   * @}
00114   */
00115
00116 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_Variables STM32746G_DISCOVERY_CAMERA Private Variables
00117   * @{
00118   */
00119 DCMI_HandleTypeDef  hDcmiHandler;
00120 CAMERA_DrvTypeDef   *camera_drv;
00121 /* Camera current resolution naming (QQVGA, VGA, ...) */
00122 static uint32_t CameraCurrentResolution;
00123
00124 /* Camera module I2C HW address */
00125 static uint32_t CameraHwAddress;
00126 /**
00127   * @}
00128   */
00129
00130 /** @defgroup STM32746G_DISCOVERY_CAMERA_Private_FunctionPrototypes STM32746G_DISCOVERY_CAMERA Private Function Prototypes
00131   * @{
00132   */
00133 static uint32_t GetSize(uint32_t resolution);
00134 /**
00135   * @}
00136   */
00137
00138 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Functions STM32746G_DISCOVERY_CAMERA Exported Functions
00139   * @{
00140   */
00141
00142 /**
00143   * @brief  Initializes the camera.
00144   * @param  Resolution : camera sensor requested resolution (x, y) : standard resolution
00145   *         naming QQVGA, QVGA, VGA ...
00146   * @retval Camera status
00147   */
00148 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
00149 {
00150   DCMI_HandleTypeDef *phdcmi;
00151   uint8_t status = CAMERA_ERROR;
00152
00153   /* Get the DCMI handle structure */
00154   phdcmi = &hDcmiHandler;
00155
00156   /*** Configures the DCMI to interface with the camera module ***/
00157   /* DCMI configuration */
00158   phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
00159   phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_LOW;
00160   phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
00161   phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
00162   phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
00163   phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
00164   phdcmi->Instance              = DCMI;
00165
00166   /* Power up camera */
00167   BSP_CAMERA_PwrUp();
00168
00169   /* Read ID of Camera module via I2C */
00170   if(ov9655_ReadID(CAMERA_I2C_ADDRESS) == OV9655_ID)
00171   {
00172     /* Initialize the camera driver structure */
00173     camera_drv = &ov9655_drv;
00174     CameraHwAddress = CAMERA_I2C_ADDRESS;
00175
00176     /* DCMI Initialization */
00177     BSP_CAMERA_MspInit(&hDcmiHandler, NULL);
00178     HAL_DCMI_Init(phdcmi);
00179
00180     /* Camera Module Initialization via I2C to the wanted 'Resolution' */
00181     if (Resolution == CAMERA_R480x272)
00182     {     /* For 480x272 resolution, the OV9655 sensor is set to VGA resolution
00183            * as OV9655 doesn't supports 480x272 resolution,
00184            * then DCMI is configured to output a 480x272 cropped window */
00185       camera_drv->Init(CameraHwAddress, CAMERA_R640x480);
00186       HAL_DCMI_ConfigCROP(phdcmi,           /* Crop in the middle of the VGA picture */
00187                          (CAMERA_VGA_RES_X - CAMERA_480x272_RES_X)/2,
00188                          (CAMERA_VGA_RES_Y - CAMERA_480x272_RES_Y)/2,
00189                          (CAMERA_480x272_RES_X * 2) - 1,
00190                           CAMERA_480x272_RES_Y - 1);
00191       HAL_DCMI_EnableCROP(phdcmi);
00192     }
00193     else
00194     {
00195       camera_drv->Init(CameraHwAddress, Resolution);
00196       HAL_DCMI_DisableCROP(phdcmi);
00197     }
00198
00199     CameraCurrentResolution = Resolution;
00200
00201     /* Return CAMERA_OK status */
00202     status = CAMERA_OK;
00203   }
00204   else
00205   {
00206     /* Return CAMERA_NOT_SUPPORTED status */
00207     status = CAMERA_NOT_SUPPORTED;
00208   }
00209
00210   return status;
00211 }
00212
00213 /**
00214   * @brief  DeInitializes the camera.
00215   * @retval Camera status
00216   */
00217 uint8_t BSP_CAMERA_DeInit(void)
00218 {
00219   hDcmiHandler.Instance              = DCMI;
00220
00221   HAL_DCMI_DeInit(&hDcmiHandler);
00222   BSP_CAMERA_MspDeInit(&hDcmiHandler, NULL);
00223   return CAMERA_OK;
00224 }
00225
00226 /**
00227   * @brief  Starts the camera capture in continuous mode.
00228   * @param  buff: pointer to the camera output buffer
00229   * @retval None
00230   */
00231 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
00232 {
00233   /* Start the camera capture */
00234   HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
00235 }
00236
00237 /**
00238   * @brief  Starts the camera capture in snapshot mode.
00239   * @param  buff: pointer to the camera output buffer
00240   * @retval None
00241   */
00242 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
00243 {
00244   /* Start the camera capture */
00245   HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
00246 }
00247
00248 /**
00249   * @brief Suspend the CAMERA capture
00250   * @retval None
00251   */
00252 void BSP_CAMERA_Suspend(void)
00253 {
00254   /* Suspend the Camera Capture */
00255   HAL_DCMI_Suspend(&hDcmiHandler);
00256 }
00257
00258 /**
00259   * @brief Resume the CAMERA capture
00260   * @retval None
00261   */
00262 void BSP_CAMERA_Resume(void)
00263 {
00264   /* Start the Camera Capture */
00265   HAL_DCMI_Resume(&hDcmiHandler);
00266 }
00267
00268 /**
00269   * @brief  Stop the CAMERA capture
00270   * @retval Camera status
00271   */
00272 uint8_t BSP_CAMERA_Stop(void)
00273 {
00274   uint8_t status = CAMERA_ERROR;
00275
00276   if(HAL_DCMI_Stop(&hDcmiHandler) == HAL_OK)
00277   {
00278      status = CAMERA_OK;
00279   }
00280
00281   /* Set Camera in Power Down */
00282   BSP_CAMERA_PwrDown();
00283
00284   return status;
00285 }
00286
00287 /**
00288   * @brief  CANERA power up
00289   * @retval None
00290   */
00291 void BSP_CAMERA_PwrUp(void)
00292 {
00293   GPIO_InitTypeDef gpio_init_structure;
00294
00295   /* Enable GPIO clock */
00296   __HAL_RCC_GPIOH_CLK_ENABLE();
00297
00298   /*** Configure the GPIO ***/
00299   /* Configure DCMI GPIO as alternate function */
00300   gpio_init_structure.Pin       = GPIO_PIN_13;
00301   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
00302   gpio_init_structure.Pull      = GPIO_NOPULL;
00303   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00304   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00305
00306   /* De-assert the camera POWER_DOWN pin (active high) */
00307   HAL_GPIO_WritePin(GPIOH, GPIO_PIN_13, GPIO_PIN_RESET);
00308
00309   HAL_Delay(3);     /* POWER_DOWN de-asserted during 3ms */
00310 }
00311
00312 /**
00313   * @brief  CAMERA power down
00314   * @retval None
00315   */
00316 void BSP_CAMERA_PwrDown(void)
00317 {
00318   GPIO_InitTypeDef gpio_init_structure;
00319
00320   /* Enable GPIO clock */
00321   __HAL_RCC_GPIOH_CLK_ENABLE();
00322
00323   /*** Configure the GPIO ***/
00324   /* Configure DCMI GPIO as alternate function */
00325   gpio_init_structure.Pin       = GPIO_PIN_13;
00326   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
00327   gpio_init_structure.Pull      = GPIO_NOPULL;
00328   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00329   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00330
00331   /* Assert the camera POWER_DOWN pin (active high) */
00332   HAL_GPIO_WritePin(GPIOH, GPIO_PIN_13, GPIO_PIN_SET);
00333 }
00334
00335 /**
00336   * @brief  Configures the camera contrast and brightness.
00337   * @param  contrast_level: Contrast level
00338   *          This parameter can be one of the following values:
00339   *            @arg  CAMERA_CONTRAST_LEVEL4: for contrast +2
00340   *            @arg  CAMERA_CONTRAST_LEVEL3: for contrast +1
00341   *            @arg  CAMERA_CONTRAST_LEVEL2: for contrast  0
00342   *            @arg  CAMERA_CONTRAST_LEVEL1: for contrast -1
00343   *            @arg  CAMERA_CONTRAST_LEVEL0: for contrast -2
00344   * @param  brightness_level: Contrast level
00345   *          This parameter can be one of the following values:
00346   *            @arg  CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
00347   *            @arg  CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
00348   *            @arg  CAMERA_BRIGHTNESS_LEVEL2: for brightness  0
00349   *            @arg  CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
00350   *            @arg  CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
00351   * @retval None
00352   */
00353 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
00354 {
00355   if(camera_drv->Config != NULL)
00356   {
00357     camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
00358   }
00359 }
00360
00361 /**
00362   * @brief  Configures the camera white balance.
00363   * @param  Mode: black_white mode
00364   *          This parameter can be one of the following values:
00365   *            @arg  CAMERA_BLACK_WHITE_BW
00366   *            @arg  CAMERA_BLACK_WHITE_NEGATIVE
00367   *            @arg  CAMERA_BLACK_WHITE_BW_NEGATIVE
00368   *            @arg  CAMERA_BLACK_WHITE_NORMAL
00369   * @retval None
00370   */
00371 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
00372 {
00373   if(camera_drv->Config != NULL)
00374   {
00375     camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
00376   }
00377 }
00378
00379 /**
00380   * @brief  Configures the camera color effect.
00381   * @param  Effect: Color effect
00382   *          This parameter can be one of the following values:
00383   *            @arg  CAMERA_COLOR_EFFECT_ANTIQUE
00384   *            @arg  CAMERA_COLOR_EFFECT_BLUE
00385   *            @arg  CAMERA_COLOR_EFFECT_GREEN
00386   *            @arg  CAMERA_COLOR_EFFECT_RED
00387   * @retval None
00388   */
00389 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
00390 {
00391   if(camera_drv->Config != NULL)
00392   {
00393     camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
00394   }
00395 }
00396
00397 /**
00398   * @brief  Get the capture size in pixels unit.
00399   * @param  resolution: the current resolution.
00400   * @retval capture size in pixels unit.
00401   */
00402 static uint32_t GetSize(uint32_t resolution)
00403 {
00404   uint32_t size = 0;
00405
00406   /* Get capture size */
00407   switch (resolution)
00408   {
00409   case CAMERA_R160x120:
00410     {
00411       size =  0x2580;
00412     }
00413     break;
00414   case CAMERA_R320x240:
00415     {
00416       size =  0x9600;
00417     }
00418     break;
00419   case CAMERA_R480x272:
00420     {
00421       size =  0xFF00;
00422     }
00423     break;
00424   case CAMERA_R640x480:
00425     {
00426       size =  0x25800;
00427     }
00428     break;
00429   default:
00430     {
00431       break;
00432     }
00433   }
00434
00435   return size;
00436 }
00437
00438 /**
00439   * @brief  Initializes the DCMI MSP.
00440   * @param  hdcmi: HDMI handle
00441   * @param  Params
00442   * @retval None
00443   */
00444 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00445 {
00446   static DMA_HandleTypeDef hdma_handler;
00447   GPIO_InitTypeDef gpio_init_structure;
00448
00449   /*** Enable peripherals and GPIO clocks ***/
00450   /* Enable DCMI clock */
00451   __HAL_RCC_DCMI_CLK_ENABLE();
00452
00453   /* Enable DMA2 clock */
00454   __HAL_RCC_DMA2_CLK_ENABLE();
00455
00456   /* Enable GPIO clocks */
00457   __HAL_RCC_GPIOA_CLK_ENABLE();
00458   __HAL_RCC_GPIOD_CLK_ENABLE();
00459   __HAL_RCC_GPIOE_CLK_ENABLE();
00460   __HAL_RCC_GPIOG_CLK_ENABLE();
00461   __HAL_RCC_GPIOH_CLK_ENABLE();
00462
00463   /*** Configure the GPIO ***/
00464   /* Configure DCMI GPIO as alternate function */
00465   gpio_init_structure.Pin       = GPIO_PIN_4 | GPIO_PIN_6;
00466   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00467   gpio_init_structure.Pull      = GPIO_PULLUP;
00468   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00469   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00470   HAL_GPIO_Init(GPIOA, &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_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_5 | GPIO_PIN_6;
00480   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00481   gpio_init_structure.Pull      = GPIO_PULLUP;
00482   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00483   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00484   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00485
00486   gpio_init_structure.Pin       = GPIO_PIN_9;
00487   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00488   gpio_init_structure.Pull      = GPIO_PULLUP;
00489   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00490   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00491   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00492
00493   gpio_init_structure.Pin       = GPIO_PIN_9 | GPIO_PIN_10  | GPIO_PIN_11  |\
00494                                   GPIO_PIN_12 | GPIO_PIN_14;
00495   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00496   gpio_init_structure.Pull      = GPIO_PULLUP;
00497   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00498   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00499   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00500
00501   /*** Configure the DMA ***/
00502   /* Set the parameters to be configured */
00503   hdma_handler.Init.Channel             = DMA_CHANNEL_1;
00504   hdma_handler.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00505   hdma_handler.Init.PeriphInc           = DMA_PINC_DISABLE;
00506   hdma_handler.Init.MemInc              = DMA_MINC_ENABLE;
00507   hdma_handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00508   hdma_handler.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00509   hdma_handler.Init.Mode                = DMA_CIRCULAR;
00510   hdma_handler.Init.Priority            = DMA_PRIORITY_HIGH;
00511   hdma_handler.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00512   hdma_handler.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00513   hdma_handler.Init.MemBurst            = DMA_MBURST_SINGLE;
00514   hdma_handler.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00515
00516   hdma_handler.Instance = DMA2_Stream1;
00517
00518   /* Associate the initialized DMA handle to the DCMI handle */
00519   __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_handler);
00520
00521   /*** Configure the NVIC for DCMI and DMA ***/
00522   /* NVIC configuration for DCMI transfer complete interrupt */
00523   HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0);
00524   HAL_NVIC_EnableIRQ(DCMI_IRQn);
00525
00526   /* NVIC configuration for DMA2D transfer complete interrupt */
00527   HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 0x0F, 0);
00528   HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
00529
00530   /* Configure the DMA stream */
00531   HAL_DMA_Init(hdcmi->DMA_Handle);
00532 }
00533
00534
00535 /**
00536   * @brief  DeInitializes the DCMI MSP.
00537   * @param  hdcmi: HDMI handle
00538   * @param  Params
00539   * @retval None
00540   */
00541 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00542 {
00543   /* Disable NVIC  for DCMI transfer complete interrupt */
00544   HAL_NVIC_DisableIRQ(DCMI_IRQn);
00545
00546   /* Disable NVIC for DMA2 transfer complete interrupt */
00547   HAL_NVIC_DisableIRQ(DMA2_Stream1_IRQn);
00548
00549   /* Configure the DMA stream */
00550   HAL_DMA_DeInit(hdcmi->DMA_Handle);
00551
00552   /* Disable DCMI clock */
00553   __HAL_RCC_DCMI_CLK_DISABLE();
00554
00555   /* GPIO pins clock and DMA clock can be shut down in the application
00556      by surcharging this __weak function */
00557 }
00558
00559 /**
00560   * @brief  Line event callback
00561   * @param  hdcmi: pointer to the DCMI handle
00562   * @retval None
00563   */
00564 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
00565 {
00566   BSP_CAMERA_LineEventCallback();
00567 }
00568
00569 /**
00570   * @brief  Line Event callback.
00571   * @retval None
00572   */
00573 __weak void BSP_CAMERA_LineEventCallback(void)
00574 {
00575   /* NOTE : This function Should not be modified, when the callback is needed,
00576             the HAL_DCMI_LineEventCallback could be implemented in the user file
00577    */
00578 }
00579
00580 /**
00581   * @brief  VSYNC event callback
00582   * @param  hdcmi: pointer to the DCMI handle
00583   * @retval None
00584   */
00585 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
00586 {
00587   BSP_CAMERA_VsyncEventCallback();
00588 }
00589
00590 /**
00591   * @brief  VSYNC Event callback.
00592   * @retval None
00593   */
00594 __weak void BSP_CAMERA_VsyncEventCallback(void)
00595 {
00596   /* NOTE : This function Should not be modified, when the callback is needed,
00597             the HAL_DCMI_VsyncEventCallback could be implemented in the user file
00598    */
00599 }
00600
00601 /**
00602   * @brief  Frame event callback
00603   * @param  hdcmi: pointer to the DCMI handle
00604   * @retval None
00605   */
00606 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
00607 {
00608   BSP_CAMERA_FrameEventCallback();
00609 }
00610
00611 /**
00612   * @brief  Frame Event callback.
00613   * @retval None
00614   */
00615 __weak void BSP_CAMERA_FrameEventCallback(void)
00616 {
00617   /* NOTE : This function Should not be modified, when the callback is needed,
00618             the HAL_DCMI_FrameEventCallback could be implemented in the user file
00619    */
00620 }
00621
00622 /**
00623   * @brief  Error callback
00624   * @param  hdcmi: pointer to the DCMI handle
00625   * @retval None
00626   */
00627 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
00628 {
00629   BSP_CAMERA_ErrorCallback();
00630 }
00631
00632 /**
00633   * @brief  Error callback.
00634   * @retval None
00635   */
00636 __weak void BSP_CAMERA_ErrorCallback(void)
00637 {
00638   /* NOTE : This function Should not be modified, when the callback is needed,
00639             the HAL_DCMI_ErrorCallback could be implemented in the user file
00640    */
00641 }
00642
00643 /**
00644   * @}
00645   */
00646
00647 /**
00648   * @}
00649   */
00650
00651 /**
00652   * @}
00653   */
00654
00655 /**
00656   * @}
00657   */
00658
00659 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_camera.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_camera.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_camera.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_camera.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_CAMERA_H
00039 #define __STM32746G_DISCOVERY_CAMERA_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include Camera component Driver */
00047 #include "../Components/ov9655/ov9655.h"
00048 #include "stm32746g_discovery.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32746G_DISCOVERY
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32746G_DISCOVERY_CAMERA
00059   * @{
00060   */
00061
00062 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Types STM32746G_DISCOVERY_CAMERA Exported Types
00063   * @{
00064   */
00065
00066 /**
00067   * @brief  Camera State structures definition
00068   */
00069 typedef enum
00070 {
00071   CAMERA_OK            = 0x00,
00072   CAMERA_ERROR         = 0x01,
00073   CAMERA_TIMEOUT       = 0x02,
00074   CAMERA_NOT_DETECTED  = 0x03,
00075   CAMERA_NOT_SUPPORTED = 0x04
00076
00077 } Camera_StatusTypeDef;
00078
00079 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00080 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00081 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00082 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00083 /**
00084   * @}
00085   */
00086
00087 /** @defgroup STM32746G_DISCOVERY_CAMERA_Exported_Constants STM32746G_DISCOVERY_CAMERA Exported Constants
00088   * @{
00089   */
00090 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00091 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Stream1_IRQHandler
00092
00093 /**
00094   * @}
00095   */
00096
00097 /** @addtogroup STM32746G_DISCOVERY_CAMERA_Exported_Functions
00098   * @{
00099   */
00100 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00101 uint8_t BSP_CAMERA_DeInit(void);
00102 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00103 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00104 void    BSP_CAMERA_Suspend(void);
00105 void    BSP_CAMERA_Resume(void);
00106 uint8_t BSP_CAMERA_Stop(void);
00107 void    BSP_CAMERA_PwrUp(void);
00108 void    BSP_CAMERA_PwrDown(void);
00109 void    BSP_CAMERA_LineEventCallback(void);
00110 void    BSP_CAMERA_VsyncEventCallback(void);
00111 void    BSP_CAMERA_FrameEventCallback(void);
00112 void    BSP_CAMERA_ErrorCallback(void);
00113
00114 /* Camera features functions prototype */
00115 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00116 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00117 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00118
00119 /* These functions can be modified in case the current settings (e.g. DMA stream)
00120    need to be changed for specific application needs */
00121 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00122 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00123
00124
00125 /**
00126   * @}
00127   */
00128
00129 /**
00130   * @}
00131   */
00132
00133 /**
00134   * @}
00135   */
00136
00137 /**
00138   * @}
00139   */
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif /* __STM32746G_DISCOVERY_CAMERA_H */
00146
00147 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_eeprom.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_eeprom.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_eeprom.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage an I2C M24LR64
00006   *          EEPROM memory.
00007   @verbatim
00008              To be able to use this driver, the switch EE_M24LR64 must be defined
00009              in your toolchain compiler preprocessor
00010
00011              ===================================================================
00012              Notes:
00013               - The I2C EEPROM memory (M24LR64) is available on separate daughter
00014                 board ANT7-M24LR-A, which is not provided with the STM32746G_DISCOVERY
00015                 board.
00016                 To use this driver you have to connect the ANT7-M24LR-A to CN3
00017                 connector of STM32746G_DISCOVERY board.
00018              ===================================================================
00019
00020              It implements a high level communication layer for read and write
00021              from/to this memory. The needed STM32F7xx hardware resources (I2C and
00022              GPIO) are defined in stm32746g_discovery.h file, and the initialization is
00023              performed in EEPROM_IO_Init() function declared in stm32746g_discovery.c
00024              file.
00025              You can easily tailor this driver to any other development board,
00026              by just adapting the defines for hardware resources and
00027              EEPROM_IO_Init() function.
00028
00029              @note In this driver, basic read and write functions (BSP_EEPROM_ReadBuffer()
00030                    and BSP_EEPROM_WritePage()) use DMA mode to perform the data
00031                    transfer to/from EEPROM memory.
00032
00033             @note   Regarding BSP_EEPROM_WritePage(), it is an optimized function to perform
00034                    small write (less than 1 page) BUT the number of bytes (combined to write start address) must not
00035                    cross the EEPROM page boundary. This function can only writes into
00036                    the boundaries of an EEPROM page.
00037                    This function doesn't check on boundaries condition (in this driver
00038                    the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
00039                    responsible of checking on Page boundaries).
00040
00041
00042         +-----------------------------------------------------------------+
00043         |               Pin assignment for M24LR64 EEPROM                 |
00044         +---------------------------------------+-----------+-------------+
00045         |  STM32F7xx I2C Pins                   |   EEPROM  |   Pin       |
00046         +---------------------------------------+-----------+-------------+
00047         | .                                     |   E0(GND) |    1  (0V)  |
00048         | .                                     |   AC0     |    2        |
00049         | .                                     |   AC1     |    3        |
00050         | .                                     |   VSS     |    4  (0V)  |
00051         | SDA                                   |   SDA     |    5        |
00052         | SCL                                   |   SCL     |    6        |
00053         | .                                     |   E1(GND) |    7  (0V)  |
00054         | .                                     |   VDD     |    8 (3.3V) |
00055         +---------------------------------------+-----------+-------------+
00056   @endverbatim
00057   ******************************************************************************
00058   * @attention
00059   *
00060   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00061   *
00062   * Redistribution and use in source and binary forms, with or without modification,
00063   * are permitted provided that the following conditions are met:
00064   *   1. Redistributions of source code must retain the above copyright notice,
00065   *      this list of conditions and the following disclaimer.
00066   *   2. Redistributions in binary form must reproduce the above copyright notice,
00067   *      this list of conditions and the following disclaimer in the documentation
00068   *      and/or other materials provided with the distribution.
00069   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00070   *      may be used to endorse or promote products derived from this software
00071   *      without specific prior written permission.
00072   *
00073   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00074   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00075   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00076   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00077   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00078   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00079   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00080   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00081   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00082   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00083   *
00084   ******************************************************************************
00085   */
00086
00087 /* Dependencies
00088 - stm32746g_discovery.c
00089 EndDependencies */
00090
00091 /* Includes ------------------------------------------------------------------*/
00092 #include "stm32746g_discovery_eeprom.h"
00093
00094 /** @addtogroup BSP
00095   * @{
00096   */
00097
00098 /** @addtogroup STM32746G_DISCOVERY
00099   * @{
00100   */
00101
00102 /** @addtogroup STM32746G_DISCOVERY_EEPROM
00103   * @brief This file includes the I2C EEPROM driver of STM32746G-Discovery board.
00104   * @{
00105   */
00106
00107 /** @defgroup STM32746G_DISCOVERY_EEPROM_Private_Types STM32746G_DISCOVERY_EEPROM Private Types
00108   * @{
00109   */
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32746G_DISCOVERY_EEPROM_Private_Defines STM32746G_DISCOVERY_EEPROM Private Defines
00115   * @{
00116   */
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32746G_DISCOVERY_EEPROM_Private_Macros STM32746G_DISCOVERY_EEPROM Private Macros
00122   * @{
00123   */
00124 /**
00125   * @}
00126   */
00127
00128 /** @defgroup STM32746G_DISCOVERY_EEPROM_Private_Variables STM32746G_DISCOVERY_EEPROM Private Variables
00129   * @{
00130   */
00131 __IO uint16_t EEPROMAddress = 0;
00132 __IO uint16_t EEPROMDataRead;
00133 __IO uint8_t  EEPROMDataWrite;
00134 /**
00135   * @}
00136   */
00137
00138 /** @defgroup STM32746G_DISCOVERY_EEPROM_Private_Function_Prototypes STM32746G_DISCOVERY_EEPROM Private Function Prototypes
00139   * @{
00140   */
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Functions STM32746G_DISCOVERY_EEPROM Exported Functions
00146   * @{
00147   */
00148
00149 /**
00150   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00151   *
00152   * @note   There are 2 different versions of M24LR64 (A01 & A02).
00153   *             Then try to connect on 1st one (EEPROM_I2C_ADDRESS_A01)
00154   *             and if problem, check the 2nd one (EEPROM_I2C_ADDRESS_A02)
00155   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00156   *         different from EEPROM_OK (0)
00157   */
00158 uint32_t BSP_EEPROM_Init(void)
00159 {
00160   /* I2C Initialization */
00161   EEPROM_IO_Init();
00162
00163   /* Select the EEPROM address for A01 and check if OK */
00164   EEPROMAddress = EEPROM_I2C_ADDRESS_A01;
00165   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00166   {
00167     /* Select the EEPROM address for A02 and check if OK */
00168     EEPROMAddress = EEPROM_I2C_ADDRESS_A02;
00169     if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00170     {
00171       return EEPROM_FAIL;
00172     }
00173   }
00174   return EEPROM_OK;
00175 }
00176
00177 /**
00178   * @brief  DeInitializes the EEPROM.
00179   * @retval EEPROM state
00180   */
00181 uint8_t BSP_EEPROM_DeInit(void)
00182 {
00183   /* I2C won't be disabled because common to other functionalities */
00184   return EEPROM_OK;
00185 }
00186
00187 /**
00188   * @brief  Reads a block of data from the EEPROM.
00189   * @param  pBuffer: pointer to the buffer that receives the data read from
00190   *         the EEPROM.
00191   * @param  ReadAddr: EEPROM's internal address to start reading from.
00192   * @param  NumByteToRead: pointer to the variable holding number of bytes to
00193   *         be read from the EEPROM.
00194   *
00195   *        @note The variable pointed by NumByteToRead is reset to 0 when all the
00196   *              data are read from the EEPROM. Application should monitor this
00197   *              variable in order know when the transfer is complete.
00198   *
00199   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00200   *         different from EEPROM_OK (0) or the timeout user callback.
00201   */
00202 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead)
00203 {
00204   uint32_t buffersize = *NumByteToRead;
00205
00206   /* Set the pointer to the Number of data to be read. This pointer will be used
00207      by the DMA Transfer Completer interrupt Handler in order to reset the
00208      variable to 0. User should check on this variable in order to know if the
00209      DMA transfer has been complete or not. */
00210   EEPROMDataRead = *NumByteToRead;
00211
00212   if(EEPROM_IO_ReadData(EEPROMAddress, ReadAddr, pBuffer, buffersize) != HAL_OK)
00213   {
00214     BSP_EEPROM_TIMEOUT_UserCallback();
00215     return EEPROM_FAIL;
00216   }
00217
00218   /* If all operations OK, return EEPROM_OK (0) */
00219   return EEPROM_OK;
00220 }
00221
00222 /**
00223   * @brief  Writes more than one byte to the EEPROM with a single WRITE cycle.
00224   *
00225   * @note   The number of bytes (combined to write start address) must not
00226   *         cross the EEPROM page boundary. This function can only write into
00227   *         the boundaries of an EEPROM page.
00228   *         This function doesn't check on boundaries condition (in this driver
00229   *         the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
00230   *         responsible of checking on Page boundaries).
00231   *
00232   * @param  pBuffer: pointer to the buffer containing the data to be written to
00233   *         the EEPROM.
00234   * @param  WriteAddr: EEPROM's internal address to write to.
00235   * @param  NumByteToWrite: pointer to the variable holding number of bytes to
00236   *         be written into the EEPROM.
00237   *
00238   *        @note The variable pointed by NumByteToWrite is reset to 0 when all the
00239   *              data are written to the EEPROM. Application should monitor this
00240   *              variable in order know when the transfer is complete.
00241   *
00242   *        @note This function just configure the communication and enable the DMA
00243   *              channel to transfer data. Meanwhile, the user application may perform
00244   *              other tasks in parallel.
00245   *
00246   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00247   *         different from EEPROM_OK (0) or the timeout user callback.
00248   */
00249 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite)
00250 {
00251   uint32_t buffersize = *NumByteToWrite;
00252   uint32_t status = EEPROM_OK;
00253
00254   /* Set the pointer to the Number of data to be written. This pointer will be used
00255       by the DMA Transfer Completer interrupt Handler in order to reset the
00256       variable to 0. User should check on this variable in order to know if the
00257       DMA transfer has been complete or not. */
00258   EEPROMDataWrite = *NumByteToWrite;
00259
00260   if(EEPROM_IO_WriteData(EEPROMAddress, WriteAddr, pBuffer, buffersize) != HAL_OK)
00261   {
00262     BSP_EEPROM_TIMEOUT_UserCallback();
00263     status = EEPROM_FAIL;
00264   }
00265
00266   if(BSP_EEPROM_WaitEepromStandbyState() != EEPROM_OK)
00267   {
00268     return EEPROM_FAIL;
00269   }
00270
00271   /* If all operations OK, return EEPROM_OK (0) */
00272   return status;
00273 }
00274
00275 /**
00276   * @brief  Writes buffer of data to the I2C EEPROM.
00277   * @param  pBuffer: pointer to the buffer  containing the data to be written
00278   *         to the EEPROM.
00279   * @param  WriteAddr: EEPROM's internal address to write to.
00280   * @param  NumByteToWrite: number of bytes to write to the EEPROM.
00281   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00282   *         different from EEPROM_OK (0) or the timeout user callback.
00283   */
00284 uint32_t BSP_EEPROM_WriteBuffer(uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
00285 {
00286   uint16_t numofpage = 0, numofsingle = 0, count = 0;
00287   uint16_t addr = 0;
00288   uint8_t  dataindex = 0;
00289   uint32_t status = EEPROM_OK;
00290
00291   addr = WriteAddr % EEPROM_PAGESIZE;
00292   count = EEPROM_PAGESIZE - addr;
00293   numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00294   numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00295
00296   /* If WriteAddr is EEPROM_PAGESIZE aligned */
00297   if(addr == 0)
00298   {
00299     /* If NumByteToWrite < EEPROM_PAGESIZE */
00300     if(numofpage == 0)
00301     {
00302       /* Store the number of data to be written */
00303       dataindex = numofsingle;
00304       /* Start writing data */
00305       status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00306       if(status != EEPROM_OK)
00307       {
00308         return status;
00309       }
00310     }
00311     /* If NumByteToWrite > EEPROM_PAGESIZE */
00312     else
00313     {
00314       while(numofpage--)
00315       {
00316         /* Store the number of data to be written */
00317         dataindex = EEPROM_PAGESIZE;
00318         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00319         if(status != EEPROM_OK)
00320         {
00321           return status;
00322         }
00323
00324         WriteAddr +=  EEPROM_PAGESIZE;
00325         pBuffer += EEPROM_PAGESIZE;
00326       }
00327
00328       if(numofsingle!=0)
00329       {
00330         /* Store the number of data to be written */
00331         dataindex = numofsingle;
00332         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00333         if(status != EEPROM_OK)
00334         {
00335           return status;
00336         }
00337       }
00338     }
00339   }
00340   /* If WriteAddr is not EEPROM_PAGESIZE aligned */
00341   else
00342   {
00343     /* If NumByteToWrite < EEPROM_PAGESIZE */
00344     if(numofpage== 0)
00345     {
00346       /* If the number of data to be written is more than the remaining space
00347       in the current page: */
00348       if(NumByteToWrite > count)
00349       {
00350         /* Store the number of data to be written */
00351         dataindex = count;
00352         /* Write the data contained in same page */
00353         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00354         if(status != EEPROM_OK)
00355         {
00356           return status;
00357         }
00358
00359         /* Store the number of data to be written */
00360         dataindex = (NumByteToWrite - count);
00361         /* Write the remaining data in the following page */
00362         status = BSP_EEPROM_WritePage((uint8_t*)(pBuffer + count), (WriteAddr + count), (uint8_t*)(&dataindex));
00363         if(status != EEPROM_OK)
00364         {
00365           return status;
00366         }
00367       }
00368       else
00369       {
00370         /* Store the number of data to be written */
00371         dataindex = numofsingle;
00372         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00373         if(status != EEPROM_OK)
00374         {
00375           return status;
00376         }
00377       }
00378     }
00379     /* If NumByteToWrite > EEPROM_PAGESIZE */
00380     else
00381     {
00382       NumByteToWrite -= count;
00383       numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00384       numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00385
00386       if(count != 0)
00387       {
00388         /* Store the number of data to be written */
00389         dataindex = count;
00390         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00391         if(status != EEPROM_OK)
00392         {
00393           return status;
00394         }
00395         WriteAddr += count;
00396         pBuffer += count;
00397       }
00398
00399       while(numofpage--)
00400       {
00401         /* Store the number of data to be written */
00402         dataindex = EEPROM_PAGESIZE;
00403         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00404         if(status != EEPROM_OK)
00405         {
00406           return status;
00407         }
00408         WriteAddr +=  EEPROM_PAGESIZE;
00409         pBuffer += EEPROM_PAGESIZE;
00410       }
00411       if(numofsingle != 0)
00412       {
00413         /* Store the number of data to be written */
00414         dataindex = numofsingle;
00415         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00416         if(status != EEPROM_OK)
00417         {
00418           return status;
00419         }
00420       }
00421     }
00422   }
00423
00424   /* If all operations OK, return EEPROM_OK (0) */
00425   return EEPROM_OK;
00426 }
00427
00428 /**
00429   * @brief  Wait for EEPROM Standby state.
00430   *
00431   * @note  This function allows to wait and check that EEPROM has finished the
00432   *        last operation. It is mostly used after Write operation: after receiving
00433   *        the buffer to be written, the EEPROM may need additional time to actually
00434   *        perform the write operation. During this time, it doesn't answer to
00435   *        I2C packets addressed to it. Once the write operation is complete
00436   *        the EEPROM responds to its address.
00437   *
00438   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00439   *         different from EEPROM_OK (0) or the timeout user callback.
00440   */
00441 uint32_t BSP_EEPROM_WaitEepromStandbyState(void)
00442 {
00443   /* Check if the maximum allowed number of trials has bee reached */
00444   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00445   {
00446     /* If the maximum number of trials has been reached, exit the function */
00447     BSP_EEPROM_TIMEOUT_UserCallback();
00448     return EEPROM_TIMEOUT;
00449   }
00450   return EEPROM_OK;
00451 }
00452
00453 /**
00454   * @brief  Basic management of the timeout situation.
00455   * @retval None
00456   */
00457 __weak void BSP_EEPROM_TIMEOUT_UserCallback(void)
00458 {
00459 }
00460
00461 /**
00462   * @}
00463   */
00464
00465 /**
00466   * @}
00467   */
00468
00469 /**
00470   * @}
00471   */
00472
00473 /**
00474   * @}
00475   */
00476
00477 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_eeprom.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_eeprom.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_eeprom.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains all the functions prototypes for
00006   *          the stm32746g_discovery_eeprom.c firmware driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_EEPROM_H
00039 #define __STM32746G_DISCOVERY_EEPROM_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32746g_discovery.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32746G_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32746G_DISCOVERY_EEPROM
00057   * @brief This file includes the I2C EEPROM driver of STM32746G-Discovery board.
00058   * @{
00059   */
00060
00061 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Types STM32746G_DISCOVERY_EEPROM Exported Types
00062   * @{
00063   */
00064 /**
00065   * @}
00066   */
00067
00068 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Constants STM32746G_DISCOVERY_EEPROM Exported Constants
00069   * @{
00070   */
00071 /* EEPROM hardware address and page size */
00072 #define EEPROM_PAGESIZE             ((uint8_t)4)
00073 #define EEPROM_MAX_SIZE             ((uint16_t)0x2000) /* 64Kbit */
00074
00075
00076 /* Maximum number of trials for EEPROM_WaitEepromStandbyState() function */
00077 #define EEPROM_MAX_TRIALS           ((uint32_t)3000)
00078
00079 #define EEPROM_OK                   ((uint32_t)0)
00080 #define EEPROM_FAIL                 ((uint32_t)1)
00081 #define EEPROM_TIMEOUT              ((uint32_t)2)
00082 /**
00083   * @}
00084   */
00085
00086 /** @defgroup STM32746G_DISCOVERY_EEPROM_Exported_Macros STM32746G_DISCOVERY_EEPROM Exported Macros
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092
00093 /** @addtogroup STM32746G_DISCOVERY_EEPROM_Exported_Functions
00094   * @{
00095   */
00096 uint32_t BSP_EEPROM_Init(void);
00097 uint8_t BSP_EEPROM_DeInit(void);
00098 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead);
00099 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite);
00100 uint32_t BSP_EEPROM_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
00101 uint32_t BSP_EEPROM_WaitEepromStandbyState(void);
00102
00103 /* USER Callbacks: This function is declared as __weak in EEPROM driver and
00104    should be implemented into user application.
00105    BSP_EEPROM_TIMEOUT_UserCallback() function is called whenever a timeout condition
00106    occurs during communication (waiting on an event that doesn't occur, bus
00107    errors, busy devices ...). */
00108 void     BSP_EEPROM_TIMEOUT_UserCallback(void);
00109
00110 /* Link function for I2C EEPROM peripheral */
00111 void              EEPROM_IO_Init(void);
00112 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00113 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00114 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00115
00116 /**
00117   * @}
00118   */
00119
00120 /**
00121   * @}
00122   */
00123
00124 /**
00125   * @}
00126   */
00127
00128 /**
00129   * @}
00130   */
00131
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135
00136 #endif /* __STM32746G_DISCOVERY_EEPROM_H */
00137
00138 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_lcd.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_lcd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_lcd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00006   *          mounted on STM32746G-Discovery board.
00007   @verbatim
00008   1. How To use this driver:
00009   --------------------------
00010      - This driver is used to drive directly an LCD TFT using the LTDC controller.
00011      - This driver uses timing and setting for RK043FN48H LCD.
00012
00013   2. Driver description:
00014   ---------------------
00015     + Initialization steps:
00016        o Initialize the LCD using the BSP_LCD_Init() function.
00017        o Apply the Layer configuration using the BSP_LCD_LayerDefaultInit() function.
00018        o Select the LCD layer to be used using the BSP_LCD_SelectLayer() function.
00019        o Enable the LCD display using the BSP_LCD_DisplayOn() function.
00020
00021     + Options
00022        o Configure and enable the color keying functionality using the
00023          BSP_LCD_SetColorKeying() function.
00024        o Modify in the fly the transparency and/or the frame buffer address
00025          using the following functions:
00026          - BSP_LCD_SetTransparency()
00027          - BSP_LCD_SetLayerAddress()
00028
00029     + Display on LCD
00030        o Clear the hole LCD using BSP_LCD_Clear() function or only one specified string
00031          line using the BSP_LCD_ClearStringLine() function.
00032        o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
00033          function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
00034        o Display a string line on the specified position (x,y in pixel) and align mode
00035          using the BSP_LCD_DisplayStringAtLine() function.
00036        o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00037          on LCD using the available set of functions.
00038   @endverbatim
00039   ******************************************************************************
00040   * @attention
00041   *
00042   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00043   *
00044   * Redistribution and use in source and binary forms, with or without modification,
00045   * are permitted provided that the following conditions are met:
00046   *   1. Redistributions of source code must retain the above copyright notice,
00047   *      this list of conditions and the following disclaimer.
00048   *   2. Redistributions in binary form must reproduce the above copyright notice,
00049   *      this list of conditions and the following disclaimer in the documentation
00050   *      and/or other materials provided with the distribution.
00051   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00052   *      may be used to endorse or promote products derived from this software
00053   *      without specific prior written permission.
00054   *
00055   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00056   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00057   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00058   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00059   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00060   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00061   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00062   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00063   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00064   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00065   *
00066   ******************************************************************************
00067   */
00068
00069 /* Dependencies
00070 - stm32746g_discovery.c
00071 - stm32746g_discovery_sdram.c
00072 - stm32f7xx_hal_ltdc.c
00073 - stm32f7xx_hal_ltdc_ex.c
00074 - stm32f7xx_hal_dma2d.c
00075 - stm32f7xx_hal_rcc_ex.c
00076 - stm32f7xx_hal_gpio.c
00077 - stm32f7xx_hal_cortex.c
00078 - rk043fn48h.h
00079 - fonts.h
00080 - font24.c
00081 - font20.c
00082 - font16.c
00083 - font12.c
00084 - font8.c"
00085 EndDependencies */
00086
00087 /* Includes ------------------------------------------------------------------*/
00088 #include "stm32746g_discovery_lcd.h"
00089 #include "../../../Utilities/Fonts/fonts.h"
00090 #include "../../../Utilities/Fonts/font24.c"
00091 #include "../../../Utilities/Fonts/font20.c"
00092 #include "../../../Utilities/Fonts/font16.c"
00093 #include "../../../Utilities/Fonts/font12.c"
00094 #include "../../../Utilities/Fonts/font8.c"
00095
00096 /** @addtogroup BSP
00097   * @{
00098   */
00099
00100 /** @addtogroup STM32746G_DISCOVERY
00101   * @{
00102   */
00103
00104 /** @addtogroup STM32746G_DISCOVERY_LCD
00105   * @{
00106   */
00107
00108 /** @defgroup STM32746G_DISCOVERY_LCD_Private_TypesDefinitions STM32746G_DISCOVERY_LCD Private Types Definitions
00109   * @{
00110   */
00111 /**
00112   * @}
00113   */
00114
00115 /** @defgroup STM32746G_DISCOVERY_LCD_Private_Defines STM32746G_DISCOVERY LCD Private Defines
00116   * @{
00117   */
00118 #define POLY_X(Z)              ((int32_t)((Points + Z)->X))
00119 #define POLY_Y(Z)              ((int32_t)((Points + Z)->Y))
00120 /**
00121   * @}
00122   */
00123
00124 /** @defgroup STM32746G_DISCOVERY_LCD_Private_Macros STM32746G_DISCOVERY_LCD Private Macros
00125   * @{
00126   */
00127 #define ABS(X)  ((X) > 0 ? (X) : -(X))
00128 /**
00129   * @}
00130   */
00131
00132 /** @defgroup STM32746G_DISCOVERY_LCD_Private_Variables STM32746G_DISCOVERY_LCD Private Variables
00133   * @{
00134   */
00135 LTDC_HandleTypeDef  hLtdcHandler;
00136 static DMA2D_HandleTypeDef hDma2dHandler;
00137
00138 /* Default LCD configuration with LCD Layer 1 */
00139 static uint32_t            ActiveLayer = 0;
00140 static LCD_DrawPropTypeDef DrawProp[MAX_LAYER_NUMBER];
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32746G_DISCOVERY_LCD_Private_FunctionPrototypes STM32746G_DISCOVERY_LCD Private Function Prototypes
00146   * @{
00147   */
00148 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c);
00149 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3);
00150 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex);
00151 static void LL_ConvertLineToARGB8888(void * pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode);
00152 /**
00153   * @}
00154   */
00155
00156 /** @defgroup STM32746G_DISCOVERY_LCD_Exported_Functions STM32746G_DISCOVERY_LCD Exported Functions
00157   * @{
00158   */
00159
00160 /**
00161   * @brief  Initializes the LCD.
00162   * @retval LCD state
00163   */
00164 uint8_t BSP_LCD_Init(void)
00165 {
00166   /* Select the used LCD */
00167
00168   /* The RK043FN48H LCD 480x272 is selected */
00169   /* Timing Configuration */
00170   hLtdcHandler.Init.HorizontalSync = (RK043FN48H_HSYNC - 1);
00171   hLtdcHandler.Init.VerticalSync = (RK043FN48H_VSYNC - 1);
00172   hLtdcHandler.Init.AccumulatedHBP = (RK043FN48H_HSYNC + RK043FN48H_HBP - 1);
00173   hLtdcHandler.Init.AccumulatedVBP = (RK043FN48H_VSYNC + RK043FN48H_VBP - 1);
00174   hLtdcHandler.Init.AccumulatedActiveH = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP - 1);
00175   hLtdcHandler.Init.AccumulatedActiveW = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP - 1);
00176   hLtdcHandler.Init.TotalHeigh = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP + RK043FN48H_VFP - 1);
00177   hLtdcHandler.Init.TotalWidth = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP + RK043FN48H_HFP - 1);
00178
00179   /* LCD clock configuration */
00180   BSP_LCD_ClockConfig(&hLtdcHandler, NULL);
00181
00182   /* Initialize the LCD pixel width and pixel height */
00183   hLtdcHandler.LayerCfg->ImageWidth  = RK043FN48H_WIDTH;
00184   hLtdcHandler.LayerCfg->ImageHeight = RK043FN48H_HEIGHT;
00185
00186   /* Background value */
00187   hLtdcHandler.Init.Backcolor.Blue = 0;
00188   hLtdcHandler.Init.Backcolor.Green = 0;
00189   hLtdcHandler.Init.Backcolor.Red = 0;
00190
00191   /* Polarity */
00192   hLtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL;
00193   hLtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL;
00194   hLtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL;
00195   hLtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00196   hLtdcHandler.Instance = LTDC;
00197
00198   if(HAL_LTDC_GetState(&hLtdcHandler) == HAL_LTDC_STATE_RESET)
00199   {
00200     /* Initialize the LCD Msp: this __weak function can be rewritten by the application */
00201     BSP_LCD_MspInit(&hLtdcHandler, NULL);
00202   }
00203   HAL_LTDC_Init(&hLtdcHandler);
00204
00205   /* Assert display enable LCD_DISP pin */
00206   HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_SET);
00207
00208   /* Assert backlight LCD_BL_CTRL pin */
00209   HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);
00210
00211 #if !defined(DATA_IN_ExtSDRAM)
00212   /* Initialize the SDRAM */
00213   BSP_SDRAM_Init();
00214 #endif
00215
00216   /* Initialize the font */
00217   BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00218
00219   return LCD_OK;
00220 }
00221
00222 /**
00223   * @brief  DeInitializes the LCD.
00224   * @retval LCD state
00225   */
00226 uint8_t BSP_LCD_DeInit(void)
00227 {
00228   /* Initialize the hLtdcHandler Instance parameter */
00229   hLtdcHandler.Instance = LTDC;
00230
00231  /* Disable LTDC block */
00232   __HAL_LTDC_DISABLE(&hLtdcHandler);
00233
00234   /* DeInit the LTDC */
00235   HAL_LTDC_DeInit(&hLtdcHandler);
00236
00237   /* DeInit the LTDC MSP : this __weak function can be rewritten by the application */
00238   BSP_LCD_MspDeInit(&hLtdcHandler, NULL);
00239
00240   return LCD_OK;
00241 }
00242
00243 /**
00244   * @brief  Gets the LCD X size.
00245   * @retval Used LCD X size
00246   */
00247 uint32_t BSP_LCD_GetXSize(void)
00248 {
00249   return hLtdcHandler.LayerCfg[ActiveLayer].ImageWidth;
00250 }
00251
00252 /**
00253   * @brief  Gets the LCD Y size.
00254   * @retval Used LCD Y size
00255   */
00256 uint32_t BSP_LCD_GetYSize(void)
00257 {
00258   return hLtdcHandler.LayerCfg[ActiveLayer].ImageHeight;
00259 }
00260
00261 /**
00262   * @brief  Set the LCD X size.
00263   * @param  imageWidthPixels : image width in pixels unit
00264   * @retval None
00265   */
00266 void BSP_LCD_SetXSize(uint32_t imageWidthPixels)
00267 {
00268   hLtdcHandler.LayerCfg[ActiveLayer].ImageWidth = imageWidthPixels;
00269 }
00270
00271 /**
00272   * @brief  Set the LCD Y size.
00273   * @param  imageHeightPixels : image height in lines unit
00274   * @retval None
00275   */
00276 void BSP_LCD_SetYSize(uint32_t imageHeightPixels)
00277 {
00278   hLtdcHandler.LayerCfg[ActiveLayer].ImageHeight = imageHeightPixels;
00279 }
00280
00281 /**
00282   * @brief  Initializes the LCD layer in ARGB8888 format (32 bits per pixel).
00283   * @param  LayerIndex: Layer foreground or background
00284   * @param  FB_Address: Layer frame buffer
00285   * @retval None
00286   */
00287 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
00288 {
00289   LCD_LayerCfgTypeDef  layer_cfg;
00290
00291   /* Layer Init */
00292   layer_cfg.WindowX0 = 0;
00293   layer_cfg.WindowX1 = BSP_LCD_GetXSize();
00294   layer_cfg.WindowY0 = 0;
00295   layer_cfg.WindowY1 = BSP_LCD_GetYSize();
00296   layer_cfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
00297   layer_cfg.FBStartAdress = FB_Address;
00298   layer_cfg.Alpha = 255;
00299   layer_cfg.Alpha0 = 0;
00300   layer_cfg.Backcolor.Blue = 0;
00301   layer_cfg.Backcolor.Green = 0;
00302   layer_cfg.Backcolor.Red = 0;
00303   layer_cfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00304   layer_cfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00305   layer_cfg.ImageWidth = BSP_LCD_GetXSize();
00306   layer_cfg.ImageHeight = BSP_LCD_GetYSize();
00307
00308   HAL_LTDC_ConfigLayer(&hLtdcHandler, &layer_cfg, LayerIndex);
00309
00310   DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE;
00311   DrawProp[LayerIndex].pFont     = &Font24;
00312   DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK;
00313 }
00314
00315 /**
00316   * @brief  Initializes the LCD layer in RGB565 format (16 bits per pixel).
00317   * @param  LayerIndex: Layer foreground or background
00318   * @param  FB_Address: Layer frame buffer
00319   * @retval None
00320   */
00321 void BSP_LCD_LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address)
00322 {
00323   LCD_LayerCfgTypeDef  layer_cfg;
00324
00325   /* Layer Init */
00326   layer_cfg.WindowX0 = 0;
00327   layer_cfg.WindowX1 = BSP_LCD_GetXSize();
00328   layer_cfg.WindowY0 = 0;
00329   layer_cfg.WindowY1 = BSP_LCD_GetYSize();
00330   layer_cfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
00331   layer_cfg.FBStartAdress = FB_Address;
00332   layer_cfg.Alpha = 255;
00333   layer_cfg.Alpha0 = 0;
00334   layer_cfg.Backcolor.Blue = 0;
00335   layer_cfg.Backcolor.Green = 0;
00336   layer_cfg.Backcolor.Red = 0;
00337   layer_cfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00338   layer_cfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00339   layer_cfg.ImageWidth = BSP_LCD_GetXSize();
00340   layer_cfg.ImageHeight = BSP_LCD_GetYSize();
00341
00342   HAL_LTDC_ConfigLayer(&hLtdcHandler, &layer_cfg, LayerIndex);
00343
00344   DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE;
00345   DrawProp[LayerIndex].pFont     = &Font24;
00346   DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK;
00347 }
00348
00349 /**
00350   * @brief  Selects the LCD Layer.
00351   * @param  LayerIndex: Layer foreground or background
00352   * @retval None
00353   */
00354 void BSP_LCD_SelectLayer(uint32_t LayerIndex)
00355 {
00356   ActiveLayer = LayerIndex;
00357 }
00358
00359 /**
00360   * @brief  Sets an LCD Layer visible
00361   * @param  LayerIndex: Visible Layer
00362   * @param  State: New state of the specified layer
00363   *          This parameter can be one of the following values:
00364   *            @arg  ENABLE
00365   *            @arg  DISABLE
00366   * @retval None
00367   */
00368 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State)
00369 {
00370   if(State == ENABLE)
00371   {
00372     __HAL_LTDC_LAYER_ENABLE(&hLtdcHandler, LayerIndex);
00373   }
00374   else
00375   {
00376     __HAL_LTDC_LAYER_DISABLE(&hLtdcHandler, LayerIndex);
00377   }
00378   __HAL_LTDC_RELOAD_CONFIG(&hLtdcHandler);
00379 }
00380
00381 /**
00382   * @brief  Sets an LCD Layer visible without reloading.
00383   * @param  LayerIndex: Visible Layer
00384   * @param  State: New state of the specified layer
00385   *          This parameter can be one of the following values:
00386   *            @arg  ENABLE
00387   *            @arg  DISABLE
00388   * @retval None
00389   */
00390 void BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State)
00391 {
00392   if(State == ENABLE)
00393   {
00394     __HAL_LTDC_LAYER_ENABLE(&hLtdcHandler, LayerIndex);
00395   }
00396   else
00397   {
00398     __HAL_LTDC_LAYER_DISABLE(&hLtdcHandler, LayerIndex);
00399   }
00400   /* Do not Sets the Reload  */
00401 }
00402
00403 /**
00404   * @brief  Configures the transparency.
00405   * @param  LayerIndex: Layer foreground or background.
00406   * @param  Transparency: Transparency
00407   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00408   * @retval None
00409   */
00410 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency)
00411 {
00412   HAL_LTDC_SetAlpha(&hLtdcHandler, Transparency, LayerIndex);
00413 }
00414
00415 /**
00416   * @brief  Configures the transparency without reloading.
00417   * @param  LayerIndex: Layer foreground or background.
00418   * @param  Transparency: Transparency
00419   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00420   * @retval None
00421   */
00422 void BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency)
00423 {
00424   HAL_LTDC_SetAlpha_NoReload(&hLtdcHandler, Transparency, LayerIndex);
00425 }
00426
00427 /**
00428   * @brief  Sets an LCD layer frame buffer address.
00429   * @param  LayerIndex: Layer foreground or background
00430   * @param  Address: New LCD frame buffer value
00431   * @retval None
00432   */
00433 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address)
00434 {
00435   HAL_LTDC_SetAddress(&hLtdcHandler, Address, LayerIndex);
00436 }
00437
00438 /**
00439   * @brief  Sets an LCD layer frame buffer address without reloading.
00440   * @param  LayerIndex: Layer foreground or background
00441   * @param  Address: New LCD frame buffer value
00442   * @retval None
00443   */
00444 void BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address)
00445 {
00446   HAL_LTDC_SetAddress_NoReload(&hLtdcHandler, Address, LayerIndex);
00447 }
00448
00449 /**
00450   * @brief  Sets display window.
00451   * @param  LayerIndex: Layer index
00452   * @param  Xpos: LCD X position
00453   * @param  Ypos: LCD Y position
00454   * @param  Width: LCD window width
00455   * @param  Height: LCD window height
00456   * @retval None
00457   */
00458 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00459 {
00460   /* Reconfigure the layer size */
00461   HAL_LTDC_SetWindowSize(&hLtdcHandler, Width, Height, LayerIndex);
00462
00463   /* Reconfigure the layer position */
00464   HAL_LTDC_SetWindowPosition(&hLtdcHandler, Xpos, Ypos, LayerIndex);
00465 }
00466
00467 /**
00468   * @brief  Sets display window without reloading.
00469   * @param  LayerIndex: Layer index
00470   * @param  Xpos: LCD X position
00471   * @param  Ypos: LCD Y position
00472   * @param  Width: LCD window width
00473   * @param  Height: LCD window height
00474   * @retval None
00475   */
00476 void BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00477 {
00478   /* Reconfigure the layer size */
00479   HAL_LTDC_SetWindowSize_NoReload(&hLtdcHandler, Width, Height, LayerIndex);
00480
00481   /* Reconfigure the layer position */
00482   HAL_LTDC_SetWindowPosition_NoReload(&hLtdcHandler, Xpos, Ypos, LayerIndex);
00483 }
00484
00485 /**
00486   * @brief  Configures and sets the color keying.
00487   * @param  LayerIndex: Layer foreground or background
00488   * @param  RGBValue: Color reference
00489   * @retval None
00490   */
00491 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue)
00492 {
00493   /* Configure and Enable the color Keying for LCD Layer */
00494   HAL_LTDC_ConfigColorKeying(&hLtdcHandler, RGBValue, LayerIndex);
00495   HAL_LTDC_EnableColorKeying(&hLtdcHandler, LayerIndex);
00496 }
00497
00498 /**
00499   * @brief  Configures and sets the color keying without reloading.
00500   * @param  LayerIndex: Layer foreground or background
00501   * @param  RGBValue: Color reference
00502   * @retval None
00503   */
00504 void BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue)
00505 {
00506   /* Configure and Enable the color Keying for LCD Layer */
00507   HAL_LTDC_ConfigColorKeying_NoReload(&hLtdcHandler, RGBValue, LayerIndex);
00508   HAL_LTDC_EnableColorKeying_NoReload(&hLtdcHandler, LayerIndex);
00509 }
00510
00511 /**
00512   * @brief  Disables the color keying.
00513   * @param  LayerIndex: Layer foreground or background
00514   * @retval None
00515   */
00516 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex)
00517 {
00518   /* Disable the color Keying for LCD Layer */
00519   HAL_LTDC_DisableColorKeying(&hLtdcHandler, LayerIndex);
00520 }
00521
00522 /**
00523   * @brief  Disables the color keying without reloading.
00524   * @param  LayerIndex: Layer foreground or background
00525   * @retval None
00526   */
00527 void BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex)
00528 {
00529   /* Disable the color Keying for LCD Layer */
00530   HAL_LTDC_DisableColorKeying_NoReload(&hLtdcHandler, LayerIndex);
00531 }
00532
00533 /**
00534   * @brief  Disables the color keying without reloading.
00535   * @param  ReloadType: can be one of the following values
00536   *         - LCD_RELOAD_IMMEDIATE
00537   *         - LCD_RELOAD_VERTICAL_BLANKING
00538   * @retval None
00539   */
00540 void BSP_LCD_Reload(uint32_t ReloadType)
00541 {
00542   HAL_LTDC_Reload (&hLtdcHandler, ReloadType);
00543 }
00544
00545 /**
00546   * @brief  Sets the LCD text color.
00547   * @param  Color: Text color code ARGB(8-8-8-8)
00548   * @retval None
00549   */
00550 void BSP_LCD_SetTextColor(uint32_t Color)
00551 {
00552   DrawProp[ActiveLayer].TextColor = Color;
00553 }
00554
00555 /**
00556   * @brief  Gets the LCD text color.
00557   * @retval Used text color.
00558   */
00559 uint32_t BSP_LCD_GetTextColor(void)
00560 {
00561   return DrawProp[ActiveLayer].TextColor;
00562 }
00563
00564 /**
00565   * @brief  Sets the LCD background color.
00566   * @param  Color: Layer background color code ARGB(8-8-8-8)
00567   * @retval None
00568   */
00569 void BSP_LCD_SetBackColor(uint32_t Color)
00570 {
00571   DrawProp[ActiveLayer].BackColor = Color;
00572 }
00573
00574 /**
00575   * @brief  Gets the LCD background color.
00576   * @retval Used background colour
00577   */
00578 uint32_t BSP_LCD_GetBackColor(void)
00579 {
00580   return DrawProp[ActiveLayer].BackColor;
00581 }
00582
00583 /**
00584   * @brief  Sets the LCD text font.
00585   * @param  fonts: Layer font to be used
00586   * @retval None
00587   */
00588 void BSP_LCD_SetFont(sFONT *fonts)
00589 {
00590   DrawProp[ActiveLayer].pFont = fonts;
00591 }
00592
00593 /**
00594   * @brief  Gets the LCD text font.
00595   * @retval Used layer font
00596   */
00597 sFONT *BSP_LCD_GetFont(void)
00598 {
00599   return DrawProp[ActiveLayer].pFont;
00600 }
00601
00602 /**
00603   * @brief  Reads an LCD pixel.
00604   * @param  Xpos: X position
00605   * @param  Ypos: Y position
00606   * @retval RGB pixel color
00607   */
00608 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
00609 {
00610   uint32_t ret = 0;
00611
00612   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
00613   {
00614     /* Read data value from SDRAM memory */
00615     ret = *(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00616   }
00617   else if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888)
00618   {
00619     /* Read data value from SDRAM memory */
00620     ret = (*(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF);
00621   }
00622   else if((hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
00623           (hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
00624           (hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_AL88))
00625   {
00626     /* Read data value from SDRAM memory */
00627     ret = *(__IO uint16_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00628   }
00629   else
00630   {
00631     /* Read data value from SDRAM memory */
00632     ret = *(__IO uint8_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00633   }
00634
00635   return ret;
00636 }
00637
00638 /**
00639   * @brief  Clears the hole LCD.
00640   * @param  Color: Color of the background
00641   * @retval None
00642   */
00643 void BSP_LCD_Clear(uint32_t Color)
00644 {
00645   /* Clear the LCD */
00646   LL_FillBuffer(ActiveLayer, (uint32_t *)(hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);
00647 }
00648
00649 /**
00650   * @brief  Clears the selected line.
00651   * @param  Line: Line to be cleared
00652   * @retval None
00653   */
00654 void BSP_LCD_ClearStringLine(uint32_t Line)
00655 {
00656   uint32_t color_backup = DrawProp[ActiveLayer].TextColor;
00657   DrawProp[ActiveLayer].TextColor = DrawProp[ActiveLayer].BackColor;
00658
00659   /* Draw rectangle with background color */
00660   BSP_LCD_FillRect(0, (Line * DrawProp[ActiveLayer].pFont->Height), BSP_LCD_GetXSize(), DrawProp[ActiveLayer].pFont->Height);
00661
00662   DrawProp[ActiveLayer].TextColor = color_backup;
00663   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
00664 }
00665
00666 /**
00667   * @brief  Displays one character.
00668   * @param  Xpos: Start column address
00669   * @param  Ypos: Line where to display the character shape.
00670   * @param  Ascii: Character ascii code
00671   *           This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
00672   * @retval None
00673   */
00674 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00675 {
00676   DrawChar(Xpos, Ypos, &DrawProp[ActiveLayer].pFont->table[(Ascii-' ') *\
00677     DrawProp[ActiveLayer].pFont->Height * ((DrawProp[ActiveLayer].pFont->Width + 7) / 8)]);
00678 }
00679
00680 /**
00681   * @brief  Displays characters on the LCD.
00682   * @param  Xpos: X position (in pixel)
00683   * @param  Ypos: Y position (in pixel)
00684   * @param  Text: Pointer to string to display on LCD
00685   * @param  Mode: Display mode
00686   *          This parameter can be one of the following values:
00687   *            @arg  CENTER_MODE
00688   *            @arg  RIGHT_MODE
00689   *            @arg  LEFT_MODE
00690   * @retval None
00691   */
00692 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
00693 {
00694   uint16_t ref_column = 1, i = 0;
00695   uint32_t size = 0, xsize = 0;
00696   uint8_t  *ptr = Text;
00697
00698   /* Get the text size */
00699   while (*ptr++) size ++ ;
00700
00701   /* Characters number per line */
00702   xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
00703
00704   switch (Mode)
00705   {
00706   case CENTER_MODE:
00707     {
00708       ref_column = Xpos + ((xsize - size)* DrawProp[ActiveLayer].pFont->Width) / 2;
00709       break;
00710     }
00711   case LEFT_MODE:
00712     {
00713       ref_column = Xpos;
00714       break;
00715     }
00716   case RIGHT_MODE:
00717     {
00718       ref_column = - Xpos + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
00719       break;
00720     }
00721   default:
00722     {
00723       ref_column = Xpos;
00724       break;
00725     }
00726   }
00727
00728   /* Check that the Start column is located in the screen */
00729   if ((ref_column < 1) || (ref_column >= 0x8000))
00730   {
00731     ref_column = 1;
00732   }
00733
00734   /* Send the string character by character on LCD */
00735   while ((*Text != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
00736   {
00737     /* Display one character on LCD */
00738     BSP_LCD_DisplayChar(ref_column, Ypos, *Text);
00739     /* Decrement the column position by 16 */
00740     ref_column += DrawProp[ActiveLayer].pFont->Width;
00741     /* Point on the next character */
00742     Text++;
00743     i++;
00744   }
00745 }
00746
00747 /**
00748   * @brief  Displays a maximum of 60 characters on the LCD.
00749   * @param  Line: Line where to display the character shape
00750   * @param  ptr: Pointer to string to display on LCD
00751   * @retval None
00752   */
00753 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
00754 {
00755   BSP_LCD_DisplayStringAt(0, LINE(Line), ptr, LEFT_MODE);
00756 }
00757
00758 /**
00759   * @brief  Draws an horizontal line.
00760   * @param  Xpos: X position
00761   * @param  Ypos: Y position
00762   * @param  Length: Line length
00763   * @retval None
00764   */
00765 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00766 {
00767   uint32_t  Xaddress = 0;
00768
00769   /* Get the line address */
00770   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
00771   { /* RGB565 format */
00772     Xaddress = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 2*(BSP_LCD_GetXSize()*Ypos + Xpos);
00773   }
00774   else
00775   { /* ARGB8888 format */
00776     Xaddress = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00777   }
00778
00779   /* Write line */
00780   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, DrawProp[ActiveLayer].TextColor);
00781 }
00782
00783 /**
00784   * @brief  Draws a vertical line.
00785   * @param  Xpos: X position
00786   * @param  Ypos: Y position
00787   * @param  Length: Line length
00788   * @retval None
00789   */
00790 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00791 {
00792   uint32_t  Xaddress = 0;
00793
00794   /* Get the line address */
00795   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
00796   { /* RGB565 format */
00797     Xaddress = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 2*(BSP_LCD_GetXSize()*Ypos + Xpos);
00798   }
00799   else
00800   { /* ARGB8888 format */
00801     Xaddress = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00802   }
00803
00804   /* Write line */
00805   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, 1, Length, (BSP_LCD_GetXSize() - 1), DrawProp[ActiveLayer].TextColor);
00806 }
00807
00808 /**
00809   * @brief  Draws an uni-line (between two points).
00810   * @param  x1: Point 1 X position
00811   * @param  y1: Point 1 Y position
00812   * @param  x2: Point 2 X position
00813   * @param  y2: Point 2 Y position
00814   * @retval None
00815   */
00816 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
00817 {
00818   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
00819   yinc1 = 0, yinc2 = 0, den = 0, num = 0, num_add = 0, num_pixels = 0,
00820   curpixel = 0;
00821
00822   deltax = ABS(x2 - x1);        /* The difference between the x's */
00823   deltay = ABS(y2 - y1);        /* The difference between the y's */
00824   x = x1;                       /* Start x off at the first pixel */
00825   y = y1;                       /* Start y off at the first pixel */
00826
00827   if (x2 >= x1)                 /* The x-values are increasing */
00828   {
00829     xinc1 = 1;
00830     xinc2 = 1;
00831   }
00832   else                          /* The x-values are decreasing */
00833   {
00834     xinc1 = -1;
00835     xinc2 = -1;
00836   }
00837
00838   if (y2 >= y1)                 /* The y-values are increasing */
00839   {
00840     yinc1 = 1;
00841     yinc2 = 1;
00842   }
00843   else                          /* The y-values are decreasing */
00844   {
00845     yinc1 = -1;
00846     yinc2 = -1;
00847   }
00848
00849   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
00850   {
00851     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
00852     yinc2 = 0;                  /* Don't change the y for every iteration */
00853     den = deltax;
00854     num = deltax / 2;
00855     num_add = deltay;
00856     num_pixels = deltax;         /* There are more x-values than y-values */
00857   }
00858   else                          /* There is at least one y-value for every x-value */
00859   {
00860     xinc2 = 0;                  /* Don't change the x for every iteration */
00861     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
00862     den = deltay;
00863     num = deltay / 2;
00864     num_add = deltax;
00865     num_pixels = deltay;         /* There are more y-values than x-values */
00866   }
00867
00868   for (curpixel = 0; curpixel <= num_pixels; curpixel++)
00869   {
00870     BSP_LCD_DrawPixel(x, y, DrawProp[ActiveLayer].TextColor);   /* Draw the current pixel */
00871     num += num_add;                            /* Increase the numerator by the top of the fraction */
00872     if (num >= den)                           /* Check if numerator >= denominator */
00873     {
00874       num -= den;                             /* Calculate the new numerator value */
00875       x += xinc1;                             /* Change the x as appropriate */
00876       y += yinc1;                             /* Change the y as appropriate */
00877     }
00878     x += xinc2;                               /* Change the x as appropriate */
00879     y += yinc2;                               /* Change the y as appropriate */
00880   }
00881 }
00882
00883 /**
00884   * @brief  Draws a rectangle.
00885   * @param  Xpos: X position
00886   * @param  Ypos: Y position
00887   * @param  Width: Rectangle width
00888   * @param  Height: Rectangle height
00889   * @retval None
00890   */
00891 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00892 {
00893   /* Draw horizontal lines */
00894   BSP_LCD_DrawHLine(Xpos, Ypos, Width);
00895   BSP_LCD_DrawHLine(Xpos, (Ypos+ Height), Width);
00896
00897   /* Draw vertical lines */
00898   BSP_LCD_DrawVLine(Xpos, Ypos, Height);
00899   BSP_LCD_DrawVLine((Xpos + Width), Ypos, Height);
00900 }
00901
00902 /**
00903   * @brief  Draws a circle.
00904   * @param  Xpos: X position
00905   * @param  Ypos: Y position
00906   * @param  Radius: Circle radius
00907   * @retval None
00908   */
00909 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00910 {
00911   int32_t   decision;    /* Decision Variable */
00912   uint32_t  current_x;   /* Current X Value */
00913   uint32_t  current_y;   /* Current Y Value */
00914
00915   decision = 3 - (Radius << 1);
00916   current_x = 0;
00917   current_y = Radius;
00918
00919   while (current_x <= current_y)
00920   {
00921     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos - current_y), DrawProp[ActiveLayer].TextColor);
00922
00923     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos - current_y), DrawProp[ActiveLayer].TextColor);
00924
00925     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos - current_x), DrawProp[ActiveLayer].TextColor);
00926
00927     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos - current_x), DrawProp[ActiveLayer].TextColor);
00928
00929     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos + current_y), DrawProp[ActiveLayer].TextColor);
00930
00931     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos + current_y), DrawProp[ActiveLayer].TextColor);
00932
00933     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos + current_x), DrawProp[ActiveLayer].TextColor);
00934
00935     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos + current_x), DrawProp[ActiveLayer].TextColor);
00936
00937     if (decision < 0)
00938     {
00939       decision += (current_x << 2) + 6;
00940     }
00941     else
00942     {
00943       decision += ((current_x - current_y) << 2) + 10;
00944       current_y--;
00945     }
00946     current_x++;
00947   }
00948 }
00949
00950 /**
00951   * @brief  Draws an poly-line (between many points).
00952   * @param  Points: Pointer to the points array
00953   * @param  PointCount: Number of points
00954   * @retval None
00955   */
00956 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount)
00957 {
00958   int16_t x = 0, y = 0;
00959
00960   if(PointCount < 2)
00961   {
00962     return;
00963   }
00964
00965   BSP_LCD_DrawLine(Points->X, Points->Y, (Points+PointCount-1)->X, (Points+PointCount-1)->Y);
00966
00967   while(--PointCount)
00968   {
00969     x = Points->X;
00970     y = Points->Y;
00971     Points++;
00972     BSP_LCD_DrawLine(x, y, Points->X, Points->Y);
00973   }
00974 }
00975
00976 /**
00977   * @brief  Draws an ellipse on LCD.
00978   * @param  Xpos: X position
00979   * @param  Ypos: Y position
00980   * @param  XRadius: Ellipse X radius
00981   * @param  YRadius: Ellipse Y radius
00982   * @retval None
00983   */
00984 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00985 {
00986   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
00987   float k = 0, rad1 = 0, rad2 = 0;
00988
00989   rad1 = XRadius;
00990   rad2 = YRadius;
00991
00992   k = (float)(rad2/rad1);
00993
00994   do {
00995     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/k)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
00996     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/k)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
00997     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/k)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
00998     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/k)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
00999
01000     e2 = err;
01001     if (e2 <= x) {
01002       err += ++x*2+1;
01003       if (-y == x && e2 <= y) e2 = 0;
01004     }
01005     if (e2 > y) err += ++y*2+1;
01006   }
01007   while (y <= 0);
01008 }
01009
01010 /**
01011   * @brief  Draws a pixel on LCD.
01012   * @param  Xpos: X position
01013   * @param  Ypos: Y position
01014   * @param  RGB_Code: Pixel color in ARGB mode (8-8-8-8)
01015   * @retval None
01016   */
01017 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
01018 {
01019   /* Write data value to all SDRAM memory */
01020   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
01021   { /* RGB565 format */
01022     *(__IO uint16_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos))) = (uint16_t)RGB_Code;
01023   }
01024   else
01025   { /* ARGB8888 format */
01026     *(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
01027   }
01028 }
01029
01030 /**
01031   * @brief  Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel).
01032   * @param  Xpos: Bmp X position in the LCD
01033   * @param  Ypos: Bmp Y position in the LCD
01034   * @param  pbmp: Pointer to Bmp picture address in the internal Flash
01035   * @retval None
01036   */
01037 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
01038 {
01039   uint32_t index = 0, width = 0, height = 0, bit_pixel = 0;
01040   uint32_t address;
01041   uint32_t input_color_mode = 0;
01042
01043   /* Get bitmap data address offset */
01044   index = *(__IO uint16_t *) (pbmp + 10);
01045   index |= (*(__IO uint16_t *) (pbmp + 12)) << 16;
01046
01047   /* Read bitmap width */
01048   width = *(uint16_t *) (pbmp + 18);
01049   width |= (*(uint16_t *) (pbmp + 20)) << 16;
01050
01051   /* Read bitmap height */
01052   height = *(uint16_t *) (pbmp + 22);
01053   height |= (*(uint16_t *) (pbmp + 24)) << 16;
01054
01055   /* Read bit/pixel */
01056   bit_pixel = *(uint16_t *) (pbmp + 28);
01057
01058   /* Set the address */
01059   address = hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (((BSP_LCD_GetXSize()*Ypos) + Xpos)*(4));
01060
01061   /* Get the layer pixel format */
01062   if ((bit_pixel/8) == 4)
01063   {
01064     input_color_mode = CM_ARGB8888;
01065   }
01066   else if ((bit_pixel/8) == 2)
01067   {
01068     input_color_mode = CM_RGB565;
01069   }
01070   else
01071   {
01072     input_color_mode = CM_RGB888;
01073   }
01074
01075   /* Bypass the bitmap header */
01076   pbmp += (index + (width * (height - 1) * (bit_pixel/8)));
01077
01078   /* Convert picture to ARGB8888 pixel format */
01079   for(index=0; index < height; index++)
01080   {
01081     /* Pixel format conversion */
01082     LL_ConvertLineToARGB8888((uint32_t *)pbmp, (uint32_t *)address, width, input_color_mode);
01083
01084     /* Increment the source and destination buffers */
01085     address+=  (BSP_LCD_GetXSize()*4);
01086     pbmp -= width*(bit_pixel/8);
01087   }
01088 }
01089
01090 /**
01091   * @brief  Draws a full rectangle.
01092   * @param  Xpos: X position
01093   * @param  Ypos: Y position
01094   * @param  Width: Rectangle width
01095   * @param  Height: Rectangle height
01096   * @retval None
01097   */
01098 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01099 {
01100   uint32_t  x_address = 0;
01101
01102   /* Set the text color */
01103   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01104
01105   /* Get the rectangle start address */
01106   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
01107   { /* RGB565 format */
01108     x_address = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 2*(BSP_LCD_GetXSize()*Ypos + Xpos);
01109   }
01110   else
01111   { /* ARGB8888 format */
01112     x_address = (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01113   }
01114   /* Fill the rectangle */
01115   LL_FillBuffer(ActiveLayer, (uint32_t *)x_address, Width, Height, (BSP_LCD_GetXSize() - Width), DrawProp[ActiveLayer].TextColor);
01116 }
01117
01118 /**
01119   * @brief  Draws a full circle.
01120   * @param  Xpos: X position
01121   * @param  Ypos: Y position
01122   * @param  Radius: Circle radius
01123   * @retval None
01124   */
01125 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
01126 {
01127   int32_t  decision;     /* Decision Variable */
01128   uint32_t  current_x;   /* Current X Value */
01129   uint32_t  current_y;   /* Current Y Value */
01130
01131   decision = 3 - (Radius << 1);
01132
01133   current_x = 0;
01134   current_y = Radius;
01135
01136   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01137
01138   while (current_x <= current_y)
01139   {
01140     if(current_y > 0)
01141     {
01142       BSP_LCD_DrawHLine(Xpos - current_y, Ypos + current_x, 2*current_y);
01143       BSP_LCD_DrawHLine(Xpos - current_y, Ypos - current_x, 2*current_y);
01144     }
01145
01146     if(current_x > 0)
01147     {
01148       BSP_LCD_DrawHLine(Xpos - current_x, Ypos - current_y, 2*current_x);
01149       BSP_LCD_DrawHLine(Xpos - current_x, Ypos + current_y, 2*current_x);
01150     }
01151     if (decision < 0)
01152     {
01153       decision += (current_x << 2) + 6;
01154     }
01155     else
01156     {
01157       decision += ((current_x - current_y) << 2) + 10;
01158       current_y--;
01159     }
01160     current_x++;
01161   }
01162
01163   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01164   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
01165 }
01166
01167 /**
01168   * @brief  Draws a full poly-line (between many points).
01169   * @param  Points: Pointer to the points array
01170   * @param  PointCount: Number of points
01171   * @retval None
01172   */
01173 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount)
01174 {
01175   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;
01176   uint16_t  image_left = 0, image_right = 0, image_top = 0, image_bottom = 0;
01177
01178   image_left = image_right = Points->X;
01179   image_top= image_bottom = Points->Y;
01180
01181   for(counter = 1; counter < PointCount; counter++)
01182   {
01183     pixelX = POLY_X(counter);
01184     if(pixelX < image_left)
01185     {
01186       image_left = pixelX;
01187     }
01188     if(pixelX > image_right)
01189     {
01190       image_right = pixelX;
01191     }
01192
01193     pixelY = POLY_Y(counter);
01194     if(pixelY < image_top)
01195     {
01196       image_top = pixelY;
01197     }
01198     if(pixelY > image_bottom)
01199     {
01200       image_bottom = pixelY;
01201     }
01202   }
01203
01204   if(PointCount < 2)
01205   {
01206     return;
01207   }
01208
01209   X_center = (image_left + image_right)/2;
01210   Y_center = (image_bottom + image_top)/2;
01211
01212   X_first = Points->X;
01213   Y_first = Points->Y;
01214
01215   while(--PointCount)
01216   {
01217     X = Points->X;
01218     Y = Points->Y;
01219     Points++;
01220     X2 = Points->X;
01221     Y2 = Points->Y;
01222
01223     FillTriangle(X, X2, X_center, Y, Y2, Y_center);
01224     FillTriangle(X, X_center, X2, Y, Y_center, Y2);
01225     FillTriangle(X_center, X2, X, Y_center, Y2, Y);
01226   }
01227
01228   FillTriangle(X_first, X2, X_center, Y_first, Y2, Y_center);
01229   FillTriangle(X_first, X_center, X2, Y_first, Y_center, Y2);
01230   FillTriangle(X_center, X2, X_first, Y_center, Y2, Y_first);
01231 }
01232
01233 /**
01234   * @brief  Draws a full ellipse.
01235   * @param  Xpos: X position
01236   * @param  Ypos: Y position
01237   * @param  XRadius: Ellipse X radius
01238   * @param  YRadius: Ellipse Y radius
01239   * @retval None
01240   */
01241 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01242 {
01243   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01244   float k = 0, rad1 = 0, rad2 = 0;
01245
01246   rad1 = XRadius;
01247   rad2 = YRadius;
01248
01249   k = (float)(rad2/rad1);
01250
01251   do
01252   {
01253     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/k)), (Ypos+y), (2*(uint16_t)(x/k) + 1));
01254     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/k)), (Ypos-y), (2*(uint16_t)(x/k) + 1));
01255
01256     e2 = err;
01257     if (e2 <= x)
01258     {
01259       err += ++x*2+1;
01260       if (-y == x && e2 <= y) e2 = 0;
01261     }
01262     if (e2 > y) err += ++y*2+1;
01263   }
01264   while (y <= 0);
01265 }
01266
01267 /**
01268   * @brief  Enables the display.
01269   * @retval None
01270   */
01271 void BSP_LCD_DisplayOn(void)
01272 {
01273   /* Display On */
01274   __HAL_LTDC_ENABLE(&hLtdcHandler);
01275   HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_SET);        /* Assert LCD_DISP pin */
01276   HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);  /* Assert LCD_BL_CTRL pin */
01277 }
01278
01279 /**
01280   * @brief  Disables the display.
01281   * @retval None
01282   */
01283 void BSP_LCD_DisplayOff(void)
01284 {
01285   /* Display Off */
01286   __HAL_LTDC_DISABLE(&hLtdcHandler);
01287   HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_RESET);      /* De-assert LCD_DISP pin */
01288   HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_RESET);/* De-assert LCD_BL_CTRL pin */
01289 }
01290
01291 /**
01292   * @brief  Initializes the LTDC MSP.
01293   * @param  hltdc: LTDC handle
01294   * @param  Params
01295   * @retval None
01296   */
01297 __weak void BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params)
01298 {
01299   GPIO_InitTypeDef gpio_init_structure;
01300
01301   /* Enable the LTDC and DMA2D clocks */
01302   __HAL_RCC_LTDC_CLK_ENABLE();
01303   __HAL_RCC_DMA2D_CLK_ENABLE();
01304
01305   /* Enable GPIOs clock */
01306   __HAL_RCC_GPIOE_CLK_ENABLE();
01307   __HAL_RCC_GPIOG_CLK_ENABLE();
01308   __HAL_RCC_GPIOI_CLK_ENABLE();
01309   __HAL_RCC_GPIOJ_CLK_ENABLE();
01310   __HAL_RCC_GPIOK_CLK_ENABLE();
01311   LCD_DISP_GPIO_CLK_ENABLE();
01312   LCD_BL_CTRL_GPIO_CLK_ENABLE();
01313
01314   /*** LTDC Pins configuration ***/
01315   /* GPIOE configuration */
01316   gpio_init_structure.Pin       = GPIO_PIN_4;
01317   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01318   gpio_init_structure.Pull      = GPIO_NOPULL;
01319   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
01320   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01321   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
01322
01323   /* GPIOG configuration */
01324   gpio_init_structure.Pin       = GPIO_PIN_12;
01325   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01326   gpio_init_structure.Alternate = GPIO_AF9_LTDC;
01327   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
01328
01329   /* GPIOI LTDC alternate configuration */
01330   gpio_init_structure.Pin       = GPIO_PIN_9 | GPIO_PIN_10 | \
01331                                   GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01332   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01333   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01334   HAL_GPIO_Init(GPIOI, &gpio_init_structure);
01335
01336   /* GPIOJ configuration */
01337   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01338                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | \
01339                                   GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | \
01340                                   GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01341   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01342   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01343   HAL_GPIO_Init(GPIOJ, &gpio_init_structure);
01344
01345   /* GPIOK configuration */
01346   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | \
01347                                   GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7;
01348   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01349   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01350   HAL_GPIO_Init(GPIOK, &gpio_init_structure);
01351
01352   /* LCD_DISP GPIO configuration */
01353   gpio_init_structure.Pin       = LCD_DISP_PIN;     /* LCD_DISP pin has to be manually controlled */
01354   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
01355   HAL_GPIO_Init(LCD_DISP_GPIO_PORT, &gpio_init_structure);
01356
01357   /* LCD_BL_CTRL GPIO configuration */
01358   gpio_init_structure.Pin       = LCD_BL_CTRL_PIN;  /* LCD_BL_CTRL pin has to be manually controlled */
01359   gpio_init_structure.Mode      = GPIO_MODE_OUTPUT_PP;
01360   HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &gpio_init_structure);
01361 }
01362
01363 /**
01364   * @brief  DeInitializes BSP_LCD MSP.
01365   * @param  hltdc: LTDC handle
01366   * @param  Params
01367   * @retval None
01368   */
01369 __weak void BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params)
01370 {
01371   GPIO_InitTypeDef  gpio_init_structure;
01372
01373   /* Disable LTDC block */
01374   __HAL_LTDC_DISABLE(hltdc);
01375
01376   /* LTDC Pins deactivation */
01377
01378   /* GPIOE deactivation */
01379   gpio_init_structure.Pin       = GPIO_PIN_4;
01380   HAL_GPIO_DeInit(GPIOE, gpio_init_structure.Pin);
01381
01382   /* GPIOG deactivation */
01383   gpio_init_structure.Pin       = GPIO_PIN_12;
01384   HAL_GPIO_DeInit(GPIOG, gpio_init_structure.Pin);
01385
01386   /* GPIOI deactivation */
01387   gpio_init_structure.Pin       = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_12 | \
01388                                   GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01389   HAL_GPIO_DeInit(GPIOI, gpio_init_structure.Pin);
01390
01391   /* GPIOJ deactivation */
01392   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01393                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | \
01394                                   GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | \
01395                                   GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01396   HAL_GPIO_DeInit(GPIOJ, gpio_init_structure.Pin);
01397
01398   /* GPIOK deactivation */
01399   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | \
01400                                   GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7;
01401   HAL_GPIO_DeInit(GPIOK, gpio_init_structure.Pin);
01402
01403   /* Disable LTDC clock */
01404   __HAL_RCC_LTDC_CLK_DISABLE();
01405
01406   /* GPIO pins clock can be shut down in the application
01407      by surcharging this __weak function */
01408 }
01409
01410 /**
01411   * @brief  Clock Config.
01412   * @param  hltdc: LTDC handle
01413   * @param  Params
01414   * @note   This API is called by BSP_LCD_Init()
01415   *         Being __weak it can be overwritten by the application
01416   * @retval None
01417   */
01418 __weak void BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params)
01419 {
01420   static RCC_PeriphCLKInitTypeDef  periph_clk_init_struct;
01421
01422   /* RK043FN48H LCD clock configuration */
01423   /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
01424   /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */
01425   /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/5 = 38.4 Mhz */
01426   /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_4 = 38.4/4 = 9.6Mhz */
01427   periph_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
01428   periph_clk_init_struct.PLLSAI.PLLSAIN = 192;
01429   periph_clk_init_struct.PLLSAI.PLLSAIR = RK043FN48H_FREQUENCY_DIVIDER;
01430   periph_clk_init_struct.PLLSAIDivR = RCC_PLLSAIDIVR_4;
01431   HAL_RCCEx_PeriphCLKConfig(&periph_clk_init_struct);
01432 }
01433
01434
01435 /*******************************************************************************
01436                             Static Functions
01437 *******************************************************************************/
01438
01439 /**
01440   * @brief  Draws a character on LCD.
01441   * @param  Xpos: Line where to display the character shape
01442   * @param  Ypos: Start column address
01443   * @param  c: Pointer to the character data
01444   * @retval None
01445   */
01446 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
01447 {
01448   uint32_t i = 0, j = 0;
01449   uint16_t height, width;
01450   uint8_t  offset;
01451   uint8_t  *pchar;
01452   uint32_t line;
01453
01454   height = DrawProp[ActiveLayer].pFont->Height;
01455   width  = DrawProp[ActiveLayer].pFont->Width;
01456
01457   offset =  8 *((width + 7)/8) -  width ;
01458
01459   for(i = 0; i < height; i++)
01460   {
01461     pchar = ((uint8_t *)c + (width + 7)/8 * i);
01462
01463     switch(((width + 7)/8))
01464     {
01465
01466     case 1:
01467       line =  pchar[0];
01468       break;
01469
01470     case 2:
01471       line =  (pchar[0]<< 8) | pchar[1];
01472       break;
01473
01474     case 3:
01475     default:
01476       line =  (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];
01477       break;
01478     }
01479
01480     for (j = 0; j < width; j++)
01481     {
01482       if(line & (1 << (width- j + offset- 1)))
01483       {
01484         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].TextColor);
01485       }
01486       else
01487       {
01488         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].BackColor);
01489       }
01490     }
01491     Ypos++;
01492   }
01493 }
01494
01495 /**
01496   * @brief  Fills a triangle (between 3 points).
01497   * @param  x1: Point 1 X position
01498   * @param  y1: Point 1 Y position
01499   * @param  x2: Point 2 X position
01500   * @param  y2: Point 2 Y position
01501   * @param  x3: Point 3 X position
01502   * @param  y3: Point 3 Y position
01503   * @retval None
01504   */
01505 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
01506 {
01507   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01508   yinc1 = 0, yinc2 = 0, den = 0, num = 0, num_add = 0, num_pixels = 0,
01509   curpixel = 0;
01510
01511   deltax = ABS(x2 - x1);        /* The difference between the x's */
01512   deltay = ABS(y2 - y1);        /* The difference between the y's */
01513   x = x1;                       /* Start x off at the first pixel */
01514   y = y1;                       /* Start y off at the first pixel */
01515
01516   if (x2 >= x1)                 /* The x-values are increasing */
01517   {
01518     xinc1 = 1;
01519     xinc2 = 1;
01520   }
01521   else                          /* The x-values are decreasing */
01522   {
01523     xinc1 = -1;
01524     xinc2 = -1;
01525   }
01526
01527   if (y2 >= y1)                 /* The y-values are increasing */
01528   {
01529     yinc1 = 1;
01530     yinc2 = 1;
01531   }
01532   else                          /* The y-values are decreasing */
01533   {
01534     yinc1 = -1;
01535     yinc2 = -1;
01536   }
01537
01538   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01539   {
01540     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01541     yinc2 = 0;                  /* Don't change the y for every iteration */
01542     den = deltax;
01543     num = deltax / 2;
01544     num_add = deltay;
01545     num_pixels = deltax;         /* There are more x-values than y-values */
01546   }
01547   else                          /* There is at least one y-value for every x-value */
01548   {
01549     xinc2 = 0;                  /* Don't change the x for every iteration */
01550     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01551     den = deltay;
01552     num = deltay / 2;
01553     num_add = deltax;
01554     num_pixels = deltay;         /* There are more y-values than x-values */
01555   }
01556
01557   for (curpixel = 0; curpixel <= num_pixels; curpixel++)
01558   {
01559     BSP_LCD_DrawLine(x, y, x3, y3);
01560
01561     num += num_add;              /* Increase the numerator by the top of the fraction */
01562     if (num >= den)             /* Check if numerator >= denominator */
01563     {
01564       num -= den;               /* Calculate the new numerator value */
01565       x += xinc1;               /* Change the x as appropriate */
01566       y += yinc1;               /* Change the y as appropriate */
01567     }
01568     x += xinc2;                 /* Change the x as appropriate */
01569     y += yinc2;                 /* Change the y as appropriate */
01570   }
01571 }
01572
01573 /**
01574   * @brief  Fills a buffer.
01575   * @param  LayerIndex: Layer index
01576   * @param  pDst: Pointer to destination buffer
01577   * @param  xSize: Buffer width
01578   * @param  ySize: Buffer height
01579   * @param  OffLine: Offset
01580   * @param  ColorIndex: Color index
01581   * @retval None
01582   */
01583 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
01584 {
01585   /* Register to memory mode with ARGB8888 as color Mode */
01586   hDma2dHandler.Init.Mode         = DMA2D_R2M;
01587   if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
01588   { /* RGB565 format */
01589     hDma2dHandler.Init.ColorMode    = DMA2D_RGB565;
01590   }
01591   else
01592   { /* ARGB8888 format */
01593     hDma2dHandler.Init.ColorMode    = DMA2D_ARGB8888;
01594   }
01595   hDma2dHandler.Init.OutputOffset = OffLine;
01596
01597   hDma2dHandler.Instance = DMA2D;
01598
01599   /* DMA2D Initialization */
01600   if(HAL_DMA2D_Init(&hDma2dHandler) == HAL_OK)
01601   {
01602     if(HAL_DMA2D_ConfigLayer(&hDma2dHandler, LayerIndex) == HAL_OK)
01603     {
01604       if (HAL_DMA2D_Start(&hDma2dHandler, ColorIndex, (uint32_t)pDst, xSize, ySize) == HAL_OK)
01605       {
01606         /* Polling For DMA transfer */
01607         HAL_DMA2D_PollForTransfer(&hDma2dHandler, 10);
01608       }
01609     }
01610   }
01611 }
01612
01613 /**
01614   * @brief  Converts a line to an ARGB8888 pixel format.
01615   * @param  pSrc: Pointer to source buffer
01616   * @param  pDst: Output color
01617   * @param  xSize: Buffer width
01618   * @param  ColorMode: Input color mode
01619   * @retval None
01620   */
01621 static void LL_ConvertLineToARGB8888(void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
01622 {
01623   /* Configure the DMA2D Mode, Color Mode and output offset */
01624   hDma2dHandler.Init.Mode         = DMA2D_M2M_PFC;
01625   hDma2dHandler.Init.ColorMode    = DMA2D_ARGB8888;
01626   hDma2dHandler.Init.OutputOffset = 0;
01627
01628   /* Foreground Configuration */
01629   hDma2dHandler.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
01630   hDma2dHandler.LayerCfg[1].InputAlpha = 0xFF;
01631   hDma2dHandler.LayerCfg[1].InputColorMode = ColorMode;
01632   hDma2dHandler.LayerCfg[1].InputOffset = 0;
01633
01634   hDma2dHandler.Instance = DMA2D;
01635
01636   /* DMA2D Initialization */
01637   if(HAL_DMA2D_Init(&hDma2dHandler) == HAL_OK)
01638   {
01639     if(HAL_DMA2D_ConfigLayer(&hDma2dHandler, 1) == HAL_OK)
01640     {
01641       if (HAL_DMA2D_Start(&hDma2dHandler, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1) == HAL_OK)
01642       {
01643         /* Polling For DMA transfer */
01644         HAL_DMA2D_PollForTransfer(&hDma2dHandler, 10);
01645       }
01646     }
01647   }
01648 }
01649
01650 /**
01651   * @}
01652   */
01653
01654 /**
01655   * @}
01656   */
01657
01658 /**
01659   * @}
01660   */
01661
01662 /**
01663   * @}
01664   */
01665
01666 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_lcd.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_LCD_H
00039 #define __STM32746G_DISCOVERY_LCD_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include LCD component Driver */
00047 /* LCD RK043FN48H-CT672B 4,3" 480x272 pixels */
00048 #include "../Components/rk043fn48h/rk043fn48h.h"
00049
00050 /* Include SDRAM Driver */
00051 #include "stm32746g_discovery_sdram.h"
00052
00053 #include "stm32746g_discovery.h"
00054 #include "../../../Utilities/Fonts/fonts.h"
00055
00056 /** @addtogroup BSP
00057   * @{
00058   */
00059
00060 /** @addtogroup STM32746G_DISCOVERY
00061   * @{
00062   */
00063
00064 /** @addtogroup STM32746G_DISCOVERY_LCD
00065   * @{
00066   */
00067
00068 /** @defgroup STM32746G_DISCOVERY_LCD_Exported_Types STM32746G_DISCOVERY_LCD Exported Types
00069   * @{
00070   */
00071 typedef struct
00072 {
00073   uint32_t TextColor;
00074   uint32_t BackColor;
00075   sFONT    *pFont;
00076 }LCD_DrawPropTypeDef;
00077
00078 typedef struct
00079 {
00080   int16_t X;
00081   int16_t Y;
00082 }Point, * pPoint;
00083
00084 /**
00085   * @brief  Line mode structures definition
00086   */
00087 typedef enum
00088 {
00089   CENTER_MODE             = 0x01,    /* Center mode */
00090   RIGHT_MODE              = 0x02,    /* Right mode  */
00091   LEFT_MODE               = 0x03     /* Left mode   */
00092 }Text_AlignModeTypdef;
00093
00094 /**
00095   * @}
00096   */
00097
00098 /** @defgroup STM32746G_DISCOVERY_LCD_Exported_Constants STM32746G_DISCOVERY_LCD Exported Constants
00099   * @{
00100   */
00101 #define MAX_LAYER_NUMBER       ((uint32_t)2)
00102
00103 #define LCD_LayerCfgTypeDef    LTDC_LayerCfgTypeDef
00104
00105 #define LTDC_ACTIVE_LAYER            ((uint32_t)1) /* Layer 1 */
00106 /**
00107   * @brief  LCD status structure definition
00108   */
00109 #define LCD_OK                 ((uint8_t)0x00)
00110 #define LCD_ERROR              ((uint8_t)0x01)
00111 #define LCD_TIMEOUT            ((uint8_t)0x02)
00112
00113 /**
00114   * @brief  LCD FB_StartAddress
00115   */
00116 #define LCD_FB_START_ADDRESS       ((uint32_t)0xC0000000)
00117
00118 /**
00119   * @brief  LCD color
00120   */
00121 #define LCD_COLOR_BLUE          ((uint32_t)0xFF0000FF)
00122 #define LCD_COLOR_GREEN         ((uint32_t)0xFF00FF00)
00123 #define LCD_COLOR_RED           ((uint32_t)0xFFFF0000)
00124 #define LCD_COLOR_CYAN          ((uint32_t)0xFF00FFFF)
00125 #define LCD_COLOR_MAGENTA       ((uint32_t)0xFFFF00FF)
00126 #define LCD_COLOR_YELLOW        ((uint32_t)0xFFFFFF00)
00127 #define LCD_COLOR_LIGHTBLUE     ((uint32_t)0xFF8080FF)
00128 #define LCD_COLOR_LIGHTGREEN    ((uint32_t)0xFF80FF80)
00129 #define LCD_COLOR_LIGHTRED      ((uint32_t)0xFFFF8080)
00130 #define LCD_COLOR_LIGHTCYAN     ((uint32_t)0xFF80FFFF)
00131 #define LCD_COLOR_LIGHTMAGENTA  ((uint32_t)0xFFFF80FF)
00132 #define LCD_COLOR_LIGHTYELLOW   ((uint32_t)0xFFFFFF80)
00133 #define LCD_COLOR_DARKBLUE      ((uint32_t)0xFF000080)
00134 #define LCD_COLOR_DARKGREEN     ((uint32_t)0xFF008000)
00135 #define LCD_COLOR_DARKRED       ((uint32_t)0xFF800000)
00136 #define LCD_COLOR_DARKCYAN      ((uint32_t)0xFF008080)
00137 #define LCD_COLOR_DARKMAGENTA   ((uint32_t)0xFF800080)
00138 #define LCD_COLOR_DARKYELLOW    ((uint32_t)0xFF808000)
00139 #define LCD_COLOR_WHITE         ((uint32_t)0xFFFFFFFF)
00140 #define LCD_COLOR_LIGHTGRAY     ((uint32_t)0xFFD3D3D3)
00141 #define LCD_COLOR_GRAY          ((uint32_t)0xFF808080)
00142 #define LCD_COLOR_DARKGRAY      ((uint32_t)0xFF404040)
00143 #define LCD_COLOR_BLACK         ((uint32_t)0xFF000000)
00144 #define LCD_COLOR_BROWN         ((uint32_t)0xFFA52A2A)
00145 #define LCD_COLOR_ORANGE        ((uint32_t)0xFFFFA500)
00146 #define LCD_COLOR_TRANSPARENT   ((uint32_t)0xFF000000)
00147
00148 /**
00149   * @brief LCD default font
00150   */
00151 #define LCD_DEFAULT_FONT        Font24
00152
00153 /**
00154   * @brief  LCD Reload Types
00155   */
00156 #define LCD_RELOAD_IMMEDIATE               ((uint32_t)LTDC_SRCR_IMR)
00157 #define LCD_RELOAD_VERTICAL_BLANKING       ((uint32_t)LTDC_SRCR_VBR)
00158
00159
00160 /**
00161   * @brief LCD special pins
00162   */
00163 /* Display enable pin */
00164 #define LCD_DISP_PIN                    GPIO_PIN_12
00165 #define LCD_DISP_GPIO_PORT              GPIOI
00166 #define LCD_DISP_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOI_CLK_ENABLE()
00167 #define LCD_DISP_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOI_CLK_DISABLE()
00168
00169 /* Backlight control pin */
00170 #define LCD_BL_CTRL_PIN                  GPIO_PIN_3
00171 #define LCD_BL_CTRL_GPIO_PORT            GPIOK
00172 #define LCD_BL_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOK_CLK_ENABLE()
00173 #define LCD_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOK_CLK_DISABLE()
00174
00175 /**
00176   * @}
00177   */
00178
00179 /** @addtogroup STM32746G_DISCOVERY_LCD_Exported_Functions
00180   * @{
00181   */
00182 uint8_t  BSP_LCD_Init(void);
00183 uint8_t  BSP_LCD_DeInit(void);
00184 uint32_t BSP_LCD_GetXSize(void);
00185 uint32_t BSP_LCD_GetYSize(void);
00186 void     BSP_LCD_SetXSize(uint32_t imageWidthPixels);
00187 void     BSP_LCD_SetYSize(uint32_t imageHeightPixels);
00188
00189 /* Functions using the LTDC controller */
00190 void     BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
00191 void     BSP_LCD_LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address);
00192 void     BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
00193 void     BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency);
00194 void     BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
00195 void     BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address);
00196 void     BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
00197 void     BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue);
00198 void     BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
00199 void     BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex);
00200 void     BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00201 void     BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00202 void     BSP_LCD_SelectLayer(uint32_t LayerIndex);
00203 void     BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
00204 void     BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State);
00205 void     BSP_LCD_Reload(uint32_t ReloadType);
00206
00207 void     BSP_LCD_SetTextColor(uint32_t Color);
00208 uint32_t BSP_LCD_GetTextColor(void);
00209 void     BSP_LCD_SetBackColor(uint32_t Color);
00210 uint32_t BSP_LCD_GetBackColor(void);
00211 void     BSP_LCD_SetFont(sFONT *fonts);
00212 sFONT    *BSP_LCD_GetFont(void);
00213
00214 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00215 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
00216 void     BSP_LCD_Clear(uint32_t Color);
00217 void     BSP_LCD_ClearStringLine(uint32_t Line);
00218 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00219 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
00220 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00221
00222 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00223 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00224 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00225 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00226 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00227 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00228 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00229 void     BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
00230
00231 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00232 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00233 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00234 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00235
00236 void     BSP_LCD_DisplayOff(void);
00237 void     BSP_LCD_DisplayOn(void);
00238
00239 /* These functions can be modified in case the current settings
00240    need to be changed for specific application needs */
00241 void     BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params);
00242 void     BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params);
00243 void     BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params);
00244
00245 /**
00246   * @}
00247   */
00248
00249 /**
00250   * @}
00251   */
00252
00253 /**
00254   * @}
00255   */
00256
00257 /**
00258   * @}
00259   */
00260
00261 #ifdef __cplusplus
00262 }
00263 #endif
00264
00265 #endif /* __STM32746G_DISCOVERY_LCD_H */
00266
00267 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_qspi.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_qspi.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_qspi.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the N25Q128A QSPI
00006   *          memory mounted on STM32746G-Discovery board.
00007   @verbatim
00008   ==============================================================================
00009                      ##### How to use this driver #####
00010   ==============================================================================
00011   [..]
00012    (#) This driver is used to drive the N25Q128A QSPI external
00013        memory mounted on STM32746G-Discovery board.
00014
00015    (#) This driver need a specific component driver (N25Q128A) 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) 2016 STMicroelectronics</center></h2>
00039   *
00040   * Redistribution and use in source and binary forms, with or without modification,
00041   * are permitted provided that the following conditions are met:
00042   *   1. Redistributions of source code must retain the above copyright notice,
00043   *      this list of conditions and the following disclaimer.
00044   *   2. Redistributions in binary form must reproduce the above copyright notice,
00045   *      this list of conditions and the following disclaimer in the documentation
00046   *      and/or other materials provided with the distribution.
00047   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00048   *      may be used to endorse or promote products derived from this software
00049   *      without specific prior written permission.
00050   *
00051   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00052   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00053   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00054   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00055   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00056   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00057   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00058   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00059   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00060   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00061   *
00062   ******************************************************************************
00063   */
00064
00065 /* Dependencies
00066 - stm32f7xx_hal_qspi.c
00067 - stm32f7xx_hal_gpio.c
00068 - stm32f7xx_hal_cortex.c
00069 - stm32f7xx_hal_rcc_ex.h
00070 - n25q128a.h
00071 EndDependencies */
00072
00073 /* Includes ------------------------------------------------------------------*/
00074 #include "stm32746g_discovery_qspi.h"
00075
00076 /** @addtogroup BSP
00077   * @{
00078   */
00079
00080 /** @addtogroup STM32746G_DISCOVERY
00081   * @{
00082   */
00083
00084 /** @defgroup STM32746G_DISCOVERY_QSPI STM32746G-Discovery QSPI
00085   * @{
00086   */
00087
00088
00089 /* Private variables ---------------------------------------------------------*/
00090
00091 /** @defgroup STM32746G_DISCOVERY_QSPI_Private_Variables STM32746G_DISCOVERY QSPI Private Variables
00092   * @{
00093   */
00094 QSPI_HandleTypeDef QSPIHandle;
00095
00096 /**
00097   * @}
00098   */
00099
00100
00101
00102 /* Private functions ---------------------------------------------------------*/
00103
00104 /** @defgroup STM32746G_DISCOVERY_QSPI_Private_Functions STM32746G_DISCOVERY QSPI Private Functions
00105   * @{
00106   */
00107 static uint8_t QSPI_ResetMemory          (QSPI_HandleTypeDef *hqspi);
00108 static uint8_t QSPI_DummyCyclesCfg       (QSPI_HandleTypeDef *hqspi);
00109 static uint8_t QSPI_WriteEnable          (QSPI_HandleTypeDef *hqspi);
00110 static uint8_t QSPI_AutoPollingMemReady  (QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
00111
00112 /**
00113   * @}
00114   */
00115
00116 /** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Functions STM32746G_DISCOVERY QSPI Exported Functions
00117   * @{
00118   */
00119
00120 /**
00121   * @brief  Initializes the QSPI interface.
00122   * @retval QSPI memory status
00123   */
00124 uint8_t BSP_QSPI_Init(void)
00125 {
00126   QSPIHandle.Instance = QUADSPI;
00127
00128   /* Call the DeInit function to reset the driver */
00129   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00130   {
00131     return QSPI_ERROR;
00132   }
00133
00134   /* System level initialization */
00135   BSP_QSPI_MspInit(&QSPIHandle, NULL);
00136
00137   /* QSPI initialization */
00138   QSPIHandle.Init.ClockPrescaler     = 1; /* QSPI freq = 216 MHz/(1+1) = 108 Mhz */
00139   QSPIHandle.Init.FifoThreshold      = 4;
00140   QSPIHandle.Init.SampleShifting     = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
00141   QSPIHandle.Init.FlashSize          = POSITION_VAL(N25Q128A_FLASH_SIZE) - 1;
00142   QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE; /* Min 50ns for nonRead */
00143   QSPIHandle.Init.ClockMode          = QSPI_CLOCK_MODE_0;
00144   QSPIHandle.Init.FlashID            = QSPI_FLASH_ID_1;
00145   QSPIHandle.Init.DualFlash          = QSPI_DUALFLASH_DISABLE;
00146
00147   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00148   {
00149     return QSPI_ERROR;
00150   }
00151
00152   /* QSPI memory reset */
00153   if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
00154   {
00155     return QSPI_NOT_SUPPORTED;
00156   }
00157
00158   /* Configuration of the dummy cycles on QSPI memory side */
00159   if (QSPI_DummyCyclesCfg(&QSPIHandle) != QSPI_OK)
00160   {
00161     return QSPI_NOT_SUPPORTED;
00162   }
00163
00164   return QSPI_OK;
00165 }
00166
00167 /**
00168   * @brief  De-Initializes the QSPI interface.
00169   * @retval QSPI memory status
00170   */
00171 uint8_t BSP_QSPI_DeInit(void)
00172 {
00173   QSPIHandle.Instance = QUADSPI;
00174
00175   /* Call the DeInit function to reset the driver */
00176   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00177   {
00178     return QSPI_ERROR;
00179   }
00180
00181   /* System level De-initialization */
00182   BSP_QSPI_MspDeInit(&QSPIHandle, NULL);
00183
00184   return QSPI_OK;
00185 }
00186
00187 /**
00188   * @brief  Reads an amount of data from the QSPI memory.
00189   * @param  pData: Pointer to data to be read
00190   * @param  ReadAddr: Read start address
00191   * @param  Size: Size of data to read
00192   * @retval QSPI memory status
00193   */
00194 uint8_t BSP_QSPI_Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
00195 {
00196   QSPI_CommandTypeDef s_command;
00197
00198   /* Initialize the read command */
00199   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00200   s_command.Instruction       = QUAD_INOUT_FAST_READ_CMD;
00201   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00202   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00203   s_command.Address           = ReadAddr;
00204   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00205   s_command.DataMode          = QSPI_DATA_4_LINES;
00206   s_command.DummyCycles       = N25Q128A_DUMMY_CYCLES_READ_QUAD;
00207   s_command.NbData            = Size;
00208   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00209   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00210   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00211
00212   /* Configure the command */
00213   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00214   {
00215     return QSPI_ERROR;
00216   }
00217
00218   /* Set S# timing for Read command */
00219   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_3_CYCLE);
00220
00221   /* Reception of the data */
00222   if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00223   {
00224     return QSPI_ERROR;
00225   }
00226
00227   /* Restore S# timing for nonRead commands */
00228   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_6_CYCLE);
00229
00230   return QSPI_OK;
00231 }
00232
00233 /**
00234   * @brief  Writes an amount of data to the QSPI memory.
00235   * @param  pData: Pointer to data to be written
00236   * @param  WriteAddr: Write start address
00237   * @param  Size: Size of data to write
00238   * @retval QSPI memory status
00239   */
00240 uint8_t BSP_QSPI_Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
00241 {
00242   QSPI_CommandTypeDef s_command;
00243   uint32_t end_addr, current_size, current_addr;
00244
00245   /* Calculation of the size between the write address and the end of the page */
00246   current_size = N25Q128A_PAGE_SIZE - (WriteAddr % N25Q128A_PAGE_SIZE);
00247
00248   /* Check if the size of the data is less than the remaining place in the page */
00249   if (current_size > Size)
00250   {
00251     current_size = Size;
00252   }
00253
00254   /* Initialize the adress variables */
00255   current_addr = WriteAddr;
00256   end_addr = WriteAddr + Size;
00257
00258   /* Initialize the program command */
00259   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00260   s_command.Instruction       = EXT_QUAD_IN_FAST_PROG_CMD;
00261   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00262   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00263   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00264   s_command.DataMode          = QSPI_DATA_4_LINES;
00265   s_command.DummyCycles       = 0;
00266   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00267   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00268   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00269
00270   /* Perform the write page by page */
00271   do
00272   {
00273     s_command.Address = current_addr;
00274     s_command.NbData  = current_size;
00275
00276     /* Enable write operations */
00277     if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00278     {
00279       return QSPI_ERROR;
00280     }
00281
00282     /* Configure the command */
00283     if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00284     {
00285       return QSPI_ERROR;
00286     }
00287
00288     /* Transmission of the data */
00289     if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00290     {
00291       return QSPI_ERROR;
00292     }
00293
00294     /* Configure automatic polling mode to wait for end of program */
00295     if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00296     {
00297       return QSPI_ERROR;
00298     }
00299
00300     /* Update the address and size variables for next page programming */
00301     current_addr += current_size;
00302     pData += current_size;
00303     current_size = ((current_addr + N25Q128A_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : N25Q128A_PAGE_SIZE;
00304   } while (current_addr < end_addr);
00305
00306   return QSPI_OK;
00307 }
00308
00309 /**
00310   * @brief  Erases the specified block of the QSPI memory.
00311   * @param  BlockAddress: Block address to erase
00312   * @retval QSPI memory status
00313   */
00314 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
00315 {
00316   QSPI_CommandTypeDef s_command;
00317
00318   /* Initialize the erase command */
00319   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00320   s_command.Instruction       = SUBSECTOR_ERASE_CMD;
00321   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00322   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00323   s_command.Address           = BlockAddress;
00324   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00325   s_command.DataMode          = QSPI_DATA_NONE;
00326   s_command.DummyCycles       = 0;
00327   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00328   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00329   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00330
00331   /* Enable write operations */
00332   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00333   {
00334     return QSPI_ERROR;
00335   }
00336
00337   /* Send the command */
00338   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00339   {
00340     return QSPI_ERROR;
00341   }
00342
00343   /* Configure automatic polling mode to wait for end of erase */
00344   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_SUBSECTOR_ERASE_MAX_TIME) != QSPI_OK)
00345   {
00346     return QSPI_ERROR;
00347   }
00348
00349   return QSPI_OK;
00350 }
00351
00352 /**
00353   * @brief  Erases the entire QSPI memory.
00354   * @retval QSPI memory status
00355   */
00356 uint8_t BSP_QSPI_Erase_Chip(void)
00357 {
00358   QSPI_CommandTypeDef s_command;
00359
00360   /* Initialize the erase command */
00361   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00362   s_command.Instruction       = BULK_ERASE_CMD;
00363   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00364   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00365   s_command.DataMode          = QSPI_DATA_NONE;
00366   s_command.DummyCycles       = 0;
00367   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00368   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00369   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00370
00371   /* Enable write operations */
00372   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00373   {
00374     return QSPI_ERROR;
00375   }
00376
00377   /* Send the command */
00378   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00379   {
00380     return QSPI_ERROR;
00381   }
00382
00383   /* Configure automatic polling mode to wait for end of erase */
00384   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_BULK_ERASE_MAX_TIME) != QSPI_OK)
00385   {
00386     return QSPI_ERROR;
00387   }
00388
00389   return QSPI_OK;
00390 }
00391
00392 /**
00393   * @brief  Reads current status of the QSPI memory.
00394   * @retval QSPI memory status
00395   */
00396 uint8_t BSP_QSPI_GetStatus(void)
00397 {
00398   QSPI_CommandTypeDef s_command;
00399   uint8_t reg;
00400
00401   /* Initialize the read flag status register command */
00402   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00403   s_command.Instruction       = READ_FLAG_STATUS_REG_CMD;
00404   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00405   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00406   s_command.DataMode          = QSPI_DATA_1_LINE;
00407   s_command.DummyCycles       = 0;
00408   s_command.NbData            = 1;
00409   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00410   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00411   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00412
00413   /* Configure the command */
00414   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00415   {
00416     return QSPI_ERROR;
00417   }
00418
00419   /* Reception of the data */
00420   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00421   {
00422     return QSPI_ERROR;
00423   }
00424
00425   /* Check the value of the register */
00426   if ((reg & (N25Q128A_FSR_PRERR | N25Q128A_FSR_VPPERR | N25Q128A_FSR_PGERR | N25Q128A_FSR_ERERR)) != 0)
00427   {
00428     return QSPI_ERROR;
00429   }
00430   else if ((reg & (N25Q128A_FSR_PGSUS | N25Q128A_FSR_ERSUS)) != 0)
00431   {
00432     return QSPI_SUSPENDED;
00433   }
00434   else if ((reg & N25Q128A_FSR_READY) != 0)
00435   {
00436     return QSPI_OK;
00437   }
00438   else
00439   {
00440     return QSPI_BUSY;
00441   }
00442 }
00443
00444 /**
00445   * @brief  Return the configuration of the QSPI memory.
00446   * @param  pInfo: pointer on the configuration structure
00447   * @retval QSPI memory status
00448   */
00449 uint8_t BSP_QSPI_GetInfo(QSPI_Info* pInfo)
00450 {
00451   /* Configure the structure with the memory configuration */
00452   pInfo->FlashSize          = N25Q128A_FLASH_SIZE;
00453   pInfo->EraseSectorSize    = N25Q128A_SUBSECTOR_SIZE;
00454   pInfo->EraseSectorsNumber = (N25Q128A_FLASH_SIZE/N25Q128A_SUBSECTOR_SIZE);
00455   pInfo->ProgPageSize       = N25Q128A_PAGE_SIZE;
00456   pInfo->ProgPagesNumber    = (N25Q128A_FLASH_SIZE/N25Q128A_PAGE_SIZE);
00457
00458   return QSPI_OK;
00459 }
00460
00461 /**
00462   * @brief  Configure the QSPI in memory-mapped mode
00463   * @retval QSPI memory status
00464   */
00465 uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
00466 {
00467   QSPI_CommandTypeDef      s_command;
00468   QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
00469
00470   /* Configure the command for the read instruction */
00471   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00472   s_command.Instruction       = QUAD_INOUT_FAST_READ_CMD;
00473   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00474   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00475   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00476   s_command.DataMode          = QSPI_DATA_4_LINES;
00477   s_command.DummyCycles       = N25Q128A_DUMMY_CYCLES_READ_QUAD;
00478   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00479   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00480   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00481
00482   /* Configure the memory mapped mode */
00483   s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
00484   s_mem_mapped_cfg.TimeOutPeriod     = 0;
00485
00486   if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
00487   {
00488     return QSPI_ERROR;
00489   }
00490
00491   return QSPI_OK;
00492 }
00493
00494 /**
00495   * @}
00496   */
00497
00498 /** @addtogroup STM32746G_DISCOVERY_QSPI_Private_Functions
00499   * @{
00500   */
00501
00502 /**
00503   * @brief QSPI MSP Initialization
00504   *        This function configures the hardware resources used in this example:
00505   *           - Peripheral's clock enable
00506   *           - Peripheral's GPIO Configuration
00507   *           - NVIC configuration for QSPI interrupt
00508   * @retval None
00509   */
00510 __weak void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params)
00511 {
00512   GPIO_InitTypeDef gpio_init_structure;
00513
00514   /*##-1- Enable peripherals and GPIO Clocks #################################*/
00515   /* Enable the QuadSPI memory interface clock */
00516   QSPI_CLK_ENABLE();
00517   /* Reset the QuadSPI memory interface */
00518   QSPI_FORCE_RESET();
00519   QSPI_RELEASE_RESET();
00520   /* Enable GPIO clocks */
00521   QSPI_CS_GPIO_CLK_ENABLE();
00522   QSPI_CLK_GPIO_CLK_ENABLE();
00523   QSPI_D0_GPIO_CLK_ENABLE();
00524   QSPI_D1_GPIO_CLK_ENABLE();
00525   QSPI_D2_GPIO_CLK_ENABLE();
00526   QSPI_D3_GPIO_CLK_ENABLE();
00527
00528   /*##-2- Configure peripheral GPIO ##########################################*/
00529   /* QSPI CS GPIO pin configuration  */
00530   gpio_init_structure.Pin       = QSPI_CS_PIN;
00531   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00532   gpio_init_structure.Pull      = GPIO_PULLUP;
00533   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00534   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00535   HAL_GPIO_Init(QSPI_CS_GPIO_PORT, &gpio_init_structure);
00536
00537   /* QSPI CLK GPIO pin configuration  */
00538   gpio_init_structure.Pin       = QSPI_CLK_PIN;
00539   gpio_init_structure.Pull      = GPIO_NOPULL;
00540   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00541   HAL_GPIO_Init(QSPI_CLK_GPIO_PORT, &gpio_init_structure);
00542
00543   /* QSPI D0 GPIO pin configuration  */
00544   gpio_init_structure.Pin       = QSPI_D0_PIN;
00545   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00546   HAL_GPIO_Init(QSPI_D0_GPIO_PORT, &gpio_init_structure);
00547
00548   /* QSPI D1 GPIO pin configuration  */
00549   gpio_init_structure.Pin       = QSPI_D1_PIN;
00550   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00551   HAL_GPIO_Init(QSPI_D1_GPIO_PORT, &gpio_init_structure);
00552
00553   /* QSPI D2 GPIO pin configuration  */
00554   gpio_init_structure.Pin       = QSPI_D2_PIN;
00555   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00556   HAL_GPIO_Init(QSPI_D2_GPIO_PORT, &gpio_init_structure);
00557
00558   /* QSPI D3 GPIO pin configuration  */
00559   gpio_init_structure.Pin       = QSPI_D3_PIN;
00560   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00561   HAL_GPIO_Init(QSPI_D3_GPIO_PORT, &gpio_init_structure);
00562
00563   /*##-3- Configure the NVIC for QSPI #########################################*/
00564   /* NVIC configuration for QSPI interrupt */
00565   HAL_NVIC_SetPriority(QUADSPI_IRQn, 0x0F, 0);
00566   HAL_NVIC_EnableIRQ(QUADSPI_IRQn);
00567 }
00568
00569 /**
00570   * @brief QSPI MSP De-Initialization
00571   *        This function frees the hardware resources used in this example:
00572   *          - Disable the Peripheral's clock
00573   *          - Revert GPIO and NVIC configuration to their default state
00574   * @retval None
00575   */
00576 __weak void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params)
00577 {
00578   /*##-1- Disable the NVIC for QSPI ###########################################*/
00579   HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
00580
00581   /*##-2- Disable peripherals and GPIO Clocks ################################*/
00582   /* De-Configure QSPI pins */
00583   HAL_GPIO_DeInit(QSPI_CS_GPIO_PORT, QSPI_CS_PIN);
00584   HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
00585   HAL_GPIO_DeInit(QSPI_D0_GPIO_PORT, QSPI_D0_PIN);
00586   HAL_GPIO_DeInit(QSPI_D1_GPIO_PORT, QSPI_D1_PIN);
00587   HAL_GPIO_DeInit(QSPI_D2_GPIO_PORT, QSPI_D2_PIN);
00588   HAL_GPIO_DeInit(QSPI_D3_GPIO_PORT, QSPI_D3_PIN);
00589
00590   /*##-3- Reset peripherals ##################################################*/
00591   /* Reset the QuadSPI memory interface */
00592   QSPI_FORCE_RESET();
00593   QSPI_RELEASE_RESET();
00594
00595   /* Disable the QuadSPI memory interface clock */
00596   QSPI_CLK_DISABLE();
00597 }
00598
00599 /**
00600   * @brief  This function reset the QSPI memory.
00601   * @param  hqspi: QSPI handle
00602   * @retval None
00603   */
00604 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
00605 {
00606   QSPI_CommandTypeDef s_command;
00607
00608   /* Initialize the reset enable command */
00609   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00610   s_command.Instruction       = RESET_ENABLE_CMD;
00611   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00612   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00613   s_command.DataMode          = QSPI_DATA_NONE;
00614   s_command.DummyCycles       = 0;
00615   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00616   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00617   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00618
00619   /* Send the command */
00620   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00621   {
00622     return QSPI_ERROR;
00623   }
00624
00625   /* Send the reset memory command */
00626   s_command.Instruction = RESET_MEMORY_CMD;
00627   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00628   {
00629     return QSPI_ERROR;
00630   }
00631
00632   /* Configure automatic polling mode to wait the memory is ready */
00633   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00634   {
00635     return QSPI_ERROR;
00636   }
00637
00638   return QSPI_OK;
00639 }
00640
00641 /**
00642   * @brief  This function configure the dummy cycles on memory side.
00643   * @param  hqspi: QSPI handle
00644   * @retval None
00645   */
00646 static uint8_t QSPI_DummyCyclesCfg(QSPI_HandleTypeDef *hqspi)
00647 {
00648   QSPI_CommandTypeDef s_command;
00649   uint8_t reg;
00650
00651   /* Initialize the read volatile configuration register command */
00652   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00653   s_command.Instruction       = READ_VOL_CFG_REG_CMD;
00654   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00655   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00656   s_command.DataMode          = QSPI_DATA_1_LINE;
00657   s_command.DummyCycles       = 0;
00658   s_command.NbData            = 1;
00659   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00660   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00661   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00662
00663   /* Configure the command */
00664   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00665   {
00666     return QSPI_ERROR;
00667   }
00668
00669   /* Reception of the data */
00670   if (HAL_QSPI_Receive(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00671   {
00672     return QSPI_ERROR;
00673   }
00674
00675   /* Enable write operations */
00676   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00677   {
00678     return QSPI_ERROR;
00679   }
00680
00681   /* Update volatile configuration register (with new dummy cycles) */
00682   s_command.Instruction = WRITE_VOL_CFG_REG_CMD;
00683   MODIFY_REG(reg, N25Q128A_VCR_NB_DUMMY, (N25Q128A_DUMMY_CYCLES_READ_QUAD << POSITION_VAL(N25Q128A_VCR_NB_DUMMY)));
00684
00685   /* Configure the write volatile configuration register command */
00686   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00687   {
00688     return QSPI_ERROR;
00689   }
00690
00691   /* Transmission of the data */
00692   if (HAL_QSPI_Transmit(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00693   {
00694     return QSPI_ERROR;
00695   }
00696
00697   return QSPI_OK;
00698 }
00699
00700 /**
00701   * @brief  This function send a Write Enable and wait it is effective.
00702   * @param  hqspi: QSPI handle
00703   * @retval None
00704   */
00705 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
00706 {
00707   QSPI_CommandTypeDef     s_command;
00708   QSPI_AutoPollingTypeDef s_config;
00709
00710   /* Enable write operations */
00711   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00712   s_command.Instruction       = WRITE_ENABLE_CMD;
00713   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00714   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00715   s_command.DataMode          = QSPI_DATA_NONE;
00716   s_command.DummyCycles       = 0;
00717   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00718   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00719   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00720
00721   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00722   {
00723     return QSPI_ERROR;
00724   }
00725
00726   /* Configure automatic polling mode to wait for write enabling */
00727   s_config.Match           = N25Q128A_SR_WREN;
00728   s_config.Mask            = N25Q128A_SR_WREN;
00729   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00730   s_config.StatusBytesSize = 1;
00731   s_config.Interval        = 0x10;
00732   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00733
00734   s_command.Instruction    = READ_STATUS_REG_CMD;
00735   s_command.DataMode       = QSPI_DATA_1_LINE;
00736
00737   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00738   {
00739     return QSPI_ERROR;
00740   }
00741
00742   return QSPI_OK;
00743 }
00744
00745 /**
00746   * @brief  This function read the SR of the memory and wait the EOP.
00747   * @param  hqspi: QSPI handle
00748   * @param  Timeout
00749   * @retval None
00750   */
00751 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
00752 {
00753   QSPI_CommandTypeDef     s_command;
00754   QSPI_AutoPollingTypeDef s_config;
00755
00756   /* Configure automatic polling mode to wait for memory ready */
00757   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00758   s_command.Instruction       = READ_STATUS_REG_CMD;
00759   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00760   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00761   s_command.DataMode          = QSPI_DATA_1_LINE;
00762   s_command.DummyCycles       = 0;
00763   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00764   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00765   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00766
00767   s_config.Match           = 0;
00768   s_config.Mask            = N25Q128A_SR_WIP;
00769   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00770   s_config.StatusBytesSize = 1;
00771   s_config.Interval        = 0x10;
00772   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00773
00774   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, Timeout) != HAL_OK)
00775   {
00776     return QSPI_ERROR;
00777   }
00778
00779   return QSPI_OK;
00780 }
00781 /**
00782   * @}
00783   */
00784
00785 /**
00786   * @}
00787   */
00788
00789 /**
00790   * @}
00791   */
00792
00793 /**
00794   * @}
00795   */
00796
00797 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00798


STM32746G-Discovery BSP User Manual: stm32746g_discovery_qspi.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_qspi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_qspi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /** @addtogroup BSP
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32746G_DISCOVERY
00042   * @{
00043   */
00044
00045 /* Define to prevent recursive inclusion -------------------------------------*/
00046 #ifndef __STM32746G_DISCOVERY_QSPI_H
00047 #define __STM32746G_DISCOVERY_QSPI_H
00048
00049 #ifdef __cplusplus
00050  extern "C" {
00051 #endif
00052
00053 /* Includes ------------------------------------------------------------------*/
00054 #include "stm32f7xx_hal.h"
00055 #include "../Components/n25q128a/n25q128a.h"
00056
00057 /** @addtogroup STM32746G_DISCOVERY_QSPI
00058   * @{
00059   */
00060
00061
00062 /* Exported constants --------------------------------------------------------*/
00063 /** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Constants STM32746G_DISCOVERY_QSPI Exported Constants
00064   * @{
00065   */
00066 /* QSPI Error codes */
00067 #define QSPI_OK            ((uint8_t)0x00)
00068 #define QSPI_ERROR         ((uint8_t)0x01)
00069 #define QSPI_BUSY          ((uint8_t)0x02)
00070 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00071 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00072
00073
00074 /* Definition for QSPI clock resources */
00075 #define QSPI_CLK_ENABLE()          __HAL_RCC_QSPI_CLK_ENABLE()
00076 #define QSPI_CLK_DISABLE()         __HAL_RCC_QSPI_CLK_DISABLE()
00077 #define QSPI_CS_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOB_CLK_ENABLE()
00078 #define QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
00079 #define QSPI_D0_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOD_CLK_ENABLE()
00080 #define QSPI_D1_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOD_CLK_ENABLE()
00081 #define QSPI_D2_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOE_CLK_ENABLE()
00082 #define QSPI_D3_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOD_CLK_ENABLE()
00083
00084 #define QSPI_FORCE_RESET()         __HAL_RCC_QSPI_FORCE_RESET()
00085 #define QSPI_RELEASE_RESET()       __HAL_RCC_QSPI_RELEASE_RESET()
00086
00087 /* Definition for QSPI Pins */
00088 #define QSPI_CS_PIN                GPIO_PIN_6
00089 #define QSPI_CS_GPIO_PORT          GPIOB
00090 #define QSPI_CLK_PIN               GPIO_PIN_2
00091 #define QSPI_CLK_GPIO_PORT         GPIOB
00092 #define QSPI_D0_PIN                GPIO_PIN_11
00093 #define QSPI_D0_GPIO_PORT          GPIOD
00094 #define QSPI_D1_PIN                GPIO_PIN_12
00095 #define QSPI_D1_GPIO_PORT          GPIOD
00096 #define QSPI_D2_PIN                GPIO_PIN_2
00097 #define QSPI_D2_GPIO_PORT          GPIOE
00098 #define QSPI_D3_PIN                GPIO_PIN_13
00099 #define QSPI_D3_GPIO_PORT          GPIOD
00100
00101 /* N25Q128A13EF840E Micron memory */
00102 /* Size of the flash */
00103 #define QSPI_FLASH_SIZE            23     /* Address bus width to access whole memory space */
00104 #define QSPI_PAGE_SIZE             256
00105
00106 /* This alias is added as the name of Memory mapped fucntion changed */
00107 #define BSP_QSPI_MemoryMappedMode  BSP_QSPI_EnableMemoryMappedMode
00108 /**
00109   * @}
00110   */
00111
00112 /* Exported types ------------------------------------------------------------*/
00113 /** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Types STM32746G_DISCOVERY_QSPI Exported Types
00114   * @{
00115   */
00116 /* QSPI Info */
00117 typedef struct {
00118   uint32_t FlashSize;          /*!< Size of the flash */
00119   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation */
00120   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00121   uint32_t ProgPageSize;       /*!< Size of pages for the program operation */
00122   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00123 } QSPI_Info;
00124
00125 /**
00126   * @}
00127   */
00128
00129
00130 /* Exported functions --------------------------------------------------------*/
00131 /** @addtogroup STM32746G_DISCOVERY_QSPI_Exported_Functions
00132   * @{
00133   */
00134 uint8_t BSP_QSPI_Init       (void);
00135 uint8_t BSP_QSPI_DeInit     (void);
00136 uint8_t BSP_QSPI_Read       (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00137 uint8_t BSP_QSPI_Write      (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00138 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00139 uint8_t BSP_QSPI_Erase_Chip (void);
00140 uint8_t BSP_QSPI_GetStatus  (void);
00141 uint8_t BSP_QSPI_GetInfo    (QSPI_Info* pInfo);
00142 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00143
00144 /* These functions can be modified in case the current settings
00145    need to be changed for specific application needs */
00146 void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params);
00147 void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params);
00148
00149 /**
00150   * @}
00151   */
00152
00153 /**
00154   * @}
00155   */
00156
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160
00161 #endif /* __STM32746G_DISCOVERY_QSPI_H */
00162 /**
00163   * @}
00164   */
00165
00166 /**
00167   * @}
00168   */
00169
00170 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sd.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_sd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_sd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the uSD card driver mounted on STM32746G-Discovery
00006   *          board.
00007   @verbatim
00008    1. How To use this driver:
00009    --------------------------
00010       - This driver is used to drive the micro SD external card mounted on STM32746G-Discovery
00011         board.
00012       - This driver does not need a specific component driver for the micro SD device
00013         to be included with.
00014
00015    2. Driver description:
00016    ---------------------
00017      + Initialization steps:
00018         o Initialize the micro SD card using the BSP_SD_Init() function. This
00019           function includes the MSP layer hardware resources initialization and the
00020           SDIO interface configuration to interface with the external micro SD. It
00021           also includes the micro SD initialization sequence.
00022         o To check the SD card presence you can use the function BSP_SD_IsDetected() which
00023           returns the detection status
00024         o If SD presence detection interrupt mode is desired, you must configure the
00025           SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt
00026           is generated as an external interrupt whenever the micro SD card is
00027           plugged/unplugged in/from the board.
00028         o The function BSP_SD_GetCardInfo() is used to get the micro SD card information
00029           which is stored in the structure "HAL_SD_CardInfoTypedef".
00030
00031      + Micro SD card operations
00032         o The micro SD card can be accessed with read/write block(s) operations once
00033           it is ready for access. The access can be performed whether using the polling
00034           mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA
00035           transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
00036         o The DMA transfer complete is used with interrupt mode. Once the SD transfer
00037           is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
00038           the DMA Tx/Rx transfer complete are handled using the functions
00039           BSP_SD_DMA_Tx_IRQHandler()/BSP_SD_DMA_Rx_IRQHandler(). The corresponding user callbacks
00040           are implemented by the user at application level.
00041         o The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
00042           the number of blocks to erase.
00043         o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
00044
00045   @endverbatim
00046   ******************************************************************************
00047   * @attention
00048   *
00049   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00050   *
00051   * Redistribution and use in source and binary forms, with or without modification,
00052   * are permitted provided that the following conditions are met:
00053   *   1. Redistributions of source code must retain the above copyright notice,
00054   *      this list of conditions and the following disclaimer.
00055   *   2. Redistributions in binary form must reproduce the above copyright notice,
00056   *      this list of conditions and the following disclaimer in the documentation
00057   *      and/or other materials provided with the distribution.
00058   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00059   *      may be used to endorse or promote products derived from this software
00060   *      without specific prior written permission.
00061   *
00062   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00063   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00064   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00065   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00066   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00067   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00068   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00069   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00070   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00071   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00072   *
00073   ******************************************************************************
00074   */
00075
00076 /* Dependencies
00077 - stm32746g_discovery.c
00078 - stm32f7xx_hal_sd.c
00079 - stm32f7xx_ll_sdmmc.c
00080 - stm32f7xx_hal_dma.c
00081 - stm32f7xx_hal_gpio.c
00082 - stm32f7xx_hal_cortex.c
00083 - stm32f7xx_hal_rcc_ex.h
00084 EndDependencies */
00085
00086 /* Includes ------------------------------------------------------------------*/
00087 #include "stm32746g_discovery_sd.h"
00088
00089 /** @addtogroup BSP
00090   * @{
00091   */
00092
00093 /** @addtogroup STM32746G_DISCOVERY
00094   * @{
00095   */
00096
00097 /** @defgroup STM32746G_DISCOVERY_SD STM32746G_DISCOVERY_SD
00098   * @{
00099   */
00100
00101
00102 /** @defgroup STM32746G_DISCOVERY_SD_Private_TypesDefinitions STM32746G_DISCOVERY_SD Private Types Definitions
00103   * @{
00104   */
00105 /**
00106   * @}
00107   */
00108
00109 /** @defgroup STM32746G_DISCOVERY_SD_Private_Defines STM32746G_DISCOVERY_SD Private Defines
00110   * @{
00111   */
00112 /**
00113   * @}
00114   */
00115
00116 /** @defgroup STM32746G_DISCOVERY_SD_Private_Macros STM32746G_DISCOVERY_SD Private Macros
00117   * @{
00118   */
00119 /**
00120   * @}
00121   */
00122
00123 /** @defgroup STM32746G_DISCOVERY_SD_Private_Variables STM32746G_DISCOVERY_SD Private Variables
00124   * @{
00125   */
00126 SD_HandleTypeDef uSdHandle;
00127
00128 /**
00129   * @}
00130   */
00131
00132 /** @defgroup STM32746G_DISCOVERY_SD_Private_FunctionPrototypes STM32746G_DISCOVERY_SD Private Function Prototypes
00133   * @{
00134   */
00135 /**
00136   * @}
00137   */
00138
00139 /** @defgroup STM32746G_DISCOVERY_SD_Exported_Functions STM32746G_DISCOVERY_SD Exported Functions
00140   * @{
00141   */
00142
00143 /**
00144   * @brief  Initializes the SD card device.
00145   * @retval SD status
00146   */
00147 uint8_t BSP_SD_Init(void)
00148 {
00149   uint8_t sd_state = MSD_OK;
00150
00151   /* uSD device interface configuration */
00152   uSdHandle.Instance = SDMMC1;
00153
00154   uSdHandle.Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00155   uSdHandle.Init.ClockBypass         = SDMMC_CLOCK_BYPASS_DISABLE;
00156   uSdHandle.Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00157   uSdHandle.Init.BusWide             = SDMMC_BUS_WIDE_1B;
00158   uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
00159   uSdHandle.Init.ClockDiv            = SDMMC_TRANSFER_CLK_DIV;
00160
00161   /* Msp SD Detect pin initialization */
00162   BSP_SD_Detect_MspInit(&uSdHandle, NULL);
00163   if(BSP_SD_IsDetected() != SD_PRESENT)   /* Check if SD card is present */
00164   {
00165     return MSD_ERROR_SD_NOT_PRESENT;
00166   }
00167
00168   /* Msp SD initialization */
00169   BSP_SD_MspInit(&uSdHandle, NULL);
00170
00171   /* HAL SD initialization */
00172   if(HAL_SD_Init(&uSdHandle) != HAL_OK)
00173   {
00174     sd_state = MSD_ERROR;
00175   }
00176
00177   /* Configure SD Bus width */
00178   if(sd_state == MSD_OK)
00179   {
00180     /* Enable wide operation */
00181     if(HAL_SD_ConfigWideBusOperation(&uSdHandle, SDMMC_BUS_WIDE_4B) != HAL_OK)
00182     {
00183       sd_state = MSD_ERROR;
00184     }
00185     else
00186     {
00187       sd_state = MSD_OK;
00188     }
00189   }
00190
00191   return  sd_state;
00192 }
00193
00194 /**
00195   * @brief  DeInitializes the SD card device.
00196   * @retval SD status
00197   */
00198 uint8_t BSP_SD_DeInit(void)
00199 {
00200   uint8_t sd_state = MSD_OK;
00201
00202   uSdHandle.Instance = SDMMC1;
00203
00204   /* HAL SD deinitialization */
00205   if(HAL_SD_DeInit(&uSdHandle) != HAL_OK)
00206   {
00207     sd_state = MSD_ERROR;
00208   }
00209
00210   /* Msp SD deinitialization */
00211   uSdHandle.Instance = SDMMC1;
00212   BSP_SD_MspDeInit(&uSdHandle, NULL);
00213
00214   return  sd_state;
00215 }
00216
00217 /**
00218   * @brief  Configures Interrupt mode for SD detection pin.
00219   * @retval Returns MSD_OK
00220   */
00221 uint8_t BSP_SD_ITConfig(void)
00222 {
00223   GPIO_InitTypeDef gpio_init_structure;
00224
00225   /* Configure Interrupt mode for SD detection pin */
00226   gpio_init_structure.Pin = SD_DETECT_PIN;
00227   gpio_init_structure.Pull = GPIO_PULLUP;
00228   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00229   gpio_init_structure.Mode = GPIO_MODE_IT_RISING_FALLING;
00230   HAL_GPIO_Init(SD_DETECT_GPIO_PORT, &gpio_init_structure);
00231
00232   /* Enable and set SD detect EXTI Interrupt to the lowest priority */
00233   HAL_NVIC_SetPriority((IRQn_Type)(SD_DETECT_EXTI_IRQn), 0x0F, 0x00);
00234   HAL_NVIC_EnableIRQ((IRQn_Type)(SD_DETECT_EXTI_IRQn));
00235
00236   return MSD_OK;
00237 }
00238
00239 /**
00240   * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00241   * @retval Returns if SD is detected or not
00242   */
00243 uint8_t BSP_SD_IsDetected(void)
00244 {
00245   __IO uint8_t      status = SD_PRESENT;
00246
00247   /* Check SD card detect pin */
00248   if (HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) == GPIO_PIN_SET)
00249   {
00250     status = SD_NOT_PRESENT;
00251   }
00252
00253   return status;
00254 }
00255
00256 /**
00257   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00258   * @param  pData: Pointer to the buffer that will contain the data to transmit
00259   * @param  ReadAddr: Address from where data is to be read
00260   * @param  NumOfBlocks: Number of SD blocks to read
00261   * @param  Timeout: Timeout for read operation
00262   * @retval SD status
00263   */
00264 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00265 {
00266   if(HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) != HAL_OK)
00267   {
00268     return MSD_ERROR;
00269   }
00270   else
00271   {
00272     return MSD_OK;
00273   }
00274 }
00275
00276 /**
00277   * @brief  Writes block(s) to a specified address in an SD card, in polling mode.
00278   * @param  pData: Pointer to the buffer that will contain the data to transmit
00279   * @param  WriteAddr: Address from where data is to be written
00280   * @param  NumOfBlocks: Number of SD blocks to write
00281   * @param  Timeout: Timeout for write operation
00282   * @retval SD status
00283   */
00284 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00285 {
00286   if(HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) != HAL_OK)
00287   {
00288     return MSD_ERROR;
00289   }
00290   else
00291   {
00292     return MSD_OK;
00293   }
00294 }
00295
00296 /**
00297   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00298   * @param  pData: Pointer to the buffer that will contain the data to transmit
00299   * @param  ReadAddr: Address from where data is to be read
00300   * @param  NumOfBlocks: Number of SD blocks to read
00301   * @retval SD status
00302   */
00303 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
00304 {
00305   /* Read block(s) in DMA transfer mode */
00306   if(HAL_SD_ReadBlocks_DMA(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks) != HAL_OK)
00307   {
00308     return MSD_ERROR;
00309   }
00310   else
00311   {
00312     return MSD_OK;
00313   }
00314 }
00315
00316 /**
00317   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00318   * @param  pData: Pointer to the buffer that will contain the data to transmit
00319   * @param  WriteAddr: Address from where data is to be written
00320   * @param  NumOfBlocks: Number of SD blocks to write
00321   * @retval SD status
00322   */
00323 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
00324 {
00325   /* Write block(s) in DMA transfer mode */
00326   if(HAL_SD_WriteBlocks_DMA(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK)
00327   {
00328     return MSD_ERROR;
00329   }
00330   else
00331   {
00332     return MSD_OK;
00333   }
00334 }
00335
00336 /**
00337   * @brief  Erases the specified memory area of the given SD card.
00338   * @param  StartAddr: Start byte address
00339   * @param  EndAddr: End byte address
00340   * @retval SD status
00341   */
00342 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
00343 {
00344   if(HAL_SD_Erase(&uSdHandle, StartAddr, EndAddr) != HAL_OK)
00345   {
00346     return MSD_ERROR;
00347   }
00348   else
00349   {
00350     return MSD_OK;
00351   }
00352 }
00353
00354 /**
00355   * @brief  Initializes the SD MSP.
00356   * @param  hsd: SD handle
00357   * @param  Params
00358   * @retval None
00359   */
00360 __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
00361 {
00362   static DMA_HandleTypeDef dma_rx_handle;
00363   static DMA_HandleTypeDef dma_tx_handle;
00364   GPIO_InitTypeDef gpio_init_structure;
00365
00366   /* Enable SDIO clock */
00367   __HAL_RCC_SDMMC1_CLK_ENABLE();
00368
00369   /* Enable DMA2 clocks */
00370   __DMAx_TxRx_CLK_ENABLE();
00371
00372   /* Enable GPIOs clock */
00373   __HAL_RCC_GPIOC_CLK_ENABLE();
00374   __HAL_RCC_GPIOD_CLK_ENABLE();
00375
00376   /* Common GPIO configuration */
00377   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00378   gpio_init_structure.Pull      = GPIO_PULLUP;
00379   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00380   gpio_init_structure.Alternate = GPIO_AF12_SDMMC1;
00381
00382   /* GPIOC configuration */
00383   gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00384   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00385
00386   /* GPIOD configuration */
00387   gpio_init_structure.Pin = GPIO_PIN_2;
00388   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00389
00390   /* NVIC configuration for SDIO interrupts */
00391   HAL_NVIC_SetPriority(SDMMC1_IRQn, 0x0E, 0);
00392   HAL_NVIC_EnableIRQ(SDMMC1_IRQn);
00393
00394   /* Configure DMA Rx parameters */
00395   dma_rx_handle.Init.Channel             = SD_DMAx_Rx_CHANNEL;
00396   dma_rx_handle.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00397   dma_rx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00398   dma_rx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00399   dma_rx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00400   dma_rx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00401   dma_rx_handle.Init.Mode                = DMA_PFCTRL;
00402   dma_rx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00403   dma_rx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00404   dma_rx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00405   dma_rx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00406   dma_rx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00407
00408   dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00409
00410   /* Associate the DMA handle */
00411   __HAL_LINKDMA(hsd, hdmarx, dma_rx_handle);
00412
00413   /* Deinitialize the stream for new transfer */
00414   HAL_DMA_DeInit(&dma_rx_handle);
00415
00416   /* Configure the DMA stream */
00417   HAL_DMA_Init(&dma_rx_handle);
00418
00419   /* Configure DMA Tx parameters */
00420   dma_tx_handle.Init.Channel             = SD_DMAx_Tx_CHANNEL;
00421   dma_tx_handle.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00422   dma_tx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00423   dma_tx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00424   dma_tx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00425   dma_tx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00426   dma_tx_handle.Init.Mode                = DMA_PFCTRL;
00427   dma_tx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00428   dma_tx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00429   dma_tx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00430   dma_tx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00431   dma_tx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00432
00433   dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00434
00435   /* Associate the DMA handle */
00436   __HAL_LINKDMA(hsd, hdmatx, dma_tx_handle);
00437
00438   /* Deinitialize the stream for new transfer */
00439   HAL_DMA_DeInit(&dma_tx_handle);
00440
00441   /* Configure the DMA stream */
00442   HAL_DMA_Init(&dma_tx_handle);
00443
00444   /* NVIC configuration for DMA transfer complete interrupt */
00445   HAL_NVIC_SetPriority(SD_DMAx_Rx_IRQn, 0x0F, 0);
00446   HAL_NVIC_EnableIRQ(SD_DMAx_Rx_IRQn);
00447
00448   /* NVIC configuration for DMA transfer complete interrupt */
00449   HAL_NVIC_SetPriority(SD_DMAx_Tx_IRQn, 0x0F, 0);
00450   HAL_NVIC_EnableIRQ(SD_DMAx_Tx_IRQn);
00451 }
00452
00453 /**
00454   * @brief  Initializes the SD Detect pin MSP.
00455   * @param  hsd: SD handle
00456   * @param  Params
00457   * @retval None
00458   */
00459 __weak void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params)
00460 {
00461   GPIO_InitTypeDef  gpio_init_structure;
00462
00463   SD_DETECT_GPIO_CLK_ENABLE();
00464
00465   /* GPIO configuration in input for uSD_Detect signal */
00466   gpio_init_structure.Pin       = SD_DETECT_PIN;
00467   gpio_init_structure.Mode      = GPIO_MODE_INPUT;
00468   gpio_init_structure.Pull      = GPIO_PULLUP;
00469   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00470   HAL_GPIO_Init(SD_DETECT_GPIO_PORT, &gpio_init_structure);
00471 }
00472
00473 /**
00474   * @brief  DeInitializes the SD MSP.
00475   * @param  hsd: SD handle
00476   * @param  Params
00477   * @retval None
00478   */
00479 __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
00480 {
00481   static DMA_HandleTypeDef dma_rx_handle;
00482   static DMA_HandleTypeDef dma_tx_handle;
00483
00484   /* Disable NVIC for DMA transfer complete interrupts */
00485   HAL_NVIC_DisableIRQ(SD_DMAx_Rx_IRQn);
00486   HAL_NVIC_DisableIRQ(SD_DMAx_Tx_IRQn);
00487
00488   /* Deinitialize the stream for new transfer */
00489   dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00490   HAL_DMA_DeInit(&dma_rx_handle);
00491
00492   /* Deinitialize the stream for new transfer */
00493   dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00494   HAL_DMA_DeInit(&dma_tx_handle);
00495
00496   /* Disable NVIC for SDIO interrupts */
00497   HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
00498
00499   /* DeInit GPIO pins can be done in the application
00500      (by surcharging this __weak function) */
00501
00502   /* Disable SDMMC1 clock */
00503   __HAL_RCC_SDMMC1_CLK_DISABLE();
00504
00505   /* GPIO pins clock and DMA clocks can be shut down in the application
00506      by surcharging this __weak function */
00507 }
00508
00509 /**
00510   * @brief  Gets the current SD card data status.
00511   * @retval Data transfer state.
00512   *          This value can be one of the following values:
00513   *            @arg  SD_TRANSFER_OK: No data transfer is acting
00514   *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
00515   */
00516 uint8_t BSP_SD_GetCardState(void)
00517 {
00518   return((HAL_SD_GetCardState(&uSdHandle) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY);
00519 }
00520
00521
00522 /**
00523   * @brief  Get SD information about specific SD card.
00524   * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
00525   * @retval None
00526   */
00527 void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
00528 {
00529   /* Get SD card Information */
00530   HAL_SD_GetCardInfo(&uSdHandle, CardInfo);
00531 }
00532
00533 /**
00534   * @brief SD Abort callbacks
00535   * @param hsd: SD handle
00536   * @retval None
00537   */
00538 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00539 {
00540   BSP_SD_AbortCallback();
00541 }
00542
00543 /**
00544   * @brief Tx Transfer completed callbacks
00545   * @param hsd: SD handle
00546   * @retval None
00547   */
00548 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00549 {
00550   BSP_SD_WriteCpltCallback();
00551 }
00552
00553 /**
00554   * @brief Rx Transfer completed callbacks
00555   * @param hsd: SD handle
00556   * @retval None
00557   */
00558 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00559 {
00560   BSP_SD_ReadCpltCallback();
00561 }
00562
00563 /**
00564   * @brief BSP SD Abort callbacks
00565   * @retval None
00566   */
00567 __weak void BSP_SD_AbortCallback(void)
00568 {
00569
00570 }
00571
00572 /**
00573   * @brief BSP Tx Transfer completed callbacks
00574   * @retval None
00575   */
00576 __weak void BSP_SD_WriteCpltCallback(void)
00577 {
00578
00579 }
00580
00581 /**
00582   * @brief BSP Rx Transfer completed callbacks
00583   * @retval None
00584   */
00585 __weak void BSP_SD_ReadCpltCallback(void)
00586 {
00587
00588 }
00589
00590 /**
00591   * @}
00592   */
00593
00594 /**
00595   * @}
00596   */
00597
00598 /**
00599   * @}
00600   */
00601
00602 /**
00603   * @}
00604   */
00605
00606 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sd.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_sd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_SD_H
00039 #define __STM32746G_DISCOVERY_SD_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32746g_discovery.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32746G_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32746G_DISCOVERY_SD
00057   * @{
00058   */
00059
00060 /** @defgroup STM32746G_DISCOVERY_SD_Exported_Types STM32746G_DISCOVERY_SD Exported Types
00061   * @{
00062   */
00063
00064 /**
00065   * @brief SD Card information structure
00066   */
00067 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00068 /**
00069   * @}
00070   */
00071
00072 /**
00073   * @brief  SD status structure definition
00074   */
00075 #define MSD_OK                        ((uint8_t)0x00)
00076 #define MSD_ERROR                     ((uint8_t)0x01)
00077 #define MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00078
00079 /**
00080   * @brief  SD transfer state definition
00081   */
00082 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00083 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00084
00085 /** @defgroup STM32746G_DISCOVERY_SD_Exported_Constants STM32746G_DISCOVERY_SD Exported Constants
00086   * @{
00087   */
00088 #define SD_PRESENT               ((uint8_t)0x01)
00089 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00090
00091 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00092
00093 /* DMA definitions for SD DMA transfer */
00094 #define __DMAx_TxRx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00095 #define SD_DMAx_Tx_CHANNEL                DMA_CHANNEL_4
00096 #define SD_DMAx_Rx_CHANNEL                DMA_CHANNEL_4
00097 #define SD_DMAx_Tx_STREAM                 DMA2_Stream6
00098 #define SD_DMAx_Rx_STREAM                 DMA2_Stream3
00099 #define SD_DMAx_Tx_IRQn                   DMA2_Stream6_IRQn
00100 #define SD_DMAx_Rx_IRQn                   DMA2_Stream3_IRQn
00101 #define BSP_SDMMC_IRQHandler              SDMMC1_IRQHandler
00102 #define BSP_SDMMC_DMA_Tx_IRQHandler       DMA2_Stream6_IRQHandler
00103 #define BSP_SDMMC_DMA_Rx_IRQHandler       DMA2_Stream3_IRQHandler
00104 #define SD_DetectIRQHandler()             HAL_GPIO_EXTI_IRQHandler(SD_DETECT_PIN)
00105 /**
00106   * @}
00107   */
00108
00109 /** @defgroup STM32746G_DISCOVERY_SD_Exported_Macro STM32746G_DISCOVERY_SD Exported Macro
00110   * @{
00111   */
00112 /**
00113   * @}
00114   */
00115
00116 /** @addtogroup STM32746G_DISCOVERY_SD_Exported_Functions
00117   * @{
00118   */
00119 uint8_t BSP_SD_Init(void);
00120 uint8_t BSP_SD_DeInit(void);
00121 uint8_t BSP_SD_ITConfig(void);
00122 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00123 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00124 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00125 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00126 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00127 uint8_t BSP_SD_GetCardState(void);
00128 void    BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
00129 uint8_t BSP_SD_IsDetected(void);
00130
00131 /* These functions can be modified in case the current settings (e.g. DMA stream)
00132    need to be changed for specific application needs */
00133 void    BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00134 void    BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
00135 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00136 void    BSP_SD_AbortCallback(void);
00137 void    BSP_SD_WriteCpltCallback(void);
00138 void    BSP_SD_ReadCpltCallback(void);
00139 /**
00140   * @}
00141   */
00142
00143 /**
00144   * @}
00145   */
00146
00147 /**
00148   * @}
00149   */
00150
00151 /**
00152   * @}
00153   */
00154
00155 #ifdef __cplusplus
00156 }
00157 #endif
00158
00159 #endif /* __STM32746G_DISCOVERY_SD_H */
00160
00161 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sdram.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_sdram.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_sdram.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory
00006   *          device mounted on STM32746G-Discovery board.
00007   @verbatim
00008    1. How To use this driver:
00009    --------------------------
00010       - This driver is used to drive the MT48LC4M32B2B5-7 SDRAM external memory mounted
00011         on STM32746G-Discovery board.
00012       - This driver does not need a specific component driver for the SDRAM device
00013         to be included with.
00014
00015    2. 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 DMA 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 DMA 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 DMA transfer, the function BSP_SDRAM_DMA_IRQHandler()
00039           is called in IRQ handler file, to serve the generated interrupt once the DMA
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
00045   @endverbatim
00046   ******************************************************************************
00047   * @attention
00048   *
00049   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00050   *
00051   * Redistribution and use in source and binary forms, with or without modification,
00052   * are permitted provided that the following conditions are met:
00053   *   1. Redistributions of source code must retain the above copyright notice,
00054   *      this list of conditions and the following disclaimer.
00055   *   2. Redistributions in binary form must reproduce the above copyright notice,
00056   *      this list of conditions and the following disclaimer in the documentation
00057   *      and/or other materials provided with the distribution.
00058   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00059   *      may be used to endorse or promote products derived from this software
00060   *      without specific prior written permission.
00061   *
00062   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00063   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00064   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00065   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00066   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00067   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00068   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00069   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00070   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00071   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00072   *
00073   ******************************************************************************
00074   */
00075
00076 /* Dependencies
00077 - stm32f7xx_hal_sdram.c
00078 - stm32f7xx_ll_fmc.c
00079 - stm32f7xx_hal_dma.c
00080 - stm32f7xx_hal_gpio.c
00081 - stm32f7xx_hal_cortex.c
00082 - stm32f7xx_hal_rcc_ex.h
00083 EndDependencies */
00084
00085 /* Includes ------------------------------------------------------------------*/
00086 #include "stm32746g_discovery_sdram.h"
00087
00088 /** @addtogroup BSP
00089   * @{
00090   */
00091
00092 /** @addtogroup STM32746G_DISCOVERY
00093   * @{
00094   */
00095
00096 /** @defgroup STM32746G_DISCOVERY_SDRAM STM32746G_DISCOVERY_SDRAM
00097   * @{
00098   */
00099
00100 /** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Types_Definitions STM32746G_DISCOVERY_SDRAM Private Types Definitions
00101   * @{
00102   */
00103 /**
00104   * @}
00105   */
00106
00107 /** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Defines STM32746G_DISCOVERY_SDRAM Private Defines
00108   * @{
00109   */
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Macros STM32746G_DISCOVERY_SDRAM Private Macros
00115   * @{
00116   */
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Variables STM32746G_DISCOVERY_SDRAM Private Variables
00122   * @{
00123   */
00124 SDRAM_HandleTypeDef sdramHandle;
00125 static FMC_SDRAM_TimingTypeDef Timing;
00126 static FMC_SDRAM_CommandTypeDef Command;
00127 /**
00128   * @}
00129   */
00130
00131 /** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Function_Prototypes STM32746G_DISCOVERY_SDRAM Private Function Prototypes
00132   * @{
00133   */
00134 /**
00135   * @}
00136   */
00137
00138 /** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Functions STM32746G_DISCOVERY_SDRAM Exported Functions
00139   * @{
00140   */
00141
00142 /**
00143   * @brief  Initializes the SDRAM device.
00144   * @retval SDRAM status
00145   */
00146 uint8_t BSP_SDRAM_Init(void)
00147 {
00148   static uint8_t sdramstatus = SDRAM_ERROR;
00149   /* SDRAM device configuration */
00150   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00151
00152   /* Timing configuration for 100Mhz as SD clock frequency (System clock is up to 200Mhz) */
00153   Timing.LoadToActiveDelay    = 2;
00154   Timing.ExitSelfRefreshDelay = 7;
00155   Timing.SelfRefreshTime      = 4;
00156   Timing.RowCycleDelay        = 7;
00157   Timing.WriteRecoveryTime    = 2;
00158   Timing.RPDelay              = 2;
00159   Timing.RCDDelay             = 2;
00160
00161   sdramHandle.Init.SDBank             = FMC_SDRAM_BANK1;
00162   sdramHandle.Init.ColumnBitsNumber   = FMC_SDRAM_COLUMN_BITS_NUM_8;
00163   sdramHandle.Init.RowBitsNumber      = FMC_SDRAM_ROW_BITS_NUM_12;
00164   sdramHandle.Init.MemoryDataWidth    = SDRAM_MEMORY_WIDTH;
00165   sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
00166   sdramHandle.Init.CASLatency         = FMC_SDRAM_CAS_LATENCY_2;
00167   sdramHandle.Init.WriteProtection    = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
00168   sdramHandle.Init.SDClockPeriod      = SDCLOCK_PERIOD;
00169   sdramHandle.Init.ReadBurst          = FMC_SDRAM_RBURST_ENABLE;
00170   sdramHandle.Init.ReadPipeDelay      = FMC_SDRAM_RPIPE_DELAY_0;
00171
00172   /* SDRAM controller initialization */
00173
00174   BSP_SDRAM_MspInit(&sdramHandle, NULL); /* __weak function can be rewritten by the application */
00175
00176   if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)
00177   {
00178     sdramstatus = SDRAM_ERROR;
00179   }
00180   else
00181   {
00182     sdramstatus = SDRAM_OK;
00183   }
00184
00185   /* SDRAM initialization sequence */
00186   BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);
00187
00188   return sdramstatus;
00189 }
00190
00191 /**
00192   * @brief  DeInitializes the SDRAM device.
00193   * @retval SDRAM status
00194   */
00195 uint8_t BSP_SDRAM_DeInit(void)
00196 {
00197   static uint8_t sdramstatus = SDRAM_ERROR;
00198   /* SDRAM device de-initialization */
00199   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00200
00201   if(HAL_SDRAM_DeInit(&sdramHandle) != HAL_OK)
00202   {
00203     sdramstatus = SDRAM_ERROR;
00204   }
00205   else
00206   {
00207     sdramstatus = SDRAM_OK;
00208   }
00209
00210   /* SDRAM controller de-initialization */
00211   BSP_SDRAM_MspDeInit(&sdramHandle, NULL);
00212
00213   return sdramstatus;
00214 }
00215
00216 /**
00217   * @brief  Programs the SDRAM device.
00218   * @param  RefreshCount: SDRAM refresh counter value
00219   * @retval None
00220   */
00221 void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
00222 {
00223   __IO uint32_t tmpmrd = 0;
00224
00225   /* Step 1: Configure a clock configuration enable command */
00226   Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
00227   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00228   Command.AutoRefreshNumber      = 1;
00229   Command.ModeRegisterDefinition = 0;
00230
00231   /* Send the command */
00232   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00233
00234   /* Step 2: Insert 100 us minimum delay */
00235   /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
00236   HAL_Delay(1);
00237
00238   /* Step 3: Configure a PALL (precharge all) command */
00239   Command.CommandMode            = FMC_SDRAM_CMD_PALL;
00240   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00241   Command.AutoRefreshNumber      = 1;
00242   Command.ModeRegisterDefinition = 0;
00243
00244   /* Send the command */
00245   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00246
00247   /* Step 4: Configure an Auto Refresh command */
00248   Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
00249   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00250   Command.AutoRefreshNumber      = 8;
00251   Command.ModeRegisterDefinition = 0;
00252
00253   /* Send the command */
00254   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00255
00256   /* Step 5: Program the external memory mode register */
00257   tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |\
00258                      SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |\
00259                      SDRAM_MODEREG_CAS_LATENCY_2           |\
00260                      SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
00261                      SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
00262
00263   Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
00264   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00265   Command.AutoRefreshNumber      = 1;
00266   Command.ModeRegisterDefinition = tmpmrd;
00267
00268   /* Send the command */
00269   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00270
00271   /* Step 6: Set the refresh rate counter */
00272   /* Set the device refresh rate */
00273   HAL_SDRAM_ProgramRefreshRate(&sdramHandle, RefreshCount);
00274 }
00275
00276 /**
00277   * @brief  Reads an amount of data from the SDRAM memory in polling mode.
00278   * @param  uwStartAddress: Read start address
00279   * @param  pData: Pointer to data to be read
00280   * @param  uwDataSize: Size of read data from the memory
00281   * @retval SDRAM status
00282   */
00283 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00284 {
00285   if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00286   {
00287     return SDRAM_ERROR;
00288   }
00289   else
00290   {
00291     return SDRAM_OK;
00292   }
00293 }
00294
00295 /**
00296   * @brief  Reads an amount of data from the SDRAM memory in DMA mode.
00297   * @param  uwStartAddress: Read start address
00298   * @param  pData: Pointer to data to be read
00299   * @param  uwDataSize: Size of read data from the memory
00300   * @retval SDRAM status
00301   */
00302 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00303 {
00304   if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00305   {
00306     return SDRAM_ERROR;
00307   }
00308   else
00309   {
00310     return SDRAM_OK;
00311   }
00312 }
00313
00314 /**
00315   * @brief  Writes an amount of data to the SDRAM memory in polling mode.
00316   * @param  uwStartAddress: Write start address
00317   * @param  pData: Pointer to data to be written
00318   * @param  uwDataSize: Size of written data from the memory
00319   * @retval SDRAM status
00320   */
00321 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00322 {
00323   if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00324   {
00325     return SDRAM_ERROR;
00326   }
00327   else
00328   {
00329     return SDRAM_OK;
00330   }
00331 }
00332
00333 /**
00334   * @brief  Writes an amount of data to the SDRAM memory in DMA mode.
00335   * @param  uwStartAddress: Write start address
00336   * @param  pData: Pointer to data to be written
00337   * @param  uwDataSize: Size of written data from the memory
00338   * @retval SDRAM status
00339   */
00340 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00341 {
00342   if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00343   {
00344     return SDRAM_ERROR;
00345   }
00346   else
00347   {
00348     return SDRAM_OK;
00349   }
00350 }
00351
00352 /**
00353   * @brief  Sends command to the SDRAM bank.
00354   * @param  SdramCmd: Pointer to SDRAM command structure
00355   * @retval SDRAM status
00356   */
00357 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
00358 {
00359   if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK)
00360   {
00361     return SDRAM_ERROR;
00362   }
00363   else
00364   {
00365     return SDRAM_OK;
00366   }
00367 }
00368
00369 /**
00370   * @brief  Initializes SDRAM MSP.
00371   * @param  hsdram: SDRAM handle
00372   * @param  Params
00373   * @retval None
00374   */
00375 __weak void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00376 {
00377   static DMA_HandleTypeDef dma_handle;
00378   GPIO_InitTypeDef gpio_init_structure;
00379
00380   /* Enable FMC clock */
00381   __HAL_RCC_FMC_CLK_ENABLE();
00382
00383   /* Enable chosen DMAx clock */
00384   __DMAx_CLK_ENABLE();
00385
00386   /* Enable GPIOs clock */
00387   __HAL_RCC_GPIOC_CLK_ENABLE();
00388   __HAL_RCC_GPIOD_CLK_ENABLE();
00389   __HAL_RCC_GPIOE_CLK_ENABLE();
00390   __HAL_RCC_GPIOF_CLK_ENABLE();
00391   __HAL_RCC_GPIOG_CLK_ENABLE();
00392   __HAL_RCC_GPIOH_CLK_ENABLE();
00393
00394   /* Common GPIO configuration */
00395   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00396   gpio_init_structure.Pull      = GPIO_PULLUP;
00397   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
00398   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00399
00400   /* GPIOC configuration */
00401   gpio_init_structure.Pin   = GPIO_PIN_3;
00402   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00403
00404   /* GPIOD configuration */
00405   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9 |
00406                               GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15;
00407   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00408
00409   /* GPIOE configuration */
00410   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7| GPIO_PIN_8 | GPIO_PIN_9 |\
00411                               GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00412                               GPIO_PIN_15;
00413   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00414
00415   /* GPIOF configuration */
00416   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4 |\
00417                               GPIO_PIN_5 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00418                               GPIO_PIN_15;
00419   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00420
00421   /* GPIOG configuration */
00422   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4| GPIO_PIN_5 | GPIO_PIN_8 |\
00423                               GPIO_PIN_15;
00424   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00425
00426   /* GPIOH configuration */
00427   gpio_init_structure.Pin   = GPIO_PIN_3 | GPIO_PIN_5;
00428   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00429
00430   /* Configure common DMA parameters */
00431   dma_handle.Init.Channel             = SDRAM_DMAx_CHANNEL;
00432   dma_handle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00433   dma_handle.Init.PeriphInc           = DMA_PINC_ENABLE;
00434   dma_handle.Init.MemInc              = DMA_MINC_ENABLE;
00435   dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00436   dma_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00437   dma_handle.Init.Mode                = DMA_NORMAL;
00438   dma_handle.Init.Priority            = DMA_PRIORITY_HIGH;
00439   dma_handle.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00440   dma_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00441   dma_handle.Init.MemBurst            = DMA_MBURST_SINGLE;
00442   dma_handle.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00443
00444   dma_handle.Instance = SDRAM_DMAx_STREAM;
00445
00446    /* Associate the DMA handle */
00447   __HAL_LINKDMA(hsdram, hdma, dma_handle);
00448
00449   /* Deinitialize the stream for new transfer */
00450   HAL_DMA_DeInit(&dma_handle);
00451
00452   /* Configure the DMA stream */
00453   HAL_DMA_Init(&dma_handle);
00454
00455   /* NVIC configuration for DMA transfer complete interrupt */
00456   HAL_NVIC_SetPriority(SDRAM_DMAx_IRQn, 0x0F, 0);
00457   HAL_NVIC_EnableIRQ(SDRAM_DMAx_IRQn);
00458 }
00459
00460 /**
00461   * @brief  DeInitializes SDRAM MSP.
00462   * @param  hsdram: SDRAM handle
00463   * @param  Params
00464   * @retval None
00465   */
00466 __weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00467 {
00468     static DMA_HandleTypeDef dma_handle;
00469
00470     /* Disable NVIC configuration for DMA interrupt */
00471     HAL_NVIC_DisableIRQ(SDRAM_DMAx_IRQn);
00472
00473     /* Deinitialize the stream for new transfer */
00474     dma_handle.Instance = SDRAM_DMAx_STREAM;
00475     HAL_DMA_DeInit(&dma_handle);
00476
00477     /* GPIO pins clock, FMC clock and DMA clock can be shut down in the applications
00478        by surcharging this __weak function */
00479 }
00480
00481 /**
00482   * @}
00483   */
00484
00485 /**
00486   * @}
00487   */
00488
00489 /**
00490   * @}
00491   */
00492
00493 /**
00494   * @}
00495   */
00496
00497 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_sdram.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_sdram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_sdram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_sdram.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_SDRAM_H
00039 #define __STM32746G_DISCOVERY_SDRAM_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32f7xx_hal.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32746G_DISCOVERY
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32746G_DISCOVERY_SDRAM
00057   * @{
00058   */
00059
00060 /** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Types STM32746G_DISCOVERY_SDRAM Exported Types
00061   * @{
00062   */
00063
00064 /**
00065   * @brief  SDRAM status structure definition
00066   */
00067 #define   SDRAM_OK         ((uint8_t)0x00)
00068 #define   SDRAM_ERROR      ((uint8_t)0x01)
00069
00070 /** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Constants STM32746G_DISCOVERY_SDRAM Exported Constants
00071   * @{
00072   */
00073 #define SDRAM_DEVICE_ADDR  ((uint32_t)0xC0000000)
00074 #define SDRAM_DEVICE_SIZE  ((uint32_t)0x800000)  /* SDRAM device size in MBytes */
00075
00076 /* #define SDRAM_MEMORY_WIDTH            FMC_SDRAM_MEM_BUS_WIDTH_8  */
00077 #define SDRAM_MEMORY_WIDTH               FMC_SDRAM_MEM_BUS_WIDTH_16
00078
00079 #define SDCLOCK_PERIOD                   FMC_SDRAM_CLOCK_PERIOD_2
00080 /* #define SDCLOCK_PERIOD                FMC_SDRAM_CLOCK_PERIOD_3 */
00081
00082 #define REFRESH_COUNT                    ((uint32_t)0x0603)   /* SDRAM refresh counter (100Mhz SD clock) */
00083
00084 #define SDRAM_TIMEOUT                    ((uint32_t)0xFFFF)
00085
00086 /* DMA definitions for SDRAM DMA transfer */
00087 #define __DMAx_CLK_ENABLE                 __HAL_RCC_DMA2_CLK_ENABLE
00088 #define __DMAx_CLK_DISABLE                __HAL_RCC_DMA2_CLK_DISABLE
00089 #define SDRAM_DMAx_CHANNEL                DMA_CHANNEL_0
00090 #define SDRAM_DMAx_STREAM                 DMA2_Stream0
00091 #define SDRAM_DMAx_IRQn                   DMA2_Stream0_IRQn
00092 #define BSP_SDRAM_DMA_IRQHandler          DMA2_Stream0_IRQHandler
00093 /**
00094   * @}
00095   */
00096
00097 /**
00098   * @brief  FMC SDRAM Mode definition register defines
00099   */
00100 #define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
00101 #define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
00102 #define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
00103 #define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
00104 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
00105 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
00106 #define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
00107 #define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
00108 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
00109 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
00110 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)
00111 /**
00112   * @}
00113   */
00114
00115 /** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Macro STM32746G_DISCOVERY_SDRAM Exported Macro
00116   * @{
00117   */
00118 /**
00119   * @}
00120   */
00121
00122 /** @addtogroup STM32746G_DISCOVERY_SDRAM_Exported_Functions
00123   * @{
00124   */
00125 uint8_t BSP_SDRAM_Init(void);
00126 uint8_t BSP_SDRAM_DeInit(void);
00127 void    BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
00128 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00129 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00130 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00131 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00132 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
00133
00134 /* These functions can be modified in case the current settings (e.g. DMA stream)
00135    need to be changed for specific application needs */
00136 void    BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00137 void    BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00138
00139
00140 /**
00141   * @}
00142   */
00143
00144 /**
00145   * @}
00146   */
00147
00148 /**
00149   * @}
00150   */
00151
00152 /**
00153   * @}
00154   */
00155
00156 #ifdef __cplusplus
00157 }
00158 #endif
00159
00160 #endif /* __STM32746G_DISCOVERY_SDRAM_H */
00161
00162 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_ts.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_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 STM32746G-Discovery board.
00007   @verbatim
00008    1. How To use this driver:
00009    --------------------------
00010       - This driver is used to drive the touch screen module of the STM32746G-Discovery
00011         board on the RK043FN48H-CT672B 480x272 LCD screen with capacitive touch screen.
00012       - The FT5336 component driver must be included in project files according to
00013         the touch screen driver present on this board.
00014
00015    2. Driver description:
00016    ---------------------
00017      + Initialization steps:
00018         o Initialize the TS module using the BSP_TS_Init() function. This
00019           function includes the MSP layer hardware resources initialization and the
00020           communication layer configuration to start the TS use. The LCD size properties
00021           (x and y) are passed as parameters.
00022         o If TS interrupt mode is desired, you must configure the TS interrupt mode
00023           by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00024           as an external interrupt whenever a touch is detected.
00025           The interrupt mode internally uses the IO functionalities driver driven by
00026           the IO expander, to configure the IT line.
00027
00028      + Touch screen use
00029         o The touch screen state is captured whenever the function BSP_TS_GetState() is
00030           used. This function returns information about the last LCD touch occurred
00031           in the TS_StateTypeDef structure.
00032         o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
00033           the interrupt status. To clear the IT pending bits, you should call the
00034           function BSP_TS_ITClear().
00035         o The IT is handled using the corresponding external interrupt IRQ handler,
00036           the user IT callback treatment is implemented on the same external interrupt
00037           callback.
00038   @endverbatim
00039   ******************************************************************************
00040   * @attention
00041   *
00042   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00043   *
00044   * Redistribution and use in source and binary forms, with or without modification,
00045   * are permitted provided that the following conditions are met:
00046   *   1. Redistributions of source code must retain the above copyright notice,
00047   *      this list of conditions and the following disclaimer.
00048   *   2. Redistributions in binary form must reproduce the above copyright notice,
00049   *      this list of conditions and the following disclaimer in the documentation
00050   *      and/or other materials provided with the distribution.
00051   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00052   *      may be used to endorse or promote products derived from this software
00053   *      without specific prior written permission.
00054   *
00055   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00056   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00057   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00058   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00059   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00060   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00061   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00062   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00063   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00064   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00065   *
00066   ******************************************************************************
00067   */
00068
00069 /* Dependencies
00070 - stm32746g_discovery_lcd.c
00071 - ft5336.c
00072 EndDependencies */
00073
00074 /* Includes ------------------------------------------------------------------*/
00075 #include "stm32746g_discovery_ts.h"
00076
00077 /** @addtogroup BSP
00078   * @{
00079   */
00080
00081 /** @addtogroup STM32746G_DISCOVERY
00082   * @{
00083   */
00084
00085 /** @defgroup STM32746G_DISCOVERY_TS STM32746G_DISCOVERY_TS
00086   * @{
00087   */
00088
00089 /** @defgroup STM32746G_DISCOVERY_TS_Private_Types_Definitions STM32746G_DISCOVERY_TS Types Definitions
00090   * @{
00091   */
00092 /**
00093   * @}
00094   */
00095
00096 /** @defgroup STM32746G_DISCOVERY_TS_Private_Defines STM32746G_DISCOVERY_TS Types Defines
00097   * @{
00098   */
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32746G_DISCOVERY_TS_Private_Macros STM32746G_DISCOVERY_TS Private Macros
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32746G_DISCOVERY_TS_Imported_Variables STM32746G_DISCOVERY_TS Imported Variables
00111   * @{
00112   */
00113   /**
00114     * @}
00115     */
00116
00117 /** @defgroup STM32746G_DISCOVERY_TS_Private_Variables STM32746G_DISCOVERY_TS Private Variables
00118   * @{
00119   */
00120 static TS_DrvTypeDef *tsDriver;
00121 static uint16_t tsXBoundary, tsYBoundary;
00122 static uint8_t  tsOrientation;
00123 static uint8_t  I2cAddress;
00124 /**
00125   * @}
00126   */
00127
00128 /** @defgroup STM32746G_DISCOVERY_TS_Private_Function_Prototypes STM32746G_DISCOVERY_TS Private Function Prototypes
00129   * @{
00130   */
00131 /**
00132   * @}
00133   */
00134
00135 /** @defgroup STM32746G_DISCOVERY_TS_Exported_Functions STM32746G_DISCOVERY_TS Exported Functions
00136   * @{
00137   */
00138
00139 /**
00140   * @brief  Initializes and configures the touch screen functionalities and
00141   *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00142   * @param  ts_SizeX: Maximum X size of the TS area on LCD
00143   * @param  ts_SizeY: Maximum Y size of the TS area on LCD
00144   * @retval TS_OK if all initializations are OK. Other value if error.
00145   */
00146 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
00147 {
00148   uint8_t status = TS_OK;
00149   tsXBoundary = ts_SizeX;
00150   tsYBoundary = ts_SizeY;
00151
00152   /* Read ID and verify if the touch screen driver is ready */
00153   ft5336_ts_drv.Init(TS_I2C_ADDRESS);
00154   if(ft5336_ts_drv.ReadID(TS_I2C_ADDRESS) == FT5336_ID_VALUE)
00155   {
00156     /* Initialize the TS driver structure */
00157     tsDriver = &ft5336_ts_drv;
00158     I2cAddress = TS_I2C_ADDRESS;
00159     tsOrientation = TS_SWAP_XY;
00160
00161     /* Initialize the TS driver */
00162     tsDriver->Start(I2cAddress);
00163   }
00164   else
00165   {
00166     status = TS_DEVICE_NOT_FOUND;
00167   }
00168
00169   return status;
00170 }
00171
00172 /**
00173   * @brief  DeInitializes the TouchScreen.
00174   * @retval TS state
00175   */
00176 uint8_t BSP_TS_DeInit(void)
00177 {
00178   /* Actually ts_driver does not provide a DeInit function */
00179   return TS_OK;
00180 }
00181
00182 /**
00183   * @brief  Configures and enables the touch screen interrupts.
00184   * @retval TS_OK if all initializations are OK. Other value if error.
00185   */
00186 uint8_t BSP_TS_ITConfig(void)
00187 {
00188   GPIO_InitTypeDef gpio_init_structure;
00189
00190   /* Configure Interrupt mode for SD detection pin */
00191   gpio_init_structure.Pin = TS_INT_PIN;
00192   gpio_init_structure.Pull = GPIO_NOPULL;
00193   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00194   gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00195   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00196
00197   /* Enable and set Touch screen EXTI Interrupt to the lowest priority */
00198   HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x0F, 0x00);
00199   HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00200
00201   /* Enable the TS ITs */
00202   tsDriver->EnableIT(I2cAddress);
00203
00204   return TS_OK;
00205 }
00206
00207 /**
00208   * @brief  Gets the touch screen interrupt status.
00209   * @retval TS_OK if all initializations are OK. Other value if error.
00210   */
00211 uint8_t BSP_TS_ITGetStatus(void)
00212 {
00213   /* Return the TS IT status */
00214   return (tsDriver->GetITStatus(I2cAddress));
00215 }
00216
00217 /**
00218   * @brief  Returns status and positions of the touch screen.
00219   * @param  TS_State: Pointer to touch screen current state structure
00220   * @retval TS_OK if all initializations are OK. Other value if error.
00221   */
00222 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00223 {
00224   static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0};
00225   static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0};
00226   uint8_t ts_status = TS_OK;
00227   uint16_t x[TS_MAX_NB_TOUCH];
00228   uint16_t y[TS_MAX_NB_TOUCH];
00229   uint16_t brute_x[TS_MAX_NB_TOUCH];
00230   uint16_t brute_y[TS_MAX_NB_TOUCH];
00231   uint16_t x_diff;
00232   uint16_t y_diff;
00233   uint32_t index;
00234 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00235   uint32_t weight = 0;
00236   uint32_t area = 0;
00237   uint32_t event = 0;
00238 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00239
00240   /* Check and update the number of touches active detected */
00241   TS_State->touchDetected = tsDriver->DetectTouch(I2cAddress);
00242
00243   if(TS_State->touchDetected)
00244   {
00245     for(index=0; index < TS_State->touchDetected; index++)
00246     {
00247       /* Get each touch coordinates */
00248       tsDriver->GetXY(I2cAddress, &(brute_x[index]), &(brute_y[index]));
00249
00250       if(tsOrientation == TS_SWAP_NONE)
00251       {
00252         x[index] = brute_x[index];
00253         y[index] = brute_y[index];
00254       }
00255
00256       if(tsOrientation & TS_SWAP_X)
00257       {
00258         x[index] = 4096 - brute_x[index];
00259       }
00260
00261       if(tsOrientation & TS_SWAP_Y)
00262       {
00263         y[index] = 4096 - brute_y[index];
00264       }
00265
00266       if(tsOrientation & TS_SWAP_XY)
00267       {
00268         y[index] = brute_x[index];
00269         x[index] = brute_y[index];
00270       }
00271
00272       x_diff = x[index] > _x[index]? (x[index] - _x[index]): (_x[index] - x[index]);
00273       y_diff = y[index] > _y[index]? (y[index] - _y[index]): (_y[index] - y[index]);
00274
00275       if ((x_diff + y_diff) > 5)
00276       {
00277         _x[index] = x[index];
00278         _y[index] = y[index];
00279       }
00280
00281       if(I2cAddress == FT5336_I2C_SLAVE_ADDRESS)
00282       {
00283         TS_State->touchX[index] = x[index];
00284         TS_State->touchY[index] = y[index];
00285       }
00286       else
00287       {
00288         /* 2^12 = 4096 : indexes are expressed on a dynamic of 4096 */
00289         TS_State->touchX[index] = (tsXBoundary * _x[index]) >> 12;
00290         TS_State->touchY[index] = (tsYBoundary * _y[index]) >> 12;
00291       }
00292
00293 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00294
00295       /* Get touch info related to the current touch */
00296       ft5336_TS_GetTouchInfo(I2cAddress, index, &weight, &area, &event);
00297
00298       /* Update TS_State structure */
00299       TS_State->touchWeight[index] = weight;
00300       TS_State->touchArea[index]   = area;
00301
00302       /* Remap touch event */
00303       switch(event)
00304       {
00305         case FT5336_TOUCH_EVT_FLAG_PRESS_DOWN   :
00306           TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN;
00307           break;
00308         case FT5336_TOUCH_EVT_FLAG_LIFT_UP :
00309           TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP;
00310           break;
00311         case FT5336_TOUCH_EVT_FLAG_CONTACT :
00312           TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT;
00313           break;
00314         case FT5336_TOUCH_EVT_FLAG_NO_EVENT :
00315           TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00316           break;
00317         default :
00318           ts_status = TS_ERROR;
00319           break;
00320       } /* of switch(event) */
00321
00322 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00323
00324     } /* of for(index=0; index < TS_State->touchDetected; index++) */
00325
00326 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00327     /* Get gesture Id */
00328     ts_status = BSP_TS_Get_GestureId(TS_State);
00329 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00330
00331   } /* end of if(TS_State->touchDetected != 0) */
00332
00333   return (ts_status);
00334 }
00335
00336 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00337 /**
00338   * @brief  Update gesture Id following a touch detected.
00339   * @param  TS_State: Pointer to touch screen current state structure
00340   * @retval TS_OK if all initializations are OK. Other value if error.
00341   */
00342 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State)
00343 {
00344   uint32_t gestureId = 0;
00345   uint8_t  ts_status = TS_OK;
00346
00347   /* Get gesture Id */
00348   ft5336_TS_GetGestureID(I2cAddress, &gestureId);
00349
00350   /* Remap gesture Id to a TS_GestureIdTypeDef value */
00351   switch(gestureId)
00352   {
00353     case FT5336_GEST_ID_NO_GESTURE :
00354       TS_State->gestureId = GEST_ID_NO_GESTURE;
00355       break;
00356     case FT5336_GEST_ID_MOVE_UP :
00357       TS_State->gestureId = GEST_ID_MOVE_UP;
00358       break;
00359     case FT5336_GEST_ID_MOVE_RIGHT :
00360       TS_State->gestureId = GEST_ID_MOVE_RIGHT;
00361       break;
00362     case FT5336_GEST_ID_MOVE_DOWN :
00363       TS_State->gestureId = GEST_ID_MOVE_DOWN;
00364       break;
00365     case FT5336_GEST_ID_MOVE_LEFT :
00366       TS_State->gestureId = GEST_ID_MOVE_LEFT;
00367       break;
00368     case FT5336_GEST_ID_ZOOM_IN :
00369       TS_State->gestureId = GEST_ID_ZOOM_IN;
00370       break;
00371     case FT5336_GEST_ID_ZOOM_OUT :
00372       TS_State->gestureId = GEST_ID_ZOOM_OUT;
00373       break;
00374     default :
00375       ts_status = TS_ERROR;
00376       break;
00377   } /* of switch(gestureId) */
00378
00379   return(ts_status);
00380 }
00381 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00382
00383 /**
00384   * @brief  Clears all touch screen interrupts.
00385   */
00386 void BSP_TS_ITClear(void)
00387 {
00388   /* Clear TS IT pending bits */
00389   tsDriver->ClearIT(I2cAddress);
00390 }
00391
00392
00393 /** @defgroup STM32756G_DISCOVERY_TS_Private_Functions TS Private Functions
00394   * @{
00395   */
00396
00397
00398 /**
00399   * @brief  Function used to reset all touch data before a new acquisition
00400   *         of touch information.
00401   * @param  TS_State: Pointer to touch screen current state structure
00402   * @retval TS_OK if OK, TE_ERROR if problem found.
00403   */
00404 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State)
00405 {
00406   uint8_t ts_status = TS_ERROR;
00407   uint32_t index;
00408
00409   if (TS_State != (TS_StateTypeDef *)NULL)
00410   {
00411     TS_State->gestureId = GEST_ID_NO_GESTURE;
00412     TS_State->touchDetected = 0;
00413
00414     for(index = 0; index < TS_MAX_NB_TOUCH; index++)
00415     {
00416       TS_State->touchX[index]       = 0;
00417       TS_State->touchY[index]       = 0;
00418       TS_State->touchArea[index]    = 0;
00419       TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00420       TS_State->touchWeight[index]  = 0;
00421     }
00422
00423     ts_status = TS_OK;
00424
00425   } /* of if (TS_State != (TS_StateTypeDef *)NULL) */
00426
00427   return (ts_status);
00428 }
00429
00430 /**
00431   * @}
00432   */
00433
00434 /**
00435   * @}
00436   */
00437
00438 /**
00439   * @}
00440   */
00441
00442 /**
00443   * @}
00444   */
00445
00446 /**
00447   * @}
00448   */
00449
00450 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: stm32746g_discovery_ts.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32746G-Discovery
stm32746g_discovery_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32746g_discovery_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32746g_discovery_ts.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */
00036
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __STM32746G_DISCOVERY_TS_H
00039 #define __STM32746G_DISCOVERY_TS_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32746g_discovery.h"
00047 /* Include touch screen FT5336 component Driver */
00048 #include "../Components/ft5336/ft5336.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32746G_DISCOVERY
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32746G_DISCOVERY_TS
00059   * @{
00060   */
00061
00062  /** @defgroup STM32746G_DISCOVERY_TS_Exported_Constants STM32746G_DISCOVERY_TS Exported Constants
00063    * @{
00064    */
00065
00066 /** @brief With FT5336 : maximum 5 touches detected simultaneously
00067   */
00068 #define TS_MAX_NB_TOUCH                 ((uint32_t) FT5336_MAX_DETECTABLE_TOUCH)
00069
00070 #define TS_NO_IRQ_PENDING               ((uint8_t) 0)
00071 #define TS_IRQ_PENDING                  ((uint8_t) 1)
00072
00073 #define TS_SWAP_NONE                    ((uint8_t) 0x01)
00074 #define TS_SWAP_X                       ((uint8_t) 0x02)
00075 #define TS_SWAP_Y                       ((uint8_t) 0x04)
00076 #define TS_SWAP_XY                      ((uint8_t) 0x08)
00077
00078 /**
00079   * @}
00080   */
00081
00082 /** @defgroup STM32746G_DISCOVERY_TS_Exported_Types  STM32746G_DISCOVERY_TS Exported Types
00083   * @{
00084   */
00085 /**
00086 *  @brief TS_StateTypeDef
00087 *  Define TS State structure
00088 */
00089 typedef struct
00090 {
00091   uint8_t  touchDetected;                /*!< Total number of active touches detected at last scan */
00092   uint16_t touchX[TS_MAX_NB_TOUCH];      /*!< Touch X[0], X[1] coordinates on 12 bits */
00093   uint16_t touchY[TS_MAX_NB_TOUCH];      /*!< Touch Y[0], Y[1] coordinates on 12 bits */
00094
00095 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00096   uint8_t  touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */
00097   uint8_t  touchEventId[TS_MAX_NB_TOUCH];     /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
00098   uint8_t  touchArea[TS_MAX_NB_TOUCH];   /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */
00099   uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
00100 #endif  /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00101
00102 } TS_StateTypeDef;
00103
00104 /**
00105   * @}
00106   */
00107
00108 /** @defgroup STM32746G_DISCOVERY_TS_Exported_Constants STM32746G_DISCOVERY_TS Exported Constants
00109   * @{
00110   */
00111
00112 typedef enum
00113 {
00114   TS_OK                = 0x00, /*!< Touch Ok */
00115   TS_ERROR             = 0x01, /*!< Touch Error */
00116   TS_TIMEOUT           = 0x02, /*!< Touch Timeout */
00117   TS_DEVICE_NOT_FOUND  = 0x03  /*!< Touchscreen device not found */
00118 }TS_StatusTypeDef;
00119
00120 /**
00121  *  @brief TS_GestureIdTypeDef
00122  *  Define Possible managed gesture identification values returned by touch screen
00123  *  driver.
00124  */
00125 typedef enum
00126 {
00127   GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
00128   GEST_ID_MOVE_UP    = 0x01, /*!< Gesture Move Up */
00129   GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
00130   GEST_ID_MOVE_DOWN  = 0x03, /*!< Gesture Move Down */
00131   GEST_ID_MOVE_LEFT  = 0x04, /*!< Gesture Move Left */
00132   GEST_ID_ZOOM_IN    = 0x05, /*!< Gesture Zoom In */
00133   GEST_ID_ZOOM_OUT   = 0x06, /*!< Gesture Zoom Out */
00134   GEST_ID_NB_MAX     = 0x07  /*!< max number of gesture id */
00135
00136 } TS_GestureIdTypeDef;
00137
00138 /**
00139  *  @brief TS_TouchEventTypeDef
00140  *  Define Possible touch events kind as returned values
00141  *  by touch screen IC Driver.
00142  */
00143 typedef enum
00144 {
00145   TOUCH_EVENT_NO_EVT        = 0x00, /*!< Touch Event : undetermined */
00146   TOUCH_EVENT_PRESS_DOWN    = 0x01, /*!< Touch Event Press Down */
00147   TOUCH_EVENT_LIFT_UP       = 0x02, /*!< Touch Event Lift Up */
00148   TOUCH_EVENT_CONTACT       = 0x03, /*!< Touch Event Contact */
00149   TOUCH_EVENT_NB_MAX        = 0x04  /*!< max number of touch events kind */
00150
00151 } TS_TouchEventTypeDef;
00152 /**
00153   * @}
00154   */
00155
00156 /** @defgroup STM32746G_DISCOVERY_TS_Imported_Variables STM32746G_DISCOVERY_TS Imported Variables
00157   * @{
00158   */
00159 /**
00160  *  @brief Table for touchscreen event information display on LCD :
00161  *  table indexed on enum @ref TS_TouchEventTypeDef information
00162  */
00163 extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
00164
00165 /**
00166  *  @brief Table for touchscreen gesture Id information display on LCD : table indexed
00167  *  on enum @ref TS_GestureIdTypeDef information
00168  */
00169 extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
00170 /**
00171   * @}
00172   */
00173
00174 /** @addtogroup STM32746G_DISCOVERY_TS_Exported_Functions
00175   * @{
00176   */
00177 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
00178 uint8_t BSP_TS_DeInit(void);
00179 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00180
00181 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00182 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
00183 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00184
00185 uint8_t BSP_TS_ITConfig(void);
00186 uint8_t BSP_TS_ITGetStatus(void);
00187 void    BSP_TS_ITClear(void);
00188 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);
00189 /**
00190   * @}
00191   */
00192
00193 /**
00194   * @}
00195   */
00196
00197 /**
00198   * @}
00199   */
00200
00201 /**
00202   * @}
00203   */
00204
00205
00206 #ifdef __cplusplus
00207 }
00208 #endif
00209
00210 #endif /* __STM32746G_DISCOVERY_TS_H */
00211
00212 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32746G-Discovery BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference