STM32756G_EVAL BSP User Manual: STM32756G_EVAL BSP Drivers

STM32756G_EVAL BSP User Manual
  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories
STM32756G_EVAL BSP Drivers

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32756G_EVAL 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 |  | STM32756G_EVAL Board
Generated on Fri May 26 2017 12:30:21 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


STM32756G_EVAL BSP User Manual: STM32756G-EVAL LOW LEVEL Private Types Definitions

  • Data Structures
  • Files
  • Directories
STM32756G-EVAL LOW LEVEL Private Types Definitions
STM32756G-EVAL LOW LEVEL


STM32756G_EVAL BSP User Manual: STM32756G-EVAL LOW LEVEL Private Defines

Defines
STM32756G-EVAL LOW LEVEL Private Defines
STM32756G-EVAL LOW LEVEL

Defines

#define | __STM32756G_EVAL_BSP_VERSION_MAIN (0x02)
STM32756G EVAL BSP Driver version number V2.0.1.
#define | __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)
#define | __STM32756G_EVAL_BSP_VERSION_SUB2 (0x01)
#define | __STM32756G_EVAL_BSP_VERSION_RC (0x00)
#define | __STM32756G_EVAL_BSP_VERSION

Define Documentation

#define __STM32756G_EVAL_BSP_VERSION
Value:
((__STM32756G_EVAL_BSP_VERSION_MAIN << 24)\
                                             |(__STM32756G_EVAL_BSP_VERSION_SUB1 << 16)\
                                             |(__STM32756G_EVAL_BSP_VERSION_SUB2 << 8 )\
                                             |(__STM32756G_EVAL_BSP_VERSION_RC))

Definition at line 102 of file stm32756g_eval.c.

Referenced by BSP_GetVersion().

#define __STM32756G_EVAL_BSP_VERSION_MAIN (0x02)

STM32756G EVAL BSP Driver version number V2.0.1.

[31:24] main version

Definition at line 98 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 101 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)

[23:16] sub1 version

Definition at line 99 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_SUB2 (0x01)

[15:8] sub2 version

Definition at line 100 of file stm32756g_eval.c.


STM32756G_EVAL BSP User Manual: STM32756G-EVAL LOW LEVEL Private Macros

STM32756G-EVAL LOW LEVEL Private Macros
STM32756G-EVAL LOW LEVEL


STM32756G_EVAL BSP User Manual: STM32756G-EVAL LOW LEVEL Private Variables

Variables
STM32756G-EVAL LOW LEVEL Private Variables
STM32756G-EVAL LOW LEVEL

Variables

const uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn]
const uint16_t | BUTTON_PIN [BUTTONn]
const uint16_t | BUTTON_IRQn [BUTTONn]
USART_TypeDef * | COM_USART [COMn] = {EVAL_COM1}
GPIO_TypeDef * | COM_TX_PORT [COMn] = {EVAL_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {EVAL_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {EVAL_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {EVAL_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {EVAL_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {EVAL_COM1_RX_AF}
static I2C_HandleTypeDef | hEvalI2c
static ADC_HandleTypeDef | hEvalADC

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 140 of file stm32756g_eval.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 136 of file stm32756g_eval.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 132 of file stm32756g_eval.c.

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

const uint16_t COM_RX_AF[COMn] = {EVAL_COM1_RX_AF}

Definition at line 156 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN}

Definition at line 152 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT}

Definition at line 148 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF}

Definition at line 154 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN}

Definition at line 150 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT}

Definition at line 146 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

USART_TypeDef* COM_USART[COMn] = {EVAL_COM1}

Definition at line 144 of file stm32756g_eval.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

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

Definition at line 127 of file stm32756g_eval.c.

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

ADC_HandleTypeDef hEvalADC [static]

Definition at line 159 of file stm32756g_eval.c.

Referenced by BSP_POTENTIOMETER_GetLevel(), and BSP_POTENTIOMETER_Init().

I2C_HandleTypeDef hEvalI2c [static]

Definition at line 158 of file stm32756g_eval.c.

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


STM32756G_EVAL BSP User Manual: STM32756G_EVAL LOW LEVEL Private Function Prototypes

STM32756G_EVAL LOW LEVEL Private Function Prototypes
STM32756G-EVAL LOW LEVEL


STM32756G_EVAL BSP User Manual: STM32756G_EVAL LOW LEVEL Private Functions

Functions
STM32756G_EVAL LOW LEVEL Private Functions
STM32756G-EVAL LOW LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32756G EVAL BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on GPIO and/or on MFX.
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.
void | BSP_POTENTIOMETER_Init (void)
Init Potentiometer.
uint32_t | BSP_POTENTIOMETER_GetLevel (void)
Get Potentiometer level in 12 bits.
static void | I2Cx_MspInit (void)
Initializes I2C MSP.
static void | I2Cx_Init (void)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static HAL_StatusTypeDef | I2Cx_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
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, uint16_t Reg, uint16_t Value)
Camera writes single data.
uint16_t | CAMERA_IO_Read (uint8_t Addr, uint16_t Reg)
Camera reads single data.
void | CAMERA_Delay (uint32_t Delay)
Camera delay.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.

Function Documentation

void AUDIO_IO_DeInit ( void )

Deinitializes Audio low level.

Return values:
None

Definition at line 1233 of file stm32756g_eval.c.

void AUDIO_IO_Delay ( uint32_t Delay )

AUDIO Codec delay.

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

Definition at line 1281 of file stm32756g_eval.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Return values:
None

Definition at line 1224 of file stm32756g_eval.c.

References I2Cx_Init().

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

Reads a single data.

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

Definition at line 1261 of file stm32756g_eval.c.

References I2Cx_ReadMultiple().

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

Writes a single data.

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

Definition at line 1244 of file stm32756g_eval.c.

References 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 618 of file stm32756g_eval.c.

References COM_USART, and EVAL_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 578 of file stm32756g_eval.c.

References COM_RX_AF, COM_RX_PIN, COM_RX_PORT, COM_TX_AF, COM_TX_PIN, COM_TX_PORT, COM_USART, EVAL_COMx_CLK_ENABLE, EVAL_COMx_RX_GPIO_CLK_ENABLE, and EVAL_COMx_TX_GPIO_CLK_ENABLE.

uint32_t BSP_GetVersion ( void )

This method returns the STM32756G EVAL BSP Driver revision.

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

Definition at line 231 of file stm32756g_eval.c.

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

Definition at line 310 of file stm32756g_eval.c.

References BSP_IO_ConfigPin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED on GPIO and/or on MFX.

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

Definition at line 246 of file stm32756g_eval.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), BSP_IO_PIN_SET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_CLK_ENABLE, LED1_GPIO_PORT, LED3, LED3_GPIO_CLK_ENABLE, and LED3_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
  • LED2
  • LED3
  • LED4
Return values:
None

Definition at line 399 of file stm32756g_eval.c.

References BSP_IO_PIN_SET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

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

Definition at line 359 of file stm32756g_eval.c.

References BSP_IO_PIN_RESET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

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

Definition at line 440 of file stm32756g_eval.c.

References BSP_IO_TogglePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
PB DeInit does not disable the GPIO clock
Return values:
None

Definition at line 541 of file stm32756g_eval.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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
Return values:
The Button GPIO pin value

Definition at line 563 of file stm32756g_eval.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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
Return values:
None

Definition at line 487 of file stm32756g_eval.c.

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

uint32_t BSP_POTENTIOMETER_GetLevel ( void )

Get Potentiometer level in 12 bits.

Return values:
Potentiometer level(0..0xFFF) / 0xFFFFFFFF : Error

Definition at line 687 of file stm32756g_eval.c.

References ADCx_POLL_TIMEOUT, and hEvalADC.

void BSP_POTENTIOMETER_Init ( void )

Init Potentiometer.

Return values:
None

Definition at line 638 of file stm32756g_eval.c.

References ADCx, ADCx_CHANNEL, ADCx_CHANNEL_GPIO_CLK_ENABLE, ADCx_CHANNEL_GPIO_PORT, ADCx_CHANNEL_PIN, ADCx_CLK_ENABLE, and hEvalADC.

void CAMERA_Delay ( uint32_t Delay )

Camera delay.

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

Definition at line 1335 of file stm32756g_eval.c.

void CAMERA_IO_Init ( void )

Initializes Camera low level.

Return values:
None

Definition at line 1292 of file stm32756g_eval.c.

References I2Cx_Init().

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

Camera reads single data.

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

Definition at line 1319 of file stm32756g_eval.c.

References I2Cx_ReadMultiple().

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

Camera writes single data.

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

Definition at line 1304 of file stm32756g_eval.c.

References I2Cx_WriteMultiple().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Return values:
None

Definition at line 1346 of file stm32756g_eval.c.

References 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 1384 of file stm32756g_eval.c.

References 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 1372 of file stm32756g_eval.c.

References 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 1359 of file stm32756g_eval.c.

References I2Cx_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().

static void I2Cx_Error ( uint8_t Addr ) [static]

Manages error callback by re-initializing I2C.

Parameters:
Addr,: I2C Address
Return values:
None

Definition at line 1013 of file stm32756g_eval.c.

References hEvalI2c, and I2Cx_Init().

Referenced by I2Cx_ReadMultiple(), and I2Cx_WriteMultiple().

static void I2Cx_Init ( void ) [static]

Initializes I2C HAL.

Return values:
None

Definition at line 876 of file stm32756g_eval.c.

References EVAL_I2Cx, hEvalI2c, and I2Cx_MspInit().

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

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

Checks if target device is ready for communication.

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

Definition at line 1003 of file stm32756g_eval.c.

References hEvalI2c.

Referenced by EEPROM_IO_IsDeviceReady().

static void I2Cx_MspInit ( void ) [static]

Initializes I2C MSP.

Return values:
None

Definition at line 833 of file stm32756g_eval.c.

References EVAL_I2Cx_CLK_ENABLE, EVAL_I2Cx_ER_IRQn, EVAL_I2Cx_EV_IRQn, EVAL_I2Cx_FORCE_RESET, EVAL_I2Cx_RELEASE_RESET, EVAL_I2Cx_SCL_PIN, EVAL_I2Cx_SCL_SDA_AF, EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE, EVAL_I2Cx_SCL_SDA_GPIO_PORT, and EVAL_I2Cx_SDA_PIN.

Referenced by I2Cx_Init().

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

Reads multiple data.

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

Definition at line 950 of file stm32756g_eval.c.

References EXC7200_I2C_ADDRESS, hEvalI2c, and I2Cx_Error().

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

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

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

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

Definition at line 981 of file stm32756g_eval.c.

References hEvalI2c, and I2Cx_Error().

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


STM32756G_EVAL BSP User Manual: LEVEL Exported Types

Enumerations
LEVEL Exported Types
STM32756G-EVAL LOW LEVEL

Enumerations

enum | Led_TypeDef { LED1 = 0, LED_GREEN = LED1, LED3 = 1, LED_RED = LED3 }
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 89 of file stm32756g_eval.h.

enum ButtonMode_TypeDef
Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 96 of file stm32756g_eval.h.

enum COM_TypeDef
Enumerator:
COM1
COM2

Definition at line 120 of file stm32756g_eval.h.

enum Led_TypeDef
Enumerator:
LED1
LED_GREEN
LED3
LED_RED

Definition at line 70 of file stm32756g_eval.h.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_LOW_LEVEL_LED

Defines
STM32756G_EVAL_LOW_LEVEL_LED
LOW LEVEL Exported Constants

Define for STM32756G_EVAL board. More...

Defines

#define | LEDn ((uint8_t)2)
#define | LED1_GPIO_PORT GPIOF
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_10 /* To use LED1, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
#define | LED3_GPIO_PORT GPIOB
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED3_PIN GPIO_PIN_7 /* To use LED3, ensure that JP23 is in position 2-3, camera is then no more usable */

Detailed Description

Define for STM32756G_EVAL board.

Define Documentation

#define LED1_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 156 of file stm32756g_eval.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 155 of file stm32756g_eval.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT GPIOF

Definition at line 154 of file stm32756g_eval.h.

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

#define LED1_PIN GPIO_PIN_10 /* To use LED1, ensure that JP24 is in position 2-3, potentiometer is then no more usable */

Definition at line 157 of file stm32756g_eval.h.

#define LED3_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 161 of file stm32756g_eval.h.

#define LED3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 160 of file stm32756g_eval.h.

Referenced by BSP_LED_Init().

#define LED3_GPIO_PORT GPIOB

Definition at line 159 of file stm32756g_eval.h.

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

#define LED3_PIN GPIO_PIN_7 /* To use LED3, ensure that JP23 is in position 2-3, camera is then no more usable */

Definition at line 162 of file stm32756g_eval.h.

#define LEDn ((uint8_t)2)

Definition at line 151 of file stm32756g_eval.h.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_LOW_LEVEL_BUTTON

Defines
STM32756G_EVAL_LOW_LEVEL_BUTTON
LOW LEVEL Exported Constants

Defines

#define | BUTTONn ((uint8_t)3)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_13
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOC
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | TAMPER_BUTTON_PIN GPIO_PIN_13
Tamper push-button.
#define | TAMPER_BUTTON_GPIO_PORT GPIOC
#define | TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | KEY_BUTTON_PIN GPIO_PIN_13
Key push-button.
#define | KEY_BUTTON_GPIO_PORT GPIOC
#define | KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_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 191 of file stm32756g_eval.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 224 of file stm32756g_eval.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 220 of file stm32756g_eval.h.

Referenced by BSP_PB_Init().

#define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 218 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 217 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 216 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_PORT GPIOC

Definition at line 215 of file stm32756g_eval.h.

#define KEY_BUTTON_PIN GPIO_PIN_13

Key push-button.

Definition at line 214 of file stm32756g_eval.h.

#define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 209 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 208 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 207 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_PORT GPIOC

Definition at line 206 of file stm32756g_eval.h.

#define TAMPER_BUTTON_PIN GPIO_PIN_13

Tamper push-button.

Definition at line 205 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 200 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 199 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 198 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_PORT GPIOC

Definition at line 197 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_PIN GPIO_PIN_13

Wakeup push-button.

Definition at line 196 of file stm32756g_eval.h.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_LOW_LEVEL_COM

Defines
STM32756G_EVAL_LOW_LEVEL_COM
LOW LEVEL Exported Constants

Defines

#define | COMn ((uint8_t)1)
#define | EVAL_COM1 USART1
Definition for COM port1, connected to USART1.
#define | EVAL_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
#define | EVAL_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
#define | EVAL_COM1_TX_PIN GPIO_PIN_9
#define | EVAL_COM1_TX_GPIO_PORT GPIOA
#define | EVAL_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | EVAL_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | EVAL_COM1_TX_AF GPIO_AF7_USART1
#define | EVAL_COM1_RX_PIN GPIO_PIN_10
#define | EVAL_COM1_RX_GPIO_PORT GPIOA
#define | EVAL_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | EVAL_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | EVAL_COM1_RX_AF GPIO_AF7_USART1
#define | EVAL_COM1_IRQn USART1_IRQn
#define | EVAL_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0)
#define | EVAL_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0)
#define | EVAL_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0)
#define | ADCx ADC3
Definition for Potentiometer, connected to ADC3.
#define | ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE()
#define | ADCx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | ADCx_FORCE_RESET() __HAL_RCC_ADC_FORCE_RESET()
#define | ADCx_RELEASE_RESET() __HAL_RCC_ADC_RELEASE_RESET()
#define | ADCx_CHANNEL_PIN GPIO_PIN_10
#define | ADCx_CHANNEL_GPIO_PORT GPIOF
#define | ADCx_CHANNEL ADC_CHANNEL_8
#define | SAMPLINGTIME ADC_SAMPLETIME_3CYCLES
#define | ADCx_POLL_TIMEOUT 10
#define | IO_I2C_ADDRESS ((uint16_t)0x84) /*mfx MFX_I2C_ADDR 0*/
Joystick Pins definition.
#define | IO_I2C_ADDRESS_2 ((uint16_t)0x86) /*mfx MFX_I2C_ADDR 1*/
#define | TS_I2C_ADDRESS ((uint16_t)0x82) /*stmpe811 used on MB1046 board */
#define | TS3510_I2C_ADDRESS ((uint16_t)0x80)
#define | EXC7200_I2C_ADDRESS ((uint16_t)0x08)
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x5A)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
#define | EVAL_I2Cx I2C1
#define | EVAL_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | EVAL_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | EVAL_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | EVAL_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | EVAL_I2Cx_SCL_PIN GPIO_PIN_8
#define | EVAL_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | EVAL_I2Cx_SDA_PIN GPIO_PIN_9
#define | EVAL_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | EVAL_I2Cx_ER_IRQn I2C1_ER_IRQn

Define Documentation

#define ADCx ADC3

Definition for Potentiometer, connected to ADC3.

Definition at line 268 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL ADC_CHANNEL_8

Definition at line 280 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 270 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_GPIO_PORT GPIOF

Definition at line 277 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_PIN GPIO_PIN_10

Definition at line 276 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CLK_ENABLE ( ) __HAL_RCC_ADC3_CLK_ENABLE()

Definition at line 269 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_FORCE_RESET ( ) __HAL_RCC_ADC_FORCE_RESET()

Definition at line 272 of file stm32756g_eval.h.

#define ADCx_POLL_TIMEOUT 10

Definition at line 282 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_GetLevel().

#define ADCx_RELEASE_RESET ( ) __HAL_RCC_ADC_RELEASE_RESET()

Definition at line 273 of file stm32756g_eval.h.

#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)

Definition at line 329 of file stm32756g_eval.h.

Referenced by 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)0x5A)

Definition at line 328 of file stm32756g_eval.h.

Referenced by BSP_CAMERA_Init().

#define COMn ((uint8_t)1)

Definition at line 233 of file stm32756g_eval.h.

#define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)

Definition at line 330 of file stm32756g_eval.h.

Referenced by BSP_EEPROM_Init().

#define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)

Definition at line 331 of file stm32756g_eval.h.

Referenced by BSP_EEPROM_Init().

#define EVAL_COM1 USART1

Definition for COM port1, connected to USART1.

Definition at line 238 of file stm32756g_eval.h.

#define EVAL_COM1_CLK_DISABLE ( ) __HAL_RCC_USART1_CLK_DISABLE()

Definition at line 240 of file stm32756g_eval.h.

#define EVAL_COM1_CLK_ENABLE ( ) __HAL_RCC_USART1_CLK_ENABLE()

Definition at line 239 of file stm32756g_eval.h.

#define EVAL_COM1_IRQn USART1_IRQn

Definition at line 254 of file stm32756g_eval.h.

#define EVAL_COM1_RX_AF GPIO_AF7_USART1

Definition at line 252 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 251 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 250 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_PORT GPIOA

Definition at line 249 of file stm32756g_eval.h.

#define EVAL_COM1_RX_PIN GPIO_PIN_10

Definition at line 248 of file stm32756g_eval.h.

#define EVAL_COM1_TX_AF GPIO_AF7_USART1

Definition at line 246 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 245 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 244 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_PORT GPIOA

Definition at line 243 of file stm32756g_eval.h.

#define EVAL_COM1_TX_PIN GPIO_PIN_9

Definition at line 242 of file stm32756g_eval.h.

#define EVAL_COMx_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0)

Definition at line 257 of file stm32756g_eval.h.

Referenced by BSP_COM_DeInit().

#define EVAL_COMx_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0)

Definition at line 256 of file stm32756g_eval.h.

Referenced by BSP_COM_Init().

#define EVAL_COMx_RX_GPIO_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0)

Definition at line 263 of file stm32756g_eval.h.

#define EVAL_COMx_RX_GPIO_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0)

Definition at line 262 of file stm32756g_eval.h.

Referenced by BSP_COM_Init().

#define EVAL_COMx_TX_GPIO_CLK_DISABLE ( __INDEX__ ) (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0)

Definition at line 260 of file stm32756g_eval.h.

#define EVAL_COMx_TX_GPIO_CLK_ENABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0)

Definition at line 259 of file stm32756g_eval.h.

Referenced by BSP_COM_Init().

#define EVAL_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 345 of file stm32756g_eval.h.

#define EVAL_I2Cx I2C1

Definition at line 343 of file stm32756g_eval.h.

Referenced by I2Cx_Init().

#define EVAL_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 344 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_ER_IRQn I2C1_ER_IRQn

Definition at line 359 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_EV_IRQn I2C1_EV_IRQn

Definition at line 358 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 348 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 349 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_PIN GPIO_PIN_8

Definition at line 352 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 354 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 346 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_SDA_GPIO_PORT GPIOB

Definition at line 353 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SDA_PIN GPIO_PIN_9

Definition at line 355 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EXC7200_I2C_ADDRESS ((uint16_t)0x08)

Definition at line 327 of file stm32756g_eval.h.

Referenced by BSP_TS_Init(), and I2Cx_ReadMultiple().

#define IO_I2C_ADDRESS ((uint16_t)0x84) /*mfx MFX_I2C_ADDR 0*/

Joystick Pins definition.

Eval Pins definition connected to MFX

Definition at line 323 of file stm32756g_eval.h.

Referenced by BSP_IO_ConfigIrqOutPin(), BSP_IO_ConfigPin(), BSP_IO_Init(), BSP_IO_ITClear(), BSP_IO_ITGetStatus(), BSP_IO_ReadPin(), BSP_IO_TogglePin(), and BSP_IO_WritePin().

#define IO_I2C_ADDRESS_2 ((uint16_t)0x86) /*mfx MFX_I2C_ADDR 1*/

Definition at line 324 of file stm32756g_eval.h.

#define SAMPLINGTIME ADC_SAMPLETIME_3CYCLES

Definition at line 281 of file stm32756g_eval.h.

#define TS3510_I2C_ADDRESS ((uint16_t)0x80)

Definition at line 326 of file stm32756g_eval.h.

Referenced by BSP_TS_Init().

#define TS_I2C_ADDRESS ((uint16_t)0x82) /*stmpe811 used on MB1046 board */

Definition at line 325 of file stm32756g_eval.h.

Referenced by BSP_LCD_ClockConfig(), BSP_LCD_InitEx(), and BSP_TS_Init().


STM32756G_EVAL BSP User Manual: LOW LEVEL Exported Constants

Modules | Defines
LOW LEVEL Exported Constants
STM32756G-EVAL LOW LEVEL

Modules

STM32756G_EVAL_LOW_LEVEL_LED

Define for STM32756G_EVAL board.

STM32756G_EVAL_LOW_LEVEL_BUTTON
STM32756G_EVAL_LOW_LEVEL_COM

Defines

#define | MFX_IRQOUT_PIN GPIO_PIN_8
MFX_IRQOUt pin.
#define | MFX_IRQOUT_GPIO_PORT GPIOI
#define | MFX_IRQOUT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | MFX_IRQOUT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | MFX_IRQOUT_EXTI_IRQn EXTI9_5_IRQn

Define Documentation

#define MFX_IRQOUT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 185 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 184 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 183 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_PORT GPIOI

Definition at line 182 of file stm32756g_eval.h.

#define MFX_IRQOUT_PIN GPIO_PIN_8

MFX_IRQOUt pin.

Definition at line 181 of file stm32756g_eval.h.


STM32756G_EVAL BSP User Manual: LOW LEVEL Exported Macros

LOW LEVEL Exported Macros
STM32756G-EVAL LOW LEVEL


STM32756G_EVAL BSP User Manual: LOW LEVEL Exported Functions

Functions
LOW LEVEL Exported Functions
STM32756G-EVAL LOW LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32756G EVAL BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on GPIO and/or on MFX.
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 *husart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
void | BSP_POTENTIOMETER_Init (void)
Init Potentiometer.
uint32_t | BSP_POTENTIOMETER_GetLevel (void)
Get Potentiometer level in 12 bits.

Function Documentation

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 618 of file stm32756g_eval.c.

References COM_USART, and EVAL_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 578 of file stm32756g_eval.c.

References COM_RX_AF, COM_RX_PIN, COM_RX_PORT, COM_TX_AF, COM_TX_PIN, COM_TX_PORT, COM_USART, EVAL_COMx_CLK_ENABLE, EVAL_COMx_RX_GPIO_CLK_ENABLE, and EVAL_COMx_TX_GPIO_CLK_ENABLE.

uint32_t BSP_GetVersion ( void )

This method returns the STM32756G EVAL BSP Driver revision.

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

Definition at line 231 of file stm32756g_eval.c.

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

Definition at line 310 of file stm32756g_eval.c.

References BSP_IO_ConfigPin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED on GPIO and/or on MFX.

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

Definition at line 246 of file stm32756g_eval.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), BSP_IO_PIN_SET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_CLK_ENABLE, LED1_GPIO_PORT, LED3, LED3_GPIO_CLK_ENABLE, and LED3_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
  • LED2
  • LED3
  • LED4
Return values:
None

Definition at line 399 of file stm32756g_eval.c.

References BSP_IO_PIN_SET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

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

Definition at line 359 of file stm32756g_eval.c.

References BSP_IO_PIN_RESET, BSP_IO_WritePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_GPIO_PORT.

void BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

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

Definition at line 440 of file stm32756g_eval.c.

References BSP_IO_TogglePin(), GPIO_PIN, LED1, LED1_GPIO_PORT, LED3, and LED3_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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
PB DeInit does not disable the GPIO clock
Return values:
None

Definition at line 541 of file stm32756g_eval.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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
Return values:
The Button GPIO pin value

Definition at line 563 of file stm32756g_eval.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 STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper and key buttons) are mapped on the same push button named "Wakeup/Tamper" on the board serigraphy.
Return values:
None

Definition at line 487 of file stm32756g_eval.c.

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

uint32_t BSP_POTENTIOMETER_GetLevel ( void )

Get Potentiometer level in 12 bits.

Return values:
Potentiometer level(0..0xFFF) / 0xFFFFFFFF : Error

Definition at line 687 of file stm32756g_eval.c.

References ADCx_POLL_TIMEOUT, and hEvalADC.

void BSP_POTENTIOMETER_Init ( void )

Init Potentiometer.

Return values:
None

Definition at line 638 of file stm32756g_eval.c.

References ADCx, ADCx_CHANNEL, ADCx_CHANNEL_GPIO_CLK_ENABLE, ADCx_CHANNEL_GPIO_PORT, ADCx_CHANNEL_PIN, ADCx_CLK_ENABLE, and hEvalADC.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Private Types

STM32756G_EVAL_AUDIO Private Types
STM32756G_EVAL AUDIO


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Private Defines

STM32756G_EVAL_AUDIO Private Defines
STM32756G_EVAL AUDIO


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Private Macros

STM32756G_EVAL_AUDIO Private Macros
STM32756G_EVAL AUDIO


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Private Variables

Variables
STM32756G_EVAL_AUDIO Private Variables
STM32756G_EVAL AUDIO

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai
I2S_HandleTypeDef | haudio_in_i2s
TIM_HandleTypeDef | haudio_tim
PDMFilter_InitStruct | Filter [2]
uint8_t | Channel_Demux [128]
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Variable Documentation

AUDIO_DrvTypeDef* audio_drv

Definition at line 148 of file stm32756g_eval_audio.c.

Referenced by 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 173 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and BSP_AUDIO_IN_SetVolume().

uint8_t Channel_Demux[128]
Initial value:
 {
    0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
    0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
    0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
    0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
    0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
    0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
    0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
    0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
    0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
    0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
    0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
    0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
    0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
    0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
    0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
    0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f
}

Definition at line 154 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM().

PDMFilter_InitStruct Filter[2]

Definition at line 153 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and PDMDecoder_Init().

I2S_HandleTypeDef haudio_in_i2s

Definition at line 150 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), I2Sx_DeInit(), and I2Sx_Init().

SAI_HandleTypeDef haudio_out_sai

Definition at line 149 of file stm32756g_eval_audio.c.

Referenced by 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(), SAIx_DeInit(), and SAIx_Init().

TIM_HandleTypeDef haudio_tim

Definition at line 151 of file stm32756g_eval_audio.c.

Referenced by TIMx_DeInit(), and TIMx_Init().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Private Function Prototypes

STM32756G_EVAL_AUDIO Private Function Prototypes
STM32756G_EVAL AUDIO


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO_Out Private Functions

Functions
STM32756G_EVAL_AUDIO_Out Private Functions
STM32756G_EVAL 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.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
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.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
void | HAL_I2S_RxCpltCallback (I2S_HandleTypeDef *hi2s)
Rx Transfer completed callbacks.
void | HAL_I2S_RxHalfCpltCallback (I2S_HandleTypeDef *hi2s)
Rx Half Transfer completed callbacks.
void | HAL_I2S_ErrorCallback (I2S_HandleTypeDef *hi2s)
I2S error 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 (I2S_HandleTypeDef *hi2s, void *Params)
Initializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params)
Clock Config.
static void | SAIx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_DeInit (void)
Deinitializes the Audio Codec audio interface (SAI).
static void | PDMDecoder_Init (uint32_t AudioFreq, uint32_t ChnlNbr)
Initializes the PDM library.
static void | I2Sx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (I2S)
static void | I2Sx_DeInit (void)
Deinitializes the Audio Codec audio interface (I2S).
static void | TIMx_IC_MspInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_IC_MspDeInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_Init (void)
Configure TIM as a clock divider by 2.
static void | TIMx_DeInit (void)
Configure TIM as a clock divider by 2.

Function Documentation

__weak void BSP_AUDIO_IN_ClockConfig | ( | I2S_HandleTypeDef * | hi2s,
 |  | uint32_t | AudioFreq,
 |  | void * | Params
 | ) |  |

Clock Config.

Parameters:
hi2s,: might be required to set audio peripheral predivider if any.
AudioFreq,: Audio frequency used to record the audio stream.
Params
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application
Return values:
None

Definition at line 1135 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 914 of file stm32756g_eval_audio.c.

References BSP_AUDIO_IN_MspDeInit(), haudio_in_i2s, I2Sx_DeInit(), and TIMx_DeInit().

__weak void BSP_AUDIO_IN_Error_Callback ( void )

Audio IN Error callback function.

Return values:
None

Definition at line 1014 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_ErrorCallback().

__weak void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1003 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_RxHalfCpltCallback().

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

Initializes wave recording.

Note:
This function assumes that the I2S input clock (through PLL_R in Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the I2S peripheral.
BitRes,: Audio frequency to be configured for the I2S peripheral.
ChnlNbr,: Audio frequency to be configured for the I2S peripheral.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 809 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_OK, BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_MspInit(), haudio_in_i2s, I2Sx_DeInit(), I2Sx_Init(), and PDMDecoder_Init().

__weak void BSP_AUDIO_IN_MspDeInit | ( | I2S_HandleTypeDef * | hi2s,
 |  | void * | Params
 | ) |  |

DeInitializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params
Return values:
None

Definition at line 1095 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_I2Sx_CLK_DISABLE, AUDIO_I2Sx_DMAx_IRQ, AUDIO_I2Sx_SCK_GPIO_PORT, AUDIO_I2Sx_SCK_PIN, AUDIO_I2Sx_SD_GPIO_PORT, and AUDIO_I2Sx_SD_PIN.

Referenced by BSP_AUDIO_IN_DeInit().

__weak void BSP_AUDIO_IN_MspInit | ( | I2S_HandleTypeDef * | hi2s,
 |  | void * | Params
 | ) |  |

Initializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params
Return values:
None

Definition at line 1026 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_I2Sx_CLK_ENABLE, AUDIO_I2Sx_DMAx_CHANNEL, AUDIO_I2Sx_DMAx_CLK_ENABLE, AUDIO_I2Sx_DMAx_IRQ, AUDIO_I2Sx_DMAx_MEM_DATA_SIZE, AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE, AUDIO_I2Sx_DMAx_STREAM, AUDIO_I2Sx_SCK_AF, AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE, AUDIO_I2Sx_SCK_GPIO_PORT, AUDIO_I2Sx_SCK_PIN, AUDIO_I2Sx_SD_AF, AUDIO_I2Sx_SD_GPIO_CLK_ENABLE, AUDIO_I2Sx_SD_GPIO_PORT, AUDIO_I2Sx_SD_PIN, AUDIO_IN_IRQ_PREPRIO, and TIMx_Init().

Referenced by BSP_AUDIO_IN_Init().

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 875 of file stm32756g_eval_audio.c.

References AUDIO_OK, and haudio_in_i2s.

uint8_t BSP_AUDIO_IN_PDMToPCM | ( | uint16_t * | PDMBuf,
 |  | uint16_t * | PCMBuf
 | ) |  |

Converts audio format from PDM to PCM.

Parameters:
PDMBuf,: Pointer to data PDM buffer
PCMBuf,: Pointer to data PCM buffer
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 928 of file stm32756g_eval_audio.c.

References AUDIO_OK, AudioInVolume, Channel_Demux, CHANNEL_DEMUX_MASK, DEFAULT_AUDIO_IN_CHANNEL_NBR, Filter, and INTERNAL_BUFF_SIZE.

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,: Current size of the recorded buffer
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 839 of file stm32756g_eval_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_i2s.

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 887 of file stm32756g_eval_audio.c.

References AUDIO_OK, and haudio_in_i2s.

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t Volume )

Controls the audio in volume level.

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

Definition at line 901 of file stm32756g_eval_audio.c.

References AUDIO_OK, and AudioInVolume.

uint8_t BSP_AUDIO_IN_Stop ( void )

Stops audio recording.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 856 of file stm32756g_eval_audio.c.

References AUDIO_ERROR, AUDIO_OK, AUDIO_TIMx_CLK_DISABLE, and haudio_in_i2s.

__weak void BSP_AUDIO_IN_TransferComplete_CallBack ( void )

User callback when record buffer is filled.

Return values:
None

Definition at line 992 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_RxCpltCallback().

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 282 of file stm32756g_eval_audio.c.

References haudio_out_sai.

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

Referenced by 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 475 of file stm32756g_eval_audio.c.

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

__weak void BSP_AUDIO_OUT_Error_CallBack ( void )

Manages the DMA FIFO error event.

Return values:
None

Definition at line 536 of file stm32756g_eval_audio.c.

Referenced by HAL_SAI_ErrorCallback().

__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 528 of file stm32756g_eval_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 208 of file stm32756g_eval_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIx, BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), haudio_out_sai, SAIx_DeInit(), and SAIx_Init().

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

Deinitializes SAI MSP.

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

Definition at line 629 of file stm32756g_eval_audio.c.

References AUDIO_SAIx, AUDIO_SAIx_CLK_DISABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_FS_GPIO_PORT, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_PIN, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_GPIO_PORT, and AUDIO_SAIx_SD_PIN.

Referenced by BSP_AUDIO_OUT_DeInit().

__weak 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 546 of file stm32756g_eval_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_SAIx, AUDIO_SAIx_CLK_ENABLE, AUDIO_SAIx_DMAx_CHANNEL, AUDIO_SAIx_DMAx_CLK_ENABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_DMAx_MEM_DATA_SIZE, AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE, AUDIO_SAIx_DMAx_STREAM, AUDIO_SAIx_FS_ENABLE, AUDIO_SAIx_FS_GPIO_PORT, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_FS_SD_MCLK_AF, AUDIO_SAIx_MCLK_ENABLE, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_PIN, AUDIO_SAIx_SCK_AF, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_ENABLE, AUDIO_SAIx_SCK_SD_GPIO_PORT, and AUDIO_SAIx_SD_PIN.

Referenced by 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 295 of file stm32756g_eval_audio.c.

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

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

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

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

Definition at line 260 of file stm32756g_eval_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 319 of file stm32756g_eval_audio.c.

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

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t AudioFrameSlot )

Updates the Audio frame slot configuration.

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

Definition at line 458 of file stm32756g_eval_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 435 of file stm32756g_eval_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 393 of file stm32756g_eval_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 414 of file stm32756g_eval_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 373 of file stm32756g_eval_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 345 of file stm32756g_eval_audio.c.

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

__weak void BSP_AUDIO_OUT_TransferComplete_CallBack ( void )

Manages the DMA full Transfer complete event.

Return values:
None

Definition at line 520 of file stm32756g_eval_audio.c.

Referenced by HAL_SAI_TxCpltCallback().

void HAL_I2S_ErrorCallback ( I2S_HandleTypeDef * hi2s )

I2S error callbacks.

Parameters:
hi2s,: I2S handle
Return values:
None

Definition at line 981 of file stm32756g_eval_audio.c.

References BSP_AUDIO_IN_Error_Callback().

void HAL_I2S_RxCpltCallback ( I2S_HandleTypeDef * hi2s )

Rx Transfer completed callbacks.

Parameters:
hi2s,: I2S handle
Return values:
None

Definition at line 958 of file stm32756g_eval_audio.c.

References BSP_AUDIO_IN_TransferComplete_CallBack().

void HAL_I2S_RxHalfCpltCallback ( I2S_HandleTypeDef * hi2s )

Rx Half Transfer completed callbacks.

Parameters:
hi2s,: I2S handle
Return values:
None

Definition at line 969 of file stm32756g_eval_audio.c.

References BSP_AUDIO_IN_HalfTransfer_CallBack().

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 511 of file stm32756g_eval_audio.c.

References BSP_AUDIO_OUT_Error_CallBack().

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 487 of file stm32756g_eval_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 499 of file stm32756g_eval_audio.c.

References BSP_AUDIO_OUT_HalfTransfer_CallBack().

static void I2Sx_DeInit ( void ) [static]

Deinitializes the Audio Codec audio interface (I2S).

Return values:
None

Definition at line 1216 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, and haudio_in_i2s.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_IN_Init().

static void I2Sx_Init ( uint32_t AudioFreq ) [static]

Initializes the Audio Codec audio interface (I2S)

Note:
This function assumes that the I2S input clock (through PLL_R in Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the I2S peripheral.
Return values:
None

Definition at line 1188 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, and haudio_in_i2s.

Referenced by BSP_AUDIO_IN_Init().

static void PDMDecoder_Init | ( | uint32_t | AudioFreq,
 |  | uint32_t | ChnlNbr
 | ) |  | [static]

Initializes the PDM library.

Parameters:
AudioFreq,: Audio sampling frequency
ChnlNbr,: Number of audio channels (1: mono; 2: stereo)
Return values:
None

Definition at line 1161 of file stm32756g_eval_audio.c.

References Filter.

Referenced by BSP_AUDIO_IN_Init().

static void SAIx_DeInit ( void ) [static]

Deinitializes the Audio Codec audio interface (SAI).

Return values:
None

Definition at line 780 of file stm32756g_eval_audio.c.

References AUDIO_SAIx, and haudio_out_sai.

Referenced by BSP_AUDIO_OUT_DeInit(), and BSP_AUDIO_OUT_Init().

static void SAIx_Init ( uint32_t AudioFreq ) [static]

Initializes the 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 726 of file stm32756g_eval_audio.c.

References AUDIO_SAIx, CODEC_AUDIOFRAME_SLOT_0123, and haudio_out_sai.

Referenced by BSP_AUDIO_OUT_Init().

static void TIMx_DeInit ( void ) [static]

Configure TIM as a clock divider by 2.

I2S_SCK is externally connected to TIMx input channel

Return values:
None

Definition at line 1354 of file stm32756g_eval_audio.c.

References AUDIO_TIMx, AUDIO_TIMx_IN_CHANNEL, AUDIO_TIMx_OUT_CHANNEL, haudio_tim, and TIMx_IC_MspDeInit().

Referenced by BSP_AUDIO_IN_DeInit().

static void TIMx_IC_MspDeInit ( TIM_HandleTypeDef * htim ) [static]

Initializes the TIM INput Capture MSP.

Parameters:
htim,: TIM handle
Return values:
None

Definition at line 1267 of file stm32756g_eval_audio.c.

References AUDIO_TIMx_CLK_DISABLE.

Referenced by TIMx_DeInit().

static void TIMx_IC_MspInit ( TIM_HandleTypeDef * htim ) [static]

Initializes the TIM INput Capture MSP.

Parameters:
htim,: TIM handle
Return values:
None

Definition at line 1234 of file stm32756g_eval_audio.c.

References AUDIO_TIMx_AF, AUDIO_TIMx_CLK_ENABLE, AUDIO_TIMx_GPIO_CLK_ENABLE, AUDIO_TIMx_GPIO_PORT, AUDIO_TIMx_IN_GPIO_PIN, and AUDIO_TIMx_OUT_GPIO_PIN.

Referenced by TIMx_Init().

static void TIMx_Init ( void ) [static]

Configure TIM as a clock divider by 2.

I2S_SCK is externally connected to TIMx input channel

Return values:
None

Definition at line 1281 of file stm32756g_eval_audio.c.

References AUDIO_TIMx, AUDIO_TIMx_IN_CHANNEL, AUDIO_TIMx_OUT_CHANNEL, haudio_tim, and TIMx_IC_MspInit().

Referenced by BSP_AUDIO_IN_MspInit().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Exported Types

STM32756G_EVAL_AUDIO Exported Types
STM32756G_EVAL AUDIO


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Exported Constants

Defines
STM32756G_EVAL_AUDIO Exported Constants
STM32756G_EVAL AUDIO

Defines

#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode TDM format : +------------------|------------------|--------------------|-------------------+ | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | +------------------------------------------------------------------------------+.
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_SAIx SAI2_Block_B
#define | AUDIO_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_SAIx_SCK_AF GPIO_AF8_SAI2
#define | AUDIO_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2
#define | AUDIO_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_MCLK_GPIO_PORT GPIOE
#define | AUDIO_SAIx_MCLK_PIN GPIO_PIN_6
#define | AUDIO_SAIx_SCK_SD_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | AUDIO_SAIx_SCK_SD_GPIO_PORT GPIOA
#define | AUDIO_SAIx_SCK_PIN GPIO_PIN_2
#define | AUDIO_SAIx_SD_PIN GPIO_PIN_0
#define | AUDIO_SAIx_FS_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_SAIx_FS_GPIO_PORT GPIOG
#define | AUDIO_SAIx_FS_PIN GPIO_PIN_9
#define | AUDIO_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_SAIx_DMAx_STREAM DMA2_Stream6
#define | AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_3
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Stream6_IRQn
#define | AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | DMA_MAX_SZE 0xFFFF
#define | AUDIO_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_I2Sx SPI3
#define | AUDIO_I2Sx_CLK_ENABLE() __HAL_RCC_SPI3_CLK_ENABLE()
#define | AUDIO_I2Sx_CLK_DISABLE() __HAL_RCC_SPI3_CLK_DISABLE()
#define | AUDIO_I2Sx_SCK_PIN GPIO_PIN_3
#define | AUDIO_I2Sx_SCK_GPIO_PORT GPIOB
#define | AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | AUDIO_I2Sx_SCK_AF GPIO_AF6_SPI3
#define | AUDIO_I2Sx_SD_PIN GPIO_PIN_6
#define | AUDIO_I2Sx_SD_GPIO_PORT GPIOD
#define | AUDIO_I2Sx_SD_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | AUDIO_I2Sx_SD_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | AUDIO_I2Sx_SD_AF GPIO_AF5_SPI3
#define | AUDIO_I2Sx_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | AUDIO_I2Sx_DMAx_CLK_DISABLE() __HAL_RCC_DMA1_CLK_DISABLE()
#define | AUDIO_I2Sx_DMAx_STREAM DMA1_Stream2
#define | AUDIO_I2Sx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_I2Sx_DMAx_IRQ DMA1_Stream2_IRQn
#define | AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_I2Sx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_I2Sx_DMAx_IRQHandler DMA1_Stream2_IRQHandler
#define | AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_TIMx_CLK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE()
#define | AUDIO_TIMx_CLK_DISABLE() __HAL_RCC_TIM3_CLK_DISABLE()
#define | AUDIO_TIMx TIM3
#define | AUDIO_TIMx_IN_CHANNEL TIM_CHANNEL_1
#define | AUDIO_TIMx_OUT_CHANNEL TIM_CHANNEL_2 /* Select channel 2 as output */
#define | AUDIO_TIMx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_TIMx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | AUDIO_TIMx_GPIO_PORT GPIOC
#define | AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_6
#define | AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_7
#define | AUDIO_TIMx_AF GPIO_AF2_TIM3
#define | AUDIODATA_SIZE 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 | INTERNAL_BUFF_SIZE (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
#define | PCM_OUT_SIZE (DEFAULT_AUDIO_IN_FREQ/1000*2)
#define | CHANNEL_DEMUX_MASK ((uint8_t)0x55)
#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 182 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_Record(), 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_I2Sx SPI3

Definition at line 127 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_MspDeInit(), BSP_AUDIO_IN_MspInit(), I2Sx_DeInit(), and I2Sx_Init().

#define AUDIO_I2Sx_CLK_DISABLE ( ) __HAL_RCC_SPI3_CLK_DISABLE()

Definition at line 129 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit().

#define AUDIO_I2Sx_CLK_ENABLE ( ) __HAL_RCC_SPI3_CLK_ENABLE()

Definition at line 128 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 146 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_CLK_DISABLE ( ) __HAL_RCC_DMA1_CLK_DISABLE()

Definition at line 144 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 143 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_IRQ DMA1_Stream2_IRQn

Definition at line 147 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_IRQHandler DMA1_Stream2_IRQHandler

Definition at line 151 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 149 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 148 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_STREAM DMA1_Stream2

Definition at line 145 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_AF GPIO_AF6_SPI3

Definition at line 134 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 133 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 132 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_GPIO_PORT GPIOB

Definition at line 131 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_PIN GPIO_PIN_3

Definition at line 130 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_AF GPIO_AF5_SPI3

Definition at line 140 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 139 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 138 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_GPIO_PORT GPIOD

Definition at line 137 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_PIN GPIO_PIN_6

Definition at line 136 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

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

Definition at line 154 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_OK ((uint8_t)0)

Definition at line 181 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_PDMToPCM(), 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 121 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx SAI2_Block_B

Definition at line 91 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_MspDeInit(), BSP_AUDIO_OUT_MspInit(), SAIx_DeInit(), and SAIx_Init().

#define AUDIO_SAIx_CLK_DISABLE ( ) __HAL_RCC_SAI2_CLK_DISABLE()

Definition at line 93 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit().

#define AUDIO_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI2_CLK_ENABLE()

Definition at line 92 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_3

Definition at line 112 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 110 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_IRQ DMA2_Stream6_IRQn

Definition at line 113 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 118 of file stm32756g_eval_audio.h.

#define AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 115 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 114 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_STREAM DMA2_Stream6

Definition at line 111 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 104 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_GPIO_PORT GPIOG

Definition at line 105 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_PIN GPIO_PIN_9

Definition at line 106 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2

Definition at line 95 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 97 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_GPIO_PORT GPIOE

Definition at line 98 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_PIN GPIO_PIN_6

Definition at line 99 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_AF GPIO_AF8_SAI2

Definition at line 94 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_PIN GPIO_PIN_2

Definition at line 102 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_SD_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 100 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_SD_GPIO_PORT GPIOA

Definition at line 101 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SD_PIN GPIO_PIN_0

Definition at line 103 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_TIMEOUT ((uint8_t)2)

Definition at line 183 of file stm32756g_eval_audio.h.

#define AUDIO_TIMx TIM3

Definition at line 164 of file stm32756g_eval_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_AF GPIO_AF2_TIM3

Definition at line 172 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_CLK_DISABLE ( ) __HAL_RCC_TIM3_CLK_DISABLE()

Definition at line 163 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_Stop(), and TIMx_IC_MspDeInit().

#define AUDIO_TIMx_CLK_ENABLE ( ) __HAL_RCC_TIM3_CLK_ENABLE()

Definition at line 162 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 168 of file stm32756g_eval_audio.h.

#define AUDIO_TIMx_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 167 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_GPIO_PORT GPIOC

Definition at line 169 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_IN_CHANNEL TIM_CHANNEL_1

Definition at line 165 of file stm32756g_eval_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_6

Definition at line 170 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_OUT_CHANNEL TIM_CHANNEL_2 /* Select channel 2 as output */

Definition at line 166 of file stm32756g_eval_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_7

Definition at line 171 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

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

Definition at line 178 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define CHANNEL_DEMUX_MASK ((uint8_t)0x55)

Definition at line 195 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

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

Definition at line 84 of file stm32756g_eval_audio.h.

Referenced by SAIx_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 86 of file stm32756g_eval_audio.h.

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 88 of file stm32756g_eval_audio.h.

#define CODEC_RESET_DELAY ((uint8_t)5)

Definition at line 202 of file stm32756g_eval_audio.h.

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)

Definition at line 187 of file stm32756g_eval_audio.h.

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

Definition at line 188 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define DEFAULT_AUDIO_IN_FREQ I2S_AUDIOFREQ_16K

Definition at line 186 of file stm32756g_eval_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)

Definition at line 189 of file stm32756g_eval_audio.h.

#define DMA_MAX_SZE 0xFFFF

Definition at line 116 of file stm32756g_eval_audio.h.

#define INTERNAL_BUFF_SIZE (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)

Definition at line 192 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE

Definition at line 209 of file stm32756g_eval_audio.h.

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

Definition at line 210 of file stm32756g_eval_audio.h.

#define PCM_OUT_SIZE (DEFAULT_AUDIO_IN_FREQ/1000*2)

Definition at line 194 of file stm32756g_eval_audio.h.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Exported Variables

Variables
STM32756G_EVAL_AUDIO Exported Variables
STM32756G_EVAL AUDIO

Variables

__IO uint16_t AudioInVolume

Variable Documentation

__IO uint16_t AudioInVolume

Definition at line 173 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and BSP_AUDIO_IN_SetVolume().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO Exported Macros

Defines
STM32756G_EVAL_AUDIO Exported Macros
STM32756G_EVAL 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 227 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_Play().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO_OUT Exported Functions

Functions
STM32756G_EVAL_AUDIO_OUT Exported Functions
STM32756G_EVAL 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.
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.
void | BSP_AUDIO_OUT_TransferComplete_CallBack (void)
Manages the DMA full Transfer complete event.
void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
void | BSP_AUDIO_OUT_Error_CallBack (void)
Manages the DMA FIFO error event.
void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.
void | BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_OUT MSP.
void | BSP_AUDIO_OUT_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
Deinitializes SAI MSP.

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 282 of file stm32756g_eval_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 674 of file stm32756g_eval_audio.c.

Referenced by 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 475 of file stm32756g_eval_audio.c.

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

void BSP_AUDIO_OUT_Error_CallBack ( void )

Manages the DMA FIFO error event.

Return values:
None

Definition at line 536 of file stm32756g_eval_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 528 of file stm32756g_eval_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 208 of file stm32756g_eval_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIx, BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), haudio_out_sai, SAIx_DeInit(), and SAIx_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 629 of file stm32756g_eval_audio.c.

References AUDIO_SAIx, AUDIO_SAIx_CLK_DISABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_FS_GPIO_PORT, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_PIN, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_GPIO_PORT, and AUDIO_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 546 of file stm32756g_eval_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_SAIx, AUDIO_SAIx_CLK_ENABLE, AUDIO_SAIx_DMAx_CHANNEL, AUDIO_SAIx_DMAx_CLK_ENABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_DMAx_MEM_DATA_SIZE, AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE, AUDIO_SAIx_DMAx_STREAM, AUDIO_SAIx_FS_ENABLE, AUDIO_SAIx_FS_GPIO_PORT, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_FS_SD_MCLK_AF, AUDIO_SAIx_MCLK_ENABLE, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_PIN, AUDIO_SAIx_SCK_AF, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_ENABLE, AUDIO_SAIx_SCK_SD_GPIO_PORT, and AUDIO_SAIx_SD_PIN.

Referenced by 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 295 of file stm32756g_eval_audio.c.

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

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

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

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

Definition at line 260 of file stm32756g_eval_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 319 of file stm32756g_eval_audio.c.

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

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t AudioFrameSlot )

Updates the Audio frame slot configuration.

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

Definition at line 458 of file stm32756g_eval_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 435 of file stm32756g_eval_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 393 of file stm32756g_eval_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 414 of file stm32756g_eval_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 373 of file stm32756g_eval_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 345 of file stm32756g_eval_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 520 of file stm32756g_eval_audio.c.

Referenced by HAL_SAI_TxCpltCallback().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL_AUDIO_IN Exported Functions

Functions
STM32756G_EVAL_AUDIO_IN Exported Functions
STM32756G_EVAL 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_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
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.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
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 (I2S_HandleTypeDef *hi2s, void *Params)
Initializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params)
Clock Config.

Function Documentation

void BSP_AUDIO_IN_ClockConfig | ( | I2S_HandleTypeDef * | hi2s,
 |  | uint32_t | AudioFreq,
 |  | void * | Params
 | ) |  |

Clock Config.

Parameters:
hi2s,: might be required to set audio peripheral predivider if any.
AudioFreq,: Audio frequency used to record the audio stream.
Params
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application
Return values:
None

Definition at line 1135 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 914 of file stm32756g_eval_audio.c.

References BSP_AUDIO_IN_MspDeInit(), haudio_in_i2s, I2Sx_DeInit(), and TIMx_DeInit().

void BSP_AUDIO_IN_Error_Callback ( void )

Audio IN Error callback function.

Return values:
None

Definition at line 1014 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_ErrorCallback().

void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1003 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_RxHalfCpltCallback().

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

Initializes wave recording.

Note:
This function assumes that the I2S input clock (through PLL_R in Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the I2S peripheral.
BitRes,: Audio frequency to be configured for the I2S peripheral.
ChnlNbr,: Audio frequency to be configured for the I2S peripheral.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 809 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_OK, BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_MspInit(), haudio_in_i2s, I2Sx_DeInit(), I2Sx_Init(), and PDMDecoder_Init().

void BSP_AUDIO_IN_MspDeInit | ( | I2S_HandleTypeDef * | hi2s,
 |  | void * | Params
 | ) |  |

DeInitializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params
Return values:
None

Definition at line 1095 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_I2Sx_CLK_DISABLE, AUDIO_I2Sx_DMAx_IRQ, AUDIO_I2Sx_SCK_GPIO_PORT, AUDIO_I2Sx_SCK_PIN, AUDIO_I2Sx_SD_GPIO_PORT, and AUDIO_I2Sx_SD_PIN.

Referenced by BSP_AUDIO_IN_DeInit().

void BSP_AUDIO_IN_MspInit | ( | I2S_HandleTypeDef * | hi2s,
 |  | void * | Params
 | ) |  |

Initializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params
Return values:
None

Definition at line 1026 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_I2Sx_CLK_ENABLE, AUDIO_I2Sx_DMAx_CHANNEL, AUDIO_I2Sx_DMAx_CLK_ENABLE, AUDIO_I2Sx_DMAx_IRQ, AUDIO_I2Sx_DMAx_MEM_DATA_SIZE, AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE, AUDIO_I2Sx_DMAx_STREAM, AUDIO_I2Sx_SCK_AF, AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE, AUDIO_I2Sx_SCK_GPIO_PORT, AUDIO_I2Sx_SCK_PIN, AUDIO_I2Sx_SD_AF, AUDIO_I2Sx_SD_GPIO_CLK_ENABLE, AUDIO_I2Sx_SD_GPIO_PORT, AUDIO_I2Sx_SD_PIN, AUDIO_IN_IRQ_PREPRIO, and TIMx_Init().

Referenced by BSP_AUDIO_IN_Init().

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 875 of file stm32756g_eval_audio.c.

References AUDIO_OK, and haudio_in_i2s.

uint8_t BSP_AUDIO_IN_PDMToPCM | ( | uint16_t * | PDMBuf,
 |  | uint16_t * | PCMBuf
 | ) |  |

Converts audio format from PDM to PCM.

Parameters:
PDMBuf,: Pointer to data PDM buffer
PCMBuf,: Pointer to data PCM buffer
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 928 of file stm32756g_eval_audio.c.

References AUDIO_OK, AudioInVolume, Channel_Demux, CHANNEL_DEMUX_MASK, DEFAULT_AUDIO_IN_CHANNEL_NBR, Filter, and INTERNAL_BUFF_SIZE.

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,: Current size of the recorded buffer
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 839 of file stm32756g_eval_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_i2s.

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 887 of file stm32756g_eval_audio.c.

References AUDIO_OK, and haudio_in_i2s.

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t Volume )

Controls the audio in volume level.

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

Definition at line 901 of file stm32756g_eval_audio.c.

References AUDIO_OK, and AudioInVolume.

uint8_t BSP_AUDIO_IN_Stop ( void )

Stops audio recording.

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 856 of file stm32756g_eval_audio.c.

References AUDIO_ERROR, AUDIO_OK, AUDIO_TIMx_CLK_DISABLE, and haudio_in_i2s.

void BSP_AUDIO_IN_TransferComplete_CallBack ( void )

User callback when record buffer is filled.

Return values:
None

Definition at line 992 of file stm32756g_eval_audio.c.

Referenced by HAL_I2S_RxCpltCallback().


STM32756G_EVAL BSP User Manual: CAMERA Private TypesDefinitions

CAMERA Private TypesDefinitions
STM32756G_EVAL CAMERA


STM32756G_EVAL BSP User Manual: CAMERA Private Defines

CAMERA Private Defines
STM32756G_EVAL CAMERA


STM32756G_EVAL BSP User Manual: CAMERA Private Macros

CAMERA Private Macros
STM32756G_EVAL CAMERA


STM32756G_EVAL BSP User Manual: CAMERA Private Variables

Variables
CAMERA Private Variables
STM32756G_EVAL CAMERA

Variables

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

Variable Documentation

CAMERA_DrvTypeDef* camera_drv

Definition at line 111 of file stm32756g_eval_camera.c.

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

uint32_t CameraCurrentResolution [static]

Definition at line 113 of file stm32756g_eval_camera.c.

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

uint32_t CameraHwAddress [static]

Definition at line 116 of file stm32756g_eval_camera.c.

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

DCMI_HandleTypeDef hDcmiEval

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


STM32756G_EVAL BSP User Manual: CAMERA Private Functions Prototypes

CAMERA Private Functions Prototypes
STM32756G_EVAL CAMERA


STM32756G_EVAL BSP User Manual: CAMERA Private Functions

Functions
CAMERA Private Functions
STM32756G_EVAL 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_HwReset (void)
CANERA hardware reset.
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 356 of file stm32756g_eval_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 374 of file stm32756g_eval_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 217 of file stm32756g_eval_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiEval.

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 338 of file stm32756g_eval_camera.c.

References camera_drv, and CameraHwAddress.

uint8_t BSP_CAMERA_DeInit ( void )

DeInitializes the camera.

Return values:
Camera status

Definition at line 203 of file stm32756g_eval_camera.c.

References BSP_CAMERA_MspDeInit(), CAMERA_OK, and hDcmiEval.

__weak void BSP_CAMERA_ErrorCallback ( void )

Error callback.

Return values:
None

Definition at line 623 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_ErrorCallback().

__weak void BSP_CAMERA_FrameEventCallback ( void )

Frame Event callback.

Return values:
None

Definition at line 602 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_FrameEventCallback().

void BSP_CAMERA_HwReset ( void )

CANERA hardware reset.

Return values:
None

Definition at line 278 of file stm32756g_eval_camera.c.

References BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, BSP_IO_PIN_SET, and BSP_IO_WritePin().

Referenced by BSP_CAMERA_Init().

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 140 of file stm32756g_eval_camera.c.

References BSP_CAMERA_HwReset(), BSP_CAMERA_MspInit(), BSP_IO_Init(), BSP_IO_PIN_SET, BSP_IO_ReadPin(), camera_drv, CAMERA_ERROR, CAMERA_I2C_ADDRESS, CAMERA_NOT_DETECTED, CAMERA_NOT_SUPPORTED, CAMERA_OK, CameraCurrentResolution, CameraHwAddress, and hDcmiEval.

__weak void BSP_CAMERA_LineEventCallback ( void )

Line Event callback.

Return values:
None

Definition at line 560 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_LineEventCallback().

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

DeInitializes the DCMI MSP.

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

Definition at line 528 of file stm32756g_eval_camera.c.

Referenced by BSP_CAMERA_DeInit().

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

Initializes the DCMI MSP.

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

Definition at line 429 of file stm32756g_eval_camera.c.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_PwrDown ( void )

CAMERA power down.

Return values:
None

Definition at line 307 of file stm32756g_eval_camera.c.

References BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, and BSP_IO_WritePin().

Referenced by BSP_CAMERA_Stop().

void BSP_CAMERA_Resume ( void )

Resume the CAMERA capture.

Return values:
None

Definition at line 249 of file stm32756g_eval_camera.c.

References hDcmiEval.

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 228 of file stm32756g_eval_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiEval.

uint8_t BSP_CAMERA_Stop ( void )

Stop the CAMERA capture.

Return values:
Camera status

Definition at line 259 of file stm32756g_eval_camera.c.

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

void BSP_CAMERA_Suspend ( void )

Suspend the CAMERA capture.

Return values:
None

Definition at line 239 of file stm32756g_eval_camera.c.

References hDcmiEval.

__weak void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 581 of file stm32756g_eval_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 387 of file stm32756g_eval_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 614 of file stm32756g_eval_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 593 of file stm32756g_eval_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 551 of file stm32756g_eval_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 572 of file stm32756g_eval_camera.c.

References BSP_CAMERA_VsyncEventCallback().


STM32756G_EVAL BSP User Manual: CAMERA Exported Types

Defines | Enumerations
CAMERA Exported Types
STM32756G_EVAL 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 81 of file stm32756g_eval_camera.h.

#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */

Definition at line 82 of file stm32756g_eval_camera.h.

#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */

Definition at line 83 of file stm32756g_eval_camera.h.

#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Definition at line 84 of file stm32756g_eval_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 71 of file stm32756g_eval_camera.h.


STM32756G_EVAL BSP User Manual: CAMERA Exported Constants

Defines
CAMERA Exported Constants
STM32756G_EVAL 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 93 of file stm32756g_eval_camera.h.

#define BSP_CAMERA_IRQHandler DCMI_IRQHandler

Definition at line 92 of file stm32756g_eval_camera.h.


STM32756G_EVAL BSP User Manual: CAMERA Exported Functions

Functions
CAMERA Exported Functions
STM32756G_EVAL 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_HwReset (void)
CANERA hardware reset.
void | BSP_CAMERA_PwrDown (void)
CAMERA power down.
void | BSP_CAMERA_LineEventCallback (void)
Line Event callback.
void | BSP_CAMERA_VsyncEventCallback (void)
VSYNC Event callback.
void | BSP_CAMERA_FrameEventCallback (void)
Frame Event callback.
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.
void | BSP_CAMERA_IRQHandler (void)
void | BSP_CAMERA_DMA_IRQHandler (void)
void | BSP_CAMERA_MspInit (DCMI_HandleTypeDef *hdcmi, void *Params)
Initializes the DCMI MSP.
void | BSP_CAMERA_MspDeInit (DCMI_HandleTypeDef *hdcmi, void *Params)
DeInitializes the DCMI MSP.

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 356 of file stm32756g_eval_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 374 of file stm32756g_eval_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 217 of file stm32756g_eval_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiEval.

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 338 of file stm32756g_eval_camera.c.

References camera_drv, and CameraHwAddress.

uint8_t BSP_CAMERA_DeInit ( void )

DeInitializes the camera.

Return values:
Camera status

Definition at line 203 of file stm32756g_eval_camera.c.

References BSP_CAMERA_MspDeInit(), CAMERA_OK, and hDcmiEval.

void BSP_CAMERA_DMA_IRQHandler ( void )
void BSP_CAMERA_ErrorCallback ( void )

Error callback.

Return values:
None

Definition at line 623 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_ErrorCallback().

void BSP_CAMERA_FrameEventCallback ( void )

Frame Event callback.

Return values:
None

Definition at line 602 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_FrameEventCallback().

void BSP_CAMERA_HwReset ( void )

CANERA hardware reset.

Return values:
None

Definition at line 278 of file stm32756g_eval_camera.c.

References BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, BSP_IO_PIN_SET, and BSP_IO_WritePin().

Referenced by BSP_CAMERA_Init().

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 140 of file stm32756g_eval_camera.c.

References BSP_CAMERA_HwReset(), BSP_CAMERA_MspInit(), BSP_IO_Init(), BSP_IO_PIN_SET, BSP_IO_ReadPin(), camera_drv, CAMERA_ERROR, CAMERA_I2C_ADDRESS, CAMERA_NOT_DETECTED, CAMERA_NOT_SUPPORTED, CAMERA_OK, CameraCurrentResolution, CameraHwAddress, and hDcmiEval.

void BSP_CAMERA_IRQHandler ( void )
void BSP_CAMERA_LineEventCallback ( void )

Line Event callback.

Return values:
None

Definition at line 560 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_LineEventCallback().

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

DeInitializes the DCMI MSP.

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

Definition at line 528 of file stm32756g_eval_camera.c.

Referenced by BSP_CAMERA_DeInit().

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

Initializes the DCMI MSP.

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

Definition at line 429 of file stm32756g_eval_camera.c.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_PwrDown ( void )

CAMERA power down.

Return values:
None

Definition at line 307 of file stm32756g_eval_camera.c.

References BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, and BSP_IO_WritePin().

Referenced by BSP_CAMERA_Stop().

void BSP_CAMERA_Resume ( void )

Resume the CAMERA capture.

Return values:
None

Definition at line 249 of file stm32756g_eval_camera.c.

References hDcmiEval.

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 228 of file stm32756g_eval_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiEval.

uint8_t BSP_CAMERA_Stop ( void )

Stop the CAMERA capture.

Return values:
Camera status

Definition at line 259 of file stm32756g_eval_camera.c.

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

void BSP_CAMERA_Suspend ( void )

Suspend the CAMERA capture.

Return values:
None

Definition at line 239 of file stm32756g_eval_camera.c.

References hDcmiEval.

void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 581 of file stm32756g_eval_camera.c.

Referenced by HAL_DCMI_VsyncEventCallback().


STM32756G_EVAL BSP User Manual: EEPROM Private Types

EEPROM Private Types
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Private Defines

EEPROM Private Defines
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Private Macros

EEPROM Private Macros
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Private Variables

Variables
EEPROM Private Variables
STM32756G_EVAL 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 stm32756g_eval_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 stm32756g_eval_eeprom.c.

Referenced by BSP_EEPROM_ReadBuffer().

__IO uint8_t EEPROMDataWrite

Definition at line 133 of file stm32756g_eval_eeprom.c.

Referenced by BSP_EEPROM_WritePage().


STM32756G_EVAL BSP User Manual: EEPROM Private Functions Prototypes

EEPROM Private Functions Prototypes
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Private Functions

Functions
EEPROM Private Functions
STM32756G_EVAL 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.

Function Documentation

uint8_t BSP_EEPROM_DeInit ( void )

DeInitializes the EEPROM.

Return values:
EEPROM state

Definition at line 180 of file stm32756g_eval_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 157 of file stm32756g_eval_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 201 of file stm32756g_eval_eeprom.c.

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

__weak void BSP_EEPROM_TIMEOUT_UserCallback ( void )

Basic management of the timeout situation.

Return values:
None

Definition at line 456 of file stm32756g_eval_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 440 of file stm32756g_eval_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 283 of file stm32756g_eval_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 248 of file stm32756g_eval_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().


STM32756G_EVAL BSP User Manual: EEPROM Exported Types

EEPROM Exported Types
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Exported Constants

Defines
EEPROM Exported Constants
STM32756G_EVAL 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 stm32756g_eval_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 stm32756g_eval_eeprom.h.

#define EEPROM_MAX_TRIALS ((uint32_t)3000)

Definition at line 77 of file stm32756g_eval_eeprom.h.

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

#define EEPROM_OK ((uint32_t)0)

Definition at line 79 of file stm32756g_eval_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 stm32756g_eval_eeprom.h.

Referenced by BSP_EEPROM_WriteBuffer().

#define EEPROM_TIMEOUT ((uint32_t)2)

Definition at line 81 of file stm32756g_eval_eeprom.h.

Referenced by BSP_EEPROM_WaitEepromStandbyState().


STM32756G_EVAL BSP User Manual: EEPROM Exported Macros

EEPROM Exported Macros
STM32756G_EVAL EEPROM


STM32756G_EVAL BSP User Manual: EEPROM Exported Functions

Functions
EEPROM Exported Functions
STM32756G_EVAL 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.
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 180 of file stm32756g_eval_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 157 of file stm32756g_eval_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 201 of file stm32756g_eval_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 456 of file stm32756g_eval_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 440 of file stm32756g_eval_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 283 of file stm32756g_eval_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 248 of file stm32756g_eval_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 1346 of file stm32756g_eval.c.

References 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 1384 of file stm32756g_eval.c.

References 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 1372 of file stm32756g_eval.c.

References 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 1359 of file stm32756g_eval.c.

References I2Cx_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().


STM32756G_EVAL BSP User Manual: IO Private Types Definitions

IO Private Types Definitions
STM32756G_EVAL IO


STM32756G_EVAL BSP User Manual: IO Private Defines

IO Private Defines
STM32756G_EVAL IO


STM32756G_EVAL BSP User Manual: IO Private Macros

IO Private Macros
STM32756G_EVAL IO


STM32756G_EVAL BSP User Manual: IO Private Variables

Variables
IO Private Variables
STM32756G_EVAL IO

Variables

static IO_DrvTypeDef * | IoDrv = NULL
static uint8_t | mfxstm32l152Identifier

Variable Documentation

IO_DrvTypeDef* IoDrv = NULL [static]

Definition at line 113 of file stm32756g_eval_io.c.

Referenced by BSP_IO_ConfigPin(), BSP_IO_DeInit(), BSP_IO_Init(), BSP_IO_ITClear(), BSP_IO_ITGetStatus(), BSP_IO_ReadPin(), BSP_IO_TogglePin(), and BSP_IO_WritePin().

uint8_t mfxstm32l152Identifier [static]

Definition at line 114 of file stm32756g_eval_io.c.

Referenced by BSP_IO_ConfigIrqOutPin(), and BSP_IO_Init().


STM32756G_EVAL BSP User Manual: IO Private Functions Prototypes

IO Private Functions Prototypes
STM32756G_EVAL IO


STM32756G_EVAL BSP User Manual: IO Private Functions

Functions
IO Private Functions
STM32756G_EVAL IO

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).
uint8_t | BSP_IO_DeInit (void)
DeInit allows Mfx Initialization to be executed again.
uint32_t | BSP_IO_ITGetStatus (uint32_t IoPin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (void)
Clears all the IO IT pending bits.
uint8_t | BSP_IO_ConfigPin (uint32_t IoPin, IO_ModeTypedef IoMode)
Configures the IO pin(s) according to IO mode structure value.
uint8_t | BSP_IO_ConfigIrqOutPin (uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
Sets the IRQ_OUT pin polarity and type.
void | BSP_IO_WritePin (uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IoPin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IoPin)
Toggles the selected pins state.

Function Documentation

uint8_t BSP_IO_ConfigIrqOutPin | ( | uint8_t | IoIrqOutPinPolarity,
 |  | uint8_t | IoIrqOutPinType
 | ) |  |

Sets the IRQ_OUT pin polarity and type.

Parameters:
IoIrqOutPinPolarity,: High/Low
IoIrqOutPinType,: OpenDrain/PushPull
Return values:
OK

Definition at line 253 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, IO_OK, and mfxstm32l152Identifier.

uint8_t BSP_IO_ConfigPin | ( | uint32_t | IoPin,
 |  | IO_ModeTypedef | IoMode
 | ) |  |

Configures the IO pin(s) according to IO mode structure value.

Parameters:
IoPin,: IO pin(s) to be configured. This parameter can be one of the following values:
  • MFXSTM32L152_GPIO_PIN_x: where x can be from 0 to 23.
IoMode,: IO pin mode to configure This parameter can be one of the following values:
  • IO_MODE_INPUT
  • IO_MODE_OUTPUT
  • IO_MODE_IT_RISING_EDGE
  • IO_MODE_IT_FALLING_EDGE
  • IO_MODE_IT_LOW_LEVEL
  • IO_MODE_IT_HIGH_LEVEL
  • IO_MODE_ANALOG
  • IO_MODE_OFF
  • IO_MODE_INPUT_PU,
  • IO_MODE_INPUT_PD,
  • IO_MODE_OUTPUT_OD,
  • IO_MODE_OUTPUT_OD_PU,
  • IO_MODE_OUTPUT_OD_PD,
  • IO_MODE_OUTPUT_PP,
  • IO_MODE_OUTPUT_PP_PU,
  • IO_MODE_OUTPUT_PP_PD,
  • IO_MODE_IT_RISING_EDGE_PU
  • IO_MODE_IT_FALLING_EDGE_PU
  • IO_MODE_IT_LOW_LEVEL_PU
  • IO_MODE_IT_HIGH_LEVEL_PU
  • IO_MODE_IT_RISING_EDGE_PD
  • IO_MODE_IT_FALLING_EDGE_PD
  • IO_MODE_IT_LOW_LEVEL_PD
  • IO_MODE_IT_HIGH_LEVEL_PD
Return values:
IO_OK if all initializations are OK. Other value if error.

Definition at line 239 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, IO_OK, and IoDrv.

Referenced by BSP_CAMERA_HwReset(), BSP_CAMERA_PwrDown(), BSP_LED_DeInit(), BSP_LED_Init(), BSP_SD_DeInit(), BSP_SD_Init(), BSP_SD_IsDetected(), BSP_SD_MspInit(), and BSP_TS_ITConfig().

uint8_t BSP_IO_DeInit ( void )

DeInit allows Mfx Initialization to be executed again.

Note:
BSP_IO_Init() has no effect if the IoDrv is already initialized BSP_IO_DeInit() allows to erase the pointer such to allow init to be effective
Return values:
IO_OK

Definition at line 178 of file stm32756g_eval_io.c.

References IO_OK, and IoDrv.

uint8_t BSP_IO_Init ( void )

Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).

Note:
BSP_IO_Init() is using HAL_Delay() function to ensure that MFXSTM32L152 IO Expander is correctly reset. HAL_Delay() function provides accurate delay (in milliseconds) based on variable incremented in SysTick ISR. This implies that if BSP_IO_Init() is called from a peripheral ISR process, then the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
Return values:
IO_OK if all initializations are OK. Other value if error.

Definition at line 142 of file stm32756g_eval_io.c.

References IO_ERROR, IO_I2C_ADDRESS, IO_OK, IO_PIN_ALL, IoDrv, and mfxstm32l152Identifier.

Referenced by BSP_CAMERA_Init(), BSP_LED_Init(), BSP_SD_Init(), and BSP_TS_ITConfig().

void BSP_IO_ITClear ( void )

Clears all the IO IT pending bits.

Return values:
None

Definition at line 200 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_TS_ITClear().

uint32_t BSP_IO_ITGetStatus ( uint32_t IoPin )

Gets the selected pins IT status.

Parameters:
IoPin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
IO_OK if read status OK. Other value if error.

Definition at line 190 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

uint32_t BSP_IO_ReadPin ( uint32_t IoPin )

Gets the selected pins current state.

Parameters:
IoPin,: Selected pins to read. This parameter can be any combination of the IO pins.
Return values:
The current pins state

Definition at line 284 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_CAMERA_Init(), and BSP_SD_IsDetected().

void BSP_IO_TogglePin ( uint32_t IoPin )

Toggles the selected pins state.

Parameters:
IoPin,: Selected pins to toggle. This parameter can be any combination of the IO pins.
Note:
This function is only used to toggle one pin in the same time
Return values:
None

Definition at line 296 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_LED_Toggle().

void BSP_IO_WritePin | ( | uint32_t | IoPin,
 |  | BSP_IO_PinStateTypeDef | PinState
 | ) |  |

Sets the selected pins state.

Parameters:
IoPin,: Selected pins to write. This parameter can be any combination of the IO pins.
PinState,: New pins state to write
Return values:
None

Definition at line 272 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_CAMERA_HwReset(), BSP_CAMERA_PwrDown(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and BSP_SD_MspInit().


STM32756G_EVAL BSP User Manual: IO Exported Types

Enumerations
IO Exported Types
STM32756G_EVAL IO

Enumerations

enum | BSP_IO_PinStateTypeDef { BSP_IO_PIN_RESET = 0, BSP_IO_PIN_SET = 1 }
enum | IO_StatusTypeDef { IO_OK = 0, IO_ERROR = 1, IO_TIMEOUT = 2 }

Enumeration Type Documentation

enum BSP_IO_PinStateTypeDef
Enumerator:
BSP_IO_PIN_RESET
BSP_IO_PIN_SET

Definition at line 66 of file stm32756g_eval_io.h.

enum IO_StatusTypeDef
Enumerator:
IO_OK
IO_ERROR
IO_TIMEOUT

Definition at line 72 of file stm32756g_eval_io.h.


STM32756G_EVAL BSP User Manual: IO Exported Constants

Defines
IO Exported Constants
STM32756G_EVAL IO

Defines

#define | IO_PIN_0 ((uint32_t)0x0001)
#define | IO_PIN_1 ((uint32_t)0x0002)
#define | IO_PIN_2 ((uint32_t)0x0004)
#define | IO_PIN_3 ((uint32_t)0x0008)
#define | IO_PIN_4 ((uint32_t)0x0010)
#define | IO_PIN_5 ((uint32_t)0x0020)
#define | IO_PIN_6 ((uint32_t)0x0040)
#define | IO_PIN_7 ((uint32_t)0x0080)
#define | IO_PIN_8 ((uint32_t)0x0100)
#define | IO_PIN_9 ((uint32_t)0x0200)
#define | IO_PIN_10 ((uint32_t)0x0400)
#define | IO_PIN_11 ((uint32_t)0x0800)
#define | IO_PIN_12 ((uint32_t)0x1000)
#define | IO_PIN_13 ((uint32_t)0x2000)
#define | IO_PIN_14 ((uint32_t)0x4000)
#define | IO_PIN_15 ((uint32_t)0x8000)
#define | IO_PIN_16 ((uint32_t)0x010000)
#define | IO_PIN_17 ((uint32_t)0x020000)
#define | IO_PIN_18 ((uint32_t)0x040000)
#define | IO_PIN_19 ((uint32_t)0x080000)
#define | IO_PIN_20 ((uint32_t)0x100000)
#define | IO_PIN_21 ((uint32_t)0x200000)
#define | IO_PIN_22 ((uint32_t)0x400000)
#define | IO_PIN_23 ((uint32_t)0x800000)
#define | IO_PIN_ALL ((uint32_t)0xFFFFFF)

Define Documentation

#define IO_PIN_0 ((uint32_t)0x0001)

Definition at line 85 of file stm32756g_eval_io.h.

#define IO_PIN_1 ((uint32_t)0x0002)

Definition at line 86 of file stm32756g_eval_io.h.

#define IO_PIN_10 ((uint32_t)0x0400)

Definition at line 95 of file stm32756g_eval_io.h.

#define IO_PIN_11 ((uint32_t)0x0800)

Definition at line 96 of file stm32756g_eval_io.h.

#define IO_PIN_12 ((uint32_t)0x1000)

Definition at line 97 of file stm32756g_eval_io.h.

#define IO_PIN_13 ((uint32_t)0x2000)

Definition at line 98 of file stm32756g_eval_io.h.

#define IO_PIN_14 ((uint32_t)0x4000)

Definition at line 99 of file stm32756g_eval_io.h.

#define IO_PIN_15 ((uint32_t)0x8000)

Definition at line 100 of file stm32756g_eval_io.h.

#define IO_PIN_16 ((uint32_t)0x010000)

Definition at line 101 of file stm32756g_eval_io.h.

#define IO_PIN_17 ((uint32_t)0x020000)

Definition at line 102 of file stm32756g_eval_io.h.

#define IO_PIN_18 ((uint32_t)0x040000)

Definition at line 103 of file stm32756g_eval_io.h.

#define IO_PIN_19 ((uint32_t)0x080000)

Definition at line 104 of file stm32756g_eval_io.h.

#define IO_PIN_2 ((uint32_t)0x0004)

Definition at line 87 of file stm32756g_eval_io.h.

#define IO_PIN_20 ((uint32_t)0x100000)

Definition at line 105 of file stm32756g_eval_io.h.

#define IO_PIN_21 ((uint32_t)0x200000)

Definition at line 106 of file stm32756g_eval_io.h.

#define IO_PIN_22 ((uint32_t)0x400000)

Definition at line 107 of file stm32756g_eval_io.h.

#define IO_PIN_23 ((uint32_t)0x800000)

Definition at line 108 of file stm32756g_eval_io.h.

#define IO_PIN_3 ((uint32_t)0x0008)

Definition at line 88 of file stm32756g_eval_io.h.

#define IO_PIN_4 ((uint32_t)0x0010)

Definition at line 89 of file stm32756g_eval_io.h.

#define IO_PIN_5 ((uint32_t)0x0020)

Definition at line 90 of file stm32756g_eval_io.h.

#define IO_PIN_6 ((uint32_t)0x0040)

Definition at line 91 of file stm32756g_eval_io.h.

#define IO_PIN_7 ((uint32_t)0x0080)

Definition at line 92 of file stm32756g_eval_io.h.

#define IO_PIN_8 ((uint32_t)0x0100)

Definition at line 93 of file stm32756g_eval_io.h.

#define IO_PIN_9 ((uint32_t)0x0200)

Definition at line 94 of file stm32756g_eval_io.h.

#define IO_PIN_ALL ((uint32_t)0xFFFFFF)

Definition at line 109 of file stm32756g_eval_io.h.

Referenced by BSP_IO_Init().


STM32756G_EVAL BSP User Manual: IO Exported Macro

IO Exported Macro
STM32756G_EVAL IO


STM32756G_EVAL BSP User Manual: IO Exported Functions

Functions
IO Exported Functions
STM32756G_EVAL IO

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).
uint8_t | BSP_IO_DeInit (void)
DeInit allows Mfx Initialization to be executed again.
uint8_t | BSP_IO_ConfigIrqOutPin (uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
Sets the IRQ_OUT pin polarity and type.
uint32_t | BSP_IO_ITGetStatus (uint32_t IoPin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (void)
Clears all the IO IT pending bits.
uint8_t | BSP_IO_ConfigPin (uint32_t IoPin, IO_ModeTypedef IoMode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IoPin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IoPin)
Toggles the selected pins state.

Function Documentation

uint8_t BSP_IO_ConfigIrqOutPin | ( | uint8_t | IoIrqOutPinPolarity,
 |  | uint8_t | IoIrqOutPinType
 | ) |  |

Sets the IRQ_OUT pin polarity and type.

Parameters:
IoIrqOutPinPolarity,: High/Low
IoIrqOutPinType,: OpenDrain/PushPull
Return values:
OK

Definition at line 253 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, IO_OK, and mfxstm32l152Identifier.

uint8_t BSP_IO_ConfigPin | ( | uint32_t | IoPin,
 |  | IO_ModeTypedef | IoMode
 | ) |  |

Configures the IO pin(s) according to IO mode structure value.

Parameters:
IoPin,: IO pin(s) to be configured. This parameter can be one of the following values:
  • MFXSTM32L152_GPIO_PIN_x: where x can be from 0 to 23.
IoMode,: IO pin mode to configure This parameter can be one of the following values:
  • IO_MODE_INPUT
  • IO_MODE_OUTPUT
  • IO_MODE_IT_RISING_EDGE
  • IO_MODE_IT_FALLING_EDGE
  • IO_MODE_IT_LOW_LEVEL
  • IO_MODE_IT_HIGH_LEVEL
  • IO_MODE_ANALOG
  • IO_MODE_OFF
  • IO_MODE_INPUT_PU,
  • IO_MODE_INPUT_PD,
  • IO_MODE_OUTPUT_OD,
  • IO_MODE_OUTPUT_OD_PU,
  • IO_MODE_OUTPUT_OD_PD,
  • IO_MODE_OUTPUT_PP,
  • IO_MODE_OUTPUT_PP_PU,
  • IO_MODE_OUTPUT_PP_PD,
  • IO_MODE_IT_RISING_EDGE_PU
  • IO_MODE_IT_FALLING_EDGE_PU
  • IO_MODE_IT_LOW_LEVEL_PU
  • IO_MODE_IT_HIGH_LEVEL_PU
  • IO_MODE_IT_RISING_EDGE_PD
  • IO_MODE_IT_FALLING_EDGE_PD
  • IO_MODE_IT_LOW_LEVEL_PD
  • IO_MODE_IT_HIGH_LEVEL_PD
Return values:
IO_OK if all initializations are OK. Other value if error.

Definition at line 239 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, IO_OK, and IoDrv.

Referenced by BSP_CAMERA_HwReset(), BSP_CAMERA_PwrDown(), BSP_LED_DeInit(), BSP_LED_Init(), BSP_SD_DeInit(), BSP_SD_Init(), BSP_SD_IsDetected(), BSP_SD_MspInit(), and BSP_TS_ITConfig().

uint8_t BSP_IO_DeInit ( void )

DeInit allows Mfx Initialization to be executed again.

Note:
BSP_IO_Init() has no effect if the IoDrv is already initialized BSP_IO_DeInit() allows to erase the pointer such to allow init to be effective
Return values:
IO_OK

Definition at line 178 of file stm32756g_eval_io.c.

References IO_OK, and IoDrv.

uint8_t BSP_IO_Init ( void )

Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).

Note:
BSP_IO_Init() is using HAL_Delay() function to ensure that MFXSTM32L152 IO Expander is correctly reset. HAL_Delay() function provides accurate delay (in milliseconds) based on variable incremented in SysTick ISR. This implies that if BSP_IO_Init() is called from a peripheral ISR process, then the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
Return values:
IO_OK if all initializations are OK. Other value if error.

Definition at line 142 of file stm32756g_eval_io.c.

References IO_ERROR, IO_I2C_ADDRESS, IO_OK, IO_PIN_ALL, IoDrv, and mfxstm32l152Identifier.

Referenced by BSP_CAMERA_Init(), BSP_LED_Init(), BSP_SD_Init(), and BSP_TS_ITConfig().

void BSP_IO_ITClear ( void )

Clears all the IO IT pending bits.

Return values:
None

Definition at line 200 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_TS_ITClear().

uint32_t BSP_IO_ITGetStatus ( uint32_t IoPin )

Gets the selected pins IT status.

Parameters:
IoPin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
IO_OK if read status OK. Other value if error.

Definition at line 190 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

uint32_t BSP_IO_ReadPin ( uint32_t IoPin )

Gets the selected pins current state.

Parameters:
IoPin,: Selected pins to read. This parameter can be any combination of the IO pins.
Return values:
The current pins state

Definition at line 284 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_CAMERA_Init(), and BSP_SD_IsDetected().

void BSP_IO_TogglePin ( uint32_t IoPin )

Toggles the selected pins state.

Parameters:
IoPin,: Selected pins to toggle. This parameter can be any combination of the IO pins.
Note:
This function is only used to toggle one pin in the same time
Return values:
None

Definition at line 296 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_LED_Toggle().

void BSP_IO_WritePin | ( | uint32_t | IoPin,
 |  | BSP_IO_PinStateTypeDef | PinState
 | ) |  |

Sets the selected pins state.

Parameters:
IoPin,: Selected pins to write. This parameter can be any combination of the IO pins.
PinState,: New pins state to write
Return values:
None

Definition at line 272 of file stm32756g_eval_io.c.

References IO_I2C_ADDRESS, and IoDrv.

Referenced by BSP_CAMERA_HwReset(), BSP_CAMERA_PwrDown(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and BSP_SD_MspInit().


STM32756G_EVAL BSP User Manual: LCD Private TypesDefinitions

LCD Private TypesDefinitions
STM32756G_EVAL LCD


STM32756G_EVAL BSP User Manual: LCD Private Defines

Defines
LCD Private Defines
STM32756G_EVAL 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 124 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_FillPolygon().

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

Definition at line 125 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_FillPolygon().


STM32756G_EVAL BSP User Manual: LCD Private Macros

Defines
LCD Private Macros
STM32756G_EVAL LCD

Defines

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

Define Documentation

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

Definition at line 133 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_DrawLine(), and FillTriangle().


STM32756G_EVAL BSP User Manual: LCD Private Variables

Variables
LCD Private Variables
STM32756G_EVAL LCD

Variables

LTDC_HandleTypeDef | hLtdcEval
static DMA2D_HandleTypeDef | hDma2dEval
static uint32_t | PCLK_profile = LCD_MAX_PCLK
static uint32_t | ActiveLayer = 0
static LCD_DrawPropTypeDef | DrawProp [MAX_LAYER_NUMBER]

Variable Documentation

uint32_t ActiveLayer = 0 [static]

Definition at line 145 of file stm32756g_eval_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(), and DrawChar().

LCD_DrawPropTypeDef DrawProp[MAX_LAYER_NUMBER] [static]

Definition at line 146 of file stm32756g_eval_lcd.c.

DMA2D_HandleTypeDef hDma2dEval [static]

Definition at line 142 of file stm32756g_eval_lcd.c.

Referenced by LL_ConvertLineToARGB8888(), and LL_FillBuffer().

LTDC_HandleTypeDef hLtdcEval

Definition at line 141 of file stm32756g_eval_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_InitEx(), BSP_LCD_LayerDefaultInit(), BSP_LCD_ReadPixel(), BSP_LCD_Relaod(), 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(), and BSP_LCD_SetYSize().

uint32_t PCLK_profile = LCD_MAX_PCLK [static]

Definition at line 143 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_InitEx().


STM32756G_EVAL BSP User Manual: LCD Private FunctionPrototypes

LCD Private FunctionPrototypes
STM32756G_EVAL LCD


STM32756G_EVAL BSP User Manual: LCD Private Functions

Functions
LCD Private Functions
STM32756G_EVAL LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t PclkConfig)
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 layers.
void | BSP_LCD_SelectLayer (uint32_t LayerIndex)
Selects the LCD Layer.
void | BSP_LCD_SetLayerVisible (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
void | BSP_LCD_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_Relaod (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 (32 bpp).
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 644 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), hLtdcEval, 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 655 of file stm32756g_eval_lcd.c.

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

__weak 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 1353 of file stm32756g_eval_lcd.c.

References LCD_MAX_PCLK, and TS_I2C_ADDRESS.

Referenced by BSP_LCD_InitEx().

uint8_t BSP_LCD_DeInit ( void )

DeInitializes the LCD.

Return values:
LCD state

Definition at line 261 of file stm32756g_eval_lcd.c.

References BSP_LCD_MspDeInit(), hLtdcEval, 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 675 of file stm32756g_eval_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 1255 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Return values:
None

Definition at line 1245 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 693 of file stm32756g_eval_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 754 of file stm32756g_eval_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

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

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

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 1017 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 896 of file stm32756g_eval_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 971 of file stm32756g_eval_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 766 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 803 of file stm32756g_eval_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 1004 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcEval.

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 943 of file stm32756g_eval_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 878 of file stm32756g_eval_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 784 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 1099 of file stm32756g_eval_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 1215 of file stm32756g_eval_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 1147 of file stm32756g_eval_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 1078 of file stm32756g_eval_lcd.c.

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

Referenced by BSP_LCD_ClearStringLine().

uint32_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Return values:
Used background color

Definition at line 579 of file stm32756g_eval_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 598 of file stm32756g_eval_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 560 of file stm32756g_eval_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 282 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

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

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Return values:
Used LCD Y size

Definition at line 291 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

Referenced by BSP_LCD_Clear(), and BSP_LCD_LayerDefaultInit().

uint8_t BSP_LCD_Init ( void )

Initializes the LCD.

Return values:
LCD state

Definition at line 170 of file stm32756g_eval_lcd.c.

References BSP_LCD_InitEx(), and LCD_MAX_PCLK.

uint8_t BSP_LCD_InitEx ( uint32_t PclkConfig )

Initializes the LCD.

Parameters:
PclkConfig : pixel clock profile
Return values:
LCD state

Definition at line 180 of file stm32756g_eval_lcd.c.

References BSP_LCD_ClockConfig(), BSP_LCD_MspInit(), BSP_LCD_SetFont(), BSP_SDRAM_Init(), hLtdcEval, LCD_DEFAULT_FONT, LCD_OK, PCLK_profile, and TS_I2C_ADDRESS.

Referenced by BSP_LCD_Init().

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

Initializes the LCD layers.

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

Definition at line 322 of file stm32756g_eval_lcd.c.

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

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

DeInitializes BSP_LCD MSP.

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

Definition at line 1316 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_DeInit().

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

Initializes the LTDC MSP.

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

Definition at line 1267 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_InitEx().

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

Reads an LCD pixel.

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

Definition at line 609 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcEval.

void BSP_LCD_Relaod ( 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 541 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_ResetColorKeying ( uint32_t LayerIndex )

Disables the color keying.

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

Definition at line 517 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 528 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_SelectLayer ( uint32_t LayerIndex )

Selects the LCD Layer.

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

Definition at line 355 of file stm32756g_eval_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 570 of file stm32756g_eval_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 492 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 505 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

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

Definition at line 589 of file stm32756g_eval_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_InitEx().

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

Sets an LCD layer frame buffer address.

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

Definition at line 434 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 445 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 369 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 391 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 459 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 477 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 551 of file stm32756g_eval_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 411 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 423 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 301 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

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 311 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

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 1416 of file stm32756g_eval_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 1475 of file stm32756g_eval_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 1584 of file stm32756g_eval_lcd.c.

References hDma2dEval.

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 1553 of file stm32756g_eval_lcd.c.

References hDma2dEval.

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


STM32756G_EVAL BSP User Manual: LCD Exported Types

Data Structures | Typedefs | Enumerations
LCD Exported Types
STM32756G_EVAL 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 92 of file stm32756g_eval_lcd.h.


STM32756G_EVAL BSP User Manual: LCD_DrawPropTypeDef Struct Reference

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

#include <stm32756g_eval_lcd.h>

Data Fields

uint32_t | TextColor
uint32_t | BackColor
sFONT * | pFont

Detailed Description

Definition at line 76 of file stm32756g_eval_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Definition at line 79 of file stm32756g_eval_lcd.h.

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

sFONT* LCD_DrawPropTypeDef::pFont

Definition at line 80 of file stm32756g_eval_lcd.h.

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

uint32_t LCD_DrawPropTypeDef::TextColor

Definition at line 78 of file stm32756g_eval_lcd.h.

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

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


STM32756G_EVAL BSP User Manual: Point Struct Reference

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

#include <stm32756g_eval_lcd.h>

Data Fields

int16_t | X
int16_t | Y

Detailed Description

Definition at line 83 of file stm32756g_eval_lcd.h.

Field Documentation

int16_t Point::X

Definition at line 85 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

Definition at line 86 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

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


STM32756G_EVAL BSP User Manual: LCD Exported Constants

Defines
LCD Exported Constants
STM32756G_EVAL 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_MAX_PCLK ((uint8_t)0x00)
LCD Layer_Number.
#define | LCD_MIN_PCLK ((uint8_t)0x01)
#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 Documentation

#define LCD_COLOR_BLACK ((uint32_t)0xFF000000)

Definition at line 161 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)

LCD color.

Definition at line 139 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)

Definition at line 162 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)

Definition at line 142 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)

Definition at line 151 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)

Definition at line 154 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)

Definition at line 160 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)

Definition at line 152 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)

Definition at line 155 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKRED ((uint32_t)0xFF800000)

Definition at line 153 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)

Definition at line 156 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_GRAY ((uint32_t)0xFF808080)

Definition at line 159 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)

Definition at line 140 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)

Definition at line 145 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)

Definition at line 148 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)

Definition at line 158 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)

Definition at line 146 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)

Definition at line 149 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)

Definition at line 147 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)

Definition at line 150 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)

Definition at line 143 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)

Definition at line 163 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_RED ((uint32_t)0xFFFF0000)

Definition at line 141 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)

Definition at line 164 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)

Definition at line 157 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)

Definition at line 144 of file stm32756g_eval_lcd.h.

#define LCD_DEFAULT_FONT Font24

LCD default font.

Definition at line 169 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_ERROR ((uint8_t)0x01)

Definition at line 115 of file stm32756g_eval_lcd.h.

#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)

LCD FB_StartAddress.

Definition at line 121 of file stm32756g_eval_lcd.h.

#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef

Definition at line 108 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_MAX_PCLK ((uint8_t)0x00)

LCD Layer_Number.

Definition at line 132 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_ClockConfig(), and BSP_LCD_Init().

#define LCD_MIN_PCLK ((uint8_t)0x01)

Definition at line 133 of file stm32756g_eval_lcd.h.

#define LCD_OK ((uint8_t)0x00)

LCD status structure definition.

Definition at line 114 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_DeInit(), and BSP_LCD_InitEx().

#define LCD_RELOAD_IMMEDIATE ((uint32_t)LTDC_SRCR_IMR)

LCD Reload Types.

Definition at line 174 of file stm32756g_eval_lcd.h.

#define LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)

Definition at line 175 of file stm32756g_eval_lcd.h.

#define LCD_TIMEOUT ((uint8_t)0x02)

Definition at line 116 of file stm32756g_eval_lcd.h.

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

Definition at line 110 of file stm32756g_eval_lcd.h.

#define MAX_LAYER_NUMBER ((uint32_t)2)

Definition at line 106 of file stm32756g_eval_lcd.h.


STM32756G_EVAL BSP User Manual: LCD Exported Functions

Functions
LCD Exported Functions
STM32756G_EVAL LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t PclkConfig)
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 FrameBuffer)
Initializes the LCD layers.
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_Relaod (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 pixel)
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 (32 bpp).
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.
void | BSP_LCD_MspInit (LTDC_HandleTypeDef *hltdc, void *Params)
Initializes the LTDC MSP.
void | BSP_LCD_MspDeInit (LTDC_HandleTypeDef *hltdc, void *Params)
DeInitializes BSP_LCD MSP.
void | BSP_LCD_ClockConfig (LTDC_HandleTypeDef *hltdc, void *Params)
Clock Config.

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 644 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), hLtdcEval, 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 655 of file stm32756g_eval_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 1353 of file stm32756g_eval_lcd.c.

References LCD_MAX_PCLK, and TS_I2C_ADDRESS.

Referenced by BSP_LCD_InitEx().

uint8_t BSP_LCD_DeInit ( void )

DeInitializes the LCD.

Return values:
LCD state

Definition at line 261 of file stm32756g_eval_lcd.c.

References BSP_LCD_MspDeInit(), hLtdcEval, 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 675 of file stm32756g_eval_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 1255 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Return values:
None

Definition at line 1245 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 693 of file stm32756g_eval_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 754 of file stm32756g_eval_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

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

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

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 1017 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 896 of file stm32756g_eval_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 971 of file stm32756g_eval_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 766 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 803 of file stm32756g_eval_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 1004 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcEval.

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 943 of file stm32756g_eval_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 878 of file stm32756g_eval_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 784 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), hLtdcEval, 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 1099 of file stm32756g_eval_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 1215 of file stm32756g_eval_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 1147 of file stm32756g_eval_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 1078 of file stm32756g_eval_lcd.c.

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

Referenced by BSP_LCD_ClearStringLine().

uint32_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Return values:
Used background color

Definition at line 579 of file stm32756g_eval_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 598 of file stm32756g_eval_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 560 of file stm32756g_eval_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 282 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

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

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Return values:
Used LCD Y size

Definition at line 291 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

Referenced by BSP_LCD_Clear(), and BSP_LCD_LayerDefaultInit().

uint8_t BSP_LCD_Init ( void )

Initializes the LCD.

Return values:
LCD state

Definition at line 170 of file stm32756g_eval_lcd.c.

References BSP_LCD_InitEx(), and LCD_MAX_PCLK.

uint8_t BSP_LCD_InitEx ( uint32_t PclkConfig )

Initializes the LCD.

Parameters:
PclkConfig : pixel clock profile
Return values:
LCD state

Definition at line 180 of file stm32756g_eval_lcd.c.

References BSP_LCD_ClockConfig(), BSP_LCD_MspInit(), BSP_LCD_SetFont(), BSP_SDRAM_Init(), hLtdcEval, LCD_DEFAULT_FONT, LCD_OK, PCLK_profile, and TS_I2C_ADDRESS.

Referenced by BSP_LCD_Init().

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

Initializes the LCD layers.

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

Definition at line 322 of file stm32756g_eval_lcd.c.

References LCD_DrawPropTypeDef::BackColor, BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), hLtdcEval, 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 1316 of file stm32756g_eval_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 1267 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_InitEx().

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

Reads an LCD pixel.

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

Definition at line 609 of file stm32756g_eval_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hLtdcEval.

void BSP_LCD_Relaod ( 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 541 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_ResetColorKeying ( uint32_t LayerIndex )

Disables the color keying.

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

Definition at line 517 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 528 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_SelectLayer ( uint32_t LayerIndex )

Selects the LCD Layer.

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

Definition at line 355 of file stm32756g_eval_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 570 of file stm32756g_eval_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 492 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 505 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

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

Definition at line 589 of file stm32756g_eval_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_InitEx().

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

Sets an LCD layer frame buffer address.

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

Definition at line 434 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 445 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 369 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 391 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 459 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 477 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 551 of file stm32756g_eval_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 411 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 423 of file stm32756g_eval_lcd.c.

References hLtdcEval.

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 301 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.

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 311 of file stm32756g_eval_lcd.c.

References ActiveLayer, and hLtdcEval.


STM32756G_EVAL BSP User Manual: NOR Private Types Definitions

NOR Private Types Definitions
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Private Defines

NOR Private Defines
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Private Macros

NOR Private Macros
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Private Variables

Variables
NOR Private Variables
STM32756G_EVAL NOR

Variables

static NOR_HandleTypeDef | norHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Variable Documentation

NOR_HandleTypeDef norHandle [static]

Definition at line 118 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_DeInit(), BSP_NOR_Erase_Block(), BSP_NOR_Erase_Chip(), BSP_NOR_Init(), BSP_NOR_ProgramData(), BSP_NOR_Read_ID(), BSP_NOR_ReadData(), BSP_NOR_ReturnToReadMode(), and BSP_NOR_WriteData().

FMC_NORSRAM_TimingTypeDef Timing [static]

Definition at line 119 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_Init().


STM32756G_EVAL BSP User Manual: NOR Private Functions Prototypes

NOR Private Functions Prototypes
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Private Functions

Functions
NOR Private Functions
STM32756G_EVAL NOR

Functions

uint8_t | BSP_NOR_Init (void)
Initializes the NOR device.
uint8_t | BSP_NOR_DeInit (void)
DeInitializes the NOR device.
uint8_t | BSP_NOR_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the NOR device.
void | BSP_NOR_ReturnToReadMode (void)
Returns the NOR memory to read mode.
uint8_t | BSP_NOR_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data to the NOR device.
uint8_t | BSP_NOR_ProgramData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Programs an amount of data to the NOR device.
uint8_t | BSP_NOR_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the NOR device.
uint8_t | BSP_NOR_Erase_Chip (void)
Erases the entire NOR chip.
uint8_t | BSP_NOR_Read_ID (NOR_IDTypeDef *pNOR_ID)
Reads NOR flash IDs.
__weak void | BSP_NOR_MspInit (NOR_HandleTypeDef *hnor, void *Params)
Initializes the NOR MSP.
__weak void | BSP_NOR_MspDeInit (NOR_HandleTypeDef *hnor, void *Params)
DeInitializes NOR MSP.
void | HAL_NOR_MspWait (NOR_HandleTypeDef *hnor, uint32_t Timeout)
NOR BSP Wait for Ready/Busy signal.

Function Documentation

uint8_t BSP_NOR_DeInit ( void )

DeInitializes the NOR device.

Return values:
NOR status

Definition at line 192 of file stm32756g_eval_nor.c.

References BSP_NOR_MspDeInit(), NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Erase_Block ( uint32_t BlockAddress )

Erases the specified block of the NOR device.

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

Definition at line 301 of file stm32756g_eval_nor.c.

References BLOCKERASE_TIMEOUT, NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Erase_Chip ( void )

Erases the entire NOR chip.

Return values:
NOR memory status

Definition at line 321 of file stm32756g_eval_nor.c.

References CHIPERASE_TIMEOUT, NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Init ( void )

Initializes the NOR device.

Return values:
NOR memory status

Definition at line 143 of file stm32756g_eval_nor.c.

References BSP_NOR_MspInit(), CONTINUOUSCLOCK_FEATURE, NOR_BURSTACCESS, NOR_MEMORY_WIDTH, NOR_STATUS_ERROR, NOR_STATUS_OK, NOR_WRITEBURST, norHandle, and Timing.

__weak void BSP_NOR_MspDeInit | ( | NOR_HandleTypeDef * | hnor,
 |  | void * | Params
 | ) |  |

DeInitializes NOR MSP.

Parameters:
hnor,: NOR handle
Params
Return values:
None

Definition at line 408 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_DeInit().

__weak void BSP_NOR_MspInit | ( | NOR_HandleTypeDef * | hnor,
 |  | void * | Params
 | ) |  |

Initializes the NOR MSP.

Parameters:
hnor,: NOR handle
Params
Return values:
None

Definition at line 360 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_Init().

uint8_t BSP_NOR_ProgramData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Programs an amount of data to the NOR device.

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

Definition at line 280 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, norHandle, and PROGRAM_TIMEOUT.

uint8_t BSP_NOR_Read_ID ( NOR_IDTypeDef * pNOR_ID )

Reads NOR flash IDs.

Parameters:
pNOR_ID : Pointer to NOR ID structure
Return values:
NOR memory status

Definition at line 342 of file stm32756g_eval_nor.c.

References NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_ReadData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the NOR device.

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

Definition at line 221 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

void BSP_NOR_ReturnToReadMode ( void )

Returns the NOR memory to read mode.

Return values:
None

Definition at line 237 of file stm32756g_eval_nor.c.

References norHandle.

uint8_t BSP_NOR_WriteData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data to the NOR device.

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

Definition at line 249 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, norHandle, and PROGRAM_TIMEOUT.

void HAL_NOR_MspWait | ( | NOR_HandleTypeDef * | hnor,
 |  | uint32_t | Timeout
 | ) |  |

NOR BSP Wait for Ready/Busy signal.

Parameters:
hnor,: Pointer to NOR handle
Timeout,: Timeout duration
Return values:
None

Definition at line 420 of file stm32756g_eval_nor.c.

References NOR_BUSY_STATE, NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN, and NOR_READY_STATE.


STM32756G_EVAL BSP User Manual: NOR Exported Types

NOR Exported Types
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Exported Constants

Defines
NOR Exported Constants
STM32756G_EVAL NOR

Defines

#define | NOR_DEVICE_ADDR ((uint32_t)0x60000000)
#define | NOR_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | NOR_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | NOR_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY
#define | BLOCKERASE_TIMEOUT ((uint32_t)0x00A00000) /* NOR block erase timeout */
#define | CHIPERASE_TIMEOUT ((uint32_t)0x30000000) /* NOR chip erase timeout */
#define | PROGRAM_TIMEOUT ((uint32_t)0x00004400) /* NOR program timeout */
#define | NOR_READY_BUSY_PIN GPIO_PIN_6
#define | NOR_READY_BUSY_GPIO GPIOD
#define | NOR_READY_STATE GPIO_PIN_SET
#define | NOR_BUSY_STATE GPIO_PIN_RESET

Define Documentation

#define BLOCKERASE_TIMEOUT ((uint32_t)0x00A00000) /* NOR block erase timeout */

Definition at line 91 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Erase_Block().

#define CHIPERASE_TIMEOUT ((uint32_t)0x30000000) /* NOR chip erase timeout */

Definition at line 92 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Erase_Chip().

#define CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY

Definition at line 87 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init(), and BSP_SRAM_Init().

#define NOR_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE

Definition at line 81 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

#define NOR_BUSY_STATE GPIO_PIN_RESET

Definition at line 99 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_DEVICE_ADDR ((uint32_t)0x60000000)

Definition at line 76 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Erase_Block(), BSP_NOR_Erase_Chip(), BSP_NOR_ProgramData(), BSP_NOR_ReadData(), and BSP_NOR_WriteData().

#define NOR_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16

Definition at line 79 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

#define NOR_READY_BUSY_GPIO GPIOD

Definition at line 97 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_READY_BUSY_PIN GPIO_PIN_6

Definition at line 96 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_READY_STATE GPIO_PIN_SET

Definition at line 98 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_WRITEBURST FMC_WRITE_BURST_DISABLE

Definition at line 84 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

#define PROGRAM_TIMEOUT ((uint32_t)0x00004400) /* NOR program timeout */

Definition at line 93 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_ProgramData(), and BSP_NOR_WriteData().


STM32756G_EVAL BSP User Manual: NOR Exported Macro

NOR Exported Macro
STM32756G_EVAL NOR


STM32756G_EVAL BSP User Manual: NOR Exported Functions

Functions
NOR Exported Functions
STM32756G_EVAL NOR

Functions

uint8_t | BSP_NOR_Init (void)
Initializes the NOR device.
uint8_t | BSP_NOR_DeInit (void)
DeInitializes the NOR device.
uint8_t | BSP_NOR_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the NOR device.
uint8_t | BSP_NOR_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data to the NOR device.
uint8_t | BSP_NOR_ProgramData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Programs an amount of data to the NOR device.
uint8_t | BSP_NOR_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the NOR device.
uint8_t | BSP_NOR_Erase_Chip (void)
Erases the entire NOR chip.
uint8_t | BSP_NOR_Read_ID (NOR_IDTypeDef *pNOR_ID)
Reads NOR flash IDs.
void | BSP_NOR_ReturnToReadMode (void)
Returns the NOR memory to read mode.
void | BSP_NOR_MspInit (NOR_HandleTypeDef *hnor, void *Params)
Initializes the NOR MSP.
void | BSP_NOR_MspDeInit (NOR_HandleTypeDef *hnor, void *Params)
DeInitializes NOR MSP.

Function Documentation

uint8_t BSP_NOR_DeInit ( void )

DeInitializes the NOR device.

Return values:
NOR status

Definition at line 192 of file stm32756g_eval_nor.c.

References BSP_NOR_MspDeInit(), NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Erase_Block ( uint32_t BlockAddress )

Erases the specified block of the NOR device.

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

Definition at line 301 of file stm32756g_eval_nor.c.

References BLOCKERASE_TIMEOUT, NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Erase_Chip ( void )

Erases the entire NOR chip.

Return values:
NOR memory status

Definition at line 321 of file stm32756g_eval_nor.c.

References CHIPERASE_TIMEOUT, NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_Init ( void )

Initializes the NOR device.

Return values:
NOR memory status

Definition at line 143 of file stm32756g_eval_nor.c.

References BSP_NOR_MspInit(), CONTINUOUSCLOCK_FEATURE, NOR_BURSTACCESS, NOR_MEMORY_WIDTH, NOR_STATUS_ERROR, NOR_STATUS_OK, NOR_WRITEBURST, norHandle, and Timing.

void BSP_NOR_MspDeInit | ( | NOR_HandleTypeDef * | hnor,
 |  | void * | Params
 | ) |  |

DeInitializes NOR MSP.

Parameters:
hnor,: NOR handle
Params
Return values:
None

Definition at line 408 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_DeInit().

void BSP_NOR_MspInit | ( | NOR_HandleTypeDef * | hnor,
 |  | void * | Params
 | ) |  |

Initializes the NOR MSP.

Parameters:
hnor,: NOR handle
Params
Return values:
None

Definition at line 360 of file stm32756g_eval_nor.c.

Referenced by BSP_NOR_Init().

uint8_t BSP_NOR_ProgramData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Programs an amount of data to the NOR device.

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

Definition at line 280 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, norHandle, and PROGRAM_TIMEOUT.

uint8_t BSP_NOR_Read_ID ( NOR_IDTypeDef * pNOR_ID )

Reads NOR flash IDs.

Parameters:
pNOR_ID : Pointer to NOR ID structure
Return values:
NOR memory status

Definition at line 342 of file stm32756g_eval_nor.c.

References NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

uint8_t BSP_NOR_ReadData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the NOR device.

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

Definition at line 221 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, and norHandle.

void BSP_NOR_ReturnToReadMode ( void )

Returns the NOR memory to read mode.

Return values:
None

Definition at line 237 of file stm32756g_eval_nor.c.

References norHandle.

uint8_t BSP_NOR_WriteData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data to the NOR device.

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

Definition at line 249 of file stm32756g_eval_nor.c.

References NOR_DEVICE_ADDR, NOR_STATUS_ERROR, NOR_STATUS_OK, norHandle, and PROGRAM_TIMEOUT.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL NOR

Modules | Defines
STM32756G_EVAL NOR
EVAL

Modules

NOR Private Types Definitions
NOR Private Defines
NOR Private Macros
NOR Private Variables
NOR Private Functions Prototypes
NOR Private Functions
NOR Exported Types
NOR Exported Constants
NOR Exported Macro
NOR Exported Functions

Defines

#define | NOR_STATUS_OK ((uint8_t)0x00)
NOR status structure definition.
#define | NOR_STATUS_ERROR ((uint8_t)0x01)

Define Documentation

#define NOR_STATUS_ERROR ((uint8_t)0x01)

Definition at line 71 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_DeInit(), BSP_NOR_Erase_Block(), BSP_NOR_Erase_Chip(), BSP_NOR_Init(), BSP_NOR_ProgramData(), BSP_NOR_Read_ID(), BSP_NOR_ReadData(), and BSP_NOR_WriteData().

#define NOR_STATUS_OK ((uint8_t)0x00)

NOR status structure definition.

Definition at line 70 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_DeInit(), BSP_NOR_Erase_Block(), BSP_NOR_Erase_Chip(), BSP_NOR_Init(), BSP_NOR_ProgramData(), BSP_NOR_Read_ID(), BSP_NOR_ReadData(), and BSP_NOR_WriteData().


STM32756G_EVAL BSP User Manual: Private Variables

Variables
Private Variables
STM32756G-EVAL QSPI

Variables

QSPI_HandleTypeDef QSPIHandle

Variable Documentation

QSPI_HandleTypeDef QSPIHandle

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


STM32756G_EVAL BSP User Manual: Private Functions

Functions
Private Functions
STM32756G-EVAL QSPI

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_EnterFourBytesAddress (QSPI_HandleTypeDef *hqspi)
This function set the QSPI memory in 4-byte address mode.
static uint8_t | QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
This function configure the dummy cycles on memory side.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
__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 584 of file stm32756g_eval_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 518 of file stm32756g_eval_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 800 of file stm32756g_eval_qspi.c.

References QSPI_ERROR, and QSPI_OK.

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

static uint8_t QSPI_DummyCyclesCfg ( QSPI_HandleTypeDef * hqspi ) [static]

This function configure the dummy cycles on memory side.

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 695 of file stm32756g_eval_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_EnterFourBytesAddress ( QSPI_HandleTypeDef * hqspi ) [static]

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

Parameters:
hqspi,: QSPI handle
Return values:
None

Definition at line 654 of file stm32756g_eval_qspi.c.

References QSPI_AutoPollingMemReady(), 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 612 of file stm32756g_eval_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 754 of file stm32756g_eval_qspi.c.

References QSPI_ERROR, and QSPI_OK.

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


STM32756G_EVAL BSP User Manual: Exported Functions

Functions
Exported Functions
STM32756G-EVAL 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 179 of file stm32756g_eval_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 473 of file stm32756g_eval_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 322 of file stm32756g_eval_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 364 of file stm32756g_eval_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 457 of file stm32756g_eval_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 404 of file stm32756g_eval_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 125 of file stm32756g_eval_qspi.c.

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

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

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

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

Definition at line 584 of file stm32756g_eval_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 518 of file stm32756g_eval_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 202 of file stm32756g_eval_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 248 of file stm32756g_eval_qspi.c.

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


STM32756G_EVAL BSP User Manual: Exported Constants

Defines
Exported Constants
STM32756G-EVAL 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_GPIOF_CLK_ENABLE()
#define | QSPI_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_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_8
#define | QSPI_D0_GPIO_PORT GPIOF
#define | QSPI_D1_PIN GPIO_PIN_9
#define | QSPI_D1_GPIO_PORT GPIOF
#define | QSPI_D2_PIN GPIO_PIN_7
#define | QSPI_D2_GPIO_PORT GPIOF
#define | QSPI_D3_PIN GPIO_PIN_6
#define | QSPI_D3_GPIO_PORT GPIOF
#define | QSPI_FLASH_SIZE 25 /* 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 stm32756g_eval_qspi.h.

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 69 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_GetStatus().

#define QSPI_CLK_DISABLE ( ) __HAL_RCC_QSPI_CLK_DISABLE()

Definition at line 76 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_CLK_ENABLE ( ) __HAL_RCC_QSPI_CLK_ENABLE()

Definition at line 75 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 78 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_PORT GPIOB

Definition at line 91 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CLK_PIN GPIO_PIN_2

Definition at line 90 of file stm32756g_eval_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 stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_PORT GPIOB

Definition at line 89 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CS_PIN GPIO_PIN_6

Definition at line 88 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D0_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 79 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D0_GPIO_PORT GPIOF

Definition at line 93 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D0_PIN GPIO_PIN_8

Definition at line 92 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 80 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D1_GPIO_PORT GPIOF

Definition at line 95 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D1_PIN GPIO_PIN_9

Definition at line 94 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 81 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D2_GPIO_PORT GPIOF

Definition at line 97 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D2_PIN GPIO_PIN_7

Definition at line 96 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 82 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D3_GPIO_PORT GPIOF

Definition at line 99 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D3_PIN GPIO_PIN_6

Definition at line 98 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_ERROR ((uint8_t)0x01)

Definition at line 68 of file stm32756g_eval_qspi.h.

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

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

Definition at line 103 of file stm32756g_eval_qspi.h.

#define QSPI_FORCE_RESET ( ) __HAL_RCC_QSPI_FORCE_RESET()

Definition at line 84 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)

Definition at line 70 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

Definition at line 67 of file stm32756g_eval_qspi.h.

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

#define QSPI_PAGE_SIZE 256

Definition at line 104 of file stm32756g_eval_qspi.h.

#define QSPI_RELEASE_RESET ( ) __HAL_RCC_QSPI_RELEASE_RESET()

Definition at line 85 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_SUSPENDED ((uint8_t)0x08)

Definition at line 71 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_GetStatus().


STM32756G_EVAL BSP User Manual: QSPI_Info Struct Reference

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

#include <stm32756g_eval_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 stm32756g_eval_qspi.h.

Field Documentation

uint32_t QSPI_Info::EraseSectorSize

Size of sectors for the erase operation

Definition at line 119 of file stm32756g_eval_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 stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::FlashSize

Size of the flash

Definition at line 118 of file stm32756g_eval_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 stm32756g_eval_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 stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_GetInfo().

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


STM32756G_EVAL BSP User Manual: SD Private TypesDefinitions

SD Private TypesDefinitions
STM32756G_EVAL SD


STM32756G_EVAL BSP User Manual: SD Private Defines

SD Private Defines
STM32756G_EVAL SD


STM32756G_EVAL BSP User Manual: SD Private Macros

SD Private Macros
STM32756G_EVAL SD


STM32756G_EVAL BSP User Manual: SD Private Variables

Variables
SD Private Variables
STM32756G_EVAL SD

Variables

SD_HandleTypeDef | uSdHandle
static uint8_t | UseExtiModeDetection = 0

Variable Documentation

SD_HandleTypeDef uSdHandle

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

uint8_t UseExtiModeDetection = 0 [static]

Definition at line 129 of file stm32756g_eval_sd.c.

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


STM32756G_EVAL BSP User Manual: SD Private Functions Prototypes

SD Private Functions Prototypes
STM32756G_EVAL SD


STM32756G_EVAL BSP User Manual: SD Private Functions

Functions
SD Private Functions
STM32756G_EVAL 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_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

__weak void BSP_SD_AbortCallback ( void )

BSP SD Abort callbacks.

Return values:
None

Definition at line 573 of file stm32756g_eval_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 204 of file stm32756g_eval_sd.c.

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

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 354 of file stm32756g_eval_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 533 of file stm32756g_eval_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 522 of file stm32756g_eval_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 150 of file stm32756g_eval_sd.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), 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 245 of file stm32756g_eval_sd.c.

References BSP_IO_ConfigPin(), BSP_IO_ReadPin(), SD_NOT_PRESENT, SD_PRESENT, and UseExtiModeDetection.

Referenced by BSP_SD_Init(), and BSP_SD_ITConfig().

uint8_t BSP_SD_ITConfig ( void )

Configures Interrupt mode for SD detection pin.

Return values:
Returns 0

Definition at line 231 of file stm32756g_eval_sd.c.

References BSP_SD_IsDetected(), and UseExtiModeDetection.

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

DeInitializes the SD MSP.

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

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

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

Initializes the SD MSP.

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

Definition at line 372 of file stm32756g_eval_sd.c.

References __DMAx_TxRx_CLK_ENABLE, BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, BSP_IO_WritePin(), 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 276 of file stm32756g_eval_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 315 of file stm32756g_eval_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

__weak void BSP_SD_ReadCpltCallback ( void )

BSP Rx Transfer completed callbacks.

Return values:
None

Definition at line 591 of file stm32756g_eval_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 296 of file stm32756g_eval_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 335 of file stm32756g_eval_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

__weak void BSP_SD_WriteCpltCallback ( void )

BSP Tx Transfer completed callbacks.

Return values:
None

Definition at line 582 of file stm32756g_eval_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 544 of file stm32756g_eval_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 564 of file stm32756g_eval_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 554 of file stm32756g_eval_sd.c.

References BSP_SD_WriteCpltCallback().


STM32756G_EVAL BSP User Manual: SD Exported Types

Defines
SD Exported Types
STM32756G_EVAL 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 68 of file stm32756g_eval_sd.h.


STM32756G_EVAL BSP User Manual: SD Exported Constants

Defines
SD Exported Constants
STM32756G_EVAL 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(GPIO_PIN_8)

Define Documentation

#define __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 95 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspInit().

#define BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 104 of file stm32756g_eval_sd.h.

#define BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 103 of file stm32756g_eval_sd.h.

#define BSP_SDMMC_IRQHandler SDMMC1_IRQHandler

Definition at line 102 of file stm32756g_eval_sd.h.

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 92 of file stm32756g_eval_sd.h.

#define SD_DetectIRQHandler ( ) HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)

Definition at line 105 of file stm32756g_eval_sd.h.

#define SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4

Definition at line 97 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn

Definition at line 101 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Rx_STREAM DMA2_Stream3

Definition at line 99 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4

Definition at line 96 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn

Definition at line 100 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_STREAM DMA2_Stream6

Definition at line 98 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_NOT_PRESENT ((uint8_t)0x00)

Definition at line 90 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 89 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_Init(), and BSP_SD_IsDetected().


STM32756G_EVAL BSP User Manual: SD Exported Macro

SD Exported Macro
STM32756G_EVAL SD


STM32756G_EVAL BSP User Manual: SD Exported Functions

Functions
SD Exported Functions
STM32756G_EVAL 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.
void | BSP_SD_DetectIT (void)
void | BSP_SD_DetectCallback (void)
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
void | BSP_SD_AbortCallback (void)
BSP SD Abort callbacks.
void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callbacks.
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 573 of file stm32756g_eval_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 204 of file stm32756g_eval_sd.c.

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

void BSP_SD_DetectCallback ( void )
void BSP_SD_DetectIT ( void )
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 354 of file stm32756g_eval_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( BSP_SD_CardInfo * CardInfo )
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 522 of file stm32756g_eval_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 150 of file stm32756g_eval_sd.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), 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 245 of file stm32756g_eval_sd.c.

References BSP_IO_ConfigPin(), BSP_IO_ReadPin(), SD_NOT_PRESENT, SD_PRESENT, and UseExtiModeDetection.

Referenced by BSP_SD_Init(), and BSP_SD_ITConfig().

uint8_t BSP_SD_ITConfig ( void )

Configures Interrupt mode for SD detection pin.

Return values:
Returns 0

Definition at line 231 of file stm32756g_eval_sd.c.

References BSP_SD_IsDetected(), and UseExtiModeDetection.

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

DeInitializes the SD MSP.

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

Definition at line 485 of file stm32756g_eval_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 372 of file stm32756g_eval_sd.c.

References __DMAx_TxRx_CLK_ENABLE, BSP_IO_ConfigPin(), BSP_IO_PIN_RESET, BSP_IO_WritePin(), 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 276 of file stm32756g_eval_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 315 of file stm32756g_eval_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 591 of file stm32756g_eval_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 296 of file stm32756g_eval_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 335 of file stm32756g_eval_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 582 of file stm32756g_eval_sd.c.

Referenced by HAL_SD_TxCpltCallback().


STM32756G_EVAL BSP User Manual: STM32756G_EVAL SD

Modules | Defines
STM32756G_EVAL SD
EVAL

Modules

SD Private TypesDefinitions
SD Private Defines
SD Private Macros
SD Private Variables
SD Private Functions Prototypes
SD Private Functions
SD Exported Types
SD Exported Constants
SD Exported Macro
SD Exported Functions

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 77 of file stm32756g_eval_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 78 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

Definition at line 76 of file stm32756g_eval_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 SD_TRANSFER_BUSY ((uint8_t)0x01)

Definition at line 84 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK ((uint8_t)0x00)

SD transfer state definition.

Definition at line 83 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_GetCardState().


STM32756G_EVAL BSP User Manual: SDRAM Private Types Definitions

SDRAM Private Types Definitions
STM32756G_EVAL SDRAM


STM32756G_EVAL BSP User Manual: SDRAM Private Defines

SDRAM Private Defines
STM32756G_EVAL SDRAM


STM32756G_EVAL BSP User Manual: SDRAM Private Macros

SDRAM Private Macros
STM32756G_EVAL SDRAM


STM32756G_EVAL BSP User Manual: SDRAM Private Variables

Variables
SDRAM Private Variables
STM32756G_EVAL 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 125 of file stm32756g_eval_sdram.c.

Referenced by BSP_SDRAM_Initialization_sequence().

SDRAM_HandleTypeDef sdramHandle

Definition at line 123 of file stm32756g_eval_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 124 of file stm32756g_eval_sdram.c.

Referenced by BSP_SDRAM_Init().


STM32756G_EVAL BSP User Manual: SDRAM Private Functions Prototypes

SDRAM Private Functions Prototypes
STM32756G_EVAL SDRAM


STM32756G_EVAL BSP User Manual: SDRAM Private Functions

Functions
SDRAM Private Functions
STM32756G_EVAL 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 194 of file stm32756g_eval_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 145 of file stm32756g_eval_sdram.c.

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

Referenced by BSP_LCD_InitEx().

void BSP_SDRAM_Initialization_sequence ( uint32_t RefreshCount )

Programs the SDRAM device.

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

Definition at line 220 of file stm32756g_eval_sdram.c.

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

Referenced by BSP_SDRAM_Init().

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

DeInitializes SDRAM MSP.

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

Definition at line 473 of file stm32756g_eval_sdram.c.

References SDRAM_DMAx_IRQn, and SDRAM_DMAx_STREAM.

Referenced by BSP_SDRAM_DeInit().

__weak 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 stm32756g_eval_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 282 of file stm32756g_eval_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 301 of file stm32756g_eval_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 356 of file stm32756g_eval_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 320 of file stm32756g_eval_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 339 of file stm32756g_eval_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.


STM32756G_EVAL BSP User Manual: SDRAM Exported Constants

Defines
SDRAM Exported Constants
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_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
#define | SDRAM_TIMEOUT ((uint32_t)0xFFFF)
#define | __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 89 of file stm32756g_eval_sdram.h.

#define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 88 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler

Definition at line 93 of file stm32756g_eval_sdram.h.

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

Definition at line 83 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2

Definition at line 80 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)

Definition at line 73 of file stm32756g_eval_sdram.h.

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

Definition at line 74 of file stm32756g_eval_sdram.h.

#define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 90 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn

Definition at line 92 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_DMAx_STREAM DMA2_Stream0

Definition at line 91 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32

Definition at line 78 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)

Definition at line 85 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence(), and BSP_SDRAM_Sendcmd().


STM32756G_EVAL BSP User Manual: SDRAM Exported Types

Modules | Defines
SDRAM Exported Types
STM32756G_EVAL SDRAM

Modules

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 stm32756g_eval_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 101 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)

Definition at line 102 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)

Definition at line 103 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)

Definition at line 104 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)

Definition at line 106 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)

Definition at line 105 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)

Definition at line 107 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)

Definition at line 108 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)

Definition at line 109 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)

Definition at line 110 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Definition at line 111 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_OK ((uint8_t)0x00)

SDRAM status structure definition.

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


STM32756G_EVAL BSP User Manual: SDRAM Exported Macro

SDRAM Exported Macro
STM32756G_EVAL SDRAM


STM32756G_EVAL BSP User Manual: SDRAM Exported Functions

Functions
SDRAM Exported Functions
STM32756G_EVAL 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.
void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
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 194 of file stm32756g_eval_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 145 of file stm32756g_eval_sdram.c.

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

Referenced by BSP_LCD_InitEx().

void BSP_SDRAM_Initialization_sequence ( uint32_t RefreshCount )

Programs the SDRAM device.

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

Definition at line 220 of file stm32756g_eval_sdram.c.

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

Referenced by BSP_SDRAM_Init().

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

DeInitializes SDRAM MSP.

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

Definition at line 473 of file stm32756g_eval_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 stm32756g_eval_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 282 of file stm32756g_eval_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 301 of file stm32756g_eval_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 356 of file stm32756g_eval_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 320 of file stm32756g_eval_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 339 of file stm32756g_eval_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.


STM32756G_EVAL BSP User Manual: SRAM Private Types Definitions

SRAM Private Types Definitions
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Private Defines

SRAM Private Defines
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Private Macros

SRAM Private Macros
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Private Variables

Variables
SRAM Private Variables
STM32756G_EVAL SRAM

Variables

SRAM_HandleTypeDef | sramHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Variable Documentation

SRAM_HandleTypeDef sramHandle

Definition at line 115 of file stm32756g_eval_sram.c.

Referenced by BSP_SRAM_DeInit(), BSP_SRAM_Init(), BSP_SRAM_ReadData(), BSP_SRAM_ReadData_DMA(), BSP_SRAM_WriteData(), and BSP_SRAM_WriteData_DMA().

FMC_NORSRAM_TimingTypeDef Timing [static]

Definition at line 116 of file stm32756g_eval_sram.c.

Referenced by BSP_SRAM_Init().


STM32756G_EVAL BSP User Manual: SRAM Private Function Prototypes

SRAM Private Function Prototypes
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Private Functions

Functions
SRAM Private Functions
STM32756G_EVAL SRAM

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_DeInit (void)
DeInitializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
__weak void | BSP_SRAM_MspInit (SRAM_HandleTypeDef *hsram, void *Params)
Initializes SRAM MSP.
__weak void | BSP_SRAM_MspDeInit (SRAM_HandleTypeDef *hsram, void *Params)
DeInitializes SRAM MSP.

Function Documentation

uint8_t BSP_SRAM_DeInit ( void )

DeInitializes the SRAM device.

Return values:
SRAM status

Definition at line 185 of file stm32756g_eval_sram.c.

References BSP_SRAM_MspDeInit(), SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_Init ( void )

Initializes the SRAM device.

Return values:
SRAM status

Definition at line 136 of file stm32756g_eval_sram.c.

References BSP_SRAM_MspInit(), CONTINUOUSCLOCK_FEATURE, SRAM_BURSTACCESS, SRAM_ERROR, SRAM_MEMORY_WIDTH, SRAM_OK, SRAM_WRITEBURST, sramHandle, and Timing.

__weak void BSP_SRAM_MspDeInit | ( | SRAM_HandleTypeDef * | hsram,
 |  | void * | Params
 | ) |  |

DeInitializes SRAM MSP.

Parameters:
hsram,: SRAM handle
Params
Return values:
None

Definition at line 371 of file stm32756g_eval_sram.c.

References SRAM_DMAx_IRQn, and SRAM_DMAx_STREAM.

Referenced by BSP_SRAM_DeInit().

__weak void BSP_SRAM_MspInit | ( | SRAM_HandleTypeDef * | hsram,
 |  | void * | Params
 | ) |  |

Initializes SRAM MSP.

Parameters:
hsram,: SRAM handle
Params
Return values:
None

Definition at line 289 of file stm32756g_eval_sram.c.

References __SRAM_DMAx_CLK_ENABLE, SRAM_DMAx_CHANNEL, SRAM_DMAx_IRQn, and SRAM_DMAx_STREAM.

Referenced by BSP_SRAM_Init().

uint8_t BSP_SRAM_ReadData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the SRAM device 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:
SRAM status

Definition at line 214 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_ReadData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the SRAM device 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:
SRAM status

Definition at line 233 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_WriteData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data from the SRAM device 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:
SRAM status

Definition at line 252 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_WriteData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data from the SRAM device 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:
SRAM status

Definition at line 271 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.


STM32756G_EVAL BSP User Manual: SRAM Exported Types

SRAM Exported Types
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Exported Constants

Defines
SRAM Exported Constants
STM32756G_EVAL SRAM

Defines

#define | SRAM_OK ((uint8_t)0x00)
SRAM status structure definition.
#define | SRAM_ERROR ((uint8_t)0x01)
#define | SRAM_DEVICE_ADDR ((uint32_t)0x68000000)
#define | SRAM_DEVICE_SIZE ((uint32_t)0x200000) /* SRAM device size in MBytes */
#define | SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY
#define | __SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | __SRAM_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SRAM_DMAx_CHANNEL DMA_CHANNEL_0
#define | SRAM_DMAx_STREAM DMA2_Stream4
#define | SRAM_DMAx_IRQn DMA2_Stream4_IRQn
#define | BSP_SRAM_DMA_IRQHandler DMA2_Stream4_IRQHandler

Define Documentation

#define __SRAM_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE

Definition at line 94 of file stm32756g_eval_sram.h.

#define __SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 93 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspInit().

#define BSP_SRAM_DMA_IRQHandler DMA2_Stream4_IRQHandler

Definition at line 98 of file stm32756g_eval_sram.h.

#define CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY

Definition at line 89 of file stm32756g_eval_sram.h.

#define SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE

Definition at line 83 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_Init().

#define SRAM_DEVICE_ADDR ((uint32_t)0x68000000)

Definition at line 77 of file stm32756g_eval_sram.h.

#define SRAM_DEVICE_SIZE ((uint32_t)0x200000) /* SRAM device size in MBytes */

Definition at line 78 of file stm32756g_eval_sram.h.

#define SRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 95 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspInit().

#define SRAM_DMAx_IRQn DMA2_Stream4_IRQn

Definition at line 97 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspDeInit(), and BSP_SRAM_MspInit().

#define SRAM_DMAx_STREAM DMA2_Stream4

Definition at line 96 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspDeInit(), and BSP_SRAM_MspInit().

#define SRAM_ERROR ((uint8_t)0x01)

Definition at line 75 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_DeInit(), BSP_SRAM_Init(), BSP_SRAM_ReadData(), BSP_SRAM_ReadData_DMA(), BSP_SRAM_WriteData(), and BSP_SRAM_WriteData_DMA().

#define SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16

Definition at line 81 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_Init().

#define SRAM_OK ((uint8_t)0x00)

SRAM status structure definition.

Definition at line 74 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_DeInit(), BSP_SRAM_Init(), BSP_SRAM_ReadData(), BSP_SRAM_ReadData_DMA(), BSP_SRAM_WriteData(), and BSP_SRAM_WriteData_DMA().

#define SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE

Definition at line 86 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_Init().


STM32756G_EVAL BSP User Manual: SRAM Exported Macro

SRAM Exported Macro
STM32756G_EVAL SRAM


STM32756G_EVAL BSP User Manual: SRAM Exported Functions

Functions
SRAM Exported Functions
STM32756G_EVAL SRAM

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_DeInit (void)
DeInitializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
void | BSP_SRAM_MspInit (SRAM_HandleTypeDef *hsram, void *Params)
Initializes SRAM MSP.
void | BSP_SRAM_MspDeInit (SRAM_HandleTypeDef *hsram, void *Params)
DeInitializes SRAM MSP.

Function Documentation

uint8_t BSP_SRAM_DeInit ( void )

DeInitializes the SRAM device.

Return values:
SRAM status

Definition at line 185 of file stm32756g_eval_sram.c.

References BSP_SRAM_MspDeInit(), SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_Init ( void )

Initializes the SRAM device.

Return values:
SRAM status

Definition at line 136 of file stm32756g_eval_sram.c.

References BSP_SRAM_MspInit(), CONTINUOUSCLOCK_FEATURE, SRAM_BURSTACCESS, SRAM_ERROR, SRAM_MEMORY_WIDTH, SRAM_OK, SRAM_WRITEBURST, sramHandle, and Timing.

void BSP_SRAM_MspDeInit | ( | SRAM_HandleTypeDef * | hsram,
 |  | void * | Params
 | ) |  |

DeInitializes SRAM MSP.

Parameters:
hsram,: SRAM handle
Params
Return values:
None

Definition at line 371 of file stm32756g_eval_sram.c.

References SRAM_DMAx_IRQn, and SRAM_DMAx_STREAM.

Referenced by BSP_SRAM_DeInit().

void BSP_SRAM_MspInit | ( | SRAM_HandleTypeDef * | hsram,
 |  | void * | Params
 | ) |  |

Initializes SRAM MSP.

Parameters:
hsram,: SRAM handle
Params
Return values:
None

Definition at line 289 of file stm32756g_eval_sram.c.

References __SRAM_DMAx_CLK_ENABLE, SRAM_DMAx_CHANNEL, SRAM_DMAx_IRQn, and SRAM_DMAx_STREAM.

Referenced by BSP_SRAM_Init().

uint8_t BSP_SRAM_ReadData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the SRAM device 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:
SRAM status

Definition at line 214 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_ReadData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Reads an amount of data from the SRAM device 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:
SRAM status

Definition at line 233 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_WriteData | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data from the SRAM device 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:
SRAM status

Definition at line 252 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

uint8_t BSP_SRAM_WriteData_DMA | ( | uint32_t | uwStartAddress,
 |  | uint16_t * | pData,
 |  | uint32_t | uwDataSize
 | ) |  |

Writes an amount of data from the SRAM device 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:
SRAM status

Definition at line 271 of file stm32756g_eval_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.


STM32756G_EVAL BSP User Manual: TS Private Types Definitions

TS Private Types Definitions
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: TS Private Defines

TS Private Defines
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: TS Private Macros

TS Private Macros
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: TS Private Variables

Variables
TS Private Variables
STM32756G_EVAL 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 124 of file stm32756g_eval_ts.c.

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

TS_DrvTypeDef* tsDriver [static]

Definition at line 121 of file stm32756g_eval_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 123 of file stm32756g_eval_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsXBoundary [static]

Definition at line 122 of file stm32756g_eval_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsYBoundary [static]

Definition at line 122 of file stm32756g_eval_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


STM32756G_EVAL BSP User Manual: TS Private Functions Prototypes

TS Private Functions Prototypes
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: TS Private Functions

Functions
TS Private Functions
STM32756G_EVAL TS

Functions

uint8_t | BSP_TS_Init (uint16_t xSize, uint16_t ySize)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, 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.
void | BSP_TS_ITClear (void)
Clears all touch screen interrupts.

Function Documentation

uint8_t BSP_TS_DeInit ( void )

DeInitializes the TouchScreen.

Return values:
TS state

Definition at line 193 of file stm32756g_eval_ts.c.

References TS_OK.

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 232 of file stm32756g_eval_ts.c.

References I2cAddress, TS_StateTypeDef::TouchDetected, TS_OK, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, tsOrientation, tsXBoundary, tsYBoundary, TS_StateTypeDef::x, and TS_StateTypeDef::y.

uint8_t BSP_TS_Init | ( | uint16_t | xSize,
 |  | uint16_t | ySize
 | ) |  |

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

Parameters:
xSize,: Maximum X size of the TS area on LCD
ySize,: 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 147 of file stm32756g_eval_ts.c.

References EXC7200_I2C_ADDRESS, I2cAddress, TS3510_I2C_ADDRESS, TS_I2C_ADDRESS, TS_OK, TS_SWAP_NONE, TS_SWAP_Y, tsDriver, tsOrientation, tsXBoundary, and tsYBoundary.

void BSP_TS_ITClear ( void )

Clears all touch screen interrupts.

Return values:
None

Definition at line 280 of file stm32756g_eval_ts.c.

References BSP_IO_ITClear(), 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 203 of file stm32756g_eval_ts.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), I2cAddress, 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 221 of file stm32756g_eval_ts.c.

References I2cAddress, and tsDriver.


STM32756G_EVAL BSP User Manual: TS_StateTypeDef Struct Reference

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

#include <stm32756g_eval_ts.h>

Data Fields

uint16_t | TouchDetected
uint16_t | x
uint16_t | y
uint16_t | z

Detailed Description

Definition at line 68 of file stm32756g_eval_ts.h.

Field Documentation

uint16_t TS_StateTypeDef::TouchDetected

Definition at line 70 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::x

Definition at line 71 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::y

Definition at line 72 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::z

Definition at line 73 of file stm32756g_eval_ts.h.

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


STM32756G_EVAL BSP User Manual: TS Exported Constants

Defines | Enumerations
TS Exported Constants
STM32756G_EVAL TS

Defines

#define | TS_SWAP_NONE ((uint8_t)0x00)
#define | TS_SWAP_X ((uint8_t)0x01)
#define | TS_SWAP_Y ((uint8_t)0x02)
#define | TS_SWAP_XY ((uint8_t)0x04)
#define | TS_INT_PIN LCD_INT_PIN

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02 }

Define Documentation

#define TS_INT_PIN LCD_INT_PIN

Definition at line 95 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_ITConfig().

#define TS_SWAP_NONE ((uint8_t)0x00)

Definition at line 82 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_Init().

#define TS_SWAP_X ((uint8_t)0x01)

Definition at line 83 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_XY ((uint8_t)0x04)

Definition at line 85 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_Y ((uint8_t)0x02)

Definition at line 84 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

Enumeration Type Documentation

enum TS_StatusTypeDef
Enumerator:
TS_OK
TS_ERROR
TS_TIMEOUT

Definition at line 87 of file stm32756g_eval_ts.h.


STM32756G_EVAL BSP User Manual: TS Exported Macros

TS Exported Macros
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: TS Exported Functions

Functions
TS Exported Functions
STM32756G_EVAL TS

Functions

uint8_t | BSP_TS_Init (uint16_t xSize, uint16_t ySize)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, 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_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.

Function Documentation

uint8_t BSP_TS_DeInit ( void )

DeInitializes the TouchScreen.

Return values:
TS state

Definition at line 193 of file stm32756g_eval_ts.c.

References TS_OK.

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 232 of file stm32756g_eval_ts.c.

References I2cAddress, TS_StateTypeDef::TouchDetected, TS_OK, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, tsOrientation, tsXBoundary, tsYBoundary, TS_StateTypeDef::x, and TS_StateTypeDef::y.

uint8_t BSP_TS_Init | ( | uint16_t | xSize,
 |  | uint16_t | ySize
 | ) |  |

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

Parameters:
xSize,: Maximum X size of the TS area on LCD
ySize,: 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 147 of file stm32756g_eval_ts.c.

References EXC7200_I2C_ADDRESS, I2cAddress, TS3510_I2C_ADDRESS, TS_I2C_ADDRESS, TS_OK, TS_SWAP_NONE, TS_SWAP_Y, tsDriver, tsOrientation, tsXBoundary, and tsYBoundary.

void BSP_TS_ITClear ( void )

Clears all touch screen interrupts.

Return values:
None

Definition at line 280 of file stm32756g_eval_ts.c.

References BSP_IO_ITClear(), 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 203 of file stm32756g_eval_ts.c.

References BSP_IO_ConfigPin(), BSP_IO_Init(), I2cAddress, 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 221 of file stm32756g_eval_ts.c.

References I2cAddress, and tsDriver.


STM32756G_EVAL 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
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • TextColor : LCD_DrawPropTypeDef
  • TouchDetected : TS_StateTypeDef
  • X : Point
  • x : TS_StateTypeDef
  • y : TS_StateTypeDef
  • Y : Point
  • z : TS_StateTypeDef


STM32756G_EVAL 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
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info
  • TextColor : LCD_DrawPropTypeDef
  • TouchDetected : TS_StateTypeDef
  • X : Point
  • x : TS_StateTypeDef
  • y : TS_StateTypeDef
  • Y : Point
  • z : TS_StateTypeDef


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_sdram.h
  • __DMAx_CLK_ENABLE : stm32756g_eval_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32756g_eval_sd.h
  • __SRAM_DMAx_CLK_DISABLE : stm32756g_eval_sram.h
  • __SRAM_DMAx_CLK_ENABLE : stm32756g_eval_sram.h
  • __STM32756G_EVAL_BSP_VERSION : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_MAIN : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_RC : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_SUB1 : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_SUB2 : stm32756g_eval.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_lcd.c
  • ActiveLayer : stm32756g_eval_lcd.c
  • ADCx : stm32756g_eval.h
  • ADCx_CHANNEL : stm32756g_eval.h
  • ADCx_CHANNEL_GPIO_CLK_ENABLE : stm32756g_eval.h
  • ADCx_CHANNEL_GPIO_PORT : stm32756g_eval.h
  • ADCx_CHANNEL_PIN : stm32756g_eval.h
  • ADCx_CLK_ENABLE : stm32756g_eval.h
  • ADCx_FORCE_RESET : stm32756g_eval.h
  • ADCx_POLL_TIMEOUT : stm32756g_eval.h
  • ADCx_RELEASE_RESET : stm32756g_eval.h
  • audio_drv : stm32756g_eval_audio.c
  • AUDIO_ERROR : stm32756g_eval_audio.h
  • AUDIO_I2C_ADDRESS : stm32756g_eval.h
  • AUDIO_I2Sx : stm32756g_eval_audio.h
  • AUDIO_I2Sx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_IRQ : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_IRQHandler : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_MEM_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_STREAM : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_AF : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_PIN : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_AF : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_PIN : stm32756g_eval_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32756g_eval_audio.h
  • AUDIO_IO_DeInit() : stm32756g_eval.c
  • AUDIO_IO_Delay() : stm32756g_eval.c
  • AUDIO_IO_Init() : stm32756g_eval.c
  • AUDIO_IO_Read() : stm32756g_eval.c
  • AUDIO_IO_Write() : stm32756g_eval.c
  • AUDIO_OK : stm32756g_eval_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32756g_eval_audio.h
  • AUDIO_SAIx : stm32756g_eval_audio.h
  • AUDIO_SAIx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_STREAM : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_SD_MCLK_AF : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_AF : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_SD_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_SD_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_SD_PIN : stm32756g_eval_audio.h
  • AUDIO_TIMEOUT : stm32756g_eval_audio.h
  • AUDIO_TIMx : stm32756g_eval_audio.h
  • AUDIO_TIMx_AF : stm32756g_eval_audio.h
  • AUDIO_TIMx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_TIMx_IN_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_TIMx_IN_GPIO_PIN : stm32756g_eval_audio.h
  • AUDIO_TIMx_OUT_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_TIMx_OUT_GPIO_PIN : stm32756g_eval_audio.h
  • AUDIODATA_SIZE : stm32756g_eval_audio.h
  • AudioInVolume : stm32756g_eval_audio.h , stm32756g_eval_audio.c


STM32756G_EVAL 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
  • n
  • 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 -

  • BLOCKERASE_TIMEOUT : stm32756g_eval_nor.h
  • BSP_AUDIO_IN_ClockConfig() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Error_Callback() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Init() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Pause() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_PDMToPCM() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Record() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Resume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Stop() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_ClockConfig() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_DeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Error_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Init() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_MspDeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_MspInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Pause() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Play() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Resume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetFrequency() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetMute() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetOutputMode() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetVolume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Stop() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_CAMERA_BlackWhiteConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ColorEffectConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ContinuousStart() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_DeInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_DMA_IRQHandler : stm32756g_eval_camera.h
  • BSP_CAMERA_ErrorCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_FrameEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_HwReset() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Init() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_IRQHandler : stm32756g_eval_camera.h
  • BSP_CAMERA_LineEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_MspDeInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_MspInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_PwrDown() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Resume() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_SnapshotStart() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Stop() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Suspend() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_VsyncEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_COM_DeInit() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_COM_Init() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_EEPROM_DeInit() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_Init() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_ReadBuffer() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WaitEepromStandbyState() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WriteBuffer() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WritePage() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_GetVersion() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_IO_ConfigIrqOutPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ConfigPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_DeInit() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_Init() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ITClear() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ITGetStatus() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_PIN_RESET : stm32756g_eval_io.h
  • BSP_IO_PIN_SET : stm32756g_eval_io.h
  • BSP_IO_PinStateTypeDef : stm32756g_eval_io.h
  • BSP_IO_ReadPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_TogglePin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_WritePin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_LCD_Clear() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ClearStringLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ClockConfig() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DeInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayChar() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayOff() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayOn() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayStringAt() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayStringAtLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawBitmap() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawCircle() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawEllipse() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawHLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawPixel() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawPolygon() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawRect() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawVLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillCircle() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillEllipse() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillPolygon() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillRect() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetBackColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetFont() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetTextColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetXSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetYSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_Init() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_InitEx() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_LayerDefaultInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_MspDeInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_MspInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ReadPixel() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_Relaod() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ResetColorKeying() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ResetColorKeying_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SelectLayer() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetBackColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetColorKeying() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetColorKeying_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetFont() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerAddress() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerAddress_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerVisible() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerVisible_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerWindow() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerWindow_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTextColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTransparency() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTransparency_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetXSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetYSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LED_DeInit() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Init() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Off() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_LED_On() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Toggle() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_NOR_DeInit() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_Erase_Block() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_Erase_Chip() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_Init() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_MspDeInit() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_MspInit() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_ProgramData() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_Read_ID() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_ReadData() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_ReturnToReadMode() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_WriteData() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_PB_DeInit() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_PB_GetState() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_PB_Init() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_POTENTIOMETER_GetLevel() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_POTENTIOMETER_Init() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_QSPI_DeInit() : stm32756g_eval_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32756g_eval_qspi.c
  • BSP_QSPI_Erase_Block() : stm32756g_eval_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32756g_eval_qspi.c
  • BSP_QSPI_GetInfo() : stm32756g_eval_qspi.c
  • BSP_QSPI_GetStatus() : stm32756g_eval_qspi.c
  • BSP_QSPI_Init() : stm32756g_eval_qspi.c
  • BSP_QSPI_MemoryMappedMode : stm32756g_eval_qspi.h
  • BSP_QSPI_MspDeInit() : stm32756g_eval_qspi.h , stm32756g_eval_qspi.c
  • BSP_QSPI_MspInit() : stm32756g_eval_qspi.h , stm32756g_eval_qspi.c
  • BSP_QSPI_Read() : stm32756g_eval_qspi.c
  • BSP_QSPI_Write() : stm32756g_eval_qspi.c
  • BSP_SD_AbortCallback() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_CardInfo : stm32756g_eval_sd.h
  • BSP_SD_DeInit() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_DetectCallback() : stm32756g_eval_sd.h
  • BSP_SD_DetectIT() : stm32756g_eval_sd.h
  • BSP_SD_Erase() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_GetCardInfo() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_GetCardState() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_Init() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_IsDetected() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_ITConfig() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_MspDeInit() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_MspInit() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_ReadBlocks() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_ReadCpltCallback() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_WriteBlocks() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_WriteCpltCallback() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SDMMC_DMA_Rx_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDMMC_DMA_Tx_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDMMC_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDRAM_DeInit() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_DMA_IRQHandler : stm32756g_eval_sdram.h
  • BSP_SDRAM_Init() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_MspDeInit() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_MspInit() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_ReadData() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_WriteData() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_WriteData_DMA() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SRAM_DeInit() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_DMA_IRQHandler : stm32756g_eval_sram.h
  • BSP_SRAM_Init() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_MspDeInit() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_MspInit() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_ReadData() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_ReadData_DMA() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_WriteData() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_WriteData_DMA() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_TS_DeInit() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_GetState() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BSP_TS_Init() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BSP_TS_ITClear() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_ITConfig() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_ITGetStatus() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BUTTON_IRQn : stm32756g_eval.c
  • BUTTON_KEY : stm32756g_eval.h
  • BUTTON_MODE_EXTI : stm32756g_eval.h
  • BUTTON_MODE_GPIO : stm32756g_eval.h
  • BUTTON_PIN : stm32756g_eval.c
  • BUTTON_PORT : stm32756g_eval.c
  • BUTTON_TAMPER : stm32756g_eval.h
  • Button_TypeDef : stm32756g_eval.h
  • BUTTON_WAKEUP : stm32756g_eval.h
  • ButtonMode_TypeDef : stm32756g_eval.h
  • BUTTONn : stm32756g_eval.h
  • BUTTONx_GPIO_CLK_DISABLE : stm32756g_eval.h
  • BUTTONx_GPIO_CLK_ENABLE : stm32756g_eval.h


STM32756G_EVAL 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
  • n
  • 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_Delay() : stm32756g_eval.c
  • camera_drv : stm32756g_eval_camera.c
  • CAMERA_ERROR : stm32756g_eval_camera.h
  • CAMERA_I2C_ADDRESS : stm32756g_eval.h
  • CAMERA_IO_Init() : stm32756g_eval.c
  • CAMERA_IO_Read() : stm32756g_eval.c
  • CAMERA_IO_Write() : stm32756g_eval.c
  • CAMERA_NOT_DETECTED : stm32756g_eval_camera.h
  • CAMERA_NOT_SUPPORTED : stm32756g_eval_camera.h
  • CAMERA_OK : stm32756g_eval_camera.h
  • Camera_StatusTypeDef : stm32756g_eval_camera.h
  • CAMERA_TIMEOUT : stm32756g_eval_camera.h
  • CameraCurrentResolution : stm32756g_eval_camera.c
  • CameraHwAddress : stm32756g_eval_camera.c
  • CENTER_MODE : stm32756g_eval_lcd.h
  • Channel_Demux : stm32756g_eval_audio.c
  • CHANNEL_DEMUX_MASK : stm32756g_eval_audio.h
  • CHIPERASE_TIMEOUT : stm32756g_eval_nor.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32756g_eval_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32756g_eval_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32756g_eval_audio.h
  • CODEC_RESET_DELAY : stm32756g_eval_audio.h
  • COM1 : stm32756g_eval.h
  • COM2 : stm32756g_eval.h
  • COM_RX_AF : stm32756g_eval.c
  • COM_RX_PIN : stm32756g_eval.c
  • COM_RX_PORT : stm32756g_eval.c
  • COM_TX_AF : stm32756g_eval.c
  • COM_TX_PIN : stm32756g_eval.c
  • COM_TX_PORT : stm32756g_eval.c
  • COM_TypeDef : stm32756g_eval.h
  • COM_USART : stm32756g_eval.c
  • Command : stm32756g_eval_sdram.c
  • COMn : stm32756g_eval.h
  • CONTINUOUSCLOCK_FEATURE : stm32756g_eval_nor.h , stm32756g_eval_sram.h


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32756g_eval_audio.h
  • DMA_MAX : stm32756g_eval_audio.h
  • DMA_MAX_SZE : stm32756g_eval_audio.h
  • DrawChar() : stm32756g_eval_lcd.c
  • DrawProp : stm32756g_eval_lcd.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32756g_eval.h
  • EEPROM_I2C_ADDRESS_A02 : stm32756g_eval.h
  • EEPROM_IO_Init() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_IO_ReadData() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_IO_WriteData() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_MAX_SIZE : stm32756g_eval_eeprom.h
  • EEPROM_MAX_TRIALS : stm32756g_eval_eeprom.h
  • EEPROM_OK : stm32756g_eval_eeprom.h
  • EEPROM_PAGESIZE : stm32756g_eval_eeprom.h
  • EEPROM_TIMEOUT : stm32756g_eval_eeprom.h
  • EEPROMAddress : stm32756g_eval_eeprom.c
  • EEPROMDataRead : stm32756g_eval_eeprom.c
  • EEPROMDataWrite : stm32756g_eval_eeprom.c
  • EVAL_COM1 : stm32756g_eval.h
  • EVAL_COM1_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_IRQn : stm32756g_eval.h
  • EVAL_COM1_RX_AF : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_PORT : stm32756g_eval.h
  • EVAL_COM1_RX_PIN : stm32756g_eval.h
  • EVAL_COM1_TX_AF : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_PORT : stm32756g_eval.h
  • EVAL_COM1_TX_PIN : stm32756g_eval.h
  • EVAL_COMx_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COMx_RX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_RX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COMx_TX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_TX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_DMAx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx : stm32756g_eval.h
  • EVAL_I2Cx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx_ER_IRQn : stm32756g_eval.h
  • EVAL_I2Cx_EV_IRQn : stm32756g_eval.h
  • EVAL_I2Cx_FORCE_RESET : stm32756g_eval.h
  • EVAL_I2Cx_RELEASE_RESET : stm32756g_eval.h
  • EVAL_I2Cx_SCL_PIN : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_AF : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_GPIO_PORT : stm32756g_eval.h
  • EVAL_I2Cx_SDA_PIN : stm32756g_eval.h
  • EXC7200_I2C_ADDRESS : stm32756g_eval.h


STM32756G_EVAL 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
  • n
  • 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() : stm32756g_eval_lcd.c
  • Filter : stm32756g_eval_audio.c


STM32756G_EVAL 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
  • n
  • 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 -

  • GetSize() : stm32756g_eval_camera.c
  • GPIO_PIN : stm32756g_eval.c


STM32756G_EVAL 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
  • n
  • 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() : stm32756g_eval_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32756g_eval_camera.c
  • HAL_DCMI_LineEventCallback() : stm32756g_eval_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32756g_eval_camera.c
  • HAL_I2S_ErrorCallback() : stm32756g_eval_audio.c
  • HAL_I2S_RxCpltCallback() : stm32756g_eval_audio.c
  • HAL_I2S_RxHalfCpltCallback() : stm32756g_eval_audio.c
  • HAL_NOR_MspWait() : stm32756g_eval_nor.c
  • HAL_SAI_ErrorCallback() : stm32756g_eval_audio.c
  • HAL_SAI_TxCpltCallback() : stm32756g_eval_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32756g_eval_audio.c
  • HAL_SD_AbortCallback() : stm32756g_eval_sd.c
  • HAL_SD_RxCpltCallback() : stm32756g_eval_sd.c
  • HAL_SD_TxCpltCallback() : stm32756g_eval_sd.c
  • haudio_in_i2s : stm32756g_eval_audio.c
  • haudio_out_sai : stm32756g_eval_audio.c
  • haudio_tim : stm32756g_eval_audio.c
  • hDcmiEval : stm32756g_eval_camera.c
  • hDma2dEval : stm32756g_eval_lcd.c
  • hEvalADC : stm32756g_eval.c
  • hEvalI2c : stm32756g_eval.c
  • hLtdcEval : stm32756g_eval_lcd.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_ts.c
  • I2Cx_Error() : stm32756g_eval.c
  • I2Cx_Init() : stm32756g_eval.c
  • I2Cx_IsDeviceReady() : stm32756g_eval.c
  • I2Cx_MspInit() : stm32756g_eval.c
  • I2Cx_ReadMultiple() : stm32756g_eval.c
  • I2Cx_WriteMultiple() : stm32756g_eval.c
  • I2Sx_DeInit() : stm32756g_eval_audio.c
  • I2Sx_Init() : stm32756g_eval_audio.c
  • INTERNAL_BUFF_SIZE : stm32756g_eval_audio.h
  • IO_ERROR : stm32756g_eval_io.h
  • IO_I2C_ADDRESS : stm32756g_eval.h
  • IO_I2C_ADDRESS_2 : stm32756g_eval.h
  • IO_OK : stm32756g_eval_io.h
  • IO_PIN_0 : stm32756g_eval_io.h
  • IO_PIN_1 : stm32756g_eval_io.h
  • IO_PIN_10 : stm32756g_eval_io.h
  • IO_PIN_11 : stm32756g_eval_io.h
  • IO_PIN_12 : stm32756g_eval_io.h
  • IO_PIN_13 : stm32756g_eval_io.h
  • IO_PIN_14 : stm32756g_eval_io.h
  • IO_PIN_15 : stm32756g_eval_io.h
  • IO_PIN_16 : stm32756g_eval_io.h
  • IO_PIN_17 : stm32756g_eval_io.h
  • IO_PIN_18 : stm32756g_eval_io.h
  • IO_PIN_19 : stm32756g_eval_io.h
  • IO_PIN_2 : stm32756g_eval_io.h
  • IO_PIN_20 : stm32756g_eval_io.h
  • IO_PIN_21 : stm32756g_eval_io.h
  • IO_PIN_22 : stm32756g_eval_io.h
  • IO_PIN_23 : stm32756g_eval_io.h
  • IO_PIN_3 : stm32756g_eval_io.h
  • IO_PIN_4 : stm32756g_eval_io.h
  • IO_PIN_5 : stm32756g_eval_io.h
  • IO_PIN_6 : stm32756g_eval_io.h
  • IO_PIN_7 : stm32756g_eval_io.h
  • IO_PIN_8 : stm32756g_eval_io.h
  • IO_PIN_9 : stm32756g_eval_io.h
  • IO_PIN_ALL : stm32756g_eval_io.h
  • IO_StatusTypeDef : stm32756g_eval_io.h
  • IO_TIMEOUT : stm32756g_eval_io.h
  • IoDrv : stm32756g_eval_io.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval.h
  • KEY_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • KEY_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • KEY_BUTTON_GPIO_PORT : stm32756g_eval.h
  • KEY_BUTTON_PIN : stm32756g_eval.h


STM32756G_EVAL 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
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- l -

  • LCD_COLOR_BLACK : stm32756g_eval_lcd.h
  • LCD_COLOR_BLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_BROWN : stm32756g_eval_lcd.h
  • LCD_COLOR_CYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKBLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKCYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKGRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKGREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKRED : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32756g_eval_lcd.h
  • LCD_COLOR_GRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_GREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTRED : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32756g_eval_lcd.h
  • LCD_COLOR_MAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_ORANGE : stm32756g_eval_lcd.h
  • LCD_COLOR_RED : stm32756g_eval_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32756g_eval_lcd.h
  • LCD_COLOR_WHITE : stm32756g_eval_lcd.h
  • LCD_COLOR_YELLOW : stm32756g_eval_lcd.h
  • LCD_DEFAULT_FONT : stm32756g_eval_lcd.h
  • LCD_ERROR : stm32756g_eval_lcd.h
  • LCD_FB_START_ADDRESS : stm32756g_eval_lcd.h
  • LCD_LayerCfgTypeDef : stm32756g_eval_lcd.h
  • LCD_MAX_PCLK : stm32756g_eval_lcd.h
  • LCD_MIN_PCLK : stm32756g_eval_lcd.h
  • LCD_OK : stm32756g_eval_lcd.h
  • LCD_RELOAD_IMMEDIATE : stm32756g_eval_lcd.h
  • LCD_RELOAD_VERTICAL_BLANKING : stm32756g_eval_lcd.h
  • LCD_TIMEOUT : stm32756g_eval_lcd.h
  • LED1 : stm32756g_eval.h
  • LED1_GPIO_CLK_DISABLE : stm32756g_eval.h
  • LED1_GPIO_CLK_ENABLE : stm32756g_eval.h
  • LED1_GPIO_PORT : stm32756g_eval.h
  • LED1_PIN : stm32756g_eval.h
  • LED3 : stm32756g_eval.h
  • LED3_GPIO_CLK_DISABLE : stm32756g_eval.h
  • LED3_GPIO_CLK_ENABLE : stm32756g_eval.h
  • LED3_GPIO_PORT : stm32756g_eval.h
  • LED3_PIN : stm32756g_eval.h
  • LED_GREEN : stm32756g_eval.h
  • LED_RED : stm32756g_eval.h
  • Led_TypeDef : stm32756g_eval.h
  • LEDn : stm32756g_eval.h
  • LEFT_MODE : stm32756g_eval_lcd.h
  • LL_ConvertLineToARGB8888() : stm32756g_eval_lcd.c
  • LL_FillBuffer() : stm32756g_eval_lcd.c
  • LTDC_ACTIVE_LAYER : stm32756g_eval_lcd.h


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_lcd.h
  • MFX_IRQOUT_EXTI_IRQn : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_CLK_DISABLE : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_CLK_ENABLE : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_PORT : stm32756g_eval.h
  • MFX_IRQOUT_PIN : stm32756g_eval.h
  • mfxstm32l152Identifier : stm32756g_eval_io.c
  • MSD_ERROR : stm32756g_eval_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32756g_eval_sd.h
  • MSD_OK : stm32756g_eval_sd.h


STM32756G_EVAL 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
  • n
  • 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:

- n -

  • NOR_BURSTACCESS : stm32756g_eval_nor.h
  • NOR_BUSY_STATE : stm32756g_eval_nor.h
  • NOR_DEVICE_ADDR : stm32756g_eval_nor.h
  • NOR_MEMORY_WIDTH : stm32756g_eval_nor.h
  • NOR_READY_BUSY_GPIO : stm32756g_eval_nor.h
  • NOR_READY_BUSY_PIN : stm32756g_eval_nor.h
  • NOR_READY_STATE : stm32756g_eval_nor.h
  • NOR_STATUS_ERROR : stm32756g_eval_nor.h
  • NOR_STATUS_OK : stm32756g_eval_nor.h
  • NOR_WRITEBURST : stm32756g_eval_nor.h
  • norHandle : stm32756g_eval_nor.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32756g_eval_audio.h


STM32756G_EVAL 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
  • n
  • 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 -

  • PCLK_profile : stm32756g_eval_lcd.c
  • PCM_OUT_SIZE : stm32756g_eval_audio.h
  • PDMDecoder_Init() : stm32756g_eval_audio.c
  • POLY_X : stm32756g_eval_lcd.c
  • POLY_Y : stm32756g_eval_lcd.c
  • pPoint : stm32756g_eval_lcd.h
  • PROGRAM_TIMEOUT : stm32756g_eval_nor.h


STM32756G_EVAL 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
  • n
  • 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() : stm32756g_eval_qspi.c
  • QSPI_BUSY : stm32756g_eval_qspi.h
  • QSPI_CLK_DISABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_CLK_PIN : stm32756g_eval_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CS_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_CS_PIN : stm32756g_eval_qspi.h
  • QSPI_D0_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D0_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D0_PIN : stm32756g_eval_qspi.h
  • QSPI_D1_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D1_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D1_PIN : stm32756g_eval_qspi.h
  • QSPI_D2_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D2_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D2_PIN : stm32756g_eval_qspi.h
  • QSPI_D3_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D3_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D3_PIN : stm32756g_eval_qspi.h
  • QSPI_DummyCyclesCfg() : stm32756g_eval_qspi.c
  • QSPI_EnterFourBytesAddress() : stm32756g_eval_qspi.c
  • QSPI_ERROR : stm32756g_eval_qspi.h
  • QSPI_FLASH_SIZE : stm32756g_eval_qspi.h
  • QSPI_FORCE_RESET : stm32756g_eval_qspi.h
  • QSPI_NOT_SUPPORTED : stm32756g_eval_qspi.h
  • QSPI_OK : stm32756g_eval_qspi.h
  • QSPI_PAGE_SIZE : stm32756g_eval_qspi.h
  • QSPI_RELEASE_RESET : stm32756g_eval_qspi.h
  • QSPI_ResetMemory() : stm32756g_eval_qspi.c
  • QSPI_SUSPENDED : stm32756g_eval_qspi.h
  • QSPI_WriteEnable() : stm32756g_eval_qspi.c
  • QSPIHandle : stm32756g_eval_qspi.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_sdram.h
  • RESOLUTION_R160x120 : stm32756g_eval_camera.h
  • RESOLUTION_R320x240 : stm32756g_eval_camera.h
  • RESOLUTION_R480x272 : stm32756g_eval_camera.h
  • RESOLUTION_R640x480 : stm32756g_eval_camera.h
  • RIGHT_MODE : stm32756g_eval_lcd.h


STM32756G_EVAL 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
  • n
  • 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_DeInit() : stm32756g_eval_audio.c
  • SAIx_Init() : stm32756g_eval_audio.c
  • SAMPLINGTIME : stm32756g_eval.h
  • SD_DATATIMEOUT : stm32756g_eval_sd.h
  • SD_DetectIRQHandler : stm32756g_eval_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32756g_eval_sd.h
  • SD_DMAx_Rx_IRQn : stm32756g_eval_sd.h
  • SD_DMAx_Rx_STREAM : stm32756g_eval_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32756g_eval_sd.h
  • SD_DMAx_Tx_IRQn : stm32756g_eval_sd.h
  • SD_DMAx_Tx_STREAM : stm32756g_eval_sd.h
  • SD_NOT_PRESENT : stm32756g_eval_sd.h
  • SD_PRESENT : stm32756g_eval_sd.h
  • SD_TRANSFER_BUSY : stm32756g_eval_sd.h
  • SD_TRANSFER_OK : stm32756g_eval_sd.h
  • SDCLOCK_PERIOD : stm32756g_eval_sdram.h
  • SDRAM_DEVICE_ADDR : stm32756g_eval_sdram.h
  • SDRAM_DEVICE_SIZE : stm32756g_eval_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32756g_eval_sdram.h
  • SDRAM_DMAx_IRQn : stm32756g_eval_sdram.h
  • SDRAM_DMAx_STREAM : stm32756g_eval_sdram.h
  • SDRAM_ERROR : stm32756g_eval_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32756g_eval_sdram.h
  • SDRAM_OK : stm32756g_eval_sdram.h
  • SDRAM_TIMEOUT : stm32756g_eval_sdram.h
  • sdramHandle : stm32756g_eval_sdram.c
  • SRAM_BURSTACCESS : stm32756g_eval_sram.h
  • SRAM_DEVICE_ADDR : stm32756g_eval_sram.h
  • SRAM_DEVICE_SIZE : stm32756g_eval_sram.h
  • SRAM_DMAx_CHANNEL : stm32756g_eval_sram.h
  • SRAM_DMAx_IRQn : stm32756g_eval_sram.h
  • SRAM_DMAx_STREAM : stm32756g_eval_sram.h
  • SRAM_ERROR : stm32756g_eval_sram.h
  • SRAM_MEMORY_WIDTH : stm32756g_eval_sram.h
  • SRAM_OK : stm32756g_eval_sram.h
  • SRAM_WRITEBURST : stm32756g_eval_sram.h
  • sramHandle : stm32756g_eval_sram.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_PORT : stm32756g_eval.h
  • TAMPER_BUTTON_PIN : stm32756g_eval.h
  • Text_AlignModeTypdef : stm32756g_eval_lcd.h
  • Timing : stm32756g_eval_sdram.c , stm32756g_eval_sram.c , stm32756g_eval_nor.c
  • TIMx_DeInit() : stm32756g_eval_audio.c
  • TIMx_IC_MspDeInit() : stm32756g_eval_audio.c
  • TIMx_IC_MspInit() : stm32756g_eval_audio.c
  • TIMx_Init() : stm32756g_eval_audio.c
  • TS3510_I2C_ADDRESS : stm32756g_eval.h
  • TS_ERROR : stm32756g_eval_ts.h
  • TS_I2C_ADDRESS : stm32756g_eval.h
  • TS_INT_PIN : stm32756g_eval_ts.h
  • TS_OK : stm32756g_eval_ts.h
  • TS_StatusTypeDef : stm32756g_eval_ts.h
  • TS_SWAP_NONE : stm32756g_eval_ts.h
  • TS_SWAP_X : stm32756g_eval_ts.h
  • TS_SWAP_XY : stm32756g_eval_ts.h
  • TS_SWAP_Y : stm32756g_eval_ts.h
  • TS_TIMEOUT : stm32756g_eval_ts.h
  • tsDriver : stm32756g_eval_ts.c
  • tsOrientation : stm32756g_eval_ts.c
  • tsXBoundary : stm32756g_eval_ts.c
  • tsYBoundary : stm32756g_eval_ts.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval_sd.c
  • UseExtiModeDetection : stm32756g_eval_sd.c


STM32756G_EVAL 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
  • n
  • 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 : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32756g_eval.h
  • WAKEUP_BUTTON_PIN : stm32756g_eval.h


STM32756G_EVAL BSP User Manual: Globals

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

- a -

  • AUDIO_IO_DeInit() : stm32756g_eval.c
  • AUDIO_IO_Delay() : stm32756g_eval.c
  • AUDIO_IO_Init() : stm32756g_eval.c
  • AUDIO_IO_Read() : stm32756g_eval.c
  • AUDIO_IO_Write() : stm32756g_eval.c


STM32756G_EVAL BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_IN_ClockConfig() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_AUDIO_IN_Error_Callback() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_AUDIO_IN_Init() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Pause() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_AUDIO_IN_PDMToPCM() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Record() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Resume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Stop() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_ClockConfig() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Error_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Init() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_MspDeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_MspInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Pause() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Play() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Resume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetFrequency() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetMute() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetOutputMode() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_SetVolume() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_Stop() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ColorEffectConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ContinuousStart() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_DeInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_DMA_IRQHandler() : stm32756g_eval_camera.h
  • BSP_CAMERA_ErrorCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_FrameEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_HwReset() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Init() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_IRQHandler() : stm32756g_eval_camera.h
  • BSP_CAMERA_LineEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_MspDeInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_MspInit() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_PwrDown() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Resume() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_SnapshotStart() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Stop() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_Suspend() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_CAMERA_VsyncEventCallback() : stm32756g_eval_camera.c , stm32756g_eval_camera.h
  • BSP_COM_DeInit() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_COM_Init() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_EEPROM_DeInit() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_Init() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_ReadBuffer() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WaitEepromStandbyState() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WriteBuffer() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_EEPROM_WritePage() : stm32756g_eval_eeprom.c , stm32756g_eval_eeprom.h
  • BSP_GetVersion() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_IO_ConfigIrqOutPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ConfigPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_DeInit() : stm32756g_eval_io.h , stm32756g_eval_io.c
  • BSP_IO_Init() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ITClear() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ITGetStatus() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_ReadPin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_TogglePin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_IO_WritePin() : stm32756g_eval_io.c , stm32756g_eval_io.h
  • BSP_LCD_Clear() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ClearStringLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ClockConfig() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DeInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayChar() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayOff() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayOn() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayStringAt() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DisplayStringAtLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawBitmap() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawCircle() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawEllipse() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawHLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawPixel() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawPolygon() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawRect() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_DrawVLine() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillCircle() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillEllipse() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillPolygon() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_FillRect() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetBackColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetFont() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetTextColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetXSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_GetYSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_Init() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_InitEx() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_LayerDefaultInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_MspDeInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_MspInit() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ReadPixel() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_Relaod() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ResetColorKeying() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_ResetColorKeying_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SelectLayer() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetBackColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetColorKeying() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetColorKeying_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetFont() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerAddress() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerAddress_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerVisible() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerVisible_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerWindow() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetLayerWindow_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTextColor() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTransparency() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetTransparency_NoReload() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetXSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LCD_SetYSize() : stm32756g_eval_lcd.c , stm32756g_eval_lcd.h
  • BSP_LED_DeInit() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Init() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Off() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_On() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_LED_Toggle() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_NOR_DeInit() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_Erase_Block() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_Erase_Chip() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_Init() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_MspDeInit() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_MspInit() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_ProgramData() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_Read_ID() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_ReadData() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_ReturnToReadMode() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • BSP_NOR_WriteData() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_PB_DeInit() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_PB_GetState() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_PB_Init() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_POTENTIOMETER_GetLevel() : stm32756g_eval.h , stm32756g_eval.c
  • BSP_POTENTIOMETER_Init() : stm32756g_eval.c , stm32756g_eval.h
  • BSP_QSPI_DeInit() : stm32756g_eval_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32756g_eval_qspi.c
  • BSP_QSPI_Erase_Block() : stm32756g_eval_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32756g_eval_qspi.c
  • BSP_QSPI_GetInfo() : stm32756g_eval_qspi.c
  • BSP_QSPI_GetStatus() : stm32756g_eval_qspi.c
  • BSP_QSPI_Init() : stm32756g_eval_qspi.c
  • BSP_QSPI_MspDeInit() : stm32756g_eval_qspi.h , stm32756g_eval_qspi.c
  • BSP_QSPI_MspInit() : stm32756g_eval_qspi.c , stm32756g_eval_qspi.h
  • BSP_QSPI_Read() : stm32756g_eval_qspi.c
  • BSP_QSPI_Write() : stm32756g_eval_qspi.c
  • BSP_SD_AbortCallback() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_DeInit() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_DetectCallback() : stm32756g_eval_sd.h
  • BSP_SD_DetectIT() : stm32756g_eval_sd.h
  • BSP_SD_Erase() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_GetCardInfo() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_GetCardState() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_Init() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_IsDetected() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_ITConfig() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_MspDeInit() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_MspInit() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_ReadBlocks() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_ReadCpltCallback() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_WriteBlocks() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_WriteCpltCallback() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SDRAM_DeInit() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_Init() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_MspInit() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_ReadData() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_Sendcmd() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_WriteData() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_WriteData_DMA() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SRAM_DeInit() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_Init() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_MspDeInit() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_MspInit() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_SRAM_ReadData() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_ReadData_DMA() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_WriteData() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_WriteData_DMA() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • BSP_TS_DeInit() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_GetState() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BSP_TS_Init() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_ITClear() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BSP_TS_ITConfig() : stm32756g_eval_ts.h , stm32756g_eval_ts.c
  • BSP_TS_ITGetStatus() : stm32756g_eval_ts.c , stm32756g_eval_ts.h


STM32756G_EVAL BSP User Manual: Globals

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

- c -

  • CAMERA_Delay() : stm32756g_eval.c
  • CAMERA_IO_Init() : stm32756g_eval.c
  • CAMERA_IO_Read() : stm32756g_eval.c
  • CAMERA_IO_Write() : stm32756g_eval.c


STM32756G_EVAL BSP User Manual: Globals

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

- d -

  • DrawChar() : stm32756g_eval_lcd.c


STM32756G_EVAL BSP User Manual: Globals

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

- e -

  • EEPROM_IO_Init() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32756g_eval_eeprom.h , stm32756g_eval.c
  • EEPROM_IO_ReadData() : stm32756g_eval.c , stm32756g_eval_eeprom.h
  • EEPROM_IO_WriteData() : stm32756g_eval_eeprom.h , stm32756g_eval.c


STM32756G_EVAL BSP User Manual: Globals

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

- f -

  • FillTriangle() : stm32756g_eval_lcd.c


STM32756G_EVAL BSP User Manual: Globals

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

- g -

  • GetSize() : stm32756g_eval_camera.c


STM32756G_EVAL BSP User Manual: Globals

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

- h -

  • HAL_DCMI_ErrorCallback() : stm32756g_eval_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32756g_eval_camera.c
  • HAL_DCMI_LineEventCallback() : stm32756g_eval_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32756g_eval_camera.c
  • HAL_I2S_ErrorCallback() : stm32756g_eval_audio.c
  • HAL_I2S_RxCpltCallback() : stm32756g_eval_audio.c
  • HAL_I2S_RxHalfCpltCallback() : stm32756g_eval_audio.c
  • HAL_NOR_MspWait() : stm32756g_eval_nor.c
  • HAL_SAI_ErrorCallback() : stm32756g_eval_audio.c
  • HAL_SAI_TxCpltCallback() : stm32756g_eval_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32756g_eval_audio.c
  • HAL_SD_AbortCallback() : stm32756g_eval_sd.c
  • HAL_SD_RxCpltCallback() : stm32756g_eval_sd.c
  • HAL_SD_TxCpltCallback() : stm32756g_eval_sd.c


STM32756G_EVAL BSP User Manual: Globals

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

- i -

  • I2Cx_Error() : stm32756g_eval.c
  • I2Cx_Init() : stm32756g_eval.c
  • I2Cx_IsDeviceReady() : stm32756g_eval.c
  • I2Cx_MspInit() : stm32756g_eval.c
  • I2Cx_ReadMultiple() : stm32756g_eval.c
  • I2Cx_WriteMultiple() : stm32756g_eval.c
  • I2Sx_DeInit() : stm32756g_eval_audio.c
  • I2Sx_Init() : stm32756g_eval_audio.c


STM32756G_EVAL BSP User Manual: Globals

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

- l -

  • LL_ConvertLineToARGB8888() : stm32756g_eval_lcd.c
  • LL_FillBuffer() : stm32756g_eval_lcd.c


STM32756G_EVAL BSP User Manual: Globals

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

- p -

  • PDMDecoder_Init() : stm32756g_eval_audio.c


STM32756G_EVAL BSP User Manual: Globals

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

- q -

  • QSPI_AutoPollingMemReady() : stm32756g_eval_qspi.c
  • QSPI_DummyCyclesCfg() : stm32756g_eval_qspi.c
  • QSPI_EnterFourBytesAddress() : stm32756g_eval_qspi.c
  • QSPI_ResetMemory() : stm32756g_eval_qspi.c
  • QSPI_WriteEnable() : stm32756g_eval_qspi.c


STM32756G_EVAL BSP User Manual: Globals

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

- s -

  • SAIx_DeInit() : stm32756g_eval_audio.c
  • SAIx_Init() : stm32756g_eval_audio.c


STM32756G_EVAL BSP User Manual: Globals

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

- t -

  • TIMx_DeInit() : stm32756g_eval_audio.c
  • TIMx_IC_MspDeInit() : stm32756g_eval_audio.c
  • TIMx_IC_MspInit() : stm32756g_eval_audio.c
  • TIMx_Init() : stm32756g_eval_audio.c


STM32756G_EVAL BSP User Manual: Globals

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

- a -

  • ActiveLayer : stm32756g_eval_lcd.c
  • audio_drv : stm32756g_eval_audio.c
  • AudioInVolume : stm32756g_eval_audio.c , stm32756g_eval_audio.h

- b -

  • BUTTON_IRQn : stm32756g_eval.c
  • BUTTON_PIN : stm32756g_eval.c
  • BUTTON_PORT : stm32756g_eval.c

- c -

  • camera_drv : stm32756g_eval_camera.c
  • CameraCurrentResolution : stm32756g_eval_camera.c
  • CameraHwAddress : stm32756g_eval_camera.c
  • Channel_Demux : stm32756g_eval_audio.c
  • COM_RX_AF : stm32756g_eval.c
  • COM_RX_PIN : stm32756g_eval.c
  • COM_RX_PORT : stm32756g_eval.c
  • COM_TX_AF : stm32756g_eval.c
  • COM_TX_PIN : stm32756g_eval.c
  • COM_TX_PORT : stm32756g_eval.c
  • COM_USART : stm32756g_eval.c
  • Command : stm32756g_eval_sdram.c

- d -

  • DrawProp : stm32756g_eval_lcd.c

- e -

  • EEPROMAddress : stm32756g_eval_eeprom.c
  • EEPROMDataRead : stm32756g_eval_eeprom.c
  • EEPROMDataWrite : stm32756g_eval_eeprom.c

- f -

  • Filter : stm32756g_eval_audio.c

- g -

  • GPIO_PIN : stm32756g_eval.c

- h -

  • haudio_in_i2s : stm32756g_eval_audio.c
  • haudio_out_sai : stm32756g_eval_audio.c
  • haudio_tim : stm32756g_eval_audio.c
  • hDcmiEval : stm32756g_eval_camera.c
  • hDma2dEval : stm32756g_eval_lcd.c
  • hEvalADC : stm32756g_eval.c
  • hEvalI2c : stm32756g_eval.c
  • hLtdcEval : stm32756g_eval_lcd.c

- i -

  • I2cAddress : stm32756g_eval_ts.c
  • IoDrv : stm32756g_eval_io.c

- m -

  • mfxstm32l152Identifier : stm32756g_eval_io.c

- n -

  • norHandle : stm32756g_eval_nor.c

- p -

  • PCLK_profile : stm32756g_eval_lcd.c

- q -

  • QSPIHandle : stm32756g_eval_qspi.c

- s -

  • sdramHandle : stm32756g_eval_sdram.c
  • sramHandle : stm32756g_eval_sram.c

- t -

  • Timing : stm32756g_eval_nor.c , stm32756g_eval_sdram.c , stm32756g_eval_sram.c
  • tsDriver : stm32756g_eval_ts.c
  • tsOrientation : stm32756g_eval_ts.c
  • tsXBoundary : stm32756g_eval_ts.c
  • tsYBoundary : stm32756g_eval_ts.c

- u -

  • uSdHandle : stm32756g_eval_sd.c
  • UseExtiModeDetection : stm32756g_eval_sd.c


STM32756G_EVAL BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • pPoint : stm32756g_eval_lcd.h


STM32756G_EVAL BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_IO_PinStateTypeDef : stm32756g_eval_io.h
  • Button_TypeDef : stm32756g_eval.h
  • ButtonMode_TypeDef : stm32756g_eval.h
  • Camera_StatusTypeDef : stm32756g_eval_camera.h
  • COM_TypeDef : stm32756g_eval.h
  • IO_StatusTypeDef : stm32756g_eval_io.h
  • Led_TypeDef : stm32756g_eval.h
  • Text_AlignModeTypdef : stm32756g_eval_lcd.h
  • TS_StatusTypeDef : stm32756g_eval_ts.h


STM32756G_EVAL BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • BSP_IO_PIN_RESET : stm32756g_eval_io.h
  • BSP_IO_PIN_SET : stm32756g_eval_io.h
  • BUTTON_KEY : stm32756g_eval.h
  • BUTTON_MODE_EXTI : stm32756g_eval.h
  • BUTTON_MODE_GPIO : stm32756g_eval.h
  • BUTTON_TAMPER : stm32756g_eval.h
  • BUTTON_WAKEUP : stm32756g_eval.h
  • CAMERA_ERROR : stm32756g_eval_camera.h
  • CAMERA_NOT_DETECTED : stm32756g_eval_camera.h
  • CAMERA_NOT_SUPPORTED : stm32756g_eval_camera.h
  • CAMERA_OK : stm32756g_eval_camera.h
  • CAMERA_TIMEOUT : stm32756g_eval_camera.h
  • CENTER_MODE : stm32756g_eval_lcd.h
  • COM1 : stm32756g_eval.h
  • COM2 : stm32756g_eval.h
  • IO_ERROR : stm32756g_eval_io.h
  • IO_OK : stm32756g_eval_io.h
  • IO_TIMEOUT : stm32756g_eval_io.h
  • LED1 : stm32756g_eval.h
  • LED3 : stm32756g_eval.h
  • LED_GREEN : stm32756g_eval.h
  • LED_RED : stm32756g_eval.h
  • LEFT_MODE : stm32756g_eval_lcd.h
  • RIGHT_MODE : stm32756g_eval_lcd.h
  • TS_ERROR : stm32756g_eval_ts.h
  • TS_OK : stm32756g_eval_ts.h
  • TS_TIMEOUT : stm32756g_eval_ts.h


STM32756G_EVAL BSP User Manual: Globals

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

- _ -

  • __DMAx_CLK_DISABLE : stm32756g_eval_sdram.h
  • __DMAx_CLK_ENABLE : stm32756g_eval_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32756g_eval_sd.h
  • __SRAM_DMAx_CLK_DISABLE : stm32756g_eval_sram.h
  • __SRAM_DMAx_CLK_ENABLE : stm32756g_eval_sram.h
  • __STM32756G_EVAL_BSP_VERSION : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_MAIN : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_RC : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_SUB1 : stm32756g_eval.c
  • __STM32756G_EVAL_BSP_VERSION_SUB2 : stm32756g_eval.c


STM32756G_EVAL BSP User Manual: Globals

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

- a -

  • ABS : stm32756g_eval_lcd.c
  • ADCx : stm32756g_eval.h
  • ADCx_CHANNEL : stm32756g_eval.h
  • ADCx_CHANNEL_GPIO_CLK_ENABLE : stm32756g_eval.h
  • ADCx_CHANNEL_GPIO_PORT : stm32756g_eval.h
  • ADCx_CHANNEL_PIN : stm32756g_eval.h
  • ADCx_CLK_ENABLE : stm32756g_eval.h
  • ADCx_FORCE_RESET : stm32756g_eval.h
  • ADCx_POLL_TIMEOUT : stm32756g_eval.h
  • ADCx_RELEASE_RESET : stm32756g_eval.h
  • AUDIO_ERROR : stm32756g_eval_audio.h
  • AUDIO_I2C_ADDRESS : stm32756g_eval.h
  • AUDIO_I2Sx : stm32756g_eval_audio.h
  • AUDIO_I2Sx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_IRQ : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_IRQHandler : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_MEM_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_DMAx_STREAM : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_AF : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SCK_PIN : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_AF : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_I2Sx_SD_PIN : stm32756g_eval_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32756g_eval_audio.h
  • AUDIO_OK : stm32756g_eval_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32756g_eval_audio.h
  • AUDIO_SAIx : stm32756g_eval_audio.h
  • AUDIO_SAIx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32756g_eval_audio.h
  • AUDIO_SAIx_DMAx_STREAM : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_FS_SD_MCLK_AF : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_MCLK_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_AF : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_PIN : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_SD_ENABLE : stm32756g_eval_audio.h
  • AUDIO_SAIx_SCK_SD_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_SAIx_SD_PIN : stm32756g_eval_audio.h
  • AUDIO_TIMEOUT : stm32756g_eval_audio.h
  • AUDIO_TIMx : stm32756g_eval_audio.h
  • AUDIO_TIMx_AF : stm32756g_eval_audio.h
  • AUDIO_TIMx_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_CLK_DISABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_CLK_ENABLE : stm32756g_eval_audio.h
  • AUDIO_TIMx_GPIO_PORT : stm32756g_eval_audio.h
  • AUDIO_TIMx_IN_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_TIMx_IN_GPIO_PIN : stm32756g_eval_audio.h
  • AUDIO_TIMx_OUT_CHANNEL : stm32756g_eval_audio.h
  • AUDIO_TIMx_OUT_GPIO_PIN : stm32756g_eval_audio.h
  • AUDIODATA_SIZE : stm32756g_eval_audio.h


STM32756G_EVAL BSP User Manual: Globals

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

- b -

  • BLOCKERASE_TIMEOUT : stm32756g_eval_nor.h
  • BSP_CAMERA_DMA_IRQHandler : stm32756g_eval_camera.h
  • BSP_CAMERA_IRQHandler : stm32756g_eval_camera.h
  • BSP_QSPI_MemoryMappedMode : stm32756g_eval_qspi.h
  • BSP_SD_CardInfo : stm32756g_eval_sd.h
  • BSP_SDMMC_DMA_Rx_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDMMC_DMA_Tx_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDMMC_IRQHandler : stm32756g_eval_sd.h
  • BSP_SDRAM_DMA_IRQHandler : stm32756g_eval_sdram.h
  • BSP_SRAM_DMA_IRQHandler : stm32756g_eval_sram.h
  • BUTTONn : stm32756g_eval.h
  • BUTTONx_GPIO_CLK_DISABLE : stm32756g_eval.h
  • BUTTONx_GPIO_CLK_ENABLE : stm32756g_eval.h


STM32756G_EVAL BSP User Manual: Globals

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

- c -

  • CAMERA_I2C_ADDRESS : stm32756g_eval.h
  • CHANNEL_DEMUX_MASK : stm32756g_eval_audio.h
  • CHIPERASE_TIMEOUT : stm32756g_eval_nor.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32756g_eval_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32756g_eval_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32756g_eval_audio.h
  • CODEC_RESET_DELAY : stm32756g_eval_audio.h
  • COMn : stm32756g_eval.h
  • CONTINUOUSCLOCK_FEATURE : stm32756g_eval_nor.h , stm32756g_eval_sram.h


STM32756G_EVAL BSP User Manual: Globals

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

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32756g_eval_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32756g_eval_audio.h
  • DMA_MAX : stm32756g_eval_audio.h
  • DMA_MAX_SZE : stm32756g_eval_audio.h


STM32756G_EVAL BSP User Manual: Globals

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

- e -

  • EEPROM_FAIL : stm32756g_eval_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32756g_eval.h
  • EEPROM_I2C_ADDRESS_A02 : stm32756g_eval.h
  • EEPROM_MAX_SIZE : stm32756g_eval_eeprom.h
  • EEPROM_MAX_TRIALS : stm32756g_eval_eeprom.h
  • EEPROM_OK : stm32756g_eval_eeprom.h
  • EEPROM_PAGESIZE : stm32756g_eval_eeprom.h
  • EEPROM_TIMEOUT : stm32756g_eval_eeprom.h
  • EVAL_COM1 : stm32756g_eval.h
  • EVAL_COM1_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_IRQn : stm32756g_eval.h
  • EVAL_COM1_RX_AF : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_RX_GPIO_PORT : stm32756g_eval.h
  • EVAL_COM1_RX_PIN : stm32756g_eval.h
  • EVAL_COM1_TX_AF : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COM1_TX_GPIO_PORT : stm32756g_eval.h
  • EVAL_COM1_TX_PIN : stm32756g_eval.h
  • EVAL_COMx_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COMx_RX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_RX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_COMx_TX_GPIO_CLK_DISABLE : stm32756g_eval.h
  • EVAL_COMx_TX_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_DMAx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx : stm32756g_eval.h
  • EVAL_I2Cx_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx_ER_IRQn : stm32756g_eval.h
  • EVAL_I2Cx_EV_IRQn : stm32756g_eval.h
  • EVAL_I2Cx_FORCE_RESET : stm32756g_eval.h
  • EVAL_I2Cx_RELEASE_RESET : stm32756g_eval.h
  • EVAL_I2Cx_SCL_PIN : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_AF : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32756g_eval.h
  • EVAL_I2Cx_SCL_SDA_GPIO_PORT : stm32756g_eval.h
  • EVAL_I2Cx_SDA_PIN : stm32756g_eval.h
  • EXC7200_I2C_ADDRESS : stm32756g_eval.h


STM32756G_EVAL BSP User Manual: Globals

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

- i -

  • INTERNAL_BUFF_SIZE : stm32756g_eval_audio.h
  • IO_I2C_ADDRESS : stm32756g_eval.h
  • IO_I2C_ADDRESS_2 : stm32756g_eval.h
  • IO_PIN_0 : stm32756g_eval_io.h
  • IO_PIN_1 : stm32756g_eval_io.h
  • IO_PIN_10 : stm32756g_eval_io.h
  • IO_PIN_11 : stm32756g_eval_io.h
  • IO_PIN_12 : stm32756g_eval_io.h
  • IO_PIN_13 : stm32756g_eval_io.h
  • IO_PIN_14 : stm32756g_eval_io.h
  • IO_PIN_15 : stm32756g_eval_io.h
  • IO_PIN_16 : stm32756g_eval_io.h
  • IO_PIN_17 : stm32756g_eval_io.h
  • IO_PIN_18 : stm32756g_eval_io.h
  • IO_PIN_19 : stm32756g_eval_io.h
  • IO_PIN_2 : stm32756g_eval_io.h
  • IO_PIN_20 : stm32756g_eval_io.h
  • IO_PIN_21 : stm32756g_eval_io.h
  • IO_PIN_22 : stm32756g_eval_io.h
  • IO_PIN_23 : stm32756g_eval_io.h
  • IO_PIN_3 : stm32756g_eval_io.h
  • IO_PIN_4 : stm32756g_eval_io.h
  • IO_PIN_5 : stm32756g_eval_io.h
  • IO_PIN_6 : stm32756g_eval_io.h
  • IO_PIN_7 : stm32756g_eval_io.h
  • IO_PIN_8 : stm32756g_eval_io.h
  • IO_PIN_9 : stm32756g_eval_io.h
  • IO_PIN_ALL : stm32756g_eval_io.h


STM32756G_EVAL BSP User Manual: Globals

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

- k -

  • KEY_BUTTON_EXTI_IRQn : stm32756g_eval.h
  • KEY_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • KEY_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • KEY_BUTTON_GPIO_PORT : stm32756g_eval.h
  • KEY_BUTTON_PIN : stm32756g_eval.h


STM32756G_EVAL BSP User Manual: Globals

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

- l -

  • LCD_COLOR_BLACK : stm32756g_eval_lcd.h
  • LCD_COLOR_BLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_BROWN : stm32756g_eval_lcd.h
  • LCD_COLOR_CYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKBLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKCYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKGRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKGREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKRED : stm32756g_eval_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32756g_eval_lcd.h
  • LCD_COLOR_GRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_GREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTRED : stm32756g_eval_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32756g_eval_lcd.h
  • LCD_COLOR_MAGENTA : stm32756g_eval_lcd.h
  • LCD_COLOR_ORANGE : stm32756g_eval_lcd.h
  • LCD_COLOR_RED : stm32756g_eval_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32756g_eval_lcd.h
  • LCD_COLOR_WHITE : stm32756g_eval_lcd.h
  • LCD_COLOR_YELLOW : stm32756g_eval_lcd.h
  • LCD_DEFAULT_FONT : stm32756g_eval_lcd.h
  • LCD_ERROR : stm32756g_eval_lcd.h
  • LCD_FB_START_ADDRESS : stm32756g_eval_lcd.h
  • LCD_LayerCfgTypeDef : stm32756g_eval_lcd.h
  • LCD_MAX_PCLK : stm32756g_eval_lcd.h
  • LCD_MIN_PCLK : stm32756g_eval_lcd.h
  • LCD_OK : stm32756g_eval_lcd.h
  • LCD_RELOAD_IMMEDIATE : stm32756g_eval_lcd.h
  • LCD_RELOAD_VERTICAL_BLANKING : stm32756g_eval_lcd.h
  • LCD_TIMEOUT : stm32756g_eval_lcd.h
  • LED1_GPIO_CLK_DISABLE : stm32756g_eval.h
  • LED1_GPIO_CLK_ENABLE : stm32756g_eval.h
  • LED1_GPIO_PORT : stm32756g_eval.h
  • LED1_PIN : stm32756g_eval.h
  • LED3_GPIO_CLK_DISABLE : stm32756g_eval.h
  • LED3_GPIO_CLK_ENABLE : stm32756g_eval.h
  • LED3_GPIO_PORT : stm32756g_eval.h
  • LED3_PIN : stm32756g_eval.h
  • LEDn : stm32756g_eval.h
  • LTDC_ACTIVE_LAYER : stm32756g_eval_lcd.h


STM32756G_EVAL BSP User Manual: Globals

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

- m -

  • MAX_LAYER_NUMBER : stm32756g_eval_lcd.h
  • MFX_IRQOUT_EXTI_IRQn : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_CLK_DISABLE : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_CLK_ENABLE : stm32756g_eval.h
  • MFX_IRQOUT_GPIO_PORT : stm32756g_eval.h
  • MFX_IRQOUT_PIN : stm32756g_eval.h
  • MSD_ERROR : stm32756g_eval_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32756g_eval_sd.h
  • MSD_OK : stm32756g_eval_sd.h


STM32756G_EVAL BSP User Manual: Globals

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

- n -

  • NOR_BURSTACCESS : stm32756g_eval_nor.h
  • NOR_BUSY_STATE : stm32756g_eval_nor.h
  • NOR_DEVICE_ADDR : stm32756g_eval_nor.h
  • NOR_MEMORY_WIDTH : stm32756g_eval_nor.h
  • NOR_READY_BUSY_GPIO : stm32756g_eval_nor.h
  • NOR_READY_BUSY_PIN : stm32756g_eval_nor.h
  • NOR_READY_STATE : stm32756g_eval_nor.h
  • NOR_STATUS_ERROR : stm32756g_eval_nor.h
  • NOR_STATUS_OK : stm32756g_eval_nor.h
  • NOR_WRITEBURST : stm32756g_eval_nor.h


STM32756G_EVAL BSP User Manual: Globals

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

- o -

  • OUTPUT_DEVICE_HEADPHONE1 : stm32756g_eval_audio.h
  • OUTPUT_DEVICE_HEADPHONE2 : stm32756g_eval_audio.h


STM32756G_EVAL BSP User Manual: Globals

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

- p -

  • PCM_OUT_SIZE : stm32756g_eval_audio.h
  • POLY_X : stm32756g_eval_lcd.c
  • POLY_Y : stm32756g_eval_lcd.c
  • PROGRAM_TIMEOUT : stm32756g_eval_nor.h


STM32756G_EVAL BSP User Manual: Globals

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

- q -

  • QSPI_BUSY : stm32756g_eval_qspi.h
  • QSPI_CLK_DISABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_CLK_PIN : stm32756g_eval_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_CS_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_CS_PIN : stm32756g_eval_qspi.h
  • QSPI_D0_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D0_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D0_PIN : stm32756g_eval_qspi.h
  • QSPI_D1_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D1_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D1_PIN : stm32756g_eval_qspi.h
  • QSPI_D2_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D2_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D2_PIN : stm32756g_eval_qspi.h
  • QSPI_D3_GPIO_CLK_ENABLE : stm32756g_eval_qspi.h
  • QSPI_D3_GPIO_PORT : stm32756g_eval_qspi.h
  • QSPI_D3_PIN : stm32756g_eval_qspi.h
  • QSPI_ERROR : stm32756g_eval_qspi.h
  • QSPI_FLASH_SIZE : stm32756g_eval_qspi.h
  • QSPI_FORCE_RESET : stm32756g_eval_qspi.h
  • QSPI_NOT_SUPPORTED : stm32756g_eval_qspi.h
  • QSPI_OK : stm32756g_eval_qspi.h
  • QSPI_PAGE_SIZE : stm32756g_eval_qspi.h
  • QSPI_RELEASE_RESET : stm32756g_eval_qspi.h
  • QSPI_SUSPENDED : stm32756g_eval_qspi.h


STM32756G_EVAL BSP User Manual: Globals

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

- r -

  • REFRESH_COUNT : stm32756g_eval_sdram.h
  • RESOLUTION_R160x120 : stm32756g_eval_camera.h
  • RESOLUTION_R320x240 : stm32756g_eval_camera.h
  • RESOLUTION_R480x272 : stm32756g_eval_camera.h
  • RESOLUTION_R640x480 : stm32756g_eval_camera.h


STM32756G_EVAL BSP User Manual: Globals

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

- s -

  • SAMPLINGTIME : stm32756g_eval.h
  • SD_DATATIMEOUT : stm32756g_eval_sd.h
  • SD_DetectIRQHandler : stm32756g_eval_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32756g_eval_sd.h
  • SD_DMAx_Rx_IRQn : stm32756g_eval_sd.h
  • SD_DMAx_Rx_STREAM : stm32756g_eval_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32756g_eval_sd.h
  • SD_DMAx_Tx_IRQn : stm32756g_eval_sd.h
  • SD_DMAx_Tx_STREAM : stm32756g_eval_sd.h
  • SD_NOT_PRESENT : stm32756g_eval_sd.h
  • SD_PRESENT : stm32756g_eval_sd.h
  • SD_TRANSFER_BUSY : stm32756g_eval_sd.h
  • SD_TRANSFER_OK : stm32756g_eval_sd.h
  • SDCLOCK_PERIOD : stm32756g_eval_sdram.h
  • SDRAM_DEVICE_ADDR : stm32756g_eval_sdram.h
  • SDRAM_DEVICE_SIZE : stm32756g_eval_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32756g_eval_sdram.h
  • SDRAM_DMAx_IRQn : stm32756g_eval_sdram.h
  • SDRAM_DMAx_STREAM : stm32756g_eval_sdram.h
  • SDRAM_ERROR : stm32756g_eval_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32756g_eval_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32756g_eval_sdram.h
  • SDRAM_OK : stm32756g_eval_sdram.h
  • SDRAM_TIMEOUT : stm32756g_eval_sdram.h
  • SRAM_BURSTACCESS : stm32756g_eval_sram.h
  • SRAM_DEVICE_ADDR : stm32756g_eval_sram.h
  • SRAM_DEVICE_SIZE : stm32756g_eval_sram.h
  • SRAM_DMAx_CHANNEL : stm32756g_eval_sram.h
  • SRAM_DMAx_IRQn : stm32756g_eval_sram.h
  • SRAM_DMAx_STREAM : stm32756g_eval_sram.h
  • SRAM_ERROR : stm32756g_eval_sram.h
  • SRAM_MEMORY_WIDTH : stm32756g_eval_sram.h
  • SRAM_OK : stm32756g_eval_sram.h
  • SRAM_WRITEBURST : stm32756g_eval_sram.h


STM32756G_EVAL BSP User Manual: Globals

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

- t -

  • TAMPER_BUTTON_EXTI_IRQn : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • TAMPER_BUTTON_GPIO_PORT : stm32756g_eval.h
  • TAMPER_BUTTON_PIN : stm32756g_eval.h
  • TS3510_I2C_ADDRESS : stm32756g_eval.h
  • TS_I2C_ADDRESS : stm32756g_eval.h
  • TS_INT_PIN : stm32756g_eval_ts.h
  • TS_SWAP_NONE : stm32756g_eval_ts.h
  • TS_SWAP_X : stm32756g_eval_ts.h
  • TS_SWAP_XY : stm32756g_eval_ts.h
  • TS_SWAP_Y : stm32756g_eval_ts.h


STM32756G_EVAL BSP User Manual: Globals

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

- w -

  • WAKEUP_BUTTON_EXTI_IRQn : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32756g_eval.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32756g_eval.h
  • WAKEUP_BUTTON_PIN : stm32756g_eval.h


STM32756G_EVAL BSP User Manual: stm32756g_eval.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions | Variables
stm32756g_eval.c File Reference

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

#include "stm32756g_eval.h"

Go to the source code of this file.

Defines

#define | __STM32756G_EVAL_BSP_VERSION_MAIN (0x02)
STM32756G EVAL BSP Driver version number V2.0.1.
#define | __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)
#define | __STM32756G_EVAL_BSP_VERSION_SUB2 (0x01)
#define | __STM32756G_EVAL_BSP_VERSION_RC (0x00)
#define | __STM32756G_EVAL_BSP_VERSION

Functions

static void | I2Cx_MspInit (void)
Initializes I2C MSP.
static void | I2Cx_Init (void)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static HAL_StatusTypeDef | I2Cx_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2Cx_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
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_Delay (uint32_t Delay)
Camera delay.
void | CAMERA_IO_Write (uint8_t Addr, uint16_t Reg, uint16_t Value)
Camera writes single data.
uint16_t | CAMERA_IO_Read (uint8_t Addr, uint16_t Reg)
Camera reads single data.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
uint32_t | BSP_GetVersion (void)
This method returns the STM32756G EVAL BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on GPIO and/or on MFX.
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.
void | BSP_POTENTIOMETER_Init (void)
Init Potentiometer.
uint32_t | BSP_POTENTIOMETER_GetLevel (void)
Get Potentiometer level in 12 bits.

Variables

const uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn]
const uint16_t | BUTTON_PIN [BUTTONn]
const uint16_t | BUTTON_IRQn [BUTTONn]
USART_TypeDef * | COM_USART [COMn] = {EVAL_COM1}
GPIO_TypeDef * | COM_TX_PORT [COMn] = {EVAL_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {EVAL_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {EVAL_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {EVAL_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {EVAL_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {EVAL_COM1_RX_AF}
static I2C_HandleTypeDef | hEvalI2c
static ADC_HandleTypeDef | hEvalADC

Detailed Description

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

Author:
MCD Application Team
            This driver requires the stm32756g_eval_io.c/.h files to manage the
            IO module resources mapped on the MFX IO expander.
            These resources are mainly LEDs, Joystick push buttons, SD detect pin,
            USB OTG power switch/over current drive pins, Camera plug pin, Audio
            INT pin
            The use of the above eval resources is conditioned by the "USE_IOEXPANDER"
            preprocessor define which is enabled by default for the STM327x6G-EVAL
            boards Rev A. However for Rev B boards these resources are disabled by default
            (except LED1 and LED2) and to be able to use them, user must add "USE_IOEXPANDER"
            define in the compiler preprocessor configuration (or any header file that
            is processed before stm32756g_eval.h).
            On the STM327x6G-EVAL RevB LED1 and LED2 are directly mapped on GPIO pins,
            to avoid the unnecessary overhead of code brought by the use of MFX IO
            expander when no further evaluation board resources are needed by the
            application/example.
            For precise details on the use of the MFX IO expander, you can refer to
            the description provided within the stm32756g_eval_io.c file header
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 stm32756g_eval.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Enumerations | Functions
stm32756g_eval.h File Reference

This file contains definitions for STM32756G_EVAL and STM32746G_EVAL 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)2)
#define | LED1_GPIO_PORT GPIOF
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | LED1_PIN GPIO_PIN_10 /* To use LED1, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
#define | LED3_GPIO_PORT GPIOB
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | LED3_PIN GPIO_PIN_7 /* To use LED3, ensure that JP23 is in position 2-3, camera is then no more usable */
#define | MFX_IRQOUT_PIN GPIO_PIN_8
MFX_IRQOUt pin.
#define | MFX_IRQOUT_GPIO_PORT GPIOI
#define | MFX_IRQOUT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | MFX_IRQOUT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | MFX_IRQOUT_EXTI_IRQn EXTI9_5_IRQn
#define | BUTTONn ((uint8_t)3)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_13
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOC
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | TAMPER_BUTTON_PIN GPIO_PIN_13
Tamper push-button.
#define | TAMPER_BUTTON_GPIO_PORT GPIOC
#define | TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | KEY_BUTTON_PIN GPIO_PIN_13
Key push-button.
#define | KEY_BUTTON_GPIO_PORT GPIOC
#define | KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
#define | BUTTONx_GPIO_CLK_ENABLE(__INDEX__)
#define | BUTTONx_GPIO_CLK_DISABLE(__INDEX__)
#define | COMn ((uint8_t)1)
#define | EVAL_COM1 USART1
Definition for COM port1, connected to USART1.
#define | EVAL_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
#define | EVAL_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
#define | EVAL_COM1_TX_PIN GPIO_PIN_9
#define | EVAL_COM1_TX_GPIO_PORT GPIOA
#define | EVAL_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | EVAL_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | EVAL_COM1_TX_AF GPIO_AF7_USART1
#define | EVAL_COM1_RX_PIN GPIO_PIN_10
#define | EVAL_COM1_RX_GPIO_PORT GPIOA
#define | EVAL_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | EVAL_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | EVAL_COM1_RX_AF GPIO_AF7_USART1
#define | EVAL_COM1_IRQn USART1_IRQn
#define | EVAL_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0)
#define | EVAL_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0)
#define | EVAL_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
#define | EVAL_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0)
#define | ADCx ADC3
Definition for Potentiometer, connected to ADC3.
#define | ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE()
#define | ADCx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | ADCx_FORCE_RESET() __HAL_RCC_ADC_FORCE_RESET()
#define | ADCx_RELEASE_RESET() __HAL_RCC_ADC_RELEASE_RESET()
#define | ADCx_CHANNEL_PIN GPIO_PIN_10
#define | ADCx_CHANNEL_GPIO_PORT GPIOF
#define | ADCx_CHANNEL ADC_CHANNEL_8
#define | SAMPLINGTIME ADC_SAMPLETIME_3CYCLES
#define | ADCx_POLL_TIMEOUT 10
#define | IO_I2C_ADDRESS ((uint16_t)0x84) /*mfx MFX_I2C_ADDR 0*/
Joystick Pins definition.
#define | IO_I2C_ADDRESS_2 ((uint16_t)0x86) /*mfx MFX_I2C_ADDR 1*/
#define | TS_I2C_ADDRESS ((uint16_t)0x82) /*stmpe811 used on MB1046 board */
#define | TS3510_I2C_ADDRESS ((uint16_t)0x80)
#define | EXC7200_I2C_ADDRESS ((uint16_t)0x08)
#define | CAMERA_I2C_ADDRESS ((uint16_t)0x5A)
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x34)
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
#define | EVAL_I2Cx I2C1
#define | EVAL_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | EVAL_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | EVAL_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | EVAL_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | EVAL_I2Cx_SCL_PIN GPIO_PIN_8
#define | EVAL_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | EVAL_I2Cx_SDA_PIN GPIO_PIN_9
#define | EVAL_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | EVAL_I2Cx_ER_IRQn I2C1_ER_IRQn

Enumerations

enum | Led_TypeDef { LED1 = 0, LED_GREEN = LED1, LED3 = 1, LED_RED = LED3 }
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 STM32756G EVAL BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED on GPIO and/or on MFX.
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 *husart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
void | BSP_POTENTIOMETER_Init (void)
Init Potentiometer.
uint32_t | BSP_POTENTIOMETER_GetLevel (void)
Get Potentiometer level in 12 bits.

Detailed Description

This file contains definitions for STM32756G_EVAL and STM32746G_EVAL 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 stm32756g_eval.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_audio.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_audio.c File Reference

This file provides the Audio driver for the STM32756G-EVAL and STM32746G_EVAL evaluation board. More...

#include "stm32756g_eval_audio.h"

Go to the source code of this file.

Functions

static void | SAIx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static void | SAIx_DeInit (void)
Deinitializes the Audio Codec audio interface (SAI).
static void | I2Sx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (I2S)
static void | I2Sx_DeInit (void)
Deinitializes the Audio Codec audio interface (I2S).
static void | TIMx_IC_MspInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_IC_MspDeInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_Init (void)
Configure TIM as a clock divider by 2.
static void | TIMx_DeInit (void)
Configure TIM as a clock divider by 2.
static void | PDMDecoder_Init (uint32_t AudioFreq, uint32_t ChnlNbr)
Initializes the PDM library.
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_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
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.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
void | HAL_I2S_RxCpltCallback (I2S_HandleTypeDef *hi2s)
Rx Transfer completed callbacks.
void | HAL_I2S_RxHalfCpltCallback (I2S_HandleTypeDef *hi2s)
Rx Half Transfer completed callbacks.
void | HAL_I2S_ErrorCallback (I2S_HandleTypeDef *hi2s)
I2S error 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 (I2S_HandleTypeDef *hi2s, void *Params)
Initializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
__weak void | BSP_AUDIO_IN_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params)
Clock Config.

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai
I2S_HandleTypeDef | haudio_in_i2s
TIM_HandleTypeDef | haudio_tim
PDMFilter_InitStruct | Filter [2]
uint8_t | Channel_Demux [128]
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Detailed Description

This file provides the Audio driver for the STM32756G-EVAL and STM32746G_EVAL evaluation board.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   + This driver supports STM32F7xx devices on STM32756G-EVAL (MB1167) Evaluation boards.
   + Call the function BSP_AUDIO_OUT_Init(
                                    OutputDevice: physical output mode (OUTPUT_DEVICE_SPEAKER,
                                                  OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH)
                                    Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
                                    AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
                                                  this parameter is relative to the audio file/stream type.
                                   )
      This function configures all the hardware required for the audio application (codec, I2C, SAI,
      GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
      If the returned value is different from AUDIO_OK or the function is stuck then the communication with
      the codec 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 STM32756G-EVAL 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_EVAL_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 stm32756g_eval_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 stm32756g_eval_audio.h file.

  Driver architecture:
  --------------------
   + This driver provides the High Audio Layer: consists of the function API exported in the stm32756g_eval_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 stm32756g_eval_audio_codec.c file (I2Sx_Init(), I2Sx_DeInit(), SAIx_Init() and SAIx_DeInit())

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

© COPYRIGHT(c) 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 stm32756g_eval_audio.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_audio.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions | Variables
stm32756g_eval_audio.h File Reference

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

#include "../Components/wm8994/wm8994.h"
#include "stm32756g_eval.h"
#include "../../../Middlewares/ST/STM32_Audio/Addons/PDM/pdm_filter.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
CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode TDM format : +------------------|------------------|--------------------|-------------------+ | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | +------------------------------------------------------------------------------+.
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_SAIx SAI2_Block_B
#define | AUDIO_SAIx_CLK_ENABLE() __HAL_RCC_SAI2_CLK_ENABLE()
#define | AUDIO_SAIx_CLK_DISABLE() __HAL_RCC_SAI2_CLK_DISABLE()
#define | AUDIO_SAIx_SCK_AF GPIO_AF8_SAI2
#define | AUDIO_SAIx_FS_SD_MCLK_AF GPIO_AF10_SAI2
#define | AUDIO_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_MCLK_GPIO_PORT GPIOE
#define | AUDIO_SAIx_MCLK_PIN GPIO_PIN_6
#define | AUDIO_SAIx_SCK_SD_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | AUDIO_SAIx_SCK_SD_GPIO_PORT GPIOA
#define | AUDIO_SAIx_SCK_PIN GPIO_PIN_2
#define | AUDIO_SAIx_SD_PIN GPIO_PIN_0
#define | AUDIO_SAIx_FS_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_SAIx_FS_GPIO_PORT GPIOG
#define | AUDIO_SAIx_FS_PIN GPIO_PIN_9
#define | AUDIO_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_SAIx_DMAx_STREAM DMA2_Stream6
#define | AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_3
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Stream6_IRQn
#define | AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | DMA_MAX_SZE 0xFFFF
#define | AUDIO_SAIx_DMAx_IRQHandler DMA2_Stream6_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_I2Sx SPI3
#define | AUDIO_I2Sx_CLK_ENABLE() __HAL_RCC_SPI3_CLK_ENABLE()
#define | AUDIO_I2Sx_CLK_DISABLE() __HAL_RCC_SPI3_CLK_DISABLE()
#define | AUDIO_I2Sx_SCK_PIN GPIO_PIN_3
#define | AUDIO_I2Sx_SCK_GPIO_PORT GPIOB
#define | AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | AUDIO_I2Sx_SCK_AF GPIO_AF6_SPI3
#define | AUDIO_I2Sx_SD_PIN GPIO_PIN_6
#define | AUDIO_I2Sx_SD_GPIO_PORT GPIOD
#define | AUDIO_I2Sx_SD_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | AUDIO_I2Sx_SD_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | AUDIO_I2Sx_SD_AF GPIO_AF5_SPI3
#define | AUDIO_I2Sx_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | AUDIO_I2Sx_DMAx_CLK_DISABLE() __HAL_RCC_DMA1_CLK_DISABLE()
#define | AUDIO_I2Sx_DMAx_STREAM DMA1_Stream2
#define | AUDIO_I2Sx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_I2Sx_DMAx_IRQ DMA1_Stream2_IRQn
#define | AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
#define | AUDIO_I2Sx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
#define | AUDIO_I2Sx_DMAx_IRQHandler DMA1_Stream2_IRQHandler
#define | AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_TIMx_CLK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE()
#define | AUDIO_TIMx_CLK_DISABLE() __HAL_RCC_TIM3_CLK_DISABLE()
#define | AUDIO_TIMx TIM3
#define | AUDIO_TIMx_IN_CHANNEL TIM_CHANNEL_1
#define | AUDIO_TIMx_OUT_CHANNEL TIM_CHANNEL_2 /* Select channel 2 as output */
#define | AUDIO_TIMx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_TIMx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | AUDIO_TIMx_GPIO_PORT GPIOC
#define | AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_6
#define | AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_7
#define | AUDIO_TIMx_AF GPIO_AF2_TIM3
#define | AUDIODATA_SIZE 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 | INTERNAL_BUFF_SIZE (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
#define | PCM_OUT_SIZE (DEFAULT_AUDIO_IN_FREQ/1000*2)
#define | CHANNEL_DEMUX_MASK ((uint8_t)0x55)
#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.
void | BSP_AUDIO_OUT_TransferComplete_CallBack (void)
Manages the DMA full Transfer complete event.
void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
Manages the DMA Half Transfer complete event.
void | BSP_AUDIO_OUT_Error_CallBack (void)
Manages the DMA FIFO error event.
void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.
void | BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
Initializes BSP_AUDIO_OUT MSP.
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_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_Stop (void)
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.
uint8_t | BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
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 (I2S_HandleTypeDef *hi2s, void *Params)
Initializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
void | BSP_AUDIO_IN_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params)
Clock Config.

Variables

__IO uint16_t | AudioInVolume

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_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 stm32756g_eval_audio.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_camera.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_camera.c File Reference

This file includes the driver for Camera modules mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_camera.h"

Go to the source code of this file.

Functions

static uint32_t | GetSize (uint32_t resolution)
Get the capture size in pixels unit.
uint8_t | BSP_CAMERA_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_HwReset (void)
CANERA hardware reset.
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 | hDcmiEval
CAMERA_DrvTypeDef * | camera_drv
static uint32_t | CameraCurrentResolution
static uint32_t | CameraHwAddress

Detailed Description

This file includes the driver for Camera modules mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

Author:
MCD Application Team
  How to use this driver:
  -----------------------
   - This driver is used to drive the camera.
   - The S5K5CAG 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 stm32756g_eval_camera.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_camera.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Enumerations | Functions
stm32756g_eval_camera.h File Reference

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

#include "../Components/s5k5cag/s5k5cag.h"
#include "stm32756g_eval_io.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_HwReset (void)
CANERA hardware reset.
void | BSP_CAMERA_PwrDown (void)
CAMERA power down.
void | BSP_CAMERA_LineEventCallback (void)
Line Event callback.
void | BSP_CAMERA_VsyncEventCallback (void)
VSYNC Event callback.
void | BSP_CAMERA_FrameEventCallback (void)
Frame Event callback.
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.
void | BSP_CAMERA_IRQHandler (void)
void | BSP_CAMERA_DMA_IRQHandler (void)
void | BSP_CAMERA_MspInit (DCMI_HandleTypeDef *hdcmi, void *Params)
Initializes the DCMI MSP.
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 stm32756g_eval_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 stm32756g_eval_camera.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_eeprom.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_eeprom.c File Reference

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

#include "stm32756g_eval_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 STM32756G_EVAL
               and STM32746G_EVAL boards.
               To use this driver you have to connect the ANT7-M24LR-A to CN2
               connector of STM32756G_EVAL 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 stm32756g_eval.h file, and the initialization is
            performed in EEPROM_IO_Init() function declared in stm32756g_eval.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 stm32756g_eval_eeprom.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_eeprom.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions
stm32756g_eval_eeprom.h File Reference

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

#include "stm32756g_eval.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.
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 stm32756g_eval_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 stm32756g_eval_eeprom.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_io.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_io.c File Reference

This file provides a set of functions needed to manage the IO pins on STM32756G-EVAL and STM32746G-EVAL evaluation board. More...

#include "stm32756g_eval_io.h"

Go to the source code of this file.

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).
uint8_t | BSP_IO_DeInit (void)
DeInit allows Mfx Initialization to be executed again.
uint32_t | BSP_IO_ITGetStatus (uint32_t IoPin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (void)
Clears all the IO IT pending bits.
uint8_t | BSP_IO_ConfigPin (uint32_t IoPin, IO_ModeTypedef IoMode)
Configures the IO pin(s) according to IO mode structure value.
uint8_t | BSP_IO_ConfigIrqOutPin (uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
Sets the IRQ_OUT pin polarity and type.
void | BSP_IO_WritePin (uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IoPin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IoPin)
Toggles the selected pins state.

Variables

static IO_DrvTypeDef * | IoDrv = NULL
static uint8_t | mfxstm32l152Identifier

Detailed Description

This file provides a set of functions needed to manage the IO pins on STM32756G-EVAL and STM32746G-EVAL evaluation board.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the IO module of the STM32756G-EVAL evaluation
     board.
   - The MFXSTM32L152 IO expander device component driver must be included with this
     driver in order to run the IO functionalities commanded by the IO expander (MFX)
     device mounted on the evaluation board.

  Driver description:
  -------------------
  + Initialization steps:
     o Initialize the IO module using the BSP_IO_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       communication layer configuration to start the IO functionalities use.

  + IO functionalities use
     o The IO pin mode is configured when calling the function BSP_IO_ConfigPin(), you
       must specify the desired IO mode by choosing the "IO_ModeTypedef" parameter
       predefined value.
     o If an IO pin is used in interrupt mode, the function BSP_IO_ITGetStatus() is
       needed to get the interrupt status. To clear the IT pending bits, you should
       call the function BSP_IO_ITClear() with specifying the IO pending bit to clear.
     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.
     o The IRQ_OUT pin (common for all functionalities: JOY, SD, LEDs, etc)  can be
       configured using the function BSP_IO_ConfigIrqOutPin()
     o To get/set an IO pin combination state you can use the functions
       BSP_IO_ReadPin()/BSP_IO_WritePin() or the function BSP_IO_TogglePin() to toggle the pin
       state.
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 stm32756g_eval_io.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_io.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Enumerations | Functions
stm32756g_eval_io.h File Reference

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

#include "stm32756g_eval.h"
#include "../Components/mfxstm32l152/mfxstm32l152.h"

Go to the source code of this file.

Defines

#define | IO_PIN_0 ((uint32_t)0x0001)
#define | IO_PIN_1 ((uint32_t)0x0002)
#define | IO_PIN_2 ((uint32_t)0x0004)
#define | IO_PIN_3 ((uint32_t)0x0008)
#define | IO_PIN_4 ((uint32_t)0x0010)
#define | IO_PIN_5 ((uint32_t)0x0020)
#define | IO_PIN_6 ((uint32_t)0x0040)
#define | IO_PIN_7 ((uint32_t)0x0080)
#define | IO_PIN_8 ((uint32_t)0x0100)
#define | IO_PIN_9 ((uint32_t)0x0200)
#define | IO_PIN_10 ((uint32_t)0x0400)
#define | IO_PIN_11 ((uint32_t)0x0800)
#define | IO_PIN_12 ((uint32_t)0x1000)
#define | IO_PIN_13 ((uint32_t)0x2000)
#define | IO_PIN_14 ((uint32_t)0x4000)
#define | IO_PIN_15 ((uint32_t)0x8000)
#define | IO_PIN_16 ((uint32_t)0x010000)
#define | IO_PIN_17 ((uint32_t)0x020000)
#define | IO_PIN_18 ((uint32_t)0x040000)
#define | IO_PIN_19 ((uint32_t)0x080000)
#define | IO_PIN_20 ((uint32_t)0x100000)
#define | IO_PIN_21 ((uint32_t)0x200000)
#define | IO_PIN_22 ((uint32_t)0x400000)
#define | IO_PIN_23 ((uint32_t)0x800000)
#define | IO_PIN_ALL ((uint32_t)0xFFFFFF)

Enumerations

enum | BSP_IO_PinStateTypeDef { BSP_IO_PIN_RESET = 0, BSP_IO_PIN_SET = 1 }
enum | IO_StatusTypeDef { IO_OK = 0, IO_ERROR = 1, IO_TIMEOUT = 2 }

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (MFX, ...).
uint8_t | BSP_IO_DeInit (void)
DeInit allows Mfx Initialization to be executed again.
uint8_t | BSP_IO_ConfigIrqOutPin (uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
Sets the IRQ_OUT pin polarity and type.
uint32_t | BSP_IO_ITGetStatus (uint32_t IoPin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (void)
Clears all the IO IT pending bits.
uint8_t | BSP_IO_ConfigPin (uint32_t IoPin, IO_ModeTypedef IoMode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IoPin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IoPin)
Toggles the selected pins state.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_io.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 stm32756g_eval_io.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_lcd.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions | Variables
stm32756g_eval_lcd.c File Reference

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_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_InitEx (uint32_t PclkConfig)
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 layers.
void | BSP_LCD_SelectLayer (uint32_t LayerIndex)
Selects the LCD Layer.
void | BSP_LCD_SetLayerVisible (uint32_t LayerIndex, FunctionalState State)
Sets an LCD Layer visible.
void | BSP_LCD_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_Relaod (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 (32 bpp).
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 | hLtdcEval
static DMA2D_HandleTypeDef | hDma2dEval
static uint32_t | PCLK_profile = LCD_MAX_PCLK
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 STM32756G-EVAL and STM32746G-EVAL evaluation boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive directly an LCD TFT using the LTDC controller.
   - This driver selects dynamically the mounted LCD, AMPIRE 640x480 LCD mounted
     on MB1063 or AMPIRE 480x272 LCD mounted on MB1046 daughter board,
     and uses the adequate timing and setting for the specified LCD using
     device ID of the STMPE811 mounted on MB1046 daughter board.

  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 colour 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 whole 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 stm32756g_eval_lcd.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_lcd.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Data Structures | Defines | Typedefs | Enumerations | Functions
stm32756g_eval_lcd.h File Reference

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

#include "../Components/ampire640480/ampire640480.h"
#include "../Components/ampire480272/ampire480272.h"
#include "../Components/stmpe811/stmpe811.h"
#include "stm32756g_eval_sdram.h"
#include "stm32756g_eval.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_MAX_PCLK ((uint8_t)0x00)
LCD Layer_Number.
#define | LCD_MIN_PCLK ((uint8_t)0x01)
#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)

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_InitEx (uint32_t PclkConfig)
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 FrameBuffer)
Initializes the LCD layers.
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_Relaod (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 pixel)
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 (32 bpp).
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.
void | BSP_LCD_MspInit (LTDC_HandleTypeDef *hltdc, void *Params)
Initializes the LTDC MSP.
void | BSP_LCD_MspDeInit (LTDC_HandleTypeDef *hltdc, void *Params)
DeInitializes BSP_LCD MSP.
void | BSP_LCD_ClockConfig (LTDC_HandleTypeDef *hltdc, void *Params)
Clock Config.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_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 stm32756g_eval_lcd.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_nor.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_nor.c File Reference

This file includes a standard driver for the PC28F128M29EWLA NOR flash memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_nor.h"

Go to the source code of this file.

Functions

uint8_t | BSP_NOR_Init (void)
Initializes the NOR device.
uint8_t | BSP_NOR_DeInit (void)
DeInitializes the NOR device.
uint8_t | BSP_NOR_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the NOR device.
void | BSP_NOR_ReturnToReadMode (void)
Returns the NOR memory to read mode.
uint8_t | BSP_NOR_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data to the NOR device.
uint8_t | BSP_NOR_ProgramData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Programs an amount of data to the NOR device.
uint8_t | BSP_NOR_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the NOR device.
uint8_t | BSP_NOR_Erase_Chip (void)
Erases the entire NOR chip.
uint8_t | BSP_NOR_Read_ID (NOR_IDTypeDef *pNOR_ID)
Reads NOR flash IDs.
__weak void | BSP_NOR_MspInit (NOR_HandleTypeDef *hnor, void *Params)
Initializes the NOR MSP.
__weak void | BSP_NOR_MspDeInit (NOR_HandleTypeDef *hnor, void *Params)
DeInitializes NOR MSP.
void | HAL_NOR_MspWait (NOR_HandleTypeDef *hnor, uint32_t Timeout)
NOR BSP Wait for Ready/Busy signal.

Variables

static NOR_HandleTypeDef | norHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Detailed Description

This file includes a standard driver for the PC28F128M29EWLA NOR flash memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the PC28F128M29EWLA NOR flash external memory mounted
     on STM32756G-EVAL evaluation board.
   - This driver does not need a specific component driver for the NOR device
     to be included with.

  Driver description:
  ------------------
  + Initialization steps:
     o Initialize the NOR external memory using the BSP_NOR_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       FMC controller configuration to interface with the external NOR memory.

  + NOR flash operations
     o NOR 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_NOR_ReadData()/BSP_NOR_WriteData(). The BSP_NOR_WriteData() performs write operation
       of an amount of data by unit (halfword). You can also perform a program data
       operation of an amount of data using the function BSP_NOR_ProgramData().
     o The function BSP_NOR_Read_ID() returns the chip IDs stored in the structure
       "NOR_IDTypeDef". (see the NOR IDs in the memory data sheet)
     o Perform erase block operation using the function BSP_NOR_Erase_Block() and by
       specifying the block address. You can perform an erase operation of the whole
       chip by calling the function BSP_NOR_Erase_Chip().
     o After other operations, the function BSP_NOR_ReturnToReadMode() allows the NOR
       flash to return to read mode to perform read operations on it.
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 stm32756g_eval_nor.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_nor.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions
stm32756g_eval_nor.h File Reference

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

#include "stm32f7xx_hal.h"

Go to the source code of this file.

Defines

#define | NOR_STATUS_OK ((uint8_t)0x00)
NOR status structure definition.
#define | NOR_STATUS_ERROR ((uint8_t)0x01)
#define | NOR_DEVICE_ADDR ((uint32_t)0x60000000)
#define | NOR_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | NOR_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | NOR_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY
#define | BLOCKERASE_TIMEOUT ((uint32_t)0x00A00000) /* NOR block erase timeout */
#define | CHIPERASE_TIMEOUT ((uint32_t)0x30000000) /* NOR chip erase timeout */
#define | PROGRAM_TIMEOUT ((uint32_t)0x00004400) /* NOR program timeout */
#define | NOR_READY_BUSY_PIN GPIO_PIN_6
#define | NOR_READY_BUSY_GPIO GPIOD
#define | NOR_READY_STATE GPIO_PIN_SET
#define | NOR_BUSY_STATE GPIO_PIN_RESET

Functions

uint8_t | BSP_NOR_Init (void)
Initializes the NOR device.
uint8_t | BSP_NOR_DeInit (void)
DeInitializes the NOR device.
uint8_t | BSP_NOR_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the NOR device.
uint8_t | BSP_NOR_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data to the NOR device.
uint8_t | BSP_NOR_ProgramData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Programs an amount of data to the NOR device.
uint8_t | BSP_NOR_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the NOR device.
uint8_t | BSP_NOR_Erase_Chip (void)
Erases the entire NOR chip.
uint8_t | BSP_NOR_Read_ID (NOR_IDTypeDef *pNOR_ID)
Reads NOR flash IDs.
void | BSP_NOR_ReturnToReadMode (void)
Returns the NOR memory to read mode.
void | BSP_NOR_MspInit (NOR_HandleTypeDef *hnor, void *Params)
Initializes the NOR MSP.
void | BSP_NOR_MspDeInit (NOR_HandleTypeDef *hnor, void *Params)
DeInitializes NOR MSP.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_nor.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 stm32756g_eval_nor.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_qspi.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_qspi.c File Reference

This file includes a standard driver for the N25Q512A QSPI memory mounted on STM32756G-EVAL and STM32746G-EVAL board. More...

#include "stm32756g_eval_qspi.h"

Go to the source code of this file.

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_EnterFourBytesAddress (QSPI_HandleTypeDef *hqspi)
This function set the QSPI memory in 4-byte address mode.
static uint8_t | QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
This function configure the dummy cycles on memory side.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
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 N25Q512A QSPI memory mounted on STM32756G-EVAL and STM32746G-EVAL board.

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

   (#) This driver need a specific component driver (N25Q512A) 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 stm32756g_eval_qspi.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_qspi.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Data Structures | Defines | Functions
stm32756g_eval_qspi.h File Reference

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

#include "stm32f7xx_hal.h"
#include "../Components/n25q512a/n25q512a.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_GPIOF_CLK_ENABLE()
#define | QSPI_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_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_8
#define | QSPI_D0_GPIO_PORT GPIOF
#define | QSPI_D1_PIN GPIO_PIN_9
#define | QSPI_D1_GPIO_PORT GPIOF
#define | QSPI_D2_PIN GPIO_PIN_7
#define | QSPI_D2_GPIO_PORT GPIOF
#define | QSPI_D3_PIN GPIO_PIN_6
#define | QSPI_D3_GPIO_PORT GPIOF
#define | QSPI_FLASH_SIZE 25 /* 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 stm32756g_eval_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 stm32756g_eval_qspi.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sd.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_sd.c File Reference

This file includes the uSD card driver mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_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_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
static uint8_t | UseExtiModeDetection = 0

Detailed Description

This file includes the uSD card driver mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

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

  Driver description:
  ------------------
  + Initialization steps:
     o Initialize the micro SD card using the BSP_SD_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       SDIO interface configuration to interface with the external micro SD. It
       also includes the micro SD initialization sequence.
     o To check the SD card presence you can use the function BSP_SD_IsDetected() which
       returns the detection status
     o If SD presence detection interrupt mode is desired, you must configure the
       SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt
       is generated as an external interrupt whenever the micro SD card is
       plugged/unplugged in/from the evaluation board. The SD detection is managed by MFX,
       so the SD detection interrupt has to be treated by MFX_IRQOUT gpio pin IRQ handler.
     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 stm32756g_eval_sd.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sd.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions
stm32756g_eval_sd.h File Reference

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

#include "stm32f7xx_hal.h"
#include "stm32756g_eval_io.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(GPIO_PIN_8)

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.
void | BSP_SD_DetectIT (void)
void | BSP_SD_DetectCallback (void)
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
void | BSP_SD_AbortCallback (void)
BSP SD Abort callbacks.
void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callbacks.
void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callbacks.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_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 stm32756g_eval_sd.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sdram.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_sdram.c File Reference

This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_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 STM32756G-EVAL and STM32746G-EVAL evaluation boards.

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

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

  + SDRAM read/write operations
     o SDRAM external memory can be accessed with read/write operations once it is
       initialized.
       Read/write operation can be performed with AHB access using the functions
       BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by 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 stm32756g_eval_sdram.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sdram.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions
stm32756g_eval_sdram.h File Reference

This file contains the common defines and functions prototypes for the stm32756g_eval_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_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
#define | SDRAM_TIMEOUT ((uint32_t)0xFFFF)
#define | __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.
void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
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 stm32756g_eval_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 stm32756g_eval_sdram.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sram.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_sram.c File Reference

This file includes the SRAM driver for the IS61WV102416BLL-10M memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_sram.h"

Go to the source code of this file.

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_DeInit (void)
DeInitializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
__weak void | BSP_SRAM_MspInit (SRAM_HandleTypeDef *hsram, void *Params)
Initializes SRAM MSP.
__weak void | BSP_SRAM_MspDeInit (SRAM_HandleTypeDef *hsram, void *Params)
DeInitializes SRAM MSP.

Variables

SRAM_HandleTypeDef | sramHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Detailed Description

This file includes the SRAM driver for the IS61WV102416BLL-10M memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the IS61WV102416BLL-10M SRAM external memory mounted
     on STM32756G-EVAL evaluation board.
   - This driver does not need a specific component driver for the SRAM device
     to be included with.

  Driver description:
  ------------------
  + Initialization steps:
     o Initialize the SRAM external memory using the BSP_SRAM_Init() function. This
       function includes the MSP layer hardware resources initialization and the
       FMC controller configuration to interface with the external SRAM memory.

  + SRAM read/write operations
     o SRAM 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_SRAM_ReadData()/BSP_SRAM_WriteData(), or by DMA transfer using the functions
       BSP_SRAM_ReadData_DMA()/BSP_SRAM_WriteData_DMA().
     o The AHB access is performed with 16-bit width transaction, the DMA transfer
       configuration is fixed at single (no burst) halfword transfer
       (see the SRAM_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_SRAM_DMA_IRQHandler()
       is called in IRQ handler file, to serve the generated interrupt once the DMA
       transfer is complete.
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 stm32756g_eval_sram.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_sram.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Defines | Functions
stm32756g_eval_sram.h File Reference

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

#include "stm32f7xx_hal.h"

Go to the source code of this file.

Defines

#define | SRAM_OK ((uint8_t)0x00)
SRAM status structure definition.
#define | SRAM_ERROR ((uint8_t)0x01)
#define | SRAM_DEVICE_ADDR ((uint32_t)0x68000000)
#define | SRAM_DEVICE_SIZE ((uint32_t)0x200000) /* SRAM device size in MBytes */
#define | SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY
#define | __SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | __SRAM_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SRAM_DMAx_CHANNEL DMA_CHANNEL_0
#define | SRAM_DMAx_STREAM DMA2_Stream4
#define | SRAM_DMAx_IRQn DMA2_Stream4_IRQn
#define | BSP_SRAM_DMA_IRQHandler DMA2_Stream4_IRQHandler

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_DeInit (void)
DeInitializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
void | BSP_SRAM_MspInit (SRAM_HandleTypeDef *hsram, void *Params)
Initializes SRAM MSP.
void | BSP_SRAM_MspDeInit (SRAM_HandleTypeDef *hsram, void *Params)
DeInitializes SRAM MSP.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_sram.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 stm32756g_eval_sram.h.


STM32756G_EVAL BSP User Manual: stm32756g_eval_ts.c File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Functions | Variables
stm32756g_eval_ts.c File Reference

This file provides a set of functions needed to manage the Touch Screen on STM32756G-EVAL and STM32746G-EVAL evaluation boards. More...

#include "stm32756g_eval_ts.h"
#include "stm32756g_eval_io.h"

Go to the source code of this file.

Functions

uint8_t | BSP_TS_Init (uint16_t xSize, uint16_t ySize)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, 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.
void | BSP_TS_ITClear (void)
Clears all touch screen interrupts.

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 STM32756G-EVAL and STM32746G-EVAL evaluation boards.

Author:
MCD Application Team
  How To use this driver:
  -----------------------
   - This driver is used to drive the touch screen module of the STM32756G-EVAL
     evaluation board on the AMPIRE 640x480 LCD mounted on MB1063 or AMPIRE
     480x272 LCD mounted on MB1046 daughter board.
   - If the AMPIRE 640x480 LCD is used, the TS3510 or EXC7200 component driver
     must be included according to the touch screen driver present on this board.
   - If the AMPIRE 480x272 LCD is used, the STMPE811 IO expander device component
     driver must be included in order to run the TS module commanded by the IO
     expander device, the MFXSTM32L152 IO expander device component driver must be
     also included in case of interrupt mode use of the TS.

  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 stm32756g_eval_ts.c.


STM32756G_EVAL BSP User Manual: stm32756g_eval_ts.h File Reference

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
Data Structures | Defines | Enumerations | Functions
stm32756g_eval_ts.h File Reference

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

#include "stm32756g_eval.h"
#include "../Components/stmpe811/stmpe811.h"
#include "../Components/ts3510/ts3510.h"
#include "../Components/exc7200/exc7200.h"

Go to the source code of this file.

Data Structures

struct | TS_StateTypeDef

Defines

#define | TS_SWAP_NONE ((uint8_t)0x00)
#define | TS_SWAP_X ((uint8_t)0x01)
#define | TS_SWAP_Y ((uint8_t)0x02)
#define | TS_SWAP_XY ((uint8_t)0x04)
#define | TS_INT_PIN LCD_INT_PIN

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02 }

Functions

uint8_t | BSP_TS_Init (uint16_t xSize, uint16_t ySize)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, 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_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.

Detailed Description

This file contains the common defines and functions prototypes for the stm32756g_eval_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 stm32756g_eval_ts.h.


STM32756G_EVAL 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


STM32756G_EVAL 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


STM32756G_EVAL BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32756G_EVAL/Trunk/Drivers/BSP/ Directory Reference

  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32756G_EVAL


STM32756G_EVAL BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32756G_EVAL/Trunk/Drivers/ Directory Reference

  • Drivers
Drivers Directory Reference

Directories

directory BSP


STM32756G_EVAL BSP User Manual: C:/WORK/BSP/SVN/Boards/STM32756G_EVAL/Trunk/Drivers/BSP/STM32756G_EVAL/ Directory Reference

  • Drivers
  • BSP
  • STM32756G_EVAL
STM32756G_EVAL Directory Reference

Files

file | stm32756g_eval.c [code]

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

file | stm32756g_eval.h [code]

This file contains definitions for STM32756G_EVAL and STM32746G_EVAL LEDs, push-buttons and COM ports hardware resources.

file | stm32756g_eval_audio.c [code]

This file provides the Audio driver for the STM32756G-EVAL and STM32746G_EVAL evaluation board.

file | stm32756g_eval_audio.h [code]

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

file | stm32756g_eval_camera.c [code]

This file includes the driver for Camera modules mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_camera.h [code]

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

file | stm32756g_eval_eeprom.c [code]

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

file | stm32756g_eval_eeprom.h [code]

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

file | stm32756g_eval_io.c [code]

This file provides a set of functions needed to manage the IO pins on STM32756G-EVAL and STM32746G-EVAL evaluation board.

file | stm32756g_eval_io.h [code]

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

file | stm32756g_eval_lcd.c [code]

This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_lcd.h [code]

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

file | stm32756g_eval_nor.c [code]

This file includes a standard driver for the PC28F128M29EWLA NOR flash memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_nor.h [code]

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

file | stm32756g_eval_qspi.c [code]

This file includes a standard driver for the N25Q512A QSPI memory mounted on STM32756G-EVAL and STM32746G-EVAL board.

file | stm32756g_eval_qspi.h [code]

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

file | stm32756g_eval_sd.c [code]

This file includes the uSD card driver mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_sd.h [code]

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

file | stm32756g_eval_sdram.c [code]

This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_sdram.h [code]

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

file | stm32756g_eval_sram.c [code]

This file includes the SRAM driver for the IS61WV102416BLL-10M memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_sram.h [code]

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

file | stm32756g_eval_ts.c [code]

This file provides a set of functions needed to manage the Touch Screen on STM32756G-EVAL and STM32746G-EVAL evaluation boards.

file | stm32756g_eval_ts.h [code]

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


STM32756G_EVAL BSP User Manual: Directories

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


STM32756G_EVAL BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32756g_eval.c [code] | This file provides a set of firmware functions to manage LEDs, push-buttons and COM ports available on STM32756G-EVAL and STM32746G-EVAL evaluation board(MB1167) from STMicroelectronics
stm32756g_eval.h [code] | This file contains definitions for STM32756G_EVAL and STM32746G_EVAL LEDs, push-buttons and COM ports hardware resources
stm32756g_eval_audio.c [code] | This file provides the Audio driver for the STM32756G-EVAL and STM32746G_EVAL evaluation board
stm32756g_eval_audio.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_audio.c driver
stm32756g_eval_camera.c [code] | This file includes the driver for Camera modules mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_camera.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_camera.c driver
stm32756g_eval_eeprom.c [code] | This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory
stm32756g_eval_eeprom.h [code] | This file contains all the functions prototypes for the stm32756g_eval_eeprom.c firmware driver
stm32756g_eval_io.c [code] | This file provides a set of functions needed to manage the IO pins on STM32756G-EVAL and STM32746G-EVAL evaluation board
stm32756g_eval_io.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_io.c driver
stm32756g_eval_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_lcd.c driver
stm32756g_eval_nor.c [code] | This file includes a standard driver for the PC28F128M29EWLA NOR flash memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_nor.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_nor.c driver
stm32756g_eval_qspi.c [code] | This file includes a standard driver for the N25Q512A QSPI memory mounted on STM32756G-EVAL and STM32746G-EVAL board
stm32756g_eval_qspi.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_qspi.c driver
stm32756g_eval_sd.c [code] | This file includes the uSD card driver mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_sd.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_sd.c driver
stm32756g_eval_sdram.c [code] | This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_sdram.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_sdram.c driver
stm32756g_eval_sram.c [code] | This file includes the SRAM driver for the IS61WV102416BLL-10M memory device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_sram.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_sram.c driver
stm32756g_eval_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32756G-EVAL and STM32746G-EVAL evaluation boards
stm32756g_eval_ts.h [code] | This file contains the common defines and functions prototypes for the stm32756g_eval_ts.c driver


STM32756G_EVAL BSP User Manual: BSP

Modules
BSP

Modules

EVAL


STM32756G_EVAL BSP User Manual: EVAL

Modules
EVAL
BSP

Modules

STM32756G-EVAL LOW LEVEL
STM32756G_EVAL AUDIO

This file includes the low layer driver for wm8994 Audio Codec available on STM32756G-EVAL evaluation board(MB1167).

STM32756G_EVAL CAMERA
STM32756G_EVAL EEPROM

This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.

STM32756G_EVAL IO
STM32756G_EVAL LCD
STM32756G_EVAL NOR
STM32756G-EVAL QSPI
STM32756G_EVAL SD
STM32756G_EVAL SDRAM
STM32756G_EVAL SRAM
STM32756G_EVAL TS


STM32756G_EVAL BSP User Manual: STM32756G_EVAL AUDIO

Modules
STM32756G_EVAL AUDIO
EVAL

This file includes the low layer driver for wm8994 Audio Codec available on STM32756G-EVAL evaluation board(MB1167). More...

Modules

STM32756G_EVAL_AUDIO Private Types
STM32756G_EVAL_AUDIO Private Defines
STM32756G_EVAL_AUDIO Private Macros
STM32756G_EVAL_AUDIO Private Variables
STM32756G_EVAL_AUDIO Private Function Prototypes
STM32756G_EVAL_AUDIO_Out Private Functions
STM32756G_EVAL_AUDIO Exported Types
STM32756G_EVAL_AUDIO Exported Constants
STM32756G_EVAL_AUDIO Exported Variables
STM32756G_EVAL_AUDIO Exported Macros
STM32756G_EVAL_AUDIO_OUT Exported Functions
STM32756G_EVAL_AUDIO_IN Exported Functions

Detailed Description

This file includes the low layer driver for wm8994 Audio Codec available on STM32756G-EVAL evaluation board(MB1167).


STM32756G_EVAL BSP User Manual: STM32756G_EVAL CAMERA

Modules
STM32756G_EVAL CAMERA
EVAL

Modules

CAMERA Private TypesDefinitions
CAMERA Private Defines
CAMERA Private Macros
CAMERA Private Variables
CAMERA Private Functions Prototypes
CAMERA Private Functions
CAMERA Exported Types
CAMERA Exported Constants
CAMERA Exported Functions


STM32756G_EVAL BSP User Manual: STM32756G_EVAL EEPROM

Modules
STM32756G_EVAL EEPROM
EVAL

This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board. More...

Modules

EEPROM Private Types
EEPROM Private Defines
EEPROM Private Macros
EEPROM Private Variables
EEPROM Private Functions Prototypes
EEPROM Private Functions
EEPROM Exported Types
EEPROM Exported Constants
EEPROM Exported Macros
EEPROM Exported Functions

Detailed Description

This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.


STM32756G_EVAL BSP User Manual: STM32756G_EVAL IO

Modules
STM32756G_EVAL IO
EVAL

Modules

IO Private Types Definitions
IO Private Defines
IO Private Macros
IO Private Variables
IO Private Functions Prototypes
IO Private Functions
IO Exported Types
IO Exported Constants
IO Exported Macro
IO Exported Functions


STM32756G_EVAL BSP User Manual: STM32756G_EVAL LCD

Modules
STM32756G_EVAL LCD
EVAL

Modules

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


STM32756G_EVAL BSP User Manual: STM32756G-EVAL LOW LEVEL

Modules
STM32756G-EVAL LOW LEVEL
EVAL

Modules

STM32756G-EVAL LOW LEVEL Private Types Definitions
STM32756G-EVAL LOW LEVEL Private Defines
STM32756G-EVAL LOW LEVEL Private Macros
STM32756G-EVAL LOW LEVEL Private Variables
STM32756G_EVAL LOW LEVEL Private Function Prototypes
STM32756G_EVAL LOW LEVEL Private Functions
LEVEL Exported Types
LOW LEVEL Exported Constants
LOW LEVEL Exported Macros
LOW LEVEL Exported Functions


STM32756G_EVAL BSP User Manual: STM32756G-EVAL QSPI

Modules
STM32756G-EVAL QSPI
EVAL

Modules

Private Variables
Private Functions
Exported Functions
Exported Constants
Exported Types


STM32756G_EVAL BSP User Manual: Exported Types

Data Structures
Exported Types
STM32756G-EVAL QSPI

Data Structures

struct QSPI_Info


STM32756G_EVAL BSP User Manual: STM32756G_EVAL SDRAM

Modules
STM32756G_EVAL SDRAM
EVAL

Modules

SDRAM Private Types Definitions
SDRAM Private Defines
SDRAM Private Macros
SDRAM Private Variables
SDRAM Private Functions Prototypes
SDRAM Private Functions
SDRAM Exported Types
SDRAM Exported Macro
SDRAM Exported Functions


STM32756G_EVAL BSP User Manual: STM32756G_EVAL SRAM

Modules
STM32756G_EVAL SRAM
EVAL

Modules

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


STM32756G_EVAL BSP User Manual: STM32756G_EVAL TS

Modules
STM32756G_EVAL TS
EVAL

Modules

TS Private Types Definitions
TS Private Defines
TS Private Macros
TS Private Variables
TS Private Functions Prototypes
TS Private Functions
TS Exported Types
TS Exported Constants
TS Exported Macros
TS Exported Functions


STM32756G_EVAL BSP User Manual: TS Exported Types

Data Structures
TS Exported Types
STM32756G_EVAL TS

Data Structures

struct TS_StateTypeDef


STM32756G_EVAL BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • EVAL
      • STM32756G-EVAL LOW LEVEL
        • STM32756G-EVAL LOW LEVEL Private Types Definitions
        • STM32756G-EVAL LOW LEVEL Private Defines
        • STM32756G-EVAL LOW LEVEL Private Macros
        • STM32756G-EVAL LOW LEVEL Private Variables
        • STM32756G_EVAL LOW LEVEL Private Function Prototypes
        • STM32756G_EVAL LOW LEVEL Private Functions
        • LEVEL Exported Types
        • LOW LEVEL Exported Constants
          • STM32756G_EVAL_LOW_LEVEL_LED
          • STM32756G_EVAL_LOW_LEVEL_BUTTON
          • STM32756G_EVAL_LOW_LEVEL_COM
        • LOW LEVEL Exported Macros
        • LOW LEVEL Exported Functions
      • STM32756G_EVAL AUDIO
        • STM32756G_EVAL_AUDIO Private Types
        • STM32756G_EVAL_AUDIO Private Defines
        • STM32756G_EVAL_AUDIO Private Macros
        • STM32756G_EVAL_AUDIO Private Variables
        • STM32756G_EVAL_AUDIO Private Function Prototypes
        • STM32756G_EVAL_AUDIO_Out Private Functions
        • STM32756G_EVAL_AUDIO Exported Types
        • STM32756G_EVAL_AUDIO Exported Constants
        • STM32756G_EVAL_AUDIO Exported Variables
        • STM32756G_EVAL_AUDIO Exported Macros
        • STM32756G_EVAL_AUDIO_OUT Exported Functions
        • STM32756G_EVAL_AUDIO_IN Exported Functions
      • STM32756G_EVAL CAMERA
        • CAMERA Private TypesDefinitions
        • CAMERA Private Defines
        • CAMERA Private Macros
        • CAMERA Private Variables
        • CAMERA Private Functions Prototypes
        • CAMERA Private Functions
        • CAMERA Exported Types
        • CAMERA Exported Constants
        • CAMERA Exported Functions
      • STM32756G_EVAL EEPROM
        • EEPROM Private Types
        • EEPROM Private Defines
        • EEPROM Private Macros
        • EEPROM Private Variables
        • EEPROM Private Functions Prototypes
        • EEPROM Private Functions
        • EEPROM Exported Types
        • EEPROM Exported Constants
        • EEPROM Exported Macros
        • EEPROM Exported Functions
      • STM32756G_EVAL IO
        • IO Private Types Definitions
        • IO Private Defines
        • IO Private Macros
        • IO Private Variables
        • IO Private Functions Prototypes
        • IO Private Functions
        • IO Exported Types
        • IO Exported Constants
        • IO Exported Macro
        • IO Exported Functions
      • STM32756G_EVAL LCD
        • LCD Private TypesDefinitions
        • LCD Private Defines
        • LCD Private Macros
        • LCD Private Variables
        • LCD Private FunctionPrototypes
        • LCD Private Functions
        • LCD Exported Types
        • LCD Exported Constants
        • LCD Exported Functions
      • STM32756G_EVAL NOR
        • NOR Private Types Definitions
        • NOR Private Defines
        • NOR Private Macros
        • NOR Private Variables
        • NOR Private Functions Prototypes
        • NOR Private Functions
        • NOR Exported Types
        • NOR Exported Constants
        • NOR Exported Macro
        • NOR Exported Functions
      • STM32756G-EVAL QSPI
        • Private Variables
        • Private Functions
        • Exported Functions
        • Exported Constants
        • Exported Types
      • STM32756G_EVAL SD
        • SD Private TypesDefinitions
        • SD Private Defines
        • SD Private Macros
        • SD Private Variables
        • SD Private Functions Prototypes
        • SD Private Functions
        • SD Exported Types
        • SD Exported Constants
        • SD Exported Macro
        • SD Exported Functions
      • STM32756G_EVAL SDRAM
        • SDRAM Private Types Definitions
        • SDRAM Private Defines
        • SDRAM Private Macros
        • SDRAM Private Variables
        • SDRAM Private Functions Prototypes
        • SDRAM Private Functions
        • SDRAM Exported Types
          • SDRAM Exported Constants
        • SDRAM Exported Macro
        • SDRAM Exported Functions
      • STM32756G_EVAL SRAM
        • SRAM Private Types Definitions
        • SRAM Private Defines
        • SRAM Private Macros
        • SRAM Private Variables
        • SRAM Private Function Prototypes
        • SRAM Private Functions
        • SRAM Exported Types
        • SRAM Exported Constants
        • SRAM Exported Macro
        • SRAM Exported Functions
      • STM32756G_EVAL TS
        • TS Private Types Definitions
        • TS Private Defines
        • TS Private Macros
        • TS Private Variables
        • TS Private Functions Prototypes
        • TS Private Functions
        • TS Exported Types
        • TS Exported Constants
        • TS Exported Macros
        • TS Exported Functions


STM32756G_EVAL BSP User Manual: stm32756g_eval.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval.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 STM32756G-EVAL and STM32746G-EVAL
00007   *          evaluation board(MB1167) from STMicroelectronics.
00008   *
00009   @verbatim
00010             This driver requires the stm32756g_eval_io.c/.h files to manage the
00011             IO module resources mapped on the MFX IO expander.
00012             These resources are mainly LEDs, Joystick push buttons, SD detect pin,
00013             USB OTG power switch/over current drive pins, Camera plug pin, Audio
00014             INT pin
00015             The use of the above eval resources is conditioned by the "USE_IOEXPANDER"
00016             preprocessor define which is enabled by default for the STM327x6G-EVAL
00017             boards Rev A. However for Rev B boards these resources are disabled by default
00018             (except LED1 and LED2) and to be able to use them, user must add "USE_IOEXPANDER"
00019             define in the compiler preprocessor configuration (or any header file that
00020             is processed before stm32756g_eval.h).
00021             On the STM327x6G-EVAL RevB LED1 and LED2 are directly mapped on GPIO pins,
00022             to avoid the unnecessary overhead of code brought by the use of MFX IO
00023             expander when no further evaluation board resources are needed by the
00024             application/example.
00025             For precise details on the use of the MFX IO expander, you can refer to
00026             the description provided within the stm32756g_eval_io.c file header
00027   @endverbatim
00028   ******************************************************************************
00029   * @attention
00030   *
00031   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00032   *
00033   * Redistribution and use in source and binary forms, with or without modification,
00034   * are permitted provided that the following conditions are met:
00035   *   1. Redistributions of source code must retain the above copyright notice,
00036   *      this list of conditions and the following disclaimer.
00037   *   2. Redistributions in binary form must reproduce the above copyright notice,
00038   *      this list of conditions and the following disclaimer in the documentation
00039   *      and/or other materials provided with the distribution.
00040   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00041   *      may be used to endorse or promote products derived from this software
00042   *      without specific prior written permission.
00043   *
00044   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00045   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00046   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00047   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00048   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00049   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00050   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00051   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00052   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00053   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00054   *
00055   ******************************************************************************
00056   */
00057
00058 /* Dependencies
00059 - stm32756g_eval_io.c
00060 - stm32f7xx_hal_cortex.c
00061 - stm32f7xx_hal_gpio.c
00062 - stm32f7xx_hal_uart.c
00063 - stm32f7xx_hal_i2c.c
00064 - stm32f7xx_hal_adc.c
00065 EndDependencies */
00066
00067 /* Includes ------------------------------------------------------------------*/
00068 #include "stm32756g_eval.h"
00069 #if defined(USE_IOEXPANDER)
00070 #include "stm32756g_eval_io.h"
00071 #endif /* USE_IOEXPANDER */
00072
00073 /** @addtogroup BSP
00074   * @{
00075   */
00076
00077 /** @defgroup STM32756G_EVAL EVAL
00078   * @{
00079   */
00080
00081 /** @defgroup STM32756G_EVAL_LOW_LEVEL STM32756G-EVAL LOW LEVEL
00082   * @{
00083   */
00084
00085 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_TypesDefinitions STM32756G-EVAL LOW LEVEL Private Types Definitions
00086   * @{
00087   */
00088 /**
00089   * @}
00090   */
00091
00092 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Defines STM32756G-EVAL LOW LEVEL Private Defines
00093   * @{
00094   */
00095 /**
00096  * @brief STM32756G EVAL BSP Driver version number V2.0.1
00097    */
00098 #define __STM32756G_EVAL_BSP_VERSION_MAIN   (0x02) /*!< [31:24] main version */
00099 #define __STM32756G_EVAL_BSP_VERSION_SUB1   (0x00) /*!< [23:16] sub1 version */
00100 #define __STM32756G_EVAL_BSP_VERSION_SUB2   (0x01) /*!< [15:8]  sub2 version */
00101 #define __STM32756G_EVAL_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00102 #define __STM32756G_EVAL_BSP_VERSION         ((__STM32756G_EVAL_BSP_VERSION_MAIN << 24)\
00103                                              |(__STM32756G_EVAL_BSP_VERSION_SUB1 << 16)\
00104                                              |(__STM32756G_EVAL_BSP_VERSION_SUB2 << 8 )\
00105                                              |(__STM32756G_EVAL_BSP_VERSION_RC))
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Macros STM32756G-EVAL LOW LEVEL Private Macros
00111   * @{
00112   */
00113 /**
00114   * @}
00115   */
00116
00117 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Variables STM32756G-EVAL LOW LEVEL Private Variables
00118   * @{
00119   */
00120
00121 #if defined(USE_IOEXPANDER)
00122 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00123                                  LED2_PIN,
00124                                  LED3_PIN,
00125                                  LED4_PIN};
00126 #else
00127 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00128                                  LED3_PIN};
00129 #endif /* USE_IOEXPANDER */
00130
00131
00132 GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT,
00133                                       TAMPER_BUTTON_GPIO_PORT,
00134                                       KEY_BUTTON_GPIO_PORT};
00135
00136 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN,
00137                                       TAMPER_BUTTON_PIN,
00138                                       KEY_BUTTON_PIN};
00139
00140 const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn,
00141                                        TAMPER_BUTTON_EXTI_IRQn,
00142                                        KEY_BUTTON_EXTI_IRQn};
00143
00144 USART_TypeDef* COM_USART[COMn] = {EVAL_COM1};
00145
00146 GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT};
00147
00148 GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT};
00149
00150 const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN};
00151
00152 const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN};
00153
00154 const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF};
00155
00156 const uint16_t COM_RX_AF[COMn] = {EVAL_COM1_RX_AF};
00157
00158 static I2C_HandleTypeDef hEvalI2c;
00159 static ADC_HandleTypeDef hEvalADC;
00160 /**
00161   * @}
00162   */
00163
00164 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_FunctionPrototypes  STM32756G_EVAL LOW LEVEL Private Function Prototypes
00165   * @{
00166   */
00167 static void     I2Cx_MspInit(void);
00168 static void     I2Cx_Init(void);
00169 #if defined(USE_IOEXPANDER)
00170 static void     I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00171 static uint8_t  I2Cx_Read(uint8_t Addr, uint8_t Reg);
00172 #endif /* USE_IOEXPANDER */
00173
00174 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00175 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00176 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00177 static void     I2Cx_Error(uint8_t Addr);
00178
00179 #if defined(USE_IOEXPANDER)
00180 /* IOExpander IO functions */
00181 void            IOE_Init(void);
00182 void            IOE_ITConfig(void);
00183 void            IOE_Delay(uint32_t Delay);
00184 void            IOE_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00185 uint8_t         IOE_Read(uint8_t Addr, uint8_t Reg);
00186 uint16_t        IOE_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00187 void            IOE_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00188
00189 /* MFX IO functions */
00190 void            MFX_IO_Init(void);
00191 void            MFX_IO_DeInit(void);
00192 void            MFX_IO_ITConfig(void);
00193 void            MFX_IO_Delay(uint32_t Delay);
00194 void            MFX_IO_Write(uint16_t Addr, uint8_t Reg, uint8_t Value);
00195 uint8_t         MFX_IO_Read(uint16_t Addr, uint8_t Reg);
00196 uint16_t        MFX_IO_ReadMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00197 void            MFX_IO_Wakeup(void);
00198 void            MFX_IO_EnableWakeupPin(void);
00199 #endif /* USE_IOEXPANDER */
00200
00201 /* AUDIO IO functions */
00202 void            AUDIO_IO_Init(void);
00203 void            AUDIO_IO_DeInit(void);
00204 void            AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00205 uint16_t        AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
00206 void            AUDIO_IO_Delay(uint32_t Delay);
00207
00208 /* CAMERA IO functions */
00209 void            CAMERA_IO_Init(void);
00210 void            CAMERA_Delay(uint32_t Delay);
00211 void            CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00212 uint16_t        CAMERA_IO_Read(uint8_t Addr, uint16_t Reg);
00213
00214 /* I2C EEPROM IO function */
00215 void                EEPROM_IO_Init(void);
00216 HAL_StatusTypeDef   EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00217 HAL_StatusTypeDef   EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00218 HAL_StatusTypeDef   EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00219 /**
00220   * @}
00221   */
00222
00223 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Functions STM32756G_EVAL LOW LEVEL Private Functions
00224   * @{
00225   */
00226
00227   /**
00228   * @brief  This method returns the STM32756G EVAL BSP Driver revision
00229   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00230   */
00231 uint32_t BSP_GetVersion(void)
00232 {
00233   return __STM32756G_EVAL_BSP_VERSION;
00234 }
00235
00236 /**
00237   * @brief  Configures LED on GPIO and/or on MFX.
00238   * @param  Led: LED to be configured.
00239   *          This parameter can be one of the following values:
00240   *            @arg  LED1
00241   *            @arg  LED2
00242   *            @arg  LED3
00243   *            @arg  LED4
00244   * @retval None
00245   */
00246 void BSP_LED_Init(Led_TypeDef Led)
00247 {
00248 #if !defined(USE_STM32756G_EVAL_REVA)
00249   /* On RevB and above evaluation boards, LED1 and LED3 are connected to GPIOs */
00250   /* To use LED1 on RevB board, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
00251   /* To use LED3 on RevB board, ensure that JP23 is in position 2-3, camera is then no more usable */
00252   GPIO_InitTypeDef  gpio_init_structure;
00253   GPIO_TypeDef*     gpio_led;
00254
00255   if ((Led == LED1) || (Led == LED3))
00256   {
00257     if (Led == LED1)
00258     {
00259       gpio_led = LED1_GPIO_PORT;
00260       /* Enable the GPIO_LED clock */
00261       LED1_GPIO_CLK_ENABLE();
00262     }
00263     else
00264     {
00265       gpio_led = LED3_GPIO_PORT;
00266       /* Enable the GPIO_LED clock */
00267       LED3_GPIO_CLK_ENABLE();
00268     }
00269
00270     /* Configure the GPIO_LED pin */
00271     gpio_init_structure.Pin = GPIO_PIN[Led];
00272     gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
00273     gpio_init_structure.Pull = GPIO_PULLUP;
00274     gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00275
00276     HAL_GPIO_Init(gpio_led, &gpio_init_structure);
00277
00278     /* By default, turn off LED */
00279     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
00280   }
00281   else
00282   {
00283 #endif /* !USE_STM32756G_EVAL_REVA */
00284
00285 #if defined(USE_IOEXPANDER)
00286   /* On RevA eval board, all LEDs are connected to MFX */
00287   /* On RevB and above eval board, LED2 and LED4 are connected to MFX */
00288   BSP_IO_Init();        /* Initialize MFX */
00289   BSP_IO_ConfigPin(GPIO_PIN[Led], IO_MODE_OUTPUT_PP_PU);
00290   BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_SET);
00291 #endif  /* USE_IOEXPANDER */
00292
00293 #if !defined(USE_STM32756G_EVAL_REVA)
00294   }
00295 #endif /* !USE_STM32756G_EVAL_REVA */
00296 }
00297
00298
00299 /**
00300   * @brief  DeInit LEDs.
00301   * @param  Led: LED to be configured.
00302   *          This parameter can be one of the following values:
00303   *            @arg  LED1
00304   *            @arg  LED2
00305   *            @arg  LED3
00306   *            @arg  LED4
00307   * @note Led DeInit does not disable the GPIO clock nor disable the Mfx
00308   * @retval None
00309   */
00310 void BSP_LED_DeInit(Led_TypeDef Led)
00311 {
00312 #if !defined(USE_STM32756G_EVAL_REVA)
00313   GPIO_InitTypeDef  gpio_init_structure;
00314   GPIO_TypeDef*     gpio_led;
00315
00316   /* On RevB led1 and Led3 are on GPIO while Led2 and Led4 on Mfx*/
00317   if ((Led == LED1) || (Led == LED3))
00318   {
00319     if (Led == LED1)
00320     {
00321       gpio_led = LED1_GPIO_PORT;
00322     }
00323     else
00324     {
00325       gpio_led = LED3_GPIO_PORT;
00326     }
00327     /* Turn off LED */
00328     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00329     /* Configure the GPIO_LED pin */
00330     gpio_init_structure.Pin = GPIO_PIN[Led];
00331     HAL_GPIO_DeInit(gpio_led, gpio_init_structure.Pin);
00332   }
00333   else
00334   {
00335 #endif /* !USE_STM32756G_EVAL_REVA */
00336
00337 #if defined(USE_IOEXPANDER)   /* (USE_IOEXPANDER always defined for RevA) */
00338     /* GPIO_PIN[Led]  depends on the board revision: */
00339     /*  - in case of RevA all leds are deinit  */
00340     /*  - in case of RevB just led 2 and led4 are deinit */
00341     BSP_IO_ConfigPin(GPIO_PIN[Led], IO_MODE_OFF);
00342 #endif /* USE_IOEXPANDER */
00343
00344 #if !defined(USE_STM32756G_EVAL_REVA)
00345   }
00346 #endif /* !USE_STM32756G_EVAL_REVA */
00347 }
00348
00349 /**
00350   * @brief  Turns selected LED On.
00351   * @param  Led: LED to be set on
00352   *          This parameter can be one of the following values:
00353   *            @arg  LED1
00354   *            @arg  LED2
00355   *            @arg  LED3
00356   *            @arg  LED4
00357   * @retval None
00358   */
00359 void BSP_LED_On(Led_TypeDef Led)
00360 {
00361 #if !defined(USE_STM32756G_EVAL_REVA)
00362   GPIO_TypeDef*     gpio_led;
00363
00364   if ((Led == LED1) || (Led == LED3))   /* Switch On LED connected to GPIO */
00365   {
00366     if (Led == LED1)
00367     {
00368       gpio_led = LED1_GPIO_PORT;
00369     }
00370     else
00371     {
00372       gpio_led = LED3_GPIO_PORT;
00373     }
00374     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00375   }
00376   else
00377   {
00378 #endif /* !USE_STM32756G_EVAL_REVA */
00379
00380 #if defined(USE_IOEXPANDER)            /* Switch On LED connected to MFX */
00381       BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_RESET);
00382 #endif /* USE_IOEXPANDER */
00383
00384 #if !defined(USE_STM32756G_EVAL_REVA)
00385   }
00386 #endif /* !USE_STM32756G_EVAL_REVA */
00387 }
00388
00389 /**
00390   * @brief  Turns selected LED Off.
00391   * @param  Led: LED to be set off
00392   *          This parameter can be one of the following values:
00393   *            @arg  LED1
00394   *            @arg  LED2
00395   *            @arg  LED3
00396   *            @arg  LED4
00397   * @retval None
00398   */
00399 void BSP_LED_Off(Led_TypeDef Led)
00400 {
00401 #if !defined(USE_STM32756G_EVAL_REVA)
00402   GPIO_TypeDef*     gpio_led;
00403
00404   if ((Led == LED1) || (Led == LED3)) /* Switch Off LED connected to GPIO */
00405   {
00406     if (Led == LED1)
00407     {
00408       gpio_led = LED1_GPIO_PORT;
00409     }
00410     else
00411     {
00412       gpio_led = LED3_GPIO_PORT;
00413     }
00414     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
00415   }
00416   else
00417   {
00418 #endif /* !USE_STM32756G_EVAL_REVA */
00419
00420 #if defined(USE_IOEXPANDER)             /* Switch Off LED connected to MFX */
00421      BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_SET);
00422 #endif /* USE_IOEXPANDER */
00423
00424 #if !defined(USE_STM32756G_EVAL_REVA)
00425   }
00426 #endif /* !USE_STM32756G_EVAL_REVA */
00427
00428 }
00429
00430 /**
00431   * @brief  Toggles the selected LED.
00432   * @param  Led: LED to be toggled
00433   *          This parameter can be one of the following values:
00434   *            @arg  LED1
00435   *            @arg  LED2
00436   *            @arg  LED3
00437   *            @arg  LED4
00438   * @retval None
00439   */
00440 void BSP_LED_Toggle(Led_TypeDef Led)
00441 {
00442 #if !defined(USE_STM32756G_EVAL_REVA)
00443   GPIO_TypeDef*     gpio_led;
00444
00445   if ((Led == LED1) || (Led == LED3))   /* Toggle LED connected to GPIO */
00446   {
00447     if (Led == LED1)
00448     {
00449       gpio_led = LED1_GPIO_PORT;
00450     }
00451     else
00452     {
00453       gpio_led = LED3_GPIO_PORT;
00454     }
00455     HAL_GPIO_TogglePin(gpio_led, GPIO_PIN[Led]);
00456   }
00457   else
00458   {
00459 #endif /* !USE_STM32756G_EVAL_REVA */
00460
00461 #if defined(USE_IOEXPANDER)             /* Toggle LED connected to MFX */
00462      BSP_IO_TogglePin(GPIO_PIN[Led]);
00463 #endif /* USE_IOEXPANDER */
00464
00465 #if !defined(USE_STM32756G_EVAL_REVA)
00466   }
00467 #endif /* !USE_STM32756G_EVAL_REVA */
00468 }
00469
00470 /**
00471   * @brief  Configures button GPIO and EXTI Line.
00472   * @param  Button: Button to be configured
00473   *          This parameter can be one of the following values:
00474   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00475   *            @arg  BUTTON_TAMPER: Tamper Push Button
00476   *            @arg  BUTTON_KEY: Key Push Button
00477   * @param  ButtonMode: Button mode
00478   *          This parameter can be one of the following values:
00479   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00480   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00481   *                                    with interrupt generation capability
00482   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00483   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00484   *       on the board serigraphy.
00485   * @retval None
00486   */
00487 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
00488 {
00489   GPIO_InitTypeDef gpio_init_structure;
00490
00491   /* Enable the BUTTON clock */
00492   BUTTONx_GPIO_CLK_ENABLE(Button);
00493
00494   if(ButtonMode == BUTTON_MODE_GPIO)
00495   {
00496     /* Configure Button pin as input */
00497     gpio_init_structure.Pin = BUTTON_PIN[Button];
00498     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00499     gpio_init_structure.Pull = GPIO_NOPULL;
00500     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00501     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00502   }
00503
00504   if(ButtonMode == BUTTON_MODE_EXTI)
00505   {
00506     /* Configure Button pin as input with External interrupt */
00507     gpio_init_structure.Pin = BUTTON_PIN[Button];
00508     gpio_init_structure.Pull = GPIO_NOPULL;
00509     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00510
00511     if(Button != BUTTON_WAKEUP)
00512     {
00513       gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00514     }
00515     else
00516     {
00517       gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00518     }
00519
00520     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00521
00522     /* Enable and set Button EXTI Interrupt to the lowest priority */
00523     HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
00524     HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00525   }
00526 }
00527
00528 /**
00529   * @brief  Push Button DeInit.
00530   * @param  Button: Button to be configured
00531   *          This parameter can be one of the following values:
00532   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00533   *            @arg  BUTTON_TAMPER: Tamper Push Button
00534   *            @arg  BUTTON_KEY: Key Push Button
00535   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00536   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00537   *       on the board serigraphy.
00538   * @note PB DeInit does not disable the GPIO clock
00539   * @retval None
00540   */
00541 void BSP_PB_DeInit(Button_TypeDef Button)
00542 {
00543     GPIO_InitTypeDef gpio_init_structure;
00544
00545     gpio_init_structure.Pin = BUTTON_PIN[Button];
00546     HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00547     HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00548 }
00549
00550
00551 /**
00552   * @brief  Returns the selected button state.
00553   * @param  Button: Button to be checked
00554   *          This parameter can be one of the following values:
00555   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00556   *            @arg  BUTTON_TAMPER: Tamper Push Button
00557   *            @arg  BUTTON_KEY: Key Push Button
00558   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00559   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00560   *       on the board serigraphy.
00561   * @retval The Button GPIO pin value
00562   */
00563 uint32_t BSP_PB_GetState(Button_TypeDef Button)
00564 {
00565   return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00566 }
00567
00568 /**
00569   * @brief  Configures COM port.
00570   * @param  COM: COM port to be configured.
00571   *          This parameter can be one of the following values:
00572   *            @arg  COM1
00573   *            @arg  COM2
00574   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00575   *                configuration information for the specified USART peripheral.
00576   * @retval None
00577   */
00578 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart)
00579 {
00580   GPIO_InitTypeDef gpio_init_structure;
00581
00582   /* Enable GPIO clock */
00583   EVAL_COMx_TX_GPIO_CLK_ENABLE(COM);
00584   EVAL_COMx_RX_GPIO_CLK_ENABLE(COM);
00585
00586   /* Enable USART clock */
00587   EVAL_COMx_CLK_ENABLE(COM);
00588
00589   /* Configure USART Tx as alternate function */
00590   gpio_init_structure.Pin = COM_TX_PIN[COM];
00591   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00592   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00593   gpio_init_structure.Pull = GPIO_PULLUP;
00594   gpio_init_structure.Alternate = COM_TX_AF[COM];
00595   HAL_GPIO_Init(COM_TX_PORT[COM], &gpio_init_structure);
00596
00597   /* Configure USART Rx as alternate function */
00598   gpio_init_structure.Pin = COM_RX_PIN[COM];
00599   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00600   gpio_init_structure.Alternate = COM_RX_AF[COM];
00601   HAL_GPIO_Init(COM_RX_PORT[COM], &gpio_init_structure);
00602
00603   /* USART configuration */
00604   huart->Instance = COM_USART[COM];
00605   HAL_UART_Init(huart);
00606 }
00607
00608 /**
00609   * @brief  DeInit COM port.
00610   * @param  COM: COM port to be configured.
00611   *          This parameter can be one of the following values:
00612   *            @arg  COM1
00613   *            @arg  COM2
00614   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00615   *                configuration information for the specified USART peripheral.
00616   * @retval None
00617   */
00618 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart)
00619 {
00620   /* USART configuration */
00621   huart->Instance = COM_USART[COM];
00622   HAL_UART_DeInit(huart);
00623
00624   /* Enable USART clock */
00625   EVAL_COMx_CLK_DISABLE(COM);
00626
00627   /* DeInit GPIO pins can be done in the application
00628      (by surcharging this __weak function) */
00629
00630   /* GPIO pins clock, DMA clock can be shut down in the application
00631      by surcharging this __weak function */
00632 }
00633
00634 /**
00635   * @brief  Init Potentiometer.
00636   * @retval None
00637   */
00638 void BSP_POTENTIOMETER_Init(void)
00639 {
00640     GPIO_InitTypeDef          GPIO_InitStruct;
00641     ADC_ChannelConfTypeDef    ADC_Config;
00642
00643     /* ADC an GPIO Periph clock enable */
00644     ADCx_CLK_ENABLE();
00645     ADCx_CHANNEL_GPIO_CLK_ENABLE();
00646
00647     /* ADC Channel GPIO pin configuration */
00648     GPIO_InitStruct.Pin = ADCx_CHANNEL_PIN;
00649     GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
00650     GPIO_InitStruct.Pull = GPIO_NOPULL;
00651     HAL_GPIO_Init(ADCx_CHANNEL_GPIO_PORT, &GPIO_InitStruct);
00652
00653     /* Configure the ADC peripheral */
00654     hEvalADC.Instance          = ADCx;
00655
00656     HAL_ADC_DeInit(&hEvalADC);
00657
00658     hEvalADC.Init.ClockPrescaler        = ADC_CLOCKPRESCALER_PCLK_DIV4;   /* Asynchronous clock mode, input ADC clock not divided */
00659     hEvalADC.Init.Resolution            = ADC_RESOLUTION_12B;            /* 12-bit resolution for converted data */
00660     hEvalADC.Init.DataAlign             = ADC_DATAALIGN_RIGHT;           /* Right-alignment for converted data */
00661     hEvalADC.Init.ScanConvMode          = DISABLE;                       /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
00662     hEvalADC.Init.EOCSelection          = DISABLE;                       /* EOC flag picked-up to indicate conversion end */
00663     hEvalADC.Init.ContinuousConvMode    = DISABLE;                       /* Continuous mode disabled to have only 1 conversion at each conversion trig */
00664     hEvalADC.Init.NbrOfConversion       = 1;                             /* Parameter discarded because sequencer is disabled */
00665     hEvalADC.Init.DiscontinuousConvMode = DISABLE;                       /* Parameter discarded because sequencer is disabled */
00666     hEvalADC.Init.NbrOfDiscConversion   = 0;                             /* Parameter discarded because sequencer is disabled */
00667     hEvalADC.Init.ExternalTrigConv      = ADC_EXTERNALTRIGCONV_T1_CC1;   /* Software start to trig the 1st conversion manually, without external event */
00668     hEvalADC.Init.ExternalTrigConvEdge  = ADC_EXTERNALTRIGCONVEDGE_NONE; /* Parameter discarded because software trigger chosen */
00669     hEvalADC.Init.DMAContinuousRequests = DISABLE;                       /* DMA one-shot mode selected  */
00670
00671
00672     HAL_ADC_Init(&hEvalADC);
00673
00674     /* Configure ADC regular channel */
00675     ADC_Config.Channel      = ADCx_CHANNEL;                /* Sampled channel number */
00676     ADC_Config.Rank         = 1;                           /* Rank of sampled channel number ADCx_CHANNEL */
00677     ADC_Config.SamplingTime = ADC_SAMPLETIME_3CYCLES;      /* Sampling time (number of clock cycles unit) */
00678     ADC_Config.Offset = 0;                                 /* Parameter discarded because offset correction is disabled */
00679
00680     HAL_ADC_ConfigChannel(&hEvalADC, &ADC_Config);
00681 }
00682
00683 /**
00684   * @brief  Get Potentiometer level in 12 bits.
00685   * @retval Potentiometer level(0..0xFFF) / 0xFFFFFFFF : Error
00686   */
00687 uint32_t BSP_POTENTIOMETER_GetLevel(void)
00688 {
00689   if(HAL_ADC_Start(&hEvalADC) == HAL_OK)
00690   {
00691     if(HAL_ADC_PollForConversion(&hEvalADC, ADCx_POLL_TIMEOUT)== HAL_OK)
00692     {
00693       return (HAL_ADC_GetValue(&hEvalADC));
00694     }
00695   }
00696   return  0xFFFFFFFF;
00697 }
00698
00699 #if defined(USE_IOEXPANDER)
00700 /**
00701   * @brief  Configures joystick GPIO and EXTI modes.
00702   * @param  JoyMode: Button mode.
00703   *          This parameter can be one of the following values:
00704   *            @arg  JOY_MODE_GPIO: Joystick pins will be used as simple IOs
00705   *            @arg  JOY_MODE_EXTI: Joystick pins will be connected to EXTI line
00706   *                                 with interrupt generation capability
00707   * @retval IO_OK: if all initializations are OK. Other value if error.
00708   */
00709 uint8_t BSP_JOY_Init(JOYMode_TypeDef JoyMode)
00710 {
00711   uint8_t ret = 0;
00712
00713   /* Initialize the IO functionalities */
00714   ret = BSP_IO_Init();
00715
00716   /* Configure joystick pins in IT mode */
00717   if(JoyMode == JOY_MODE_EXTI)
00718   {
00719     /* Configure IO interrupt acquisition mode */
00720     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_IT_LOW_LEVEL_PU);
00721   }
00722   else
00723   {
00724     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_INPUT_PU);
00725   }
00726
00727   return ret;
00728 }
00729
00730
00731 /**
00732   * @brief  DeInit joystick GPIOs.
00733   * @note   JOY DeInit does not disable the MFX, just set the MFX pins in Off mode
00734   * @retval None.
00735   */
00736 void BSP_JOY_DeInit()
00737 {
00738     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_OFF);
00739 }
00740
00741 /**
00742   * @brief  Returns the current joystick status.
00743   * @retval Code of the joystick key pressed
00744   *          This code can be one of the following values:
00745   *            @arg  JOY_NONE
00746   *            @arg  JOY_SEL
00747   *            @arg  JOY_DOWN
00748   *            @arg  JOY_LEFT
00749   *            @arg  JOY_RIGHT
00750   *            @arg  JOY_UP
00751   */
00752 JOYState_TypeDef BSP_JOY_GetState(void)
00753 {
00754   uint16_t pin_status = 0;
00755
00756   /* Read the status joystick pins */
00757   pin_status = BSP_IO_ReadPin(JOY_ALL_PINS);
00758
00759   /* Check the pressed keys */
00760   if((pin_status & JOY_NONE_PIN) == JOY_NONE)
00761   {
00762     return(JOYState_TypeDef) JOY_NONE;
00763   }
00764   else if(!(pin_status & JOY_SEL_PIN))
00765   {
00766     return(JOYState_TypeDef) JOY_SEL;
00767   }
00768   else if(!(pin_status & JOY_DOWN_PIN))
00769   {
00770     return(JOYState_TypeDef) JOY_DOWN;
00771   }
00772   else if(!(pin_status & JOY_LEFT_PIN))
00773   {
00774     return(JOYState_TypeDef) JOY_LEFT;
00775   }
00776   else if(!(pin_status & JOY_RIGHT_PIN))
00777   {
00778     return(JOYState_TypeDef) JOY_RIGHT;
00779   }
00780   else if(!(pin_status & JOY_UP_PIN))
00781   {
00782     return(JOYState_TypeDef) JOY_UP;
00783   }
00784   else
00785   {
00786     return(JOYState_TypeDef) JOY_NONE;
00787   }
00788 }
00789
00790 /**
00791   * @brief  Check TS3510 touch screen presence
00792   * @retval Return 0 if TS3510 is detected, return 1 if not detected
00793   */
00794 uint8_t BSP_TS3510_IsDetected(void)
00795 {
00796   HAL_StatusTypeDef status = HAL_OK;
00797   uint32_t error = 0;
00798   uint8_t a_buffer;
00799
00800   uint8_t tmp_buffer[2] = {0x81, 0x08};
00801
00802   /* Prepare for LCD read data */
00803   IOE_WriteMultiple(TS3510_I2C_ADDRESS, 0x8A, tmp_buffer, 2);
00804
00805   status = HAL_I2C_Mem_Read(&hEvalI2c, TS3510_I2C_ADDRESS, 0x8A, I2C_MEMADD_SIZE_8BIT, &a_buffer, 1, 1000);
00806
00807   /* Check the communication status */
00808   if(status != HAL_OK)
00809   {
00810     error = (uint32_t)HAL_I2C_GetError(&hEvalI2c);
00811
00812     /* I2C error occurred */
00813     I2Cx_Error(TS3510_I2C_ADDRESS);
00814
00815     if(error == HAL_I2C_ERROR_AF)
00816     {
00817       return 1;
00818     }
00819   }
00820   return 0;
00821 }
00822 #endif /* USE_IOEXPANDER */
00823
00824 /*******************************************************************************
00825                             BUS OPERATIONS
00826 *******************************************************************************/
00827
00828 /******************************* I2C Routines *********************************/
00829 /**
00830   * @brief  Initializes I2C MSP.
00831   * @retval None
00832   */
00833 static void I2Cx_MspInit(void)
00834 {
00835   GPIO_InitTypeDef  gpio_init_structure;
00836
00837   /*** Configure the GPIOs ***/
00838   /* Enable GPIO clock */
00839   EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
00840
00841   /* Configure I2C Tx as alternate function */
00842   gpio_init_structure.Pin = EVAL_I2Cx_SCL_PIN;
00843   gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00844   gpio_init_structure.Pull = GPIO_NOPULL;
00845   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00846   gpio_init_structure.Alternate = EVAL_I2Cx_SCL_SDA_AF;
00847   HAL_GPIO_Init(EVAL_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00848
00849   /* Configure I2C Rx as alternate function */
00850   gpio_init_structure.Pin = EVAL_I2Cx_SDA_PIN;
00851   HAL_GPIO_Init(EVAL_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00852
00853   /*** Configure the I2C peripheral ***/
00854   /* Enable I2C clock */
00855   EVAL_I2Cx_CLK_ENABLE();
00856
00857   /* Force the I2C peripheral clock reset */
00858   EVAL_I2Cx_FORCE_RESET();
00859
00860   /* Release the I2C peripheral clock reset */
00861   EVAL_I2Cx_RELEASE_RESET();
00862
00863   /* Enable and set I2Cx Interrupt to a lower priority */
00864   HAL_NVIC_SetPriority(EVAL_I2Cx_EV_IRQn, 0x0F, 0);
00865   HAL_NVIC_EnableIRQ(EVAL_I2Cx_EV_IRQn);
00866
00867   /* Enable and set I2Cx Interrupt to a lower priority */
00868   HAL_NVIC_SetPriority(EVAL_I2Cx_ER_IRQn, 0x0F, 0);
00869   HAL_NVIC_EnableIRQ(EVAL_I2Cx_ER_IRQn);
00870 }
00871
00872 /**
00873   * @brief  Initializes I2C HAL.
00874   * @retval None
00875   */
00876 static void I2Cx_Init(void)
00877 {
00878   if(HAL_I2C_GetState(&hEvalI2c) == HAL_I2C_STATE_RESET)
00879   {
00880     hEvalI2c.Instance              = EVAL_I2Cx;
00881     hEvalI2c.Init.Timing           = EVAL_I2Cx_TIMING;
00882     hEvalI2c.Init.OwnAddress1      = 0;
00883     hEvalI2c.Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00884     hEvalI2c.Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00885     hEvalI2c.Init.OwnAddress2      = 0;
00886     hEvalI2c.Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00887     hEvalI2c.Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00888
00889     /* Init the I2C */
00890     I2Cx_MspInit();
00891     HAL_I2C_Init(&hEvalI2c);
00892   }
00893 }
00894
00895
00896 #if defined(USE_IOEXPANDER)
00897 /**
00898   * @brief  Writes a single data.
00899   * @param  Addr: I2C address
00900   * @param  Reg: Register address
00901   * @param  Value: Data to be written
00902   * @retval None
00903   */
00904 static void I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00905 {
00906   HAL_StatusTypeDef status = HAL_OK;
00907
00908   status = HAL_I2C_Mem_Write(&hEvalI2c, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 100);
00909
00910   /* Check the communication status */
00911   if(status != HAL_OK)
00912   {
00913     /* Execute user timeout callback */
00914     I2Cx_Error(Addr);
00915   }
00916 }
00917
00918 /**
00919   * @brief  Reads a single data.
00920   * @param  Addr: I2C address
00921   * @param  Reg: Register address
00922   * @retval Read data
00923   */
00924 static uint8_t I2Cx_Read(uint8_t Addr, uint8_t Reg)
00925 {
00926   HAL_StatusTypeDef status = HAL_OK;
00927   uint8_t Value = 0;
00928
00929   status = HAL_I2C_Mem_Read(&hEvalI2c, Addr, Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 1000);
00930
00931   /* Check the communication status */
00932   if(status != HAL_OK)
00933   {
00934     /* Execute user timeout callback */
00935     I2Cx_Error(Addr);
00936   }
00937   return Value;
00938 }
00939 #endif /* USE_IOEXPANDER */
00940
00941 /**
00942   * @brief  Reads multiple data.
00943   * @param  Addr: I2C address
00944   * @param  Reg: Reg address
00945   * @param  MemAddress: Internal memory address
00946   * @param  Buffer: Pointer to data buffer
00947   * @param  Length: Length of the data
00948   * @retval Number of read data
00949   */
00950 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00951 {
00952   HAL_StatusTypeDef status = HAL_OK;
00953
00954   if(Addr == EXC7200_I2C_ADDRESS)
00955   {
00956     status = HAL_I2C_Master_Receive(&hEvalI2c, Addr, Buffer, Length, 1000);
00957   }
00958   else
00959   {
00960     status = HAL_I2C_Mem_Read(&hEvalI2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00961   }
00962
00963   /* Check the communication status */
00964   if(status != HAL_OK)
00965   {
00966     /* I2C error occurred */
00967     I2Cx_Error(Addr);
00968   }
00969   return status;
00970 }
00971
00972 /**
00973   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00974   * @param  Addr: Device address on BUS Bus.
00975   * @param  Reg: The target register address to write
00976   * @param  MemAddress: Internal memory address
00977   * @param  Buffer: The target register value to be written
00978   * @param  Length: buffer size to be written
00979   * @retval HAL status
00980   */
00981 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00982 {
00983   HAL_StatusTypeDef status = HAL_OK;
00984
00985   status = HAL_I2C_Mem_Write(&hEvalI2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00986
00987   /* Check the communication status */
00988   if(status != HAL_OK)
00989   {
00990     /* Re-Initiaize the I2C Bus */
00991     I2Cx_Error(Addr);
00992   }
00993   return status;
00994 }
00995
00996 /**
00997   * @brief  Checks if target device is ready for communication.
00998   * @note   This function is used with Memory devices
00999   * @param  DevAddress: Target device address
01000   * @param  Trials: Number of trials
01001   * @retval HAL status
01002   */
01003 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
01004 {
01005   return (HAL_I2C_IsDeviceReady(&hEvalI2c, DevAddress, Trials, 1000));
01006 }
01007
01008 /**
01009   * @brief  Manages error callback by re-initializing I2C.
01010   * @param  Addr: I2C Address
01011   * @retval None
01012   */
01013 static void I2Cx_Error(uint8_t Addr)
01014 {
01015   /* De-initialize the I2C communication bus */
01016   HAL_I2C_DeInit(&hEvalI2c);
01017
01018   /* Re-Initialize the I2C communication bus */
01019   I2Cx_Init();
01020 }
01021
01022 /*******************************************************************************
01023                             LINK OPERATIONS
01024 *******************************************************************************/
01025
01026 /********************************* LINK IOE ***********************************/
01027 #if defined(USE_IOEXPANDER)
01028 /**
01029   * @brief  Initializes IOE low level.
01030   * @retval None
01031   */
01032 void IOE_Init(void)
01033 {
01034   I2Cx_Init();
01035 }
01036
01037 /**
01038   * @brief  Configures IOE low level interrupt.
01039   * @retval None
01040   */
01041 void IOE_ITConfig(void)
01042 {
01043   /* STMPE811 IO expander IT config done by BSP_TS_ITConfig function */
01044 }
01045
01046 /**
01047   * @brief  IOE writes single data.
01048   * @param  Addr: I2C address
01049   * @param  Reg: Register address
01050   * @param  Value: Data to be written
01051   * @retval None
01052   */
01053 void IOE_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
01054 {
01055   I2Cx_Write(Addr, Reg, Value);
01056 }
01057
01058 /**
01059   * @brief  IOE reads single data.
01060   * @param  Addr: I2C address
01061   * @param  Reg: Register address
01062   * @retval Read data
01063   */
01064 uint8_t IOE_Read(uint8_t Addr, uint8_t Reg)
01065 {
01066   return I2Cx_Read(Addr, Reg);
01067 }
01068
01069 /**
01070   * @brief  IOE reads multiple data.
01071   * @param  Addr: I2C address
01072   * @param  Reg: Register address
01073   * @param  Buffer: Pointer to data buffer
01074   * @param  Length: Length of the data
01075   * @retval Number of read data
01076   */
01077 uint16_t IOE_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01078 {
01079  return I2Cx_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01080 }
01081
01082 /**
01083   * @brief  IOE writes multiple data.
01084   * @param  Addr: I2C address
01085   * @param  Reg: Register address
01086   * @param  Buffer: Pointer to data buffer
01087   * @param  Length: Length of the data
01088   * @retval None
01089   */
01090 void IOE_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01091 {
01092   I2Cx_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01093 }
01094
01095 /**
01096   * @brief  IOE delay
01097   * @param  Delay: Delay in ms
01098   * @retval None
01099   */
01100 void IOE_Delay(uint32_t Delay)
01101 {
01102   HAL_Delay(Delay);
01103 }
01104 #endif /* USE_IOEXPANDER */
01105
01106 /********************************* LINK MFX ***********************************/
01107
01108 #if defined(USE_IOEXPANDER)
01109 /**
01110   * @brief  Initializes MFX low level.
01111   * @retval None
01112   */
01113 void MFX_IO_Init(void)
01114 {
01115   I2Cx_Init();
01116 }
01117
01118 /**
01119   * @brief  DeInitializes MFX low level.
01120   * @retval None
01121   */
01122 void MFX_IO_DeInit(void)
01123 {
01124 }
01125
01126 /**
01127   * @brief  Configures MFX low level interrupt.
01128   * @retval None
01129   */
01130 void MFX_IO_ITConfig(void)
01131 {
01132   static uint8_t mfx_io_it_enabled = 0;
01133   GPIO_InitTypeDef  gpio_init_structure;
01134
01135   if(mfx_io_it_enabled == 0)
01136   {
01137     mfx_io_it_enabled = 1;
01138     /* Enable the GPIO EXTI clock */
01139     __HAL_RCC_GPIOI_CLK_ENABLE();
01140     __HAL_RCC_SYSCFG_CLK_ENABLE();
01141
01142     gpio_init_structure.Pin   = GPIO_PIN_8;
01143     gpio_init_structure.Pull  = GPIO_NOPULL;
01144     gpio_init_structure.Speed = GPIO_SPEED_LOW;
01145     gpio_init_structure.Mode  = GPIO_MODE_IT_RISING;
01146     HAL_GPIO_Init(GPIOI, &gpio_init_structure);
01147
01148     /* Enable and set GPIO EXTI Interrupt to the lowest priority */
01149     HAL_NVIC_SetPriority((IRQn_Type)(EXTI9_5_IRQn), 0x0F, 0x0F);
01150     HAL_NVIC_EnableIRQ((IRQn_Type)(EXTI9_5_IRQn));
01151   }
01152 }
01153
01154 /**
01155   * @brief  MFX writes single data.
01156   * @param  Addr: I2C address
01157   * @param  Reg: Register address
01158   * @param  Value: Data to be written
01159   * @retval None
01160   */
01161 void MFX_IO_Write(uint16_t Addr, uint8_t Reg, uint8_t Value)
01162 {
01163   I2Cx_Write((uint8_t) Addr, Reg, Value);
01164 }
01165
01166 /**
01167   * @brief  MFX reads single data.
01168   * @param  Addr: I2C address
01169   * @param  Reg: Register address
01170   * @retval Read data
01171   */
01172 uint8_t MFX_IO_Read(uint16_t Addr, uint8_t Reg)
01173 {
01174   return I2Cx_Read((uint8_t) Addr, Reg);
01175 }
01176
01177 /**
01178   * @brief  MFX reads multiple data.
01179   * @param  Addr: I2C address
01180   * @param  Reg: Register address
01181   * @param  Buffer: Pointer to data buffer
01182   * @param  Length: Length of the data
01183   * @retval Number of read data
01184   */
01185 uint16_t MFX_IO_ReadMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01186 {
01187  return I2Cx_ReadMultiple((uint8_t)Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01188 }
01189
01190 /**
01191   * @brief  MFX delay
01192   * @param  Delay: Delay in ms
01193   * @retval None
01194   */
01195 void MFX_IO_Delay(uint32_t Delay)
01196 {
01197   HAL_Delay(Delay);
01198 }
01199
01200 /**
01201   * @brief  Used by Lx family but requested for MFX component compatibility.
01202   * @retval None
01203   */
01204 void MFX_IO_Wakeup(void)
01205 {
01206 }
01207
01208 /**
01209   * @brief  Used by Lx family but requested for MXF component compatibility.
01210   * @retval None
01211   */
01212 void MFX_IO_EnableWakeupPin(void)
01213 {
01214 }
01215
01216 #endif /* USE_IOEXPANDER */
01217
01218 /********************************* LINK AUDIO *********************************/
01219
01220 /**
01221   * @brief  Initializes Audio low level.
01222   * @retval None
01223   */
01224 void AUDIO_IO_Init(void)
01225 {
01226   I2Cx_Init();
01227 }
01228
01229 /**
01230   * @brief  Deinitializes Audio low level.
01231   * @retval None
01232   */
01233 void AUDIO_IO_DeInit(void)
01234 {
01235 }
01236
01237 /**
01238   * @brief  Writes a single data.
01239   * @param  Addr: I2C address
01240   * @param  Reg: Reg address
01241   * @param  Value: Data to be written
01242   * @retval None
01243   */
01244 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
01245 {
01246   uint16_t tmp = Value;
01247
01248   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
01249
01250   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
01251
01252   I2Cx_WriteMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
01253 }
01254
01255 /**
01256   * @brief  Reads a single data.
01257   * @param  Addr: I2C address
01258   * @param  Reg: Reg address
01259   * @retval Data to be read
01260   */
01261 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
01262 {
01263   uint16_t read_value = 0, tmp = 0;
01264
01265   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
01266
01267   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
01268
01269   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
01270
01271   read_value = tmp;
01272
01273   return read_value;
01274 }
01275
01276 /**
01277   * @brief  AUDIO Codec delay
01278   * @param  Delay: Delay in ms
01279   * @retval None
01280   */
01281 void AUDIO_IO_Delay(uint32_t Delay)
01282 {
01283   HAL_Delay(Delay);
01284 }
01285
01286 /********************************* LINK CAMERA ********************************/
01287
01288 /**
01289   * @brief  Initializes Camera low level.
01290   * @retval None
01291   */
01292 void CAMERA_IO_Init(void)
01293 {
01294   I2Cx_Init();
01295 }
01296
01297 /**
01298   * @brief  Camera writes single data.
01299   * @param  Addr: I2C address
01300   * @param  Reg: Register address
01301   * @param  Value: Data to be written
01302   * @retval None
01303   */
01304 void CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
01305 {
01306   uint16_t tmp = Value;
01307   /* For S5K5CAG sensor, 16 bits accesses are used */
01308   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
01309   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
01310   I2Cx_WriteMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
01311 }
01312
01313 /**
01314   * @brief  Camera reads single data.
01315   * @param  Addr: I2C address
01316   * @param  Reg: Register address
01317   * @retval Read data
01318   */
01319 uint16_t CAMERA_IO_Read(uint8_t Addr, uint16_t Reg)
01320 {
01321   uint16_t read_value = 0, tmp = 0;
01322   /* For S5K5CAG sensor, 16 bits accesses are used */
01323   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
01324   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
01325   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
01326   read_value = tmp;
01327   return read_value;
01328 }
01329
01330 /**
01331   * @brief  Camera delay
01332   * @param  Delay: Delay in ms
01333   * @retval None
01334   */
01335 void CAMERA_Delay(uint32_t Delay)
01336 {
01337   HAL_Delay(Delay);
01338 }
01339
01340 /******************************** LINK I2C EEPROM *****************************/
01341
01342 /**
01343   * @brief  Initializes peripherals used by the I2C EEPROM driver.
01344   * @retval None
01345   */
01346 void EEPROM_IO_Init(void)
01347 {
01348   I2Cx_Init();
01349 }
01350
01351 /**
01352   * @brief  Write data to I2C EEPROM driver in using DMA channel.
01353   * @param  DevAddress: Target device address
01354   * @param  MemAddress: Internal memory address
01355   * @param  pBuffer: Pointer to data buffer
01356   * @param  BufferSize: Amount of data to be sent
01357   * @retval HAL status
01358   */
01359 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
01360 {
01361   return (I2Cx_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
01362 }
01363
01364 /**
01365   * @brief  Read data from I2C EEPROM driver in using DMA channel.
01366   * @param  DevAddress: Target device address
01367   * @param  MemAddress: Internal memory address
01368   * @param  pBuffer: Pointer to data buffer
01369   * @param  BufferSize: Amount of data to be read
01370   * @retval HAL status
01371   */
01372 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
01373 {
01374   return (I2Cx_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
01375 }
01376
01377 /**
01378   * @brief  Checks if target device is ready for communication.
01379   * @note   This function is used with Memory devices
01380   * @param  DevAddress: Target device address
01381   * @param  Trials: Number of trials
01382   * @retval HAL status
01383   */
01384 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
01385 {
01386   return (I2Cx_IsDeviceReady(DevAddress, Trials));
01387 }
01388
01389 /**
01390   * @}
01391   */
01392
01393 /**
01394   * @}
01395   */
01396
01397 /**
01398   * @}
01399   */
01400
01401 /**
01402   * @}
01403   */
01404
01405 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32756G_EVAL and STM32746G_EVAL 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 __STM32756G_EVAL_H
00039 #define __STM32756G_EVAL_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* USE_STM32756G_EVAL_REVA must USE USE_IOEXPANDER */
00046 #if defined(USE_STM32756G_EVAL_REVA)
00047 #ifndef USE_IOEXPANDER
00048 #define USE_IOEXPANDER
00049 #endif /* USE_IOEXPANDER */
00050 #endif /* USE_STM32756G_EVAL_REVA */
00051
00052 /* Includes ------------------------------------------------------------------*/
00053 #include "stm32f7xx_hal.h"
00054
00055 /** @addtogroup BSP
00056   * @{
00057   */
00058
00059 /** @addtogroup STM32756G_EVAL
00060   * @{
00061   */
00062
00063 /** @addtogroup STM32756G_EVAL_LOW_LEVEL
00064   * @{
00065   */
00066
00067 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Types LEVEL Exported Types
00068   * @{
00069   */
00070 typedef enum
00071 {
00072 #if defined(USE_IOEXPANDER)
00073 LED1 = 0,
00074 LED_GREEN = LED1,
00075 LED2 = 1,
00076 LED_ORANGE = LED2,
00077 LED3 = 2,
00078 LED_RED = LED3,
00079 LED4 = 3,
00080 LED_BLUE = LED4
00081 #else
00082 LED1 = 0,
00083 LED_GREEN = LED1,
00084 LED3 = 1,
00085 LED_RED = LED3,
00086 #endif /* USE_IOEXPANDER */
00087 }Led_TypeDef;
00088
00089 typedef enum
00090 {
00091   BUTTON_WAKEUP = 0,
00092   BUTTON_TAMPER = 1,
00093   BUTTON_KEY = 2
00094 }Button_TypeDef;
00095
00096 typedef enum
00097 {
00098   BUTTON_MODE_GPIO = 0,
00099   BUTTON_MODE_EXTI = 1
00100 }ButtonMode_TypeDef;
00101
00102 #if defined(USE_IOEXPANDER)
00103 typedef enum
00104 {
00105   JOY_MODE_GPIO = 0,
00106   JOY_MODE_EXTI = 1
00107 }JOYMode_TypeDef;
00108
00109 typedef enum
00110 {
00111   JOY_NONE  = 0,
00112   JOY_SEL   = 1,
00113   JOY_DOWN  = 2,
00114   JOY_LEFT  = 3,
00115   JOY_RIGHT = 4,
00116   JOY_UP    = 5
00117 }JOYState_TypeDef;
00118 #endif /* USE_IOEXPANDER */
00119
00120 typedef enum
00121 {
00122   COM1 = 0,
00123   COM2 = 1
00124 }COM_TypeDef;
00125 /**
00126   * @}
00127   */
00128
00129 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants
00130   * @{
00131   */
00132
00133 /**
00134   * @brief  Define for STM32756G_EVAL board
00135   */
00136 #if !defined (USE_STM32756G_EVAL)
00137  #define USE_STM32756G_EVAL
00138 #endif
00139
00140 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_LED
00141   * @{
00142   */
00143
00144 #if !defined(USE_STM32756G_EVAL_REVA)
00145
00146 #if defined(USE_IOEXPANDER)
00147 #define LEDn                             ((uint8_t)4)
00148 #define LED2_PIN                         IO_PIN_17
00149 #define LED4_PIN                         IO_PIN_19
00150 #else
00151 #define LEDn                             ((uint8_t)2)
00152 #endif /* USE_IOEXPANDER */
00153
00154 #define LED1_GPIO_PORT                   GPIOF
00155 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOF_CLK_ENABLE()
00156 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOF_CLK_DISABLE()
00157 #define LED1_PIN                         GPIO_PIN_10    /* To use LED1, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
00158
00159 #define LED3_GPIO_PORT                   GPIOB
00160 #define LED3_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOB_CLK_ENABLE()
00161 #define LED3_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOB_CLK_DISABLE()
00162 #define LED3_PIN                         GPIO_PIN_7             /* To use LED3, ensure that JP23 is in position 2-3, camera is then no more usable */
00163
00164 #else
00165
00166 #define LEDn                             ((uint8_t)4)
00167 #define LED1_PIN                         IO_PIN_16
00168 #define LED2_PIN                         IO_PIN_17
00169 #define LED3_PIN                         IO_PIN_18
00170 #define LED4_PIN                         IO_PIN_19
00171
00172 #endif /* !USE_STM32756G_EVAL_REVA */
00173
00174 /**
00175   * @}
00176   */
00177
00178 /**
00179   * @brief MFX_IRQOUt pin
00180   */
00181 #define MFX_IRQOUT_PIN                    GPIO_PIN_8
00182 #define MFX_IRQOUT_GPIO_PORT              GPIOI
00183 #define MFX_IRQOUT_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOI_CLK_ENABLE()
00184 #define MFX_IRQOUT_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOI_CLK_DISABLE()
00185 #define MFX_IRQOUT_EXTI_IRQn              EXTI9_5_IRQn
00186
00187 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_BUTTON
00188   * @{
00189   */
00190 /* Joystick pins are connected to IO Expander (accessible through I2C1 interface) */
00191 #define BUTTONn                             ((uint8_t)3)
00192
00193 /**
00194   * @brief Wakeup push-button
00195   */
00196 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_13
00197 #define WAKEUP_BUTTON_GPIO_PORT             GPIOC
00198 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOC_CLK_ENABLE()
00199 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOC_CLK_DISABLE()
00200 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI15_10_IRQn
00201
00202 /**
00203   * @brief Tamper push-button
00204   */
00205 #define TAMPER_BUTTON_PIN                    GPIO_PIN_13
00206 #define TAMPER_BUTTON_GPIO_PORT              GPIOC
00207 #define TAMPER_BUTTON_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOC_CLK_ENABLE()
00208 #define TAMPER_BUTTON_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOC_CLK_DISABLE()
00209 #define TAMPER_BUTTON_EXTI_IRQn              EXTI15_10_IRQn
00210
00211 /**
00212   * @brief Key push-button
00213   */
00214 #define KEY_BUTTON_PIN                       GPIO_PIN_13
00215 #define KEY_BUTTON_GPIO_PORT                 GPIOC
00216 #define KEY_BUTTON_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00217 #define KEY_BUTTON_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00218 #define KEY_BUTTON_EXTI_IRQn                 EXTI15_10_IRQn
00219
00220 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\
00221                                                    if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\
00222                                                                                                                         KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0)
00223
00224 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__)    (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\
00225                                                 ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE())
00226 /**
00227   * @}
00228   */
00229
00230 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_COM
00231   * @{
00232   */
00233 #define COMn                             ((uint8_t)1)
00234
00235 /**
00236  * @brief Definition for COM port1, connected to USART1
00237  */
00238 #define EVAL_COM1                          USART1
00239 #define EVAL_COM1_CLK_ENABLE()             __HAL_RCC_USART1_CLK_ENABLE()
00240 #define EVAL_COM1_CLK_DISABLE()            __HAL_RCC_USART1_CLK_DISABLE()
00241
00242 #define EVAL_COM1_TX_PIN                   GPIO_PIN_9
00243 #define EVAL_COM1_TX_GPIO_PORT             GPIOA
00244 #define EVAL_COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00245 #define EVAL_COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00246 #define EVAL_COM1_TX_AF                    GPIO_AF7_USART1
00247
00248 #define EVAL_COM1_RX_PIN                   GPIO_PIN_10
00249 #define EVAL_COM1_RX_GPIO_PORT             GPIOA
00250 #define EVAL_COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00251 #define EVAL_COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00252 #define EVAL_COM1_RX_AF                    GPIO_AF7_USART1
00253
00254 #define EVAL_COM1_IRQn                     USART1_IRQn
00255
00256 #define EVAL_COMx_CLK_ENABLE(__INDEX__)            do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0)
00257 #define EVAL_COMx_CLK_DISABLE(__INDEX__)           (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0)
00258
00259 #define EVAL_COMx_TX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
00260 #define EVAL_COMx_TX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0)
00261
00262 #define EVAL_COMx_RX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
00263 #define EVAL_COMx_RX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0)
00264
00265 /**
00266  * @brief Definition for Potentiometer, connected to ADC3
00267  */
00268 #define ADCx                            ADC3
00269 #define ADCx_CLK_ENABLE()               __HAL_RCC_ADC3_CLK_ENABLE()
00270 #define ADCx_CHANNEL_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00271
00272 #define ADCx_FORCE_RESET()              __HAL_RCC_ADC_FORCE_RESET()
00273 #define ADCx_RELEASE_RESET()            __HAL_RCC_ADC_RELEASE_RESET()
00274
00275 /* Definition for ADCx Channel Pin */
00276 #define ADCx_CHANNEL_PIN                GPIO_PIN_10
00277 #define ADCx_CHANNEL_GPIO_PORT          GPIOF
00278
00279 /* Definition for ADCx's Channel */
00280 #define ADCx_CHANNEL                    ADC_CHANNEL_8
00281 #define SAMPLINGTIME                    ADC_SAMPLETIME_3CYCLES
00282 #define ADCx_POLL_TIMEOUT               10
00283
00284 /**
00285   * @brief Joystick Pins definition
00286   */
00287 #if defined(USE_IOEXPANDER)
00288 #define JOY_SEL_PIN                    IO_PIN_0
00289 #define JOY_DOWN_PIN                   IO_PIN_1
00290 #define JOY_LEFT_PIN                   IO_PIN_2
00291 #define JOY_RIGHT_PIN                  IO_PIN_3
00292 #define JOY_UP_PIN                     IO_PIN_4
00293 #define JOY_NONE_PIN                   JOY_ALL_PINS
00294 #define JOY_ALL_PINS                   (IO_PIN_0 | IO_PIN_1 | IO_PIN_2 | IO_PIN_3 | IO_PIN_4)
00295 #endif /* USE_IOEXPANDER */
00296 /**
00297   * @brief Eval Pins definition connected to MFX
00298   */
00299
00300 #if defined(USE_IOEXPANDER)
00301 #define XSDN_PIN                       IO_PIN_10
00302 #define MII_INT_PIN                    IO_PIN_13
00303 #define RSTI_PIN                       IO_PIN_11
00304 #define CAM_PLUG_PIN                   IO_PIN_12
00305 #define LCD_INT_PIN                    IO_PIN_14
00306 #define AUDIO_INT_PIN                  IO_PIN_5
00307 #define OTG_FS1_OVER_CURRENT_PIN       IO_PIN_6
00308 #define OTG_FS1_POWER_SWITCH_PIN       IO_PIN_7
00309 #define OTG_FS2_OVER_CURRENT_PIN       IO_PIN_8
00310 #define OTG_FS2_POWER_SWITCH_PIN       IO_PIN_9
00311 #define SD_DETECT_PIN                  IO_PIN_15
00312
00313 #endif /* USE_IOEXPANDER */
00314
00315
00316 /* Exported constant IO ------------------------------------------------------*/
00317
00318 /*  The MFX_I2C_ADDR input pin selects the MFX I2C device address
00319         MFX_I2C_ADDR input pin     MFX I2C device address
00320             0                           b: 1000 010x    (0x84)
00321             1                           b: 1000 011x    (0x86)
00322    This input is sampled during the MFX firmware startup.  */
00323 #define IO_I2C_ADDRESS                   ((uint16_t)0x84)  /*mfx MFX_I2C_ADDR 0*/
00324 #define IO_I2C_ADDRESS_2                 ((uint16_t)0x86)  /*mfx MFX_I2C_ADDR 1*/
00325 #define TS_I2C_ADDRESS                   ((uint16_t)0x82)  /*stmpe811 used on MB1046 board */
00326 #define TS3510_I2C_ADDRESS               ((uint16_t)0x80)
00327 #define EXC7200_I2C_ADDRESS              ((uint16_t)0x08)
00328 #define CAMERA_I2C_ADDRESS               ((uint16_t)0x5A)
00329 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x34)
00330 #define EEPROM_I2C_ADDRESS_A01           ((uint16_t)0xA0)
00331 #define EEPROM_I2C_ADDRESS_A02           ((uint16_t)0xA6)
00332 /* I2C clock speed configuration (in Hz)
00333    WARNING:
00334    Make sure that this define is not already declared in other files (ie.
00335    stm32756G_eval.h file). It can be used in parallel by other modules. */
00336 #ifndef I2C_SPEED
00337  #define I2C_SPEED                        ((uint32_t)100000)
00338 #endif /* I2C_SPEED */
00339
00340 /* User can use this section to tailor I2Cx/I2Cx instance used and associated
00341    resources */
00342 /* Definition for I2Cx clock resources */
00343 #define EVAL_I2Cx                             I2C1
00344 #define EVAL_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C1_CLK_ENABLE()
00345 #define EVAL_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00346 #define EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
00347
00348 #define EVAL_I2Cx_FORCE_RESET()               __HAL_RCC_I2C1_FORCE_RESET()
00349 #define EVAL_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C1_RELEASE_RESET()
00350
00351 /* Definition for I2Cx Pins */
00352 #define EVAL_I2Cx_SCL_PIN                     GPIO_PIN_8
00353 #define EVAL_I2Cx_SCL_SDA_GPIO_PORT           GPIOB
00354 #define EVAL_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C1
00355 #define EVAL_I2Cx_SDA_PIN                     GPIO_PIN_9
00356
00357 /* I2C interrupt requests */
00358 #define EVAL_I2Cx_EV_IRQn                     I2C1_EV_IRQn
00359 #define EVAL_I2Cx_ER_IRQn                     I2C1_ER_IRQn
00360
00361 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00362 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */
00363 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
00364 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */
00365 #ifndef EVAL_I2Cx_TIMING
00366 #define EVAL_I2Cx_TIMING                      ((uint32_t)0x40912732)
00367 #endif /* EVAL_I2Cx_TIMING */
00368
00369 /**
00370   * @}
00371   */
00372
00373 /**
00374   * @}
00375   */
00376
00377 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Macros LOW LEVEL Exported Macros
00378   * @{
00379   */
00380 /**
00381   * @}
00382   */
00383
00384 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Functions LOW LEVEL Exported Functions
00385   * @{
00386   */
00387 uint32_t         BSP_GetVersion(void);
00388 void             BSP_LED_Init(Led_TypeDef Led);
00389 void             BSP_LED_DeInit(Led_TypeDef Led);
00390 void             BSP_LED_On(Led_TypeDef Led);
00391 void             BSP_LED_Off(Led_TypeDef Led);
00392 void             BSP_LED_Toggle(Led_TypeDef Led);
00393 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00394 void             BSP_PB_DeInit(Button_TypeDef Button);
00395 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00396 void             BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart);
00397 void             BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
00398 void             BSP_POTENTIOMETER_Init(void);
00399 uint32_t         BSP_POTENTIOMETER_GetLevel(void);
00400 #if defined(USE_IOEXPANDER)
00401 uint8_t          BSP_JOY_Init(JOYMode_TypeDef JoyMode);
00402 void             BSP_JOY_DeInit(void);
00403 JOYState_TypeDef BSP_JOY_GetState(void);
00404 uint8_t          BSP_TS3510_IsDetected(void);
00405 #endif /* USE_IOEXPANDER */
00406
00407 /**
00408   * @}
00409   */
00410
00411 /**
00412   * @}
00413   */
00414
00415 /**
00416   * @}
00417   */
00418
00419 /**
00420   * @}
00421   */
00422
00423 #ifdef __cplusplus
00424 }
00425 #endif
00426
00427 #endif /* __STM32756G_EVAL_H */
00428
00429 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_audio.c Source File

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


STM32756G_EVAL BSP User Manual: stm32756g_eval_audio.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_audio.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_AUDIO_H
00039 #define __STM32756G_EVAL_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 "stm32756g_eval.h"
00049 #include "../../../Middlewares/ST/STM32_Audio/Addons/PDM/pdm_filter.h"
00050
00051 /** @addtogroup BSP
00052   * @{
00053   */
00054
00055 /** @addtogroup STM32756G_EVAL
00056   * @{
00057   */
00058
00059 /** @addtogroup STM32756G_EVAL_AUDIO STM32756G_EVAL AUDIO
00060   * @{
00061   */
00062
00063 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Types STM32756G_EVAL_AUDIO Exported Types
00064   * @{
00065   */
00066 /**
00067   * @}
00068   */
00069
00070 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Constants STM32756G_EVAL_AUDIO Exported Constants
00071   * @{
00072   */
00073
00074 /*------------------------------------------------------------------------------
00075                           USER SAI defines parameters
00076  -----------------------------------------------------------------------------*/
00077 /** CODEC_AudioFrame_SLOT_TDMMode 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 peripheral configuration defines */
00091 #define AUDIO_SAIx                           SAI2_Block_B
00092 #define AUDIO_SAIx_CLK_ENABLE()              __HAL_RCC_SAI2_CLK_ENABLE()
00093 #define AUDIO_SAIx_CLK_DISABLE()             __HAL_RCC_SAI2_CLK_DISABLE()
00094 #define AUDIO_SAIx_SCK_AF                    GPIO_AF8_SAI2
00095 #define AUDIO_SAIx_FS_SD_MCLK_AF             GPIO_AF10_SAI2
00096
00097 #define AUDIO_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOE_CLK_ENABLE()
00098 #define AUDIO_SAIx_MCLK_GPIO_PORT            GPIOE
00099 #define AUDIO_SAIx_MCLK_PIN                  GPIO_PIN_6
00100 #define AUDIO_SAIx_SCK_SD_ENABLE()           __HAL_RCC_GPIOA_CLK_ENABLE()
00101 #define AUDIO_SAIx_SCK_SD_GPIO_PORT          GPIOA
00102 #define AUDIO_SAIx_SCK_PIN                   GPIO_PIN_2
00103 #define AUDIO_SAIx_SD_PIN                    GPIO_PIN_0
00104 #define AUDIO_SAIx_FS_ENABLE()               __HAL_RCC_GPIOG_CLK_ENABLE()
00105 #define AUDIO_SAIx_FS_GPIO_PORT              GPIOG
00106 #define AUDIO_SAIx_FS_PIN                    GPIO_PIN_9
00107
00108
00109 /* SAI DMA Stream definitions */
00110 #define AUDIO_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00111 #define AUDIO_SAIx_DMAx_STREAM               DMA2_Stream6
00112 #define AUDIO_SAIx_DMAx_CHANNEL              DMA_CHANNEL_3
00113 #define AUDIO_SAIx_DMAx_IRQ                  DMA2_Stream6_IRQn
00114 #define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00115 #define AUDIO_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00116 #define DMA_MAX_SZE                          0xFFFF
00117
00118 #define AUDIO_SAIx_DMAx_IRQHandler           DMA2_Stream6_IRQHandler
00119
00120 /* Select the interrupt preemption priority for the DMA interrupt */
00121 #define AUDIO_OUT_IRQ_PREPRIO                ((uint32_t)0x0E)   /* Select the preemption priority level(0 is the highest) */
00122
00123 /*------------------------------------------------------------------------------
00124                         AUDIO IN CONFIGURATION
00125 ------------------------------------------------------------------------------*/
00126 /* SPI Configuration defines */
00127 #define AUDIO_I2Sx                          SPI3
00128 #define AUDIO_I2Sx_CLK_ENABLE()             __HAL_RCC_SPI3_CLK_ENABLE()
00129 #define AUDIO_I2Sx_CLK_DISABLE()            __HAL_RCC_SPI3_CLK_DISABLE()
00130 #define AUDIO_I2Sx_SCK_PIN                   GPIO_PIN_3
00131 #define AUDIO_I2Sx_SCK_GPIO_PORT             GPIOB
00132 #define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00133 #define AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOB_CLK_DISABLE()
00134 #define AUDIO_I2Sx_SCK_AF                    GPIO_AF6_SPI3
00135
00136 #define AUDIO_I2Sx_SD_PIN                   GPIO_PIN_6
00137 #define AUDIO_I2Sx_SD_GPIO_PORT             GPIOD
00138 #define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00139 #define AUDIO_I2Sx_SD_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00140 #define AUDIO_I2Sx_SD_AF                    GPIO_AF5_SPI3
00141
00142 /* I2S DMA Stream Rx definitions */
00143 #define AUDIO_I2Sx_DMAx_CLK_ENABLE()        __HAL_RCC_DMA1_CLK_ENABLE()
00144 #define AUDIO_I2Sx_DMAx_CLK_DISABLE()       __HAL_RCC_DMA1_CLK_DISABLE()
00145 #define AUDIO_I2Sx_DMAx_STREAM              DMA1_Stream2
00146 #define AUDIO_I2Sx_DMAx_CHANNEL             DMA_CHANNEL_0
00147 #define AUDIO_I2Sx_DMAx_IRQ                 DMA1_Stream2_IRQn
00148 #define AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE    DMA_PDATAALIGN_HALFWORD
00149 #define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE       DMA_MDATAALIGN_HALFWORD
00150
00151 #define AUDIO_I2Sx_DMAx_IRQHandler          DMA1_Stream2_IRQHandler
00152
00153 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
00154 #define AUDIO_IN_IRQ_PREPRIO                ((uint32_t)0x0F)   /* Select the preemption priority level(0 is the highest) */
00155
00156
00157 /* Two channels are used:
00158    - one channel as input which is connected to I2S SCK in stereo mode
00159    - one channel as outupt which divides the frequency on the input
00160 */
00161
00162 #define AUDIO_TIMx_CLK_ENABLE()             __HAL_RCC_TIM3_CLK_ENABLE()
00163 #define AUDIO_TIMx_CLK_DISABLE()            __HAL_RCC_TIM3_CLK_DISABLE()
00164 #define AUDIO_TIMx                          TIM3
00165 #define AUDIO_TIMx_IN_CHANNEL               TIM_CHANNEL_1
00166 #define AUDIO_TIMx_OUT_CHANNEL              TIM_CHANNEL_2 /* Select channel 2 as output */
00167 #define AUDIO_TIMx_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOC_CLK_ENABLE()
00168 #define AUDIO_TIMx_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOC_CLK_DISABLE()
00169 #define AUDIO_TIMx_GPIO_PORT                GPIOC
00170 #define AUDIO_TIMx_IN_GPIO_PIN              GPIO_PIN_6
00171 #define AUDIO_TIMx_OUT_GPIO_PIN             GPIO_PIN_7
00172 #define AUDIO_TIMx_AF                       GPIO_AF2_TIM3
00173
00174 /*------------------------------------------------------------------------------
00175              CONFIGURATION: Audio Driver Configuration parameters
00176 ------------------------------------------------------------------------------*/
00177
00178 #define AUDIODATA_SIZE                      2   /* 16-bits audio data size */
00179
00180 /* Audio status definition */
00181 #define AUDIO_OK                            ((uint8_t)0)
00182 #define AUDIO_ERROR                         ((uint8_t)1)
00183 #define AUDIO_TIMEOUT                       ((uint8_t)2)
00184
00185 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
00186 #define DEFAULT_AUDIO_IN_FREQ               I2S_AUDIOFREQ_16K
00187 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     ((uint8_t)16)
00188 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        ((uint8_t)2) /* Mono = 1, Stereo = 2 */
00189 #define DEFAULT_AUDIO_IN_VOLUME             ((uint16_t)64)
00190
00191 /* PDM buffer input size */
00192 #define INTERNAL_BUFF_SIZE                  (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
00193 /* PCM buffer output size */
00194 #define PCM_OUT_SIZE                        (DEFAULT_AUDIO_IN_FREQ/1000*2)
00195 #define CHANNEL_DEMUX_MASK                  ((uint8_t)0x55)
00196
00197 /*------------------------------------------------------------------------------
00198                     OPTIONAL Configuration defines parameters
00199 ------------------------------------------------------------------------------*/
00200
00201 /* Delay for the Codec to be correctly reset */
00202 #define CODEC_RESET_DELAY                   ((uint8_t)5)
00203
00204
00205 /*------------------------------------------------------------------------------
00206                             OUTPUT DEVICES definition
00207 ------------------------------------------------------------------------------*/
00208 /* Alias on existing output devices to adapt for 2 headphones output */
00209 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
00210 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
00211
00212 /**
00213   * @}
00214   */
00215
00216 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Variables STM32756G_EVAL_AUDIO Exported Variables
00217   * @{
00218   */
00219 extern __IO uint16_t AudioInVolume;
00220  /**
00221   * @}
00222   */
00223
00224 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Macros STM32756G_EVAL_AUDIO Exported Macros
00225   * @{
00226   */
00227 #define DMA_MAX(x)           (((x) <= DMA_MAX_SZE)? (x):DMA_MAX_SZE)
00228 /**
00229   * @}
00230   */
00231
00232 /** @defgroup STM32756G_EVAL_AUDIO_OUT_Exported_Functions STM32756G_EVAL_AUDIO_OUT Exported Functions
00233   * @{
00234   */
00235 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00236 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size);
00237 void    BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00238 uint8_t BSP_AUDIO_OUT_Pause(void);
00239 uint8_t BSP_AUDIO_OUT_Resume(void);
00240 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00241 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00242 void    BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00243 void    BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot);
00244 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00245 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00246 void    BSP_AUDIO_OUT_DeInit(void);
00247
00248 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00249 /* This function is called when the requested data has been completely transferred.*/
00250 void    BSP_AUDIO_OUT_TransferComplete_CallBack(void);
00251
00252 /* This function is called when half of the requested buffer has been transferred. */
00253 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(void);
00254
00255 /* This function is called when an Interrupt due to transfer error on or peripheral
00256    error occurs. */
00257 void    BSP_AUDIO_OUT_Error_CallBack(void);
00258
00259 /* These function can be modified in case the current settings (e.g. DMA stream)
00260    need to be changed for specific application needs */
00261 void  BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params);
00262 void  BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00263 void  BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00264
00265 /**
00266   * @}
00267   */
00268
00269 /** @defgroup STM32756G_EVAL_AUDIO_IN_Exported_Functions STM32756G_EVAL_AUDIO_IN Exported Functions
00270   * @{
00271   */
00272 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00273 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
00274 uint8_t BSP_AUDIO_IN_Stop(void);
00275 uint8_t BSP_AUDIO_IN_Pause(void);
00276 uint8_t BSP_AUDIO_IN_Resume(void);
00277 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume);
00278 void    BSP_AUDIO_IN_DeInit(void);
00279 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf);
00280 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00281 /* This function should be implemented by the user application.
00282    It is called into this driver when the current buffer is filled to prepare the next
00283    buffer pointer and its size. */
00284 void    BSP_AUDIO_IN_TransferComplete_CallBack(void);
00285 void    BSP_AUDIO_IN_HalfTransfer_CallBack(void);
00286
00287 /* This function is called when an Interrupt due to transfer error on or peripheral
00288    error occurs. */
00289 void    BSP_AUDIO_IN_Error_Callback(void);
00290
00291 /* These function can be modified in case the current settings (e.g. DMA stream)
00292    need to be changed for specific application needs */
00293 void  BSP_AUDIO_IN_MspInit(I2S_HandleTypeDef *hi2s, void *Params);
00294 void  BSP_AUDIO_IN_MspDeInit(I2S_HandleTypeDef *hi2s, void *Params);
00295 void BSP_AUDIO_IN_ClockConfig(I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params);
00296
00297 /**
00298   * @}
00299   */
00300
00301 /**
00302   * @}
00303   */
00304
00305 /**
00306   * @}
00307   */
00308
00309 /**
00310   * @}
00311   */
00312
00313 #ifdef __cplusplus
00314 }
00315 #endif
00316
00317 #endif /* __STM32756G_EVAL_AUDIO_H */
00318
00319 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_camera.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_camera.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_camera.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Camera modules mounted on
00006   *          STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00007   @verbatim
00008   How to use this driver:
00009   -----------------------
00010    - This driver is used to drive the camera.
00011    - The S5K5CAG 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 - stm32756g_eval.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 - s5k5cag.c
00069 EndDependencies */
00070
00071 /* Includes ------------------------------------------------------------------*/
00072 #include "stm32756g_eval_camera.h"
00073
00074 /** @addtogroup BSP
00075   * @{
00076   */
00077
00078 /** @addtogroup STM32756G_EVAL
00079   * @{
00080   */
00081
00082 /** @defgroup STM32756G_EVAL_CAMERA STM32756G_EVAL CAMERA
00083   * @{
00084   */
00085
00086 /** @defgroup STM32756G_EVAL_CAMERA_Private_TypesDefinitions CAMERA Private TypesDefinitions
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092
00093 /** @defgroup STM32756G_EVAL_CAMERA_Private_Defines CAMERA Private Defines
00094   * @{
00095   */
00096 /**
00097   * @}
00098   */
00099
00100 /** @defgroup STM32756G_EVAL_CAMERA_Private_Macros CAMERA Private Macros
00101   * @{
00102   */
00103 /**
00104   * @}
00105   */
00106
00107 /** @defgroup STM32756G_EVAL_CAMERA_Private_Variables CAMERA Private Variables
00108   * @{
00109   */
00110 DCMI_HandleTypeDef  hDcmiEval;
00111 CAMERA_DrvTypeDef   *camera_drv;
00112 /* Camera current resolution naming (QQVGA, VGA, ...) */
00113 static uint32_t CameraCurrentResolution;
00114
00115 /* Camera module I2C HW address */
00116 static uint32_t CameraHwAddress;
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_CAMERA_Private_FunctionsPrototypes CAMERA Private Functions Prototypes
00122   * @{
00123   */
00124 static uint32_t GetSize(uint32_t resolution);
00125 /**
00126   * @}
00127   */
00128
00129 /** @defgroup STM32756G_EVAL_CAMERA_Private_Functions CAMERA Private Functions
00130   * @{
00131   */
00132
00133 /**
00134   * @brief  Initializes the camera.
00135   * @param  Resolution : camera sensor requested resolution (x, y) : standard resolution
00136   *         naming QQVGA, QVGA, VGA ...
00137   *
00138   * @retval Camera status
00139   */
00140 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
00141 {
00142   DCMI_HandleTypeDef *phdcmi;
00143   uint8_t status = CAMERA_ERROR;
00144
00145   /* Get the DCMI handle structure */
00146   phdcmi = &hDcmiEval;
00147
00148   /*** Configures the DCMI to interface with the camera module ***/
00149   /* DCMI configuration */
00150   phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
00151   phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;
00152   phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
00153   phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
00154   phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
00155   phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
00156   phdcmi->Instance              = DCMI;
00157
00158   /* Configure IO functionalities for CAMERA detect pin */
00159   BSP_IO_Init();
00160
00161   /* Apply Camera Module hardware reset */
00162   BSP_CAMERA_HwReset();
00163
00164   /* Check if the CAMERA Module is plugged on board */
00165   if(BSP_IO_ReadPin(CAM_PLUG_PIN) == BSP_IO_PIN_SET)
00166   {
00167     status = CAMERA_NOT_DETECTED;
00168     return status; /* Exit with error */
00169   }
00170
00171   /* Read ID of Camera module via I2C */
00172   if (s5k5cag_ReadID(CAMERA_I2C_ADDRESS) == S5K5CAG_ID)
00173   {
00174     /* Initialize the camera driver structure */
00175     camera_drv = &s5k5cag_drv;
00176     CameraHwAddress = CAMERA_I2C_ADDRESS;
00177
00178     /* DCMI Initialization */
00179     BSP_CAMERA_MspInit(&hDcmiEval, NULL);
00180     HAL_DCMI_Init(phdcmi);
00181
00182     /* Camera Module Initialization via I2C to the wanted 'Resolution' */
00183     camera_drv->Init(CameraHwAddress, Resolution);
00184
00185     CameraCurrentResolution = Resolution;
00186
00187     /* Return CAMERA_OK status */
00188     status = CAMERA_OK;
00189   }
00190   else
00191   {
00192     /* Return CAMERA_NOT_SUPPORTED status */
00193         status = CAMERA_NOT_SUPPORTED;
00194   }
00195
00196   return status;
00197 }
00198
00199 /**
00200   * @brief  DeInitializes the camera.
00201   * @retval Camera status
00202   */
00203 uint8_t BSP_CAMERA_DeInit(void)
00204 {
00205   hDcmiEval.Instance              = DCMI;
00206
00207   HAL_DCMI_DeInit(&hDcmiEval);
00208   BSP_CAMERA_MspDeInit(&hDcmiEval, NULL);
00209   return CAMERA_OK;
00210 }
00211
00212 /**
00213   * @brief  Starts the camera capture in continuous mode.
00214   * @param  buff: pointer to the camera output buffer
00215   * @retval None
00216   */
00217 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
00218 {
00219   /* Start the camera capture */
00220   HAL_DCMI_Start_DMA(&hDcmiEval, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
00221 }
00222
00223 /**
00224   * @brief  Starts the camera capture in snapshot mode.
00225   * @param  buff: pointer to the camera output buffer
00226   * @retval None
00227   */
00228 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
00229 {
00230   /* Start the camera capture */
00231   HAL_DCMI_Start_DMA(&hDcmiEval, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
00232 }
00233
00234 /**
00235   * @brief Suspend the CAMERA capture
00236
00237   * @retval None
00238   */
00239 void BSP_CAMERA_Suspend(void)
00240 {
00241   /* Suspend the Camera Capture */
00242   HAL_DCMI_Suspend(&hDcmiEval);
00243 }
00244
00245 /**
00246   * @brief Resume the CAMERA capture
00247   * @retval None
00248   */
00249 void BSP_CAMERA_Resume(void)
00250 {
00251   /* Start the Camera Capture */
00252   HAL_DCMI_Resume(&hDcmiEval);
00253 }
00254
00255 /**
00256   * @brief  Stop the CAMERA capture
00257   * @retval Camera status
00258   */
00259 uint8_t BSP_CAMERA_Stop(void)
00260 {
00261   uint8_t status = CAMERA_ERROR;
00262
00263   if(HAL_DCMI_Stop(&hDcmiEval) == HAL_OK)
00264   {
00265      status = CAMERA_OK;
00266   }
00267
00268   /* Set Camera in Power Down */
00269   BSP_CAMERA_PwrDown();
00270
00271   return status;
00272 }
00273
00274 /**
00275   * @brief  CANERA hardware reset
00276   * @retval None
00277   */
00278 void BSP_CAMERA_HwReset(void)
00279 {
00280   /* Camera sensor RESET sequence */
00281   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00282   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00283
00284   /* Assert the camera STANDBY pin (active high)  */
00285   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_SET);
00286
00287   /* Assert the camera RSTI pin (active low) */
00288   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00289
00290   HAL_Delay(100);   /* RST and XSDN signals asserted during 100ms */
00291
00292   /* De-assert the camera STANDBY pin (active high) */
00293   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00294
00295   HAL_Delay(3);     /* RST de-asserted and XSDN asserted during 3ms */
00296
00297   /* De-assert the camera RSTI pin (active low) */
00298   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_SET);
00299
00300   HAL_Delay(6);     /* RST de-asserted during 3ms */
00301 }
00302
00303 /**
00304   * @brief  CAMERA power down
00305   * @retval None
00306   */
00307 void BSP_CAMERA_PwrDown(void)
00308 {
00309   /* Camera power down sequence */
00310   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00311   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00312
00313   /* De-assert the camera STANDBY pin (active high) */
00314   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00315
00316   /* Assert the camera RSTI pin (active low) */
00317   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00318 }
00319
00320 /**
00321   * @brief  Configures the camera contrast and brightness.
00322   * @param  contrast_level: Contrast level
00323   *          This parameter can be one of the following values:
00324   *            @arg  CAMERA_CONTRAST_LEVEL4: for contrast +2
00325   *            @arg  CAMERA_CONTRAST_LEVEL3: for contrast +1
00326   *            @arg  CAMERA_CONTRAST_LEVEL2: for contrast  0
00327   *            @arg  CAMERA_CONTRAST_LEVEL1: for contrast -1
00328   *            @arg  CAMERA_CONTRAST_LEVEL0: for contrast -2
00329   * @param  brightness_level: Contrast level
00330   *          This parameter can be one of the following values:
00331   *            @arg  CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
00332   *            @arg  CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
00333   *            @arg  CAMERA_BRIGHTNESS_LEVEL2: for brightness  0
00334   *            @arg  CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
00335   *            @arg  CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
00336   * @retval None
00337   */
00338 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
00339 {
00340   if(camera_drv->Config != NULL)
00341   {
00342     camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
00343   }
00344 }
00345
00346 /**
00347   * @brief  Configures the camera white balance.
00348   * @param  Mode: black_white mode
00349   *          This parameter can be one of the following values:
00350   *            @arg  CAMERA_BLACK_WHITE_BW
00351   *            @arg  CAMERA_BLACK_WHITE_NEGATIVE
00352   *            @arg  CAMERA_BLACK_WHITE_BW_NEGATIVE
00353   *            @arg  CAMERA_BLACK_WHITE_NORMAL
00354   * @retval None
00355   */
00356 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
00357 {
00358   if(camera_drv->Config != NULL)
00359   {
00360     camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
00361   }
00362 }
00363
00364 /**
00365   * @brief  Configures the camera color effect.
00366   * @param  Effect: Color effect
00367   *          This parameter can be one of the following values:
00368   *            @arg  CAMERA_COLOR_EFFECT_ANTIQUE
00369   *            @arg  CAMERA_COLOR_EFFECT_BLUE
00370   *            @arg  CAMERA_COLOR_EFFECT_GREEN
00371   *            @arg  CAMERA_COLOR_EFFECT_RED
00372   * @retval None
00373   */
00374 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
00375 {
00376   if(camera_drv->Config != NULL)
00377   {
00378     camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
00379   }
00380 }
00381
00382 /**
00383   * @brief  Get the capture size in pixels unit.
00384   * @param  resolution: the current resolution.
00385   * @retval capture size in pixels unit.
00386   */
00387 static uint32_t GetSize(uint32_t resolution)
00388 {
00389   uint32_t size = 0;
00390
00391   /* Get capture size */
00392   switch (resolution)
00393   {
00394   case CAMERA_R160x120:
00395     {
00396       size =  0x2580;
00397     }
00398     break;
00399   case CAMERA_R320x240:
00400     {
00401       size =  0x9600;
00402     }
00403     break;
00404   case CAMERA_R480x272:
00405     {
00406       size =  0xFF00;
00407     }
00408     break;
00409   case CAMERA_R640x480:
00410     {
00411       size =  0x25800;
00412     }
00413     break;
00414   default:
00415     {
00416       break;
00417     }
00418   }
00419
00420   return size;
00421 }
00422
00423 /**
00424   * @brief  Initializes the DCMI MSP.
00425   * @param  hdcmi: pointer to the DCMI handle
00426   * @param  Params
00427   * @retval None
00428   */
00429 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00430 {
00431   static DMA_HandleTypeDef hdma_eval;
00432   GPIO_InitTypeDef gpio_init_structure;
00433
00434   /*** Enable peripherals and GPIO clocks ***/
00435   /* Enable DCMI clock */
00436   __HAL_RCC_DCMI_CLK_ENABLE();
00437
00438   /* Enable DMA2 clock */
00439   __HAL_RCC_DMA2_CLK_ENABLE();
00440
00441   /* Enable GPIO clocks */
00442   __HAL_RCC_GPIOA_CLK_ENABLE();
00443   __HAL_RCC_GPIOB_CLK_ENABLE();
00444   __HAL_RCC_GPIOC_CLK_ENABLE();
00445   __HAL_RCC_GPIOD_CLK_ENABLE();
00446   __HAL_RCC_GPIOE_CLK_ENABLE();
00447
00448   /*** Configure the GPIO ***/
00449   /* Configure DCMI GPIO as alternate function */
00450   /* On STM32756G-EVAL RevB, to use camera, ensure that JP23 is in position 1-2,
00451    * LED3 is then no more usable */
00452   gpio_init_structure.Pin       = GPIO_PIN_4 | GPIO_PIN_6;
00453   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00454   gpio_init_structure.Pull      = GPIO_PULLUP;
00455   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00456   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00457   HAL_GPIO_Init(GPIOA, &gpio_init_structure);
00458
00459   gpio_init_structure.Pin       = GPIO_PIN_7;
00460   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00461   gpio_init_structure.Pull      = GPIO_PULLUP;
00462   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00463   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00464   HAL_GPIO_Init(GPIOB, &gpio_init_structure);
00465
00466   gpio_init_structure.Pin       = GPIO_PIN_6 | GPIO_PIN_7  | GPIO_PIN_8  |\
00467                                   GPIO_PIN_9 | GPIO_PIN_11;
00468   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00469   gpio_init_structure.Pull      = GPIO_PULLUP;
00470   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00471   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00472   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00473
00474   gpio_init_structure.Pin       = GPIO_PIN_3 | GPIO_PIN_6;
00475   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00476   gpio_init_structure.Pull      = GPIO_PULLUP;
00477   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00478   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00479   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00480
00481   gpio_init_structure.Pin       = GPIO_PIN_5 | GPIO_PIN_6;
00482   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00483   gpio_init_structure.Pull      = GPIO_PULLUP;
00484   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00485   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00486   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00487
00488   /*** Configure the DMA ***/
00489   /* Set the parameters to be configured */
00490   hdma_eval.Init.Channel             = DMA_CHANNEL_1;
00491   hdma_eval.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00492   hdma_eval.Init.PeriphInc           = DMA_PINC_DISABLE;
00493   hdma_eval.Init.MemInc              = DMA_MINC_ENABLE;
00494   hdma_eval.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00495   hdma_eval.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00496   hdma_eval.Init.Mode                = DMA_CIRCULAR;
00497   hdma_eval.Init.Priority            = DMA_PRIORITY_HIGH;
00498   hdma_eval.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00499   hdma_eval.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00500   hdma_eval.Init.MemBurst            = DMA_MBURST_SINGLE;
00501   hdma_eval.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00502
00503   hdma_eval.Instance = DMA2_Stream1;
00504
00505   /* Associate the initialized DMA handle to the DCMI handle */
00506   __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_eval);
00507
00508   /*** Configure the NVIC for DCMI and DMA ***/
00509   /* NVIC configuration for DCMI transfer complete interrupt */
00510   HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0);
00511   HAL_NVIC_EnableIRQ(DCMI_IRQn);
00512
00513   /* NVIC configuration for DMA2D transfer complete interrupt */
00514   HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 0x0F, 0);
00515   HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
00516
00517   /* Configure the DMA stream */
00518   HAL_DMA_Init(hdcmi->DMA_Handle);
00519 }
00520
00521
00522 /**
00523   * @brief  DeInitializes the DCMI MSP.
00524   * @param  hdcmi: pointer to the DCMI handle
00525   * @param  Params
00526   * @retval None
00527   */
00528 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00529 {
00530   /* Disable NVIC  for DCMI transfer complete interrupt */
00531   HAL_NVIC_DisableIRQ(DCMI_IRQn);
00532
00533   /* Disable NVIC for DMA2 transfer complete interrupt */
00534   HAL_NVIC_DisableIRQ(DMA2_Stream1_IRQn);
00535
00536   /* Configure the DMA stream */
00537   HAL_DMA_DeInit(hdcmi->DMA_Handle);
00538
00539   /* Disable DCMI clock */
00540   __HAL_RCC_DCMI_CLK_DISABLE();
00541
00542   /* GPIO pins clock and DMA clock can be shut down in the application
00543      by surcharging this __weak function */
00544 }
00545
00546 /**
00547   * @brief  Line event callback
00548   * @param  hdcmi: pointer to the DCMI handle
00549   * @retval None
00550   */
00551 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
00552 {
00553   BSP_CAMERA_LineEventCallback();
00554 }
00555
00556 /**
00557   * @brief  Line Event callback.
00558   * @retval None
00559   */
00560 __weak void BSP_CAMERA_LineEventCallback(void)
00561 {
00562   /* NOTE : This function Should not be modified, when the callback is needed,
00563             the HAL_DCMI_LineEventCallback could be implemented in the user file
00564    */
00565 }
00566
00567 /**
00568   * @brief  VSYNC event callback
00569   * @param  hdcmi: pointer to the DCMI handle
00570   * @retval None
00571   */
00572 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
00573 {
00574   BSP_CAMERA_VsyncEventCallback();
00575 }
00576
00577 /**
00578   * @brief  VSYNC Event callback.
00579   * @retval None
00580   */
00581 __weak void BSP_CAMERA_VsyncEventCallback(void)
00582 {
00583   /* NOTE : This function Should not be modified, when the callback is needed,
00584             the HAL_DCMI_VsyncEventCallback could be implemented in the user file
00585    */
00586 }
00587
00588 /**
00589   * @brief  Frame event callback
00590   * @param  hdcmi: pointer to the DCMI handle
00591   * @retval None
00592   */
00593 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
00594 {
00595   BSP_CAMERA_FrameEventCallback();
00596 }
00597
00598 /**
00599   * @brief  Frame Event callback.
00600   * @retval None
00601   */
00602 __weak void BSP_CAMERA_FrameEventCallback(void)
00603 {
00604   /* NOTE : This function Should not be modified, when the callback is needed,
00605             the HAL_DCMI_FrameEventCallback could be implemented in the user file
00606    */
00607 }
00608
00609 /**
00610   * @brief  Error callback
00611   * @param  hdcmi: pointer to the DCMI handle
00612   * @retval None
00613   */
00614 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
00615 {
00616   BSP_CAMERA_ErrorCallback();
00617 }
00618
00619 /**
00620   * @brief  Error callback.
00621   * @retval None
00622   */
00623 __weak void BSP_CAMERA_ErrorCallback(void)
00624 {
00625   /* NOTE : This function Should not be modified, when the callback is needed,
00626             the HAL_DCMI_ErrorCallback could be implemented in the user file
00627    */
00628 }
00629
00630 /**
00631   * @}
00632   */
00633
00634 /**
00635   * @}
00636   */
00637
00638 /**
00639   * @}
00640   */
00641
00642 /**
00643   * @}
00644   */
00645
00646 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_camera.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_camera.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_camera.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_CAMERA_H
00039 #define __STM32756G_EVAL_CAMERA_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include Camera component Driver */
00047 #include "../Components/s5k5cag/s5k5cag.h"
00048
00049 /* Include IO Driver */
00050 #include "stm32756g_eval_io.h"
00051
00052 /** @addtogroup BSP
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL
00057   * @{
00058   */
00059
00060 /** @addtogroup STM32756G_EVAL_CAMERA
00061   * @{
00062   */
00063
00064 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Types CAMERA Exported Types
00065   * @{
00066   */
00067
00068 /**
00069   * @brief  Camera State structures definition
00070   */
00071 typedef enum
00072 {
00073   CAMERA_OK            = 0x00,
00074   CAMERA_ERROR         = 0x01,
00075   CAMERA_TIMEOUT       = 0x02,
00076   CAMERA_NOT_DETECTED  = 0x03,
00077   CAMERA_NOT_SUPPORTED = 0x04
00078
00079 } Camera_StatusTypeDef;
00080
00081 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00082 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00083 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00084 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00085 /**
00086   * @}
00087   */
00088
00089 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Constants CAMERA Exported Constants
00090   * @{
00091   */
00092 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00093 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Stream1_IRQHandler
00094 /**
00095   * @}
00096   */
00097
00098 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Functions CAMERA Exported Functions
00099   * @{
00100   */
00101 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00102 uint8_t BSP_CAMERA_DeInit(void);
00103 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00104 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00105 void    BSP_CAMERA_Suspend(void);
00106 void    BSP_CAMERA_Resume(void);
00107 uint8_t BSP_CAMERA_Stop(void);
00108 void    BSP_CAMERA_HwReset(void);
00109 void    BSP_CAMERA_PwrDown(void);
00110 void    BSP_CAMERA_LineEventCallback(void);
00111 void    BSP_CAMERA_VsyncEventCallback(void);
00112 void    BSP_CAMERA_FrameEventCallback(void);
00113 void    BSP_CAMERA_ErrorCallback(void);
00114
00115 /* Camera features functions prototype */
00116 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00117 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00118 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00119
00120 /* To be called in DCMI_IRQHandler function */
00121 void    BSP_CAMERA_IRQHandler(void);
00122 /* To be called in DMA2_Stream1_IRQHandler function */
00123 void    BSP_CAMERA_DMA_IRQHandler(void);
00124
00125 /* These functions can be modified in case the current settings (e.g. DMA stream)
00126    need to be changed for specific application needs */
00127 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00128 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00129
00130
00131 /**
00132   * @}
00133   */
00134
00135 /**
00136   * @}
00137   */
00138
00139 /**
00140   * @}
00141   */
00142
00143 /**
00144   * @}
00145   */
00146
00147 #ifdef __cplusplus
00148 }
00149 #endif
00150
00151 #endif /* __STM32756G_EVAL_CAMERA_H */
00152
00153 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_eeprom.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_eeprom.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_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 STM32756G_EVAL
00015                and STM32746G_EVAL boards.
00016                To use this driver you have to connect the ANT7-M24LR-A to CN2
00017                connector of STM32756G_EVAL 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 stm32756g_eval.h file, and the initialization is
00023             performed in EEPROM_IO_Init() function declared in stm32756g_eval.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 - stm32756g_eval.c
00089 EndDependencies */
00090
00091 /* Includes ------------------------------------------------------------------*/
00092 #include "stm32756g_eval_eeprom.h"
00093
00094 /** @addtogroup BSP
00095   * @{
00096   */
00097
00098 /** @addtogroup STM32756G_EVAL
00099   * @{
00100   */
00101
00102 /** @defgroup STM32756G_EVAL_EEPROM  STM32756G_EVAL EEPROM
00103   * @brief This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.
00104   * @{
00105   */
00106
00107 /** @defgroup STM32756G_EVAL_EEPROM_Private_Types EEPROM Private Types
00108   * @{
00109   */
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32756G_EVAL_EEPROM_Private_Defines EEPROM Private Defines
00115   * @{
00116   */
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_EEPROM_Private_Macros EEPROM Private Macros
00122   * @{
00123   */
00124 /**
00125   * @}
00126   */
00127
00128 /** @defgroup STM32756G_EVAL_EEPROM_Private_Variables 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 STM32756G_EVAL_EEPROM_Private_Functions_Prototypes EEPROM Private Functions Prototypes
00139   * @{
00140   */
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32756G_EVAL_EEPROM_Private_Functions EEPROM Private Functions
00146   * @{
00147   */
00148
00149 /**
00150   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00151   * @note   There are 2 different versions of M24LR64 (A01 & A02).
00152   *             Then try to connect on 1st one (EEPROM_I2C_ADDRESS_A01)
00153   *             and if problem, check the 2nd one (EEPROM_I2C_ADDRESS_A02)
00154   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00155   *         different from EEPROM_OK (0)
00156   */
00157 uint32_t BSP_EEPROM_Init(void)
00158 {
00159   /* I2C Initialization */
00160   EEPROM_IO_Init();
00161
00162   /* Select the EEPROM address for A01 and check if OK */
00163   EEPROMAddress = EEPROM_I2C_ADDRESS_A01;
00164   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00165   {
00166     /* Select the EEPROM address for A02 and check if OK */
00167     EEPROMAddress = EEPROM_I2C_ADDRESS_A02;
00168     if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00169     {
00170       return EEPROM_FAIL;
00171     }
00172   }
00173   return EEPROM_OK;
00174 }
00175
00176 /**
00177   * @brief  DeInitializes the EEPROM.
00178   * @retval EEPROM state
00179   */
00180 uint8_t BSP_EEPROM_DeInit(void)
00181 {
00182   /* I2C won't be disabled because common to other functionalities */
00183   return EEPROM_OK;
00184 }
00185
00186 /**
00187   * @brief  Reads a block of data from the EEPROM.
00188   * @param  pBuffer: pointer to the buffer that receives the data read from
00189   *         the EEPROM.
00190   * @param  ReadAddr: EEPROM's internal address to start reading from.
00191   * @param  NumByteToRead: pointer to the variable holding number of bytes to
00192   *         be read from the EEPROM.
00193   *
00194   * @note   The variable pointed by NumByteToRead is reset to 0 when all the
00195   *         data are read from the EEPROM. Application should monitor this
00196   *         variable in order know when the transfer is complete.
00197   *
00198   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00199   *         different from EEPROM_OK (0) or the timeout user callback.
00200   */
00201 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead)
00202 {
00203   uint32_t buffersize = *NumByteToRead;
00204
00205   /* Set the pointer to the Number of data to be read. This pointer will be used
00206      by the DMA Transfer Completer interrupt Handler in order to reset the
00207      variable to 0. User should check on this variable in order to know if the
00208      DMA transfer has been complete or not. */
00209   EEPROMDataRead = *NumByteToRead;
00210
00211   if(EEPROM_IO_ReadData(EEPROMAddress, ReadAddr, pBuffer, buffersize) != HAL_OK)
00212   {
00213     BSP_EEPROM_TIMEOUT_UserCallback();
00214     return EEPROM_FAIL;
00215   }
00216
00217   /* If all operations OK, return EEPROM_OK (0) */
00218   return EEPROM_OK;
00219 }
00220
00221 /**
00222   * @brief  Writes more than one byte to the EEPROM with a single WRITE cycle.
00223   *
00224   * @note   The number of bytes (combined to write start address) must not
00225   *         cross the EEPROM page boundary. This function can only write into
00226   *         the boundaries of an EEPROM page.
00227   *         This function doesn't check on boundaries condition (in this driver
00228   *         the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
00229   *         responsible of checking on Page boundaries).
00230   *
00231   * @param  pBuffer: pointer to the buffer containing the data to be written to
00232   *         the EEPROM.
00233   * @param  WriteAddr: EEPROM's internal address to write to.
00234   * @param  NumByteToWrite: pointer to the variable holding number of bytes to
00235   *         be written into the EEPROM.
00236   *
00237   *        @note The variable pointed by NumByteToWrite is reset to 0 when all the
00238   *              data are written to the EEPROM. Application should monitor this
00239   *              variable in order know when the transfer is complete.
00240   *
00241   *        @note This function just configure the communication and enable the DMA
00242   *              channel to transfer data. Meanwhile, the user application may perform
00243   *              other tasks in parallel.
00244   *
00245   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00246   *         different from EEPROM_OK (0) or the timeout user callback.
00247   */
00248 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite)
00249 {
00250   uint32_t buffersize = *NumByteToWrite;
00251   uint32_t status = EEPROM_OK;
00252
00253   /* Set the pointer to the Number of data to be written. This pointer will be used
00254       by the DMA Transfer Completer interrupt Handler in order to reset the
00255       variable to 0. User should check on this variable in order to know if the
00256       DMA transfer has been complete or not. */
00257   EEPROMDataWrite = *NumByteToWrite;
00258
00259   if(EEPROM_IO_WriteData(EEPROMAddress, WriteAddr, pBuffer, buffersize) != HAL_OK)
00260   {
00261     BSP_EEPROM_TIMEOUT_UserCallback();
00262     status = EEPROM_FAIL;
00263   }
00264
00265   if(BSP_EEPROM_WaitEepromStandbyState() != EEPROM_OK)
00266   {
00267     return EEPROM_FAIL;
00268   }
00269
00270   /* If all operations OK, return EEPROM_OK (0) */
00271   return status;
00272 }
00273
00274 /**
00275   * @brief  Writes buffer of data to the I2C EEPROM.
00276   * @param  pBuffer: pointer to the buffer  containing the data to be written
00277   *         to the EEPROM.
00278   * @param  WriteAddr: EEPROM's internal address to write to.
00279   * @param  NumByteToWrite: number of bytes to write to the EEPROM.
00280   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00281   *         different from EEPROM_OK (0) or the timeout user callback.
00282   */
00283 uint32_t BSP_EEPROM_WriteBuffer(uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
00284 {
00285   uint16_t numofpage = 0, numofsingle = 0, count = 0;
00286   uint16_t addr = 0;
00287   uint8_t  dataindex = 0;
00288   uint32_t status = EEPROM_OK;
00289
00290   addr = WriteAddr % EEPROM_PAGESIZE;
00291   count = EEPROM_PAGESIZE - addr;
00292   numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00293   numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00294
00295   /* If WriteAddr is EEPROM_PAGESIZE aligned */
00296   if(addr == 0)
00297   {
00298     /* If NumByteToWrite < EEPROM_PAGESIZE */
00299     if(numofpage == 0)
00300     {
00301       /* Store the number of data to be written */
00302       dataindex = numofsingle;
00303       /* Start writing data */
00304       status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00305       if(status != EEPROM_OK)
00306       {
00307         return status;
00308       }
00309     }
00310     /* If NumByteToWrite > EEPROM_PAGESIZE */
00311     else
00312     {
00313       while(numofpage--)
00314       {
00315         /* Store the number of data to be written */
00316         dataindex = EEPROM_PAGESIZE;
00317         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00318         if(status != EEPROM_OK)
00319         {
00320           return status;
00321         }
00322
00323         WriteAddr +=  EEPROM_PAGESIZE;
00324         pBuffer += EEPROM_PAGESIZE;
00325       }
00326
00327       if(numofsingle!=0)
00328       {
00329         /* Store the number of data to be written */
00330         dataindex = numofsingle;
00331         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00332         if(status != EEPROM_OK)
00333         {
00334           return status;
00335         }
00336       }
00337     }
00338   }
00339   /* If WriteAddr is not EEPROM_PAGESIZE aligned */
00340   else
00341   {
00342     /* If NumByteToWrite < EEPROM_PAGESIZE */
00343     if(numofpage== 0)
00344     {
00345       /* If the number of data to be written is more than the remaining space
00346       in the current page: */
00347       if(NumByteToWrite > count)
00348       {
00349         /* Store the number of data to be written */
00350         dataindex = count;
00351         /* Write the data contained in same page */
00352         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00353         if(status != EEPROM_OK)
00354         {
00355           return status;
00356         }
00357
00358         /* Store the number of data to be written */
00359         dataindex = (NumByteToWrite - count);
00360         /* Write the remaining data in the following page */
00361         status = BSP_EEPROM_WritePage((uint8_t*)(pBuffer + count), (WriteAddr + count), (uint8_t*)(&dataindex));
00362         if(status != EEPROM_OK)
00363         {
00364           return status;
00365         }
00366       }
00367       else
00368       {
00369         /* Store the number of data to be written */
00370         dataindex = numofsingle;
00371         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00372         if(status != EEPROM_OK)
00373         {
00374           return status;
00375         }
00376       }
00377     }
00378     /* If NumByteToWrite > EEPROM_PAGESIZE */
00379     else
00380     {
00381       NumByteToWrite -= count;
00382       numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00383       numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00384
00385       if(count != 0)
00386       {
00387         /* Store the number of data to be written */
00388         dataindex = count;
00389         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00390         if(status != EEPROM_OK)
00391         {
00392           return status;
00393         }
00394         WriteAddr += count;
00395         pBuffer += count;
00396       }
00397
00398       while(numofpage--)
00399       {
00400         /* Store the number of data to be written */
00401         dataindex = EEPROM_PAGESIZE;
00402         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00403         if(status != EEPROM_OK)
00404         {
00405           return status;
00406         }
00407         WriteAddr +=  EEPROM_PAGESIZE;
00408         pBuffer += EEPROM_PAGESIZE;
00409       }
00410       if(numofsingle != 0)
00411       {
00412         /* Store the number of data to be written */
00413         dataindex = numofsingle;
00414         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00415         if(status != EEPROM_OK)
00416         {
00417           return status;
00418         }
00419       }
00420     }
00421   }
00422
00423   /* If all operations OK, return EEPROM_OK (0) */
00424   return EEPROM_OK;
00425 }
00426
00427 /**
00428   * @brief  Wait for EEPROM Standby state.
00429   *
00430   * @note  This function allows to wait and check that EEPROM has finished the
00431   *        last operation. It is mostly used after Write operation: after receiving
00432   *        the buffer to be written, the EEPROM may need additional time to actually
00433   *        perform the write operation. During this time, it doesn't answer to
00434   *        I2C packets addressed to it. Once the write operation is complete
00435   *        the EEPROM responds to its address.
00436   *
00437   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00438   *         different from EEPROM_OK (0) or the timeout user callback.
00439   */
00440 uint32_t BSP_EEPROM_WaitEepromStandbyState(void)
00441 {
00442   /* Check if the maximum allowed number of trials has bee reached */
00443   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00444   {
00445     /* If the maximum number of trials has been reached, exit the function */
00446     BSP_EEPROM_TIMEOUT_UserCallback();
00447     return EEPROM_TIMEOUT;
00448   }
00449   return EEPROM_OK;
00450 }
00451
00452 /**
00453   * @brief  Basic management of the timeout situation.
00454   * @retval None
00455   */
00456 __weak void BSP_EEPROM_TIMEOUT_UserCallback(void)
00457 {
00458 }
00459
00460 /**
00461   * @}
00462   */
00463
00464 /**
00465   * @}
00466   */
00467
00468 /**
00469   * @}
00470   */
00471
00472 /**
00473   * @}
00474   */
00475
00476 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_eeprom.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_eeprom.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_eeprom.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains all the functions prototypes for
00006   *          the stm32756g_eval_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 __STM32F756G_EVAL_EEPROM_H
00039 #define __STM32F756G_EVAL_EEPROM_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32756g_eval.h"
00047
00048 /** @addtogroup BSP
00049   * @{
00050   */
00051
00052 /** @addtogroup STM32756G_EVAL
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL_EEPROM STM32756G_EVAL EEPROM
00057   * @brief This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.
00058   * @{
00059   */
00060
00061 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Types EEPROM Exported Types
00062   * @{
00063   */
00064 /**
00065   * @}
00066   */
00067
00068 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Constants 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 STM32756G_EVAL_EEPROM_Exported_Macros EEPROM Exported Macros
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092
00093 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Functions 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 /* __STM32756G_EVAL_EEPROM_H */
00137
00138 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_io.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_io.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_io.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the IO pins
00006   *          on STM32756G-EVAL and STM32746G-EVAL evaluation board.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the IO module of the STM32756G-EVAL evaluation
00011      board.
00012    - The MFXSTM32L152 IO expander device component driver must be included with this
00013      driver in order to run the IO functionalities commanded by the IO expander (MFX)
00014      device mounted on the evaluation board.
00015
00016   Driver description:
00017   -------------------
00018   + Initialization steps:
00019      o Initialize the IO module using the BSP_IO_Init() function. This
00020        function includes the MSP layer hardware resources initialization and the
00021        communication layer configuration to start the IO functionalities use.
00022
00023   + IO functionalities use
00024      o The IO pin mode is configured when calling the function BSP_IO_ConfigPin(), you
00025        must specify the desired IO mode by choosing the "IO_ModeTypedef" parameter
00026        predefined value.
00027      o If an IO pin is used in interrupt mode, the function BSP_IO_ITGetStatus() is
00028        needed to get the interrupt status. To clear the IT pending bits, you should
00029        call the function BSP_IO_ITClear() with specifying the IO pending bit to clear.
00030      o The IT is handled using the corresponding external interrupt IRQ handler,
00031        the user IT callback treatment is implemented on the same external interrupt
00032        callback.
00033      o The IRQ_OUT pin (common for all functionalities: JOY, SD, LEDs, etc)  can be
00034        configured using the function BSP_IO_ConfigIrqOutPin()
00035      o To get/set an IO pin combination state you can use the functions
00036        BSP_IO_ReadPin()/BSP_IO_WritePin() or the function BSP_IO_TogglePin() to toggle the pin
00037        state.
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 - stm32756g_eval.h
00071 - mfxstm32l152.c
00072 EndDependencies */
00073
00074 /* Includes ------------------------------------------------------------------*/
00075 #include "stm32756g_eval_io.h"
00076
00077 /** @addtogroup BSP
00078   * @{
00079   */
00080
00081 /** @addtogroup STM32756G_EVAL
00082   * @{
00083   */
00084
00085 /** @defgroup STM32756G_EVAL_IO STM32756G_EVAL IO
00086   * @{
00087   */
00088
00089 /** @defgroup STM32756G_EVAL_IO_Private_Types_Definitions IO Private Types Definitions
00090   * @{
00091   */
00092 /**
00093   * @}
00094   */
00095
00096 /** @defgroup STM32756G_EVAL_IO_Private_Defines IO Private Defines
00097   * @{
00098   */
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32756G_EVAL_IO_Private_Macros IO Private Macros
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_IO_Private_Variables IO Private Variables
00111   * @{
00112   */
00113 static IO_DrvTypeDef *IoDrv = NULL;
00114 static uint8_t mfxstm32l152Identifier;
00115
00116 /**
00117   * @}
00118   */
00119
00120 /** @defgroup STM32756G_EVAL_IO_Private_Functions_Prototypes IO Private Functions Prototypes
00121   * @{
00122   */
00123 /**
00124   * @}
00125   */
00126
00127 /** @defgroup STM32756G_EVAL_IO_Private_Functions IO Private Functions
00128   * @{
00129   */
00130
00131 /**
00132   * @brief  Initializes and configures the IO functionalities and configures all
00133   *         necessary hardware resources (MFX, ...).
00134   * @note   BSP_IO_Init() is using HAL_Delay() function to ensure that MFXSTM32L152
00135   *         IO Expander is correctly reset. HAL_Delay() function provides accurate
00136   *         delay (in milliseconds) based on variable incremented in SysTick ISR.
00137   *         This implies that if BSP_IO_Init() is called from a peripheral ISR process,
00138   *         then the SysTick interrupt must have higher priority (numerically lower)
00139   *         than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
00140   * @retval IO_OK if all initializations are OK. Other value if error.
00141   */
00142 uint8_t BSP_IO_Init(void)
00143 {
00144   uint8_t ret = IO_OK;
00145
00146   if (IoDrv == NULL)  /* Checks if MFX initialization never done */
00147   {
00148     /* Read ID and verify the MFX is ready */
00149     mfxstm32l152Identifier = mfxstm32l152_io_drv.ReadID(IO_I2C_ADDRESS);
00150     if((mfxstm32l152Identifier == MFXSTM32L152_ID_1) || (mfxstm32l152Identifier == MFXSTM32L152_ID_2))
00151     {
00152       /* Initialize the IO driver structure */
00153       IoDrv = &mfxstm32l152_io_drv;
00154
00155       /* Initialize MFX */
00156       IoDrv->Init(IO_I2C_ADDRESS);
00157       IoDrv->Start(IO_I2C_ADDRESS, IO_PIN_ALL);
00158     }
00159     else
00160     {
00161       ret = IO_ERROR;
00162     }
00163   }
00164   else
00165   {
00166     /* MFX initialization already done : do nothing */
00167   }
00168
00169   return ret;
00170 }
00171
00172 /**
00173   * @brief  DeInit allows Mfx Initialization to be executed again
00174   * @note   BSP_IO_Init() has no effect if the IoDrv is already initialized
00175   *         BSP_IO_DeInit() allows to erase the pointer such to allow init to be effective
00176   * @retval IO_OK
00177   */
00178 uint8_t BSP_IO_DeInit(void)
00179 {
00180   IoDrv = NULL;
00181   return IO_OK;
00182 }
00183
00184 /**
00185   * @brief  Gets the selected pins IT status.
00186   * @param  IoPin: Selected pins to check the status.
00187   *          This parameter can be any combination of the IO pins.
00188   * @retval IO_OK if read status OK. Other value if error.
00189   */
00190 uint32_t BSP_IO_ITGetStatus(uint32_t IoPin)
00191 {
00192   /* Return the IO Pin IT status */
00193   return (IoDrv->ITStatus(IO_I2C_ADDRESS, IoPin));
00194 }
00195
00196 /**
00197   * @brief  Clears all the IO IT pending bits.
00198   * @retval None
00199   */
00200 void BSP_IO_ITClear(void)
00201 {
00202   /* Clear all IO IT pending bits */
00203   IoDrv->ClearIT(IO_I2C_ADDRESS, MFXSTM32L152_GPIO_PINS_ALL);
00204 }
00205
00206 /**
00207   * @brief  Configures the IO pin(s) according to IO mode structure value.
00208   * @param  IoPin: IO pin(s) to be configured.
00209   *          This parameter can be one of the following values:
00210   *            @arg  MFXSTM32L152_GPIO_PIN_x: where x can be from 0 to 23.
00211   * @param  IoMode: IO pin mode to configure
00212   *          This parameter can be one of the following values:
00213   *            @arg  IO_MODE_INPUT
00214   *            @arg  IO_MODE_OUTPUT
00215   *            @arg  IO_MODE_IT_RISING_EDGE
00216   *            @arg  IO_MODE_IT_FALLING_EDGE
00217   *            @arg  IO_MODE_IT_LOW_LEVEL
00218   *            @arg  IO_MODE_IT_HIGH_LEVEL
00219   *            @arg  IO_MODE_ANALOG
00220   *            @arg  IO_MODE_OFF
00221   *            @arg  IO_MODE_INPUT_PU,
00222   *            @arg  IO_MODE_INPUT_PD,
00223   *            @arg  IO_MODE_OUTPUT_OD,
00224   *            @arg  IO_MODE_OUTPUT_OD_PU,
00225   *            @arg  IO_MODE_OUTPUT_OD_PD,
00226   *            @arg  IO_MODE_OUTPUT_PP,
00227   *            @arg  IO_MODE_OUTPUT_PP_PU,
00228   *            @arg  IO_MODE_OUTPUT_PP_PD,
00229   *            @arg  IO_MODE_IT_RISING_EDGE_PU
00230   *            @arg  IO_MODE_IT_FALLING_EDGE_PU
00231   *            @arg  IO_MODE_IT_LOW_LEVEL_PU
00232   *            @arg  IO_MODE_IT_HIGH_LEVEL_PU
00233   *            @arg  IO_MODE_IT_RISING_EDGE_PD
00234   *            @arg  IO_MODE_IT_FALLING_EDGE_PD
00235   *            @arg  IO_MODE_IT_LOW_LEVEL_PD
00236   *            @arg  IO_MODE_IT_HIGH_LEVEL_PD
00237   * @retval IO_OK if all initializations are OK. Other value if error.
00238   */
00239 uint8_t BSP_IO_ConfigPin(uint32_t IoPin, IO_ModeTypedef IoMode)
00240 {
00241   /* Configure the selected IO pin(s) mode */
00242   IoDrv->Config(IO_I2C_ADDRESS, IoPin, IoMode);
00243
00244   return IO_OK;
00245 }
00246
00247 /**
00248   * @brief  Sets the IRQ_OUT pin polarity and type
00249   * @param  IoIrqOutPinPolarity: High/Low
00250   * @param  IoIrqOutPinType:     OpenDrain/PushPull
00251   * @retval OK
00252   */
00253 uint8_t BSP_IO_ConfigIrqOutPin(uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
00254 {
00255   if((mfxstm32l152Identifier == MFXSTM32L152_ID_1) || (mfxstm32l152Identifier == MFXSTM32L152_ID_2))
00256   {
00257     /* Initialize the IO driver structure */
00258     mfxstm32l152_SetIrqOutPinPolarity(IO_I2C_ADDRESS, IoIrqOutPinPolarity);
00259     mfxstm32l152_SetIrqOutPinType(IO_I2C_ADDRESS, IoIrqOutPinType);
00260   }
00261
00262   return IO_OK;
00263 }
00264
00265 /**
00266   * @brief  Sets the selected pins state.
00267   * @param  IoPin: Selected pins to write.
00268   *          This parameter can be any combination of the IO pins.
00269   * @param  PinState: New pins state to write
00270   * @retval None
00271   */
00272 void BSP_IO_WritePin(uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
00273 {
00274   /* Set the Pin state */
00275   IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, PinState);
00276 }
00277
00278 /**
00279   * @brief  Gets the selected pins current state.
00280   * @param  IoPin: Selected pins to read.
00281   *          This parameter can be any combination of the IO pins.
00282   * @retval The current pins state
00283   */
00284 uint32_t BSP_IO_ReadPin(uint32_t IoPin)
00285 {
00286  return(IoDrv->ReadPin(IO_I2C_ADDRESS, IoPin));
00287 }
00288
00289 /**
00290   * @brief  Toggles the selected pins state.
00291   * @param  IoPin: Selected pins to toggle.
00292   *          This parameter can be any combination of the IO pins.
00293   * @note   This function is only used to toggle one pin in the same time
00294   * @retval None
00295   */
00296 void BSP_IO_TogglePin(uint32_t IoPin)
00297 {
00298   /* Toggle the current pin state */
00299   if(IoDrv->ReadPin(IO_I2C_ADDRESS, IoPin) != 0) /* Set */
00300   {
00301     IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, 0); /* Reset */
00302   }
00303   else
00304   {
00305     IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, 1); /* Set */
00306   }
00307 }
00308
00309 /**
00310   * @}
00311   */
00312
00313 /**
00314   * @}
00315   */
00316
00317 /**
00318   * @}
00319   */
00320
00321 /**
00322   * @}
00323   */
00324
00325 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_io.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_io.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_io.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_io.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 __STM32756G_EVAL_IO_H
00039 #define __STM32756G_EVAL_IO_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32756g_eval.h"
00047 /* Include IO component driver */
00048 #include "../Components/mfxstm32l152/mfxstm32l152.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32756G_EVAL
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL_IO
00059   * @{
00060   */
00061
00062 /** @defgroup STM32756G_EVAL_IO_Exported_Types IO Exported Types
00063   * @{
00064   */
00065
00066 typedef enum
00067 {
00068   BSP_IO_PIN_RESET = 0,
00069   BSP_IO_PIN_SET   = 1
00070 }BSP_IO_PinStateTypeDef;
00071
00072 typedef enum
00073 {
00074   IO_OK       = 0,
00075   IO_ERROR    = 1,
00076   IO_TIMEOUT  = 2
00077 }IO_StatusTypeDef;
00078 /**
00079   * @}
00080   */
00081
00082 /** @defgroup STM32756G_EVAL_IO_Exported_Constants IO Exported Constants
00083   * @{
00084   */
00085 #define IO_PIN_0                  ((uint32_t)0x0001)
00086 #define IO_PIN_1                  ((uint32_t)0x0002)
00087 #define IO_PIN_2                  ((uint32_t)0x0004)
00088 #define IO_PIN_3                  ((uint32_t)0x0008)
00089 #define IO_PIN_4                  ((uint32_t)0x0010)
00090 #define IO_PIN_5                  ((uint32_t)0x0020)
00091 #define IO_PIN_6                  ((uint32_t)0x0040)
00092 #define IO_PIN_7                  ((uint32_t)0x0080)
00093 #define IO_PIN_8                  ((uint32_t)0x0100)
00094 #define IO_PIN_9                  ((uint32_t)0x0200)
00095 #define IO_PIN_10                 ((uint32_t)0x0400)
00096 #define IO_PIN_11                 ((uint32_t)0x0800)
00097 #define IO_PIN_12                 ((uint32_t)0x1000)
00098 #define IO_PIN_13                 ((uint32_t)0x2000)
00099 #define IO_PIN_14                 ((uint32_t)0x4000)
00100 #define IO_PIN_15                 ((uint32_t)0x8000)
00101 #define IO_PIN_16               ((uint32_t)0x010000)
00102 #define IO_PIN_17               ((uint32_t)0x020000)
00103 #define IO_PIN_18               ((uint32_t)0x040000)
00104 #define IO_PIN_19               ((uint32_t)0x080000)
00105 #define IO_PIN_20               ((uint32_t)0x100000)
00106 #define IO_PIN_21               ((uint32_t)0x200000)
00107 #define IO_PIN_22               ((uint32_t)0x400000)
00108 #define IO_PIN_23               ((uint32_t)0x800000)
00109 #define IO_PIN_ALL              ((uint32_t)0xFFFFFF)
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32756G_EVAL_IO_Exported_Macro IO Exported Macro
00115   * @{
00116   */
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_IO_Exported_Functions IO Exported Functions
00122   * @{
00123   */
00124 uint8_t  BSP_IO_Init(void);
00125 uint8_t  BSP_IO_DeInit(void);
00126 uint8_t  BSP_IO_ConfigIrqOutPin(uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType);
00127 uint32_t BSP_IO_ITGetStatus(uint32_t IoPin);
00128 void     BSP_IO_ITClear(void);
00129 uint8_t  BSP_IO_ConfigPin(uint32_t IoPin, IO_ModeTypedef IoMode);
00130 void     BSP_IO_WritePin(uint32_t IoPin, BSP_IO_PinStateTypeDef PinState);
00131 uint32_t BSP_IO_ReadPin(uint32_t IoPin);
00132 void     BSP_IO_TogglePin(uint32_t IoPin);
00133
00134 /**
00135   * @}
00136   */
00137
00138 /**
00139   * @}
00140   */
00141
00142 /**
00143   * @}
00144   */
00145
00146 /**
00147   * @}
00148   */
00149
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153
00154 #endif /* __STM32756G_EVAL_IO_H */
00155
00156 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_lcd.c Source File

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


STM32756G_EVAL BSP User Manual: stm32756g_eval_lcd.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_LCD_H
00039 #define __STM32756G_EVAL_LCD_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 /* Include LCD component Driver */
00047 /* LCD integrated within MB1063 */
00048 #include "../Components/ampire640480/ampire640480.h"
00049 /* LCD integrated within MB1046 */
00050 #include "../Components/ampire480272/ampire480272.h"
00051
00052 /* Include IOExpander(STMPE811) component Driver */
00053 #include "../Components/stmpe811/stmpe811.h"
00054
00055 /* Include SDRAM Driver */
00056 #include "stm32756g_eval_sdram.h"
00057
00058 #include "stm32756g_eval.h"
00059 #include "../../../Utilities/Fonts/fonts.h"
00060
00061 /** @addtogroup BSP
00062   * @{
00063   */
00064
00065 /** @addtogroup STM32756G_EVAL
00066   * @{
00067   */
00068
00069 /** @addtogroup STM32756G_EVAL_LCD
00070   * @{
00071   */
00072
00073 /** @defgroup STM32756G_EVAL_LCD_Exported_Types LCD Exported Types
00074   * @{
00075   */
00076 typedef struct
00077 {
00078   uint32_t TextColor;
00079   uint32_t BackColor;
00080   sFONT    *pFont;
00081 }LCD_DrawPropTypeDef;
00082
00083 typedef struct
00084 {
00085   int16_t X;
00086   int16_t Y;
00087 }Point, * pPoint;
00088
00089 /**
00090   * @brief  Line mode structures definition
00091   */
00092 typedef enum
00093 {
00094   CENTER_MODE             = 0x01,    /* Center mode */
00095   RIGHT_MODE              = 0x02,    /* Right mode  */
00096   LEFT_MODE               = 0x03     /* Left mode   */
00097 }Text_AlignModeTypdef;
00098
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32756G_EVAL_LCD_Exported_Constants LCD Exported Constants
00104   * @{
00105   */
00106 #define MAX_LAYER_NUMBER       ((uint32_t)2)
00107
00108 #define LCD_LayerCfgTypeDef    LTDC_LayerCfgTypeDef
00109
00110 #define LTDC_ACTIVE_LAYER            ((uint32_t)1) /* Layer 1 */
00111 /**
00112   * @brief  LCD status structure definition
00113   */
00114 #define LCD_OK                 ((uint8_t)0x00)
00115 #define LCD_ERROR              ((uint8_t)0x01)
00116 #define LCD_TIMEOUT            ((uint8_t)0x02)
00117
00118 /**
00119   * @brief  LCD FB_StartAddress
00120   */
00121 #define LCD_FB_START_ADDRESS       ((uint32_t)0xC0000000)
00122
00123
00124 /**
00125   * @brief  LCD Layer_Number
00126   */
00127
00128 /* The programmed LTDC pixel clock depends on the vertical refresh rate of the panel 60Hz => 25.16MHz and
00129    the LCD/SDRAM bandwidth affected by the several access on the bus and the number of used layers.
00130    when only one layer is enabled "LCD_MAX_PCLK" can be used and when two layers are enabled simultaneously
00131    or/and there is several access on the bus "LCD_MIN_PCLK" parameter is recommended */
00132 #define LCD_MAX_PCLK       ((uint8_t)0x00)
00133 #define LCD_MIN_PCLK       ((uint8_t)0x01)
00134
00135
00136 /**
00137   * @brief  LCD color
00138   */
00139 #define LCD_COLOR_BLUE          ((uint32_t)0xFF0000FF)
00140 #define LCD_COLOR_GREEN         ((uint32_t)0xFF00FF00)
00141 #define LCD_COLOR_RED           ((uint32_t)0xFFFF0000)
00142 #define LCD_COLOR_CYAN          ((uint32_t)0xFF00FFFF)
00143 #define LCD_COLOR_MAGENTA       ((uint32_t)0xFFFF00FF)
00144 #define LCD_COLOR_YELLOW        ((uint32_t)0xFFFFFF00)
00145 #define LCD_COLOR_LIGHTBLUE     ((uint32_t)0xFF8080FF)
00146 #define LCD_COLOR_LIGHTGREEN    ((uint32_t)0xFF80FF80)
00147 #define LCD_COLOR_LIGHTRED      ((uint32_t)0xFFFF8080)
00148 #define LCD_COLOR_LIGHTCYAN     ((uint32_t)0xFF80FFFF)
00149 #define LCD_COLOR_LIGHTMAGENTA  ((uint32_t)0xFFFF80FF)
00150 #define LCD_COLOR_LIGHTYELLOW   ((uint32_t)0xFFFFFF80)
00151 #define LCD_COLOR_DARKBLUE      ((uint32_t)0xFF000080)
00152 #define LCD_COLOR_DARKGREEN     ((uint32_t)0xFF008000)
00153 #define LCD_COLOR_DARKRED       ((uint32_t)0xFF800000)
00154 #define LCD_COLOR_DARKCYAN      ((uint32_t)0xFF008080)
00155 #define LCD_COLOR_DARKMAGENTA   ((uint32_t)0xFF800080)
00156 #define LCD_COLOR_DARKYELLOW    ((uint32_t)0xFF808000)
00157 #define LCD_COLOR_WHITE         ((uint32_t)0xFFFFFFFF)
00158 #define LCD_COLOR_LIGHTGRAY     ((uint32_t)0xFFD3D3D3)
00159 #define LCD_COLOR_GRAY          ((uint32_t)0xFF808080)
00160 #define LCD_COLOR_DARKGRAY      ((uint32_t)0xFF404040)
00161 #define LCD_COLOR_BLACK         ((uint32_t)0xFF000000)
00162 #define LCD_COLOR_BROWN         ((uint32_t)0xFFA52A2A)
00163 #define LCD_COLOR_ORANGE        ((uint32_t)0xFFFFA500)
00164 #define LCD_COLOR_TRANSPARENT   ((uint32_t)0xFF000000)
00165
00166 /**
00167   * @brief LCD default font
00168   */
00169 #define LCD_DEFAULT_FONT        Font24
00170
00171 /**
00172   * @brief  LCD Reload Types
00173   */
00174 #define LCD_RELOAD_IMMEDIATE               ((uint32_t)LTDC_SRCR_IMR)
00175 #define LCD_RELOAD_VERTICAL_BLANKING       ((uint32_t)LTDC_SRCR_VBR)
00176
00177 /**
00178   * @}
00179   */
00180
00181 /** @defgroup STM32756G_EVAL_LCD_Exported_Functions LCD Exported Functions
00182   * @{
00183   */
00184 uint8_t  BSP_LCD_Init(void);
00185 uint8_t  BSP_LCD_InitEx(uint32_t PclkConfig);
00186
00187 uint8_t  BSP_LCD_DeInit(void);
00188 uint32_t BSP_LCD_GetXSize(void);
00189 uint32_t BSP_LCD_GetYSize(void);
00190 void     BSP_LCD_SetXSize(uint32_t imageWidthPixels);
00191 void     BSP_LCD_SetYSize(uint32_t imageHeightPixels);
00192
00193 /* Functions using the LTDC controller */
00194 void     BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
00195 void     BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
00196 void     BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency);
00197 void     BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
00198 void     BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address);
00199 void     BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
00200 void     BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue);
00201 void     BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
00202 void     BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex);
00203 void     BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00204 void     BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00205 void     BSP_LCD_SelectLayer(uint32_t LayerIndex);
00206 void     BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
00207 void     BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State);
00208 void     BSP_LCD_Relaod(uint32_t ReloadType);
00209
00210 void     BSP_LCD_SetTextColor(uint32_t Color);
00211 uint32_t BSP_LCD_GetTextColor(void);
00212 void     BSP_LCD_SetBackColor(uint32_t Color);
00213 uint32_t BSP_LCD_GetBackColor(void);
00214 void     BSP_LCD_SetFont(sFONT *fonts);
00215 sFONT    *BSP_LCD_GetFont(void);
00216
00217 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00218 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
00219 void     BSP_LCD_Clear(uint32_t Color);
00220 void     BSP_LCD_ClearStringLine(uint32_t Line);
00221 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00222 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
00223 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00224
00225 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00226 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00227 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00228 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00229 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00230 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00231 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00232 void     BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
00233
00234 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00235 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00236 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00237 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00238
00239 void     BSP_LCD_DisplayOff(void);
00240 void     BSP_LCD_DisplayOn(void);
00241
00242 /* These functions can be modified in case the current settings
00243    need to be changed for specific application needs */
00244 void     BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params);
00245 void     BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params);
00246 void     BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params);
00247
00248 /**
00249   * @}
00250   */
00251
00252 /**
00253   * @}
00254   */
00255
00256 /**
00257   * @}
00258   */
00259
00260 /**
00261   * @}
00262   */
00263
00264 #ifdef __cplusplus
00265 }
00266 #endif
00267
00268 #endif /* __STM32756G_EVAL_LCD_H */
00269
00270 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_nor.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_nor.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_nor.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the PC28F128M29EWLA NOR flash memory
00006   *          device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the PC28F128M29EWLA NOR flash external memory mounted
00011      on STM32756G-EVAL evaluation board.
00012    - This driver does not need a specific component driver for the NOR device
00013      to be included with.
00014
00015   Driver description:
00016   ------------------
00017   + Initialization steps:
00018      o Initialize the NOR external memory using the BSP_NOR_Init() function. This
00019        function includes the MSP layer hardware resources initialization and the
00020        FMC controller configuration to interface with the external NOR memory.
00021
00022   + NOR flash operations
00023      o NOR external 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_NOR_ReadData()/BSP_NOR_WriteData(). The BSP_NOR_WriteData() performs write operation
00027        of an amount of data by unit (halfword). You can also perform a program data
00028        operation of an amount of data using the function BSP_NOR_ProgramData().
00029      o The function BSP_NOR_Read_ID() returns the chip IDs stored in the structure
00030        "NOR_IDTypeDef". (see the NOR IDs in the memory data sheet)
00031      o Perform erase block operation using the function BSP_NOR_Erase_Block() and by
00032        specifying the block address. You can perform an erase operation of the whole
00033        chip by calling the function BSP_NOR_Erase_Chip().
00034      o After other operations, the function BSP_NOR_ReturnToReadMode() allows the NOR
00035        flash to return to read mode to perform read operations on it.
00036   @endverbatim
00037   ******************************************************************************
00038   * @attention
00039   *
00040   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00041   *
00042   * Redistribution and use in source and binary forms, with or without modification,
00043   * are permitted provided that the following conditions are met:
00044   *   1. Redistributions of source code must retain the above copyright notice,
00045   *      this list of conditions and the following disclaimer.
00046   *   2. Redistributions in binary form must reproduce the above copyright notice,
00047   *      this list of conditions and the following disclaimer in the documentation
00048   *      and/or other materials provided with the distribution.
00049   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00050   *      may be used to endorse or promote products derived from this software
00051   *      without specific prior written permission.
00052   *
00053   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00054   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00055   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00056   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00057   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00058   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00059   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00060   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00061   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00062   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00063   *
00064   ******************************************************************************
00065   */
00066
00067 /* Dependencies
00068 - stm32f7xx_hal_nor.c
00069 - stm32f7xx_ll_fmc.c
00070 - stm32f7xx_hal_gpio.c
00071 - stm32f7xx_hal_rcc_ex.h
00072 EndDependencies */
00073
00074 /* Includes ------------------------------------------------------------------*/
00075 #include "stm32756g_eval_nor.h"
00076
00077 /** @addtogroup BSP
00078   * @{
00079   */
00080
00081 /** @addtogroup STM32756G_EVAL
00082   * @{
00083   */
00084
00085 /** @defgroup STM32756G_EVAL_NOR STM32756G_EVAL NOR
00086   * @{
00087   */
00088
00089 /* Private typedef -----------------------------------------------------------*/
00090
00091 /** @defgroup STM32756G_EVAL_NOR_Private_Types_Definitions NOR Private Types Definitions
00092   * @{
00093   */
00094 /**
00095   * @}
00096   */
00097 /* Private define ------------------------------------------------------------*/
00098
00099 /** @defgroup STM32756G_EVAL_NOR_Private_Defines NOR Private Defines
00100   * @{
00101   */
00102 /**
00103   * @}
00104   */
00105 /* Private macro -------------------------------------------------------------*/
00106
00107 /** @defgroup STM32756G_EVAL_NOR_Private_Macros NOR Private Macros
00108   * @{
00109   */
00110 /**
00111   * @}
00112   */
00113 /* Private variables ---------------------------------------------------------*/
00114
00115 /** @defgroup STM32756G_EVAL_NOR_Private_Variables NOR Private Variables
00116   * @{
00117   */
00118 static NOR_HandleTypeDef norHandle;
00119 static FMC_NORSRAM_TimingTypeDef Timing;
00120
00121 /**
00122   * @}
00123   */
00124
00125 /* Private function prototypes -----------------------------------------------*/
00126
00127 /** @defgroup STM32756G_EVAL_NOR_Private_Functions_Prototypes NOR Private Functions Prototypes
00128   * @{
00129   */
00130 /**
00131   * @}
00132   */
00133 /* Private functions ---------------------------------------------------------*/
00134
00135 /** @defgroup STM32756G_EVAL_NOR_Private_Functions NOR Private Functions
00136   * @{
00137   */
00138
00139 /**
00140   * @brief  Initializes the NOR device.
00141   * @retval NOR memory status
00142   */
00143 uint8_t BSP_NOR_Init(void)
00144 {
00145   static uint8_t nor_status = NOR_STATUS_ERROR;
00146   norHandle.Instance  = FMC_NORSRAM_DEVICE;
00147   norHandle.Extended  = FMC_NORSRAM_EXTENDED_DEVICE;
00148
00149   /* NOR device configuration */
00150   /* Timing configuration derived from system clock (up to 216Mhz)
00151      for 108Mhz as NOR clock frequency */
00152   Timing.AddressSetupTime      = 4;
00153   Timing.AddressHoldTime       = 3;
00154   Timing.DataSetupTime         = 8;
00155   Timing.BusTurnAroundDuration = 1;
00156   Timing.CLKDivision           = 2;
00157   Timing.DataLatency           = 2;
00158   Timing.AccessMode            = FMC_ACCESS_MODE_A;
00159
00160   norHandle.Init.NSBank             = FMC_NORSRAM_BANK1;
00161   norHandle.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
00162   norHandle.Init.MemoryType         = FMC_MEMORY_TYPE_NOR;
00163   norHandle.Init.MemoryDataWidth    = NOR_MEMORY_WIDTH;
00164   norHandle.Init.BurstAccessMode    = NOR_BURSTACCESS;
00165   norHandle.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
00166   norHandle.Init.WaitSignalActive   = FMC_WAIT_TIMING_BEFORE_WS;
00167   norHandle.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
00168   norHandle.Init.WaitSignal         = FMC_WAIT_SIGNAL_ENABLE;
00169   norHandle.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
00170   norHandle.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_ENABLE;
00171   norHandle.Init.WriteBurst         = NOR_WRITEBURST;
00172   norHandle.Init.ContinuousClock    = CONTINUOUSCLOCK_FEATURE;
00173
00174   /* NOR controller initialization */
00175   BSP_NOR_MspInit(&norHandle, NULL); /* __weak function can be rewritten by the application */
00176
00177   if(HAL_NOR_Init(&norHandle, &Timing, &Timing) != HAL_OK)
00178   {
00179     nor_status = NOR_STATUS_ERROR;
00180   }
00181   else
00182   {
00183     nor_status = NOR_STATUS_OK;
00184   }
00185   return nor_status;
00186 }
00187
00188 /**
00189   * @brief  DeInitializes the NOR device.
00190   * @retval NOR status
00191   */
00192 uint8_t BSP_NOR_DeInit(void)
00193 {
00194   static uint8_t nor_status = NOR_ERROR;
00195   /* NOR device de-initialization */
00196   norHandle.Instance = FMC_NORSRAM_DEVICE;
00197   norHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00198
00199   if(HAL_NOR_DeInit(&norHandle) != HAL_OK)
00200   {
00201     nor_status = NOR_STATUS_ERROR;
00202   }
00203   else
00204   {
00205     nor_status = NOR_STATUS_OK;
00206   }
00207
00208   /* NOR controller de-initialization */
00209   BSP_NOR_MspDeInit(&norHandle, NULL);
00210
00211   return nor_status;
00212 }
00213
00214 /**
00215   * @brief  Reads an amount of data from the NOR device.
00216   * @param  uwStartAddress: Read start address
00217   * @param  pData: Pointer to data to be read
00218   * @param  uwDataSize: Size of data to read
00219   * @retval NOR memory status
00220   */
00221 uint8_t BSP_NOR_ReadData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00222 {
00223   if(HAL_NOR_ReadBuffer(&norHandle, NOR_DEVICE_ADDR + uwStartAddress, pData, uwDataSize) != HAL_OK)
00224   {
00225     return NOR_STATUS_ERROR;
00226   }
00227   else
00228   {
00229     return NOR_STATUS_OK;
00230   }
00231 }
00232
00233 /**
00234   * @brief  Returns the NOR memory to read mode.
00235   * @retval None
00236   */
00237 void BSP_NOR_ReturnToReadMode(void)
00238 {
00239    HAL_NOR_ReturnToReadMode(&norHandle);
00240 }
00241
00242 /**
00243   * @brief  Writes an amount of data to the NOR device.
00244   * @param  uwStartAddress: Write start address
00245   * @param  pData: Pointer to data to be written
00246   * @param  uwDataSize: Size of data to write
00247   * @retval NOR memory status
00248   */
00249 uint8_t BSP_NOR_WriteData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00250 {
00251   uint32_t index = uwDataSize;
00252
00253   while(index > 0)
00254   {
00255     /* Write data to NOR */
00256     HAL_NOR_Program(&norHandle, (uint32_t *)(NOR_DEVICE_ADDR + uwStartAddress), pData);
00257
00258     /* Read NOR device status */
00259     if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, PROGRAM_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00260     {
00261       return NOR_STATUS_ERROR;
00262     }
00263
00264     /* Update the counters */
00265     index--;
00266     uwStartAddress += 2;
00267     pData++;
00268   }
00269
00270   return NOR_STATUS_OK;
00271 }
00272
00273 /**
00274   * @brief  Programs an amount of data to the NOR device.
00275   * @param  uwStartAddress: Write start address
00276   * @param  pData: Pointer to data to be written
00277   * @param  uwDataSize: Size of data to write
00278   * @retval NOR memory status
00279   */
00280 uint8_t BSP_NOR_ProgramData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00281 {
00282   /* Send NOR program buffer operation */
00283   HAL_NOR_ProgramBuffer(&norHandle, uwStartAddress, pData, uwDataSize);
00284
00285   /* Return the NOR memory status */
00286   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, PROGRAM_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00287   {
00288     return NOR_STATUS_ERROR;
00289   }
00290   else
00291   {
00292     return NOR_STATUS_OK;
00293   }
00294 }
00295
00296 /**
00297   * @brief  Erases the specified block of the NOR device.
00298   * @param  BlockAddress: Block address to erase
00299   * @retval NOR memory status
00300   */
00301 uint8_t BSP_NOR_Erase_Block(uint32_t BlockAddress)
00302 {
00303   /* Send NOR erase block operation */
00304   HAL_NOR_Erase_Block(&norHandle, BlockAddress, NOR_DEVICE_ADDR);
00305
00306   /* Return the NOR memory status */
00307   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, BLOCKERASE_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00308   {
00309     return NOR_STATUS_ERROR;
00310   }
00311   else
00312   {
00313     return NOR_STATUS_OK;
00314   }
00315 }
00316
00317 /**
00318   * @brief  Erases the entire NOR chip.
00319   * @retval NOR memory status
00320   */
00321 uint8_t BSP_NOR_Erase_Chip(void)
00322 {
00323   /* Send NOR Erase chip operation */
00324   HAL_NOR_Erase_Chip(&norHandle, NOR_DEVICE_ADDR);
00325
00326   /* Return the NOR memory status */
00327   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, CHIPERASE_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00328   {
00329     return NOR_STATUS_ERROR;
00330   }
00331   else
00332   {
00333     return NOR_STATUS_OK;
00334   }
00335 }
00336
00337 /**
00338   * @brief  Reads NOR flash IDs.
00339   * @param  pNOR_ID : Pointer to NOR ID structure
00340   * @retval NOR memory status
00341   */
00342 uint8_t BSP_NOR_Read_ID(NOR_IDTypeDef *pNOR_ID)
00343 {
00344   if(HAL_NOR_Read_ID(&norHandle, pNOR_ID) != HAL_OK)
00345   {
00346     return NOR_STATUS_ERROR;
00347   }
00348   else
00349   {
00350     return NOR_STATUS_OK;
00351   }
00352 }
00353
00354 /**
00355   * @brief  Initializes the NOR MSP.
00356   * @param  hnor: NOR handle
00357   * @param  Params
00358   * @retval None
00359   */
00360 __weak void BSP_NOR_MspInit(NOR_HandleTypeDef *hnor, void *Params)
00361 {
00362   GPIO_InitTypeDef gpio_init_structure;
00363
00364   /* Enable FMC clock */
00365   __HAL_RCC_FMC_CLK_ENABLE();
00366
00367   /* Enable GPIOs clock */
00368   __HAL_RCC_GPIOD_CLK_ENABLE();
00369   __HAL_RCC_GPIOE_CLK_ENABLE();
00370   __HAL_RCC_GPIOF_CLK_ENABLE();
00371   __HAL_RCC_GPIOG_CLK_ENABLE();
00372
00373   /* Common GPIO configuration */
00374   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00375   gpio_init_structure.Pull      = GPIO_PULLUP;
00376   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00377   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00378
00379   /* GPIOD configuration */
00380   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6   |\
00381                               GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 |\
00382                               GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00383   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00384
00385   /* GPIOE configuration */
00386   gpio_init_structure.Pin   = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6   |\
00387                               GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 |\
00388                               GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00389   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00390
00391   /* GPIOF configuration */
00392   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00393                               GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00394   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00395
00396   /* GPIOG configuration */
00397   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00398                               GPIO_PIN_5;
00399   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00400 }
00401
00402 /**
00403   * @brief  DeInitializes NOR MSP.
00404   * @param  hnor: NOR handle
00405   * @param  Params
00406   * @retval None
00407   */
00408 __weak void BSP_NOR_MspDeInit(NOR_HandleTypeDef  *hnor, void *Params)
00409 {
00410     /* GPIO pins clock, FMC clock can be shut down in the application
00411        by surcharging this __weak function */
00412 }
00413
00414 /**
00415   * @brief  NOR BSP Wait for Ready/Busy signal.
00416   * @param  hnor: Pointer to NOR handle
00417   * @param  Timeout: Timeout duration
00418   * @retval None
00419   */
00420 void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout)
00421 {
00422   uint32_t timeout = Timeout;
00423
00424   /* Polling on Ready/Busy signal */
00425   while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_BUSY_STATE) && (timeout > 0))
00426   {
00427     timeout--;
00428   }
00429
00430   timeout = Timeout;
00431
00432   /* Polling on Ready/Busy signal */
00433   while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_READY_STATE) && (timeout > 0))
00434   {
00435     timeout--;
00436   }
00437 }
00438
00439 /**
00440   * @}
00441   */
00442
00443 /**
00444   * @}
00445   */
00446
00447 /**
00448   * @}
00449   */
00450
00451 /**
00452   * @}
00453   */
00454
00455
00456 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_nor.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_nor.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_nor.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_nor.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 __STM32756G_EVAL_NOR_H
00039 #define __STM32756G_EVAL_NOR_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 STM32756G_EVAL
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL_NOR
00057   * @{
00058   */
00059
00060 /** @defgroup STM32756G_EVAL_NOR_Exported_Types NOR Exported Types
00061   * @{
00062   */
00063 /**
00064   * @}
00065   */
00066
00067 /**
00068   * @brief  NOR status structure definition
00069   */
00070 #define   NOR_STATUS_OK         ((uint8_t)0x00)
00071 #define   NOR_STATUS_ERROR      ((uint8_t)0x01)
00072
00073 /** @defgroup STM32756G_EVAL_NOR_Exported_Constants NOR Exported Constants
00074   * @{
00075   */
00076 #define NOR_DEVICE_ADDR  ((uint32_t)0x60000000)
00077
00078 /* #define NOR_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8  */
00079 #define NOR_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00080
00081 #define NOR_BURSTACCESS    FMC_BURST_ACCESS_MODE_DISABLE
00082 /* #define NOR_BURSTACCESS    FMC_BURST_ACCESS_MODE_ENABLE*/
00083
00084 #define NOR_WRITEBURST    FMC_WRITE_BURST_DISABLE
00085 /* #define NOR_WRITEBURST   FMC_WRITE_BURST_ENABLE */
00086
00087 #define CONTINUOUSCLOCK_FEATURE    FMC_CONTINUOUS_CLOCK_SYNC_ONLY
00088 /* #define CONTINUOUSCLOCK_FEATURE     FMC_CONTINUOUS_CLOCK_SYNC_ASYNC */
00089
00090 /* NOR operations Timeout definitions */
00091 #define BLOCKERASE_TIMEOUT   ((uint32_t)0x00A00000)  /* NOR block erase timeout */
00092 #define CHIPERASE_TIMEOUT    ((uint32_t)0x30000000)  /* NOR chip erase timeout  */
00093 #define PROGRAM_TIMEOUT      ((uint32_t)0x00004400)  /* NOR program timeout     */
00094
00095 /* NOR Ready/Busy signal GPIO definitions */
00096 #define NOR_READY_BUSY_PIN    GPIO_PIN_6
00097 #define NOR_READY_BUSY_GPIO   GPIOD
00098 #define NOR_READY_STATE       GPIO_PIN_SET
00099 #define NOR_BUSY_STATE        GPIO_PIN_RESET
00100 /**
00101   * @}
00102   */
00103
00104 /** @defgroup STM32756G_EVAL_NOR_Exported_Macro NOR Exported Macro
00105   * @{
00106   */
00107 /**
00108   * @}
00109   */
00110
00111 /** @defgroup STM32756G_EVAL_NOR_Exported_Functions NOR Exported Functions
00112   * @{
00113   */
00114 uint8_t BSP_NOR_Init(void);
00115 uint8_t BSP_NOR_DeInit(void);
00116 uint8_t BSP_NOR_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00117 uint8_t BSP_NOR_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00118 uint8_t BSP_NOR_ProgramData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00119 uint8_t BSP_NOR_Erase_Block(uint32_t BlockAddress);
00120 uint8_t BSP_NOR_Erase_Chip(void);
00121 uint8_t BSP_NOR_Read_ID(NOR_IDTypeDef *pNOR_ID);
00122 void BSP_NOR_ReturnToReadMode(void);
00123
00124 /* These functions can be modified in case the current settings (e.g. DMA stream)
00125    need to be changed for specific application needs */
00126 void    BSP_NOR_MspInit(NOR_HandleTypeDef  *hnor, void *Params);
00127 void    BSP_NOR_MspDeInit(NOR_HandleTypeDef  *hnor, void *Params);
00128
00129 /**
00130   * @}
00131   */
00132
00133 /**
00134   * @}
00135   */
00136
00137 /**
00138   * @}
00139   */
00140
00141 /**
00142   * @}
00143   */
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148
00149 #endif /* __STM32756G_EVAL_NOR_H */
00150
00151 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_qspi.c Source File

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


STM32756G_EVAL BSP User Manual: stm32756g_eval_qspi.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_qspi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 STM32756G_EVAL
00042   * @{
00043   */
00044
00045 /* Define to prevent recursive inclusion -------------------------------------*/
00046 #ifndef __STM32756G_EVAL_QSPI_H
00047 #define __STM32756G_EVAL_QSPI_H
00048
00049 #ifdef __cplusplus
00050  extern "C" {
00051 #endif
00052
00053 /* Includes ------------------------------------------------------------------*/
00054 #include "stm32f7xx_hal.h"
00055 #include "../Components/n25q512a/n25q512a.h"
00056
00057 /** @addtogroup STM32756G_EVAL_QSPI
00058   * @{
00059   */
00060
00061
00062 /* Exported constants --------------------------------------------------------*/
00063 /** @defgroup STM32756G_EVAL_QSPI_Exported_Constants 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_GPIOF_CLK_ENABLE()
00080 #define QSPI_D1_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00081 #define QSPI_D2_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00082 #define QSPI_D3_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_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_8
00093 #define QSPI_D0_GPIO_PORT          GPIOF
00094 #define QSPI_D1_PIN                GPIO_PIN_9
00095 #define QSPI_D1_GPIO_PORT          GPIOF
00096 #define QSPI_D2_PIN                GPIO_PIN_7
00097 #define QSPI_D2_GPIO_PORT          GPIOF
00098 #define QSPI_D3_PIN                GPIO_PIN_6
00099 #define QSPI_D3_GPIO_PORT          GPIOF
00100
00101 /* N25Q512A13GSF40E Micron memory */
00102 /* Size of the flash */
00103 #define QSPI_FLASH_SIZE            25     /* 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 STM32756G_EVAL_QSPI_Exported_Types 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 STM32756G_EVAL_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 /* __STM32756G_EVAL_QSPI_H */
00162 /**
00163   * @}
00164   */
00165
00166 /**
00167   * @}
00168   */
00169
00170 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_sd.c Source File

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


STM32756G_EVAL BSP User Manual: stm32756g_eval_sd.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_SD_H
00039 #define __STM32756G_EVAL_SD_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32f7xx_hal.h"
00047 #include "stm32756g_eval_io.h"
00048
00049 /** @addtogroup BSP
00050   * @{
00051   */
00052
00053 /** @addtogroup STM32756G_EVAL
00054   * @{
00055   */
00056
00057 /** @addtogroup STM32756G_EVAL_SD
00058   * @{
00059   */
00060
00061 /** @defgroup STM32756G_EVAL_SD_Exported_Types SD Exported Types
00062   * @{
00063   */
00064
00065 /**
00066   * @brief SD Card information structure
00067   */
00068 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00069 /**
00070   * @}
00071   */
00072
00073 /**
00074   * @brief  SD status structure definition
00075   */
00076 #define   MSD_OK                        ((uint8_t)0x00)
00077 #define   MSD_ERROR                     ((uint8_t)0x01)
00078 #define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00079
00080 /**
00081   * @brief  SD transfer state definition
00082   */
00083 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00084 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00085
00086 /** @defgroup STM32756G_EVAL_SD_Exported_Constants SD Exported Constants
00087   * @{
00088   */
00089 #define SD_PRESENT               ((uint8_t)0x01)
00090 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00091
00092 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00093
00094 /* DMA definitions for SD DMA transfer */
00095 #define __DMAx_TxRx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00096 #define SD_DMAx_Tx_CHANNEL                DMA_CHANNEL_4
00097 #define SD_DMAx_Rx_CHANNEL                DMA_CHANNEL_4
00098 #define SD_DMAx_Tx_STREAM                 DMA2_Stream6
00099 #define SD_DMAx_Rx_STREAM                 DMA2_Stream3
00100 #define SD_DMAx_Tx_IRQn                   DMA2_Stream6_IRQn
00101 #define SD_DMAx_Rx_IRQn                   DMA2_Stream3_IRQn
00102 #define BSP_SDMMC_IRQHandler              SDMMC1_IRQHandler
00103 #define BSP_SDMMC_DMA_Tx_IRQHandler       DMA2_Stream6_IRQHandler
00104 #define BSP_SDMMC_DMA_Rx_IRQHandler       DMA2_Stream3_IRQHandler
00105 #define SD_DetectIRQHandler()             HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_SD_Exported_Macro SD Exported Macro
00111   * @{
00112   */
00113 /**
00114   * @}
00115   */
00116
00117 /** @defgroup STM32756G_EVAL_SD_Exported_Functions SD Exported Functions
00118   * @{
00119   */
00120 uint8_t BSP_SD_Init(void);
00121 uint8_t BSP_SD_DeInit(void);
00122 uint8_t BSP_SD_ITConfig(void);
00123 void    BSP_SD_DetectIT(void);
00124 void    BSP_SD_DetectCallback(void);
00125 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00126 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00127 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00128 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00129 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00130 uint8_t BSP_SD_GetCardState(void);
00131 void    BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo);
00132 uint8_t BSP_SD_IsDetected(void);
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_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00137 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00138 void    BSP_SD_AbortCallback(void);
00139 void    BSP_SD_WriteCpltCallback(void);
00140 void    BSP_SD_ReadCpltCallback(void);
00141 /**
00142   * @}
00143   */
00144
00145 /**
00146   * @}
00147   */
00148
00149 /**
00150   * @}
00151   */
00152
00153 /**
00154   * @}
00155   */
00156
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160
00161 #endif /* __STM32756G_EVAL_SD_H */
00162
00163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_sdram.c Source File

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


STM32756G_EVAL BSP User Manual: stm32756g_eval_sdram.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_sdram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_sdram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_SDRAM_H
00039 #define __STM32756G_EVAL_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 STM32756G_EVAL
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL_SDRAM
00057   * @{
00058   */
00059
00060 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Types 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 STM32756G_EVAL_SDRAM_Exported_Constants 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 #define SDRAM_MEMORY_WIDTH               FMC_SDRAM_MEM_BUS_WIDTH_32
00079
00080 #define SDCLOCK_PERIOD                   FMC_SDRAM_CLOCK_PERIOD_2
00081 /* #define SDCLOCK_PERIOD                FMC_SDRAM_CLOCK_PERIOD_3 */
00082
00083 #define REFRESH_COUNT                    ((uint32_t)0x0603)   /* SDRAM refresh counter (100Mhz SD clock) */
00084
00085 #define SDRAM_TIMEOUT                    ((uint32_t)0xFFFF)
00086
00087 /* DMA definitions for SDRAM DMA transfer */
00088 #define __DMAx_CLK_ENABLE                 __HAL_RCC_DMA2_CLK_ENABLE
00089 #define __DMAx_CLK_DISABLE                __HAL_RCC_DMA2_CLK_DISABLE
00090 #define SDRAM_DMAx_CHANNEL                DMA_CHANNEL_0
00091 #define SDRAM_DMAx_STREAM                 DMA2_Stream0
00092 #define SDRAM_DMAx_IRQn                   DMA2_Stream0_IRQn
00093 #define BSP_SDRAM_DMA_IRQHandler          DMA2_Stream0_IRQHandler
00094 /**
00095   * @}
00096   */
00097
00098 /**
00099   * @brief  FMC SDRAM Mode definition register defines
00100   */
00101 #define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
00102 #define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
00103 #define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
00104 #define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
00105 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
00106 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
00107 #define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
00108 #define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
00109 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
00110 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
00111 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)
00112 /**
00113   * @}
00114   */
00115
00116 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Macro SDRAM Exported Macro
00117   * @{
00118   */
00119 /**
00120   * @}
00121   */
00122
00123 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Functions SDRAM Exported Functions
00124   * @{
00125   */
00126 uint8_t BSP_SDRAM_Init(void);
00127 uint8_t BSP_SDRAM_DeInit(void);
00128 void    BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
00129 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00130 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00131 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00132 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00133 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
00134
00135 /* These functions can be modified in case the current settings (e.g. DMA stream)
00136    need to be changed for specific application needs */
00137 void    BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00138 void    BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00139
00140
00141 /**
00142   * @}
00143   */
00144
00145 /**
00146   * @}
00147   */
00148
00149 /**
00150   * @}
00151   */
00152
00153 /**
00154   * @}
00155   */
00156
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160
00161 #endif /* __STM32756G_EVAL_SDRAM_H */
00162
00163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_sram.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_sram.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_sram.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the SRAM driver for the IS61WV102416BLL-10M memory
00006   *          device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the IS61WV102416BLL-10M SRAM external memory mounted
00011      on STM32756G-EVAL evaluation board.
00012    - This driver does not need a specific component driver for the SRAM device
00013      to be included with.
00014
00015   Driver description:
00016   ------------------
00017   + Initialization steps:
00018      o Initialize the SRAM external memory using the BSP_SRAM_Init() function. This
00019        function includes the MSP layer hardware resources initialization and the
00020        FMC controller configuration to interface with the external SRAM memory.
00021
00022   + SRAM read/write operations
00023      o SRAM external 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_SRAM_ReadData()/BSP_SRAM_WriteData(), or by DMA transfer using the functions
00027        BSP_SRAM_ReadData_DMA()/BSP_SRAM_WriteData_DMA().
00028      o The AHB access is performed with 16-bit width transaction, the DMA transfer
00029        configuration is fixed at single (no burst) halfword transfer
00030        (see the SRAM_MspInit() static function).
00031      o User can implement his own functions for read/write access with his desired
00032        configurations.
00033      o If interrupt mode is used for DMA transfer, the function BSP_SRAM_DMA_IRQHandler()
00034        is called in IRQ handler file, to serve the generated interrupt once the DMA
00035        transfer is complete.
00036   @endverbatim
00037   ******************************************************************************
00038   * @attention
00039   *
00040   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00041   *
00042   * Redistribution and use in source and binary forms, with or without modification,
00043   * are permitted provided that the following conditions are met:
00044   *   1. Redistributions of source code must retain the above copyright notice,
00045   *      this list of conditions and the following disclaimer.
00046   *   2. Redistributions in binary form must reproduce the above copyright notice,
00047   *      this list of conditions and the following disclaimer in the documentation
00048   *      and/or other materials provided with the distribution.
00049   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00050   *      may be used to endorse or promote products derived from this software
00051   *      without specific prior written permission.
00052   *
00053   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00054   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00055   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00056   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00057   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00058   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00059   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00060   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00061   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00062   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00063   *
00064   ******************************************************************************
00065   */
00066
00067 /* Dependencies
00068 - stm32f7xx_hal_sram.c
00069 - stm32f7xx_ll_fmc.c
00070 - stm32f7xx_hal_dma.c
00071 - stm32f7xx_hal_gpio.c
00072 - stm32f7xx_hal_cortex.c
00073 - stm32f7xx_hal_rcc_ex.h
00074 EndDependencies */
00075
00076 /* Includes ------------------------------------------------------------------*/
00077 #include "stm32756g_eval_sram.h"
00078
00079 /** @addtogroup BSP
00080   * @{
00081   */
00082
00083 /** @addtogroup STM32756G_EVAL
00084   * @{
00085   */
00086
00087 /** @defgroup STM32756G_EVAL_SRAM STM32756G_EVAL SRAM
00088   * @{
00089   */
00090
00091 /** @defgroup STM32756G_EVAL_SRAM_Private_Types_Definitions SRAM Private Types Definitions
00092   * @{
00093   */
00094 /**
00095   * @}
00096   */
00097
00098 /** @defgroup STM32756G_EVAL_SRAM_Private_Defines SRAM Private Defines
00099   * @{
00100   */
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32756G_EVAL_SRAM_Private_Macros SRAM Private Macros
00106   * @{
00107   */
00108 /**
00109   * @}
00110   */
00111
00112 /** @defgroup STM32756G_EVAL_SRAM_Private_Variables SRAM Private Variables
00113   * @{
00114   */
00115 SRAM_HandleTypeDef sramHandle;
00116 static FMC_NORSRAM_TimingTypeDef Timing;
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_SRAM_Private_Functions_Prototypes SRAM Private Function Prototypes
00122   * @{
00123   */
00124 /**
00125   * @}
00126   */
00127
00128 /** @defgroup STM32756G_EVAL_SRAM_Private_Functions SRAM Private Functions
00129   * @{
00130   */
00131
00132 /**
00133   * @brief  Initializes the SRAM device.
00134   * @retval SRAM status
00135   */
00136 uint8_t BSP_SRAM_Init(void)
00137 {
00138   static uint8_t sram_status = SRAM_ERROR;
00139   /* SRAM device configuration */
00140   sramHandle.Instance = FMC_NORSRAM_DEVICE;
00141   sramHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00142
00143   /* SRAM device configuration */
00144   /* Timing configuration derived from system clock (up to 216Mhz)
00145      for 108Mhz as SRAM clock frequency */
00146   Timing.AddressSetupTime      = 2;
00147   Timing.AddressHoldTime       = 1;
00148   Timing.DataSetupTime         = 2;
00149   Timing.BusTurnAroundDuration = 1;
00150   Timing.CLKDivision           = 2;
00151   Timing.DataLatency           = 2;
00152   Timing.AccessMode            = FMC_ACCESS_MODE_A;
00153
00154   sramHandle.Init.NSBank             = FMC_NORSRAM_BANK3;
00155   sramHandle.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
00156   sramHandle.Init.MemoryType         = FMC_MEMORY_TYPE_SRAM;
00157   sramHandle.Init.MemoryDataWidth    = SRAM_MEMORY_WIDTH;
00158   sramHandle.Init.BurstAccessMode    = SRAM_BURSTACCESS;
00159   sramHandle.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
00160   sramHandle.Init.WaitSignalActive   = FMC_WAIT_TIMING_BEFORE_WS;
00161   sramHandle.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
00162   sramHandle.Init.WaitSignal         = FMC_WAIT_SIGNAL_DISABLE;
00163   sramHandle.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
00164   sramHandle.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_DISABLE;
00165   sramHandle.Init.WriteBurst         = SRAM_WRITEBURST;
00166   sramHandle.Init.ContinuousClock    = CONTINUOUSCLOCK_FEATURE;
00167
00168   /* SRAM controller initialization */
00169   BSP_SRAM_MspInit(&sramHandle, NULL); /* __weak function can be rewritten by the application */
00170   if(HAL_SRAM_Init(&sramHandle, &Timing, &Timing) != HAL_OK)
00171   {
00172     sram_status = SRAM_ERROR;
00173   }
00174   else
00175   {
00176     sram_status = SRAM_OK;
00177   }
00178   return sram_status;
00179 }
00180
00181 /**
00182   * @brief  DeInitializes the SRAM device.
00183   * @retval SRAM status
00184   */
00185 uint8_t BSP_SRAM_DeInit(void)
00186 {
00187   static uint8_t sram_status = SRAM_ERROR;
00188   /* SRAM device de-initialization */
00189   sramHandle.Instance = FMC_NORSRAM_DEVICE;
00190   sramHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00191
00192   if(HAL_SRAM_DeInit(&sramHandle) != HAL_OK)
00193   {
00194     sram_status = SRAM_ERROR;
00195   }
00196   else
00197   {
00198     sram_status = SRAM_OK;
00199   }
00200
00201   /* SRAM controller de-initialization */
00202   BSP_SRAM_MspDeInit(&sramHandle, NULL);
00203
00204   return sram_status;
00205 }
00206
00207 /**
00208   * @brief  Reads an amount of data from the SRAM device in polling mode.
00209   * @param  uwStartAddress: Read start address
00210   * @param  pData: Pointer to data to be read
00211   * @param  uwDataSize: Size of read data from the memory
00212   * @retval SRAM status
00213   */
00214 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00215 {
00216   if(HAL_SRAM_Read_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00217   {
00218     return SRAM_ERROR;
00219   }
00220   else
00221   {
00222     return SRAM_OK;
00223   }
00224 }
00225
00226 /**
00227   * @brief  Reads an amount of data from the SRAM device in DMA mode.
00228   * @param  uwStartAddress: Read start address
00229   * @param  pData: Pointer to data to be read
00230   * @param  uwDataSize: Size of read data from the memory
00231   * @retval SRAM status
00232   */
00233 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00234 {
00235   if(HAL_SRAM_Read_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00236   {
00237     return SRAM_ERROR;
00238   }
00239   else
00240   {
00241     return SRAM_OK;
00242   }
00243 }
00244
00245 /**
00246   * @brief  Writes an amount of data from the SRAM device in polling mode.
00247   * @param  uwStartAddress: Write start address
00248   * @param  pData: Pointer to data to be written
00249   * @param  uwDataSize: Size of written data from the memory
00250   * @retval SRAM status
00251   */
00252 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00253 {
00254   if(HAL_SRAM_Write_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00255   {
00256     return SRAM_ERROR;
00257   }
00258   else
00259   {
00260     return SRAM_OK;
00261   }
00262 }
00263
00264 /**
00265   * @brief  Writes an amount of data from the SRAM device in DMA mode.
00266   * @param  uwStartAddress: Write start address
00267   * @param  pData: Pointer to data to be written
00268   * @param  uwDataSize: Size of written data from the memory
00269   * @retval SRAM status
00270   */
00271 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00272 {
00273   if(HAL_SRAM_Write_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00274   {
00275     return SRAM_ERROR;
00276   }
00277   else
00278   {
00279     return SRAM_OK;
00280   }
00281 }
00282
00283 /**
00284   * @brief  Initializes SRAM MSP.
00285   * @param  hsram: SRAM handle
00286   * @param  Params
00287   * @retval None
00288   */
00289 __weak void BSP_SRAM_MspInit(SRAM_HandleTypeDef  *hsram, void *Params)
00290 {
00291   static DMA_HandleTypeDef dma_handle;
00292   GPIO_InitTypeDef gpio_init_structure;
00293
00294   /* Enable FMC clock */
00295   __HAL_RCC_FMC_CLK_ENABLE();
00296
00297   /* Enable chosen DMAx clock */
00298   __SRAM_DMAx_CLK_ENABLE();
00299
00300   /* Enable GPIOs clock */
00301   __HAL_RCC_GPIOD_CLK_ENABLE();
00302   __HAL_RCC_GPIOE_CLK_ENABLE();
00303   __HAL_RCC_GPIOF_CLK_ENABLE();
00304   __HAL_RCC_GPIOG_CLK_ENABLE();
00305
00306   /* Common GPIO configuration */
00307   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00308   gpio_init_structure.Pull      = GPIO_PULLUP;
00309   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00310   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00311
00312   /* GPIOD configuration */
00313   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8     |\
00314                               GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 |\
00315                               GPIO_PIN_14 | GPIO_PIN_15;
00316   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00317
00318   /* GPIOE configuration */
00319   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3| GPIO_PIN_4 | GPIO_PIN_7     |\
00320                               GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 |\
00321                               GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00322   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00323
00324   /* GPIOF configuration */
00325   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00326                               GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00327   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00328
00329   /* GPIOG configuration */
00330   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00331                               GPIO_PIN_5 | GPIO_PIN_10;
00332   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00333
00334   /* Configure common DMA parameters */
00335   dma_handle.Init.Channel             = SRAM_DMAx_CHANNEL;
00336   dma_handle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00337   dma_handle.Init.PeriphInc           = DMA_PINC_ENABLE;
00338   dma_handle.Init.MemInc              = DMA_MINC_ENABLE;
00339   dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
00340   dma_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
00341   dma_handle.Init.Mode                = DMA_NORMAL;
00342   dma_handle.Init.Priority            = DMA_PRIORITY_HIGH;
00343   dma_handle.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00344   dma_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00345   dma_handle.Init.MemBurst            = DMA_MBURST_SINGLE;
00346   dma_handle.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00347
00348   dma_handle.Instance = SRAM_DMAx_STREAM;
00349
00350    /* Associate the DMA handle */
00351   __HAL_LINKDMA(hsram, hdma, dma_handle);
00352
00353   /* Deinitialize the Stream for new transfer */
00354   HAL_DMA_DeInit(&dma_handle);
00355
00356   /* Configure the DMA Stream */
00357   HAL_DMA_Init(&dma_handle);
00358
00359   /* NVIC configuration for DMA transfer complete interrupt */
00360   HAL_NVIC_SetPriority(SRAM_DMAx_IRQn, 0x0F, 0);
00361   HAL_NVIC_EnableIRQ(SRAM_DMAx_IRQn);
00362 }
00363
00364
00365 /**
00366   * @brief  DeInitializes SRAM MSP.
00367   * @param  hsram: SRAM handle
00368   * @param  Params
00369   * @retval None
00370   */
00371 __weak void BSP_SRAM_MspDeInit(SRAM_HandleTypeDef  *hsram, void *Params)
00372 {
00373     static DMA_HandleTypeDef dma_handle;
00374
00375     /* Disable NVIC configuration for DMA interrupt */
00376     HAL_NVIC_DisableIRQ(SRAM_DMAx_IRQn);
00377
00378     /* Deinitialize the stream for new transfer */
00379     dma_handle.Instance = SRAM_DMAx_STREAM;
00380     HAL_DMA_DeInit(&dma_handle);
00381
00382     /* GPIO pins clock, FMC clock and DMA clock can be shut down in the applications
00383        by surcharging this __weak function */
00384 }
00385
00386 /**
00387   * @}
00388   */
00389
00390 /**
00391   * @}
00392   */
00393
00394 /**
00395   * @}
00396   */
00397
00398 /**
00399   * @}
00400   */
00401
00402 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_sram.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_sram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_sram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_sram.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 __STM32756G_EVAL_SRAM_H
00039 #define __STM32756G_EVAL_SRAM_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 STM32756G_EVAL
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL_SRAM
00057   * @{
00058   */
00059
00060 /** @defgroup STM32756G_EVAL_SRAM_Exported_Types SRAM Exported Types
00061   * @{
00062   */
00063 /**
00064   * @}
00065   */
00066
00067 /** @defgroup STM32756G_EVAL_SRAM_Exported_Constants SRAM Exported Constants
00068   * @{
00069   */
00070
00071 /**
00072   * @brief  SRAM status structure definition
00073   */
00074 #define   SRAM_OK         ((uint8_t)0x00)
00075 #define   SRAM_ERROR      ((uint8_t)0x01)
00076
00077 #define SRAM_DEVICE_ADDR  ((uint32_t)0x68000000)
00078 #define SRAM_DEVICE_SIZE  ((uint32_t)0x200000)  /* SRAM device size in MBytes */
00079
00080 /* #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8*/
00081 #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00082
00083 #define SRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_DISABLE
00084 /* #define SRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_ENABLE*/
00085
00086 #define SRAM_WRITEBURST      FMC_WRITE_BURST_DISABLE
00087 /* #define SRAM_WRITEBURST     FMC_WRITE_BURST_ENABLE */
00088
00089 #define CONTINUOUSCLOCK_FEATURE    FMC_CONTINUOUS_CLOCK_SYNC_ONLY
00090 /* #define CONTINUOUSCLOCK_FEATURE     FMC_CONTINUOUS_CLOCK_SYNC_ASYNC */
00091
00092 /* DMA definitions for SRAM DMA transfer */
00093 #define __SRAM_DMAx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00094 #define __SRAM_DMAx_CLK_DISABLE           __HAL_RCC_DMA2_CLK_DISABLE
00095 #define SRAM_DMAx_CHANNEL                 DMA_CHANNEL_0
00096 #define SRAM_DMAx_STREAM                  DMA2_Stream4
00097 #define SRAM_DMAx_IRQn                    DMA2_Stream4_IRQn
00098 #define BSP_SRAM_DMA_IRQHandler           DMA2_Stream4_IRQHandler
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32756G_EVAL_SRAM_Exported_Macro SRAM Exported Macro
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_SRAM_Exported_Functions SRAM Exported Functions
00111   * @{
00112   */
00113 uint8_t BSP_SRAM_Init(void);
00114 uint8_t BSP_SRAM_DeInit(void);
00115 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00116 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00117 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00118 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00119
00120 /* These functions can be modified in case the current settings (e.g. DMA stream)
00121    need to be changed for specific application needs */
00122 void    BSP_SRAM_MspInit(SRAM_HandleTypeDef  *hsram, void *Params);
00123 void    BSP_SRAM_MspDeInit(SRAM_HandleTypeDef  *hsram, void *Params);
00124
00125 /**
00126   * @}
00127   */
00128
00129 /**
00130   * @}
00131   */
00132
00133 /**
00134   * @}
00135   */
00136
00137 /**
00138   * @}
00139   */
00140
00141
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145
00146 #endif /* __STM32756G_EVAL_SRAM_H */
00147
00148 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_ts.c Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_ts.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the Touch
00006   *          Screen on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00007   @verbatim
00008   How To use this driver:
00009   -----------------------
00010    - This driver is used to drive the touch screen module of the STM32756G-EVAL
00011      evaluation board on the AMPIRE 640x480 LCD mounted on MB1063 or AMPIRE
00012      480x272 LCD mounted on MB1046 daughter board.
00013    - If the AMPIRE 640x480 LCD is used, the TS3510 or EXC7200 component driver
00014      must be included according to the touch screen driver present on this board.
00015    - If the AMPIRE 480x272 LCD is used, the STMPE811 IO expander device component
00016      driver must be included in order to run the TS module commanded by the IO
00017      expander device, the MFXSTM32L152 IO expander device component driver must be
00018      also included in case of interrupt mode use of the TS.
00019
00020   Driver description:
00021   ------------------
00022   + Initialization steps:
00023      o Initialize the TS module using the BSP_TS_Init() function. This
00024        function includes the MSP layer hardware resources initialization and the
00025        communication layer configuration to start the TS use. The LCD size properties
00026        (x and y) are passed as parameters.
00027      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00028        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00029        as an external interrupt whenever a touch is detected.
00030        The interrupt mode internally uses the IO functionalities driver driven by
00031        the IO expander, to configure the IT line.
00032
00033   + Touch screen use
00034      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00035        used. This function returns information about the last LCD touch occurred
00036        in the TS_StateTypeDef structure.
00037      o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
00038        the interrupt status. To clear the IT pending bits, you should call the
00039        function BSP_TS_ITClear().
00040      o The IT is handled using the corresponding external interrupt IRQ handler,
00041        the user IT callback treatment is implemented on the same external interrupt
00042        callback.
00043   @endverbatim
00044   ******************************************************************************
00045   * @attention
00046   *
00047   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00048   *
00049   * Redistribution and use in source and binary forms, with or without modification,
00050   * are permitted provided that the following conditions are met:
00051   *   1. Redistributions of source code must retain the above copyright notice,
00052   *      this list of conditions and the following disclaimer.
00053   *   2. Redistributions in binary form must reproduce the above copyright notice,
00054   *      this list of conditions and the following disclaimer in the documentation
00055   *      and/or other materials provided with the distribution.
00056   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00057   *      may be used to endorse or promote products derived from this software
00058   *      without specific prior written permission.
00059   *
00060   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00061   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00062   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00063   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00064   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00065   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00066   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00067   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00068   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00069   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00070   *
00071   ******************************************************************************
00072   */
00073
00074 /* Dependencies
00075 - stm32756g_eval_lcd.c
00076 - exc7200.c
00077 - ts3510.c
00078 - stmpe811.c
00079 EndDependencies */
00080
00081 /* Includes ------------------------------------------------------------------*/
00082 #include "stm32756g_eval_ts.h"
00083 #include "stm32756g_eval_io.h"
00084
00085 /** @addtogroup BSP
00086   * @{
00087   */
00088
00089 /** @addtogroup STM32756G_EVAL
00090   * @{
00091   */
00092
00093 /** @defgroup STM32756G_EVAL_TS STM32756G_EVAL TS
00094   * @{
00095   */
00096
00097 /** @defgroup STM32756G_EVAL_TS_Private_Types_Definitions TS Private Types Definitions
00098   * @{
00099   */
00100 /**
00101   * @}
00102   */
00103
00104 /** @defgroup STM32756G_EVAL_TS_Private_Defines TS Private Defines
00105   * @{
00106   */
00107 /**
00108   * @}
00109   */
00110
00111 /** @defgroup STM32756G_EVAL_TS_Private_Macros TS Private Macros
00112   * @{
00113   */
00114 /**
00115   * @}
00116   */
00117
00118 /** @defgroup STM32756G_EVAL_TS_Private_Variables TS Private Variables
00119   * @{
00120   */
00121 static TS_DrvTypeDef *tsDriver;
00122 static uint16_t tsXBoundary, tsYBoundary;
00123 static uint8_t  tsOrientation;
00124 static uint8_t  I2cAddress;
00125 /**
00126   * @}
00127   */
00128
00129 /** @defgroup STM32756G_EVAL_TS_Private_Functions_Prototypes TS Private Functions Prototypes
00130   * @{
00131   */
00132 /**
00133   * @}
00134   */
00135
00136 /** @defgroup STM32756G_EVAL_TS_Private_Functions TS Private Functions
00137   * @{
00138   */
00139
00140 /**
00141   * @brief  Initializes and configures the touch screen functionalities and
00142   *         configures all necessary hardware resources (GPIOs, clocks..).
00143   * @param  xSize: Maximum X size of the TS area on LCD
00144   * @param  ySize: Maximum Y size of the TS area on LCD
00145   * @retval TS_OK if all initializations are OK. Other value if error.
00146   */
00147 uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize)
00148 {
00149   uint8_t status = TS_OK;
00150   tsXBoundary = xSize;
00151   tsYBoundary = ySize;
00152
00153   /* Read ID and verify if the IO expander is ready */
00154   if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
00155   {
00156     /* Initialize the TS driver structure */
00157     tsDriver = &stmpe811_ts_drv;
00158     I2cAddress = TS_I2C_ADDRESS;
00159     tsOrientation = TS_SWAP_Y;
00160   }
00161   else
00162   {
00163     IOE_Init();
00164
00165     /* Check TS3510 touch screen driver presence to determine if TS3510 or
00166      * EXC7200 driver will be used */
00167     if(BSP_TS3510_IsDetected() == 0)
00168     {
00169       /* Initialize the TS driver structure */
00170       tsDriver = &ts3510_ts_drv;
00171       I2cAddress = TS3510_I2C_ADDRESS;
00172     }
00173     else
00174     {
00175       /* Initialize the TS driver structure */
00176       tsDriver = &exc7200_ts_drv;
00177       I2cAddress = EXC7200_I2C_ADDRESS;
00178     }
00179     tsOrientation = TS_SWAP_NONE;
00180   }
00181
00182   /* Initialize the TS driver */
00183   tsDriver->Init(I2cAddress);
00184   tsDriver->Start(I2cAddress);
00185
00186   return status;
00187 }
00188
00189 /**
00190   * @brief  DeInitializes the TouchScreen.
00191   * @retval TS state
00192   */
00193 uint8_t BSP_TS_DeInit(void)
00194 {
00195   /* Actually ts_driver does not provide a DeInit function */
00196   return TS_OK;
00197 }
00198
00199 /**
00200   * @brief  Configures and enables the touch screen interrupts.
00201   * @retval TS_OK if all initializations are OK. Other value if error.
00202   */
00203 uint8_t BSP_TS_ITConfig(void)
00204 {
00205   /* Initialize the IO */
00206   BSP_IO_Init();
00207
00208   /* Configure TS IT line IO */
00209   BSP_IO_ConfigPin(TS_INT_PIN, IO_MODE_IT_FALLING_EDGE);
00210
00211   /* Enable the TS ITs */
00212   tsDriver->EnableIT(I2cAddress);
00213
00214   return TS_OK;
00215 }
00216
00217 /**
00218   * @brief  Gets the touch screen interrupt status.
00219   * @retval TS_OK if all initializations are OK. Other value if error.
00220   */
00221 uint8_t BSP_TS_ITGetStatus(void)
00222 {
00223   /* Return the TS IT status */
00224   return (tsDriver->GetITStatus(I2cAddress));
00225 }
00226
00227 /**
00228   * @brief  Returns status and positions of the touch screen.
00229   * @param  TS_State: Pointer to touch screen current state structure
00230   * @retval TS_OK if all initializations are OK. Other value if error.
00231   */
00232 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00233 {
00234   static uint32_t _x = 0, _y = 0;
00235   uint16_t x_diff, y_diff , x , y;
00236   uint16_t swap;
00237
00238   TS_State->TouchDetected = tsDriver->DetectTouch(I2cAddress);
00239
00240   if(TS_State->TouchDetected)
00241   {
00242     tsDriver->GetXY(I2cAddress, &x, &y);
00243
00244     if(tsOrientation & TS_SWAP_X)
00245     {
00246       x = 4096 - x;
00247     }
00248
00249     if(tsOrientation & TS_SWAP_Y)
00250     {
00251       y = 4096 - y;
00252     }
00253
00254     if(tsOrientation & TS_SWAP_XY)
00255     {
00256       swap = y;
00257       y = x;
00258       x = swap;
00259     }
00260
00261     x_diff = x > _x? (x - _x): (_x - x);
00262     y_diff = y > _y? (y - _y): (_y - y);
00263
00264     if (x_diff + y_diff > 5)
00265     {
00266       _x = x;
00267       _y = y;
00268     }
00269
00270       TS_State->x = (tsXBoundary * _x) >> 12;
00271       TS_State->y = (tsYBoundary * _y) >> 12;
00272   }
00273   return TS_OK;
00274 }
00275
00276 /**
00277   * @brief  Clears all touch screen interrupts.
00278   * @retval None
00279   */
00280 void BSP_TS_ITClear(void)
00281 {
00282   /* Clear all IO IT pin */
00283   BSP_IO_ITClear();
00284
00285   /* Clear TS IT pending bits */
00286   tsDriver->ClearIT(I2cAddress);
00287 }
00288
00289 /**
00290   * @}
00291   */
00292
00293 /**
00294   * @}
00295   */
00296
00297 /**
00298   * @}
00299   */
00300
00301 /**
00302   * @}
00303   */
00304
00305 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: stm32756g_eval_ts.h Source File

  • File List
  • Globals
  • Drivers
  • BSP
  • STM32756G_EVAL
stm32756g_eval_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32756g_eval_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32756g_eval_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 __STM32756G_EVAL_TS_H
00039 #define __STM32756G_EVAL_TS_H
00040
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32756g_eval.h"
00047 /* Include IOExpander(STMPE811) component Driver */
00048 #include "../Components/stmpe811/stmpe811.h"
00049 /* Include TouchScreen component drivers */
00050 #include "../Components/ts3510/ts3510.h"
00051 #include "../Components/exc7200/exc7200.h"
00052
00053 /** @addtogroup BSP
00054   * @{
00055   */
00056
00057 /** @addtogroup STM32756G_EVAL
00058   * @{
00059   */
00060
00061 /** @addtogroup STM32756G_EVAL_TS
00062   * @{
00063   */
00064
00065 /** @defgroup STM32756G_EVAL_TS_Exported_Types TS Exported Types
00066   * @{
00067   */
00068 typedef struct
00069 {
00070   uint16_t TouchDetected;
00071   uint16_t x;
00072   uint16_t y;
00073   uint16_t z;
00074 }TS_StateTypeDef;
00075 /**
00076   * @}
00077   */
00078
00079 /** @defgroup STM32756G_EVAL_TS_Exported_Constants TS Exported Constants
00080   * @{
00081   */
00082 #define TS_SWAP_NONE                    ((uint8_t)0x00)
00083 #define TS_SWAP_X                       ((uint8_t)0x01)
00084 #define TS_SWAP_Y                       ((uint8_t)0x02)
00085 #define TS_SWAP_XY                      ((uint8_t)0x04)
00086
00087 typedef enum
00088 {
00089   TS_OK       = 0x00,
00090   TS_ERROR    = 0x01,
00091   TS_TIMEOUT  = 0x02
00092 }TS_StatusTypeDef;
00093
00094 /* Interrupt sources pins definition */
00095 #define TS_INT_PIN                      LCD_INT_PIN
00096 /**
00097   * @}
00098   */
00099
00100 /** @defgroup STM32756G_EVAL_TS_Exported_Macros TS Exported Macros
00101   * @{
00102   */
00103 /**
00104   * @}
00105   */
00106
00107 /** @defgroup STM32756G_EVAL_TS_Exported_Functions TS Exported Functions
00108   * @{
00109   */
00110 uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize);
00111 uint8_t BSP_TS_DeInit(void);
00112 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00113 uint8_t BSP_TS_ITConfig(void);
00114 uint8_t BSP_TS_ITGetStatus(void);
00115 void    BSP_TS_ITClear(void);
00116
00117 /**
00118   * @}
00119   */
00120
00121 /**
00122   * @}
00123   */
00124
00125 /**
00126   * @}
00127   */
00128
00129 /**
00130   * @}
00131   */
00132
00133
00134 #ifdef __cplusplus
00135 }
00136 #endif
00137
00138 #endif /* __STM32756G_EVAL_TS_H */
00139
00140 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference