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
12/30/2016 | V1.0 |  | STM32756G_EVAL Board
Generated on Fri Dec 30 2016 19:47:41 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.0.
#define | __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)
#define | __STM32756G_EVAL_BSP_VERSION_SUB2 (0x00)
#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 95 of file stm32756g_eval.c.

Referenced by BSP_GetVersion().

#define __STM32756G_EVAL_BSP_VERSION_MAIN (0x02)

STM32756G EVAL BSP Driver version number V2.0.0.

[31:24] main version

Definition at line 91 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 94 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)

[23:16] sub1 version

Definition at line 92 of file stm32756g_eval.c.

#define __STM32756G_EVAL_BSP_VERSION_SUB2 (0x00)

[15:8] sub2 version

Definition at line 93 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 133 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 129 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 125 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 149 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN}

Definition at line 145 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT}

Definition at line 141 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF}

Definition at line 147 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN}

Definition at line 143 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT}

Definition at line 139 of file stm32756g_eval.c.

Referenced by BSP_COM_Init().

USART_TypeDef* COM_USART[COMn] = {EVAL_COM1}

Definition at line 137 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 120 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 152 of file stm32756g_eval.c.

Referenced by BSP_POTENTIOMETER_GetLevel(), and BSP_POTENTIOMETER_Init().

I2C_HandleTypeDef hEvalI2c [static]

Definition at line 151 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 1226 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 1274 of file stm32756g_eval.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Return values:
None

Definition at line 1217 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 1254 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 1237 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 611 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 571 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 224 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 303 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 239 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 392 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 352 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 433 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 534 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 556 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 480 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 680 of file stm32756g_eval.c.

References ADCx_POLL_TIMEOUT, and hEvalADC.

void BSP_POTENTIOMETER_Init ( void )

Init Potentiometer.

Return values:
None

Definition at line 631 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 1328 of file stm32756g_eval.c.

void CAMERA_IO_Init ( void )

Initializes Camera low level.

Return values:
None

Definition at line 1285 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 1312 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 1297 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 1339 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 1377 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 1365 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 1352 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 1006 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 869 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 996 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 826 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 943 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 974 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 91 of file stm32756g_eval.h.

enum ButtonMode_TypeDef
Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 98 of file stm32756g_eval.h.

enum COM_TypeDef
Enumerator:
COM1
COM2

Definition at line 122 of file stm32756g_eval.h.

enum Led_TypeDef
Enumerator:
LED1
LED_GREEN
LED3
LED_RED

Definition at line 72 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 158 of file stm32756g_eval.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 157 of file stm32756g_eval.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT GPIOF

Definition at line 156 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 159 of file stm32756g_eval.h.

#define LED3_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 163 of file stm32756g_eval.h.

#define LED3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 162 of file stm32756g_eval.h.

Referenced by BSP_LED_Init().

#define LED3_GPIO_PORT GPIOB

Definition at line 161 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 164 of file stm32756g_eval.h.

#define LEDn ((uint8_t)2)

Definition at line 153 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 193 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 226 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 222 of file stm32756g_eval.h.

Referenced by BSP_PB_Init().

#define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 220 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 219 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 218 of file stm32756g_eval.h.

#define KEY_BUTTON_GPIO_PORT GPIOC

Definition at line 217 of file stm32756g_eval.h.

#define KEY_BUTTON_PIN GPIO_PIN_13

Key push-button.

Definition at line 216 of file stm32756g_eval.h.

#define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 211 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 210 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 209 of file stm32756g_eval.h.

#define TAMPER_BUTTON_GPIO_PORT GPIOC

Definition at line 208 of file stm32756g_eval.h.

#define TAMPER_BUTTON_PIN GPIO_PIN_13

Tamper push-button.

Definition at line 207 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn

Definition at line 202 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 201 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 200 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_GPIO_PORT GPIOC

Definition at line 199 of file stm32756g_eval.h.

#define WAKEUP_BUTTON_PIN GPIO_PIN_13

Wakeup push-button.

Definition at line 198 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 270 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL ADC_CHANNEL_8

Definition at line 282 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 272 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_GPIO_PORT GPIOF

Definition at line 279 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CHANNEL_PIN GPIO_PIN_10

Definition at line 278 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_CLK_ENABLE ( ) __HAL_RCC_ADC3_CLK_ENABLE()

Definition at line 271 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_Init().

#define ADCx_FORCE_RESET ( ) __HAL_RCC_ADC_FORCE_RESET()

Definition at line 274 of file stm32756g_eval.h.

#define ADCx_POLL_TIMEOUT 10

Definition at line 284 of file stm32756g_eval.h.

Referenced by BSP_POTENTIOMETER_GetLevel().

#define ADCx_RELEASE_RESET ( ) __HAL_RCC_ADC_RELEASE_RESET()

Definition at line 275 of file stm32756g_eval.h.

#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)

Definition at line 331 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 330 of file stm32756g_eval.h.

Referenced by BSP_CAMERA_Init().

#define COMn ((uint8_t)1)

Definition at line 235 of file stm32756g_eval.h.

#define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)

Definition at line 332 of file stm32756g_eval.h.

Referenced by BSP_EEPROM_Init().

#define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)

Definition at line 333 of file stm32756g_eval.h.

Referenced by BSP_EEPROM_Init().

#define EVAL_COM1 USART1

Definition for COM port1, connected to USART1.

Definition at line 240 of file stm32756g_eval.h.

#define EVAL_COM1_CLK_DISABLE ( ) __HAL_RCC_USART1_CLK_DISABLE()

Definition at line 242 of file stm32756g_eval.h.

#define EVAL_COM1_CLK_ENABLE ( ) __HAL_RCC_USART1_CLK_ENABLE()

Definition at line 241 of file stm32756g_eval.h.

#define EVAL_COM1_IRQn USART1_IRQn

Definition at line 256 of file stm32756g_eval.h.

#define EVAL_COM1_RX_AF GPIO_AF7_USART1

Definition at line 254 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 253 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 252 of file stm32756g_eval.h.

#define EVAL_COM1_RX_GPIO_PORT GPIOA

Definition at line 251 of file stm32756g_eval.h.

#define EVAL_COM1_RX_PIN GPIO_PIN_10

Definition at line 250 of file stm32756g_eval.h.

#define EVAL_COM1_TX_AF GPIO_AF7_USART1

Definition at line 248 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 247 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 246 of file stm32756g_eval.h.

#define EVAL_COM1_TX_GPIO_PORT GPIOA

Definition at line 245 of file stm32756g_eval.h.

#define EVAL_COM1_TX_PIN GPIO_PIN_9

Definition at line 244 of file stm32756g_eval.h.

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

Definition at line 259 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 258 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 265 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 264 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 262 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 261 of file stm32756g_eval.h.

Referenced by BSP_COM_Init().

#define EVAL_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 347 of file stm32756g_eval.h.

#define EVAL_I2Cx I2C1

Definition at line 345 of file stm32756g_eval.h.

Referenced by I2Cx_Init().

#define EVAL_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 346 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_ER_IRQn I2C1_ER_IRQn

Definition at line 361 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_EV_IRQn I2C1_EV_IRQn

Definition at line 360 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 350 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 351 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_PIN GPIO_PIN_8

Definition at line 354 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 356 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 348 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SCL_SDA_GPIO_PORT GPIOB

Definition at line 355 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EVAL_I2Cx_SDA_PIN GPIO_PIN_9

Definition at line 357 of file stm32756g_eval.h.

Referenced by I2Cx_MspInit().

#define EXC7200_I2C_ADDRESS ((uint16_t)0x08)

Definition at line 329 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 325 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 326 of file stm32756g_eval.h.

#define SAMPLINGTIME ADC_SAMPLETIME_3CYCLES

Definition at line 283 of file stm32756g_eval.h.

#define TS3510_I2C_ADDRESS ((uint16_t)0x80)

Definition at line 328 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 327 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 187 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 186 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 185 of file stm32756g_eval.h.

#define MFX_IRQOUT_GPIO_PORT GPIOI

Definition at line 184 of file stm32756g_eval.h.

#define MFX_IRQOUT_PIN GPIO_PIN_8

MFX_IRQOUt pin.

Definition at line 183 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 611 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 571 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 224 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 303 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 239 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 392 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 352 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 433 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 534 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 556 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 480 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 680 of file stm32756g_eval.c.

References ADCx_POLL_TIMEOUT, and hEvalADC.

void BSP_POTENTIOMETER_Init ( void )

Init Potentiometer.

Return values:
None

Definition at line 631 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 136 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 161 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 142 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM().

PDMFilter_InitStruct Filter[2]

Definition at line 141 of file stm32756g_eval_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and PDMDecoder_Init().

I2S_HandleTypeDef haudio_in_i2s

Definition at line 138 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 137 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 139 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.
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

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 905 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 1005 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 994 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 794 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_OK, 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 1086 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 1017 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 866 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 919 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 830 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 878 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 892 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 847 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 983 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 270 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 662 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 463 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 524 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 516 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 196 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 617 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 534 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 283 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 248 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 307 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 446 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 423 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 381 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 402 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 361 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 333 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 508 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 972 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 949 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 960 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 499 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 475 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 487 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 1183 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 1155 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 1128 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 765 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 711 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 1321 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 1234 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 1201 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 1248 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 184 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 129 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 131 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 130 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 148 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 146 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 145 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_IRQ DMA1_Stream2_IRQn

Definition at line 149 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 153 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 151 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 150 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_STREAM DMA1_Stream2

Definition at line 147 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_AF GPIO_AF6_SPI3

Definition at line 136 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 135 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 134 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_GPIO_PORT GPIOB

Definition at line 133 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 132 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 142 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 141 of file stm32756g_eval_audio.h.

#define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 140 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_GPIO_PORT GPIOD

Definition at line 139 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 138 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 156 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_OK ((uint8_t)0)

Definition at line 183 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 123 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx SAI2_Block_B

Definition at line 93 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 95 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 94 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_3

Definition at line 114 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 112 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_IRQ DMA2_Stream6_IRQn

Definition at line 115 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 120 of file stm32756g_eval_audio.h.

#define AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 117 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 116 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_STREAM DMA2_Stream6

Definition at line 113 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 106 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_GPIO_PORT GPIOG

Definition at line 107 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 108 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 97 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 99 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_GPIO_PORT GPIOE

Definition at line 100 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 101 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 96 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_PIN GPIO_PIN_2

Definition at line 104 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 102 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_SD_GPIO_PORT GPIOA

Definition at line 103 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 105 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 185 of file stm32756g_eval_audio.h.

#define AUDIO_TIMx TIM3

Definition at line 166 of file stm32756g_eval_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_AF GPIO_AF2_TIM3

Definition at line 174 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_CLK_DISABLE ( ) __HAL_RCC_TIM3_CLK_DISABLE()

Definition at line 165 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 164 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 170 of file stm32756g_eval_audio.h.

#define AUDIO_TIMx_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 169 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_GPIO_PORT GPIOC

Definition at line 171 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_IN_CHANNEL TIM_CHANNEL_1

Definition at line 167 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 172 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 168 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 173 of file stm32756g_eval_audio.h.

Referenced by TIMx_IC_MspInit().

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

Definition at line 180 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define CHANNEL_DEMUX_MASK ((uint8_t)0x55)

Definition at line 197 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 86 of file stm32756g_eval_audio.h.

Referenced by SAIx_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 88 of file stm32756g_eval_audio.h.

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 90 of file stm32756g_eval_audio.h.

#define CODEC_RESET_DELAY ((uint8_t)5)

Definition at line 204 of file stm32756g_eval_audio.h.

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)

Definition at line 189 of file stm32756g_eval_audio.h.

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

Definition at line 190 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define DEFAULT_AUDIO_IN_FREQ I2S_AUDIOFREQ_16K

Definition at line 188 of file stm32756g_eval_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)

Definition at line 191 of file stm32756g_eval_audio.h.

#define DMA_MAX_SZE 0xFFFF

Definition at line 118 of file stm32756g_eval_audio.h.

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

Definition at line 194 of file stm32756g_eval_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE

Definition at line 211 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 212 of file stm32756g_eval_audio.h.

#define PCM_OUT_SIZE (DEFAULT_AUDIO_IN_FREQ/1000*2)

Definition at line 196 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 161 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 229 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 270 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 662 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 463 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 524 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 516 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 196 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 617 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 534 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 283 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 248 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 307 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 446 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 423 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 381 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 402 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 361 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 333 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 508 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.

Function Documentation

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 905 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 1005 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 994 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 794 of file stm32756g_eval_audio.c.

References AUDIO_I2Sx, AUDIO_OK, 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 1086 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 1017 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 866 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 919 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 830 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 878 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 892 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 847 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 983 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 103 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 105 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 108 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 102 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 348 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 366 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 209 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 330 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 195 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 615 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 594 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 270 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 132 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 552 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 520 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 421 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 299 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 241 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 220 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 251 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 231 of file stm32756g_eval_camera.c.

References hDcmiEval.

__weak void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 573 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 379 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 606 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 585 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 543 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 564 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 83 of file stm32756g_eval_camera.h.

#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */

Definition at line 84 of file stm32756g_eval_camera.h.

#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */

Definition at line 85 of file stm32756g_eval_camera.h.

#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Definition at line 86 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 73 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 95 of file stm32756g_eval_camera.h.

#define BSP_CAMERA_IRQHandler DCMI_IRQHandler

Definition at line 94 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 348 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 366 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 209 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 330 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 195 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 615 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 594 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 270 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 132 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 552 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 520 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 421 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 299 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 241 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 220 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 251 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 231 of file stm32756g_eval_camera.c.

References hDcmiEval.

void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 573 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 128 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 129 of file stm32756g_eval_eeprom.c.

Referenced by BSP_EEPROM_ReadBuffer().

__IO uint8_t EEPROMDataWrite

Definition at line 130 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 177 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 154 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 198 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 453 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 437 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 280 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 245 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 82 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 75 of file stm32756g_eval_eeprom.h.

#define EEPROM_MAX_TRIALS ((uint32_t)3000)

Definition at line 79 of file stm32756g_eval_eeprom.h.

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

#define EEPROM_OK ((uint32_t)0)

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

Referenced by BSP_EEPROM_WriteBuffer().

#define EEPROM_TIMEOUT ((uint32_t)2)

Definition at line 83 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 177 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 154 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 198 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 453 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 437 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 280 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 245 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 1339 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 1377 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 1365 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 1352 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 110 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 111 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 250 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 236 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 175 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 139 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 197 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 187 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 281 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 293 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 269 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 68 of file stm32756g_eval_io.h.

enum IO_StatusTypeDef
Enumerator:
IO_OK
IO_ERROR
IO_TIMEOUT

Definition at line 74 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 87 of file stm32756g_eval_io.h.

#define IO_PIN_1 ((uint32_t)0x0002)

Definition at line 88 of file stm32756g_eval_io.h.

#define IO_PIN_10 ((uint32_t)0x0400)

Definition at line 97 of file stm32756g_eval_io.h.

#define IO_PIN_11 ((uint32_t)0x0800)

Definition at line 98 of file stm32756g_eval_io.h.

#define IO_PIN_12 ((uint32_t)0x1000)

Definition at line 99 of file stm32756g_eval_io.h.

#define IO_PIN_13 ((uint32_t)0x2000)

Definition at line 100 of file stm32756g_eval_io.h.

#define IO_PIN_14 ((uint32_t)0x4000)

Definition at line 101 of file stm32756g_eval_io.h.

#define IO_PIN_15 ((uint32_t)0x8000)

Definition at line 102 of file stm32756g_eval_io.h.

#define IO_PIN_16 ((uint32_t)0x010000)

Definition at line 103 of file stm32756g_eval_io.h.

#define IO_PIN_17 ((uint32_t)0x020000)

Definition at line 104 of file stm32756g_eval_io.h.

#define IO_PIN_18 ((uint32_t)0x040000)

Definition at line 105 of file stm32756g_eval_io.h.

#define IO_PIN_19 ((uint32_t)0x080000)

Definition at line 106 of file stm32756g_eval_io.h.

#define IO_PIN_2 ((uint32_t)0x0004)

Definition at line 89 of file stm32756g_eval_io.h.

#define IO_PIN_20 ((uint32_t)0x100000)

Definition at line 107 of file stm32756g_eval_io.h.

#define IO_PIN_21 ((uint32_t)0x200000)

Definition at line 108 of file stm32756g_eval_io.h.

#define IO_PIN_22 ((uint32_t)0x400000)

Definition at line 109 of file stm32756g_eval_io.h.

#define IO_PIN_23 ((uint32_t)0x800000)

Definition at line 110 of file stm32756g_eval_io.h.

#define IO_PIN_3 ((uint32_t)0x0008)

Definition at line 90 of file stm32756g_eval_io.h.

#define IO_PIN_4 ((uint32_t)0x0010)

Definition at line 91 of file stm32756g_eval_io.h.

#define IO_PIN_5 ((uint32_t)0x0020)

Definition at line 92 of file stm32756g_eval_io.h.

#define IO_PIN_6 ((uint32_t)0x0040)

Definition at line 93 of file stm32756g_eval_io.h.

#define IO_PIN_7 ((uint32_t)0x0080)

Definition at line 94 of file stm32756g_eval_io.h.

#define IO_PIN_8 ((uint32_t)0x0100)

Definition at line 95 of file stm32756g_eval_io.h.

#define IO_PIN_9 ((uint32_t)0x0200)

Definition at line 96 of file stm32756g_eval_io.h.

#define IO_PIN_ALL ((uint32_t)0xFFFFFF)

Definition at line 111 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 250 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 236 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 175 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 139 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 197 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 187 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 281 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 293 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 269 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 105 of file stm32756g_eval_lcd.c.

Referenced by BSP_LCD_FillPolygon().

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

Definition at line 106 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 114 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 126 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 127 of file stm32756g_eval_lcd.c.

DMA2D_HandleTypeDef hDma2dEval [static]

Definition at line 123 of file stm32756g_eval_lcd.c.

Referenced by LL_ConvertLineToARGB8888(), and LL_FillBuffer().

LTDC_HandleTypeDef hLtdcEval

Definition at line 122 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 124 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 625 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 636 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 1334 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 242 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 656 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 1236 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Return values:
None

Definition at line 1226 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 674 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 735 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 998 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 877 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 952 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 747 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 784 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 985 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 924 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 859 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 765 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 1080 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 1196 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 1128 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 1059 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 560 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 579 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 541 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 263 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 272 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 151 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 161 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 303 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 1297 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 1248 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 590 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 522 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 498 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 509 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 336 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 551 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 473 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 486 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 570 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 415 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 426 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 350 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 372 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 440 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 458 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 532 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 392 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 404 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 282 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 292 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 1397 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 1456 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 1565 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 1534 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 94 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 78 of file stm32756g_eval_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Definition at line 81 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 82 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 80 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 85 of file stm32756g_eval_lcd.h.

Field Documentation

int16_t Point::X

Definition at line 87 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

Definition at line 88 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 163 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)

LCD color.

Definition at line 141 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)

Definition at line 164 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)

Definition at line 144 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)

Definition at line 153 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)

Definition at line 156 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)

Definition at line 162 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)

Definition at line 154 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)

Definition at line 157 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKRED ((uint32_t)0xFF800000)

Definition at line 155 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)

Definition at line 158 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_GRAY ((uint32_t)0xFF808080)

Definition at line 161 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)

Definition at line 142 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)

Definition at line 147 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)

Definition at line 150 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)

Definition at line 160 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)

Definition at line 148 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)

Definition at line 151 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)

Definition at line 149 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)

Definition at line 152 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)

Definition at line 145 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)

Definition at line 165 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_RED ((uint32_t)0xFFFF0000)

Definition at line 143 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)

Definition at line 166 of file stm32756g_eval_lcd.h.

#define LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)

Definition at line 159 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)

Definition at line 146 of file stm32756g_eval_lcd.h.

#define LCD_DEFAULT_FONT Font24

LCD default font.

Definition at line 171 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_ERROR ((uint8_t)0x01)

Definition at line 117 of file stm32756g_eval_lcd.h.

#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)

LCD FB_StartAddress.

Definition at line 123 of file stm32756g_eval_lcd.h.

#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef

Definition at line 110 of file stm32756g_eval_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_MAX_PCLK ((uint8_t)0x00)

LCD Layer_Number.

Definition at line 134 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 135 of file stm32756g_eval_lcd.h.

#define LCD_OK ((uint8_t)0x00)

LCD status structure definition.

Definition at line 116 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 176 of file stm32756g_eval_lcd.h.

#define LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)

Definition at line 177 of file stm32756g_eval_lcd.h.

#define LCD_TIMEOUT ((uint8_t)0x02)

Definition at line 118 of file stm32756g_eval_lcd.h.

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

Definition at line 112 of file stm32756g_eval_lcd.h.

#define MAX_LAYER_NUMBER ((uint32_t)2)

Definition at line 108 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 625 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 636 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 1334 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 242 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 656 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 1236 of file stm32756g_eval_lcd.c.

References hLtdcEval.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Return values:
None

Definition at line 1226 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 674 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 735 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 998 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 877 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 952 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 747 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 784 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 985 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 924 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 859 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 765 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 1080 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 1196 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 1128 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 1059 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 560 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 579 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 541 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 263 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 272 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 151 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 161 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 303 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 1297 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 1248 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 590 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 522 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 498 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 509 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 336 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 551 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 473 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 486 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 570 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 415 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 426 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 350 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 372 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 440 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 458 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 532 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 392 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 404 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 282 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 292 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 113 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 114 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 187 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 296 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 316 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 138 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 403 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 355 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 275 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 337 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 216 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 232 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 244 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 415 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 93 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 94 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Erase_Chip().

#define CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY

Definition at line 89 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 83 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

#define NOR_BUSY_STATE GPIO_PIN_RESET

Definition at line 101 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_DEVICE_ADDR ((uint32_t)0x60000000)

Definition at line 78 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 81 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

#define NOR_READY_BUSY_GPIO GPIOD

Definition at line 99 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_READY_BUSY_PIN GPIO_PIN_6

Definition at line 98 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_READY_STATE GPIO_PIN_SET

Definition at line 100 of file stm32756g_eval_nor.h.

Referenced by HAL_NOR_MspWait().

#define NOR_WRITEBURST FMC_WRITE_BURST_DISABLE

Definition at line 86 of file stm32756g_eval_nor.h.

Referenced by BSP_NOR_Init().

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

Definition at line 95 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 187 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 296 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 316 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 138 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 403 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 355 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 275 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 337 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 216 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 232 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 244 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 73 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 72 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 88 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 578 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 512 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 794 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 689 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 648 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 606 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 748 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 173 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 467 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 316 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 358 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 451 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 398 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 119 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 578 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 512 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 196 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 242 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 109 of file stm32756g_eval_qspi.h.

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 71 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_GetStatus().

#define QSPI_CLK_DISABLE ( ) __HAL_RCC_QSPI_CLK_DISABLE()

Definition at line 78 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_CLK_ENABLE ( ) __HAL_RCC_QSPI_CLK_ENABLE()

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

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_PORT GPIOB

Definition at line 93 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 92 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 79 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_PORT GPIOB

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

Referenced by BSP_QSPI_MspInit().

#define QSPI_D0_GPIO_PORT GPIOF

Definition at line 95 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 94 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 82 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D1_GPIO_PORT GPIOF

Definition at line 97 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 96 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 83 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D2_GPIO_PORT GPIOF

Definition at line 99 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 98 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 84 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_D3_GPIO_PORT GPIOF

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

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_ERROR ((uint8_t)0x01)

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

#define QSPI_FORCE_RESET ( ) __HAL_RCC_QSPI_FORCE_RESET()

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

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

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

#define QSPI_RELEASE_RESET ( ) __HAL_RCC_QSPI_RELEASE_RESET()

Definition at line 87 of file stm32756g_eval_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_SUSPENDED ((uint8_t)0x08)

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

Field Documentation

uint32_t QSPI_Info::EraseSectorSize

Size of sectors for the erase operation

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

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::FlashSize

Size of the flash

Definition at line 120 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 123 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 124 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 120 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 121 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 565 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 196 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 346 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 525 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 514 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 142 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 237 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 223 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 477 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 364 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 268 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 307 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 583 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 288 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 327 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 574 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 536 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 556 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 546 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 70 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 97 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspInit().

#define BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 106 of file stm32756g_eval_sd.h.

#define BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 105 of file stm32756g_eval_sd.h.

#define BSP_SDMMC_IRQHandler SDMMC1_IRQHandler

Definition at line 104 of file stm32756g_eval_sd.h.

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 94 of file stm32756g_eval_sd.h.

#define SD_DetectIRQHandler ( ) HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)

Definition at line 107 of file stm32756g_eval_sd.h.

#define SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4

Definition at line 99 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn

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

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn

Definition at line 102 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 100 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 92 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 91 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 565 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 196 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 346 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 514 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 142 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 237 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 223 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 477 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 364 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 268 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 307 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 583 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 288 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 327 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 574 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 79 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 80 of file stm32756g_eval_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

Definition at line 78 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 86 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 85 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 118 of file stm32756g_eval_sdram.c.

Referenced by BSP_SDRAM_Initialization_sequence().

SDRAM_HandleTypeDef sdramHandle

Definition at line 116 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 117 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 187 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 138 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 213 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 466 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 368 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 275 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 294 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 349 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 313 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 332 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 91 of file stm32756g_eval_sdram.h.

#define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 90 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler

Definition at line 95 of file stm32756g_eval_sdram.h.

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

Definition at line 85 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2

Definition at line 82 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)

Definition at line 75 of file stm32756g_eval_sdram.h.

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

Definition at line 76 of file stm32756g_eval_sdram.h.

#define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 92 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn

Definition at line 94 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_DMAx_STREAM DMA2_Stream0

Definition at line 93 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 80 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)

Definition at line 87 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 70 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 103 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)

Definition at line 104 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)

Definition at line 105 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)

Definition at line 106 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)

Definition at line 108 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)

Definition at line 107 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)

Definition at line 109 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)

Definition at line 110 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)

Definition at line 111 of file stm32756g_eval_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)

Definition at line 112 of file stm32756g_eval_sdram.h.

#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Definition at line 113 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 69 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 187 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 138 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 213 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 466 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 368 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 275 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 294 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 349 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 313 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 332 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 108 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 109 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 178 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 129 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 364 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 282 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 207 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 226 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 245 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 264 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 96 of file stm32756g_eval_sram.h.

#define __SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 95 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspInit().

#define BSP_SRAM_DMA_IRQHandler DMA2_Stream4_IRQHandler

Definition at line 100 of file stm32756g_eval_sram.h.

#define CONTINUOUSCLOCK_FEATURE FMC_CONTINUOUS_CLOCK_SYNC_ONLY

Definition at line 91 of file stm32756g_eval_sram.h.

#define SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE

Definition at line 85 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_Init().

#define SRAM_DEVICE_ADDR ((uint32_t)0x68000000)

Definition at line 79 of file stm32756g_eval_sram.h.

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

Definition at line 80 of file stm32756g_eval_sram.h.

#define SRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 97 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspInit().

#define SRAM_DMAx_IRQn DMA2_Stream4_IRQn

Definition at line 99 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspDeInit(), and BSP_SRAM_MspInit().

#define SRAM_DMAx_STREAM DMA2_Stream4

Definition at line 98 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_MspDeInit(), and BSP_SRAM_MspInit().

#define SRAM_ERROR ((uint8_t)0x01)

Definition at line 77 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 83 of file stm32756g_eval_sram.h.

Referenced by BSP_SRAM_Init().

#define SRAM_OK ((uint8_t)0x00)

SRAM status structure definition.

Definition at line 76 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 88 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 178 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 129 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 364 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 282 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 207 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 226 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 245 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 264 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 119 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 116 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 118 of file stm32756g_eval_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsXBoundary [static]

Definition at line 117 of file stm32756g_eval_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

uint16_t tsYBoundary [static]

Definition at line 117 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 188 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 227 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 142 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 275 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 198 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 216 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 70 of file stm32756g_eval_ts.h.

Field Documentation

uint16_t TS_StateTypeDef::TouchDetected

Definition at line 72 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::x

Definition at line 73 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::y

Definition at line 74 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::z

Definition at line 75 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 97 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_ITConfig().

#define TS_SWAP_NONE ((uint8_t)0x00)

Definition at line 84 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_Init().

#define TS_SWAP_X ((uint8_t)0x01)

Definition at line 85 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_XY ((uint8_t)0x04)

Definition at line 87 of file stm32756g_eval_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_Y ((uint8_t)0x02)

Definition at line 86 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 89 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 188 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 227 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 142 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 275 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 198 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 216 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_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.c , stm32756g_eval.h
  • BSP_LED_On() : stm32756g_eval.h , stm32756g_eval.c
  • 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.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.c , stm32756g_eval_nor.h
  • 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.c , stm32756g_eval_nor.h
  • BSP_NOR_ReturnToReadMode() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_WriteData() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • 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.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_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.c , stm32756g_eval_sd.h
  • 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.c , stm32756g_eval_sd.h
  • BSP_SD_GetCardInfo() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_GetCardState() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • BSP_SD_Init() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_IsDetected() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • 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.c , 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_DeInit() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • 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.h , stm32756g_eval_sdram.c
  • BSP_SDRAM_MspInit() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • 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_DMA_IRQHandler : stm32756g_eval_sram.h
  • BSP_SRAM_Init() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • 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.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.c , stm32756g_eval_ts.h
  • 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.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_DeInit() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Error_Callback() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32756g_eval_audio.c , stm32756g_eval_audio.h
  • BSP_AUDIO_IN_Init() : stm32756g_eval_audio.h , stm32756g_eval_audio.c
  • 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.h , stm32756g_eval_audio.c
  • 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.h , stm32756g_eval_audio.c
  • 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.h , stm32756g_eval_camera.c
  • 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.h , stm32756g_eval_io.c
  • 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.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.h , stm32756g_eval_nor.c
  • BSP_NOR_ReadData() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_ReturnToReadMode() : stm32756g_eval_nor.h , stm32756g_eval_nor.c
  • BSP_NOR_WriteData() : stm32756g_eval_nor.c , stm32756g_eval_nor.h
  • 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_MspDeInit() : stm32756g_eval_qspi.c , stm32756g_eval_qspi.h
  • 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.c , 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.h , stm32756g_eval_sd.c
  • 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.c , stm32756g_eval_sd.h
  • BSP_SD_ITConfig() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • BSP_SD_MspDeInit() : stm32756g_eval_sd.c , stm32756g_eval_sd.h
  • 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.c , stm32756g_eval_sd.h
  • BSP_SD_WriteBlocks() : stm32756g_eval_sd.h , stm32756g_eval_sd.c
  • 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.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_Init() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_Initialization_sequence() : stm32756g_eval_sdram.h , stm32756g_eval_sdram.c
  • 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.c , stm32756g_eval_sdram.h
  • BSP_SDRAM_ReadData_DMA() : stm32756g_eval_sdram.c , stm32756g_eval_sdram.h
  • 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.c , stm32756g_eval_sdram.h
  • BSP_SRAM_DeInit() : stm32756g_eval_sram.h , stm32756g_eval_sram.c
  • 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.h , stm32756g_eval_sram.c
  • BSP_SRAM_WriteData() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_SRAM_WriteData_DMA() : stm32756g_eval_sram.c , stm32756g_eval_sram.h
  • BSP_TS_DeInit() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_GetState() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • BSP_TS_Init() : stm32756g_eval_ts.c , stm32756g_eval_ts.h
  • 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


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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.0.
#define | __STM32756G_EVAL_BSP_VERSION_SUB1 (0x00)
#define | __STM32756G_EVAL_BSP_VERSION_SUB2 (0x00)
#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
Version:
V2.0.0
Date:
30-December-2016
            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
Version:
V2.0.0
Date:
30-December-2016
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.

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
Version:
V2.0.0
Date:
30-December-2016
  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.

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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
            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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  ==============================================================================
                     ##### 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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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
Version:
V2.0.0
Date:
30-December-2016
  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
Version:
V2.0.0
Date:
30-December-2016
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:/SVN/EVAL_Discovery/STM32756G_EVAL/Trunk/Drivers/BSP/ Directory Reference

  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32756G_EVAL


STM32756G_EVAL BSP User Manual: C:/SVN/EVAL_Discovery/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: C:/SVN/EVAL_Discovery/STM32756G_EVAL/Trunk/Drivers/ Directory Reference

  • Drivers
Drivers Directory Reference

Directories

directory BSP


STM32756G_EVAL BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Drivers
    • BSP
      • STM32756G_EVAL
Generated on Fri Dec 30 2016 19:47:42 for STM32756G_EVAL BSP User Manual by doxygen 1.7.6.1


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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file provides a set of firmware functions to manage LEDs,
00008   *          push-buttons and COM ports available on STM32756G-EVAL and STM32746G-EVAL
00009   *          evaluation board(MB1167) from STMicroelectronics.
00010   *
00011   @verbatim
00012             This driver requires the stm32756g_eval_io.c/.h files to manage the
00013             IO module resources mapped on the MFX IO expander.
00014             These resources are mainly LEDs, Joystick push buttons, SD detect pin,
00015             USB OTG power switch/over current drive pins, Camera plug pin, Audio
00016             INT pin
00017             The use of the above eval resources is conditioned by the "USE_IOEXPANDER"
00018             preprocessor define which is enabled by default for the STM327x6G-EVAL
00019             boards Rev A. However for Rev B boards these resources are disabled by default
00020             (except LED1 and LED2) and to be able to use them, user must add "USE_IOEXPANDER"
00021             define in the compiler preprocessor configuration (or any header file that
00022             is processed before stm32756g_eval.h).
00023             On the STM327x6G-EVAL RevB LED1 and LED2 are directly mapped on GPIO pins,
00024             to avoid the unnecessary overhead of code brought by the use of MFX IO
00025             expander when no further evaluation board resources are needed by the
00026             application/example.
00027             For precise details on the use of the MFX IO expander, you can refer to
00028             the description provided within the stm32756g_eval_io.c file header
00029   @endverbatim
00030   ******************************************************************************
00031   * @attention
00032   *
00033   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00034   *
00035   * Redistribution and use in source and binary forms, with or without modification,
00036   * are permitted provided that the following conditions are met:
00037   *   1. Redistributions of source code must retain the above copyright notice,
00038   *      this list of conditions and the following disclaimer.
00039   *   2. Redistributions in binary form must reproduce the above copyright notice,
00040   *      this list of conditions and the following disclaimer in the documentation
00041   *      and/or other materials provided with the distribution.
00042   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00043   *      may be used to endorse or promote products derived from this software
00044   *      without specific prior written permission.
00045   *
00046   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00047   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00048   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00049   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00050   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00051   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00052   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00053   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00054   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00055   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00056   *
00057   ******************************************************************************
00058   */
00059
00060 /* Includes ------------------------------------------------------------------*/
00061 #include "stm32756g_eval.h"
00062 #if defined(USE_IOEXPANDER)
00063 #include "stm32756g_eval_io.h"
00064 #endif /* USE_IOEXPANDER */
00065
00066 /** @addtogroup BSP
00067   * @{
00068   */
00069
00070 /** @defgroup STM32756G_EVAL EVAL
00071   * @{
00072   */
00073
00074 /** @defgroup STM32756G_EVAL_LOW_LEVEL STM32756G-EVAL LOW LEVEL
00075   * @{
00076   */
00077
00078 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_TypesDefinitions STM32756G-EVAL LOW LEVEL Private Types Definitions
00079   * @{
00080   */
00081 /**
00082   * @}
00083   */
00084
00085 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Defines STM32756G-EVAL LOW LEVEL Private Defines
00086   * @{
00087   */
00088 /**
00089  * @brief STM32756G EVAL BSP Driver version number V2.0.0
00090    */
00091 #define __STM32756G_EVAL_BSP_VERSION_MAIN   (0x02) /*!< [31:24] main version */
00092 #define __STM32756G_EVAL_BSP_VERSION_SUB1   (0x00) /*!< [23:16] sub1 version */
00093 #define __STM32756G_EVAL_BSP_VERSION_SUB2   (0x00) /*!< [15:8]  sub2 version */
00094 #define __STM32756G_EVAL_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00095 #define __STM32756G_EVAL_BSP_VERSION         ((__STM32756G_EVAL_BSP_VERSION_MAIN << 24)\
00096                                              |(__STM32756G_EVAL_BSP_VERSION_SUB1 << 16)\
00097                                              |(__STM32756G_EVAL_BSP_VERSION_SUB2 << 8 )\
00098                                              |(__STM32756G_EVAL_BSP_VERSION_RC))
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Macros STM32756G-EVAL LOW LEVEL Private Macros
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Variables STM32756G-EVAL LOW LEVEL Private Variables
00111   * @{
00112   */
00113
00114 #if defined(USE_IOEXPANDER)
00115 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00116                                  LED2_PIN,
00117                                  LED3_PIN,
00118                                  LED4_PIN};
00119 #else
00120 const uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00121                                  LED3_PIN};
00122 #endif /* USE_IOEXPANDER */
00123
00124
00125 GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT,
00126                                       TAMPER_BUTTON_GPIO_PORT,
00127                                       KEY_BUTTON_GPIO_PORT};
00128
00129 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN,
00130                                       TAMPER_BUTTON_PIN,
00131                                       KEY_BUTTON_PIN};
00132
00133 const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn,
00134                                        TAMPER_BUTTON_EXTI_IRQn,
00135                                        KEY_BUTTON_EXTI_IRQn};
00136
00137 USART_TypeDef* COM_USART[COMn] = {EVAL_COM1};
00138
00139 GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT};
00140
00141 GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT};
00142
00143 const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN};
00144
00145 const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN};
00146
00147 const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF};
00148
00149 const uint16_t COM_RX_AF[COMn] = {EVAL_COM1_RX_AF};
00150
00151 static I2C_HandleTypeDef hEvalI2c;
00152 static ADC_HandleTypeDef hEvalADC;
00153 /**
00154   * @}
00155   */
00156
00157 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_FunctionPrototypes  STM32756G_EVAL LOW LEVEL Private Function Prototypes
00158   * @{
00159   */
00160 static void     I2Cx_MspInit(void);
00161 static void     I2Cx_Init(void);
00162 #if defined(USE_IOEXPANDER)
00163 static void     I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00164 static uint8_t  I2Cx_Read(uint8_t Addr, uint8_t Reg);
00165 #endif /* USE_IOEXPANDER */
00166
00167 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00168 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00169 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00170 static void     I2Cx_Error(uint8_t Addr);
00171
00172 #if defined(USE_IOEXPANDER)
00173 /* IOExpander IO functions */
00174 void            IOE_Init(void);
00175 void            IOE_ITConfig(void);
00176 void            IOE_Delay(uint32_t Delay);
00177 void            IOE_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00178 uint8_t         IOE_Read(uint8_t Addr, uint8_t Reg);
00179 uint16_t        IOE_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00180 void            IOE_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00181
00182 /* MFX IO functions */
00183 void            MFX_IO_Init(void);
00184 void            MFX_IO_DeInit(void);
00185 void            MFX_IO_ITConfig(void);
00186 void            MFX_IO_Delay(uint32_t Delay);
00187 void            MFX_IO_Write(uint16_t Addr, uint8_t Reg, uint8_t Value);
00188 uint8_t         MFX_IO_Read(uint16_t Addr, uint8_t Reg);
00189 uint16_t        MFX_IO_ReadMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00190 void            MFX_IO_Wakeup(void);
00191 void            MFX_IO_EnableWakeupPin(void);
00192 #endif /* USE_IOEXPANDER */
00193
00194 /* AUDIO IO functions */
00195 void            AUDIO_IO_Init(void);
00196 void            AUDIO_IO_DeInit(void);
00197 void            AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00198 uint16_t        AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
00199 void            AUDIO_IO_Delay(uint32_t Delay);
00200
00201 /* CAMERA IO functions */
00202 void            CAMERA_IO_Init(void);
00203 void            CAMERA_Delay(uint32_t Delay);
00204 void            CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
00205 uint16_t        CAMERA_IO_Read(uint8_t Addr, uint16_t Reg);
00206
00207 /* I2C EEPROM IO function */
00208 void                EEPROM_IO_Init(void);
00209 HAL_StatusTypeDef   EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00210 HAL_StatusTypeDef   EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00211 HAL_StatusTypeDef   EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00212 /**
00213   * @}
00214   */
00215
00216 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Private_Functions STM32756G_EVAL LOW LEVEL Private Functions
00217   * @{
00218   */
00219
00220   /**
00221   * @brief  This method returns the STM32756G EVAL BSP Driver revision
00222   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00223   */
00224 uint32_t BSP_GetVersion(void)
00225 {
00226   return __STM32756G_EVAL_BSP_VERSION;
00227 }
00228
00229 /**
00230   * @brief  Configures LED on GPIO and/or on MFX.
00231   * @param  Led: LED to be configured.
00232   *          This parameter can be one of the following values:
00233   *            @arg  LED1
00234   *            @arg  LED2
00235   *            @arg  LED3
00236   *            @arg  LED4
00237   * @retval None
00238   */
00239 void BSP_LED_Init(Led_TypeDef Led)
00240 {
00241 #if !defined(USE_STM32756G_EVAL_REVA)
00242   /* On RevB and above evaluation boards, LED1 and LED3 are connected to GPIOs */
00243   /* To use LED1 on RevB board, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
00244   /* To use LED3 on RevB board, ensure that JP23 is in position 2-3, camera is then no more usable */
00245   GPIO_InitTypeDef  gpio_init_structure;
00246   GPIO_TypeDef*     gpio_led;
00247
00248   if ((Led == LED1) || (Led == LED3))
00249   {
00250     if (Led == LED1)
00251     {
00252       gpio_led = LED1_GPIO_PORT;
00253       /* Enable the GPIO_LED clock */
00254       LED1_GPIO_CLK_ENABLE();
00255     }
00256     else
00257     {
00258       gpio_led = LED3_GPIO_PORT;
00259       /* Enable the GPIO_LED clock */
00260       LED3_GPIO_CLK_ENABLE();
00261     }
00262
00263     /* Configure the GPIO_LED pin */
00264     gpio_init_structure.Pin = GPIO_PIN[Led];
00265     gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
00266     gpio_init_structure.Pull = GPIO_PULLUP;
00267     gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00268
00269     HAL_GPIO_Init(gpio_led, &gpio_init_structure);
00270
00271     /* By default, turn off LED */
00272     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
00273   }
00274   else
00275   {
00276 #endif /* !USE_STM32756G_EVAL_REVA */
00277
00278 #if defined(USE_IOEXPANDER)
00279   /* On RevA eval board, all LEDs are connected to MFX */
00280   /* On RevB and above eval board, LED2 and LED4 are connected to MFX */
00281   BSP_IO_Init();        /* Initialize MFX */
00282   BSP_IO_ConfigPin(GPIO_PIN[Led], IO_MODE_OUTPUT_PP_PU);
00283   BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_SET);
00284 #endif  /* USE_IOEXPANDER */
00285
00286 #if !defined(USE_STM32756G_EVAL_REVA)
00287   }
00288 #endif /* !USE_STM32756G_EVAL_REVA */
00289 }
00290
00291
00292 /**
00293   * @brief  DeInit LEDs.
00294   * @param  Led: LED to be configured.
00295   *          This parameter can be one of the following values:
00296   *            @arg  LED1
00297   *            @arg  LED2
00298   *            @arg  LED3
00299   *            @arg  LED4
00300   * @note Led DeInit does not disable the GPIO clock nor disable the Mfx
00301   * @retval None
00302   */
00303 void BSP_LED_DeInit(Led_TypeDef Led)
00304 {
00305 #if !defined(USE_STM32756G_EVAL_REVA)
00306   GPIO_InitTypeDef  gpio_init_structure;
00307   GPIO_TypeDef*     gpio_led;
00308
00309   /* On RevB led1 and Led3 are on GPIO while Led2 and Led4 on Mfx*/
00310   if ((Led == LED1) || (Led == LED3))
00311   {
00312     if (Led == LED1)
00313     {
00314       gpio_led = LED1_GPIO_PORT;
00315     }
00316     else
00317     {
00318       gpio_led = LED3_GPIO_PORT;
00319     }
00320     /* Turn off LED */
00321     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00322     /* Configure the GPIO_LED pin */
00323     gpio_init_structure.Pin = GPIO_PIN[Led];
00324     HAL_GPIO_DeInit(gpio_led, gpio_init_structure.Pin);
00325   }
00326   else
00327   {
00328 #endif /* !USE_STM32756G_EVAL_REVA */
00329
00330 #if defined(USE_IOEXPANDER)   /* (USE_IOEXPANDER always defined for RevA) */
00331     /* GPIO_PIN[Led]  depends on the board revision: */
00332     /*  - in case of RevA all leds are deinit  */
00333     /*  - in case of RevB just led 2 and led4 are deinit */
00334     BSP_IO_ConfigPin(GPIO_PIN[Led], IO_MODE_OFF);
00335 #endif /* USE_IOEXPANDER */
00336
00337 #if !defined(USE_STM32756G_EVAL_REVA)
00338   }
00339 #endif /* !USE_STM32756G_EVAL_REVA */
00340 }
00341
00342 /**
00343   * @brief  Turns selected LED On.
00344   * @param  Led: LED to be set on
00345   *          This parameter can be one of the following values:
00346   *            @arg  LED1
00347   *            @arg  LED2
00348   *            @arg  LED3
00349   *            @arg  LED4
00350   * @retval None
00351   */
00352 void BSP_LED_On(Led_TypeDef Led)
00353 {
00354 #if !defined(USE_STM32756G_EVAL_REVA)
00355   GPIO_TypeDef*     gpio_led;
00356
00357   if ((Led == LED1) || (Led == LED3))   /* Switch On LED connected to GPIO */
00358   {
00359     if (Led == LED1)
00360     {
00361       gpio_led = LED1_GPIO_PORT;
00362     }
00363     else
00364     {
00365       gpio_led = LED3_GPIO_PORT;
00366     }
00367     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
00368   }
00369   else
00370   {
00371 #endif /* !USE_STM32756G_EVAL_REVA */
00372
00373 #if defined(USE_IOEXPANDER)            /* Switch On LED connected to MFX */
00374       BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_RESET);
00375 #endif /* USE_IOEXPANDER */
00376
00377 #if !defined(USE_STM32756G_EVAL_REVA)
00378   }
00379 #endif /* !USE_STM32756G_EVAL_REVA */
00380 }
00381
00382 /**
00383   * @brief  Turns selected LED Off.
00384   * @param  Led: LED to be set off
00385   *          This parameter can be one of the following values:
00386   *            @arg  LED1
00387   *            @arg  LED2
00388   *            @arg  LED3
00389   *            @arg  LED4
00390   * @retval None
00391   */
00392 void BSP_LED_Off(Led_TypeDef Led)
00393 {
00394 #if !defined(USE_STM32756G_EVAL_REVA)
00395   GPIO_TypeDef*     gpio_led;
00396
00397   if ((Led == LED1) || (Led == LED3)) /* Switch Off LED connected to GPIO */
00398   {
00399     if (Led == LED1)
00400     {
00401       gpio_led = LED1_GPIO_PORT;
00402     }
00403     else
00404     {
00405       gpio_led = LED3_GPIO_PORT;
00406     }
00407     HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
00408   }
00409   else
00410   {
00411 #endif /* !USE_STM32756G_EVAL_REVA */
00412
00413 #if defined(USE_IOEXPANDER)             /* Switch Off LED connected to MFX */
00414      BSP_IO_WritePin(GPIO_PIN[Led], BSP_IO_PIN_SET);
00415 #endif /* USE_IOEXPANDER */
00416
00417 #if !defined(USE_STM32756G_EVAL_REVA)
00418   }
00419 #endif /* !USE_STM32756G_EVAL_REVA */
00420
00421 }
00422
00423 /**
00424   * @brief  Toggles the selected LED.
00425   * @param  Led: LED to be toggled
00426   *          This parameter can be one of the following values:
00427   *            @arg  LED1
00428   *            @arg  LED2
00429   *            @arg  LED3
00430   *            @arg  LED4
00431   * @retval None
00432   */
00433 void BSP_LED_Toggle(Led_TypeDef Led)
00434 {
00435 #if !defined(USE_STM32756G_EVAL_REVA)
00436   GPIO_TypeDef*     gpio_led;
00437
00438   if ((Led == LED1) || (Led == LED3))   /* Toggle LED connected to GPIO */
00439   {
00440     if (Led == LED1)
00441     {
00442       gpio_led = LED1_GPIO_PORT;
00443     }
00444     else
00445     {
00446       gpio_led = LED3_GPIO_PORT;
00447     }
00448     HAL_GPIO_TogglePin(gpio_led, GPIO_PIN[Led]);
00449   }
00450   else
00451   {
00452 #endif /* !USE_STM32756G_EVAL_REVA */
00453
00454 #if defined(USE_IOEXPANDER)             /* Toggle LED connected to MFX */
00455      BSP_IO_TogglePin(GPIO_PIN[Led]);
00456 #endif /* USE_IOEXPANDER */
00457
00458 #if !defined(USE_STM32756G_EVAL_REVA)
00459   }
00460 #endif /* !USE_STM32756G_EVAL_REVA */
00461 }
00462
00463 /**
00464   * @brief  Configures button GPIO and EXTI Line.
00465   * @param  Button: Button to be configured
00466   *          This parameter can be one of the following values:
00467   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00468   *            @arg  BUTTON_TAMPER: Tamper Push Button
00469   *            @arg  BUTTON_KEY: Key Push Button
00470   * @param  ButtonMode: Button mode
00471   *          This parameter can be one of the following values:
00472   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00473   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00474   *                                    with interrupt generation capability
00475   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00476   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00477   *       on the board serigraphy.
00478   * @retval None
00479   */
00480 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
00481 {
00482   GPIO_InitTypeDef gpio_init_structure;
00483
00484   /* Enable the BUTTON clock */
00485   BUTTONx_GPIO_CLK_ENABLE(Button);
00486
00487   if(ButtonMode == BUTTON_MODE_GPIO)
00488   {
00489     /* Configure Button pin as input */
00490     gpio_init_structure.Pin = BUTTON_PIN[Button];
00491     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00492     gpio_init_structure.Pull = GPIO_NOPULL;
00493     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00494     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00495   }
00496
00497   if(ButtonMode == BUTTON_MODE_EXTI)
00498   {
00499     /* Configure Button pin as input with External interrupt */
00500     gpio_init_structure.Pin = BUTTON_PIN[Button];
00501     gpio_init_structure.Pull = GPIO_NOPULL;
00502     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00503
00504     if(Button != BUTTON_WAKEUP)
00505     {
00506       gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00507     }
00508     else
00509     {
00510       gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00511     }
00512
00513     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00514
00515     /* Enable and set Button EXTI Interrupt to the lowest priority */
00516     HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
00517     HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00518   }
00519 }
00520
00521 /**
00522   * @brief  Push Button DeInit.
00523   * @param  Button: Button to be configured
00524   *          This parameter can be one of the following values:
00525   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00526   *            @arg  BUTTON_TAMPER: Tamper Push Button
00527   *            @arg  BUTTON_KEY: Key Push Button
00528   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00529   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00530   *       on the board serigraphy.
00531   * @note PB DeInit does not disable the GPIO clock
00532   * @retval None
00533   */
00534 void BSP_PB_DeInit(Button_TypeDef Button)
00535 {
00536     GPIO_InitTypeDef gpio_init_structure;
00537
00538     gpio_init_structure.Pin = BUTTON_PIN[Button];
00539     HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00540     HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00541 }
00542
00543
00544 /**
00545   * @brief  Returns the selected button state.
00546   * @param  Button: Button to be checked
00547   *          This parameter can be one of the following values:
00548   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00549   *            @arg  BUTTON_TAMPER: Tamper Push Button
00550   *            @arg  BUTTON_KEY: Key Push Button
00551   * @note On STM32756G-EVAL evaluation board, the three buttons (Wakeup, Tamper
00552   *       and key buttons) are mapped on the same push button named "Wakeup/Tamper"
00553   *       on the board serigraphy.
00554   * @retval The Button GPIO pin value
00555   */
00556 uint32_t BSP_PB_GetState(Button_TypeDef Button)
00557 {
00558   return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00559 }
00560
00561 /**
00562   * @brief  Configures COM port.
00563   * @param  COM: COM port to be configured.
00564   *          This parameter can be one of the following values:
00565   *            @arg  COM1
00566   *            @arg  COM2
00567   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00568   *                configuration information for the specified USART peripheral.
00569   * @retval None
00570   */
00571 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart)
00572 {
00573   GPIO_InitTypeDef gpio_init_structure;
00574
00575   /* Enable GPIO clock */
00576   EVAL_COMx_TX_GPIO_CLK_ENABLE(COM);
00577   EVAL_COMx_RX_GPIO_CLK_ENABLE(COM);
00578
00579   /* Enable USART clock */
00580   EVAL_COMx_CLK_ENABLE(COM);
00581
00582   /* Configure USART Tx as alternate function */
00583   gpio_init_structure.Pin = COM_TX_PIN[COM];
00584   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00585   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00586   gpio_init_structure.Pull = GPIO_PULLUP;
00587   gpio_init_structure.Alternate = COM_TX_AF[COM];
00588   HAL_GPIO_Init(COM_TX_PORT[COM], &gpio_init_structure);
00589
00590   /* Configure USART Rx as alternate function */
00591   gpio_init_structure.Pin = COM_RX_PIN[COM];
00592   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00593   gpio_init_structure.Alternate = COM_RX_AF[COM];
00594   HAL_GPIO_Init(COM_RX_PORT[COM], &gpio_init_structure);
00595
00596   /* USART configuration */
00597   huart->Instance = COM_USART[COM];
00598   HAL_UART_Init(huart);
00599 }
00600
00601 /**
00602   * @brief  DeInit COM port.
00603   * @param  COM: COM port to be configured.
00604   *          This parameter can be one of the following values:
00605   *            @arg  COM1
00606   *            @arg  COM2
00607   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00608   *                configuration information for the specified USART peripheral.
00609   * @retval None
00610   */
00611 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart)
00612 {
00613   /* USART configuration */
00614   huart->Instance = COM_USART[COM];
00615   HAL_UART_DeInit(huart);
00616
00617   /* Enable USART clock */
00618   EVAL_COMx_CLK_DISABLE(COM);
00619
00620   /* DeInit GPIO pins can be done in the application
00621      (by surcharging this __weak function) */
00622
00623   /* GPIO pins clock, DMA clock can be shut down in the application
00624      by surcharging this __weak function */
00625 }
00626
00627 /**
00628   * @brief  Init Potentiometer.
00629   * @retval None
00630   */
00631 void BSP_POTENTIOMETER_Init(void)
00632 {
00633     GPIO_InitTypeDef          GPIO_InitStruct;
00634     ADC_ChannelConfTypeDef    ADC_Config;
00635
00636     /* ADC an GPIO Periph clock enable */
00637     ADCx_CLK_ENABLE();
00638     ADCx_CHANNEL_GPIO_CLK_ENABLE();
00639
00640     /* ADC Channel GPIO pin configuration */
00641     GPIO_InitStruct.Pin = ADCx_CHANNEL_PIN;
00642     GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
00643     GPIO_InitStruct.Pull = GPIO_NOPULL;
00644     HAL_GPIO_Init(ADCx_CHANNEL_GPIO_PORT, &GPIO_InitStruct);
00645
00646     /* Configure the ADC peripheral */
00647     hEvalADC.Instance          = ADCx;
00648
00649     HAL_ADC_DeInit(&hEvalADC);
00650
00651     hEvalADC.Init.ClockPrescaler        = ADC_CLOCKPRESCALER_PCLK_DIV4;   /* Asynchronous clock mode, input ADC clock not divided */
00652     hEvalADC.Init.Resolution            = ADC_RESOLUTION_12B;            /* 12-bit resolution for converted data */
00653     hEvalADC.Init.DataAlign             = ADC_DATAALIGN_RIGHT;           /* Right-alignment for converted data */
00654     hEvalADC.Init.ScanConvMode          = DISABLE;                       /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
00655     hEvalADC.Init.EOCSelection          = DISABLE;                       /* EOC flag picked-up to indicate conversion end */
00656     hEvalADC.Init.ContinuousConvMode    = DISABLE;                       /* Continuous mode disabled to have only 1 conversion at each conversion trig */
00657     hEvalADC.Init.NbrOfConversion       = 1;                             /* Parameter discarded because sequencer is disabled */
00658     hEvalADC.Init.DiscontinuousConvMode = DISABLE;                       /* Parameter discarded because sequencer is disabled */
00659     hEvalADC.Init.NbrOfDiscConversion   = 0;                             /* Parameter discarded because sequencer is disabled */
00660     hEvalADC.Init.ExternalTrigConv      = ADC_EXTERNALTRIGCONV_T1_CC1;   /* Software start to trig the 1st conversion manually, without external event */
00661     hEvalADC.Init.ExternalTrigConvEdge  = ADC_EXTERNALTRIGCONVEDGE_NONE; /* Parameter discarded because software trigger chosen */
00662     hEvalADC.Init.DMAContinuousRequests = DISABLE;                       /* DMA one-shot mode selected  */
00663
00664
00665     HAL_ADC_Init(&hEvalADC);
00666
00667     /* Configure ADC regular channel */
00668     ADC_Config.Channel      = ADCx_CHANNEL;                /* Sampled channel number */
00669     ADC_Config.Rank         = 1;                           /* Rank of sampled channel number ADCx_CHANNEL */
00670     ADC_Config.SamplingTime = ADC_SAMPLETIME_3CYCLES;      /* Sampling time (number of clock cycles unit) */
00671     ADC_Config.Offset = 0;                                 /* Parameter discarded because offset correction is disabled */
00672
00673     HAL_ADC_ConfigChannel(&hEvalADC, &ADC_Config);
00674 }
00675
00676 /**
00677   * @brief  Get Potentiometer level in 12 bits.
00678   * @retval Potentiometer level(0..0xFFF) / 0xFFFFFFFF : Error
00679   */
00680 uint32_t BSP_POTENTIOMETER_GetLevel(void)
00681 {
00682   if(HAL_ADC_Start(&hEvalADC) == HAL_OK)
00683   {
00684     if(HAL_ADC_PollForConversion(&hEvalADC, ADCx_POLL_TIMEOUT)== HAL_OK)
00685     {
00686       return (HAL_ADC_GetValue(&hEvalADC));
00687     }
00688   }
00689   return  0xFFFFFFFF;
00690 }
00691
00692 #if defined(USE_IOEXPANDER)
00693 /**
00694   * @brief  Configures joystick GPIO and EXTI modes.
00695   * @param  JoyMode: Button mode.
00696   *          This parameter can be one of the following values:
00697   *            @arg  JOY_MODE_GPIO: Joystick pins will be used as simple IOs
00698   *            @arg  JOY_MODE_EXTI: Joystick pins will be connected to EXTI line
00699   *                                 with interrupt generation capability
00700   * @retval IO_OK: if all initializations are OK. Other value if error.
00701   */
00702 uint8_t BSP_JOY_Init(JOYMode_TypeDef JoyMode)
00703 {
00704   uint8_t ret = 0;
00705
00706   /* Initialize the IO functionalities */
00707   ret = BSP_IO_Init();
00708
00709   /* Configure joystick pins in IT mode */
00710   if(JoyMode == JOY_MODE_EXTI)
00711   {
00712     /* Configure IO interrupt acquisition mode */
00713     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_IT_LOW_LEVEL_PU);
00714   }
00715   else
00716   {
00717     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_INPUT_PU);
00718   }
00719
00720   return ret;
00721 }
00722
00723
00724 /**
00725   * @brief  DeInit joystick GPIOs.
00726   * @note   JOY DeInit does not disable the MFX, just set the MFX pins in Off mode
00727   * @retval None.
00728   */
00729 void BSP_JOY_DeInit()
00730 {
00731     BSP_IO_ConfigPin(JOY_ALL_PINS, IO_MODE_OFF);
00732 }
00733
00734 /**
00735   * @brief  Returns the current joystick status.
00736   * @retval Code of the joystick key pressed
00737   *          This code can be one of the following values:
00738   *            @arg  JOY_NONE
00739   *            @arg  JOY_SEL
00740   *            @arg  JOY_DOWN
00741   *            @arg  JOY_LEFT
00742   *            @arg  JOY_RIGHT
00743   *            @arg  JOY_UP
00744   */
00745 JOYState_TypeDef BSP_JOY_GetState(void)
00746 {
00747   uint16_t pin_status = 0;
00748
00749   /* Read the status joystick pins */
00750   pin_status = BSP_IO_ReadPin(JOY_ALL_PINS);
00751
00752   /* Check the pressed keys */
00753   if((pin_status & JOY_NONE_PIN) == JOY_NONE)
00754   {
00755     return(JOYState_TypeDef) JOY_NONE;
00756   }
00757   else if(!(pin_status & JOY_SEL_PIN))
00758   {
00759     return(JOYState_TypeDef) JOY_SEL;
00760   }
00761   else if(!(pin_status & JOY_DOWN_PIN))
00762   {
00763     return(JOYState_TypeDef) JOY_DOWN;
00764   }
00765   else if(!(pin_status & JOY_LEFT_PIN))
00766   {
00767     return(JOYState_TypeDef) JOY_LEFT;
00768   }
00769   else if(!(pin_status & JOY_RIGHT_PIN))
00770   {
00771     return(JOYState_TypeDef) JOY_RIGHT;
00772   }
00773   else if(!(pin_status & JOY_UP_PIN))
00774   {
00775     return(JOYState_TypeDef) JOY_UP;
00776   }
00777   else
00778   {
00779     return(JOYState_TypeDef) JOY_NONE;
00780   }
00781 }
00782
00783 /**
00784   * @brief  Check TS3510 touch screen presence
00785   * @retval Return 0 if TS3510 is detected, return 1 if not detected
00786   */
00787 uint8_t BSP_TS3510_IsDetected(void)
00788 {
00789   HAL_StatusTypeDef status = HAL_OK;
00790   uint32_t error = 0;
00791   uint8_t a_buffer;
00792
00793   uint8_t tmp_buffer[2] = {0x81, 0x08};
00794
00795   /* Prepare for LCD read data */
00796   IOE_WriteMultiple(TS3510_I2C_ADDRESS, 0x8A, tmp_buffer, 2);
00797
00798   status = HAL_I2C_Mem_Read(&hEvalI2c, TS3510_I2C_ADDRESS, 0x8A, I2C_MEMADD_SIZE_8BIT, &a_buffer, 1, 1000);
00799
00800   /* Check the communication status */
00801   if(status != HAL_OK)
00802   {
00803     error = (uint32_t)HAL_I2C_GetError(&hEvalI2c);
00804
00805     /* I2C error occurred */
00806     I2Cx_Error(TS3510_I2C_ADDRESS);
00807
00808     if(error == HAL_I2C_ERROR_AF)
00809     {
00810       return 1;
00811     }
00812   }
00813   return 0;
00814 }
00815 #endif /* USE_IOEXPANDER */
00816
00817 /*******************************************************************************
00818                             BUS OPERATIONS
00819 *******************************************************************************/
00820
00821 /******************************* I2C Routines *********************************/
00822 /**
00823   * @brief  Initializes I2C MSP.
00824   * @retval None
00825   */
00826 static void I2Cx_MspInit(void)
00827 {
00828   GPIO_InitTypeDef  gpio_init_structure;
00829
00830   /*** Configure the GPIOs ***/
00831   /* Enable GPIO clock */
00832   EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
00833
00834   /* Configure I2C Tx as alternate function */
00835   gpio_init_structure.Pin = EVAL_I2Cx_SCL_PIN;
00836   gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00837   gpio_init_structure.Pull = GPIO_NOPULL;
00838   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00839   gpio_init_structure.Alternate = EVAL_I2Cx_SCL_SDA_AF;
00840   HAL_GPIO_Init(EVAL_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00841
00842   /* Configure I2C Rx as alternate function */
00843   gpio_init_structure.Pin = EVAL_I2Cx_SDA_PIN;
00844   HAL_GPIO_Init(EVAL_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00845
00846   /*** Configure the I2C peripheral ***/
00847   /* Enable I2C clock */
00848   EVAL_I2Cx_CLK_ENABLE();
00849
00850   /* Force the I2C peripheral clock reset */
00851   EVAL_I2Cx_FORCE_RESET();
00852
00853   /* Release the I2C peripheral clock reset */
00854   EVAL_I2Cx_RELEASE_RESET();
00855
00856   /* Enable and set I2Cx Interrupt to a lower priority */
00857   HAL_NVIC_SetPriority(EVAL_I2Cx_EV_IRQn, 0x0F, 0);
00858   HAL_NVIC_EnableIRQ(EVAL_I2Cx_EV_IRQn);
00859
00860   /* Enable and set I2Cx Interrupt to a lower priority */
00861   HAL_NVIC_SetPriority(EVAL_I2Cx_ER_IRQn, 0x0F, 0);
00862   HAL_NVIC_EnableIRQ(EVAL_I2Cx_ER_IRQn);
00863 }
00864
00865 /**
00866   * @brief  Initializes I2C HAL.
00867   * @retval None
00868   */
00869 static void I2Cx_Init(void)
00870 {
00871   if(HAL_I2C_GetState(&hEvalI2c) == HAL_I2C_STATE_RESET)
00872   {
00873     hEvalI2c.Instance              = EVAL_I2Cx;
00874     hEvalI2c.Init.Timing           = EVAL_I2Cx_TIMING;
00875     hEvalI2c.Init.OwnAddress1      = 0;
00876     hEvalI2c.Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00877     hEvalI2c.Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00878     hEvalI2c.Init.OwnAddress2      = 0;
00879     hEvalI2c.Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00880     hEvalI2c.Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00881
00882     /* Init the I2C */
00883     I2Cx_MspInit();
00884     HAL_I2C_Init(&hEvalI2c);
00885   }
00886 }
00887
00888
00889 #if defined(USE_IOEXPANDER)
00890 /**
00891   * @brief  Writes a single data.
00892   * @param  Addr: I2C address
00893   * @param  Reg: Register address
00894   * @param  Value: Data to be written
00895   * @retval None
00896   */
00897 static void I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00898 {
00899   HAL_StatusTypeDef status = HAL_OK;
00900
00901   status = HAL_I2C_Mem_Write(&hEvalI2c, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 100);
00902
00903   /* Check the communication status */
00904   if(status != HAL_OK)
00905   {
00906     /* Execute user timeout callback */
00907     I2Cx_Error(Addr);
00908   }
00909 }
00910
00911 /**
00912   * @brief  Reads a single data.
00913   * @param  Addr: I2C address
00914   * @param  Reg: Register address
00915   * @retval Read data
00916   */
00917 static uint8_t I2Cx_Read(uint8_t Addr, uint8_t Reg)
00918 {
00919   HAL_StatusTypeDef status = HAL_OK;
00920   uint8_t Value = 0;
00921
00922   status = HAL_I2C_Mem_Read(&hEvalI2c, Addr, Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 1000);
00923
00924   /* Check the communication status */
00925   if(status != HAL_OK)
00926   {
00927     /* Execute user timeout callback */
00928     I2Cx_Error(Addr);
00929   }
00930   return Value;
00931 }
00932 #endif /* USE_IOEXPANDER */
00933
00934 /**
00935   * @brief  Reads multiple data.
00936   * @param  Addr: I2C address
00937   * @param  Reg: Reg address
00938   * @param  MemAddress: Internal memory address
00939   * @param  Buffer: Pointer to data buffer
00940   * @param  Length: Length of the data
00941   * @retval Number of read data
00942   */
00943 static HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00944 {
00945   HAL_StatusTypeDef status = HAL_OK;
00946
00947   if(Addr == EXC7200_I2C_ADDRESS)
00948   {
00949     status = HAL_I2C_Master_Receive(&hEvalI2c, Addr, Buffer, Length, 1000);
00950   }
00951   else
00952   {
00953     status = HAL_I2C_Mem_Read(&hEvalI2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00954   }
00955
00956   /* Check the communication status */
00957   if(status != HAL_OK)
00958   {
00959     /* I2C error occurred */
00960     I2Cx_Error(Addr);
00961   }
00962   return status;
00963 }
00964
00965 /**
00966   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00967   * @param  Addr: Device address on BUS Bus.
00968   * @param  Reg: The target register address to write
00969   * @param  MemAddress: Internal memory address
00970   * @param  Buffer: The target register value to be written
00971   * @param  Length: buffer size to be written
00972   * @retval HAL status
00973   */
00974 static HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
00975 {
00976   HAL_StatusTypeDef status = HAL_OK;
00977
00978   status = HAL_I2C_Mem_Write(&hEvalI2c, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00979
00980   /* Check the communication status */
00981   if(status != HAL_OK)
00982   {
00983     /* Re-Initiaize the I2C Bus */
00984     I2Cx_Error(Addr);
00985   }
00986   return status;
00987 }
00988
00989 /**
00990   * @brief  Checks if target device is ready for communication.
00991   * @note   This function is used with Memory devices
00992   * @param  DevAddress: Target device address
00993   * @param  Trials: Number of trials
00994   * @retval HAL status
00995   */
00996 static HAL_StatusTypeDef I2Cx_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00997 {
00998   return (HAL_I2C_IsDeviceReady(&hEvalI2c, DevAddress, Trials, 1000));
00999 }
01000
01001 /**
01002   * @brief  Manages error callback by re-initializing I2C.
01003   * @param  Addr: I2C Address
01004   * @retval None
01005   */
01006 static void I2Cx_Error(uint8_t Addr)
01007 {
01008   /* De-initialize the I2C communication bus */
01009   HAL_I2C_DeInit(&hEvalI2c);
01010
01011   /* Re-Initialize the I2C communication bus */
01012   I2Cx_Init();
01013 }
01014
01015 /*******************************************************************************
01016                             LINK OPERATIONS
01017 *******************************************************************************/
01018
01019 /********************************* LINK IOE ***********************************/
01020 #if defined(USE_IOEXPANDER)
01021 /**
01022   * @brief  Initializes IOE low level.
01023   * @retval None
01024   */
01025 void IOE_Init(void)
01026 {
01027   I2Cx_Init();
01028 }
01029
01030 /**
01031   * @brief  Configures IOE low level interrupt.
01032   * @retval None
01033   */
01034 void IOE_ITConfig(void)
01035 {
01036   /* STMPE811 IO expander IT config done by BSP_TS_ITConfig function */
01037 }
01038
01039 /**
01040   * @brief  IOE writes single data.
01041   * @param  Addr: I2C address
01042   * @param  Reg: Register address
01043   * @param  Value: Data to be written
01044   * @retval None
01045   */
01046 void IOE_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
01047 {
01048   I2Cx_Write(Addr, Reg, Value);
01049 }
01050
01051 /**
01052   * @brief  IOE reads single data.
01053   * @param  Addr: I2C address
01054   * @param  Reg: Register address
01055   * @retval Read data
01056   */
01057 uint8_t IOE_Read(uint8_t Addr, uint8_t Reg)
01058 {
01059   return I2Cx_Read(Addr, Reg);
01060 }
01061
01062 /**
01063   * @brief  IOE reads multiple data.
01064   * @param  Addr: I2C address
01065   * @param  Reg: Register address
01066   * @param  Buffer: Pointer to data buffer
01067   * @param  Length: Length of the data
01068   * @retval Number of read data
01069   */
01070 uint16_t IOE_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01071 {
01072  return I2Cx_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01073 }
01074
01075 /**
01076   * @brief  IOE writes multiple data.
01077   * @param  Addr: I2C address
01078   * @param  Reg: Register address
01079   * @param  Buffer: Pointer to data buffer
01080   * @param  Length: Length of the data
01081   * @retval None
01082   */
01083 void IOE_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01084 {
01085   I2Cx_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01086 }
01087
01088 /**
01089   * @brief  IOE delay
01090   * @param  Delay: Delay in ms
01091   * @retval None
01092   */
01093 void IOE_Delay(uint32_t Delay)
01094 {
01095   HAL_Delay(Delay);
01096 }
01097 #endif /* USE_IOEXPANDER */
01098
01099 /********************************* LINK MFX ***********************************/
01100
01101 #if defined(USE_IOEXPANDER)
01102 /**
01103   * @brief  Initializes MFX low level.
01104   * @retval None
01105   */
01106 void MFX_IO_Init(void)
01107 {
01108   I2Cx_Init();
01109 }
01110
01111 /**
01112   * @brief  DeInitializes MFX low level.
01113   * @retval None
01114   */
01115 void MFX_IO_DeInit(void)
01116 {
01117 }
01118
01119 /**
01120   * @brief  Configures MFX low level interrupt.
01121   * @retval None
01122   */
01123 void MFX_IO_ITConfig(void)
01124 {
01125   static uint8_t mfx_io_it_enabled = 0;
01126   GPIO_InitTypeDef  gpio_init_structure;
01127
01128   if(mfx_io_it_enabled == 0)
01129   {
01130     mfx_io_it_enabled = 1;
01131     /* Enable the GPIO EXTI clock */
01132     __HAL_RCC_GPIOI_CLK_ENABLE();
01133     __HAL_RCC_SYSCFG_CLK_ENABLE();
01134
01135     gpio_init_structure.Pin   = GPIO_PIN_8;
01136     gpio_init_structure.Pull  = GPIO_NOPULL;
01137     gpio_init_structure.Speed = GPIO_SPEED_LOW;
01138     gpio_init_structure.Mode  = GPIO_MODE_IT_RISING;
01139     HAL_GPIO_Init(GPIOI, &gpio_init_structure);
01140
01141     /* Enable and set GPIO EXTI Interrupt to the lowest priority */
01142     HAL_NVIC_SetPriority((IRQn_Type)(EXTI9_5_IRQn), 0x0F, 0x0F);
01143     HAL_NVIC_EnableIRQ((IRQn_Type)(EXTI9_5_IRQn));
01144   }
01145 }
01146
01147 /**
01148   * @brief  MFX writes single data.
01149   * @param  Addr: I2C address
01150   * @param  Reg: Register address
01151   * @param  Value: Data to be written
01152   * @retval None
01153   */
01154 void MFX_IO_Write(uint16_t Addr, uint8_t Reg, uint8_t Value)
01155 {
01156   I2Cx_Write((uint8_t) Addr, Reg, Value);
01157 }
01158
01159 /**
01160   * @brief  MFX reads single data.
01161   * @param  Addr: I2C address
01162   * @param  Reg: Register address
01163   * @retval Read data
01164   */
01165 uint8_t MFX_IO_Read(uint16_t Addr, uint8_t Reg)
01166 {
01167   return I2Cx_Read((uint8_t) Addr, Reg);
01168 }
01169
01170 /**
01171   * @brief  MFX reads multiple data.
01172   * @param  Addr: I2C address
01173   * @param  Reg: Register address
01174   * @param  Buffer: Pointer to data buffer
01175   * @param  Length: Length of the data
01176   * @retval Number of read data
01177   */
01178 uint16_t MFX_IO_ReadMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01179 {
01180  return I2Cx_ReadMultiple((uint8_t)Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01181 }
01182
01183 /**
01184   * @brief  MFX delay
01185   * @param  Delay: Delay in ms
01186   * @retval None
01187   */
01188 void MFX_IO_Delay(uint32_t Delay)
01189 {
01190   HAL_Delay(Delay);
01191 }
01192
01193 /**
01194   * @brief  Used by Lx family but requested for MFX component compatibility.
01195   * @retval None
01196   */
01197 void MFX_IO_Wakeup(void)
01198 {
01199 }
01200
01201 /**
01202   * @brief  Used by Lx family but requested for MXF component compatibility.
01203   * @retval None
01204   */
01205 void MFX_IO_EnableWakeupPin(void)
01206 {
01207 }
01208
01209 #endif /* USE_IOEXPANDER */
01210
01211 /********************************* LINK AUDIO *********************************/
01212
01213 /**
01214   * @brief  Initializes Audio low level.
01215   * @retval None
01216   */
01217 void AUDIO_IO_Init(void)
01218 {
01219   I2Cx_Init();
01220 }
01221
01222 /**
01223   * @brief  Deinitializes Audio low level.
01224   * @retval None
01225   */
01226 void AUDIO_IO_DeInit(void)
01227 {
01228 }
01229
01230 /**
01231   * @brief  Writes a single data.
01232   * @param  Addr: I2C address
01233   * @param  Reg: Reg address
01234   * @param  Value: Data to be written
01235   * @retval None
01236   */
01237 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
01238 {
01239   uint16_t tmp = Value;
01240
01241   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
01242
01243   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
01244
01245   I2Cx_WriteMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
01246 }
01247
01248 /**
01249   * @brief  Reads a single data.
01250   * @param  Addr: I2C address
01251   * @param  Reg: Reg address
01252   * @retval Data to be read
01253   */
01254 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
01255 {
01256   uint16_t read_value = 0, tmp = 0;
01257
01258   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
01259
01260   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
01261
01262   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
01263
01264   read_value = tmp;
01265
01266   return read_value;
01267 }
01268
01269 /**
01270   * @brief  AUDIO Codec delay
01271   * @param  Delay: Delay in ms
01272   * @retval None
01273   */
01274 void AUDIO_IO_Delay(uint32_t Delay)
01275 {
01276   HAL_Delay(Delay);
01277 }
01278
01279 /********************************* LINK CAMERA ********************************/
01280
01281 /**
01282   * @brief  Initializes Camera low level.
01283   * @retval None
01284   */
01285 void CAMERA_IO_Init(void)
01286 {
01287   I2Cx_Init();
01288 }
01289
01290 /**
01291   * @brief  Camera writes single data.
01292   * @param  Addr: I2C address
01293   * @param  Reg: Register address
01294   * @param  Value: Data to be written
01295   * @retval None
01296   */
01297 void CAMERA_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
01298 {
01299   uint16_t tmp = Value;
01300   /* For S5K5CAG sensor, 16 bits accesses are used */
01301   Value = ((uint16_t)(tmp >> 8) & 0x00FF);
01302   Value |= ((uint16_t)(tmp << 8)& 0xFF00);
01303   I2Cx_WriteMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
01304 }
01305
01306 /**
01307   * @brief  Camera reads single data.
01308   * @param  Addr: I2C address
01309   * @param  Reg: Register address
01310   * @retval Read data
01311   */
01312 uint16_t CAMERA_IO_Read(uint8_t Addr, uint16_t Reg)
01313 {
01314   uint16_t read_value = 0, tmp = 0;
01315   /* For S5K5CAG sensor, 16 bits accesses are used */
01316   I2Cx_ReadMultiple(Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
01317   tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
01318   tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
01319   read_value = tmp;
01320   return read_value;
01321 }
01322
01323 /**
01324   * @brief  Camera delay
01325   * @param  Delay: Delay in ms
01326   * @retval None
01327   */
01328 void CAMERA_Delay(uint32_t Delay)
01329 {
01330   HAL_Delay(Delay);
01331 }
01332
01333 /******************************** LINK I2C EEPROM *****************************/
01334
01335 /**
01336   * @brief  Initializes peripherals used by the I2C EEPROM driver.
01337   * @retval None
01338   */
01339 void EEPROM_IO_Init(void)
01340 {
01341   I2Cx_Init();
01342 }
01343
01344 /**
01345   * @brief  Write data to I2C EEPROM driver in using DMA channel.
01346   * @param  DevAddress: Target device address
01347   * @param  MemAddress: Internal memory address
01348   * @param  pBuffer: Pointer to data buffer
01349   * @param  BufferSize: Amount of data to be sent
01350   * @retval HAL status
01351   */
01352 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
01353 {
01354   return (I2Cx_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
01355 }
01356
01357 /**
01358   * @brief  Read data from I2C EEPROM driver in using DMA channel.
01359   * @param  DevAddress: Target device address
01360   * @param  MemAddress: Internal memory address
01361   * @param  pBuffer: Pointer to data buffer
01362   * @param  BufferSize: Amount of data to be read
01363   * @retval HAL status
01364   */
01365 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
01366 {
01367   return (I2Cx_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
01368 }
01369
01370 /**
01371   * @brief  Checks if target device is ready for communication.
01372   * @note   This function is used with Memory devices
01373   * @param  DevAddress: Target device address
01374   * @param  Trials: Number of trials
01375   * @retval HAL status
01376   */
01377 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
01378 {
01379   return (I2Cx_IsDeviceReady(DevAddress, Trials));
01380 }
01381
01382 /**
01383   * @}
01384   */
01385
01386 /**
01387   * @}
01388   */
01389
01390 /**
01391   * @}
01392   */
01393
01394 /**
01395   * @}
01396   */
01397
01398 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains definitions for STM32756G_EVAL and STM32746G_EVAL LEDs,
00008   *          push-buttons and COM ports hardware resources.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_H
00041 #define __STM32756G_EVAL_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* USE_STM32756G_EVAL_REVA must USE USE_IOEXPANDER */
00048 #if defined(USE_STM32756G_EVAL_REVA)
00049 #ifndef USE_IOEXPANDER
00050 #define USE_IOEXPANDER
00051 #endif /* USE_IOEXPANDER */
00052 #endif /* USE_STM32756G_EVAL_REVA */
00053
00054 /* Includes ------------------------------------------------------------------*/
00055 #include "stm32f7xx_hal.h"
00056
00057 /** @addtogroup BSP
00058   * @{
00059   */
00060
00061 /** @addtogroup STM32756G_EVAL
00062   * @{
00063   */
00064
00065 /** @addtogroup STM32756G_EVAL_LOW_LEVEL
00066   * @{
00067   */
00068
00069 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Types LEVEL Exported Types
00070   * @{
00071   */
00072 typedef enum
00073 {
00074 #if defined(USE_IOEXPANDER)
00075 LED1 = 0,
00076 LED_GREEN = LED1,
00077 LED2 = 1,
00078 LED_ORANGE = LED2,
00079 LED3 = 2,
00080 LED_RED = LED3,
00081 LED4 = 3,
00082 LED_BLUE = LED4
00083 #else
00084 LED1 = 0,
00085 LED_GREEN = LED1,
00086 LED3 = 1,
00087 LED_RED = LED3,
00088 #endif /* USE_IOEXPANDER */
00089 }Led_TypeDef;
00090
00091 typedef enum
00092 {
00093   BUTTON_WAKEUP = 0,
00094   BUTTON_TAMPER = 1,
00095   BUTTON_KEY = 2
00096 }Button_TypeDef;
00097
00098 typedef enum
00099 {
00100   BUTTON_MODE_GPIO = 0,
00101   BUTTON_MODE_EXTI = 1
00102 }ButtonMode_TypeDef;
00103
00104 #if defined(USE_IOEXPANDER)
00105 typedef enum
00106 {
00107   JOY_MODE_GPIO = 0,
00108   JOY_MODE_EXTI = 1
00109 }JOYMode_TypeDef;
00110
00111 typedef enum
00112 {
00113   JOY_NONE  = 0,
00114   JOY_SEL   = 1,
00115   JOY_DOWN  = 2,
00116   JOY_LEFT  = 3,
00117   JOY_RIGHT = 4,
00118   JOY_UP    = 5
00119 }JOYState_TypeDef;
00120 #endif /* USE_IOEXPANDER */
00121
00122 typedef enum
00123 {
00124   COM1 = 0,
00125   COM2 = 1
00126 }COM_TypeDef;
00127 /**
00128   * @}
00129   */
00130
00131 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants
00132   * @{
00133   */
00134
00135 /**
00136   * @brief  Define for STM32756G_EVAL board
00137   */
00138 #if !defined (USE_STM32756G_EVAL)
00139  #define USE_STM32756G_EVAL
00140 #endif
00141
00142 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_LED
00143   * @{
00144   */
00145
00146 #if !defined(USE_STM32756G_EVAL_REVA)
00147
00148 #if defined(USE_IOEXPANDER)
00149 #define LEDn                             ((uint8_t)4)
00150 #define LED2_PIN                         IO_PIN_17
00151 #define LED4_PIN                         IO_PIN_19
00152 #else
00153 #define LEDn                             ((uint8_t)2)
00154 #endif /* USE_IOEXPANDER */
00155
00156 #define LED1_GPIO_PORT                   GPIOF
00157 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOF_CLK_ENABLE()
00158 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOF_CLK_DISABLE()
00159 #define LED1_PIN                         GPIO_PIN_10    /* To use LED1, ensure that JP24 is in position 2-3, potentiometer is then no more usable */
00160
00161 #define LED3_GPIO_PORT                   GPIOB
00162 #define LED3_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOB_CLK_ENABLE()
00163 #define LED3_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOB_CLK_DISABLE()
00164 #define LED3_PIN                         GPIO_PIN_7             /* To use LED3, ensure that JP23 is in position 2-3, camera is then no more usable */
00165
00166 #else
00167
00168 #define LEDn                             ((uint8_t)4)
00169 #define LED1_PIN                         IO_PIN_16
00170 #define LED2_PIN                         IO_PIN_17
00171 #define LED3_PIN                         IO_PIN_18
00172 #define LED4_PIN                         IO_PIN_19
00173
00174 #endif /* !USE_STM32756G_EVAL_REVA */
00175
00176 /**
00177   * @}
00178   */
00179
00180 /**
00181   * @brief MFX_IRQOUt pin
00182   */
00183 #define MFX_IRQOUT_PIN                    GPIO_PIN_8
00184 #define MFX_IRQOUT_GPIO_PORT              GPIOI
00185 #define MFX_IRQOUT_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOI_CLK_ENABLE()
00186 #define MFX_IRQOUT_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOI_CLK_DISABLE()
00187 #define MFX_IRQOUT_EXTI_IRQn              EXTI9_5_IRQn
00188
00189 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_BUTTON
00190   * @{
00191   */
00192 /* Joystick pins are connected to IO Expander (accessible through I2C1 interface) */
00193 #define BUTTONn                             ((uint8_t)3)
00194
00195 /**
00196   * @brief Wakeup push-button
00197   */
00198 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_13
00199 #define WAKEUP_BUTTON_GPIO_PORT             GPIOC
00200 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOC_CLK_ENABLE()
00201 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOC_CLK_DISABLE()
00202 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI15_10_IRQn
00203
00204 /**
00205   * @brief Tamper push-button
00206   */
00207 #define TAMPER_BUTTON_PIN                    GPIO_PIN_13
00208 #define TAMPER_BUTTON_GPIO_PORT              GPIOC
00209 #define TAMPER_BUTTON_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOC_CLK_ENABLE()
00210 #define TAMPER_BUTTON_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOC_CLK_DISABLE()
00211 #define TAMPER_BUTTON_EXTI_IRQn              EXTI15_10_IRQn
00212
00213 /**
00214   * @brief Key push-button
00215   */
00216 #define KEY_BUTTON_PIN                       GPIO_PIN_13
00217 #define KEY_BUTTON_GPIO_PORT                 GPIOC
00218 #define KEY_BUTTON_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00219 #define KEY_BUTTON_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00220 #define KEY_BUTTON_EXTI_IRQn                 EXTI15_10_IRQn
00221
00222 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\
00223                                                    if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\
00224                                                                                                                         KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0)
00225
00226 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__)    (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\
00227                                                 ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE())
00228 /**
00229   * @}
00230   */
00231
00232 /** @addtogroup STM32756G_EVAL_LOW_LEVEL_COM
00233   * @{
00234   */
00235 #define COMn                             ((uint8_t)1)
00236
00237 /**
00238  * @brief Definition for COM port1, connected to USART1
00239  */
00240 #define EVAL_COM1                          USART1
00241 #define EVAL_COM1_CLK_ENABLE()             __HAL_RCC_USART1_CLK_ENABLE()
00242 #define EVAL_COM1_CLK_DISABLE()            __HAL_RCC_USART1_CLK_DISABLE()
00243
00244 #define EVAL_COM1_TX_PIN                   GPIO_PIN_9
00245 #define EVAL_COM1_TX_GPIO_PORT             GPIOA
00246 #define EVAL_COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00247 #define EVAL_COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00248 #define EVAL_COM1_TX_AF                    GPIO_AF7_USART1
00249
00250 #define EVAL_COM1_RX_PIN                   GPIO_PIN_10
00251 #define EVAL_COM1_RX_GPIO_PORT             GPIOA
00252 #define EVAL_COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00253 #define EVAL_COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00254 #define EVAL_COM1_RX_AF                    GPIO_AF7_USART1
00255
00256 #define EVAL_COM1_IRQn                     USART1_IRQn
00257
00258 #define EVAL_COMx_CLK_ENABLE(__INDEX__)            do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0)
00259 #define EVAL_COMx_CLK_DISABLE(__INDEX__)           (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0)
00260
00261 #define EVAL_COMx_TX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
00262 #define EVAL_COMx_TX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0)
00263
00264 #define EVAL_COMx_RX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
00265 #define EVAL_COMx_RX_GPIO_CLK_DISABLE(__INDEX__)   (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0)
00266
00267 /**
00268  * @brief Definition for Potentiometer, connected to ADC3
00269  */
00270 #define ADCx                            ADC3
00271 #define ADCx_CLK_ENABLE()               __HAL_RCC_ADC3_CLK_ENABLE()
00272 #define ADCx_CHANNEL_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00273
00274 #define ADCx_FORCE_RESET()              __HAL_RCC_ADC_FORCE_RESET()
00275 #define ADCx_RELEASE_RESET()            __HAL_RCC_ADC_RELEASE_RESET()
00276
00277 /* Definition for ADCx Channel Pin */
00278 #define ADCx_CHANNEL_PIN                GPIO_PIN_10
00279 #define ADCx_CHANNEL_GPIO_PORT          GPIOF
00280
00281 /* Definition for ADCx's Channel */
00282 #define ADCx_CHANNEL                    ADC_CHANNEL_8
00283 #define SAMPLINGTIME                    ADC_SAMPLETIME_3CYCLES
00284 #define ADCx_POLL_TIMEOUT               10
00285
00286 /**
00287   * @brief Joystick Pins definition
00288   */
00289 #if defined(USE_IOEXPANDER)
00290 #define JOY_SEL_PIN                    IO_PIN_0
00291 #define JOY_DOWN_PIN                   IO_PIN_1
00292 #define JOY_LEFT_PIN                   IO_PIN_2
00293 #define JOY_RIGHT_PIN                  IO_PIN_3
00294 #define JOY_UP_PIN                     IO_PIN_4
00295 #define JOY_NONE_PIN                   JOY_ALL_PINS
00296 #define JOY_ALL_PINS                   (IO_PIN_0 | IO_PIN_1 | IO_PIN_2 | IO_PIN_3 | IO_PIN_4)
00297 #endif /* USE_IOEXPANDER */
00298 /**
00299   * @brief Eval Pins definition connected to MFX
00300   */
00301
00302 #if defined(USE_IOEXPANDER)
00303 #define XSDN_PIN                       IO_PIN_10
00304 #define MII_INT_PIN                    IO_PIN_13
00305 #define RSTI_PIN                       IO_PIN_11
00306 #define CAM_PLUG_PIN                   IO_PIN_12
00307 #define LCD_INT_PIN                    IO_PIN_14
00308 #define AUDIO_INT_PIN                  IO_PIN_5
00309 #define OTG_FS1_OVER_CURRENT_PIN       IO_PIN_6
00310 #define OTG_FS1_POWER_SWITCH_PIN       IO_PIN_7
00311 #define OTG_FS2_OVER_CURRENT_PIN       IO_PIN_8
00312 #define OTG_FS2_POWER_SWITCH_PIN       IO_PIN_9
00313 #define SD_DETECT_PIN                  IO_PIN_15
00314
00315 #endif /* USE_IOEXPANDER */
00316
00317
00318 /* Exported constant IO ------------------------------------------------------*/
00319
00320 /*  The MFX_I2C_ADDR input pin selects the MFX I2C device address
00321         MFX_I2C_ADDR input pin     MFX I2C device address
00322             0                           b: 1000 010x    (0x84)
00323             1                           b: 1000 011x    (0x86)
00324    This input is sampled during the MFX firmware startup.  */
00325 #define IO_I2C_ADDRESS                   ((uint16_t)0x84)  /*mfx MFX_I2C_ADDR 0*/
00326 #define IO_I2C_ADDRESS_2                 ((uint16_t)0x86)  /*mfx MFX_I2C_ADDR 1*/
00327 #define TS_I2C_ADDRESS                   ((uint16_t)0x82)  /*stmpe811 used on MB1046 board */
00328 #define TS3510_I2C_ADDRESS               ((uint16_t)0x80)
00329 #define EXC7200_I2C_ADDRESS              ((uint16_t)0x08)
00330 #define CAMERA_I2C_ADDRESS               ((uint16_t)0x5A)
00331 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x34)
00332 #define EEPROM_I2C_ADDRESS_A01           ((uint16_t)0xA0)
00333 #define EEPROM_I2C_ADDRESS_A02           ((uint16_t)0xA6)
00334 /* I2C clock speed configuration (in Hz)
00335    WARNING:
00336    Make sure that this define is not already declared in other files (ie.
00337    stm32756G_eval.h file). It can be used in parallel by other modules. */
00338 #ifndef I2C_SPEED
00339  #define I2C_SPEED                        ((uint32_t)100000)
00340 #endif /* I2C_SPEED */
00341
00342 /* User can use this section to tailor I2Cx/I2Cx instance used and associated
00343    resources */
00344 /* Definition for I2Cx clock resources */
00345 #define EVAL_I2Cx                             I2C1
00346 #define EVAL_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C1_CLK_ENABLE()
00347 #define EVAL_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00348 #define EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
00349
00350 #define EVAL_I2Cx_FORCE_RESET()               __HAL_RCC_I2C1_FORCE_RESET()
00351 #define EVAL_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C1_RELEASE_RESET()
00352
00353 /* Definition for I2Cx Pins */
00354 #define EVAL_I2Cx_SCL_PIN                     GPIO_PIN_8
00355 #define EVAL_I2Cx_SCL_SDA_GPIO_PORT           GPIOB
00356 #define EVAL_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C1
00357 #define EVAL_I2Cx_SDA_PIN                     GPIO_PIN_9
00358
00359 /* I2C interrupt requests */
00360 #define EVAL_I2Cx_EV_IRQn                     I2C1_EV_IRQn
00361 #define EVAL_I2Cx_ER_IRQn                     I2C1_ER_IRQn
00362
00363 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00364 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */
00365 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
00366 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */
00367 #ifndef EVAL_I2Cx_TIMING
00368 #define EVAL_I2Cx_TIMING                      ((uint32_t)0x40912732)
00369 #endif /* EVAL_I2Cx_TIMING */
00370
00371 /**
00372   * @}
00373   */
00374
00375 /**
00376   * @}
00377   */
00378
00379 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Macros LOW LEVEL Exported Macros
00380   * @{
00381   */
00382 /**
00383   * @}
00384   */
00385
00386 /** @defgroup STM32756G_EVAL_LOW_LEVEL_Exported_Functions LOW LEVEL Exported Functions
00387   * @{
00388   */
00389 uint32_t         BSP_GetVersion(void);
00390 void             BSP_LED_Init(Led_TypeDef Led);
00391 void             BSP_LED_DeInit(Led_TypeDef Led);
00392 void             BSP_LED_On(Led_TypeDef Led);
00393 void             BSP_LED_Off(Led_TypeDef Led);
00394 void             BSP_LED_Toggle(Led_TypeDef Led);
00395 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00396 void             BSP_PB_DeInit(Button_TypeDef Button);
00397 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00398 void             BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart);
00399 void             BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
00400 void             BSP_POTENTIOMETER_Init(void);
00401 uint32_t         BSP_POTENTIOMETER_GetLevel(void);
00402 #if defined(USE_IOEXPANDER)
00403 uint8_t          BSP_JOY_Init(JOYMode_TypeDef JoyMode);
00404 void             BSP_JOY_DeInit(void);
00405 JOYState_TypeDef BSP_JOY_GetState(void);
00406 uint8_t          BSP_TS3510_IsDetected(void);
00407 #endif /* USE_IOEXPANDER */
00408
00409 /**
00410   * @}
00411   */
00412
00413 /**
00414   * @}
00415   */
00416
00417 /**
00418   * @}
00419   */
00420
00421 /**
00422   * @}
00423   */
00424
00425 #ifdef __cplusplus
00426 }
00427 #endif
00428
00429 #endif /* __STM32756G_EVAL_H */
00430
00431 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file provides the Audio driver for the STM32756G-EVAL and
00008   *          STM32746G_EVAL evaluation board.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    + This driver supports STM32F7xx devices on STM32756G-EVAL (MB1167) Evaluation boards.
00013    + Call the function BSP_AUDIO_OUT_Init(
00014                                     OutputDevice: physical output mode (OUTPUT_DEVICE_SPEAKER,
00015                                                   OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH)
00016                                     Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
00017                                     AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
00018                                                   this parameter is relative to the audio file/stream type.
00019                                    )
00020       This function configures all the hardware required for the audio application (codec, I2C, SAI,
00021       GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
00022       If the returned value is different from AUDIO_OK or the function is stuck then the communication with
00023       the codec or the MFX has failed (try to un-plug the power or reset device in this case).
00024       - OUTPUT_DEVICE_SPEAKER  : only speaker will be set as output for the audio stream.
00025       - OUTPUT_DEVICE_HEADPHONE: only headphones will be set as output for the audio stream.
00026       - OUTPUT_DEVICE_BOTH     : both Speaker and Headphone are used as outputs for the audio stream
00027                                  at the same time.
00028       Note. On STM32756G-EVAL SAI_DMA is configured in CIRCULAR mode. Due to this the application
00029         does NOT need to call BSP_AUDIO_OUT_ChangeBuffer() to assure streaming.
00030    + Call the function BSP_EVAL_AUDIO_OUT_Play(
00031                                   pBuffer: pointer to the audio data file address
00032                                   Size   : size of the buffer to be sent in Bytes
00033                                  )
00034       to start playing (for the first time) from the audio file/stream.
00035    + Call the function BSP_AUDIO_OUT_Pause() to pause playing
00036    + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
00037        Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00038           for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00039        Note. This function should be called only when the audio file is played or paused (not stopped).
00040    + For each mode, you may need to implement the relative callback functions into your code.
00041       The Callback functions are named AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
00042       the stm32756g_eval_audio.h file. (refer to the example for more details on the callbacks implementations)
00043    + To Stop playing, to modify the volume level, the frequency, the audio frame slot,
00044       the device output mode the mute or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
00045       AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetOutputMode(),
00046       BSP_AUDIO_OUT_SetMute() and BSP_AUDIO_OUT_Stop().
00047    + The driver API and the callback functions are at the end of the stm32756g_eval_audio.h file.
00048
00049   Driver architecture:
00050   --------------------
00051    + This driver provides the High Audio Layer: consists of the function API exported in the stm32756g_eval_audio.h file
00052      (BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play() ...)
00053    + This driver provide also the Media Access Layer (MAL): which consists of functions allowing to access the media containing/
00054      providing the audio file/stream. These functions are also included as local functions into
00055      the stm32756g_eval_audio_codec.c file (I2Sx_Init(), I2Sx_DeInit(), SAIx_Init() and SAIx_DeInit())
00056
00057   Known Limitations:
00058   ------------------
00059    1- If the TDM Format used to play in parallel 2 audio Stream (the first Stream is configured in codec SLOT0 and second
00060       Stream in SLOT1) the Pause/Resume, volume and mute feature will control the both streams.
00061    2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
00062       File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
00063    3- Supports only Stereo audio streaming.
00064    4- Supports only 16-bits audio data size.
00065   @endverbatim
00066   ******************************************************************************
00067   * @attention
00068   *
00069   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00070   *
00071   * Redistribution and use in source and binary forms, with or without modification,
00072   * are permitted provided that the following conditions are met:
00073   *   1. Redistributions of source code must retain the above copyright notice,
00074   *      this list of conditions and the following disclaimer.
00075   *   2. Redistributions in binary form must reproduce the above copyright notice,
00076   *      this list of conditions and the following disclaimer in the documentation
00077   *      and/or other materials provided with the distribution.
00078   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00079   *      may be used to endorse or promote products derived from this software
00080   *      without specific prior written permission.
00081   *
00082   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00083   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00084   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00085   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00086   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00087   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00088   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00089   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00090   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00091   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00092   *
00093   ******************************************************************************
00094   */
00095 /* Includes ------------------------------------------------------------------*/
00096 #include "stm32756g_eval_audio.h"
00097
00098 /** @addtogroup BSP
00099   * @{
00100   */
00101
00102 /** @addtogroup STM32756G_EVAL
00103   * @{
00104   */
00105
00106 /** @defgroup STM32756G_EVAL_AUDIO STM32756G_EVAL AUDIO
00107   * @brief This file includes the low layer driver for wm8994 Audio Codec
00108   *        available on STM32756G-EVAL evaluation board(MB1167).
00109   * @{
00110   */
00111
00112 /** @defgroup STM32756G_EVAL_AUDIO_Private_Types STM32756G_EVAL_AUDIO Private Types
00113   * @{
00114   */
00115 /**
00116   * @}
00117   */
00118
00119 /** @defgroup STM32756G_EVAL_AUDIO_Private_Defines STM32756G_EVAL_AUDIO Private Defines
00120   * @{
00121   */
00122 /**
00123   * @}
00124   */
00125
00126 /** @defgroup STM32756G_EVAL_AUDIO_Private_Macros STM32756G_EVAL_AUDIO Private Macros
00127   * @{
00128   */
00129 /**
00130   * @}
00131   */
00132
00133 /** @defgroup STM32756G_EVAL_AUDIO_Private_Variables STM32756G_EVAL_AUDIO Private Variables
00134   * @{
00135   */
00136 AUDIO_DrvTypeDef          *audio_drv;
00137 SAI_HandleTypeDef         haudio_out_sai;
00138 I2S_HandleTypeDef         haudio_in_i2s;
00139 TIM_HandleTypeDef         haudio_tim;
00140
00141 PDMFilter_InitStruct Filter[2];
00142 uint8_t Channel_Demux[128] = {
00143     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00144     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00145     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00146     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00147     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00148     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00149     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00150     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00151     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00152     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00153     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00154     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00155     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00156     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00157     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00158     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f
00159 };
00160
00161 uint16_t __IO AudioInVolume = DEFAULT_AUDIO_IN_VOLUME;
00162
00163 /**
00164   * @}
00165   */
00166
00167 /** @defgroup STM32756G_EVAL_AUDIO_Private_Function_Prototypes STM32756G_EVAL_AUDIO Private Function Prototypes
00168   * @{
00169   */
00170 static void SAIx_Init(uint32_t AudioFreq);
00171 static void SAIx_DeInit(void);
00172 static void I2Sx_Init(uint32_t AudioFreq);
00173 static void I2Sx_DeInit(void);
00174 static void TIMx_IC_MspInit(TIM_HandleTypeDef *htim);
00175 static void TIMx_IC_MspDeInit(TIM_HandleTypeDef *htim);
00176 static void TIMx_Init(void);
00177 static void TIMx_DeInit(void);
00178 static void PDMDecoder_Init(uint32_t AudioFreq, uint32_t ChnlNbr);
00179 /**
00180   * @}
00181   */
00182
00183 /** @defgroup STM32756G_EVAL_AUDIO_out_Private_Functions STM32756G_EVAL_AUDIO_Out Private Functions
00184   * @{
00185   */
00186
00187 /**
00188   * @brief  Configures the audio peripherals.
00189   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00190   *                       or OUTPUT_DEVICE_BOTH.
00191   * @param  Volume: Initial volume level (from 0 (Mute) to 100 (Max))
00192   * @param  AudioFreq: Audio frequency used to play the audio stream.
00193   * @note   The I2S PLL input clock must be done in the user application.
00194   * @retval AUDIO_OK if correct communication, else wrong communication
00195   */
00196 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
00197 {
00198   uint8_t ret = AUDIO_ERROR;
00199   uint32_t deviceid = 0x00;
00200
00201   /* Disable SAI */
00202   SAIx_DeInit();
00203
00204   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00205   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00206
00207   /* SAI data transfer preparation:
00208   Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00209   haudio_out_sai.Instance = AUDIO_SAIx;
00210   if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00211   {
00212     /* Init the SAI MSP: this __weak function can be redefined by the application*/
00213     BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00214   }
00215   SAIx_Init(AudioFreq);
00216
00217   /* wm8994 codec initialization */
00218   deviceid = wm8994_drv.ReadID(AUDIO_I2C_ADDRESS);
00219
00220   if((deviceid) == WM8994_ID)
00221   {
00222     /* Reset the Codec Registers */
00223     wm8994_drv.Reset(AUDIO_I2C_ADDRESS);
00224     /* Initialize the audio driver structure */
00225     audio_drv = &wm8994_drv;
00226     ret = AUDIO_OK;
00227   }
00228   else
00229   {
00230     ret = AUDIO_ERROR;
00231   }
00232
00233   if(ret == AUDIO_OK)
00234   {
00235     /* Initialize the codec internal registers */
00236     audio_drv->Init(AUDIO_I2C_ADDRESS, OutputDevice, Volume, AudioFreq);
00237   }
00238
00239   return ret;
00240 }
00241
00242 /**
00243   * @brief  Starts playing audio stream from a data buffer for a determined size.
00244   * @param  pBuffer: Pointer to the buffer
00245   * @param  Size: Number of audio data BYTES.
00246   * @retval AUDIO_OK if correct communication, else wrong communication
00247   */
00248 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size)
00249 {
00250   /* Call the audio Codec Play function */
00251   if(audio_drv->Play(AUDIO_I2C_ADDRESS, pBuffer, Size) != 0)
00252   {
00253     return AUDIO_ERROR;
00254   }
00255   else
00256   {
00257     /* Update the Media layer and enable it for play */
00258     HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pBuffer, DMA_MAX(Size / AUDIODATA_SIZE));
00259
00260     return AUDIO_OK;
00261   }
00262 }
00263
00264 /**
00265   * @brief  Sends n-Bytes on the SAI interface.
00266   * @param  pData: pointer on data address
00267   * @param  Size: number of data to be written
00268   * @retval None
00269   */
00270 void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
00271 {
00272    HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pData, Size);
00273 }
00274
00275 /**
00276   * @brief  This function Pauses the audio file stream. In case
00277   *         of using DMA, the DMA Pause feature is used.
00278   * @note   When calling BSP_AUDIO_OUT_Pause() function for pause, only
00279   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00280   *          function for resume could lead to unexpected behaviour).
00281   * @retval AUDIO_OK if correct communication, else wrong communication
00282   */
00283 uint8_t BSP_AUDIO_OUT_Pause(void)
00284 {
00285   /* Call the Audio Codec Pause/Resume function */
00286   if(audio_drv->Pause(AUDIO_I2C_ADDRESS) != 0)
00287   {
00288     return AUDIO_ERROR;
00289   }
00290   else
00291   {
00292     /* Call the Media layer pause function */
00293     HAL_SAI_DMAPause(&haudio_out_sai);
00294
00295     /* Return AUDIO_OK when all operations are correctly done */
00296     return AUDIO_OK;
00297   }
00298 }
00299
00300 /**
00301   * @brief  This function  Resumes the audio file stream.
00302   * @note   When calling BSP_AUDIO_OUT_Pause() function for pause, only
00303   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00304   *          function for resume could lead to unexpected behaviour).
00305   * @retval AUDIO_OK if correct communication, else wrong communication
00306   */
00307 uint8_t BSP_AUDIO_OUT_Resume(void)
00308 {
00309   /* Call the Audio Codec Pause/Resume function */
00310   if(audio_drv->Resume(AUDIO_I2C_ADDRESS) != 0)
00311   {
00312     return AUDIO_ERROR;
00313   }
00314   else
00315   {
00316     /* Call the Media layer pause/resume function */
00317     HAL_SAI_DMAResume(&haudio_out_sai);
00318
00319     /* Return AUDIO_OK when all operations are correctly done */
00320     return AUDIO_OK;
00321   }
00322 }
00323
00324 /**
00325   * @brief  Stops audio playing and Power down the Audio Codec.
00326   * @param  Option: could be one of the following parameters
00327   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00328   *                            Then no need to reconfigure the Codec after power on.
00329   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00330   *                            Then need to reconfigure the Codec after power on.
00331   * @retval AUDIO_OK if correct communication, else wrong communication
00332   */
00333 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
00334 {
00335   /* Call the Media layer stop function */
00336   HAL_SAI_DMAStop(&haudio_out_sai);
00337
00338   /* Call Audio Codec Stop function */
00339   if(audio_drv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
00340   {
00341     return AUDIO_ERROR;
00342   }
00343   else
00344   {
00345     if(Option == CODEC_PDWN_HW)
00346     {
00347       /* Wait at least 100us */
00348       HAL_Delay(1);
00349     }
00350     /* Return AUDIO_OK when all operations are correctly done */
00351     return AUDIO_OK;
00352   }
00353 }
00354
00355 /**
00356   * @brief  Controls the current audio volume level.
00357   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00358   *         Mute and 100 for Max volume level).
00359   * @retval AUDIO_OK if correct communication, else wrong communication
00360   */
00361 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
00362 {
00363   /* Call the codec volume control function with converted volume value */
00364   if(audio_drv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
00365   {
00366     return AUDIO_ERROR;
00367   }
00368   else
00369   {
00370     /* Return AUDIO_OK when all operations are correctly done */
00371     return AUDIO_OK;
00372   }
00373 }
00374
00375 /**
00376   * @brief  Enables or disables the MUTE mode by software
00377   * @param  Cmd: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to
00378   *         unmute the codec and restore previous volume level.
00379   * @retval AUDIO_OK if correct communication, else wrong communication
00380   */
00381 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
00382 {
00383   /* Call the Codec Mute function */
00384   if(audio_drv->SetMute(AUDIO_I2C_ADDRESS, Cmd) != 0)
00385   {
00386     return AUDIO_ERROR;
00387   }
00388   else
00389   {
00390     /* Return AUDIO_OK when all operations are correctly done */
00391     return AUDIO_OK;
00392   }
00393 }
00394
00395 /**
00396   * @brief  Switch dynamically (while audio file is played) the output target
00397   *         (speaker or headphone).
00398   * @param  Output: The audio output target: OUTPUT_DEVICE_SPEAKER,
00399   *         OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
00400   * @retval AUDIO_OK if correct communication, else wrong communication
00401   */
00402 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output)
00403 {
00404   /* Call the Codec output device function */
00405   if(audio_drv->SetOutputMode(AUDIO_I2C_ADDRESS, Output) != 0)
00406   {
00407     return AUDIO_ERROR;
00408   }
00409   else
00410   {
00411     /* Return AUDIO_OK when all operations are correctly done */
00412     return AUDIO_OK;
00413   }
00414 }
00415
00416 /**
00417   * @brief  Updates the audio frequency.
00418   * @param  AudioFreq: Audio frequency used to play the audio stream.
00419   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00420   *         audio frequency.
00421   * @retval None
00422   */
00423 void BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq)
00424 {
00425   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00426   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00427
00428   /* Disable SAI peripheral to allow access to SAI internal registers */
00429   __HAL_SAI_DISABLE(&haudio_out_sai);
00430
00431   /* Update the SAI audio frequency configuration */
00432   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00433   HAL_SAI_Init(&haudio_out_sai);
00434
00435   /* Enable SAI peripheral to generate MCLK */
00436   __HAL_SAI_ENABLE(&haudio_out_sai);
00437 }
00438
00439 /**
00440   * @brief  Updates the Audio frame slot configuration.
00441   * @param  AudioFrameSlot: specifies the audio Frame slot
00442   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00443   *         audio frame slot.
00444   * @retval None
00445   */
00446 void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
00447 {
00448   /* Disable SAI peripheral to allow access to SAI internal registers */
00449   __HAL_SAI_DISABLE(&haudio_out_sai);
00450
00451   /* Update the SAI audio frame slot configuration */
00452   haudio_out_sai.SlotInit.SlotActive = AudioFrameSlot;
00453   HAL_SAI_Init(&haudio_out_sai);
00454
00455   /* Enable SAI peripheral to generate MCLK */
00456   __HAL_SAI_ENABLE(&haudio_out_sai);
00457 }
00458
00459 /**
00460   * @brief  Deinit the audio peripherals.
00461   * @retval None
00462   */
00463 void BSP_AUDIO_OUT_DeInit(void)
00464 {
00465   SAIx_DeInit();
00466   /* DeInit the SAI MSP : this __weak function can be rewritten by the application */
00467   BSP_AUDIO_OUT_MspDeInit(&haudio_out_sai, NULL);
00468 }
00469
00470 /**
00471   * @brief  Tx Transfer completed callbacks.
00472   * @param  hsai: SAI handle
00473   * @retval None
00474   */
00475 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
00476 {
00477   /* Manage the remaining file size and new address offset: This function
00478      should be coded by user (its prototype is already declared in stm32756g_eval_audio.h) */
00479   BSP_AUDIO_OUT_TransferComplete_CallBack();
00480 }
00481
00482 /**
00483   * @brief  Tx Half Transfer completed callbacks.
00484   * @param  hsai: SAI handle
00485   * @retval None
00486   */
00487 void HAL_SAI_TxHalfCpltCallback(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_HalfTransfer_CallBack();
00492 }
00493
00494 /**
00495   * @brief  SAI error callbacks.
00496   * @param  hsai: SAI handle
00497   * @retval None
00498   */
00499 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
00500 {
00501   BSP_AUDIO_OUT_Error_CallBack();
00502 }
00503
00504 /**
00505   * @brief  Manages the DMA full Transfer complete event.
00506   * @retval None
00507   */
00508 __weak void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
00509 {
00510 }
00511
00512 /**
00513   * @brief  Manages the DMA Half Transfer complete event.
00514   * @retval None
00515   */
00516 __weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
00517 {
00518 }
00519
00520 /**
00521   * @brief  Manages the DMA FIFO error event.
00522   * @retval None
00523   */
00524 __weak void BSP_AUDIO_OUT_Error_CallBack(void)
00525 {
00526 }
00527
00528 /**
00529   * @brief  Initializes BSP_AUDIO_OUT MSP.
00530   * @param  hsai: SAI handle
00531   * @param  Params
00532   * @retval None
00533   */
00534 __weak void BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params)
00535 {
00536   static DMA_HandleTypeDef hdma_sai_tx;
00537   GPIO_InitTypeDef  gpio_init_structure;
00538
00539   /* Enable SAI clock */
00540   AUDIO_SAIx_CLK_ENABLE();
00541
00542   /* Enable GPIO clock */
00543   AUDIO_SAIx_MCLK_ENABLE();
00544   AUDIO_SAIx_SCK_SD_ENABLE();
00545   AUDIO_SAIx_FS_ENABLE();
00546   /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
00547   gpio_init_structure.Pin = AUDIO_SAIx_FS_PIN;
00548   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00549   gpio_init_structure.Pull = GPIO_NOPULL;
00550   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00551   gpio_init_structure.Alternate = AUDIO_SAIx_FS_SD_MCLK_AF;
00552   HAL_GPIO_Init(AUDIO_SAIx_FS_GPIO_PORT, &gpio_init_structure);
00553
00554   gpio_init_structure.Pin = AUDIO_SAIx_SCK_PIN;
00555   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00556   gpio_init_structure.Pull = GPIO_NOPULL;
00557   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00558   gpio_init_structure.Alternate = AUDIO_SAIx_SCK_AF;
00559   HAL_GPIO_Init(AUDIO_SAIx_SCK_SD_GPIO_PORT, &gpio_init_structure);
00560
00561   gpio_init_structure.Pin =  AUDIO_SAIx_SD_PIN;
00562   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00563   gpio_init_structure.Pull = GPIO_NOPULL;
00564   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00565   gpio_init_structure.Alternate = AUDIO_SAIx_FS_SD_MCLK_AF;
00566   HAL_GPIO_Init(AUDIO_SAIx_SCK_SD_GPIO_PORT, &gpio_init_structure);
00567
00568   gpio_init_structure.Pin = AUDIO_SAIx_MCLK_PIN;
00569   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00570   gpio_init_structure.Pull = GPIO_NOPULL;
00571   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00572   gpio_init_structure.Alternate = AUDIO_SAIx_FS_SD_MCLK_AF;
00573   HAL_GPIO_Init(AUDIO_SAIx_MCLK_GPIO_PORT, &gpio_init_structure);
00574
00575   /* Enable the DMA clock */
00576   AUDIO_SAIx_DMAx_CLK_ENABLE();
00577
00578   if(hsai->Instance == AUDIO_SAIx)
00579   {
00580     /* Configure the hdma_saiTx handle parameters */
00581     hdma_sai_tx.Init.Channel             = AUDIO_SAIx_DMAx_CHANNEL;
00582     hdma_sai_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00583     hdma_sai_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
00584     hdma_sai_tx.Init.MemInc              = DMA_MINC_ENABLE;
00585     hdma_sai_tx.Init.PeriphDataAlignment = AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE;
00586     hdma_sai_tx.Init.MemDataAlignment    = AUDIO_SAIx_DMAx_MEM_DATA_SIZE;
00587     hdma_sai_tx.Init.Mode                = DMA_CIRCULAR;
00588     hdma_sai_tx.Init.Priority            = DMA_PRIORITY_HIGH;
00589     hdma_sai_tx.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00590     hdma_sai_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00591     hdma_sai_tx.Init.MemBurst            = DMA_MBURST_SINGLE;
00592     hdma_sai_tx.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00593
00594     hdma_sai_tx.Instance = AUDIO_SAIx_DMAx_STREAM;
00595
00596     /* Associate the DMA handle */
00597     __HAL_LINKDMA(hsai, hdmatx, hdma_sai_tx);
00598
00599     /* Deinitialize the Stream for new transfer */
00600     HAL_DMA_DeInit(&hdma_sai_tx);
00601
00602     /* Configure the DMA Stream */
00603     HAL_DMA_Init(&hdma_sai_tx);
00604   }
00605
00606   /* SAI DMA IRQ Channel configuration */
00607   HAL_NVIC_SetPriority(AUDIO_SAIx_DMAx_IRQ, AUDIO_OUT_IRQ_PREPRIO, 0);
00608   HAL_NVIC_EnableIRQ(AUDIO_SAIx_DMAx_IRQ);
00609 }
00610
00611 /**
00612   * @brief  Deinitializes SAI MSP.
00613   * @param  hsai: SAI handle
00614   * @param  Params
00615   * @retval None
00616   */
00617 __weak void BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
00618 {
00619     GPIO_InitTypeDef  gpio_init_structure;
00620
00621     /* SAI DMA IRQ Channel deactivation */
00622     HAL_NVIC_DisableIRQ(AUDIO_SAIx_DMAx_IRQ);
00623
00624     if(hsai->Instance == AUDIO_SAIx)
00625     {
00626       /* Deinitialize the DMA stream */
00627       HAL_DMA_DeInit(hsai->hdmatx);
00628     }
00629
00630     /* Disable SAI peripheral */
00631     __HAL_SAI_DISABLE(hsai);
00632
00633     /* Deactivates CODEC_SAI pins FS, SCK, MCK and SD by putting them in input mode */
00634     gpio_init_structure.Pin = AUDIO_SAIx_FS_PIN;
00635     HAL_GPIO_DeInit(AUDIO_SAIx_FS_GPIO_PORT, gpio_init_structure.Pin);
00636
00637     gpio_init_structure.Pin = AUDIO_SAIx_SCK_PIN;
00638     HAL_GPIO_DeInit(AUDIO_SAIx_SCK_SD_GPIO_PORT, gpio_init_structure.Pin);
00639
00640     gpio_init_structure.Pin =  AUDIO_SAIx_SD_PIN;
00641     HAL_GPIO_DeInit(AUDIO_SAIx_SCK_SD_GPIO_PORT, gpio_init_structure.Pin);
00642
00643     gpio_init_structure.Pin = AUDIO_SAIx_MCLK_PIN;
00644     HAL_GPIO_DeInit(AUDIO_SAIx_MCLK_GPIO_PORT, gpio_init_structure.Pin);
00645
00646     /* Disable SAI clock */
00647     AUDIO_SAIx_CLK_DISABLE();
00648
00649     /* GPIO pins clock and DMA clock can be shut down in the applic
00650        by surcharging this __weak function */
00651 }
00652
00653 /**
00654   * @brief  Clock Config.
00655   * @param  hsai: might be required to set audio peripheral predivider if any.
00656   * @param  AudioFreq: Audio frequency used to play the audio stream.
00657   * @param  Params
00658   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
00659   *         Being __weak it can be overwritten by the application
00660   * @retval None
00661   */
00662 __weak void BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
00663 {
00664   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00665
00666   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00667
00668   /* Set the PLL configuration according to the audio frequency */
00669   if((AudioFreq == AUDIO_FREQUENCY_11K) || (AudioFreq == AUDIO_FREQUENCY_22K) || (AudioFreq == AUDIO_FREQUENCY_44K))
00670   {
00671     /* Configure PLLSAI prescalers */
00672     /* PLLSAI_VCO: VCO_429M
00673     SAI_CLK(first level) = PLLSAI_VCO/PLLSAIQ = 429/2 = 214.5 Mhz
00674     SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ = 214.5/19 = 11.289 Mhz */
00675     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI2;
00676     rcc_ex_clk_init_struct.Sai2ClockSelection = RCC_SAI2CLKSOURCE_PLLSAI;
00677     rcc_ex_clk_init_struct.PLLSAI.PLLSAIN = 429;
00678     rcc_ex_clk_init_struct.PLLSAI.PLLSAIQ = 2;
00679     rcc_ex_clk_init_struct.PLLSAIDivQ = 19;
00680
00681     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00682
00683   }
00684   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_48K), AUDIO_FREQUENCY_96K */
00685   {
00686     /* SAI clock config
00687     PLLSAI_VCO: VCO_344M
00688     SAI_CLK(first level) = PLLSAI_VCO/PLLSAIQ = 344/7 = 49.142 Mhz
00689     SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ = 49.142/1 = 49.142 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 = 344;
00693     rcc_ex_clk_init_struct.PLLSAI.PLLSAIQ = 7;
00694     rcc_ex_clk_init_struct.PLLSAIDivQ = 1;
00695
00696     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00697   }
00698 }
00699
00700 /*******************************************************************************
00701                             Static Functions
00702 *******************************************************************************/
00703
00704 /**
00705   * @brief  Initializes the Audio Codec audio interface (SAI).
00706   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00707   * @note   The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123
00708   *         and user can update this configuration using
00709   * @retval None
00710   */
00711 static void SAIx_Init(uint32_t AudioFreq)
00712 {
00713   /* Initialize the haudio_out_sai Instance parameter */
00714   haudio_out_sai.Instance = AUDIO_SAIx;
00715
00716   /* Disable SAI peripheral to allow access to SAI internal registers */
00717   __HAL_SAI_DISABLE(&haudio_out_sai);
00718
00719   /* Configure SAI_Block_x
00720   LSBFirst: Disabled
00721   DataSize: 16 */
00722   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00723   haudio_out_sai.Init.AudioMode = SAI_MODEMASTER_TX;
00724   haudio_out_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLED;
00725   haudio_out_sai.Init.Protocol = SAI_FREE_PROTOCOL;
00726   haudio_out_sai.Init.DataSize = SAI_DATASIZE_16;
00727   haudio_out_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
00728   haudio_out_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE;
00729   haudio_out_sai.Init.Synchro = SAI_ASYNCHRONOUS;
00730   haudio_out_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLED;
00731   haudio_out_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
00732
00733   /* Configure SAI_Block_x Frame
00734   Frame Length: 64
00735   Frame active Length: 32
00736   FS Definition: Start frame + Channel Side identification
00737   FS Polarity: FS active Low
00738   FS Offset: FS asserted one bit before the first bit of slot 0 */
00739   haudio_out_sai.FrameInit.FrameLength = 64;
00740   haudio_out_sai.FrameInit.ActiveFrameLength = 32;
00741   haudio_out_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
00742   haudio_out_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
00743   haudio_out_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
00744
00745   /* Configure SAI Block_x Slot
00746   Slot First Bit Offset: 0
00747   Slot Size  : 16
00748   Slot Number: 4
00749   Slot Active: All slot actives */
00750   haudio_out_sai.SlotInit.FirstBitOffset = 0;
00751   haudio_out_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
00752   haudio_out_sai.SlotInit.SlotNumber = 4;
00753   haudio_out_sai.SlotInit.SlotActive = CODEC_AUDIOFRAME_SLOT_0123;
00754
00755   HAL_SAI_Init(&haudio_out_sai);
00756
00757   /* Enable SAI peripheral to generate MCLK */
00758   __HAL_SAI_ENABLE(&haudio_out_sai);
00759 }
00760
00761 /**
00762   * @brief  Deinitializes the Audio Codec audio interface (SAI).
00763   * @retval None
00764   */
00765 static void SAIx_DeInit(void)
00766 {
00767   /* Initialize the haudio_out_sai Instance parameter */
00768   haudio_out_sai.Instance = AUDIO_SAIx;
00769
00770   /* Disable SAI peripheral */
00771   __HAL_SAI_DISABLE(&haudio_out_sai);
00772
00773   HAL_SAI_DeInit(&haudio_out_sai);
00774 }
00775
00776 /**
00777   * @}
00778   */
00779
00780 /** @defgroup STM32756G_EVAL_AUDIO_out_Private_Functions STM32756G_EVAL_AUDIO_Out Private Functions
00781   * @{
00782   */
00783
00784 /**
00785   * @brief  Initializes wave recording.
00786   * @note   This function assumes that the I2S input clock (through PLL_R in
00787   *         Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y)
00788   *         is already configured and ready to be used.
00789   * @param  AudioFreq: Audio frequency to be configured for the I2S peripheral.
00790   * @param  BitRes: Audio frequency to be configured for the I2S peripheral.
00791   * @param  ChnlNbr: Audio frequency to be configured for the I2S peripheral.
00792   * @retval AUDIO_OK if correct communication, else wrong communication
00793   */
00794 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00795 {
00796   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00797
00798   /* Disable I2S */
00799   I2Sx_DeInit();
00800
00801   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00802   rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
00803   rcc_ex_clk_init_struct.I2sClockSelection = RCC_I2SCLKSOURCE_PLLI2S;
00804   rcc_ex_clk_init_struct.PLLI2S.PLLI2SN = 384;
00805   rcc_ex_clk_init_struct.PLLI2S.PLLI2SR = 2;
00806   HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00807
00808   /* Configure the PDM library */
00809   PDMDecoder_Init(AudioFreq, ChnlNbr);
00810
00811   /* Configure the I2S peripheral */
00812   haudio_in_i2s.Instance = AUDIO_I2Sx;
00813   if(HAL_I2S_GetState(&haudio_in_i2s) == HAL_I2S_STATE_RESET)
00814   {
00815     /* Initialize the I2S Msp: this __weak function can be rewritten by the application */
00816     BSP_AUDIO_IN_MspInit(&haudio_in_i2s, NULL);
00817   }
00818   I2Sx_Init(AudioFreq);
00819
00820   /* Return AUDIO_OK when all operations are correctly done */
00821   return AUDIO_OK;
00822 }
00823
00824 /**
00825   * @brief  Starts audio recording.
00826   * @param  pbuf: Main buffer pointer for the recorded data storing
00827   * @param  size: Current size of the recorded buffer
00828   * @retval AUDIO_OK if correct communication, else wrong communication
00829   */
00830 uint8_t BSP_AUDIO_IN_Record(uint16_t* pbuf, uint32_t size)
00831 {
00832   uint32_t ret = AUDIO_ERROR;
00833
00834   /* Start the process receive DMA */
00835   HAL_I2S_Receive_DMA(&haudio_in_i2s, pbuf, size);
00836
00837   /* Return AUDIO_OK when all operations are correctly done */
00838   ret = AUDIO_OK;
00839
00840   return ret;
00841 }
00842
00843 /**
00844   * @brief  Stops audio recording.
00845   * @retval AUDIO_OK if correct communication, else wrong communication
00846   */
00847 uint8_t BSP_AUDIO_IN_Stop(void)
00848 {
00849   uint32_t ret = AUDIO_ERROR;
00850   /* Call the Media layer stop function */
00851   HAL_I2S_DMAStop(&haudio_in_i2s);
00852
00853   /* TIMx Peripheral clock disable */
00854   AUDIO_TIMx_CLK_DISABLE();
00855
00856   /* Return AUDIO_OK when all operations are correctly done */
00857   ret = AUDIO_OK;
00858
00859   return ret;
00860 }
00861
00862 /**
00863   * @brief  Pauses the audio file stream.
00864   * @retval AUDIO_OK if correct communication, else wrong communication
00865   */
00866 uint8_t BSP_AUDIO_IN_Pause(void)
00867 {
00868   /* Call the Media layer pause function */
00869   HAL_I2S_DMAPause(&haudio_in_i2s);
00870   /* Return AUDIO_OK when all operations are correctly done */
00871   return AUDIO_OK;
00872 }
00873
00874 /**
00875   * @brief  Resumes the audio file stream.
00876   * @retval AUDIO_OK if correct communication, else wrong communication
00877   */
00878 uint8_t BSP_AUDIO_IN_Resume(void)
00879 {
00880   /* Call the Media layer pause/resume function */
00881   HAL_I2S_DMAResume(&haudio_in_i2s);
00882   /* Return AUDIO_OK when all operations are correctly done */
00883   return AUDIO_OK;
00884 }
00885
00886 /**
00887   * @brief  Controls the audio in volume level.
00888   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00889   *         Mute and 100 for Max volume level).
00890   * @retval AUDIO_OK if correct communication, else wrong communication
00891   */
00892 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume)
00893 {
00894   /* Set the Global variable AudioInVolume  */
00895   AudioInVolume = Volume;
00896
00897   /* Return AUDIO_OK when all operations are correctly done */
00898   return AUDIO_OK;
00899 }
00900
00901 /**
00902   * @brief  Deinit the audio IN peripherals.
00903   * @retval None
00904   */
00905 void BSP_AUDIO_IN_DeInit(void)
00906 {
00907   I2Sx_DeInit();
00908   /* DeInit the I2S MSP : this __weak function can be rewritten by the application */
00909   BSP_AUDIO_IN_MspDeInit(&haudio_in_i2s, NULL);
00910   TIMx_DeInit();
00911 }
00912
00913 /**
00914   * @brief  Converts audio format from PDM to PCM.
00915   * @param  PDMBuf: Pointer to data PDM buffer
00916   * @param  PCMBuf: Pointer to data PCM buffer
00917   * @retval AUDIO_OK if correct communication, else wrong communication
00918   */
00919 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf)
00920 {
00921   uint8_t app_pdm[INTERNAL_BUFF_SIZE*2];
00922   uint8_t byte1 = 0, byte2 = 0;
00923   uint32_t index = 0;
00924
00925   /* PDM Demux */
00926   for(index = 0; index<INTERNAL_BUFF_SIZE/2; index++)
00927   {
00928     byte2 = (PDMBuf[index] >> 8)& 0xFF;
00929     byte1 = (PDMBuf[index] & 0xFF);
00930     app_pdm[(index*2)+1] = Channel_Demux[byte1 & CHANNEL_DEMUX_MASK] | Channel_Demux[byte2 & CHANNEL_DEMUX_MASK] << 4;
00931     app_pdm[(index*2)] = Channel_Demux[(byte1 >> 1) & CHANNEL_DEMUX_MASK] | Channel_Demux[(byte2 >> 1) & CHANNEL_DEMUX_MASK] << 4;
00932   }
00933
00934   for(index = 0; index < DEFAULT_AUDIO_IN_CHANNEL_NBR; index++)
00935   {
00936     /* PDM to PCM filter */
00937     PDM_Filter_64_LSB((uint8_t*)&app_pdm[index], (uint16_t*)&(PCMBuf[index]), AudioInVolume , (PDMFilter_InitStruct *)&Filter[index]);
00938   }
00939
00940   /* Return AUDIO_OK when all operations are correctly done */
00941   return AUDIO_OK;
00942 }
00943
00944  /**
00945   * @brief  Rx Transfer completed callbacks.
00946   * @param  hi2s: I2S handle
00947   * @retval None
00948   */
00949 void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s)
00950 {
00951   /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
00952   BSP_AUDIO_IN_TransferComplete_CallBack();
00953 }
00954
00955 /**
00956   * @brief  Rx Half Transfer completed callbacks.
00957   * @param  hi2s: I2S handle
00958   * @retval None
00959   */
00960 void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
00961 {
00962   /* Manage the remaining file size and new address offset: This function
00963      should be coded by user (its prototype is already declared in stm32756g_eval_audio.h) */
00964   BSP_AUDIO_IN_HalfTransfer_CallBack();
00965 }
00966
00967 /**
00968   * @brief  I2S error callbacks.
00969   * @param  hi2s: I2S handle
00970   * @retval None
00971   */
00972 void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s)
00973 {
00974   /* Manage the error generated on DMA FIFO: This function
00975      should be coded by user (its prototype is already declared in stm32756g_eval_audio.h) */
00976   BSP_AUDIO_IN_Error_Callback();
00977 }
00978
00979 /**
00980   * @brief  User callback when record buffer is filled.
00981   * @retval None
00982   */
00983 __weak void BSP_AUDIO_IN_TransferComplete_CallBack(void)
00984 {
00985   /* This function should be implemented by the user application.
00986      It is called into this driver when the current buffer is filled
00987      to prepare the next buffer pointer and its size. */
00988 }
00989
00990 /**
00991   * @brief  Manages the DMA Half Transfer complete event.
00992   * @retval None
00993   */
00994 __weak void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
00995 {
00996   /* This function should be implemented by the user application.
00997      It is called into this driver when the current buffer is filled
00998      to prepare the next buffer pointer and its size. */
00999 }
01000
01001 /**
01002   * @brief  Audio IN Error callback function.
01003   * @retval None
01004   */
01005 __weak void BSP_AUDIO_IN_Error_Callback(void)
01006 {
01007   /* This function is called when an Interrupt due to transfer error on or peripheral
01008      error occurs. */
01009 }
01010
01011 /**
01012   * @brief  Initializes BSP_AUDIO_IN MSP.
01013   * @param  hi2s: I2S handle
01014   * @param  Params
01015   * @retval None
01016   */
01017 __weak void BSP_AUDIO_IN_MspInit(I2S_HandleTypeDef *hi2s, void *Params)
01018 {
01019   static DMA_HandleTypeDef hdma_i2s_rx;
01020   GPIO_InitTypeDef  gpio_init_structure;
01021
01022   /* Configure the Timer which clocks the MEMS */
01023   /* Moved inside MSP to allow applic to redefine the TIMx_MspInit */
01024   TIMx_Init();
01025
01026   /* Enable I2S clock */
01027   AUDIO_I2Sx_CLK_ENABLE();
01028
01029   /* Enable SCK and SD GPIO clock */
01030   AUDIO_I2Sx_SD_GPIO_CLK_ENABLE();
01031   AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE();
01032   /* CODEC_I2S pins configuration: SCK and SD pins */
01033   gpio_init_structure.Pin = AUDIO_I2Sx_SCK_PIN;
01034   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01035   gpio_init_structure.Pull = GPIO_NOPULL;
01036   gpio_init_structure.Speed = GPIO_SPEED_FAST;
01037   gpio_init_structure.Alternate = AUDIO_I2Sx_SCK_AF;
01038   HAL_GPIO_Init(AUDIO_I2Sx_SCK_GPIO_PORT, &gpio_init_structure);
01039
01040   gpio_init_structure.Pin = AUDIO_I2Sx_SD_PIN;
01041   gpio_init_structure.Alternate = AUDIO_I2Sx_SD_AF;
01042   HAL_GPIO_Init(AUDIO_I2Sx_SD_GPIO_PORT, &gpio_init_structure);
01043
01044   /* Enable the DMA clock */
01045   AUDIO_I2Sx_DMAx_CLK_ENABLE();
01046
01047   if(hi2s->Instance == AUDIO_I2Sx)
01048   {
01049     /* Configure the hdma_i2s_rx handle parameters */
01050     hdma_i2s_rx.Init.Channel             = AUDIO_I2Sx_DMAx_CHANNEL;
01051     hdma_i2s_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01052     hdma_i2s_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01053     hdma_i2s_rx.Init.MemInc              = DMA_MINC_ENABLE;
01054     hdma_i2s_rx.Init.PeriphDataAlignment = AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE;
01055     hdma_i2s_rx.Init.MemDataAlignment    = AUDIO_I2Sx_DMAx_MEM_DATA_SIZE;
01056     hdma_i2s_rx.Init.Mode                = DMA_CIRCULAR;
01057     hdma_i2s_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01058     hdma_i2s_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01059     hdma_i2s_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01060     hdma_i2s_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01061     hdma_i2s_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01062
01063     hdma_i2s_rx.Instance = AUDIO_I2Sx_DMAx_STREAM;
01064
01065     /* Associate the DMA handle */
01066     __HAL_LINKDMA(hi2s, hdmarx, hdma_i2s_rx);
01067
01068     /* Deinitialize the Stream for new transfer */
01069     HAL_DMA_DeInit(&hdma_i2s_rx);
01070
01071     /* Configure the DMA Stream */
01072     HAL_DMA_Init(&hdma_i2s_rx);
01073   }
01074
01075   /* I2S DMA IRQ Channel configuration */
01076   HAL_NVIC_SetPriority(AUDIO_I2Sx_DMAx_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01077   HAL_NVIC_EnableIRQ(AUDIO_I2Sx_DMAx_IRQ);
01078 }
01079
01080 /**
01081   * @brief  DeInitializes BSP_AUDIO_IN MSP.
01082   * @param  hi2s: I2S handle
01083   * @param  Params
01084   * @retval None
01085   */
01086 __weak void BSP_AUDIO_IN_MspDeInit(I2S_HandleTypeDef *hi2s, void *Params)
01087 {
01088   GPIO_InitTypeDef  gpio_init_structure;
01089
01090   static DMA_HandleTypeDef hdma_i2s_rx;
01091
01092   /* I2S DMA IRQ Channel deactivation */
01093   HAL_NVIC_DisableIRQ(AUDIO_I2Sx_DMAx_IRQ);
01094
01095   if(hi2s->Instance == AUDIO_I2Sx)
01096   {
01097     /* Deinitialize the Stream for new transfer */
01098     HAL_DMA_DeInit(&hdma_i2s_rx);
01099   }
01100
01101  /* Disable I2S block */
01102   __HAL_I2S_DISABLE(hi2s);
01103
01104   /* Disable pins: SCK and SD pins */
01105   gpio_init_structure.Pin = AUDIO_I2Sx_SCK_PIN;
01106   HAL_GPIO_DeInit(AUDIO_I2Sx_SCK_GPIO_PORT, gpio_init_structure.Pin);
01107   gpio_init_structure.Pin = AUDIO_I2Sx_SD_PIN;
01108   HAL_GPIO_DeInit(AUDIO_I2Sx_SD_GPIO_PORT, gpio_init_structure.Pin);
01109
01110   /* Disable I2S clock */
01111   AUDIO_I2Sx_CLK_DISABLE();
01112
01113   /* GPIO pins clock and DMA clock can be shut down in the application
01114      by surcharging this __weak function */
01115 }
01116
01117
01118 /*******************************************************************************
01119                             Static Functions
01120 *******************************************************************************/
01121
01122 /**
01123   * @brief  Initializes the PDM library.
01124   * @param  AudioFreq: Audio sampling frequency
01125   * @param  ChnlNbr: Number of audio channels (1: mono; 2: stereo)
01126   * @retval None
01127   */
01128 static void PDMDecoder_Init(uint32_t AudioFreq, uint32_t ChnlNbr)
01129 {
01130   uint32_t i = 0;
01131
01132   /* Enable CRC peripheral to unlock the PDM library */
01133   __HAL_RCC_CRC_CLK_ENABLE();
01134
01135   for(i = 0; i < ChnlNbr; i++)
01136   {
01137     /* Filter LP & HP Init */
01138     Filter[i].LP_HZ = AudioFreq/2;
01139     Filter[i].HP_HZ = 10;
01140     Filter[i].Fs = AudioFreq;
01141     Filter[i].Out_MicChannels = ChnlNbr;
01142     Filter[i].In_MicChannels = ChnlNbr;
01143     PDM_Filter_Init((PDMFilter_InitStruct *)&Filter[i]);
01144   }
01145 }
01146
01147 /**
01148   * @brief  Initializes the Audio Codec audio interface (I2S)
01149   * @note   This function assumes that the I2S input clock (through PLL_R in
01150   *         Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y)
01151   *         is already configured and ready to be used.
01152   * @param  AudioFreq: Audio frequency to be configured for the I2S peripheral.
01153   * @retval None
01154   */
01155 static void I2Sx_Init(uint32_t AudioFreq)
01156 {
01157   /* Initialize the haudio_in_i2s Instance parameter */
01158   haudio_in_i2s.Instance = AUDIO_I2Sx;
01159
01160  /* Disable I2S block */
01161   __HAL_I2S_DISABLE(&haudio_in_i2s);
01162
01163   /* I2S2 peripheral configuration */
01164   haudio_in_i2s.Init.AudioFreq = 4 * AudioFreq;
01165   haudio_in_i2s.Init.ClockSource = I2S_CLOCK_SYSCLK;
01166   haudio_in_i2s.Init.CPOL = I2S_CPOL_HIGH;
01167   haudio_in_i2s.Init.DataFormat = I2S_DATAFORMAT_16B;
01168   haudio_in_i2s.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
01169   haudio_in_i2s.Init.Mode = I2S_MODE_MASTER_RX;
01170   haudio_in_i2s.Init.Standard = I2S_STANDARD_LSB;
01171
01172   /* Init the I2S */
01173   HAL_I2S_Init(&haudio_in_i2s);
01174
01175   /* Enable I2S peripheral */
01176   __HAL_I2S_ENABLE(&haudio_in_i2s);
01177 }
01178
01179 /**
01180   * @brief  Deinitializes the Audio Codec audio interface (I2S).
01181   * @retval None
01182   */
01183 static void I2Sx_DeInit(void)
01184 {
01185   /* Initialize the haudio_in_i2s Instance parameter */
01186   haudio_in_i2s.Instance = AUDIO_I2Sx;
01187
01188  /* Disable I2S block */
01189   __HAL_I2S_DISABLE(&haudio_in_i2s);
01190
01191   /* DeInit the I2S */
01192   HAL_I2S_DeInit(&haudio_in_i2s);
01193 }
01194
01195
01196 /**
01197   * @brief  Initializes the TIM INput Capture MSP.
01198   * @param  htim: TIM handle
01199   * @retval None
01200   */
01201 static void TIMx_IC_MspInit(TIM_HandleTypeDef *htim)
01202 {
01203   GPIO_InitTypeDef   gpio_init_structure;
01204
01205   /* Enable peripherals and GPIO Clocks --------------------------------------*/
01206   /* TIMx Peripheral clock enable */
01207   AUDIO_TIMx_CLK_ENABLE();
01208
01209   /* Enable GPIO Channels Clock */
01210   AUDIO_TIMx_GPIO_CLK_ENABLE();
01211
01212   /* Configure I/Os ----------------------------------------------------------*/
01213   /* Common configuration for all channels */
01214   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01215   gpio_init_structure.Pull = GPIO_NOPULL;
01216   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
01217   gpio_init_structure.Alternate = AUDIO_TIMx_AF;
01218
01219   /* Configure TIM input channel */
01220   gpio_init_structure.Pin = AUDIO_TIMx_IN_GPIO_PIN;
01221   HAL_GPIO_Init(AUDIO_TIMx_GPIO_PORT, &gpio_init_structure);
01222
01223   /* Configure TIM output channel */
01224   gpio_init_structure.Pin = AUDIO_TIMx_OUT_GPIO_PIN;
01225   HAL_GPIO_Init(AUDIO_TIMx_GPIO_PORT, &gpio_init_structure);
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_MspDeInit(TIM_HandleTypeDef *htim)
01235 {
01236     /* Disable TIMx Peripheral clock  */
01237     AUDIO_TIMx_CLK_DISABLE();
01238
01239     /* GPIO pins clock and DMA clock can be shut down in the application
01240        by surcharging this __weak function */
01241 }
01242
01243 /**
01244   * @brief  Configure TIM as a clock divider by 2.
01245   *         I2S_SCK is externally connected to TIMx input channel
01246   * @retval None
01247   */
01248 static void TIMx_Init(void)
01249 {
01250   TIM_IC_InitTypeDef     s_ic_config;
01251   TIM_OC_InitTypeDef     s_oc_config;
01252   TIM_ClockConfigTypeDef s_clk_source_config;
01253   TIM_SlaveConfigTypeDef s_slave_config;
01254
01255   /* Configure the TIM peripheral --------------------------------------------*/
01256   /* Set TIMx instance */
01257   haudio_tim.Instance = AUDIO_TIMx;
01258   /* Timer Input Capture Configuration Structure declaration */
01259    /* Initialize TIMx peripheral as follow:
01260        + Period = 0xFFFF
01261        + Prescaler = 0
01262        + ClockDivision = 0
01263        + Counter direction = Up
01264   */
01265   haudio_tim.Init.Period        = 1;
01266   haudio_tim.Init.Prescaler     = 0;
01267   haudio_tim.Init.ClockDivision = 0;
01268   haudio_tim.Init.CounterMode   = TIM_COUNTERMODE_UP;
01269
01270   /* Initialize the TIMx peripheral with the structure above */
01271   TIMx_IC_MspInit(&haudio_tim);
01272   HAL_TIM_IC_Init(&haudio_tim);
01273
01274   /* Configure the Input Capture channel -------------------------------------*/
01275   /* Configure the Input Capture of channel 2 */
01276   s_ic_config.ICPolarity  = TIM_ICPOLARITY_FALLING;
01277   s_ic_config.ICSelection = TIM_ICSELECTION_DIRECTTI;
01278   s_ic_config.ICPrescaler = TIM_ICPSC_DIV1;
01279   s_ic_config.ICFilter    = 0;
01280   HAL_TIM_IC_ConfigChannel(&haudio_tim, &s_ic_config, AUDIO_TIMx_IN_CHANNEL);
01281
01282   /* Select external clock mode 1 */
01283   s_clk_source_config.ClockSource = TIM_CLOCKSOURCE_ETRMODE1;
01284   s_clk_source_config.ClockPolarity = TIM_CLOCKPOLARITY_NONINVERTED;
01285   s_clk_source_config.ClockPrescaler = TIM_CLOCKPRESCALER_DIV1;
01286   s_clk_source_config.ClockFilter = 0;
01287   HAL_TIM_ConfigClockSource(&haudio_tim, &s_clk_source_config);
01288
01289   /* Select Input Channel as input trigger */
01290   s_slave_config.InputTrigger = TIM_TS_TI1FP1;
01291   s_slave_config.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
01292   s_slave_config.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
01293   s_slave_config.TriggerPrescaler = TIM_CLOCKPRESCALER_DIV1;
01294   s_slave_config.TriggerFilter = 0;
01295   HAL_TIM_SlaveConfigSynchronization(&haudio_tim, &s_slave_config);
01296
01297   /* Output Compare PWM Mode configuration: Channel2 */
01298   s_oc_config.OCMode = TIM_OCMODE_PWM1;
01299   s_oc_config.OCIdleState = TIM_OCIDLESTATE_SET;
01300   s_oc_config.Pulse = 1;
01301   s_oc_config.OCPolarity = TIM_OCPOLARITY_HIGH;
01302   s_oc_config.OCNPolarity = TIM_OCNPOLARITY_HIGH;
01303   s_oc_config.OCFastMode = TIM_OCFAST_DISABLE;
01304   s_oc_config.OCNIdleState = TIM_OCNIDLESTATE_SET;
01305
01306   /* Initialize the TIM3 Channel2 with the structure above */
01307   HAL_TIM_PWM_ConfigChannel(&haudio_tim, &s_oc_config, AUDIO_TIMx_OUT_CHANNEL);
01308
01309   /* Start the TIM3 Channel2 */
01310   HAL_TIM_PWM_Start(&haudio_tim, AUDIO_TIMx_OUT_CHANNEL);
01311
01312   /* Start the TIM3 Channel1 */
01313   HAL_TIM_IC_Start(&haudio_tim, AUDIO_TIMx_IN_CHANNEL);
01314 }
01315
01316 /**
01317   * @brief  Configure TIM as a clock divider by 2.
01318   *         I2S_SCK is externally connected to TIMx input channel
01319   * @retval None
01320   */
01321 static void TIMx_DeInit(void)
01322 {
01323   haudio_tim.Instance = AUDIO_TIMx;
01324
01325   /* Stop the TIM4 Channel2 */
01326   HAL_TIM_PWM_Stop(&haudio_tim, AUDIO_TIMx_OUT_CHANNEL);
01327   /* Stop the TIM4 Channel1 */
01328   HAL_TIM_IC_Stop(&haudio_tim, AUDIO_TIMx_IN_CHANNEL);
01329
01330   HAL_TIM_IC_DeInit(&haudio_tim);
01331
01332   /* Initialize the TIMx peripheral with the structure above */
01333   TIMx_IC_MspDeInit(&haudio_tim);
01334 }
01335
01336 /**
01337   * @}
01338   */
01339
01340 /**
01341   * @}
01342   */
01343
01344 /**
01345   * @}
01346   */
01347
01348 /**
01349   * @}
01350   */
01351
01352 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_audio.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_AUDIO_H
00041 #define __STM32756G_EVAL_AUDIO_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 /* Include audio component Driver */
00049 #include "../Components/wm8994/wm8994.h"
00050 #include "stm32756g_eval.h"
00051 #include "../../../Middlewares/ST/STM32_Audio/Addons/PDM/pdm_filter.h"
00052
00053 /** @addtogroup BSP
00054   * @{
00055   */
00056
00057 /** @addtogroup STM32756G_EVAL
00058   * @{
00059   */
00060
00061 /** @addtogroup STM32756G_EVAL_AUDIO STM32756G_EVAL AUDIO
00062   * @{
00063   */
00064
00065 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Types STM32756G_EVAL_AUDIO Exported Types
00066   * @{
00067   */
00068 /**
00069   * @}
00070   */
00071
00072 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Constants STM32756G_EVAL_AUDIO Exported Constants
00073   * @{
00074   */
00075
00076 /*------------------------------------------------------------------------------
00077                           USER SAI defines parameters
00078  -----------------------------------------------------------------------------*/
00079 /** CODEC_AudioFrame_SLOT_TDMMode In W8994 codec the Audio frame contains 4 slots : TDM Mode
00080   * TDM format :
00081   * +------------------|------------------|--------------------|-------------------+
00082   * | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right  | CODEC_SLOT1 Right |
00083   * +------------------------------------------------------------------------------+
00084   */
00085 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */
00086 #define CODEC_AUDIOFRAME_SLOT_0123                   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
00087 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */
00088 #define CODEC_AUDIOFRAME_SLOT_02                     SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
00089 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */
00090 #define CODEC_AUDIOFRAME_SLOT_13                     SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
00091
00092 /* SAI peripheral configuration defines */
00093 #define AUDIO_SAIx                           SAI2_Block_B
00094 #define AUDIO_SAIx_CLK_ENABLE()              __HAL_RCC_SAI2_CLK_ENABLE()
00095 #define AUDIO_SAIx_CLK_DISABLE()             __HAL_RCC_SAI2_CLK_DISABLE()
00096 #define AUDIO_SAIx_SCK_AF                    GPIO_AF8_SAI2
00097 #define AUDIO_SAIx_FS_SD_MCLK_AF             GPIO_AF10_SAI2
00098
00099 #define AUDIO_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOE_CLK_ENABLE()
00100 #define AUDIO_SAIx_MCLK_GPIO_PORT            GPIOE
00101 #define AUDIO_SAIx_MCLK_PIN                  GPIO_PIN_6
00102 #define AUDIO_SAIx_SCK_SD_ENABLE()           __HAL_RCC_GPIOA_CLK_ENABLE()
00103 #define AUDIO_SAIx_SCK_SD_GPIO_PORT          GPIOA
00104 #define AUDIO_SAIx_SCK_PIN                   GPIO_PIN_2
00105 #define AUDIO_SAIx_SD_PIN                    GPIO_PIN_0
00106 #define AUDIO_SAIx_FS_ENABLE()               __HAL_RCC_GPIOG_CLK_ENABLE()
00107 #define AUDIO_SAIx_FS_GPIO_PORT              GPIOG
00108 #define AUDIO_SAIx_FS_PIN                    GPIO_PIN_9
00109
00110
00111 /* SAI DMA Stream definitions */
00112 #define AUDIO_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00113 #define AUDIO_SAIx_DMAx_STREAM               DMA2_Stream6
00114 #define AUDIO_SAIx_DMAx_CHANNEL              DMA_CHANNEL_3
00115 #define AUDIO_SAIx_DMAx_IRQ                  DMA2_Stream6_IRQn
00116 #define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00117 #define AUDIO_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00118 #define DMA_MAX_SZE                          0xFFFF
00119
00120 #define AUDIO_SAIx_DMAx_IRQHandler           DMA2_Stream6_IRQHandler
00121
00122 /* Select the interrupt preemption priority for the DMA interrupt */
00123 #define AUDIO_OUT_IRQ_PREPRIO                ((uint32_t)0x0E)   /* Select the preemption priority level(0 is the highest) */
00124
00125 /*------------------------------------------------------------------------------
00126                         AUDIO IN CONFIGURATION
00127 ------------------------------------------------------------------------------*/
00128 /* SPI Configuration defines */
00129 #define AUDIO_I2Sx                          SPI3
00130 #define AUDIO_I2Sx_CLK_ENABLE()             __HAL_RCC_SPI3_CLK_ENABLE()
00131 #define AUDIO_I2Sx_CLK_DISABLE()            __HAL_RCC_SPI3_CLK_DISABLE()
00132 #define AUDIO_I2Sx_SCK_PIN                   GPIO_PIN_3
00133 #define AUDIO_I2Sx_SCK_GPIO_PORT             GPIOB
00134 #define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00135 #define AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOB_CLK_DISABLE()
00136 #define AUDIO_I2Sx_SCK_AF                    GPIO_AF6_SPI3
00137
00138 #define AUDIO_I2Sx_SD_PIN                   GPIO_PIN_6
00139 #define AUDIO_I2Sx_SD_GPIO_PORT             GPIOD
00140 #define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00141 #define AUDIO_I2Sx_SD_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00142 #define AUDIO_I2Sx_SD_AF                    GPIO_AF5_SPI3
00143
00144 /* I2S DMA Stream Rx definitions */
00145 #define AUDIO_I2Sx_DMAx_CLK_ENABLE()        __HAL_RCC_DMA1_CLK_ENABLE()
00146 #define AUDIO_I2Sx_DMAx_CLK_DISABLE()       __HAL_RCC_DMA1_CLK_DISABLE()
00147 #define AUDIO_I2Sx_DMAx_STREAM              DMA1_Stream2
00148 #define AUDIO_I2Sx_DMAx_CHANNEL             DMA_CHANNEL_0
00149 #define AUDIO_I2Sx_DMAx_IRQ                 DMA1_Stream2_IRQn
00150 #define AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE    DMA_PDATAALIGN_HALFWORD
00151 #define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE       DMA_MDATAALIGN_HALFWORD
00152
00153 #define AUDIO_I2Sx_DMAx_IRQHandler          DMA1_Stream2_IRQHandler
00154
00155 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
00156 #define AUDIO_IN_IRQ_PREPRIO                ((uint32_t)0x0F)   /* Select the preemption priority level(0 is the highest) */
00157
00158
00159 /* Two channels are used:
00160    - one channel as input which is connected to I2S SCK in stereo mode
00161    - one channel as outupt which divides the frequency on the input
00162 */
00163
00164 #define AUDIO_TIMx_CLK_ENABLE()             __HAL_RCC_TIM3_CLK_ENABLE()
00165 #define AUDIO_TIMx_CLK_DISABLE()            __HAL_RCC_TIM3_CLK_DISABLE()
00166 #define AUDIO_TIMx                          TIM3
00167 #define AUDIO_TIMx_IN_CHANNEL               TIM_CHANNEL_1
00168 #define AUDIO_TIMx_OUT_CHANNEL              TIM_CHANNEL_2 /* Select channel 2 as output */
00169 #define AUDIO_TIMx_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOC_CLK_ENABLE()
00170 #define AUDIO_TIMx_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOC_CLK_DISABLE()
00171 #define AUDIO_TIMx_GPIO_PORT                GPIOC
00172 #define AUDIO_TIMx_IN_GPIO_PIN              GPIO_PIN_6
00173 #define AUDIO_TIMx_OUT_GPIO_PIN             GPIO_PIN_7
00174 #define AUDIO_TIMx_AF                       GPIO_AF2_TIM3
00175
00176 /*------------------------------------------------------------------------------
00177              CONFIGURATION: Audio Driver Configuration parameters
00178 ------------------------------------------------------------------------------*/
00179
00180 #define AUDIODATA_SIZE                      2   /* 16-bits audio data size */
00181
00182 /* Audio status definition */
00183 #define AUDIO_OK                            ((uint8_t)0)
00184 #define AUDIO_ERROR                         ((uint8_t)1)
00185 #define AUDIO_TIMEOUT                       ((uint8_t)2)
00186
00187 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
00188 #define DEFAULT_AUDIO_IN_FREQ               I2S_AUDIOFREQ_16K
00189 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     ((uint8_t)16)
00190 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        ((uint8_t)2) /* Mono = 1, Stereo = 2 */
00191 #define DEFAULT_AUDIO_IN_VOLUME             ((uint16_t)64)
00192
00193 /* PDM buffer input size */
00194 #define INTERNAL_BUFF_SIZE                  (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
00195 /* PCM buffer output size */
00196 #define PCM_OUT_SIZE                        (DEFAULT_AUDIO_IN_FREQ/1000*2)
00197 #define CHANNEL_DEMUX_MASK                  ((uint8_t)0x55)
00198
00199 /*------------------------------------------------------------------------------
00200                     OPTIONAL Configuration defines parameters
00201 ------------------------------------------------------------------------------*/
00202
00203 /* Delay for the Codec to be correctly reset */
00204 #define CODEC_RESET_DELAY                   ((uint8_t)5)
00205
00206
00207 /*------------------------------------------------------------------------------
00208                             OUTPUT DEVICES definition
00209 ------------------------------------------------------------------------------*/
00210 /* Alias on existing output devices to adapt for 2 headphones output */
00211 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
00212 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */
00213
00214 /**
00215   * @}
00216   */
00217
00218 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Variables STM32756G_EVAL_AUDIO Exported Variables
00219   * @{
00220   */
00221 extern __IO uint16_t AudioInVolume;
00222  /**
00223   * @}
00224   */
00225
00226 /** @defgroup STM32756G_EVAL_AUDIO_Exported_Macros STM32756G_EVAL_AUDIO Exported Macros
00227   * @{
00228   */
00229 #define DMA_MAX(x)           (((x) <= DMA_MAX_SZE)? (x):DMA_MAX_SZE)
00230 /**
00231   * @}
00232   */
00233
00234 /** @defgroup STM32756G_EVAL_AUDIO_OUT_Exported_Functions STM32756G_EVAL_AUDIO_OUT Exported Functions
00235   * @{
00236   */
00237 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00238 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size);
00239 void    BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00240 uint8_t BSP_AUDIO_OUT_Pause(void);
00241 uint8_t BSP_AUDIO_OUT_Resume(void);
00242 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00243 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00244 void    BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00245 void    BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot);
00246 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00247 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00248 void    BSP_AUDIO_OUT_DeInit(void);
00249
00250 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00251 /* This function is called when the requested data has been completely transferred.*/
00252 void    BSP_AUDIO_OUT_TransferComplete_CallBack(void);
00253
00254 /* This function is called when half of the requested buffer has been transferred. */
00255 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(void);
00256
00257 /* This function is called when an Interrupt due to transfer error on or peripheral
00258    error occurs. */
00259 void    BSP_AUDIO_OUT_Error_CallBack(void);
00260
00261 /* These function can be modified in case the current settings (e.g. DMA stream)
00262    need to be changed for specific application needs */
00263 void  BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params);
00264 void  BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00265 void  BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00266
00267 /**
00268   * @}
00269   */
00270
00271 /** @defgroup STM32756G_EVAL_AUDIO_IN_Exported_Functions STM32756G_EVAL_AUDIO_IN Exported Functions
00272   * @{
00273   */
00274 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00275 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
00276 uint8_t BSP_AUDIO_IN_Stop(void);
00277 uint8_t BSP_AUDIO_IN_Pause(void);
00278 uint8_t BSP_AUDIO_IN_Resume(void);
00279 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume);
00280 void    BSP_AUDIO_IN_DeInit(void);
00281 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf);
00282 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00283 /* This function should be implemented by the user application.
00284    It is called into this driver when the current buffer is filled to prepare the next
00285    buffer pointer and its size. */
00286 void    BSP_AUDIO_IN_TransferComplete_CallBack(void);
00287 void    BSP_AUDIO_IN_HalfTransfer_CallBack(void);
00288
00289 /* This function is called when an Interrupt due to transfer error on or peripheral
00290    error occurs. */
00291 void    BSP_AUDIO_IN_Error_Callback(void);
00292
00293 /* These function can be modified in case the current settings (e.g. DMA stream)
00294    need to be changed for specific application needs */
00295 void  BSP_AUDIO_IN_MspInit(I2S_HandleTypeDef *hi2s, void *Params);
00296 void  BSP_AUDIO_IN_MspDeInit(I2S_HandleTypeDef *hi2s, void *Params);
00297
00298 /**
00299   * @}
00300   */
00301
00302 /**
00303   * @}
00304   */
00305
00306 /**
00307   * @}
00308   */
00309
00310 /**
00311   * @}
00312   */
00313
00314 #ifdef __cplusplus
00315 }
00316 #endif
00317
00318 #endif /* __STM32756G_EVAL_AUDIO_H */
00319
00320 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the driver for Camera modules mounted on
00008   *          STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How to use this driver:
00011   -----------------------
00012    - This driver is used to drive the camera.
00013    - The S5K5CAG component driver MUST be included with this driver.
00014
00015   Driver description:
00016   ------------------
00017   + Initialization steps:
00018      o Initialize the camera using the BSP_CAMERA_Init() function.
00019      o Start the camera capture/snapshot using the CAMERA_Start() function.
00020      o Suspend, resume or stop the camera capture using the following functions:
00021       - BSP_CAMERA_Suspend()
00022       - BSP_CAMERA_Resume()
00023       - BSP_CAMERA_Stop()
00024
00025   + Options
00026      o Increase or decrease on the fly the brightness and/or contrast
00027        using the following function:
00028        - BSP_CAMERA_ContrastBrightnessConfig
00029      o Add a special effect on the fly using the following functions:
00030        - BSP_CAMERA_BlackWhiteConfig()
00031        - BSP_CAMERA_ColorEffectConfig()
00032   @endverbatim
00033   ******************************************************************************
00034   * @attention
00035   *
00036   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00037   *
00038   * Redistribution and use in source and binary forms, with or without modification,
00039   * are permitted provided that the following conditions are met:
00040   *   1. Redistributions of source code must retain the above copyright notice,
00041   *      this list of conditions and the following disclaimer.
00042   *   2. Redistributions in binary form must reproduce the above copyright notice,
00043   *      this list of conditions and the following disclaimer in the documentation
00044   *      and/or other materials provided with the distribution.
00045   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00046   *      may be used to endorse or promote products derived from this software
00047   *      without specific prior written permission.
00048   *
00049   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00050   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00051   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00052   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00053   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00054   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00055   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00056   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00057   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00058   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00059   *
00060   ******************************************************************************
00061   */
00062
00063 /* Includes ------------------------------------------------------------------*/
00064 #include "stm32756g_eval_camera.h"
00065
00066 /** @addtogroup BSP
00067   * @{
00068   */
00069
00070 /** @addtogroup STM32756G_EVAL
00071   * @{
00072   */
00073
00074 /** @defgroup STM32756G_EVAL_CAMERA STM32756G_EVAL CAMERA
00075   * @{
00076   */
00077
00078 /** @defgroup STM32756G_EVAL_CAMERA_Private_TypesDefinitions CAMERA Private TypesDefinitions
00079   * @{
00080   */
00081 /**
00082   * @}
00083   */
00084
00085 /** @defgroup STM32756G_EVAL_CAMERA_Private_Defines CAMERA Private Defines
00086   * @{
00087   */
00088 /**
00089   * @}
00090   */
00091
00092 /** @defgroup STM32756G_EVAL_CAMERA_Private_Macros CAMERA Private Macros
00093   * @{
00094   */
00095 /**
00096   * @}
00097   */
00098
00099 /** @defgroup STM32756G_EVAL_CAMERA_Private_Variables CAMERA Private Variables
00100   * @{
00101   */
00102 DCMI_HandleTypeDef  hDcmiEval;
00103 CAMERA_DrvTypeDef   *camera_drv;
00104 /* Camera current resolution naming (QQVGA, VGA, ...) */
00105 static uint32_t CameraCurrentResolution;
00106
00107 /* Camera module I2C HW address */
00108 static uint32_t CameraHwAddress;
00109 /**
00110   * @}
00111   */
00112
00113 /** @defgroup STM32756G_EVAL_CAMERA_Private_FunctionsPrototypes CAMERA Private Functions Prototypes
00114   * @{
00115   */
00116 static uint32_t GetSize(uint32_t resolution);
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_CAMERA_Private_Functions CAMERA Private Functions
00122   * @{
00123   */
00124
00125 /**
00126   * @brief  Initializes the camera.
00127   * @param  Resolution : camera sensor requested resolution (x, y) : standard resolution
00128   *         naming QQVGA, QVGA, VGA ...
00129   *
00130   * @retval Camera status
00131   */
00132 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
00133 {
00134   DCMI_HandleTypeDef *phdcmi;
00135   uint8_t status = CAMERA_ERROR;
00136
00137   /* Get the DCMI handle structure */
00138   phdcmi = &hDcmiEval;
00139
00140   /*** Configures the DCMI to interface with the camera module ***/
00141   /* DCMI configuration */
00142   phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
00143   phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;
00144   phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
00145   phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
00146   phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
00147   phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
00148   phdcmi->Instance              = DCMI;
00149
00150   /* Configure IO functionalities for CAMERA detect pin */
00151   BSP_IO_Init();
00152
00153   /* Apply Camera Module hardware reset */
00154   BSP_CAMERA_HwReset();
00155
00156   /* Check if the CAMERA Module is plugged on board */
00157   if(BSP_IO_ReadPin(CAM_PLUG_PIN) == BSP_IO_PIN_SET)
00158   {
00159     status = CAMERA_NOT_DETECTED;
00160     return status; /* Exit with error */
00161   }
00162
00163   /* Read ID of Camera module via I2C */
00164   if (s5k5cag_ReadID(CAMERA_I2C_ADDRESS) == S5K5CAG_ID)
00165   {
00166     /* Initialize the camera driver structure */
00167     camera_drv = &s5k5cag_drv;
00168     CameraHwAddress = CAMERA_I2C_ADDRESS;
00169
00170     /* DCMI Initialization */
00171     BSP_CAMERA_MspInit(&hDcmiEval, NULL);
00172     HAL_DCMI_Init(phdcmi);
00173
00174     /* Camera Module Initialization via I2C to the wanted 'Resolution' */
00175     camera_drv->Init(CameraHwAddress, Resolution);
00176
00177     CameraCurrentResolution = Resolution;
00178
00179     /* Return CAMERA_OK status */
00180     status = CAMERA_OK;
00181   }
00182   else
00183   {
00184     /* Return CAMERA_NOT_SUPPORTED status */
00185         status = CAMERA_NOT_SUPPORTED;
00186   }
00187
00188   return status;
00189 }
00190
00191 /**
00192   * @brief  DeInitializes the camera.
00193   * @retval Camera status
00194   */
00195 uint8_t BSP_CAMERA_DeInit(void)
00196 {
00197   hDcmiEval.Instance              = DCMI;
00198
00199   HAL_DCMI_DeInit(&hDcmiEval);
00200   BSP_CAMERA_MspDeInit(&hDcmiEval, NULL);
00201   return CAMERA_OK;
00202 }
00203
00204 /**
00205   * @brief  Starts the camera capture in continuous mode.
00206   * @param  buff: pointer to the camera output buffer
00207   * @retval None
00208   */
00209 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
00210 {
00211   /* Start the camera capture */
00212   HAL_DCMI_Start_DMA(&hDcmiEval, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
00213 }
00214
00215 /**
00216   * @brief  Starts the camera capture in snapshot mode.
00217   * @param  buff: pointer to the camera output buffer
00218   * @retval None
00219   */
00220 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
00221 {
00222   /* Start the camera capture */
00223   HAL_DCMI_Start_DMA(&hDcmiEval, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
00224 }
00225
00226 /**
00227   * @brief Suspend the CAMERA capture
00228
00229   * @retval None
00230   */
00231 void BSP_CAMERA_Suspend(void)
00232 {
00233   /* Suspend the Camera Capture */
00234   HAL_DCMI_Suspend(&hDcmiEval);
00235 }
00236
00237 /**
00238   * @brief Resume the CAMERA capture
00239   * @retval None
00240   */
00241 void BSP_CAMERA_Resume(void)
00242 {
00243   /* Start the Camera Capture */
00244   HAL_DCMI_Resume(&hDcmiEval);
00245 }
00246
00247 /**
00248   * @brief  Stop the CAMERA capture
00249   * @retval Camera status
00250   */
00251 uint8_t BSP_CAMERA_Stop(void)
00252 {
00253   uint8_t status = CAMERA_ERROR;
00254
00255   if(HAL_DCMI_Stop(&hDcmiEval) == HAL_OK)
00256   {
00257      status = CAMERA_OK;
00258   }
00259
00260   /* Set Camera in Power Down */
00261   BSP_CAMERA_PwrDown();
00262
00263   return status;
00264 }
00265
00266 /**
00267   * @brief  CANERA hardware reset
00268   * @retval None
00269   */
00270 void BSP_CAMERA_HwReset(void)
00271 {
00272   /* Camera sensor RESET sequence */
00273   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00274   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00275
00276   /* Assert the camera STANDBY pin (active high)  */
00277   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_SET);
00278
00279   /* Assert the camera RSTI pin (active low) */
00280   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00281
00282   HAL_Delay(100);   /* RST and XSDN signals asserted during 100ms */
00283
00284   /* De-assert the camera STANDBY pin (active high) */
00285   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00286
00287   HAL_Delay(3);     /* RST de-asserted and XSDN asserted during 3ms */
00288
00289   /* De-assert the camera RSTI pin (active low) */
00290   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_SET);
00291
00292   HAL_Delay(6);     /* RST de-asserted during 3ms */
00293 }
00294
00295 /**
00296   * @brief  CAMERA power down
00297   * @retval None
00298   */
00299 void BSP_CAMERA_PwrDown(void)
00300 {
00301   /* Camera power down sequence */
00302   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00303   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00304
00305   /* De-assert the camera STANDBY pin (active high) */
00306   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00307
00308   /* Assert the camera RSTI pin (active low) */
00309   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00310 }
00311
00312 /**
00313   * @brief  Configures the camera contrast and brightness.
00314   * @param  contrast_level: Contrast level
00315   *          This parameter can be one of the following values:
00316   *            @arg  CAMERA_CONTRAST_LEVEL4: for contrast +2
00317   *            @arg  CAMERA_CONTRAST_LEVEL3: for contrast +1
00318   *            @arg  CAMERA_CONTRAST_LEVEL2: for contrast  0
00319   *            @arg  CAMERA_CONTRAST_LEVEL1: for contrast -1
00320   *            @arg  CAMERA_CONTRAST_LEVEL0: for contrast -2
00321   * @param  brightness_level: Contrast level
00322   *          This parameter can be one of the following values:
00323   *            @arg  CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
00324   *            @arg  CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
00325   *            @arg  CAMERA_BRIGHTNESS_LEVEL2: for brightness  0
00326   *            @arg  CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
00327   *            @arg  CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
00328   * @retval None
00329   */
00330 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
00331 {
00332   if(camera_drv->Config != NULL)
00333   {
00334     camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
00335   }
00336 }
00337
00338 /**
00339   * @brief  Configures the camera white balance.
00340   * @param  Mode: black_white mode
00341   *          This parameter can be one of the following values:
00342   *            @arg  CAMERA_BLACK_WHITE_BW
00343   *            @arg  CAMERA_BLACK_WHITE_NEGATIVE
00344   *            @arg  CAMERA_BLACK_WHITE_BW_NEGATIVE
00345   *            @arg  CAMERA_BLACK_WHITE_NORMAL
00346   * @retval None
00347   */
00348 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
00349 {
00350   if(camera_drv->Config != NULL)
00351   {
00352     camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
00353   }
00354 }
00355
00356 /**
00357   * @brief  Configures the camera color effect.
00358   * @param  Effect: Color effect
00359   *          This parameter can be one of the following values:
00360   *            @arg  CAMERA_COLOR_EFFECT_ANTIQUE
00361   *            @arg  CAMERA_COLOR_EFFECT_BLUE
00362   *            @arg  CAMERA_COLOR_EFFECT_GREEN
00363   *            @arg  CAMERA_COLOR_EFFECT_RED
00364   * @retval None
00365   */
00366 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
00367 {
00368   if(camera_drv->Config != NULL)
00369   {
00370     camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
00371   }
00372 }
00373
00374 /**
00375   * @brief  Get the capture size in pixels unit.
00376   * @param  resolution: the current resolution.
00377   * @retval capture size in pixels unit.
00378   */
00379 static uint32_t GetSize(uint32_t resolution)
00380 {
00381   uint32_t size = 0;
00382
00383   /* Get capture size */
00384   switch (resolution)
00385   {
00386   case CAMERA_R160x120:
00387     {
00388       size =  0x2580;
00389     }
00390     break;
00391   case CAMERA_R320x240:
00392     {
00393       size =  0x9600;
00394     }
00395     break;
00396   case CAMERA_R480x272:
00397     {
00398       size =  0xFF00;
00399     }
00400     break;
00401   case CAMERA_R640x480:
00402     {
00403       size =  0x25800;
00404     }
00405     break;
00406   default:
00407     {
00408       break;
00409     }
00410   }
00411
00412   return size;
00413 }
00414
00415 /**
00416   * @brief  Initializes the DCMI MSP.
00417   * @param  hdcmi: pointer to the DCMI handle
00418   * @param  Params
00419   * @retval None
00420   */
00421 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00422 {
00423   static DMA_HandleTypeDef hdma_eval;
00424   GPIO_InitTypeDef gpio_init_structure;
00425
00426   /*** Enable peripherals and GPIO clocks ***/
00427   /* Enable DCMI clock */
00428   __HAL_RCC_DCMI_CLK_ENABLE();
00429
00430   /* Enable DMA2 clock */
00431   __HAL_RCC_DMA2_CLK_ENABLE();
00432
00433   /* Enable GPIO clocks */
00434   __HAL_RCC_GPIOA_CLK_ENABLE();
00435   __HAL_RCC_GPIOB_CLK_ENABLE();
00436   __HAL_RCC_GPIOC_CLK_ENABLE();
00437   __HAL_RCC_GPIOD_CLK_ENABLE();
00438   __HAL_RCC_GPIOE_CLK_ENABLE();
00439
00440   /*** Configure the GPIO ***/
00441   /* Configure DCMI GPIO as alternate function */
00442   /* On STM32756G-EVAL RevB, to use camera, ensure that JP23 is in position 1-2,
00443    * LED3 is then no more usable */
00444   gpio_init_structure.Pin       = GPIO_PIN_4 | GPIO_PIN_6;
00445   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00446   gpio_init_structure.Pull      = GPIO_PULLUP;
00447   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00448   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00449   HAL_GPIO_Init(GPIOA, &gpio_init_structure);
00450
00451   gpio_init_structure.Pin       = GPIO_PIN_7;
00452   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00453   gpio_init_structure.Pull      = GPIO_PULLUP;
00454   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00455   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00456   HAL_GPIO_Init(GPIOB, &gpio_init_structure);
00457
00458   gpio_init_structure.Pin       = GPIO_PIN_6 | GPIO_PIN_7  | GPIO_PIN_8  |\
00459                                   GPIO_PIN_9 | GPIO_PIN_11;
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(GPIOC, &gpio_init_structure);
00465
00466   gpio_init_structure.Pin       = GPIO_PIN_3 | GPIO_PIN_6;
00467   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00468   gpio_init_structure.Pull      = GPIO_PULLUP;
00469   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00470   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00471   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00472
00473   gpio_init_structure.Pin       = GPIO_PIN_5 | GPIO_PIN_6;
00474   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00475   gpio_init_structure.Pull      = GPIO_PULLUP;
00476   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00477   gpio_init_structure.Alternate = GPIO_AF13_DCMI;
00478   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00479
00480   /*** Configure the DMA ***/
00481   /* Set the parameters to be configured */
00482   hdma_eval.Init.Channel             = DMA_CHANNEL_1;
00483   hdma_eval.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00484   hdma_eval.Init.PeriphInc           = DMA_PINC_DISABLE;
00485   hdma_eval.Init.MemInc              = DMA_MINC_ENABLE;
00486   hdma_eval.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00487   hdma_eval.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00488   hdma_eval.Init.Mode                = DMA_CIRCULAR;
00489   hdma_eval.Init.Priority            = DMA_PRIORITY_HIGH;
00490   hdma_eval.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00491   hdma_eval.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00492   hdma_eval.Init.MemBurst            = DMA_MBURST_SINGLE;
00493   hdma_eval.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00494
00495   hdma_eval.Instance = DMA2_Stream1;
00496
00497   /* Associate the initialized DMA handle to the DCMI handle */
00498   __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_eval);
00499
00500   /*** Configure the NVIC for DCMI and DMA ***/
00501   /* NVIC configuration for DCMI transfer complete interrupt */
00502   HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0);
00503   HAL_NVIC_EnableIRQ(DCMI_IRQn);
00504
00505   /* NVIC configuration for DMA2D transfer complete interrupt */
00506   HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 0x0F, 0);
00507   HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
00508
00509   /* Configure the DMA stream */
00510   HAL_DMA_Init(hdcmi->DMA_Handle);
00511 }
00512
00513
00514 /**
00515   * @brief  DeInitializes the DCMI MSP.
00516   * @param  hdcmi: pointer to the DCMI handle
00517   * @param  Params
00518   * @retval None
00519   */
00520 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00521 {
00522   /* Disable NVIC  for DCMI transfer complete interrupt */
00523   HAL_NVIC_DisableIRQ(DCMI_IRQn);
00524
00525   /* Disable NVIC for DMA2 transfer complete interrupt */
00526   HAL_NVIC_DisableIRQ(DMA2_Stream1_IRQn);
00527
00528   /* Configure the DMA stream */
00529   HAL_DMA_DeInit(hdcmi->DMA_Handle);
00530
00531   /* Disable DCMI clock */
00532   __HAL_RCC_DCMI_CLK_DISABLE();
00533
00534   /* GPIO pins clock and DMA clock can be shut down in the application
00535      by surcharging this __weak function */
00536 }
00537
00538 /**
00539   * @brief  Line event callback
00540   * @param  hdcmi: pointer to the DCMI handle
00541   * @retval None
00542   */
00543 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
00544 {
00545   BSP_CAMERA_LineEventCallback();
00546 }
00547
00548 /**
00549   * @brief  Line Event callback.
00550   * @retval None
00551   */
00552 __weak void BSP_CAMERA_LineEventCallback(void)
00553 {
00554   /* NOTE : This function Should not be modified, when the callback is needed,
00555             the HAL_DCMI_LineEventCallback could be implemented in the user file
00556    */
00557 }
00558
00559 /**
00560   * @brief  VSYNC event callback
00561   * @param  hdcmi: pointer to the DCMI handle
00562   * @retval None
00563   */
00564 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
00565 {
00566   BSP_CAMERA_VsyncEventCallback();
00567 }
00568
00569 /**
00570   * @brief  VSYNC Event callback.
00571   * @retval None
00572   */
00573 __weak void BSP_CAMERA_VsyncEventCallback(void)
00574 {
00575   /* NOTE : This function Should not be modified, when the callback is needed,
00576             the HAL_DCMI_VsyncEventCallback could be implemented in the user file
00577    */
00578 }
00579
00580 /**
00581   * @brief  Frame event callback
00582   * @param  hdcmi: pointer to the DCMI handle
00583   * @retval None
00584   */
00585 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
00586 {
00587   BSP_CAMERA_FrameEventCallback();
00588 }
00589
00590 /**
00591   * @brief  Frame Event callback.
00592   * @retval None
00593   */
00594 __weak void BSP_CAMERA_FrameEventCallback(void)
00595 {
00596   /* NOTE : This function Should not be modified, when the callback is needed,
00597             the HAL_DCMI_FrameEventCallback could be implemented in the user file
00598    */
00599 }
00600
00601 /**
00602   * @brief  Error callback
00603   * @param  hdcmi: pointer to the DCMI handle
00604   * @retval None
00605   */
00606 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
00607 {
00608   BSP_CAMERA_ErrorCallback();
00609 }
00610
00611 /**
00612   * @brief  Error callback.
00613   * @retval None
00614   */
00615 __weak void BSP_CAMERA_ErrorCallback(void)
00616 {
00617   /* NOTE : This function Should not be modified, when the callback is needed,
00618             the HAL_DCMI_ErrorCallback could be implemented in the user file
00619    */
00620 }
00621
00622 /**
00623   * @}
00624   */
00625
00626 /**
00627   * @}
00628   */
00629
00630 /**
00631   * @}
00632   */
00633
00634 /**
00635   * @}
00636   */
00637
00638 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_camera.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_CAMERA_H
00041 #define __STM32756G_EVAL_CAMERA_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 /* Include Camera component Driver */
00049 #include "../Components/s5k5cag/s5k5cag.h"
00050
00051 /* Include IO Driver */
00052 #include "stm32756g_eval_io.h"
00053
00054 /** @addtogroup BSP
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL
00059   * @{
00060   */
00061
00062 /** @addtogroup STM32756G_EVAL_CAMERA
00063   * @{
00064   */
00065
00066 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Types CAMERA Exported Types
00067   * @{
00068   */
00069
00070 /**
00071   * @brief  Camera State structures definition
00072   */
00073 typedef enum
00074 {
00075   CAMERA_OK            = 0x00,
00076   CAMERA_ERROR         = 0x01,
00077   CAMERA_TIMEOUT       = 0x02,
00078   CAMERA_NOT_DETECTED  = 0x03,
00079   CAMERA_NOT_SUPPORTED = 0x04
00080
00081 } Camera_StatusTypeDef;
00082
00083 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00084 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00085 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00086 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Constants CAMERA Exported Constants
00092   * @{
00093   */
00094 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00095 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Stream1_IRQHandler
00096 /**
00097   * @}
00098   */
00099
00100 /** @defgroup STM32756G_EVAL_CAMERA_Exported_Functions CAMERA Exported Functions
00101   * @{
00102   */
00103 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00104 uint8_t BSP_CAMERA_DeInit(void);
00105 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00106 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00107 void    BSP_CAMERA_Suspend(void);
00108 void    BSP_CAMERA_Resume(void);
00109 uint8_t BSP_CAMERA_Stop(void);
00110 void    BSP_CAMERA_HwReset(void);
00111 void    BSP_CAMERA_PwrDown(void);
00112 void    BSP_CAMERA_LineEventCallback(void);
00113 void    BSP_CAMERA_VsyncEventCallback(void);
00114 void    BSP_CAMERA_FrameEventCallback(void);
00115 void    BSP_CAMERA_ErrorCallback(void);
00116
00117 /* Camera features functions prototype */
00118 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00119 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00120 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00121
00122 /* To be called in DCMI_IRQHandler function */
00123 void    BSP_CAMERA_IRQHandler(void);
00124 /* To be called in DMA2_Stream1_IRQHandler function */
00125 void    BSP_CAMERA_DMA_IRQHandler(void);
00126
00127 /* These functions can be modified in case the current settings (e.g. DMA stream)
00128    need to be changed for specific application needs */
00129 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00130 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00131
00132
00133 /**
00134   * @}
00135   */
00136
00137 /**
00138   * @}
00139   */
00140
00141 /**
00142   * @}
00143   */
00144
00145 /**
00146   * @}
00147   */
00148
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152
00153 #endif /* __STM32756G_EVAL_CAMERA_H */
00154
00155 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file provides a set of functions needed to manage an I2C M24LR64
00008   *          EEPROM memory.
00009   @verbatim
00010             To be able to use this driver, the switch EE_M24LR64 must be defined
00011             in your toolchain compiler preprocessor
00012
00013             ===================================================================
00014             Notes:
00015              - The I2C EEPROM memory (M24LR64) is available on separate daughter
00016                board ANT7-M24LR-A, which is not provided with the STM32756G_EVAL
00017                and STM32746G_EVAL boards.
00018                To use this driver you have to connect the ANT7-M24LR-A to CN2
00019                connector of STM32756G_EVAL board.
00020             ===================================================================
00021
00022             It implements a high level communication layer for read and write
00023             from/to this memory. The needed STM32F7xx hardware resources (I2C and
00024             GPIO) are defined in stm32756g_eval.h file, and the initialization is
00025             performed in EEPROM_IO_Init() function declared in stm32756g_eval.c
00026             file.
00027             You can easily tailor this driver to any other development board,
00028             by just adapting the defines for hardware resources and
00029             EEPROM_IO_Init() function.
00030
00031             @note In this driver, basic read and write functions (BSP_EEPROM_ReadBuffer()
00032                   and BSP_EEPROM_WritePage()) use DMA mode to perform the data
00033                   transfer to/from EEPROM memory.
00034
00035            @note   Regarding BSP_EEPROM_WritePage(), it is an optimized function to perform
00036                   small write (less than 1 page) BUT the number of bytes (combined to write start address) must not
00037                   cross the EEPROM page boundary. This function can only writes into
00038                   the boundaries of an EEPROM page.
00039                   This function doesn't check on boundaries condition (in this driver
00040                   the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
00041                   responsible of checking on Page boundaries).
00042
00043
00044        +-----------------------------------------------------------------+
00045        |               Pin assignment for M24LR64 EEPROM                 |
00046        +---------------------------------------+-----------+-------------+
00047        |  STM32F7xx I2C Pins                   |   EEPROM  |   Pin       |
00048        +---------------------------------------+-----------+-------------+
00049        | .                                     |   E0(GND) |    1  (0V)  |
00050        | .                                     |   AC0     |    2        |
00051        | .                                     |   AC1     |    3        |
00052        | .                                     |   VSS     |    4  (0V)  |
00053        | SDA                                   |   SDA     |    5        |
00054        | SCL                                   |   SCL     |    6        |
00055        | .                                     |   E1(GND) |    7  (0V)  |
00056        | .                                     |   VDD     |    8 (3.3V) |
00057        +---------------------------------------+-----------+-------------+
00058   @endverbatim
00059   ******************************************************************************
00060   * @attention
00061   *
00062   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00063   *
00064   * Redistribution and use in source and binary forms, with or without modification,
00065   * are permitted provided that the following conditions are met:
00066   *   1. Redistributions of source code must retain the above copyright notice,
00067   *      this list of conditions and the following disclaimer.
00068   *   2. Redistributions in binary form must reproduce the above copyright notice,
00069   *      this list of conditions and the following disclaimer in the documentation
00070   *      and/or other materials provided with the distribution.
00071   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00072   *      may be used to endorse or promote products derived from this software
00073   *      without specific prior written permission.
00074   *
00075   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00076   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00077   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00078   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00079   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00080   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00081   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00082   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00083   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00084   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00085   *
00086   ******************************************************************************
00087   */
00088 /* Includes ------------------------------------------------------------------*/
00089 #include "stm32756g_eval_eeprom.h"
00090
00091 /** @addtogroup BSP
00092   * @{
00093   */
00094
00095 /** @addtogroup STM32756G_EVAL
00096   * @{
00097   */
00098
00099 /** @defgroup STM32756G_EVAL_EEPROM  STM32756G_EVAL EEPROM
00100   * @brief This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.
00101   * @{
00102   */
00103
00104 /** @defgroup STM32756G_EVAL_EEPROM_Private_Types EEPROM Private Types
00105   * @{
00106   */
00107 /**
00108   * @}
00109   */
00110
00111 /** @defgroup STM32756G_EVAL_EEPROM_Private_Defines EEPROM Private Defines
00112   * @{
00113   */
00114 /**
00115   * @}
00116   */
00117
00118 /** @defgroup STM32756G_EVAL_EEPROM_Private_Macros EEPROM Private Macros
00119   * @{
00120   */
00121 /**
00122   * @}
00123   */
00124
00125 /** @defgroup STM32756G_EVAL_EEPROM_Private_Variables EEPROM Private Variables
00126   * @{
00127   */
00128 __IO uint16_t EEPROMAddress = 0;
00129 __IO uint16_t EEPROMDataRead;
00130 __IO uint8_t  EEPROMDataWrite;
00131 /**
00132   * @}
00133   */
00134
00135 /** @defgroup STM32756G_EVAL_EEPROM_Private_Functions_Prototypes EEPROM Private Functions Prototypes
00136   * @{
00137   */
00138 /**
00139   * @}
00140   */
00141
00142 /** @defgroup STM32756G_EVAL_EEPROM_Private_Functions EEPROM Private Functions
00143   * @{
00144   */
00145
00146 /**
00147   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00148   * @note   There are 2 different versions of M24LR64 (A01 & A02).
00149   *             Then try to connect on 1st one (EEPROM_I2C_ADDRESS_A01)
00150   *             and if problem, check the 2nd one (EEPROM_I2C_ADDRESS_A02)
00151   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00152   *         different from EEPROM_OK (0)
00153   */
00154 uint32_t BSP_EEPROM_Init(void)
00155 {
00156   /* I2C Initialization */
00157   EEPROM_IO_Init();
00158
00159   /* Select the EEPROM address for A01 and check if OK */
00160   EEPROMAddress = EEPROM_I2C_ADDRESS_A01;
00161   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00162   {
00163     /* Select the EEPROM address for A02 and check if OK */
00164     EEPROMAddress = EEPROM_I2C_ADDRESS_A02;
00165     if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00166     {
00167       return EEPROM_FAIL;
00168     }
00169   }
00170   return EEPROM_OK;
00171 }
00172
00173 /**
00174   * @brief  DeInitializes the EEPROM.
00175   * @retval EEPROM state
00176   */
00177 uint8_t BSP_EEPROM_DeInit(void)
00178 {
00179   /* I2C won't be disabled because common to other functionalities */
00180   return EEPROM_OK;
00181 }
00182
00183 /**
00184   * @brief  Reads a block of data from the EEPROM.
00185   * @param  pBuffer: pointer to the buffer that receives the data read from
00186   *         the EEPROM.
00187   * @param  ReadAddr: EEPROM's internal address to start reading from.
00188   * @param  NumByteToRead: pointer to the variable holding number of bytes to
00189   *         be read from the EEPROM.
00190   *
00191   * @note   The variable pointed by NumByteToRead is reset to 0 when all the
00192   *         data are read from the EEPROM. Application should monitor this
00193   *         variable in order know when the transfer is complete.
00194   *
00195   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00196   *         different from EEPROM_OK (0) or the timeout user callback.
00197   */
00198 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead)
00199 {
00200   uint32_t buffersize = *NumByteToRead;
00201
00202   /* Set the pointer to the Number of data to be read. This pointer will be used
00203      by the DMA Transfer Completer interrupt Handler in order to reset the
00204      variable to 0. User should check on this variable in order to know if the
00205      DMA transfer has been complete or not. */
00206   EEPROMDataRead = *NumByteToRead;
00207
00208   if(EEPROM_IO_ReadData(EEPROMAddress, ReadAddr, pBuffer, buffersize) != HAL_OK)
00209   {
00210     BSP_EEPROM_TIMEOUT_UserCallback();
00211     return EEPROM_FAIL;
00212   }
00213
00214   /* If all operations OK, return EEPROM_OK (0) */
00215   return EEPROM_OK;
00216 }
00217
00218 /**
00219   * @brief  Writes more than one byte to the EEPROM with a single WRITE cycle.
00220   *
00221   * @note   The number of bytes (combined to write start address) must not
00222   *         cross the EEPROM page boundary. This function can only write into
00223   *         the boundaries of an EEPROM page.
00224   *         This function doesn't check on boundaries condition (in this driver
00225   *         the function BSP_EEPROM_WriteBuffer() which calls BSP_EEPROM_WritePage() is
00226   *         responsible of checking on Page boundaries).
00227   *
00228   * @param  pBuffer: pointer to the buffer containing the data to be written to
00229   *         the EEPROM.
00230   * @param  WriteAddr: EEPROM's internal address to write to.
00231   * @param  NumByteToWrite: pointer to the variable holding number of bytes to
00232   *         be written into the EEPROM.
00233   *
00234   *        @note The variable pointed by NumByteToWrite is reset to 0 when all the
00235   *              data are written to the EEPROM. Application should monitor this
00236   *              variable in order know when the transfer is complete.
00237   *
00238   *        @note This function just configure the communication and enable the DMA
00239   *              channel to transfer data. Meanwhile, the user application may perform
00240   *              other tasks in parallel.
00241   *
00242   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00243   *         different from EEPROM_OK (0) or the timeout user callback.
00244   */
00245 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite)
00246 {
00247   uint32_t buffersize = *NumByteToWrite;
00248   uint32_t status = EEPROM_OK;
00249
00250   /* Set the pointer to the Number of data to be written. This pointer will be used
00251       by the DMA Transfer Completer interrupt Handler in order to reset the
00252       variable to 0. User should check on this variable in order to know if the
00253       DMA transfer has been complete or not. */
00254   EEPROMDataWrite = *NumByteToWrite;
00255
00256   if(EEPROM_IO_WriteData(EEPROMAddress, WriteAddr, pBuffer, buffersize) != HAL_OK)
00257   {
00258     BSP_EEPROM_TIMEOUT_UserCallback();
00259     status = EEPROM_FAIL;
00260   }
00261
00262   if(BSP_EEPROM_WaitEepromStandbyState() != EEPROM_OK)
00263   {
00264     return EEPROM_FAIL;
00265   }
00266
00267   /* If all operations OK, return EEPROM_OK (0) */
00268   return status;
00269 }
00270
00271 /**
00272   * @brief  Writes buffer of data to the I2C EEPROM.
00273   * @param  pBuffer: pointer to the buffer  containing the data to be written
00274   *         to the EEPROM.
00275   * @param  WriteAddr: EEPROM's internal address to write to.
00276   * @param  NumByteToWrite: number of bytes to write to the EEPROM.
00277   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00278   *         different from EEPROM_OK (0) or the timeout user callback.
00279   */
00280 uint32_t BSP_EEPROM_WriteBuffer(uint8_t *pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
00281 {
00282   uint16_t numofpage = 0, numofsingle = 0, count = 0;
00283   uint16_t addr = 0;
00284   uint8_t  dataindex = 0;
00285   uint32_t status = EEPROM_OK;
00286
00287   addr = WriteAddr % EEPROM_PAGESIZE;
00288   count = EEPROM_PAGESIZE - addr;
00289   numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00290   numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00291
00292   /* If WriteAddr is EEPROM_PAGESIZE aligned */
00293   if(addr == 0)
00294   {
00295     /* If NumByteToWrite < EEPROM_PAGESIZE */
00296     if(numofpage == 0)
00297     {
00298       /* Store the number of data to be written */
00299       dataindex = numofsingle;
00300       /* Start writing data */
00301       status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00302       if(status != EEPROM_OK)
00303       {
00304         return status;
00305       }
00306     }
00307     /* If NumByteToWrite > EEPROM_PAGESIZE */
00308     else
00309     {
00310       while(numofpage--)
00311       {
00312         /* Store the number of data to be written */
00313         dataindex = EEPROM_PAGESIZE;
00314         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00315         if(status != EEPROM_OK)
00316         {
00317           return status;
00318         }
00319
00320         WriteAddr +=  EEPROM_PAGESIZE;
00321         pBuffer += EEPROM_PAGESIZE;
00322       }
00323
00324       if(numofsingle!=0)
00325       {
00326         /* Store the number of data to be written */
00327         dataindex = numofsingle;
00328         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00329         if(status != EEPROM_OK)
00330         {
00331           return status;
00332         }
00333       }
00334     }
00335   }
00336   /* If WriteAddr is not EEPROM_PAGESIZE aligned */
00337   else
00338   {
00339     /* If NumByteToWrite < EEPROM_PAGESIZE */
00340     if(numofpage== 0)
00341     {
00342       /* If the number of data to be written is more than the remaining space
00343       in the current page: */
00344       if(NumByteToWrite > count)
00345       {
00346         /* Store the number of data to be written */
00347         dataindex = count;
00348         /* Write the data contained in same page */
00349         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00350         if(status != EEPROM_OK)
00351         {
00352           return status;
00353         }
00354
00355         /* Store the number of data to be written */
00356         dataindex = (NumByteToWrite - count);
00357         /* Write the remaining data in the following page */
00358         status = BSP_EEPROM_WritePage((uint8_t*)(pBuffer + count), (WriteAddr + count), (uint8_t*)(&dataindex));
00359         if(status != EEPROM_OK)
00360         {
00361           return status;
00362         }
00363       }
00364       else
00365       {
00366         /* Store the number of data to be written */
00367         dataindex = numofsingle;
00368         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00369         if(status != EEPROM_OK)
00370         {
00371           return status;
00372         }
00373       }
00374     }
00375     /* If NumByteToWrite > EEPROM_PAGESIZE */
00376     else
00377     {
00378       NumByteToWrite -= count;
00379       numofpage =  NumByteToWrite / EEPROM_PAGESIZE;
00380       numofsingle = NumByteToWrite % EEPROM_PAGESIZE;
00381
00382       if(count != 0)
00383       {
00384         /* Store the number of data to be written */
00385         dataindex = count;
00386         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00387         if(status != EEPROM_OK)
00388         {
00389           return status;
00390         }
00391         WriteAddr += count;
00392         pBuffer += count;
00393       }
00394
00395       while(numofpage--)
00396       {
00397         /* Store the number of data to be written */
00398         dataindex = EEPROM_PAGESIZE;
00399         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00400         if(status != EEPROM_OK)
00401         {
00402           return status;
00403         }
00404         WriteAddr +=  EEPROM_PAGESIZE;
00405         pBuffer += EEPROM_PAGESIZE;
00406       }
00407       if(numofsingle != 0)
00408       {
00409         /* Store the number of data to be written */
00410         dataindex = numofsingle;
00411         status = BSP_EEPROM_WritePage(pBuffer, WriteAddr, (uint8_t*)(&dataindex));
00412         if(status != EEPROM_OK)
00413         {
00414           return status;
00415         }
00416       }
00417     }
00418   }
00419
00420   /* If all operations OK, return EEPROM_OK (0) */
00421   return EEPROM_OK;
00422 }
00423
00424 /**
00425   * @brief  Wait for EEPROM Standby state.
00426   *
00427   * @note  This function allows to wait and check that EEPROM has finished the
00428   *        last operation. It is mostly used after Write operation: after receiving
00429   *        the buffer to be written, the EEPROM may need additional time to actually
00430   *        perform the write operation. During this time, it doesn't answer to
00431   *        I2C packets addressed to it. Once the write operation is complete
00432   *        the EEPROM responds to its address.
00433   *
00434   * @retval EEPROM_OK (0) if operation is correctly performed, else return value
00435   *         different from EEPROM_OK (0) or the timeout user callback.
00436   */
00437 uint32_t BSP_EEPROM_WaitEepromStandbyState(void)
00438 {
00439   /* Check if the maximum allowed number of trials has bee reached */
00440   if(EEPROM_IO_IsDeviceReady(EEPROMAddress, EEPROM_MAX_TRIALS) != HAL_OK)
00441   {
00442     /* If the maximum number of trials has been reached, exit the function */
00443     BSP_EEPROM_TIMEOUT_UserCallback();
00444     return EEPROM_TIMEOUT;
00445   }
00446   return EEPROM_OK;
00447 }
00448
00449 /**
00450   * @brief  Basic management of the timeout situation.
00451   * @retval None
00452   */
00453 __weak void BSP_EEPROM_TIMEOUT_UserCallback(void)
00454 {
00455 }
00456
00457 /**
00458   * @}
00459   */
00460
00461 /**
00462   * @}
00463   */
00464
00465 /**
00466   * @}
00467   */
00468
00469 /**
00470   * @}
00471   */
00472
00473 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains all the functions prototypes for
00008   *          the stm32756g_eval_eeprom.c firmware driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32F756G_EVAL_EEPROM_H
00041 #define __STM32F756G_EVAL_EEPROM_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32756g_eval.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32756G_EVAL
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL_EEPROM STM32756G_EVAL EEPROM
00059   * @brief This file includes the I2C EEPROM driver of STM32756G-EVAL evaluation board.
00060   * @{
00061   */
00062
00063 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Types EEPROM Exported Types
00064   * @{
00065   */
00066 /**
00067   * @}
00068   */
00069
00070 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Constants EEPROM Exported Constants
00071   * @{
00072   */
00073 /* EEPROM hardware address and page size */
00074 #define EEPROM_PAGESIZE             ((uint8_t)4)
00075 #define EEPROM_MAX_SIZE             ((uint16_t)0x2000) /* 64Kbit */
00076
00077
00078 /* Maximum number of trials for EEPROM_WaitEepromStandbyState() function */
00079 #define EEPROM_MAX_TRIALS           ((uint32_t)3000)
00080
00081 #define EEPROM_OK                   ((uint32_t)0)
00082 #define EEPROM_FAIL                 ((uint32_t)1)
00083 #define EEPROM_TIMEOUT              ((uint32_t)2)
00084 /**
00085   * @}
00086   */
00087
00088 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Macros EEPROM Exported Macros
00089   * @{
00090   */
00091 /**
00092   * @}
00093   */
00094
00095 /** @defgroup STM32756G_EVAL_EEPROM_Exported_Functions EEPROM Exported Functions
00096   * @{
00097   */
00098 uint32_t BSP_EEPROM_Init(void);
00099 uint8_t BSP_EEPROM_DeInit(void);
00100 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead);
00101 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite);
00102 uint32_t BSP_EEPROM_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
00103 uint32_t BSP_EEPROM_WaitEepromStandbyState(void);
00104
00105 /* USER Callbacks: This function is declared as __weak in EEPROM driver and
00106    should be implemented into user application.
00107    BSP_EEPROM_TIMEOUT_UserCallback() function is called whenever a timeout condition
00108    occurs during communication (waiting on an event that doesn't occur, bus
00109    errors, busy devices ...). */
00110 void     BSP_EEPROM_TIMEOUT_UserCallback(void);
00111
00112 /* Link function for I2C EEPROM peripheral */
00113 void              EEPROM_IO_Init(void);
00114 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00115 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00116 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
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_EEPROM_H */
00139
00140 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file provides a set of functions needed to manage the IO pins
00008   *          on STM32756G-EVAL and STM32746G-EVAL evaluation board.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the IO module of the STM32756G-EVAL evaluation
00013      board.
00014    - The MFXSTM32L152 IO expander device component driver must be included with this
00015      driver in order to run the IO functionalities commanded by the IO expander (MFX)
00016      device mounted on the evaluation board.
00017
00018   Driver description:
00019   -------------------
00020   + Initialization steps:
00021      o Initialize the IO module using the BSP_IO_Init() function. This
00022        function includes the MSP layer hardware resources initialization and the
00023        communication layer configuration to start the IO functionalities use.
00024
00025   + IO functionalities use
00026      o The IO pin mode is configured when calling the function BSP_IO_ConfigPin(), you
00027        must specify the desired IO mode by choosing the "IO_ModeTypedef" parameter
00028        predefined value.
00029      o If an IO pin is used in interrupt mode, the function BSP_IO_ITGetStatus() is
00030        needed to get the interrupt status. To clear the IT pending bits, you should
00031        call the function BSP_IO_ITClear() with specifying the IO pending bit to clear.
00032      o The IT is handled using the corresponding external interrupt IRQ handler,
00033        the user IT callback treatment is implemented on the same external interrupt
00034        callback.
00035      o The IRQ_OUT pin (common for all functionalities: JOY, SD, LEDs, etc)  can be
00036        configured using the function BSP_IO_ConfigIrqOutPin()
00037      o To get/set an IO pin combination state you can use the functions
00038        BSP_IO_ReadPin()/BSP_IO_WritePin() or the function BSP_IO_TogglePin() to toggle the pin
00039        state.
00040   @endverbatim
00041   ******************************************************************************
00042   * @attention
00043   *
00044   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00045   *
00046   * Redistribution and use in source and binary forms, with or without modification,
00047   * are permitted provided that the following conditions are met:
00048   *   1. Redistributions of source code must retain the above copyright notice,
00049   *      this list of conditions and the following disclaimer.
00050   *   2. Redistributions in binary form must reproduce the above copyright notice,
00051   *      this list of conditions and the following disclaimer in the documentation
00052   *      and/or other materials provided with the distribution.
00053   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00054   *      may be used to endorse or promote products derived from this software
00055   *      without specific prior written permission.
00056   *
00057   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00058   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00059   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00060   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00061   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00062   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00063   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00064   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00065   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00066   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00067   *
00068   ******************************************************************************
00069   */
00070
00071 /* Includes ------------------------------------------------------------------*/
00072 #include "stm32756g_eval_io.h"
00073
00074 /** @addtogroup BSP
00075   * @{
00076   */
00077
00078 /** @addtogroup STM32756G_EVAL
00079   * @{
00080   */
00081
00082 /** @defgroup STM32756G_EVAL_IO STM32756G_EVAL IO
00083   * @{
00084   */
00085
00086 /** @defgroup STM32756G_EVAL_IO_Private_Types_Definitions IO Private Types Definitions
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092
00093 /** @defgroup STM32756G_EVAL_IO_Private_Defines IO Private Defines
00094   * @{
00095   */
00096 /**
00097   * @}
00098   */
00099
00100 /** @defgroup STM32756G_EVAL_IO_Private_Macros IO Private Macros
00101   * @{
00102   */
00103 /**
00104   * @}
00105   */
00106
00107 /** @defgroup STM32756G_EVAL_IO_Private_Variables IO Private Variables
00108   * @{
00109   */
00110 static IO_DrvTypeDef *IoDrv = NULL;
00111 static uint8_t mfxstm32l152Identifier;
00112
00113 /**
00114   * @}
00115   */
00116
00117 /** @defgroup STM32756G_EVAL_IO_Private_Functions_Prototypes IO Private Functions Prototypes
00118   * @{
00119   */
00120 /**
00121   * @}
00122   */
00123
00124 /** @defgroup STM32756G_EVAL_IO_Private_Functions IO Private Functions
00125   * @{
00126   */
00127
00128 /**
00129   * @brief  Initializes and configures the IO functionalities and configures all
00130   *         necessary hardware resources (MFX, ...).
00131   * @note   BSP_IO_Init() is using HAL_Delay() function to ensure that MFXSTM32L152
00132   *         IO Expander is correctly reset. HAL_Delay() function provides accurate
00133   *         delay (in milliseconds) based on variable incremented in SysTick ISR.
00134   *         This implies that if BSP_IO_Init() is called from a peripheral ISR process,
00135   *         then the SysTick interrupt must have higher priority (numerically lower)
00136   *         than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
00137   * @retval IO_OK if all initializations are OK. Other value if error.
00138   */
00139 uint8_t BSP_IO_Init(void)
00140 {
00141   uint8_t ret = IO_OK;
00142
00143   if (IoDrv == NULL)  /* Checks if MFX initialization never done */
00144   {
00145     /* Read ID and verify the MFX is ready */
00146     mfxstm32l152Identifier = mfxstm32l152_io_drv.ReadID(IO_I2C_ADDRESS);
00147     if((mfxstm32l152Identifier == MFXSTM32L152_ID_1) || (mfxstm32l152Identifier == MFXSTM32L152_ID_2))
00148     {
00149       /* Initialize the IO driver structure */
00150       IoDrv = &mfxstm32l152_io_drv;
00151
00152       /* Initialize MFX */
00153       IoDrv->Init(IO_I2C_ADDRESS);
00154       IoDrv->Start(IO_I2C_ADDRESS, IO_PIN_ALL);
00155     }
00156     else
00157     {
00158       ret = IO_ERROR;
00159     }
00160   }
00161   else
00162   {
00163     /* MFX initialization already done : do nothing */
00164   }
00165
00166   return ret;
00167 }
00168
00169 /**
00170   * @brief  DeInit allows Mfx Initialization to be executed again
00171   * @note   BSP_IO_Init() has no effect if the IoDrv is already initialized
00172   *         BSP_IO_DeInit() allows to erase the pointer such to allow init to be effective
00173   * @retval IO_OK
00174   */
00175 uint8_t BSP_IO_DeInit(void)
00176 {
00177   IoDrv = NULL;
00178   return IO_OK;
00179 }
00180
00181 /**
00182   * @brief  Gets the selected pins IT status.
00183   * @param  IoPin: Selected pins to check the status.
00184   *          This parameter can be any combination of the IO pins.
00185   * @retval IO_OK if read status OK. Other value if error.
00186   */
00187 uint32_t BSP_IO_ITGetStatus(uint32_t IoPin)
00188 {
00189   /* Return the IO Pin IT status */
00190   return (IoDrv->ITStatus(IO_I2C_ADDRESS, IoPin));
00191 }
00192
00193 /**
00194   * @brief  Clears all the IO IT pending bits.
00195   * @retval None
00196   */
00197 void BSP_IO_ITClear(void)
00198 {
00199   /* Clear all IO IT pending bits */
00200   IoDrv->ClearIT(IO_I2C_ADDRESS, MFXSTM32L152_GPIO_PINS_ALL);
00201 }
00202
00203 /**
00204   * @brief  Configures the IO pin(s) according to IO mode structure value.
00205   * @param  IoPin: IO pin(s) to be configured.
00206   *          This parameter can be one of the following values:
00207   *            @arg  MFXSTM32L152_GPIO_PIN_x: where x can be from 0 to 23.
00208   * @param  IoMode: IO pin mode to configure
00209   *          This parameter can be one of the following values:
00210   *            @arg  IO_MODE_INPUT
00211   *            @arg  IO_MODE_OUTPUT
00212   *            @arg  IO_MODE_IT_RISING_EDGE
00213   *            @arg  IO_MODE_IT_FALLING_EDGE
00214   *            @arg  IO_MODE_IT_LOW_LEVEL
00215   *            @arg  IO_MODE_IT_HIGH_LEVEL
00216   *            @arg  IO_MODE_ANALOG
00217   *            @arg  IO_MODE_OFF
00218   *            @arg  IO_MODE_INPUT_PU,
00219   *            @arg  IO_MODE_INPUT_PD,
00220   *            @arg  IO_MODE_OUTPUT_OD,
00221   *            @arg  IO_MODE_OUTPUT_OD_PU,
00222   *            @arg  IO_MODE_OUTPUT_OD_PD,
00223   *            @arg  IO_MODE_OUTPUT_PP,
00224   *            @arg  IO_MODE_OUTPUT_PP_PU,
00225   *            @arg  IO_MODE_OUTPUT_PP_PD,
00226   *            @arg  IO_MODE_IT_RISING_EDGE_PU
00227   *            @arg  IO_MODE_IT_FALLING_EDGE_PU
00228   *            @arg  IO_MODE_IT_LOW_LEVEL_PU
00229   *            @arg  IO_MODE_IT_HIGH_LEVEL_PU
00230   *            @arg  IO_MODE_IT_RISING_EDGE_PD
00231   *            @arg  IO_MODE_IT_FALLING_EDGE_PD
00232   *            @arg  IO_MODE_IT_LOW_LEVEL_PD
00233   *            @arg  IO_MODE_IT_HIGH_LEVEL_PD
00234   * @retval IO_OK if all initializations are OK. Other value if error.
00235   */
00236 uint8_t BSP_IO_ConfigPin(uint32_t IoPin, IO_ModeTypedef IoMode)
00237 {
00238   /* Configure the selected IO pin(s) mode */
00239   IoDrv->Config(IO_I2C_ADDRESS, IoPin, IoMode);
00240
00241   return IO_OK;
00242 }
00243
00244 /**
00245   * @brief  Sets the IRQ_OUT pin polarity and type
00246   * @param  IoIrqOutPinPolarity: High/Low
00247   * @param  IoIrqOutPinType:     OpenDrain/PushPull
00248   * @retval OK
00249   */
00250 uint8_t BSP_IO_ConfigIrqOutPin(uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType)
00251 {
00252   if((mfxstm32l152Identifier == MFXSTM32L152_ID_1) || (mfxstm32l152Identifier == MFXSTM32L152_ID_2))
00253   {
00254     /* Initialize the IO driver structure */
00255     mfxstm32l152_SetIrqOutPinPolarity(IO_I2C_ADDRESS, IoIrqOutPinPolarity);
00256     mfxstm32l152_SetIrqOutPinType(IO_I2C_ADDRESS, IoIrqOutPinType);
00257   }
00258
00259   return IO_OK;
00260 }
00261
00262 /**
00263   * @brief  Sets the selected pins state.
00264   * @param  IoPin: Selected pins to write.
00265   *          This parameter can be any combination of the IO pins.
00266   * @param  PinState: New pins state to write
00267   * @retval None
00268   */
00269 void BSP_IO_WritePin(uint32_t IoPin, BSP_IO_PinStateTypeDef PinState)
00270 {
00271   /* Set the Pin state */
00272   IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, PinState);
00273 }
00274
00275 /**
00276   * @brief  Gets the selected pins current state.
00277   * @param  IoPin: Selected pins to read.
00278   *          This parameter can be any combination of the IO pins.
00279   * @retval The current pins state
00280   */
00281 uint32_t BSP_IO_ReadPin(uint32_t IoPin)
00282 {
00283  return(IoDrv->ReadPin(IO_I2C_ADDRESS, IoPin));
00284 }
00285
00286 /**
00287   * @brief  Toggles the selected pins state.
00288   * @param  IoPin: Selected pins to toggle.
00289   *          This parameter can be any combination of the IO pins.
00290   * @note   This function is only used to toggle one pin in the same time
00291   * @retval None
00292   */
00293 void BSP_IO_TogglePin(uint32_t IoPin)
00294 {
00295   /* Toggle the current pin state */
00296   if(IoDrv->ReadPin(IO_I2C_ADDRESS, IoPin) != 0) /* Set */
00297   {
00298     IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, 0); /* Reset */
00299   }
00300   else
00301   {
00302     IoDrv->WritePin(IO_I2C_ADDRESS, IoPin, 1); /* Set */
00303   }
00304 }
00305
00306 /**
00307   * @}
00308   */
00309
00310 /**
00311   * @}
00312   */
00313
00314 /**
00315   * @}
00316   */
00317
00318 /**
00319   * @}
00320   */
00321
00322 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_io.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_IO_H
00041 #define __STM32756G_EVAL_IO_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32756g_eval.h"
00049 /* Include IO component driver */
00050 #include "../Components/mfxstm32l152/mfxstm32l152.h"
00051
00052 /** @addtogroup BSP
00053   * @{
00054   */
00055
00056 /** @addtogroup STM32756G_EVAL
00057   * @{
00058   */
00059
00060 /** @addtogroup STM32756G_EVAL_IO
00061   * @{
00062   */
00063
00064 /** @defgroup STM32756G_EVAL_IO_Exported_Types IO Exported Types
00065   * @{
00066   */
00067
00068 typedef enum
00069 {
00070   BSP_IO_PIN_RESET = 0,
00071   BSP_IO_PIN_SET   = 1
00072 }BSP_IO_PinStateTypeDef;
00073
00074 typedef enum
00075 {
00076   IO_OK       = 0,
00077   IO_ERROR    = 1,
00078   IO_TIMEOUT  = 2
00079 }IO_StatusTypeDef;
00080 /**
00081   * @}
00082   */
00083
00084 /** @defgroup STM32756G_EVAL_IO_Exported_Constants IO Exported Constants
00085   * @{
00086   */
00087 #define IO_PIN_0                  ((uint32_t)0x0001)
00088 #define IO_PIN_1                  ((uint32_t)0x0002)
00089 #define IO_PIN_2                  ((uint32_t)0x0004)
00090 #define IO_PIN_3                  ((uint32_t)0x0008)
00091 #define IO_PIN_4                  ((uint32_t)0x0010)
00092 #define IO_PIN_5                  ((uint32_t)0x0020)
00093 #define IO_PIN_6                  ((uint32_t)0x0040)
00094 #define IO_PIN_7                  ((uint32_t)0x0080)
00095 #define IO_PIN_8                  ((uint32_t)0x0100)
00096 #define IO_PIN_9                  ((uint32_t)0x0200)
00097 #define IO_PIN_10                 ((uint32_t)0x0400)
00098 #define IO_PIN_11                 ((uint32_t)0x0800)
00099 #define IO_PIN_12                 ((uint32_t)0x1000)
00100 #define IO_PIN_13                 ((uint32_t)0x2000)
00101 #define IO_PIN_14                 ((uint32_t)0x4000)
00102 #define IO_PIN_15                 ((uint32_t)0x8000)
00103 #define IO_PIN_16               ((uint32_t)0x010000)
00104 #define IO_PIN_17               ((uint32_t)0x020000)
00105 #define IO_PIN_18               ((uint32_t)0x040000)
00106 #define IO_PIN_19               ((uint32_t)0x080000)
00107 #define IO_PIN_20               ((uint32_t)0x100000)
00108 #define IO_PIN_21               ((uint32_t)0x200000)
00109 #define IO_PIN_22               ((uint32_t)0x400000)
00110 #define IO_PIN_23               ((uint32_t)0x800000)
00111 #define IO_PIN_ALL              ((uint32_t)0xFFFFFF)
00112 /**
00113   * @}
00114   */
00115
00116 /** @defgroup STM32756G_EVAL_IO_Exported_Macro IO Exported Macro
00117   * @{
00118   */
00119 /**
00120   * @}
00121   */
00122
00123 /** @defgroup STM32756G_EVAL_IO_Exported_Functions IO Exported Functions
00124   * @{
00125   */
00126 uint8_t  BSP_IO_Init(void);
00127 uint8_t  BSP_IO_DeInit(void);
00128 uint8_t  BSP_IO_ConfigIrqOutPin(uint8_t IoIrqOutPinPolarity, uint8_t IoIrqOutPinType);
00129 uint32_t BSP_IO_ITGetStatus(uint32_t IoPin);
00130 void     BSP_IO_ITClear(void);
00131 uint8_t  BSP_IO_ConfigPin(uint32_t IoPin, IO_ModeTypedef IoMode);
00132 void     BSP_IO_WritePin(uint32_t IoPin, BSP_IO_PinStateTypeDef PinState);
00133 uint32_t BSP_IO_ReadPin(uint32_t IoPin);
00134 void     BSP_IO_TogglePin(uint32_t IoPin);
00135
00136 /**
00137   * @}
00138   */
00139
00140 /**
00141   * @}
00142   */
00143
00144 /**
00145   * @}
00146   */
00147
00148 /**
00149   * @}
00150   */
00151
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155
00156 #endif /* __STM32756G_EVAL_IO_H */
00157
00158 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00008   *          mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive directly an LCD TFT using the LTDC controller.
00013    - This driver selects dynamically the mounted LCD, AMPIRE 640x480 LCD mounted
00014      on MB1063 or AMPIRE 480x272 LCD mounted on MB1046 daughter board,
00015      and uses the adequate timing and setting for the specified LCD using
00016      device ID of the STMPE811 mounted on MB1046 daughter board.
00017
00018   Driver description:
00019   ------------------
00020   + Initialization steps:
00021      o Initialize the LCD using the BSP_LCD_Init() function.
00022      o Apply the Layer configuration using the BSP_LCD_LayerDefaultInit() function.
00023      o Select the LCD layer to be used using the BSP_LCD_SelectLayer() function.
00024      o Enable the LCD display using the BSP_LCD_DisplayOn() function.
00025
00026   + Options
00027      o Configure and enable the colour keying functionality using the
00028        BSP_LCD_SetColorKeying() function.
00029      o Modify in the fly the transparency and/or the frame buffer address
00030        using the following functions:
00031        - BSP_LCD_SetTransparency()
00032        - BSP_LCD_SetLayerAddress()
00033
00034   + Display on LCD
00035      o Clear the whole LCD using BSP_LCD_Clear() function or only one specified string
00036        line using the BSP_LCD_ClearStringLine() function.
00037      o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
00038        function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
00039      o Display a string line on the specified position (x,y in pixel) and align mode
00040        using the BSP_LCD_DisplayStringAtLine() function.
00041      o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00042        on LCD using the available set of functions.
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 /* Includes ------------------------------------------------------------------*/
00075 #include "stm32756g_eval_lcd.h"
00076 #include "../../../Utilities/Fonts/fonts.h"
00077 #include "../../../Utilities/Fonts/font24.c"
00078 #include "../../../Utilities/Fonts/font20.c"
00079 #include "../../../Utilities/Fonts/font16.c"
00080 #include "../../../Utilities/Fonts/font12.c"
00081 #include "../../../Utilities/Fonts/font8.c"
00082
00083 /** @addtogroup BSP
00084   * @{
00085   */
00086
00087 /** @addtogroup STM32756G_EVAL
00088   * @{
00089   */
00090
00091 /** @defgroup STM32756G_EVAL_LCD STM32756G_EVAL LCD
00092   * @{
00093   */
00094
00095 /** @defgroup STM32756G_EVAL_LCD_Private_TypesDefinitions LCD Private TypesDefinitions
00096   * @{
00097   */
00098 /**
00099   * @}
00100   */
00101
00102 /** @defgroup STM32756G_EVAL_LCD_Private_Defines LCD Private Defines
00103   * @{
00104   */
00105 #define POLY_X(Z)              ((int32_t)((Points + Z)->X))
00106 #define POLY_Y(Z)              ((int32_t)((Points + Z)->Y))
00107 /**
00108   * @}
00109   */
00110
00111 /** @defgroup STM32756G_EVAL_LCD_Private_Macros LCD Private Macros
00112   * @{
00113   */
00114 #define ABS(X)  ((X) > 0 ? (X) : -(X))
00115 /**
00116   * @}
00117   */
00118
00119 /** @defgroup STM32756G_EVAL_LCD_Private_Variables LCD Private Variables
00120   * @{
00121   */
00122 LTDC_HandleTypeDef  hLtdcEval;
00123 static DMA2D_HandleTypeDef hDma2dEval;
00124 static uint32_t            PCLK_profile = LCD_MAX_PCLK;
00125 /* Default LCD configuration with LCD Layer 1 */
00126 static uint32_t            ActiveLayer = 0;
00127 static LCD_DrawPropTypeDef DrawProp[MAX_LAYER_NUMBER];
00128 /**
00129   * @}
00130   */
00131
00132 /** @defgroup STM32756G_EVAL_LCD_Private_FunctionPrototypes LCD Private FunctionPrototypes
00133   * @{
00134   */
00135 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c);
00136 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3);
00137 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex);
00138 static void LL_ConvertLineToARGB8888(void * pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode);
00139 /**
00140   * @}
00141   */
00142
00143 /** @defgroup STM32756G_EVAL_LCD_Private_Functions LCD Private Functions
00144   * @{
00145   */
00146
00147 /**
00148   * @brief  Initializes the LCD.
00149   * @retval LCD state
00150   */
00151 uint8_t BSP_LCD_Init(void)
00152 {
00153   return (BSP_LCD_InitEx(LCD_MAX_PCLK));
00154 }
00155
00156 /**
00157   * @brief  Initializes the LCD.
00158   * @param  PclkConfig : pixel clock profile
00159   * @retval LCD state
00160   */
00161 uint8_t BSP_LCD_InitEx(uint32_t PclkConfig)
00162 {
00163   PCLK_profile = PclkConfig;
00164   /* Select the used LCD */
00165   /* The AMPIRE 480x272 does not contain an ID register then we check the availability
00166   of AMPIRE 480x640 LCD using device ID of the STMPE811 mounted on MB1046 daughter board */
00167   if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
00168   {
00169     /* The AMPIRE LCD 480x272 is selected */
00170     /* Timing Configuration */
00171     hLtdcEval.Init.HorizontalSync = (AMPIRE480272_HSYNC - 1);
00172     hLtdcEval.Init.VerticalSync = (AMPIRE480272_VSYNC - 1);
00173     hLtdcEval.Init.AccumulatedHBP = (AMPIRE480272_HSYNC + AMPIRE480272_HBP - 1);
00174     hLtdcEval.Init.AccumulatedVBP = (AMPIRE480272_VSYNC + AMPIRE480272_VBP - 1);
00175     hLtdcEval.Init.AccumulatedActiveH = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE480272_VBP - 1);
00176     hLtdcEval.Init.AccumulatedActiveW = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE480272_HBP - 1);
00177     hLtdcEval.Init.TotalHeigh = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE480272_VBP + AMPIRE480272_VFP - 1);
00178     hLtdcEval.Init.TotalWidth = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE480272_HBP + AMPIRE480272_HFP - 1);
00179
00180     /* Initialize the LCD pixel width and pixel height */
00181     hLtdcEval.LayerCfg->ImageWidth  = AMPIRE480272_WIDTH;
00182     hLtdcEval.LayerCfg->ImageHeight = AMPIRE480272_HEIGHT;
00183   }
00184   else
00185   {
00186     /* The LCD AMPIRE 640x480 is selected */
00187     /* Timing configuration */
00188     hLtdcEval.Init.HorizontalSync = (AMPIRE640480_HSYNC - 1);
00189     hLtdcEval.Init.VerticalSync = (AMPIRE640480_VSYNC - 1);
00190     hLtdcEval.Init.AccumulatedHBP = (AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1);
00191     hLtdcEval.Init.AccumulatedVBP = (AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1);
00192     hLtdcEval.Init.AccumulatedActiveH = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1);
00193     hLtdcEval.Init.AccumulatedActiveW = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1);
00194     hLtdcEval.Init.TotalHeigh = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP + AMPIRE640480_VFP - 1);
00195     hLtdcEval.Init.TotalWidth = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP + AMPIRE640480_HFP - 1);
00196
00197     /* Initialize the LCD pixel width and pixel height */
00198     hLtdcEval.LayerCfg->ImageWidth  = AMPIRE640480_WIDTH;
00199     hLtdcEval.LayerCfg->ImageHeight = AMPIRE640480_HEIGHT;
00200   }
00201
00202   /* Background value */
00203   hLtdcEval.Init.Backcolor.Blue = 0;
00204   hLtdcEval.Init.Backcolor.Green = 0;
00205   hLtdcEval.Init.Backcolor.Red = 0;
00206
00207   /* Polarity */
00208   hLtdcEval.Init.HSPolarity = LTDC_HSPOLARITY_AL;
00209   hLtdcEval.Init.VSPolarity = LTDC_VSPOLARITY_AL;
00210   hLtdcEval.Init.DEPolarity = LTDC_DEPOLARITY_AL;
00211   hLtdcEval.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00212   hLtdcEval.Instance = LTDC;
00213
00214   /* LCD clock configuration */
00215   BSP_LCD_ClockConfig(&hLtdcEval, &PCLK_profile);
00216
00217   if(HAL_LTDC_GetState(&hLtdcEval) == HAL_LTDC_STATE_RESET)
00218   {
00219     /* Initialize the LCD Msp: this __weak function can be rewritten by the application */
00220     BSP_LCD_MspInit(&hLtdcEval, NULL);
00221   }
00222   HAL_LTDC_Init(&hLtdcEval);
00223
00224 #if !defined(DATA_IN_ExtSDRAM)
00225   /* When DATA_IN_ExtSDRAM define is enabled, the SDRAM will be configured in SystemInit()
00226   function (from system_stm32f7xx.c) before branch to main() routine. In such case, there
00227   is no need to reconfigure the SDRAM within the LCD driver, since it's already initialized.
00228   Otherwise the SDRAM must be configured. */
00229   BSP_SDRAM_Init();
00230 #endif
00231
00232   /* Initialize the font */
00233   BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00234
00235   return LCD_OK;
00236 }
00237
00238 /**
00239   * @brief  DeInitializes the LCD.
00240   * @retval LCD state
00241   */
00242 uint8_t BSP_LCD_DeInit(void)
00243 {
00244   /* Initialize the hltdc_eval Instance parameter */
00245   hLtdcEval.Instance = LTDC;
00246
00247  /* Disable LTDC block */
00248   __HAL_LTDC_DISABLE(&hLtdcEval);
00249
00250   /* DeInit the LTDC */
00251   HAL_LTDC_DeInit(&hLtdcEval);
00252
00253   /* DeInit the LTDC MSP : this __weak function can be rewritten by the application */
00254   BSP_LCD_MspDeInit(&hLtdcEval, NULL);
00255
00256   return LCD_OK;
00257 }
00258
00259 /**
00260   * @brief  Gets the LCD X size.
00261   * @retval Used LCD X size
00262   */
00263 uint32_t BSP_LCD_GetXSize(void)
00264 {
00265   return hLtdcEval.LayerCfg[ActiveLayer].ImageWidth;
00266 }
00267
00268 /**
00269   * @brief  Gets the LCD Y size.
00270   * @retval Used LCD Y size
00271   */
00272 uint32_t BSP_LCD_GetYSize(void)
00273 {
00274   return hLtdcEval.LayerCfg[ActiveLayer].ImageHeight;
00275 }
00276
00277 /**
00278   * @brief  Set the LCD X size.
00279   * @param  imageWidthPixels : image width in pixels unit
00280   * @retval None
00281   */
00282 void BSP_LCD_SetXSize(uint32_t imageWidthPixels)
00283 {
00284   hLtdcEval.LayerCfg[ActiveLayer].ImageWidth = imageWidthPixels;
00285 }
00286
00287 /**
00288   * @brief  Set the LCD Y size.
00289   * @param  imageHeightPixels : image height in lines unit
00290   * @retval None
00291   */
00292 void BSP_LCD_SetYSize(uint32_t imageHeightPixels)
00293 {
00294   hLtdcEval.LayerCfg[ActiveLayer].ImageHeight = imageHeightPixels;
00295 }
00296
00297 /**
00298   * @brief  Initializes the LCD layers.
00299   * @param  LayerIndex: Layer foreground or background
00300   * @param  FB_Address: Layer frame buffer
00301   * @retval None
00302   */
00303 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
00304 {
00305   LCD_LayerCfgTypeDef  layer_cfg;
00306
00307   /* Layer Init */
00308   layer_cfg.WindowX0 = 0;
00309   layer_cfg.WindowX1 = BSP_LCD_GetXSize();
00310   layer_cfg.WindowY0 = 0;
00311   layer_cfg.WindowY1 = BSP_LCD_GetYSize();
00312   layer_cfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
00313   layer_cfg.FBStartAdress = FB_Address;
00314   layer_cfg.Alpha = 255;
00315   layer_cfg.Alpha0 = 0;
00316   layer_cfg.Backcolor.Blue = 0;
00317   layer_cfg.Backcolor.Green = 0;
00318   layer_cfg.Backcolor.Red = 0;
00319   layer_cfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00320   layer_cfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00321   layer_cfg.ImageWidth = BSP_LCD_GetXSize();
00322   layer_cfg.ImageHeight = BSP_LCD_GetYSize();
00323
00324   HAL_LTDC_ConfigLayer(&hLtdcEval, &layer_cfg, LayerIndex);
00325
00326   DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE;
00327   DrawProp[LayerIndex].pFont     = &Font24;
00328   DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK;
00329 }
00330
00331 /**
00332   * @brief  Selects the LCD Layer.
00333   * @param  LayerIndex: Layer foreground or background
00334   * @retval None
00335   */
00336 void BSP_LCD_SelectLayer(uint32_t LayerIndex)
00337 {
00338   ActiveLayer = LayerIndex;
00339 }
00340
00341 /**
00342   * @brief  Sets an LCD Layer visible
00343   * @param  LayerIndex: Visible Layer
00344   * @param  State: New state of the specified layer
00345   *          This parameter can be one of the following values:
00346   *            @arg  ENABLE
00347   *            @arg  DISABLE
00348   * @retval None
00349   */
00350 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State)
00351 {
00352   if(State == ENABLE)
00353   {
00354     __HAL_LTDC_LAYER_ENABLE(&hLtdcEval, LayerIndex);
00355   }
00356   else
00357   {
00358     __HAL_LTDC_LAYER_DISABLE(&hLtdcEval, LayerIndex);
00359   }
00360   __HAL_LTDC_RELOAD_CONFIG(&hLtdcEval);
00361 }
00362
00363 /**
00364   * @brief  Sets an LCD Layer visible without reloading.
00365   * @param  LayerIndex: Visible Layer
00366   * @param  State: New state of the specified layer
00367   *          This parameter can be one of the following values:
00368   *            @arg  ENABLE
00369   *            @arg  DISABLE
00370   * @retval None
00371   */
00372 void BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State)
00373 {
00374   if(State == ENABLE)
00375   {
00376     __HAL_LTDC_LAYER_ENABLE(&hLtdcEval, LayerIndex);
00377   }
00378   else
00379   {
00380     __HAL_LTDC_LAYER_DISABLE(&hLtdcEval, LayerIndex);
00381   }
00382   /* Do not Sets the Reload  */
00383 }
00384
00385 /**
00386   * @brief  Configures the transparency.
00387   * @param  LayerIndex: Layer foreground or background.
00388   * @param  Transparency: Transparency
00389   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00390   * @retval None
00391   */
00392 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency)
00393 {
00394   HAL_LTDC_SetAlpha(&hLtdcEval, Transparency, LayerIndex);
00395 }
00396
00397 /**
00398   * @brief  Configures the transparency without reloading.
00399   * @param  LayerIndex: Layer foreground or background.
00400   * @param  Transparency: Transparency
00401   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00402   * @retval None
00403   */
00404 void BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency)
00405 {
00406   HAL_LTDC_SetAlpha_NoReload(&hLtdcEval, Transparency, LayerIndex);
00407 }
00408
00409 /**
00410   * @brief  Sets an LCD layer frame buffer address.
00411   * @param  LayerIndex: Layer foreground or background
00412   * @param  Address: New LCD frame buffer value
00413   * @retval None
00414   */
00415 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address)
00416 {
00417   HAL_LTDC_SetAddress(&hLtdcEval, Address, LayerIndex);
00418 }
00419
00420 /**
00421   * @brief  Sets an LCD layer frame buffer address without reloading.
00422   * @param  LayerIndex: Layer foreground or background
00423   * @param  Address: New LCD frame buffer value
00424   * @retval None
00425   */
00426 void BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address)
00427 {
00428   HAL_LTDC_SetAddress_NoReload(&hLtdcEval, Address, LayerIndex);
00429 }
00430
00431 /**
00432   * @brief  Sets display window.
00433   * @param  LayerIndex: Layer index
00434   * @param  Xpos: LCD X position
00435   * @param  Ypos: LCD Y position
00436   * @param  Width: LCD window width
00437   * @param  Height: LCD window height
00438   * @retval None
00439   */
00440 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00441 {
00442   /* Reconfigure the layer size */
00443   HAL_LTDC_SetWindowSize(&hLtdcEval, Width, Height, LayerIndex);
00444
00445   /* Reconfigure the layer position */
00446   HAL_LTDC_SetWindowPosition(&hLtdcEval, Xpos, Ypos, LayerIndex);
00447 }
00448
00449 /**
00450   * @brief  Sets display window without reloading.
00451   * @param  LayerIndex: Layer index
00452   * @param  Xpos: LCD X position
00453   * @param  Ypos: LCD Y position
00454   * @param  Width: LCD window width
00455   * @param  Height: LCD window height
00456   * @retval None
00457   */
00458 void BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00459 {
00460   /* Reconfigure the layer size */
00461   HAL_LTDC_SetWindowSize_NoReload(&hLtdcEval, Width, Height, LayerIndex);
00462
00463   /* Reconfigure the layer position */
00464   HAL_LTDC_SetWindowPosition_NoReload(&hLtdcEval, Xpos, Ypos, LayerIndex);
00465 }
00466
00467 /**
00468   * @brief  Configures and sets the color keying.
00469   * @param  LayerIndex: Layer foreground or background
00470   * @param  RGBValue: Color reference
00471   * @retval None
00472   */
00473 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue)
00474 {
00475   /* Configure and Enable the color Keying for LCD Layer */
00476   HAL_LTDC_ConfigColorKeying(&hLtdcEval, RGBValue, LayerIndex);
00477   HAL_LTDC_EnableColorKeying(&hLtdcEval, LayerIndex);
00478 }
00479
00480 /**
00481   * @brief  Configures and sets the color keying without reloading.
00482   * @param  LayerIndex: Layer foreground or background
00483   * @param  RGBValue: Color reference
00484   * @retval None
00485   */
00486 void BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue)
00487 {
00488   /* Configure and Enable the color Keying for LCD Layer */
00489   HAL_LTDC_ConfigColorKeying_NoReload(&hLtdcEval, RGBValue, LayerIndex);
00490   HAL_LTDC_EnableColorKeying_NoReload(&hLtdcEval, LayerIndex);
00491 }
00492
00493 /**
00494   * @brief  Disables the color keying.
00495   * @param  LayerIndex: Layer foreground or background
00496   * @retval None
00497   */
00498 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex)
00499 {
00500   /* Disable the color Keying for LCD Layer */
00501   HAL_LTDC_DisableColorKeying(&hLtdcEval, LayerIndex);
00502 }
00503
00504 /**
00505   * @brief  Disables the color keying without reloading.
00506   * @param  LayerIndex: Layer foreground or background
00507   * @retval None
00508   */
00509 void BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex)
00510 {
00511   /* Disable the color Keying for LCD Layer */
00512   HAL_LTDC_DisableColorKeying_NoReload(&hLtdcEval, LayerIndex);
00513 }
00514
00515 /**
00516   * @brief  Disables the color keying without reloading.
00517   * @param  ReloadType: can be one of the following values
00518   *         - LCD_RELOAD_IMMEDIATE
00519   *         - LCD_RELOAD_VERTICAL_BLANKING
00520   * @retval None
00521   */
00522 void BSP_LCD_Relaod(uint32_t ReloadType)
00523 {
00524   HAL_LTDC_Reload (&hLtdcEval, ReloadType);
00525 }
00526
00527 /**
00528   * @brief  Sets the LCD text color.
00529   * @param  Color: Text color code ARGB(8-8-8-8)
00530   * @retval None
00531   */
00532 void BSP_LCD_SetTextColor(uint32_t Color)
00533 {
00534   DrawProp[ActiveLayer].TextColor = Color;
00535 }
00536
00537 /**
00538   * @brief  Gets the LCD text color.
00539   * @retval Used text color.
00540   */
00541 uint32_t BSP_LCD_GetTextColor(void)
00542 {
00543   return DrawProp[ActiveLayer].TextColor;
00544 }
00545
00546 /**
00547   * @brief  Sets the LCD background color.
00548   * @param  Color: Layer background color code ARGB(8-8-8-8)
00549   * @retval None
00550   */
00551 void BSP_LCD_SetBackColor(uint32_t Color)
00552 {
00553   DrawProp[ActiveLayer].BackColor = Color;
00554 }
00555
00556 /**
00557   * @brief  Gets the LCD background color.
00558   * @retval Used background color
00559   */
00560 uint32_t BSP_LCD_GetBackColor(void)
00561 {
00562   return DrawProp[ActiveLayer].BackColor;
00563 }
00564
00565 /**
00566   * @brief  Sets the LCD text font.
00567   * @param  fonts: Layer font to be used
00568   * @retval None
00569   */
00570 void BSP_LCD_SetFont(sFONT *fonts)
00571 {
00572   DrawProp[ActiveLayer].pFont = fonts;
00573 }
00574
00575 /**
00576   * @brief  Gets the LCD text font.
00577   * @retval Used layer font
00578   */
00579 sFONT *BSP_LCD_GetFont(void)
00580 {
00581   return DrawProp[ActiveLayer].pFont;
00582 }
00583
00584 /**
00585   * @brief  Reads an LCD pixel.
00586   * @param  Xpos: X position
00587   * @param  Ypos: Y position
00588   * @retval RGB pixel color
00589   */
00590 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
00591 {
00592   uint32_t ret = 0;
00593
00594   if(hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
00595   {
00596     /* Read data value from SDRAM memory */
00597     ret = *(__IO uint32_t*) (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00598   }
00599   else if(hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888)
00600   {
00601     /* Read data value from SDRAM memory */
00602     ret = (*(__IO uint32_t*) (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF);
00603   }
00604   else if((hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
00605           (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
00606           (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_AL88))
00607   {
00608     /* Read data value from SDRAM memory */
00609     ret = *(__IO uint16_t*) (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00610   }
00611   else
00612   {
00613     /* Read data value from SDRAM memory */
00614     ret = *(__IO uint8_t*) (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00615   }
00616
00617   return ret;
00618 }
00619
00620 /**
00621   * @brief  Clears the hole LCD.
00622   * @param  Color: Color of the background
00623   * @retval None
00624   */
00625 void BSP_LCD_Clear(uint32_t Color)
00626 {
00627   /* Clear the LCD */
00628   LL_FillBuffer(ActiveLayer, (uint32_t *)(hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);
00629 }
00630
00631 /**
00632   * @brief  Clears the selected line.
00633   * @param  Line: Line to be cleared
00634   * @retval None
00635   */
00636 void BSP_LCD_ClearStringLine(uint32_t Line)
00637 {
00638   uint32_t color_backup = DrawProp[ActiveLayer].TextColor;
00639   DrawProp[ActiveLayer].TextColor = DrawProp[ActiveLayer].BackColor;
00640
00641   /* Draw rectangle with background color */
00642   BSP_LCD_FillRect(0, (Line * DrawProp[ActiveLayer].pFont->Height), BSP_LCD_GetXSize(), DrawProp[ActiveLayer].pFont->Height);
00643
00644   DrawProp[ActiveLayer].TextColor = color_backup;
00645   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
00646 }
00647
00648 /**
00649   * @brief  Displays one character.
00650   * @param  Xpos: Start column address
00651   * @param  Ypos: Line where to display the character shape.
00652   * @param  Ascii: Character ascii code
00653   *           This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
00654   * @retval None
00655   */
00656 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00657 {
00658   DrawChar(Xpos, Ypos, &DrawProp[ActiveLayer].pFont->table[(Ascii-' ') *\
00659     DrawProp[ActiveLayer].pFont->Height * ((DrawProp[ActiveLayer].pFont->Width + 7) / 8)]);
00660 }
00661
00662 /**
00663   * @brief  Displays characters on the LCD.
00664   * @param  Xpos: X position (in pixel)
00665   * @param  Ypos: Y position (in pixel)
00666   * @param  Text: Pointer to string to display on LCD
00667   * @param  Mode: Display mode
00668   *          This parameter can be one of the following values:
00669   *            @arg  CENTER_MODE
00670   *            @arg  RIGHT_MODE
00671   *            @arg  LEFT_MODE
00672   * @retval None
00673   */
00674 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
00675 {
00676   uint16_t ref_column = 1, i = 0;
00677   uint32_t size = 0, xsize = 0;
00678   uint8_t  *ptr = Text;
00679
00680   /* Get the text size */
00681   while (*ptr++) size ++ ;
00682
00683   /* Characters number per line */
00684   xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
00685
00686   switch (Mode)
00687   {
00688   case CENTER_MODE:
00689     {
00690       ref_column = Xpos + ((xsize - size)* DrawProp[ActiveLayer].pFont->Width) / 2;
00691       break;
00692     }
00693   case LEFT_MODE:
00694     {
00695       ref_column = Xpos;
00696       break;
00697     }
00698   case RIGHT_MODE:
00699     {
00700       ref_column = - Xpos + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
00701       break;
00702     }
00703   default:
00704     {
00705       ref_column = Xpos;
00706       break;
00707     }
00708   }
00709
00710   /* Check that the Start column is located in the screen */
00711   if ((ref_column < 1) || (ref_column >= 0x8000))
00712   {
00713     ref_column = 1;
00714   }
00715
00716   /* Send the string character by character on LCD */
00717   while ((*Text != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
00718   {
00719     /* Display one character on LCD */
00720     BSP_LCD_DisplayChar(ref_column, Ypos, *Text);
00721     /* Decrement the column position by 16 */
00722     ref_column += DrawProp[ActiveLayer].pFont->Width;
00723     /* Point on the next character */
00724     Text++;
00725     i++;
00726   }
00727 }
00728
00729 /**
00730   * @brief  Displays a maximum of 60 characters on the LCD.
00731   * @param  Line: Line where to display the character shape
00732   * @param  ptr: Pointer to string to display on LCD
00733   * @retval None
00734   */
00735 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
00736 {
00737   BSP_LCD_DisplayStringAt(0, LINE(Line), ptr, LEFT_MODE);
00738 }
00739
00740 /**
00741   * @brief  Draws an horizontal line.
00742   * @param  Xpos: X position
00743   * @param  Ypos: Y position
00744   * @param  Length: Line length
00745   * @retval None
00746   */
00747 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00748 {
00749   uint32_t  Xaddress = 0;
00750
00751   /* Get the line address */
00752   Xaddress = (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00753
00754   /* Write line */
00755   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, DrawProp[ActiveLayer].TextColor);
00756 }
00757
00758 /**
00759   * @brief  Draws a vertical line.
00760   * @param  Xpos: X position
00761   * @param  Ypos: Y position
00762   * @param  Length: Line length
00763   * @retval None
00764   */
00765 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00766 {
00767   uint32_t  Xaddress = 0;
00768
00769   /* Get the line address */
00770   Xaddress = (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00771
00772   /* Write line */
00773   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, 1, Length, (BSP_LCD_GetXSize() - 1), DrawProp[ActiveLayer].TextColor);
00774 }
00775
00776 /**
00777   * @brief  Draws an uni-line (between two points).
00778   * @param  x1: Point 1 X position
00779   * @param  y1: Point 1 Y position
00780   * @param  x2: Point 2 X position
00781   * @param  y2: Point 2 Y position
00782   * @retval None
00783   */
00784 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
00785 {
00786   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
00787   yinc1 = 0, yinc2 = 0, den = 0, num = 0, num_add = 0, num_pixels = 0,
00788   curpixel = 0;
00789
00790   deltax = ABS(x2 - x1);        /* The difference between the x's */
00791   deltay = ABS(y2 - y1);        /* The difference between the y's */
00792   x = x1;                       /* Start x off at the first pixel */
00793   y = y1;                       /* Start y off at the first pixel */
00794
00795   if (x2 >= x1)                 /* The x-values are increasing */
00796   {
00797     xinc1 = 1;
00798     xinc2 = 1;
00799   }
00800   else                          /* The x-values are decreasing */
00801   {
00802     xinc1 = -1;
00803     xinc2 = -1;
00804   }
00805
00806   if (y2 >= y1)                 /* The y-values are increasing */
00807   {
00808     yinc1 = 1;
00809     yinc2 = 1;
00810   }
00811   else                          /* The y-values are decreasing */
00812   {
00813     yinc1 = -1;
00814     yinc2 = -1;
00815   }
00816
00817   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
00818   {
00819     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
00820     yinc2 = 0;                  /* Don't change the y for every iteration */
00821     den = deltax;
00822     num = deltax / 2;
00823     num_add = deltay;
00824     num_pixels = deltax;         /* There are more x-values than y-values */
00825   }
00826   else                          /* There is at least one y-value for every x-value */
00827   {
00828     xinc2 = 0;                  /* Don't change the x for every iteration */
00829     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
00830     den = deltay;
00831     num = deltay / 2;
00832     num_add = deltax;
00833     num_pixels = deltay;         /* There are more y-values than x-values */
00834   }
00835
00836   for (curpixel = 0; curpixel <= num_pixels; curpixel++)
00837   {
00838     BSP_LCD_DrawPixel(x, y, DrawProp[ActiveLayer].TextColor);   /* Draw the current pixel */
00839     num += num_add;                            /* Increase the numerator by the top of the fraction */
00840     if (num >= den)                           /* Check if numerator >= denominator */
00841     {
00842       num -= den;                             /* Calculate the new numerator value */
00843       x += xinc1;                             /* Change the x as appropriate */
00844       y += yinc1;                             /* Change the y as appropriate */
00845     }
00846     x += xinc2;                               /* Change the x as appropriate */
00847     y += yinc2;                               /* Change the y as appropriate */
00848   }
00849 }
00850
00851 /**
00852   * @brief  Draws a rectangle.
00853   * @param  Xpos: X position
00854   * @param  Ypos: Y position
00855   * @param  Width: Rectangle width
00856   * @param  Height: Rectangle height
00857   * @retval None
00858   */
00859 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00860 {
00861   /* Draw horizontal lines */
00862   BSP_LCD_DrawHLine(Xpos, Ypos, Width);
00863   BSP_LCD_DrawHLine(Xpos, (Ypos+ Height), Width);
00864
00865   /* Draw vertical lines */
00866   BSP_LCD_DrawVLine(Xpos, Ypos, Height);
00867   BSP_LCD_DrawVLine((Xpos + Width), Ypos, Height);
00868 }
00869
00870 /**
00871   * @brief  Draws a circle.
00872   * @param  Xpos: X position
00873   * @param  Ypos: Y position
00874   * @param  Radius: Circle radius
00875   * @retval None
00876   */
00877 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00878 {
00879   int32_t   decision;    /* Decision Variable */
00880   uint32_t  current_x;   /* Current X Value */
00881   uint32_t  current_y;   /* Current Y Value */
00882
00883   decision = 3 - (Radius << 1);
00884   current_x = 0;
00885   current_y = Radius;
00886
00887   while (current_x <= current_y)
00888   {
00889     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos - current_y), DrawProp[ActiveLayer].TextColor);
00890
00891     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos - current_y), DrawProp[ActiveLayer].TextColor);
00892
00893     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos - current_x), DrawProp[ActiveLayer].TextColor);
00894
00895     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos - current_x), DrawProp[ActiveLayer].TextColor);
00896
00897     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos + current_y), DrawProp[ActiveLayer].TextColor);
00898
00899     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos + current_y), DrawProp[ActiveLayer].TextColor);
00900
00901     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos + current_x), DrawProp[ActiveLayer].TextColor);
00902
00903     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos + current_x), DrawProp[ActiveLayer].TextColor);
00904
00905     if (decision < 0)
00906     {
00907       decision += (current_x << 2) + 6;
00908     }
00909     else
00910     {
00911       decision += ((current_x - current_y) << 2) + 10;
00912       current_y--;
00913     }
00914     current_x++;
00915   }
00916 }
00917
00918 /**
00919   * @brief  Draws an poly-line (between many points).
00920   * @param  Points: Pointer to the points array
00921   * @param  PointCount: Number of points
00922   * @retval None
00923   */
00924 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount)
00925 {
00926   int16_t x = 0, y = 0;
00927
00928   if(PointCount < 2)
00929   {
00930     return;
00931   }
00932
00933   BSP_LCD_DrawLine(Points->X, Points->Y, (Points+PointCount-1)->X, (Points+PointCount-1)->Y);
00934
00935   while(--PointCount)
00936   {
00937     x = Points->X;
00938     y = Points->Y;
00939     Points++;
00940     BSP_LCD_DrawLine(x, y, Points->X, Points->Y);
00941   }
00942 }
00943
00944 /**
00945   * @brief  Draws an ellipse on LCD.
00946   * @param  Xpos: X position
00947   * @param  Ypos: Y position
00948   * @param  XRadius: Ellipse X radius
00949   * @param  YRadius: Ellipse Y radius
00950   * @retval None
00951   */
00952 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00953 {
00954   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
00955   float k = 0, rad1 = 0, rad2 = 0;
00956
00957   rad1 = XRadius;
00958   rad2 = YRadius;
00959
00960   k = (float)(rad2/rad1);
00961
00962   do {
00963     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/k)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
00964     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/k)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
00965     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/k)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
00966     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/k)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
00967
00968     e2 = err;
00969     if (e2 <= x) {
00970       err += ++x*2+1;
00971       if (-y == x && e2 <= y) e2 = 0;
00972     }
00973     if (e2 > y) err += ++y*2+1;
00974   }
00975   while (y <= 0);
00976 }
00977
00978 /**
00979   * @brief  Draws a pixel on LCD.
00980   * @param  Xpos: X position
00981   * @param  Ypos: Y position
00982   * @param  RGB_Code: Pixel color in ARGB mode (8-8-8-8)
00983   * @retval None
00984   */
00985 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
00986 {
00987   /* Write data value to all SDRAM memory */
00988   *(__IO uint32_t*) (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
00989 }
00990
00991 /**
00992   * @brief  Draws a bitmap picture loaded in the internal Flash (32 bpp).
00993   * @param  Xpos: Bmp X position in the LCD
00994   * @param  Ypos: Bmp Y position in the LCD
00995   * @param  pbmp: Pointer to Bmp picture address in the internal Flash
00996   * @retval None
00997   */
00998 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
00999 {
01000   uint32_t index = 0, width = 0, height = 0, bit_pixel = 0;
01001   uint32_t address;
01002   uint32_t input_color_mode = 0;
01003
01004   /* Get bitmap data address offset */
01005   index = *(__IO uint16_t *) (pbmp + 10);
01006   index |= (*(__IO uint16_t *) (pbmp + 12)) << 16;
01007
01008   /* Read bitmap width */
01009   width = *(uint16_t *) (pbmp + 18);
01010   width |= (*(uint16_t *) (pbmp + 20)) << 16;
01011
01012   /* Read bitmap height */
01013   height = *(uint16_t *) (pbmp + 22);
01014   height |= (*(uint16_t *) (pbmp + 24)) << 16;
01015
01016   /* Read bit/pixel */
01017   bit_pixel = *(uint16_t *) (pbmp + 28);
01018
01019   /* Set the address */
01020   address = hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress + (((BSP_LCD_GetXSize()*Ypos) + Xpos)*(4));
01021
01022   /* Get the layer pixel format */
01023   if ((bit_pixel/8) == 4)
01024   {
01025     input_color_mode = DMA2D_INPUT_ARGB8888;
01026   }
01027   else if ((bit_pixel/8) == 2)
01028   {
01029     input_color_mode = DMA2D_INPUT_RGB565;
01030   }
01031   else
01032   {
01033     input_color_mode = DMA2D_INPUT_RGB888;
01034   }
01035
01036   /* Bypass the bitmap header */
01037   pbmp += (index + (width * (height - 1) * (bit_pixel/8)));
01038
01039   /* Convert picture to ARGB8888 pixel format */
01040   for(index=0; index < height; index++)
01041   {
01042     /* Pixel format conversion */
01043     LL_ConvertLineToARGB8888((uint32_t *)pbmp, (uint32_t *)address, width, input_color_mode);
01044
01045     /* Increment the source and destination buffers */
01046     address+=  (BSP_LCD_GetXSize()*4);
01047     pbmp -= width*(bit_pixel/8);
01048   }
01049 }
01050
01051 /**
01052   * @brief  Draws a full rectangle.
01053   * @param  Xpos: X position
01054   * @param  Ypos: Y position
01055   * @param  Width: Rectangle width
01056   * @param  Height: Rectangle height
01057   * @retval None
01058   */
01059 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01060 {
01061   uint32_t  x_address = 0;
01062
01063   /* Set the text color */
01064   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01065
01066   /* Get the rectangle start address */
01067   x_address = (hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01068
01069   /* Fill the rectangle */
01070   LL_FillBuffer(ActiveLayer, (uint32_t *)x_address, Width, Height, (BSP_LCD_GetXSize() - Width), DrawProp[ActiveLayer].TextColor);
01071 }
01072
01073 /**
01074   * @brief  Draws a full circle.
01075   * @param  Xpos: X position
01076   * @param  Ypos: Y position
01077   * @param  Radius: Circle radius
01078   * @retval None
01079   */
01080 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
01081 {
01082   int32_t  decision;     /* Decision Variable */
01083   uint32_t  current_x;   /* Current X Value */
01084   uint32_t  current_y;   /* Current Y Value */
01085
01086   decision = 3 - (Radius << 1);
01087
01088   current_x = 0;
01089   current_y = Radius;
01090
01091   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01092
01093   while (current_x <= current_y)
01094   {
01095     if(current_y > 0)
01096     {
01097       BSP_LCD_DrawHLine(Xpos - current_y, Ypos + current_x, 2*current_y);
01098       BSP_LCD_DrawHLine(Xpos - current_y, Ypos - current_x, 2*current_y);
01099     }
01100
01101     if(current_x > 0)
01102     {
01103       BSP_LCD_DrawHLine(Xpos - current_x, Ypos - current_y, 2*current_x);
01104       BSP_LCD_DrawHLine(Xpos - current_x, Ypos + current_y, 2*current_x);
01105     }
01106     if (decision < 0)
01107     {
01108       decision += (current_x << 2) + 6;
01109     }
01110     else
01111     {
01112       decision += ((current_x - current_y) << 2) + 10;
01113       current_y--;
01114     }
01115     current_x++;
01116   }
01117
01118   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01119   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
01120 }
01121
01122 /**
01123   * @brief  Draws a full poly-line (between many points).
01124   * @param  Points: Pointer to the points array
01125   * @param  PointCount: Number of points
01126   * @retval None
01127   */
01128 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount)
01129 {
01130   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;
01131   uint16_t  image_left = 0, image_right = 0, image_top = 0, image_bottom = 0;
01132
01133   image_left = image_right = Points->X;
01134   image_top= image_bottom = Points->Y;
01135
01136   for(counter = 1; counter < PointCount; counter++)
01137   {
01138     pixelX = POLY_X(counter);
01139     if(pixelX < image_left)
01140     {
01141       image_left = pixelX;
01142     }
01143     if(pixelX > image_right)
01144     {
01145       image_right = pixelX;
01146     }
01147
01148     pixelY = POLY_Y(counter);
01149     if(pixelY < image_top)
01150     {
01151       image_top = pixelY;
01152     }
01153     if(pixelY > image_bottom)
01154     {
01155       image_bottom = pixelY;
01156     }
01157   }
01158
01159   if(PointCount < 2)
01160   {
01161     return;
01162   }
01163
01164   X_center = (image_left + image_right)/2;
01165   Y_center = (image_bottom + image_top)/2;
01166
01167   X_first = Points->X;
01168   Y_first = Points->Y;
01169
01170   while(--PointCount)
01171   {
01172     X = Points->X;
01173     Y = Points->Y;
01174     Points++;
01175     X2 = Points->X;
01176     Y2 = Points->Y;
01177
01178     FillTriangle(X, X2, X_center, Y, Y2, Y_center);
01179     FillTriangle(X, X_center, X2, Y, Y_center, Y2);
01180     FillTriangle(X_center, X2, X, Y_center, Y2, Y);
01181   }
01182
01183   FillTriangle(X_first, X2, X_center, Y_first, Y2, Y_center);
01184   FillTriangle(X_first, X_center, X2, Y_first, Y_center, Y2);
01185   FillTriangle(X_center, X2, X_first, Y_center, Y2, Y_first);
01186 }
01187
01188 /**
01189   * @brief  Draws a full ellipse.
01190   * @param  Xpos: X position
01191   * @param  Ypos: Y position
01192   * @param  XRadius: Ellipse X radius
01193   * @param  YRadius: Ellipse Y radius
01194   * @retval None
01195   */
01196 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01197 {
01198   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01199   float k = 0, rad1 = 0, rad2 = 0;
01200
01201   rad1 = XRadius;
01202   rad2 = YRadius;
01203
01204   k = (float)(rad2/rad1);
01205
01206   do
01207   {
01208     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/k)), (Ypos+y), (2*(uint16_t)(x/k) + 1));
01209     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/k)), (Ypos-y), (2*(uint16_t)(x/k) + 1));
01210
01211     e2 = err;
01212     if (e2 <= x)
01213     {
01214       err += ++x*2+1;
01215       if (-y == x && e2 <= y) e2 = 0;
01216     }
01217     if (e2 > y) err += ++y*2+1;
01218   }
01219   while (y <= 0);
01220 }
01221
01222 /**
01223   * @brief  Enables the display.
01224   * @retval None
01225   */
01226 void BSP_LCD_DisplayOn(void)
01227 {
01228   /* Display On */
01229   __HAL_LTDC_ENABLE(&hLtdcEval);
01230 }
01231
01232 /**
01233   * @brief  Disables the display.
01234   * @retval None
01235   */
01236 void BSP_LCD_DisplayOff(void)
01237 {
01238   /* Display Off */
01239   __HAL_LTDC_DISABLE(&hLtdcEval);
01240 }
01241
01242 /**
01243   * @brief  Initializes the LTDC MSP.
01244   * @param  hltdc: LTDC handle
01245   * @param  Params
01246   * @retval None
01247   */
01248 __weak void BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params)
01249 {
01250   GPIO_InitTypeDef gpio_init_structure;
01251
01252   /* Enable the LTDC and DMA2D clocks */
01253   __HAL_RCC_LTDC_CLK_ENABLE();
01254   __HAL_RCC_DMA2D_CLK_ENABLE();
01255
01256   /* Enable GPIOs clock */
01257   __HAL_RCC_GPIOI_CLK_ENABLE();
01258   __HAL_RCC_GPIOJ_CLK_ENABLE();
01259   __HAL_RCC_GPIOK_CLK_ENABLE();
01260
01261   /*** LTDC Pins configuration ***/
01262   /* GPIOI configuration */
01263   gpio_init_structure.Pin       = GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01264   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01265   gpio_init_structure.Pull      = GPIO_NOPULL;
01266   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
01267   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01268   HAL_GPIO_Init(GPIOI, &gpio_init_structure);
01269
01270   /* GPIOJ configuration */
01271   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01272                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | \
01273                                   GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | \
01274                                   GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01275   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01276   gpio_init_structure.Pull      = GPIO_NOPULL;
01277   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
01278   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01279   HAL_GPIO_Init(GPIOJ, &gpio_init_structure);
01280
01281   /* GPIOK configuration */
01282   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01283                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7;
01284   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
01285   gpio_init_structure.Pull      = GPIO_NOPULL;
01286   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
01287   gpio_init_structure.Alternate = GPIO_AF14_LTDC;
01288   HAL_GPIO_Init(GPIOK, &gpio_init_structure);
01289 }
01290
01291 /**
01292   * @brief  DeInitializes BSP_LCD MSP.
01293   * @param  hltdc: LTDC handle
01294   * @param  Params
01295   * @retval None
01296   */
01297 __weak void BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params)
01298 {
01299   GPIO_InitTypeDef  gpio_init_structure;
01300
01301   /* Disable LTDC block */
01302   __HAL_LTDC_DISABLE(hltdc);
01303
01304   /* LTDC Pins deactivation */
01305   /* GPIOI deactivation */
01306   gpio_init_structure.Pin       = GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01307   HAL_GPIO_DeInit(GPIOI, gpio_init_structure.Pin);
01308   /* GPIOJ deactivation */
01309   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01310                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | \
01311                                   GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | \
01312                                   GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01313   HAL_GPIO_DeInit(GPIOJ, gpio_init_structure.Pin);
01314   /* GPIOK deactivation */
01315   gpio_init_structure.Pin       = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
01316                                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7;
01317   HAL_GPIO_DeInit(GPIOK, gpio_init_structure.Pin);
01318
01319   /* Disable LTDC clock */
01320   __HAL_RCC_LTDC_CLK_DISABLE();
01321
01322   /* GPIO pins clock can be shut down in the application
01323      by surcharging this __weak function */
01324 }
01325
01326 /**
01327   * @brief  Clock Config.
01328   * @param  hltdc: LTDC handle
01329   * @param  Params
01330   * @note   This API is called by BSP_LCD_Init()
01331   *         Being __weak it can be overwritten by the application
01332   * @retval None
01333   */
01334 __weak void BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params)
01335 {
01336   static RCC_PeriphCLKInitTypeDef  periph_clk_init_struct;
01337
01338   if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
01339   {
01340     /* AMPIRE480272 LCD clock configuration */
01341     /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
01342     /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */
01343     /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/5 = 38.4 Mhz */
01344     /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_4 = 38.4/4 = 9.6Mhz */
01345     periph_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
01346     periph_clk_init_struct.PLLSAI.PLLSAIN = 192;
01347     periph_clk_init_struct.PLLSAI.PLLSAIR = AMPIRE480272_FREQUENCY_DIVIDER;
01348     periph_clk_init_struct.PLLSAIDivR = RCC_PLLSAIDIVR_4;
01349     HAL_RCCEx_PeriphCLKConfig(&periph_clk_init_struct);
01350   }
01351   else
01352   {
01353     /* The programmed LTDC pixel clock depends on the vertical refresh rate of the panel 60Hz => 25.16MHz and
01354        the LCD/SDRAM bandwidth affected by the several access on the bus and the number of used layers.
01355     */
01356     if(*(uint32_t *)Params == LCD_MAX_PCLK)
01357     {
01358       /* In case of single layer the bandwidth is arround 160MBytesPerSec ==> theorical PCLK of 40MHz */
01359       /* AMPIRE640480 typical PCLK is 25.16 MHz so the PLLSAI is configured to provide this clock */
01360       /* AMPIRE640480 LCD clock configuration */
01361       /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
01362       /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 151 Mhz */
01363       /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 151/3 = 50.3 Mhz */
01364       /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_2 = 50.3/2 = 25.16 Mhz */
01365       periph_clk_init_struct.PLLSAI.PLLSAIN = 151;
01366     }
01367     else
01368     {
01369       /* In case of double layers the bandwidth is arround 80MBytesPerSec => 20MHz (<25,16MHz) */
01370       /* so the PLLSAI is configured to provide this clock */
01371       /* AMPIRE640480 LCD clock configuration */
01372       /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
01373       /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 120 Mhz */
01374       /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 120/3 = 40 Mhz */
01375       /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_2 = 40/2 = 20 Mhz */
01376       periph_clk_init_struct.PLLSAI.PLLSAIN = 120;
01377     }
01378     periph_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
01379     periph_clk_init_struct.PLLSAI.PLLSAIR = 3;
01380     periph_clk_init_struct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
01381     HAL_RCCEx_PeriphCLKConfig(&periph_clk_init_struct);
01382   }
01383 }
01384
01385
01386 /*******************************************************************************
01387                             Static Functions
01388 *******************************************************************************/
01389
01390 /**
01391   * @brief  Draws a character on LCD.
01392   * @param  Xpos: Line where to display the character shape
01393   * @param  Ypos: Start column address
01394   * @param  c: Pointer to the character data
01395   * @retval None
01396   */
01397 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
01398 {
01399   uint32_t i = 0, j = 0;
01400   uint16_t height, width;
01401   uint8_t  offset;
01402   uint8_t  *pchar;
01403   uint32_t line;
01404
01405   height = DrawProp[ActiveLayer].pFont->Height;
01406   width  = DrawProp[ActiveLayer].pFont->Width;
01407
01408   offset =  8 *((width + 7)/8) -  width ;
01409
01410   for(i = 0; i < height; i++)
01411   {
01412     pchar = ((uint8_t *)c + (width + 7)/8 * i);
01413
01414     switch(((width + 7)/8))
01415     {
01416
01417     case 1:
01418       line =  pchar[0];
01419       break;
01420
01421     case 2:
01422       line =  (pchar[0]<< 8) | pchar[1];
01423       break;
01424
01425     case 3:
01426     default:
01427       line =  (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];
01428       break;
01429     }
01430
01431     for (j = 0; j < width; j++)
01432     {
01433       if(line & (1 << (width- j + offset- 1)))
01434       {
01435         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].TextColor);
01436       }
01437       else
01438       {
01439         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].BackColor);
01440       }
01441     }
01442     Ypos++;
01443   }
01444 }
01445
01446 /**
01447   * @brief  Fills a triangle (between 3 points).
01448   * @param  x1: Point 1 X position
01449   * @param  y1: Point 1 Y position
01450   * @param  x2: Point 2 X position
01451   * @param  y2: Point 2 Y position
01452   * @param  x3: Point 3 X position
01453   * @param  y3: Point 3 Y position
01454   * @retval None
01455   */
01456 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
01457 {
01458   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01459   yinc1 = 0, yinc2 = 0, den = 0, num = 0, num_add = 0, num_pixels = 0,
01460   curpixel = 0;
01461
01462   deltax = ABS(x2 - x1);        /* The difference between the x's */
01463   deltay = ABS(y2 - y1);        /* The difference between the y's */
01464   x = x1;                       /* Start x off at the first pixel */
01465   y = y1;                       /* Start y off at the first pixel */
01466
01467   if (x2 >= x1)                 /* The x-values are increasing */
01468   {
01469     xinc1 = 1;
01470     xinc2 = 1;
01471   }
01472   else                          /* The x-values are decreasing */
01473   {
01474     xinc1 = -1;
01475     xinc2 = -1;
01476   }
01477
01478   if (y2 >= y1)                 /* The y-values are increasing */
01479   {
01480     yinc1 = 1;
01481     yinc2 = 1;
01482   }
01483   else                          /* The y-values are decreasing */
01484   {
01485     yinc1 = -1;
01486     yinc2 = -1;
01487   }
01488
01489   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01490   {
01491     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01492     yinc2 = 0;                  /* Don't change the y for every iteration */
01493     den = deltax;
01494     num = deltax / 2;
01495     num_add = deltay;
01496     num_pixels = deltax;         /* There are more x-values than y-values */
01497   }
01498   else                          /* There is at least one y-value for every x-value */
01499   {
01500     xinc2 = 0;                  /* Don't change the x for every iteration */
01501     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01502     den = deltay;
01503     num = deltay / 2;
01504     num_add = deltax;
01505     num_pixels = deltay;         /* There are more y-values than x-values */
01506   }
01507
01508   for (curpixel = 0; curpixel <= num_pixels; curpixel++)
01509   {
01510     BSP_LCD_DrawLine(x, y, x3, y3);
01511
01512     num += num_add;              /* Increase the numerator by the top of the fraction */
01513     if (num >= den)             /* Check if numerator >= denominator */
01514     {
01515       num -= den;               /* Calculate the new numerator value */
01516       x += xinc1;               /* Change the x as appropriate */
01517       y += yinc1;               /* Change the y as appropriate */
01518     }
01519     x += xinc2;                 /* Change the x as appropriate */
01520     y += yinc2;                 /* Change the y as appropriate */
01521   }
01522 }
01523
01524 /**
01525   * @brief  Fills a buffer.
01526   * @param  LayerIndex: Layer index
01527   * @param  pDst: Pointer to destination buffer
01528   * @param  xSize: Buffer width
01529   * @param  ySize: Buffer height
01530   * @param  OffLine: Offset
01531   * @param  ColorIndex: Color index
01532   * @retval None
01533   */
01534 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
01535 {
01536   /* Register to memory mode with ARGB8888 as color Mode */
01537   hDma2dEval.Init.Mode         = DMA2D_R2M;
01538   hDma2dEval.Init.ColorMode    = DMA2D_OUTPUT_ARGB8888;
01539   hDma2dEval.Init.OutputOffset = OffLine;
01540
01541   hDma2dEval.Instance = DMA2D;
01542
01543   /* DMA2D Initialization */
01544   if(HAL_DMA2D_Init(&hDma2dEval) == HAL_OK)
01545   {
01546     if(HAL_DMA2D_ConfigLayer(&hDma2dEval, LayerIndex) == HAL_OK)
01547     {
01548       if (HAL_DMA2D_Start(&hDma2dEval, ColorIndex, (uint32_t)pDst, xSize, ySize) == HAL_OK)
01549       {
01550         /* Polling For DMA transfer */
01551         HAL_DMA2D_PollForTransfer(&hDma2dEval, 10);
01552       }
01553     }
01554   }
01555 }
01556
01557 /**
01558   * @brief  Converts a line to an ARGB8888 pixel format.
01559   * @param  pSrc: Pointer to source buffer
01560   * @param  pDst: Output color
01561   * @param  xSize: Buffer width
01562   * @param  ColorMode: Input color mode
01563   * @retval None
01564   */
01565 static void LL_ConvertLineToARGB8888(void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
01566 {
01567   /* Configure the DMA2D Mode, Color Mode and output offset */
01568   hDma2dEval.Init.Mode         = DMA2D_M2M_PFC;
01569   hDma2dEval.Init.ColorMode    = DMA2D_OUTPUT_ARGB8888;
01570   hDma2dEval.Init.OutputOffset = 0;
01571
01572   /* Foreground Configuration */
01573   hDma2dEval.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
01574   hDma2dEval.LayerCfg[1].InputAlpha = 0xFF;
01575   hDma2dEval.LayerCfg[1].InputColorMode = ColorMode;
01576   hDma2dEval.LayerCfg[1].InputOffset = 0;
01577
01578   hDma2dEval.Instance = DMA2D;
01579
01580   /* DMA2D Initialization */
01581   if(HAL_DMA2D_Init(&hDma2dEval) == HAL_OK)
01582   {
01583     if(HAL_DMA2D_ConfigLayer(&hDma2dEval, 1) == HAL_OK)
01584     {
01585       if (HAL_DMA2D_Start(&hDma2dEval, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1) == HAL_OK)
01586       {
01587         /* Polling For DMA transfer */
01588         HAL_DMA2D_PollForTransfer(&hDma2dEval, 10);
01589       }
01590     }
01591   }
01592 }
01593
01594 /**
01595   * @}
01596   */
01597
01598 /**
01599   * @}
01600   */
01601
01602 /**
01603   * @}
01604   */
01605
01606 /**
01607   * @}
01608   */
01609
01610 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_lcd.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_LCD_H
00041 #define __STM32756G_EVAL_LCD_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 /* Include LCD component Driver */
00049 /* LCD integrated within MB1063 */
00050 #include "../Components/ampire640480/ampire640480.h"
00051 /* LCD integrated within MB1046 */
00052 #include "../Components/ampire480272/ampire480272.h"
00053
00054 /* Include IOExpander(STMPE811) component Driver */
00055 #include "../Components/stmpe811/stmpe811.h"
00056
00057 /* Include SDRAM Driver */
00058 #include "stm32756g_eval_sdram.h"
00059
00060 #include "stm32756g_eval.h"
00061 #include "../../../Utilities/Fonts/fonts.h"
00062
00063 /** @addtogroup BSP
00064   * @{
00065   */
00066
00067 /** @addtogroup STM32756G_EVAL
00068   * @{
00069   */
00070
00071 /** @addtogroup STM32756G_EVAL_LCD
00072   * @{
00073   */
00074
00075 /** @defgroup STM32756G_EVAL_LCD_Exported_Types LCD Exported Types
00076   * @{
00077   */
00078 typedef struct
00079 {
00080   uint32_t TextColor;
00081   uint32_t BackColor;
00082   sFONT    *pFont;
00083 }LCD_DrawPropTypeDef;
00084
00085 typedef struct
00086 {
00087   int16_t X;
00088   int16_t Y;
00089 }Point, * pPoint;
00090
00091 /**
00092   * @brief  Line mode structures definition
00093   */
00094 typedef enum
00095 {
00096   CENTER_MODE             = 0x01,    /* Center mode */
00097   RIGHT_MODE              = 0x02,    /* Right mode  */
00098   LEFT_MODE               = 0x03     /* Left mode   */
00099 }Text_AlignModeTypdef;
00100
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32756G_EVAL_LCD_Exported_Constants LCD Exported Constants
00106   * @{
00107   */
00108 #define MAX_LAYER_NUMBER       ((uint32_t)2)
00109
00110 #define LCD_LayerCfgTypeDef    LTDC_LayerCfgTypeDef
00111
00112 #define LTDC_ACTIVE_LAYER            ((uint32_t)1) /* Layer 1 */
00113 /**
00114   * @brief  LCD status structure definition
00115   */
00116 #define LCD_OK                 ((uint8_t)0x00)
00117 #define LCD_ERROR              ((uint8_t)0x01)
00118 #define LCD_TIMEOUT            ((uint8_t)0x02)
00119
00120 /**
00121   * @brief  LCD FB_StartAddress
00122   */
00123 #define LCD_FB_START_ADDRESS       ((uint32_t)0xC0000000)
00124
00125
00126 /**
00127   * @brief  LCD Layer_Number
00128   */
00129
00130 /* The programmed LTDC pixel clock depends on the vertical refresh rate of the panel 60Hz => 25.16MHz and
00131    the LCD/SDRAM bandwidth affected by the several access on the bus and the number of used layers.
00132    when only one layer is enabled "LCD_MAX_PCLK" can be used and when two layers are enabled simultaneously
00133    or/and there is several access on the bus "LCD_MIN_PCLK" parameter is recommended */
00134 #define LCD_MAX_PCLK       ((uint8_t)0x00)
00135 #define LCD_MIN_PCLK       ((uint8_t)0x01)
00136
00137
00138 /**
00139   * @brief  LCD color
00140   */
00141 #define LCD_COLOR_BLUE          ((uint32_t)0xFF0000FF)
00142 #define LCD_COLOR_GREEN         ((uint32_t)0xFF00FF00)
00143 #define LCD_COLOR_RED           ((uint32_t)0xFFFF0000)
00144 #define LCD_COLOR_CYAN          ((uint32_t)0xFF00FFFF)
00145 #define LCD_COLOR_MAGENTA       ((uint32_t)0xFFFF00FF)
00146 #define LCD_COLOR_YELLOW        ((uint32_t)0xFFFFFF00)
00147 #define LCD_COLOR_LIGHTBLUE     ((uint32_t)0xFF8080FF)
00148 #define LCD_COLOR_LIGHTGREEN    ((uint32_t)0xFF80FF80)
00149 #define LCD_COLOR_LIGHTRED      ((uint32_t)0xFFFF8080)
00150 #define LCD_COLOR_LIGHTCYAN     ((uint32_t)0xFF80FFFF)
00151 #define LCD_COLOR_LIGHTMAGENTA  ((uint32_t)0xFFFF80FF)
00152 #define LCD_COLOR_LIGHTYELLOW   ((uint32_t)0xFFFFFF80)
00153 #define LCD_COLOR_DARKBLUE      ((uint32_t)0xFF000080)
00154 #define LCD_COLOR_DARKGREEN     ((uint32_t)0xFF008000)
00155 #define LCD_COLOR_DARKRED       ((uint32_t)0xFF800000)
00156 #define LCD_COLOR_DARKCYAN      ((uint32_t)0xFF008080)
00157 #define LCD_COLOR_DARKMAGENTA   ((uint32_t)0xFF800080)
00158 #define LCD_COLOR_DARKYELLOW    ((uint32_t)0xFF808000)
00159 #define LCD_COLOR_WHITE         ((uint32_t)0xFFFFFFFF)
00160 #define LCD_COLOR_LIGHTGRAY     ((uint32_t)0xFFD3D3D3)
00161 #define LCD_COLOR_GRAY          ((uint32_t)0xFF808080)
00162 #define LCD_COLOR_DARKGRAY      ((uint32_t)0xFF404040)
00163 #define LCD_COLOR_BLACK         ((uint32_t)0xFF000000)
00164 #define LCD_COLOR_BROWN         ((uint32_t)0xFFA52A2A)
00165 #define LCD_COLOR_ORANGE        ((uint32_t)0xFFFFA500)
00166 #define LCD_COLOR_TRANSPARENT   ((uint32_t)0xFF000000)
00167
00168 /**
00169   * @brief LCD default font
00170   */
00171 #define LCD_DEFAULT_FONT        Font24
00172
00173 /**
00174   * @brief  LCD Reload Types
00175   */
00176 #define LCD_RELOAD_IMMEDIATE               ((uint32_t)LTDC_SRCR_IMR)
00177 #define LCD_RELOAD_VERTICAL_BLANKING       ((uint32_t)LTDC_SRCR_VBR)
00178
00179 /**
00180   * @}
00181   */
00182
00183 /** @defgroup STM32756G_EVAL_LCD_Exported_Functions LCD Exported Functions
00184   * @{
00185   */
00186 uint8_t  BSP_LCD_Init(void);
00187 uint8_t  BSP_LCD_InitEx(uint32_t PclkConfig);
00188
00189 uint8_t  BSP_LCD_DeInit(void);
00190 uint32_t BSP_LCD_GetXSize(void);
00191 uint32_t BSP_LCD_GetYSize(void);
00192 void     BSP_LCD_SetXSize(uint32_t imageWidthPixels);
00193 void     BSP_LCD_SetYSize(uint32_t imageHeightPixels);
00194
00195 /* Functions using the LTDC controller */
00196 void     BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
00197 void     BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
00198 void     BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency);
00199 void     BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
00200 void     BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address);
00201 void     BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
00202 void     BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue);
00203 void     BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
00204 void     BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex);
00205 void     BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00206 void     BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00207 void     BSP_LCD_SelectLayer(uint32_t LayerIndex);
00208 void     BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
00209 void     BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State);
00210 void     BSP_LCD_Relaod(uint32_t ReloadType);
00211
00212 void     BSP_LCD_SetTextColor(uint32_t Color);
00213 uint32_t BSP_LCD_GetTextColor(void);
00214 void     BSP_LCD_SetBackColor(uint32_t Color);
00215 uint32_t BSP_LCD_GetBackColor(void);
00216 void     BSP_LCD_SetFont(sFONT *fonts);
00217 sFONT    *BSP_LCD_GetFont(void);
00218
00219 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00220 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
00221 void     BSP_LCD_Clear(uint32_t Color);
00222 void     BSP_LCD_ClearStringLine(uint32_t Line);
00223 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00224 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
00225 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00226
00227 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00228 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00229 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00230 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00231 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00232 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00233 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00234 void     BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
00235
00236 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00237 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00238 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00239 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00240
00241 void     BSP_LCD_DisplayOff(void);
00242 void     BSP_LCD_DisplayOn(void);
00243
00244 /* These functions can be modified in case the current settings
00245    need to be changed for specific application needs */
00246 void     BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params);
00247 void     BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params);
00248 void     BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params);
00249
00250 /**
00251   * @}
00252   */
00253
00254 /**
00255   * @}
00256   */
00257
00258 /**
00259   * @}
00260   */
00261
00262 /**
00263   * @}
00264   */
00265
00266 #ifdef __cplusplus
00267 }
00268 #endif
00269
00270 #endif /* __STM32756G_EVAL_LCD_H */
00271
00272 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes a standard driver for the PC28F128M29EWLA NOR flash memory
00008   *          device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the PC28F128M29EWLA NOR flash external memory mounted
00013      on STM32756G-EVAL evaluation board.
00014    - This driver does not need a specific component driver for the NOR device
00015      to be included with.
00016
00017   Driver description:
00018   ------------------
00019   + Initialization steps:
00020      o Initialize the NOR external memory using the BSP_NOR_Init() function. This
00021        function includes the MSP layer hardware resources initialization and the
00022        FMC controller configuration to interface with the external NOR memory.
00023
00024   + NOR flash operations
00025      o NOR external memory can be accessed with read/write operations once it is
00026        initialized.
00027        Read/write operation can be performed with AHB access using the functions
00028        BSP_NOR_ReadData()/BSP_NOR_WriteData(). The BSP_NOR_WriteData() performs write operation
00029        of an amount of data by unit (halfword). You can also perform a program data
00030        operation of an amount of data using the function BSP_NOR_ProgramData().
00031      o The function BSP_NOR_Read_ID() returns the chip IDs stored in the structure
00032        "NOR_IDTypeDef". (see the NOR IDs in the memory data sheet)
00033      o Perform erase block operation using the function BSP_NOR_Erase_Block() and by
00034        specifying the block address. You can perform an erase operation of the whole
00035        chip by calling the function BSP_NOR_Erase_Chip().
00036      o After other operations, the function BSP_NOR_ReturnToReadMode() allows the NOR
00037        flash to return to read mode to perform read operations on it.
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 /* Includes ------------------------------------------------------------------*/
00070 #include "stm32756g_eval_nor.h"
00071
00072 /** @addtogroup BSP
00073   * @{
00074   */
00075
00076 /** @addtogroup STM32756G_EVAL
00077   * @{
00078   */
00079
00080 /** @defgroup STM32756G_EVAL_NOR STM32756G_EVAL NOR
00081   * @{
00082   */
00083
00084 /* Private typedef -----------------------------------------------------------*/
00085
00086 /** @defgroup STM32756G_EVAL_NOR_Private_Types_Definitions NOR Private Types Definitions
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092 /* Private define ------------------------------------------------------------*/
00093
00094 /** @defgroup STM32756G_EVAL_NOR_Private_Defines NOR Private Defines
00095   * @{
00096   */
00097 /**
00098   * @}
00099   */
00100 /* Private macro -------------------------------------------------------------*/
00101
00102 /** @defgroup STM32756G_EVAL_NOR_Private_Macros NOR Private Macros
00103   * @{
00104   */
00105 /**
00106   * @}
00107   */
00108 /* Private variables ---------------------------------------------------------*/
00109
00110 /** @defgroup STM32756G_EVAL_NOR_Private_Variables NOR Private Variables
00111   * @{
00112   */
00113 static NOR_HandleTypeDef norHandle;
00114 static FMC_NORSRAM_TimingTypeDef Timing;
00115
00116 /**
00117   * @}
00118   */
00119
00120 /* Private function prototypes -----------------------------------------------*/
00121
00122 /** @defgroup STM32756G_EVAL_NOR_Private_Functions_Prototypes NOR Private Functions Prototypes
00123   * @{
00124   */
00125 /**
00126   * @}
00127   */
00128 /* Private functions ---------------------------------------------------------*/
00129
00130 /** @defgroup STM32756G_EVAL_NOR_Private_Functions NOR Private Functions
00131   * @{
00132   */
00133
00134 /**
00135   * @brief  Initializes the NOR device.
00136   * @retval NOR memory status
00137   */
00138 uint8_t BSP_NOR_Init(void)
00139 {
00140   static uint8_t nor_status = NOR_STATUS_ERROR;
00141   norHandle.Instance  = FMC_NORSRAM_DEVICE;
00142   norHandle.Extended  = FMC_NORSRAM_EXTENDED_DEVICE;
00143
00144   /* NOR device configuration */
00145   /* Timing configuration derived from system clock (up to 216Mhz)
00146      for 108Mhz as NOR clock frequency */
00147   Timing.AddressSetupTime      = 4;
00148   Timing.AddressHoldTime       = 3;
00149   Timing.DataSetupTime         = 8;
00150   Timing.BusTurnAroundDuration = 1;
00151   Timing.CLKDivision           = 2;
00152   Timing.DataLatency           = 2;
00153   Timing.AccessMode            = FMC_ACCESS_MODE_A;
00154
00155   norHandle.Init.NSBank             = FMC_NORSRAM_BANK1;
00156   norHandle.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
00157   norHandle.Init.MemoryType         = FMC_MEMORY_TYPE_NOR;
00158   norHandle.Init.MemoryDataWidth    = NOR_MEMORY_WIDTH;
00159   norHandle.Init.BurstAccessMode    = NOR_BURSTACCESS;
00160   norHandle.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
00161   norHandle.Init.WaitSignalActive   = FMC_WAIT_TIMING_BEFORE_WS;
00162   norHandle.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
00163   norHandle.Init.WaitSignal         = FMC_WAIT_SIGNAL_ENABLE;
00164   norHandle.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
00165   norHandle.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_ENABLE;
00166   norHandle.Init.WriteBurst         = NOR_WRITEBURST;
00167   norHandle.Init.ContinuousClock    = CONTINUOUSCLOCK_FEATURE;
00168
00169   /* NOR controller initialization */
00170   BSP_NOR_MspInit(&norHandle, NULL); /* __weak function can be rewritten by the application */
00171
00172   if(HAL_NOR_Init(&norHandle, &Timing, &Timing) != HAL_OK)
00173   {
00174     nor_status = NOR_STATUS_ERROR;
00175   }
00176   else
00177   {
00178     nor_status = NOR_STATUS_OK;
00179   }
00180   return nor_status;
00181 }
00182
00183 /**
00184   * @brief  DeInitializes the NOR device.
00185   * @retval NOR status
00186   */
00187 uint8_t BSP_NOR_DeInit(void)
00188 {
00189   static uint8_t nor_status = NOR_ERROR;
00190   /* NOR device de-initialization */
00191   norHandle.Instance = FMC_NORSRAM_DEVICE;
00192   norHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00193
00194   if(HAL_NOR_DeInit(&norHandle) != HAL_OK)
00195   {
00196     nor_status = NOR_STATUS_ERROR;
00197   }
00198   else
00199   {
00200     nor_status = NOR_STATUS_OK;
00201   }
00202
00203   /* NOR controller de-initialization */
00204   BSP_NOR_MspDeInit(&norHandle, NULL);
00205
00206   return nor_status;
00207 }
00208
00209 /**
00210   * @brief  Reads an amount of data from the NOR device.
00211   * @param  uwStartAddress: Read start address
00212   * @param  pData: Pointer to data to be read
00213   * @param  uwDataSize: Size of data to read
00214   * @retval NOR memory status
00215   */
00216 uint8_t BSP_NOR_ReadData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00217 {
00218   if(HAL_NOR_ReadBuffer(&norHandle, NOR_DEVICE_ADDR + uwStartAddress, pData, uwDataSize) != HAL_OK)
00219   {
00220     return NOR_STATUS_ERROR;
00221   }
00222   else
00223   {
00224     return NOR_STATUS_OK;
00225   }
00226 }
00227
00228 /**
00229   * @brief  Returns the NOR memory to read mode.
00230   * @retval None
00231   */
00232 void BSP_NOR_ReturnToReadMode(void)
00233 {
00234    HAL_NOR_ReturnToReadMode(&norHandle);
00235 }
00236
00237 /**
00238   * @brief  Writes an amount of data to the NOR device.
00239   * @param  uwStartAddress: Write start address
00240   * @param  pData: Pointer to data to be written
00241   * @param  uwDataSize: Size of data to write
00242   * @retval NOR memory status
00243   */
00244 uint8_t BSP_NOR_WriteData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00245 {
00246   uint32_t index = uwDataSize;
00247
00248   while(index > 0)
00249   {
00250     /* Write data to NOR */
00251     HAL_NOR_Program(&norHandle, (uint32_t *)(NOR_DEVICE_ADDR + uwStartAddress), pData);
00252
00253     /* Read NOR device status */
00254     if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, PROGRAM_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00255     {
00256       return NOR_STATUS_ERROR;
00257     }
00258
00259     /* Update the counters */
00260     index--;
00261     uwStartAddress += 2;
00262     pData++;
00263   }
00264
00265   return NOR_STATUS_OK;
00266 }
00267
00268 /**
00269   * @brief  Programs an amount of data to the NOR device.
00270   * @param  uwStartAddress: Write start address
00271   * @param  pData: Pointer to data to be written
00272   * @param  uwDataSize: Size of data to write
00273   * @retval NOR memory status
00274   */
00275 uint8_t BSP_NOR_ProgramData(uint32_t uwStartAddress, uint16_t* pData, uint32_t uwDataSize)
00276 {
00277   /* Send NOR program buffer operation */
00278   HAL_NOR_ProgramBuffer(&norHandle, uwStartAddress, pData, uwDataSize);
00279
00280   /* Return the NOR memory status */
00281   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, PROGRAM_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00282   {
00283     return NOR_STATUS_ERROR;
00284   }
00285   else
00286   {
00287     return NOR_STATUS_OK;
00288   }
00289 }
00290
00291 /**
00292   * @brief  Erases the specified block of the NOR device.
00293   * @param  BlockAddress: Block address to erase
00294   * @retval NOR memory status
00295   */
00296 uint8_t BSP_NOR_Erase_Block(uint32_t BlockAddress)
00297 {
00298   /* Send NOR erase block operation */
00299   HAL_NOR_Erase_Block(&norHandle, BlockAddress, NOR_DEVICE_ADDR);
00300
00301   /* Return the NOR memory status */
00302   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, BLOCKERASE_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00303   {
00304     return NOR_STATUS_ERROR;
00305   }
00306   else
00307   {
00308     return NOR_STATUS_OK;
00309   }
00310 }
00311
00312 /**
00313   * @brief  Erases the entire NOR chip.
00314   * @retval NOR memory status
00315   */
00316 uint8_t BSP_NOR_Erase_Chip(void)
00317 {
00318   /* Send NOR Erase chip operation */
00319   HAL_NOR_Erase_Chip(&norHandle, NOR_DEVICE_ADDR);
00320
00321   /* Return the NOR memory status */
00322   if(HAL_NOR_GetStatus(&norHandle, NOR_DEVICE_ADDR, CHIPERASE_TIMEOUT) != HAL_NOR_STATUS_SUCCESS)
00323   {
00324     return NOR_STATUS_ERROR;
00325   }
00326   else
00327   {
00328     return NOR_STATUS_OK;
00329   }
00330 }
00331
00332 /**
00333   * @brief  Reads NOR flash IDs.
00334   * @param  pNOR_ID : Pointer to NOR ID structure
00335   * @retval NOR memory status
00336   */
00337 uint8_t BSP_NOR_Read_ID(NOR_IDTypeDef *pNOR_ID)
00338 {
00339   if(HAL_NOR_Read_ID(&norHandle, pNOR_ID) != HAL_OK)
00340   {
00341     return NOR_STATUS_ERROR;
00342   }
00343   else
00344   {
00345     return NOR_STATUS_OK;
00346   }
00347 }
00348
00349 /**
00350   * @brief  Initializes the NOR MSP.
00351   * @param  hnor: NOR handle
00352   * @param  Params
00353   * @retval None
00354   */
00355 __weak void BSP_NOR_MspInit(NOR_HandleTypeDef *hnor, void *Params)
00356 {
00357   GPIO_InitTypeDef gpio_init_structure;
00358
00359   /* Enable FMC clock */
00360   __HAL_RCC_FMC_CLK_ENABLE();
00361
00362   /* Enable GPIOs clock */
00363   __HAL_RCC_GPIOD_CLK_ENABLE();
00364   __HAL_RCC_GPIOE_CLK_ENABLE();
00365   __HAL_RCC_GPIOF_CLK_ENABLE();
00366   __HAL_RCC_GPIOG_CLK_ENABLE();
00367
00368   /* Common GPIO configuration */
00369   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00370   gpio_init_structure.Pull      = GPIO_PULLUP;
00371   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00372   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00373
00374   /* GPIOD configuration */
00375   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6   |\
00376                               GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 |\
00377                               GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00378   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00379
00380   /* GPIOE configuration */
00381   gpio_init_structure.Pin   = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6   |\
00382                               GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 |\
00383                               GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00384   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00385
00386   /* GPIOF configuration */
00387   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00388                               GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00389   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00390
00391   /* GPIOG 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;
00394   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00395 }
00396
00397 /**
00398   * @brief  DeInitializes NOR MSP.
00399   * @param  hnor: NOR handle
00400   * @param  Params
00401   * @retval None
00402   */
00403 __weak void BSP_NOR_MspDeInit(NOR_HandleTypeDef  *hnor, void *Params)
00404 {
00405     /* GPIO pins clock, FMC clock can be shut down in the application
00406        by surcharging this __weak function */
00407 }
00408
00409 /**
00410   * @brief  NOR BSP Wait for Ready/Busy signal.
00411   * @param  hnor: Pointer to NOR handle
00412   * @param  Timeout: Timeout duration
00413   * @retval None
00414   */
00415 void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout)
00416 {
00417   uint32_t timeout = Timeout;
00418
00419   /* Polling on Ready/Busy signal */
00420   while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_BUSY_STATE) && (timeout > 0))
00421   {
00422     timeout--;
00423   }
00424
00425   timeout = Timeout;
00426
00427   /* Polling on Ready/Busy signal */
00428   while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_READY_STATE) && (timeout > 0))
00429   {
00430     timeout--;
00431   }
00432 }
00433
00434 /**
00435   * @}
00436   */
00437
00438 /**
00439   * @}
00440   */
00441
00442 /**
00443   * @}
00444   */
00445
00446 /**
00447   * @}
00448   */
00449
00450
00451 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_nor.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_NOR_H
00041 #define __STM32756G_EVAL_NOR_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32f7xx_hal.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32756G_EVAL
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL_NOR
00059   * @{
00060   */
00061
00062 /** @defgroup STM32756G_EVAL_NOR_Exported_Types NOR Exported Types
00063   * @{
00064   */
00065 /**
00066   * @}
00067   */
00068
00069 /**
00070   * @brief  NOR status structure definition
00071   */
00072 #define   NOR_STATUS_OK         ((uint8_t)0x00)
00073 #define   NOR_STATUS_ERROR      ((uint8_t)0x01)
00074
00075 /** @defgroup STM32756G_EVAL_NOR_Exported_Constants NOR Exported Constants
00076   * @{
00077   */
00078 #define NOR_DEVICE_ADDR  ((uint32_t)0x60000000)
00079
00080 /* #define NOR_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8  */
00081 #define NOR_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00082
00083 #define NOR_BURSTACCESS    FMC_BURST_ACCESS_MODE_DISABLE
00084 /* #define NOR_BURSTACCESS    FMC_BURST_ACCESS_MODE_ENABLE*/
00085
00086 #define NOR_WRITEBURST    FMC_WRITE_BURST_DISABLE
00087 /* #define NOR_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 /* NOR operations Timeout definitions */
00093 #define BLOCKERASE_TIMEOUT   ((uint32_t)0x00A00000)  /* NOR block erase timeout */
00094 #define CHIPERASE_TIMEOUT    ((uint32_t)0x30000000)  /* NOR chip erase timeout  */
00095 #define PROGRAM_TIMEOUT      ((uint32_t)0x00004400)  /* NOR program timeout     */
00096
00097 /* NOR Ready/Busy signal GPIO definitions */
00098 #define NOR_READY_BUSY_PIN    GPIO_PIN_6
00099 #define NOR_READY_BUSY_GPIO   GPIOD
00100 #define NOR_READY_STATE       GPIO_PIN_SET
00101 #define NOR_BUSY_STATE        GPIO_PIN_RESET
00102 /**
00103   * @}
00104   */
00105
00106 /** @defgroup STM32756G_EVAL_NOR_Exported_Macro NOR Exported Macro
00107   * @{
00108   */
00109 /**
00110   * @}
00111   */
00112
00113 /** @defgroup STM32756G_EVAL_NOR_Exported_Functions NOR Exported Functions
00114   * @{
00115   */
00116 uint8_t BSP_NOR_Init(void);
00117 uint8_t BSP_NOR_DeInit(void);
00118 uint8_t BSP_NOR_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00119 uint8_t BSP_NOR_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00120 uint8_t BSP_NOR_ProgramData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00121 uint8_t BSP_NOR_Erase_Block(uint32_t BlockAddress);
00122 uint8_t BSP_NOR_Erase_Chip(void);
00123 uint8_t BSP_NOR_Read_ID(NOR_IDTypeDef *pNOR_ID);
00124 void BSP_NOR_ReturnToReadMode(void);
00125
00126 /* These functions can be modified in case the current settings (e.g. DMA stream)
00127    need to be changed for specific application needs */
00128 void    BSP_NOR_MspInit(NOR_HandleTypeDef  *hnor, void *Params);
00129 void    BSP_NOR_MspDeInit(NOR_HandleTypeDef  *hnor, void *Params);
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_NOR_H */
00152
00153 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes a standard driver for the N25Q512A QSPI
00008   *          memory mounted on STM32756G-EVAL and STM32746G-EVAL board.
00009   @verbatim
00010   ==============================================================================
00011                      ##### How to use this driver #####
00012   ==============================================================================
00013   [..]
00014    (#) This driver is used to drive the N25Q512A QSPI external
00015        memory mounted on STM32756G-EVAL and STM32746G-EVAL evaluation board.
00016
00017    (#) This driver need a specific component driver (N25Q512A) to be included with.
00018
00019    (#) Initialization steps:
00020        (++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
00021             function includes the MSP layer hardware resources initialization and the
00022             QSPI interface with the external memory.
00023
00024    (#) QSPI memory operations
00025        (++) QSPI memory can be accessed with read/write operations once it is
00026             initialized.
00027             Read/write operation can be performed with AHB access using the functions
00028             BSP_QSPI_Read()/BSP_QSPI_Write().
00029        (++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
00030             (see the QSPI memory data sheet)
00031        (++) Perform erase block operation using the function BSP_QSPI_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_QSPI_Erase_Chip().
00034        (++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
00035             (see the QSPI memory data sheet)
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 /* Includes ------------------------------------------------------------------*/
00068 #include "stm32756g_eval_qspi.h"
00069
00070 /** @addtogroup BSP
00071   * @{
00072   */
00073
00074 /** @addtogroup STM32756G_EVAL
00075   * @{
00076   */
00077
00078 /** @defgroup STM32756G_EVAL_QSPI STM32756G-EVAL QSPI
00079   * @{
00080   */
00081
00082
00083 /* Private variables ---------------------------------------------------------*/
00084
00085 /** @defgroup STM32756G_EVAL_QSPI_Private_Variables Private Variables
00086   * @{
00087   */
00088 QSPI_HandleTypeDef QSPIHandle;
00089
00090 /**
00091   * @}
00092   */
00093
00094
00095
00096 /* Private functions ---------------------------------------------------------*/
00097
00098 /** @defgroup STM32756G_EVAL_QSPI_Private_Functions Private Functions
00099   * @{
00100   */
00101 static uint8_t QSPI_ResetMemory          (QSPI_HandleTypeDef *hqspi);
00102 static uint8_t QSPI_EnterFourBytesAddress(QSPI_HandleTypeDef *hqspi);
00103 static uint8_t QSPI_DummyCyclesCfg       (QSPI_HandleTypeDef *hqspi);
00104 static uint8_t QSPI_WriteEnable          (QSPI_HandleTypeDef *hqspi);
00105 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
00106
00107 /**
00108   * @}
00109   */
00110
00111 /** @defgroup STM32756G_EVAL_QSPI_Exported_Functions Exported Functions
00112   * @{
00113   */
00114
00115 /**
00116   * @brief  Initializes the QSPI interface.
00117   * @retval QSPI memory status
00118   */
00119 uint8_t BSP_QSPI_Init(void)
00120 {
00121   QSPIHandle.Instance = QUADSPI;
00122
00123   /* Call the DeInit function to reset the driver */
00124   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00125   {
00126     return QSPI_ERROR;
00127   }
00128
00129   /* System level initialization */
00130   BSP_QSPI_MspInit(&QSPIHandle, NULL);
00131
00132   /* QSPI initialization */
00133   /* QSPI freq = SYSCLK /(1 + ClockPrescaler) = 216 MHz/(1+1) = 108 Mhz */
00134   QSPIHandle.Init.ClockPrescaler     = 1;
00135   QSPIHandle.Init.FifoThreshold      = 4;
00136   QSPIHandle.Init.SampleShifting     = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
00137   QSPIHandle.Init.FlashSize          = POSITION_VAL(N25Q512A_FLASH_SIZE) - 1;
00138   QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE; /* Min 50ns for nonRead */
00139   QSPIHandle.Init.ClockMode          = QSPI_CLOCK_MODE_0;
00140   QSPIHandle.Init.FlashID            = QSPI_FLASH_ID_1;
00141   QSPIHandle.Init.DualFlash          = QSPI_DUALFLASH_DISABLE;
00142
00143   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00144   {
00145     return QSPI_ERROR;
00146   }
00147
00148   /* QSPI memory reset */
00149   if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
00150   {
00151     return QSPI_NOT_SUPPORTED;
00152   }
00153
00154   /* Set the QSPI memory in 4-bytes address mode */
00155   if (QSPI_EnterFourBytesAddress(&QSPIHandle) != QSPI_OK)
00156   {
00157     return QSPI_NOT_SUPPORTED;
00158   }
00159
00160   /* Configuration of the dummy cycles on QSPI memory side */
00161   if (QSPI_DummyCyclesCfg(&QSPIHandle) != QSPI_OK)
00162   {
00163     return QSPI_NOT_SUPPORTED;
00164   }
00165
00166   return QSPI_OK;
00167 }
00168
00169 /**
00170   * @brief  De-Initializes the QSPI interface.
00171   * @retval QSPI memory status
00172   */
00173 uint8_t BSP_QSPI_DeInit(void)
00174 {
00175   QSPIHandle.Instance = QUADSPI;
00176
00177   /* Call the DeInit function to reset the driver */
00178   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00179   {
00180     return QSPI_ERROR;
00181   }
00182
00183   /* System level De-initialization */
00184   BSP_QSPI_MspDeInit(&QSPIHandle, NULL);
00185
00186   return QSPI_OK;
00187 }
00188
00189 /**
00190   * @brief  Reads an amount of data from the QSPI memory.
00191   * @param  pData: Pointer to data to be read
00192   * @param  ReadAddr: Read start address
00193   * @param  Size: Size of data to read
00194   * @retval QSPI memory status
00195   */
00196 uint8_t BSP_QSPI_Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
00197 {
00198   QSPI_CommandTypeDef s_command;
00199
00200   /* Initialize the read command */
00201   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00202   s_command.Instruction       = QUAD_OUT_FAST_READ_CMD;
00203   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00204   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00205   s_command.Address           = ReadAddr;
00206   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00207   s_command.DataMode          = QSPI_DATA_4_LINES;
00208   s_command.DummyCycles       = N25Q512A_DUMMY_CYCLES_READ_QUAD;
00209   s_command.NbData            = Size;
00210   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00211   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00212   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00213
00214   /* Configure the command */
00215   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00216   {
00217     return QSPI_ERROR;
00218   }
00219
00220   /* Set S# timing for Read command */
00221   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_3_CYCLE);
00222
00223   /* Reception of the data */
00224   if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00225   {
00226     return QSPI_ERROR;
00227   }
00228
00229   /* Restore S# timing for nonRead commands */
00230   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_6_CYCLE);
00231
00232   return QSPI_OK;
00233 }
00234
00235 /**
00236   * @brief  Writes an amount of data to the QSPI memory.
00237   * @param  pData: Pointer to data to be written
00238   * @param  WriteAddr: Write start address
00239   * @param  Size: Size of data to write
00240   * @retval QSPI memory status
00241   */
00242 uint8_t BSP_QSPI_Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
00243 {
00244   QSPI_CommandTypeDef s_command;
00245   uint32_t end_addr, current_size, current_addr;
00246
00247   /* Calculation of the size between the write address and the end of the page */
00248   current_size = N25Q512A_PAGE_SIZE - (WriteAddr % N25Q512A_PAGE_SIZE);
00249
00250   /* Check if the size of the data is less than the remaining place in the page */
00251   if (current_size > Size)
00252   {
00253     current_size = Size;
00254   }
00255
00256   /* Initialize the address variables */
00257   current_addr = WriteAddr;
00258   end_addr = WriteAddr + Size;
00259
00260   /* Initialize the program command */
00261   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00262   s_command.Instruction       = QUAD_IN_FAST_PROG_CMD;
00263   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00264   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00265   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00266   s_command.DataMode          = QSPI_DATA_4_LINES;
00267   s_command.DummyCycles       = 0;
00268   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00269   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00270   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00271
00272   /* Perform the write page by page */
00273   do
00274   {
00275     s_command.Address = current_addr;
00276     s_command.NbData  = current_size;
00277
00278     /* Enable write operations */
00279     if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00280     {
00281       return QSPI_ERROR;
00282     }
00283
00284     /* Configure the command */
00285     if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00286     {
00287       return QSPI_ERROR;
00288     }
00289
00290     /* Transmission of the data */
00291     if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00292     {
00293       return QSPI_ERROR;
00294     }
00295
00296     /* Configure automatic polling mode to wait for end of program */
00297     if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00298     {
00299       return QSPI_ERROR;
00300     }
00301
00302     /* Update the address and size variables for next page programming */
00303     current_addr += current_size;
00304     pData += current_size;
00305     current_size = ((current_addr + N25Q512A_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : N25Q512A_PAGE_SIZE;
00306   } while (current_addr < end_addr);
00307
00308   return QSPI_OK;
00309 }
00310
00311 /**
00312   * @brief  Erases the specified block of the QSPI memory.
00313   * @param  BlockAddress: Block address to erase
00314   * @retval QSPI memory status
00315   */
00316 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
00317 {
00318   QSPI_CommandTypeDef s_command;
00319
00320   /* Initialize the erase command */
00321   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00322   s_command.Instruction       = SUBSECTOR_ERASE_CMD;
00323   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00324   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00325   s_command.Address           = BlockAddress;
00326   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00327   s_command.DataMode          = QSPI_DATA_NONE;
00328   s_command.DummyCycles       = 0;
00329   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00330   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00331   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00332
00333   /* Enable write operations */
00334   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00335   {
00336     return QSPI_ERROR;
00337   }
00338
00339   /* Send the command */
00340   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00341   {
00342     return QSPI_ERROR;
00343   }
00344
00345   /* Configure automatic polling mode to wait for end of erase */
00346   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q512A_SUBSECTOR_ERASE_MAX_TIME) != QSPI_OK)
00347   {
00348     return QSPI_ERROR;
00349   }
00350
00351   return QSPI_OK;
00352 }
00353
00354 /**
00355   * @brief  Erases the entire QSPI memory.
00356   * @retval QSPI memory status
00357   */
00358 uint8_t BSP_QSPI_Erase_Chip(void)
00359 {
00360   QSPI_CommandTypeDef s_command;
00361
00362   /* Initialize the erase command */
00363   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00364   s_command.Instruction       = BULK_ERASE_CMD;
00365   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00366   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00367   s_command.DataMode          = QSPI_DATA_NONE;
00368   s_command.DummyCycles       = 0;
00369   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00370   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00371   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00372
00373   /* Enable write operations */
00374   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00375   {
00376     return QSPI_ERROR;
00377   }
00378
00379   /* Send the command */
00380   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00381   {
00382     return QSPI_ERROR;
00383   }
00384
00385   /* Configure automatic polling mode to wait for end of erase */
00386   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q512A_BULK_ERASE_MAX_TIME) != QSPI_OK)
00387   {
00388     return QSPI_ERROR;
00389   }
00390
00391   return QSPI_OK;
00392 }
00393
00394 /**
00395   * @brief  Reads current status of the QSPI memory.
00396   * @retval QSPI memory status
00397   */
00398 uint8_t BSP_QSPI_GetStatus(void)
00399 {
00400   QSPI_CommandTypeDef s_command;
00401   uint8_t reg;
00402
00403   /* Initialize the read flag status register command */
00404   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00405   s_command.Instruction       = READ_FLAG_STATUS_REG_CMD;
00406   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00407   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00408   s_command.DataMode          = QSPI_DATA_1_LINE;
00409   s_command.DummyCycles       = 0;
00410   s_command.NbData            = 1;
00411   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00412   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00413   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00414
00415   /* Configure the command */
00416   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00417   {
00418     return QSPI_ERROR;
00419   }
00420
00421   /* Reception of the data */
00422   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00423   {
00424     return QSPI_ERROR;
00425   }
00426
00427   /* Check the value of the register */
00428   if ((reg & (N25Q512A_FSR_PRERR | N25Q512A_FSR_VPPERR | N25Q512A_FSR_PGERR | N25Q512A_FSR_ERERR)) != 0)
00429   {
00430     return QSPI_ERROR;
00431   }
00432   else if ((reg & (N25Q512A_FSR_PGSUS | N25Q512A_FSR_ERSUS)) != 0)
00433   {
00434     return QSPI_SUSPENDED;
00435   }
00436   else if ((reg & N25Q512A_FSR_READY) != 0)
00437   {
00438     return QSPI_OK;
00439   }
00440   else
00441   {
00442     return QSPI_BUSY;
00443   }
00444 }
00445
00446 /**
00447   * @brief  Return the configuration of the QSPI memory.
00448   * @param  pInfo: pointer on the configuration structure
00449   * @retval QSPI memory status
00450   */
00451 uint8_t BSP_QSPI_GetInfo(QSPI_Info* pInfo)
00452 {
00453   /* Configure the structure with the memory configuration */
00454   pInfo->FlashSize          = N25Q512A_FLASH_SIZE;
00455   pInfo->EraseSectorSize    = N25Q512A_SUBSECTOR_SIZE;
00456   pInfo->EraseSectorsNumber = (N25Q512A_FLASH_SIZE/N25Q512A_SUBSECTOR_SIZE);
00457   pInfo->ProgPageSize       = N25Q512A_PAGE_SIZE;
00458   pInfo->ProgPagesNumber    = (N25Q512A_FLASH_SIZE/N25Q512A_PAGE_SIZE);
00459
00460   return QSPI_OK;
00461 }
00462
00463 /**
00464   * @brief  Configure the QSPI in memory-mapped mode
00465   * @retval QSPI memory status
00466   */
00467 uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
00468 {
00469   QSPI_CommandTypeDef      s_command;
00470   QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
00471
00472   /* Configure the command for the read instruction */
00473   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00474   s_command.Instruction       = QUAD_OUT_FAST_READ_CMD;
00475   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00476   s_command.AddressSize       = QSPI_ADDRESS_32_BITS;
00477   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00478   s_command.DataMode          = QSPI_DATA_4_LINES;
00479   s_command.DummyCycles       = N25Q512A_DUMMY_CYCLES_READ_QUAD;
00480   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00481   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00482   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00483
00484   /* Configure the memory mapped mode */
00485   s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
00486   s_mem_mapped_cfg.TimeOutPeriod     = 0;
00487
00488   if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
00489   {
00490     return QSPI_ERROR;
00491   }
00492
00493   return QSPI_OK;
00494 }
00495
00496 /**
00497   * @}
00498   */
00499
00500 /** @addtogroup STM32756G_EVAL_QSPI_Private_Functions
00501   * @{
00502   */
00503
00504 /**
00505   * @brief QSPI MSP Initialization
00506   *        This function configures the hardware resources used in this example:
00507   *           - Peripheral's clock enable
00508   *           - Peripheral's GPIO Configuration
00509   *           - NVIC configuration for QSPI interrupt
00510   * @retval None
00511   */
00512 __weak void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params)
00513 {
00514   GPIO_InitTypeDef gpio_init_structure;
00515
00516   /*##-1- Enable peripherals and GPIO Clocks #################################*/
00517   /* Enable the QuadSPI memory interface clock */
00518   QSPI_CLK_ENABLE();
00519   /* Reset the QuadSPI memory interface */
00520   QSPI_FORCE_RESET();
00521   QSPI_RELEASE_RESET();
00522   /* Enable GPIO clocks */
00523   QSPI_CS_GPIO_CLK_ENABLE();
00524   QSPI_CLK_GPIO_CLK_ENABLE();
00525   QSPI_D0_GPIO_CLK_ENABLE();
00526   QSPI_D1_GPIO_CLK_ENABLE();
00527   QSPI_D2_GPIO_CLK_ENABLE();
00528   QSPI_D3_GPIO_CLK_ENABLE();
00529
00530   /*##-2- Configure peripheral GPIO ##########################################*/
00531   /* QSPI CS GPIO pin configuration  */
00532   gpio_init_structure.Pin       = QSPI_CS_PIN;
00533   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00534   gpio_init_structure.Pull      = GPIO_PULLUP;
00535   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00536   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00537   HAL_GPIO_Init(QSPI_CS_GPIO_PORT, &gpio_init_structure);
00538
00539   /* QSPI CLK GPIO pin configuration  */
00540   gpio_init_structure.Pin       = QSPI_CLK_PIN;
00541   gpio_init_structure.Pull      = GPIO_NOPULL;
00542   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00543   HAL_GPIO_Init(QSPI_CLK_GPIO_PORT, &gpio_init_structure);
00544
00545   /* QSPI D0 GPIO pin configuration  */
00546   gpio_init_structure.Pin       = QSPI_D0_PIN;
00547   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00548   HAL_GPIO_Init(QSPI_D0_GPIO_PORT, &gpio_init_structure);
00549
00550   /* QSPI D1 GPIO pin configuration  */
00551   gpio_init_structure.Pin       = QSPI_D1_PIN;
00552   gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
00553   HAL_GPIO_Init(QSPI_D1_GPIO_PORT, &gpio_init_structure);
00554
00555   /* QSPI D2 GPIO pin configuration  */
00556   gpio_init_structure.Pin       = QSPI_D2_PIN;
00557   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00558   HAL_GPIO_Init(QSPI_D2_GPIO_PORT, &gpio_init_structure);
00559
00560   /* QSPI D3 GPIO pin configuration  */
00561   gpio_init_structure.Pin       = QSPI_D3_PIN;
00562   gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
00563   HAL_GPIO_Init(QSPI_D3_GPIO_PORT, &gpio_init_structure);
00564
00565   /*##-3- Configure the NVIC for QSPI #########################################*/
00566   /* NVIC configuration for QSPI interrupt */
00567   HAL_NVIC_SetPriority(QUADSPI_IRQn, 0x0F, 0);
00568   HAL_NVIC_EnableIRQ(QUADSPI_IRQn);
00569 }
00570
00571 /**
00572   * @brief QSPI MSP De-Initialization
00573   *        This function frees the hardware resources used in this example:
00574   *          - Disable the Peripheral's clock
00575   *          - Revert GPIO and NVIC configuration to their default state
00576   * @retval None
00577   */
00578 __weak void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params)
00579 {
00580   /*##-1- Disable the NVIC for QSPI ###########################################*/
00581   HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
00582
00583   /*##-2- Disable peripherals and GPIO Clocks ################################*/
00584   /* De-Configure QSPI pins */
00585   HAL_GPIO_DeInit(QSPI_CS_GPIO_PORT, QSPI_CS_PIN);
00586   HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
00587   HAL_GPIO_DeInit(QSPI_D0_GPIO_PORT, QSPI_D0_PIN);
00588   HAL_GPIO_DeInit(QSPI_D1_GPIO_PORT, QSPI_D1_PIN);
00589   HAL_GPIO_DeInit(QSPI_D2_GPIO_PORT, QSPI_D2_PIN);
00590   HAL_GPIO_DeInit(QSPI_D3_GPIO_PORT, QSPI_D3_PIN);
00591
00592   /*##-3- Reset peripherals ##################################################*/
00593   /* Reset the QuadSPI memory interface */
00594   QSPI_FORCE_RESET();
00595   QSPI_RELEASE_RESET();
00596
00597   /* Disable the QuadSPI memory interface clock */
00598   QSPI_CLK_DISABLE();
00599 }
00600
00601 /**
00602   * @brief  This function reset the QSPI memory.
00603   * @param  hqspi: QSPI handle
00604   * @retval None
00605   */
00606 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
00607 {
00608   QSPI_CommandTypeDef s_command;
00609
00610   /* Initialize the reset enable command */
00611   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00612   s_command.Instruction       = RESET_ENABLE_CMD;
00613   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00614   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00615   s_command.DataMode          = QSPI_DATA_NONE;
00616   s_command.DummyCycles       = 0;
00617   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00618   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00619   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00620
00621   /* Send the command */
00622   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00623   {
00624     return QSPI_ERROR;
00625   }
00626
00627   /* Send the reset memory command */
00628   s_command.Instruction = RESET_MEMORY_CMD;
00629   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00630   {
00631     return QSPI_ERROR;
00632   }
00633
00634   /* Configure automatic polling mode to wait the memory is ready */
00635   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00636   {
00637     return QSPI_ERROR;
00638   }
00639
00640   return QSPI_OK;
00641 }
00642
00643 /**
00644   * @brief  This function set the QSPI memory in 4-byte address mode
00645   * @param  hqspi: QSPI handle
00646   * @retval None
00647   */
00648 static uint8_t QSPI_EnterFourBytesAddress(QSPI_HandleTypeDef *hqspi)
00649 {
00650   QSPI_CommandTypeDef s_command;
00651
00652   /* Initialize the command */
00653   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00654   s_command.Instruction       = ENTER_4_BYTE_ADDR_MODE_CMD;
00655   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00656   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00657   s_command.DataMode          = QSPI_DATA_NONE;
00658   s_command.DummyCycles       = 0;
00659   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00660   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00661   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00662
00663   /* Enable write operations */
00664   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00665   {
00666     return QSPI_ERROR;
00667   }
00668
00669   /* Send the command */
00670   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00671   {
00672     return QSPI_ERROR;
00673   }
00674
00675   /* Configure automatic polling mode to wait the memory is ready */
00676   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00677   {
00678     return QSPI_ERROR;
00679   }
00680
00681   return QSPI_OK;
00682 }
00683
00684 /**
00685   * @brief  This function configure the dummy cycles on memory side.
00686   * @param  hqspi: QSPI handle
00687   * @retval None
00688   */
00689 static uint8_t QSPI_DummyCyclesCfg(QSPI_HandleTypeDef *hqspi)
00690 {
00691   QSPI_CommandTypeDef s_command;
00692   uint8_t reg;
00693
00694   /* Initialize the read volatile configuration register command */
00695   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00696   s_command.Instruction       = READ_VOL_CFG_REG_CMD;
00697   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00698   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00699   s_command.DataMode          = QSPI_DATA_1_LINE;
00700   s_command.DummyCycles       = 0;
00701   s_command.NbData            = 1;
00702   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00703   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00704   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00705
00706   /* Configure the command */
00707   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00708   {
00709     return QSPI_ERROR;
00710   }
00711
00712   /* Reception of the data */
00713   if (HAL_QSPI_Receive(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00714   {
00715     return QSPI_ERROR;
00716   }
00717
00718   /* Enable write operations */
00719   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00720   {
00721     return QSPI_ERROR;
00722   }
00723
00724   /* Update volatile configuration register (with new dummy cycles) */
00725   s_command.Instruction = WRITE_VOL_CFG_REG_CMD;
00726   MODIFY_REG(reg, N25Q512A_VCR_NB_DUMMY, (N25Q512A_DUMMY_CYCLES_READ_QUAD << POSITION_VAL(N25Q512A_VCR_NB_DUMMY)));
00727
00728   /* Configure the write volatile configuration register command */
00729   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00730   {
00731     return QSPI_ERROR;
00732   }
00733
00734   /* Transmission of the data */
00735   if (HAL_QSPI_Transmit(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00736   {
00737     return QSPI_ERROR;
00738   }
00739
00740   return QSPI_OK;
00741 }
00742
00743 /**
00744   * @brief  This function send a Write Enable and wait it is effective.
00745   * @param  hqspi: QSPI handle
00746   * @retval None
00747   */
00748 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
00749 {
00750   QSPI_CommandTypeDef     s_command;
00751   QSPI_AutoPollingTypeDef s_config;
00752
00753   /* Enable write operations */
00754   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00755   s_command.Instruction       = WRITE_ENABLE_CMD;
00756   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00757   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00758   s_command.DataMode          = QSPI_DATA_NONE;
00759   s_command.DummyCycles       = 0;
00760   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00761   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00762   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00763
00764   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00765   {
00766     return QSPI_ERROR;
00767   }
00768
00769   /* Configure automatic polling mode to wait for write enabling */
00770   s_config.Match           = N25Q512A_SR_WREN;
00771   s_config.Mask            = N25Q512A_SR_WREN;
00772   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00773   s_config.StatusBytesSize = 1;
00774   s_config.Interval        = 0x10;
00775   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00776
00777   s_command.Instruction    = READ_STATUS_REG_CMD;
00778   s_command.DataMode       = QSPI_DATA_1_LINE;
00779
00780   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00781   {
00782     return QSPI_ERROR;
00783   }
00784
00785   return QSPI_OK;
00786 }
00787
00788 /**
00789   * @brief  This function read the SR of the memory and wait the EOP.
00790   * @param  hqspi: QSPI handle
00791   * @param  Timeout
00792   * @retval None
00793   */
00794 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
00795 {
00796   QSPI_CommandTypeDef     s_command;
00797   QSPI_AutoPollingTypeDef s_config;
00798
00799   /* Configure automatic polling mode to wait for memory ready */
00800   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00801   s_command.Instruction       = READ_STATUS_REG_CMD;
00802   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00803   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00804   s_command.DataMode          = QSPI_DATA_1_LINE;
00805   s_command.DummyCycles       = 0;
00806   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00807   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00808   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00809
00810   s_config.Match           = 0;
00811   s_config.Mask            = N25Q512A_SR_WIP;
00812   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00813   s_config.StatusBytesSize = 1;
00814   s_config.Interval        = 0x10;
00815   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00816
00817   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, Timeout) != HAL_OK)
00818   {
00819     return QSPI_ERROR;
00820   }
00821
00822   return QSPI_OK;
00823 }
00824 /**
00825   * @}
00826   */
00827
00828 /**
00829   * @}
00830   */
00831
00832 /**
00833   * @}
00834   */
00835
00836 /**
00837   * @}
00838   */
00839
00840 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00841


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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_qspi.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /** @addtogroup BSP
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32756G_EVAL
00044   * @{
00045   */
00046
00047 /* Define to prevent recursive inclusion -------------------------------------*/
00048 #ifndef __STM32756G_EVAL_QSPI_H
00049 #define __STM32756G_EVAL_QSPI_H
00050
00051 #ifdef __cplusplus
00052  extern "C" {
00053 #endif
00054
00055 /* Includes ------------------------------------------------------------------*/
00056 #include "stm32f7xx_hal.h"
00057 #include "../Components/n25q512a/n25q512a.h"
00058
00059 /** @addtogroup STM32756G_EVAL_QSPI
00060   * @{
00061   */
00062
00063
00064 /* Exported constants --------------------------------------------------------*/
00065 /** @defgroup STM32756G_EVAL_QSPI_Exported_Constants Exported Constants
00066   * @{
00067   */
00068 /* QSPI Error codes */
00069 #define QSPI_OK            ((uint8_t)0x00)
00070 #define QSPI_ERROR         ((uint8_t)0x01)
00071 #define QSPI_BUSY          ((uint8_t)0x02)
00072 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00073 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00074
00075
00076 /* Definition for QSPI clock resources */
00077 #define QSPI_CLK_ENABLE()          __HAL_RCC_QSPI_CLK_ENABLE()
00078 #define QSPI_CLK_DISABLE()         __HAL_RCC_QSPI_CLK_DISABLE()
00079 #define QSPI_CS_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOB_CLK_ENABLE()
00080 #define QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
00081 #define QSPI_D0_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00082 #define QSPI_D1_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00083 #define QSPI_D2_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00084 #define QSPI_D3_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOF_CLK_ENABLE()
00085
00086 #define QSPI_FORCE_RESET()         __HAL_RCC_QSPI_FORCE_RESET()
00087 #define QSPI_RELEASE_RESET()       __HAL_RCC_QSPI_RELEASE_RESET()
00088
00089 /* Definition for QSPI Pins */
00090 #define QSPI_CS_PIN                GPIO_PIN_6
00091 #define QSPI_CS_GPIO_PORT          GPIOB
00092 #define QSPI_CLK_PIN               GPIO_PIN_2
00093 #define QSPI_CLK_GPIO_PORT         GPIOB
00094 #define QSPI_D0_PIN                GPIO_PIN_8
00095 #define QSPI_D0_GPIO_PORT          GPIOF
00096 #define QSPI_D1_PIN                GPIO_PIN_9
00097 #define QSPI_D1_GPIO_PORT          GPIOF
00098 #define QSPI_D2_PIN                GPIO_PIN_7
00099 #define QSPI_D2_GPIO_PORT          GPIOF
00100 #define QSPI_D3_PIN                GPIO_PIN_6
00101 #define QSPI_D3_GPIO_PORT          GPIOF
00102
00103 /* N25Q512A13GSF40E Micron memory */
00104 /* Size of the flash */
00105 #define QSPI_FLASH_SIZE            25     /* Address bus width to access whole memory space */
00106 #define QSPI_PAGE_SIZE             256
00107
00108 /* This alias is added as the name of Memory mapped fucntion changed */
00109 #define BSP_QSPI_MemoryMappedMode  BSP_QSPI_EnableMemoryMappedMode
00110 /**
00111   * @}
00112   */
00113
00114 /* Exported types ------------------------------------------------------------*/
00115 /** @defgroup STM32756G_EVAL_QSPI_Exported_Types Exported Types
00116   * @{
00117   */
00118 /* QSPI Info */
00119 typedef struct {
00120   uint32_t FlashSize;          /*!< Size of the flash */
00121   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation */
00122   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00123   uint32_t ProgPageSize;       /*!< Size of pages for the program operation */
00124   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00125 } QSPI_Info;
00126
00127 /**
00128   * @}
00129   */
00130
00131
00132 /* Exported functions --------------------------------------------------------*/
00133 /** @addtogroup STM32756G_EVAL_QSPI_Exported_Functions
00134   * @{
00135   */
00136 uint8_t BSP_QSPI_Init       (void);
00137 uint8_t BSP_QSPI_DeInit     (void);
00138 uint8_t BSP_QSPI_Read       (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00139 uint8_t BSP_QSPI_Write      (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00140 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00141 uint8_t BSP_QSPI_Erase_Chip (void);
00142 uint8_t BSP_QSPI_GetStatus  (void);
00143 uint8_t BSP_QSPI_GetInfo    (QSPI_Info* pInfo);
00144 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00145
00146 /* These functions can be modified in case the current settings
00147    need to be changed for specific application needs */
00148 void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params);
00149 void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params);
00150
00151 /**
00152   * @}
00153   */
00154
00155 /**
00156   * @}
00157   */
00158
00159 #ifdef __cplusplus
00160 }
00161 #endif
00162
00163 #endif /* __STM32756G_EVAL_QSPI_H */
00164 /**
00165   * @}
00166   */
00167
00168 /**
00169   * @}
00170   */
00171
00172 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the uSD card driver mounted on STM32756G-EVAL and
00008   *          STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the micro SD external card mounted on STM32756G-EVAL
00013      evaluation board.
00014    - This driver does not need a specific component driver for the micro SD device
00015      to be included with.
00016
00017   Driver description:
00018   ------------------
00019   + Initialization steps:
00020      o Initialize the micro SD card using the BSP_SD_Init() function. This
00021        function includes the MSP layer hardware resources initialization and the
00022        SDIO interface configuration to interface with the external micro SD. It
00023        also includes the micro SD initialization sequence.
00024      o To check the SD card presence you can use the function BSP_SD_IsDetected() which
00025        returns the detection status
00026      o If SD presence detection interrupt mode is desired, you must configure the
00027        SD detection interrupt mode by calling the function BSP_SD_ITConfig(). The interrupt
00028        is generated as an external interrupt whenever the micro SD card is
00029        plugged/unplugged in/from the evaluation board. The SD detection is managed by MFX,
00030        so the SD detection interrupt has to be treated by MFX_IRQOUT gpio pin IRQ handler.
00031      o The function BSP_SD_GetCardInfo() is used to get the micro SD card information
00032        which is stored in the structure "HAL_SD_CardInfoTypedef".
00033
00034   + Micro SD card operations
00035      o The micro SD card can be accessed with read/write block(s) operations once
00036        it is ready for access. The access can be performed whether using the polling
00037        mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA
00038        transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
00039      o The DMA transfer complete is used with interrupt mode. Once the SD transfer
00040        is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
00041        the DMA Tx/Rx transfer complete are handled using the functions
00042        BSP_SD_DMA_Tx_IRQHandler()/BSP_SD_DMA_Rx_IRQHandler(). The corresponding user callbacks
00043        are implemented by the user at application level.
00044      o The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
00045        the number of blocks to erase.
00046      o The SD runtime status is returned when calling the function BSP_SD_GetCardState().
00047
00048
00049   @endverbatim
00050   ******************************************************************************
00051   * @attention
00052   *
00053   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00054   *
00055   * Redistribution and use in source and binary forms, with or without modification,
00056   * are permitted provided that the following conditions are met:
00057   *   1. Redistributions of source code must retain the above copyright notice,
00058   *      this list of conditions and the following disclaimer.
00059   *   2. Redistributions in binary form must reproduce the above copyright notice,
00060   *      this list of conditions and the following disclaimer in the documentation
00061   *      and/or other materials provided with the distribution.
00062   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00063   *      may be used to endorse or promote products derived from this software
00064   *      without specific prior written permission.
00065   *
00066   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00067   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00068   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00069   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00070   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00071   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00072   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00073   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00074   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00075   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00076   *
00077   ******************************************************************************
00078   */
00079
00080 /* Includes ------------------------------------------------------------------*/
00081 #include "stm32756g_eval_sd.h"
00082
00083 /** @addtogroup BSP
00084   * @{
00085   */
00086
00087 /** @addtogroup STM32756G_EVAL
00088   * @{
00089   */
00090
00091 /** @defgroup STM32756G_EVAL_SD STM32756G_EVAL SD
00092   * @{
00093   */
00094
00095
00096 /** @defgroup STM32756G_EVAL_SD_Private_TypesDefinitions SD Private TypesDefinitions
00097   * @{
00098   */
00099 /**
00100   * @}
00101   */
00102
00103 /** @defgroup STM32756G_EVAL_SD_Private_Defines SD Private Defines
00104   * @{
00105   */
00106 /**
00107   * @}
00108   */
00109
00110 /** @defgroup STM32756G_EVAL_SD_Private_Macros SD Private Macros
00111   * @{
00112   */
00113 /**
00114   * @}
00115   */
00116
00117 /** @defgroup STM32756G_EVAL_SD_Private_Variables SD Private Variables
00118   * @{
00119   */
00120 SD_HandleTypeDef uSdHandle;
00121 static uint8_t UseExtiModeDetection = 0;
00122
00123 /**
00124   * @}
00125   */
00126
00127 /** @defgroup STM32756G_EVAL_SD_Private_FunctionPrototypes SD Private Functions Prototypes
00128   * @{
00129   */
00130 /**
00131   * @}
00132   */
00133
00134 /** @defgroup STM32756G_EVAL_SD_Private_Functions SD Private Functions
00135   * @{
00136   */
00137
00138 /**
00139   * @brief  Initializes the SD card device.
00140   * @retval SD status
00141   */
00142 uint8_t BSP_SD_Init(void)
00143 {
00144   uint8_t sd_state = MSD_OK;
00145
00146   /* uSD device interface configuration */
00147   uSdHandle.Instance = SDMMC1;
00148
00149   uSdHandle.Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00150   uSdHandle.Init.ClockBypass         = SDMMC_CLOCK_BYPASS_DISABLE;
00151   uSdHandle.Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00152   uSdHandle.Init.BusWide             = SDMMC_BUS_WIDE_1B;
00153   uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
00154   uSdHandle.Init.ClockDiv            = SDMMC_TRANSFER_CLK_DIV;
00155
00156   /* Initialize IO functionalities (MFX) used by SD detect pin */
00157   BSP_IO_Init();
00158
00159   /* Check if the SD card is plugged in the slot */
00160   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
00161   if(BSP_SD_IsDetected() != SD_PRESENT)
00162   {
00163     return MSD_ERROR_SD_NOT_PRESENT;
00164   }
00165
00166   /* Msp SD initialization */
00167   BSP_SD_MspInit(&uSdHandle, NULL);
00168
00169   /* HAL SD initialization */
00170   if(HAL_SD_Init(&uSdHandle) != MSD_OK)
00171   {
00172     sd_state = MSD_ERROR;
00173   }
00174
00175   /* Configure SD Bus width */
00176   if(sd_state == MSD_OK)
00177   {
00178     /* Enable wide operation */
00179     if(HAL_SD_ConfigWideBusOperation(&uSdHandle, SDMMC_BUS_WIDE_4B) != HAL_OK)
00180     {
00181       sd_state = MSD_ERROR;
00182     }
00183     else
00184     {
00185       sd_state = MSD_OK;
00186     }
00187   }
00188
00189   return  sd_state;
00190 }
00191
00192 /**
00193   * @brief  DeInitializes the SD card device.
00194   * @retval SD status
00195   */
00196 uint8_t BSP_SD_DeInit(void)
00197 {
00198   uint8_t sd_state = MSD_OK;
00199
00200   uSdHandle.Instance = SDMMC1;
00201
00202   /* Set back Mfx pin to INPUT mode in case it was in exti */
00203   UseExtiModeDetection = 0;
00204   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
00205
00206   /* HAL SD deinitialization */
00207   if(HAL_SD_DeInit(&uSdHandle) != HAL_OK)
00208   {
00209     sd_state = MSD_ERROR;
00210   }
00211
00212   /* Msp SD deinitialization */
00213   uSdHandle.Instance = SDMMC1;
00214   BSP_SD_MspDeInit(&uSdHandle, NULL);
00215
00216   return  sd_state;
00217 }
00218
00219 /**
00220   * @brief  Configures Interrupt mode for SD detection pin.
00221   * @retval Returns 0
00222   */
00223 uint8_t BSP_SD_ITConfig(void)
00224 {
00225   /* Configure Interrupt mode for SD detection pin */
00226   /* Note: disabling exti mode can be done calling SD_DeInit() */
00227   UseExtiModeDetection = 1;
00228   BSP_SD_IsDetected();
00229
00230   return 0;
00231 }
00232
00233 /**
00234  * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00235  * @retval Returns if SD is detected or not
00236  */
00237 uint8_t BSP_SD_IsDetected(void)
00238 {
00239   __IO uint8_t status = SD_PRESENT;
00240
00241   /* Check SD card detect pin */
00242   if((BSP_IO_ReadPin(SD_DETECT_PIN)&SD_DETECT_PIN) != SD_DETECT_PIN)
00243   {
00244      if (UseExtiModeDetection)
00245      {
00246       BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_RISING_EDGE_PU);
00247      }
00248   }
00249   else
00250   {
00251     status = SD_NOT_PRESENT;
00252     if (UseExtiModeDetection)
00253     {
00254       BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_FALLING_EDGE_PU);
00255     }
00256   }
00257   return status;
00258 }
00259
00260 /**
00261   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00262   * @param  pData: Pointer to the buffer that will contain the data to transmit
00263   * @param  ReadAddr: Address from where data is to be read
00264   * @param  NumOfBlocks: Number of SD blocks to read
00265   * @param  Timeout: Timeout for read operation
00266   * @retval SD status
00267   */
00268 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00269 {
00270   if(HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) != HAL_OK)
00271   {
00272     return MSD_ERROR;
00273   }
00274   else
00275   {
00276     return MSD_OK;
00277   }
00278 }
00279
00280 /**
00281   * @brief  Writes block(s) to a specified address in an SD card, in polling mode.
00282   * @param  pData: Pointer to the buffer that will contain the data to transmit
00283   * @param  WriteAddr: Address from where data is to be written
00284   * @param  NumOfBlocks: Number of SD blocks to write
00285   * @param  Timeout: Timeout for write operation
00286   * @retval SD status
00287   */
00288 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00289 {
00290   if(HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) != HAL_OK)
00291   {
00292     return MSD_ERROR;
00293   }
00294   else
00295   {
00296     return MSD_OK;
00297   }
00298 }
00299
00300 /**
00301   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00302   * @param  pData: Pointer to the buffer that will contain the data to transmit
00303   * @param  ReadAddr: Address from where data is to be read
00304   * @param  NumOfBlocks: Number of SD blocks to read
00305   * @retval SD status
00306   */
00307 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
00308 {
00309   /* Read block(s) in DMA transfer mode */
00310   if(HAL_SD_ReadBlocks_DMA(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks) != HAL_OK)
00311   {
00312     return MSD_ERROR;
00313   }
00314   else
00315   {
00316     return MSD_OK;
00317   }
00318 }
00319
00320 /**
00321   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00322   * @param  pData: Pointer to the buffer that will contain the data to transmit
00323   * @param  WriteAddr: Address from where data is to be written
00324   * @param  NumOfBlocks: Number of SD blocks to write
00325   * @retval SD status
00326   */
00327 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
00328 {
00329   /* Write block(s) in DMA transfer mode */
00330   if(HAL_SD_WriteBlocks_DMA(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK)
00331   {
00332     return MSD_ERROR;
00333   }
00334   else
00335   {
00336     return MSD_OK;
00337   }
00338 }
00339
00340 /**
00341   * @brief  Erases the specified memory area of the given SD card.
00342   * @param  StartAddr: Start byte address
00343   * @param  EndAddr: End byte address
00344   * @retval SD status
00345   */
00346 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
00347 {
00348   if(HAL_SD_Erase(&uSdHandle, StartAddr, EndAddr) != HAL_OK)
00349   {
00350     return MSD_ERROR;
00351   }
00352   else
00353   {
00354     return MSD_OK;
00355   }
00356 }
00357
00358 /**
00359   * @brief  Initializes the SD MSP.
00360   * @param  hsd: SD handle
00361   * @param  Params
00362   * @retval None
00363   */
00364 __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
00365 {
00366   static DMA_HandleTypeDef dma_rx_handle;
00367   static DMA_HandleTypeDef dma_tx_handle;
00368   GPIO_InitTypeDef gpio_init_structure;
00369
00370   /* Camera has to be powered down as some signals use same GPIOs between
00371    * SD card and camera bus. Camera drives its signals to low impedance
00372    * when powered ON. So the camera is powered off to let its signals
00373    * in high impedance */
00374
00375   /* Camera power down sequence */
00376   BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
00377   BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
00378   /* De-assert the camera STANDBY pin (active high) */
00379   BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
00380   /* Assert the camera RSTI pin (active low) */
00381   BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
00382
00383   /* Enable SDIO clock */
00384   __HAL_RCC_SDMMC1_CLK_ENABLE();
00385
00386   /* Enable DMA2 clocks */
00387   __DMAx_TxRx_CLK_ENABLE();
00388
00389   /* Enable GPIOs clock */
00390   __HAL_RCC_GPIOC_CLK_ENABLE();
00391   __HAL_RCC_GPIOD_CLK_ENABLE();
00392
00393   /* Common GPIO configuration */
00394   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00395   gpio_init_structure.Pull      = GPIO_PULLUP;
00396   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00397   gpio_init_structure.Alternate = GPIO_AF12_SDMMC1;
00398
00399   /* GPIOC configuration */
00400   gpio_init_structure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00401
00402   HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00403
00404   /* GPIOD configuration */
00405   gpio_init_structure.Pin = GPIO_PIN_2;
00406   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00407
00408   /* NVIC configuration for SDIO interrupts */
00409   HAL_NVIC_SetPriority(SDMMC1_IRQn, 0x0E, 0);
00410   HAL_NVIC_EnableIRQ(SDMMC1_IRQn);
00411
00412   /* Configure DMA Rx parameters */
00413   dma_rx_handle.Init.Channel             = SD_DMAx_Rx_CHANNEL;
00414   dma_rx_handle.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00415   dma_rx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00416   dma_rx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00417   dma_rx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00418   dma_rx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00419   dma_rx_handle.Init.Mode                = DMA_PFCTRL;
00420   dma_rx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00421   dma_rx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00422   dma_rx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00423   dma_rx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00424   dma_rx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00425
00426   dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00427
00428   /* Associate the DMA handle */
00429   __HAL_LINKDMA(hsd, hdmarx, dma_rx_handle);
00430
00431   /* Deinitialize the stream for new transfer */
00432   HAL_DMA_DeInit(&dma_rx_handle);
00433
00434   /* Configure the DMA stream */
00435   HAL_DMA_Init(&dma_rx_handle);
00436
00437   /* Configure DMA Tx parameters */
00438   dma_tx_handle.Init.Channel             = SD_DMAx_Tx_CHANNEL;
00439   dma_tx_handle.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00440   dma_tx_handle.Init.PeriphInc           = DMA_PINC_DISABLE;
00441   dma_tx_handle.Init.MemInc              = DMA_MINC_ENABLE;
00442   dma_tx_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00443   dma_tx_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00444   dma_tx_handle.Init.Mode                = DMA_PFCTRL;
00445   dma_tx_handle.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00446   dma_tx_handle.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00447   dma_tx_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00448   dma_tx_handle.Init.MemBurst            = DMA_MBURST_INC4;
00449   dma_tx_handle.Init.PeriphBurst         = DMA_PBURST_INC4;
00450
00451   dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00452
00453   /* Associate the DMA handle */
00454   __HAL_LINKDMA(hsd, hdmatx, dma_tx_handle);
00455
00456   /* Deinitialize the stream for new transfer */
00457   HAL_DMA_DeInit(&dma_tx_handle);
00458
00459   /* Configure the DMA stream */
00460   HAL_DMA_Init(&dma_tx_handle);
00461
00462   /* NVIC configuration for DMA transfer complete interrupt */
00463   HAL_NVIC_SetPriority(SD_DMAx_Rx_IRQn, 0x0F, 0);
00464   HAL_NVIC_EnableIRQ(SD_DMAx_Rx_IRQn);
00465
00466   /* NVIC configuration for DMA transfer complete interrupt */
00467   HAL_NVIC_SetPriority(SD_DMAx_Tx_IRQn, 0x0F, 0);
00468   HAL_NVIC_EnableIRQ(SD_DMAx_Tx_IRQn);
00469 }
00470
00471 /**
00472   * @brief  DeInitializes the SD MSP.
00473   * @param  hsd: SD handle
00474   * @param  Params
00475   * @retval None
00476   */
00477 __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
00478 {
00479     static DMA_HandleTypeDef dma_rx_handle;
00480     static DMA_HandleTypeDef dma_tx_handle;
00481
00482     /* Disable NVIC for DMA transfer complete interrupts */
00483     HAL_NVIC_DisableIRQ(SD_DMAx_Rx_IRQn);
00484     HAL_NVIC_DisableIRQ(SD_DMAx_Tx_IRQn);
00485
00486     /* Deinitialize the stream for new transfer */
00487     dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
00488     HAL_DMA_DeInit(&dma_rx_handle);
00489
00490     /* Deinitialize the stream for new transfer */
00491     dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
00492     HAL_DMA_DeInit(&dma_tx_handle);
00493
00494     /* Disable NVIC for SDIO interrupts */
00495     HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
00496
00497     /* DeInit GPIO pins can be done in the application
00498        (by surcharging this __weak function) */
00499
00500     /* Disable SDMMC1 clock */
00501     __HAL_RCC_SDMMC1_CLK_DISABLE();
00502
00503     /* GPIO pins clock and DMA clocks can be shut down in the application
00504        by surcharging this __weak function */
00505 }
00506
00507 /**
00508   * @brief  Gets the current SD card data status.
00509   * @retval Data transfer state.
00510   *          This value can be one of the following values:
00511   *            @arg  SD_TRANSFER_OK: No data transfer is acting
00512   *            @arg  SD_TRANSFER_BUSY: Data transfer is acting
00513   */
00514 uint8_t BSP_SD_GetCardState(void)
00515 {
00516   return((HAL_SD_GetCardState(&uSdHandle) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY);
00517 }
00518
00519
00520 /**
00521   * @brief  Get SD information about specific SD card.
00522   * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
00523   * @retval None
00524   */
00525 void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
00526 {
00527   /* Get SD card Information */
00528   HAL_SD_GetCardInfo(&uSdHandle, CardInfo);
00529 }
00530
00531 /**
00532   * @brief SD Abort callbacks
00533   * @param hsd: SD handle
00534   * @retval None
00535   */
00536 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00537 {
00538   BSP_SD_AbortCallback();
00539 }
00540
00541 /**
00542   * @brief Tx Transfer completed callbacks
00543   * @param hsd: SD handle
00544   * @retval None
00545   */
00546 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00547 {
00548   BSP_SD_WriteCpltCallback();
00549 }
00550
00551 /**
00552   * @brief Rx Transfer completed callbacks
00553   * @param hsd: SD handle
00554   * @retval None
00555   */
00556 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00557 {
00558   BSP_SD_ReadCpltCallback();
00559 }
00560
00561 /**
00562   * @brief BSP SD Abort callbacks
00563   * @retval None
00564   */
00565 __weak void BSP_SD_AbortCallback(void)
00566 {
00567
00568 }
00569
00570 /**
00571   * @brief BSP Tx Transfer completed callbacks
00572   * @retval None
00573   */
00574 __weak void BSP_SD_WriteCpltCallback(void)
00575 {
00576
00577 }
00578
00579 /**
00580   * @brief BSP Rx Transfer completed callbacks
00581   * @retval None
00582   */
00583 __weak void BSP_SD_ReadCpltCallback(void)
00584 {
00585
00586 }
00587
00588 /**
00589   * @}
00590   */
00591
00592 /**
00593   * @}
00594   */
00595
00596 /**
00597   * @}
00598   */
00599
00600 /**
00601   * @}
00602   */
00603
00604 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_sd.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_SD_H
00041 #define __STM32756G_EVAL_SD_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32f7xx_hal.h"
00049 #include "stm32756g_eval_io.h"
00050
00051 /** @addtogroup BSP
00052   * @{
00053   */
00054
00055 /** @addtogroup STM32756G_EVAL
00056   * @{
00057   */
00058
00059 /** @addtogroup STM32756G_EVAL_SD
00060   * @{
00061   */
00062
00063 /** @defgroup STM32756G_EVAL_SD_Exported_Types SD Exported Types
00064   * @{
00065   */
00066
00067 /**
00068   * @brief SD Card information structure
00069   */
00070 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00071 /**
00072   * @}
00073   */
00074
00075 /**
00076   * @brief  SD status structure definition
00077   */
00078 #define   MSD_OK                        ((uint8_t)0x00)
00079 #define   MSD_ERROR                     ((uint8_t)0x01)
00080 #define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00081
00082 /**
00083   * @brief  SD transfer state definition
00084   */
00085 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00086 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00087
00088 /** @defgroup STM32756G_EVAL_SD_Exported_Constants SD Exported Constants
00089   * @{
00090   */
00091 #define SD_PRESENT               ((uint8_t)0x01)
00092 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00093
00094 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00095
00096 /* DMA definitions for SD DMA transfer */
00097 #define __DMAx_TxRx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00098 #define SD_DMAx_Tx_CHANNEL                DMA_CHANNEL_4
00099 #define SD_DMAx_Rx_CHANNEL                DMA_CHANNEL_4
00100 #define SD_DMAx_Tx_STREAM                 DMA2_Stream6
00101 #define SD_DMAx_Rx_STREAM                 DMA2_Stream3
00102 #define SD_DMAx_Tx_IRQn                   DMA2_Stream6_IRQn
00103 #define SD_DMAx_Rx_IRQn                   DMA2_Stream3_IRQn
00104 #define BSP_SDMMC_IRQHandler              SDMMC1_IRQHandler
00105 #define BSP_SDMMC_DMA_Tx_IRQHandler       DMA2_Stream6_IRQHandler
00106 #define BSP_SDMMC_DMA_Rx_IRQHandler       DMA2_Stream3_IRQHandler
00107 #define SD_DetectIRQHandler()             HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)
00108 /**
00109   * @}
00110   */
00111
00112 /** @defgroup STM32756G_EVAL_SD_Exported_Macro SD Exported Macro
00113   * @{
00114   */
00115 /**
00116   * @}
00117   */
00118
00119 /** @defgroup STM32756G_EVAL_SD_Exported_Functions SD Exported Functions
00120   * @{
00121   */
00122 uint8_t BSP_SD_Init(void);
00123 uint8_t BSP_SD_DeInit(void);
00124 uint8_t BSP_SD_ITConfig(void);
00125 void    BSP_SD_DetectIT(void);
00126 void    BSP_SD_DetectCallback(void);
00127 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00128 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00129 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00130 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00131 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00132 uint8_t BSP_SD_GetCardState(void);
00133 void    BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo);
00134 uint8_t BSP_SD_IsDetected(void);
00135
00136 /* These functions can be modified in case the current settings (e.g. DMA stream)
00137    need to be changed for specific application needs */
00138 void    BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00139 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00140 void    BSP_SD_AbortCallback(void);
00141 void    BSP_SD_WriteCpltCallback(void);
00142 void    BSP_SD_ReadCpltCallback(void);
00143 /**
00144   * @}
00145   */
00146
00147 /**
00148   * @}
00149   */
00150
00151 /**
00152   * @}
00153   */
00154
00155 /**
00156   * @}
00157   */
00158
00159 #ifdef __cplusplus
00160 }
00161 #endif
00162
00163 #endif /* __STM32756G_EVAL_SD_H */
00164
00165 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory
00008   *          device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the MT48LC4M32B2B5-7 SDRAM external memory mounted
00013      on STM32756G-EVAL evaluation board.
00014    - This driver does not need a specific component driver for the SDRAM device
00015      to be included with.
00016
00017   Driver description:
00018   ------------------
00019   + Initialization steps:
00020      o Initialize the SDRAM external memory using the BSP_SDRAM_Init() function. This
00021        function includes the MSP layer hardware resources initialization and the
00022        FMC controller configuration to interface with the external SDRAM memory.
00023      o It contains the SDRAM initialization sequence to program the SDRAM external
00024        device using the function BSP_SDRAM_Initialization_sequence(). Note that this
00025        sequence is standard for all SDRAM devices, but can include some differences
00026        from a device to another. If it is the case, the right sequence should be
00027        implemented separately.
00028
00029   + SDRAM read/write operations
00030      o SDRAM external memory can be accessed with read/write operations once it is
00031        initialized.
00032        Read/write operation can be performed with AHB access using the functions
00033        BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by DMA transfer using the functions
00034        BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
00035      o The AHB access is performed with 32-bit width transaction, the DMA transfer
00036        configuration is fixed at single (no burst) word transfer (see the
00037        SDRAM_MspInit() static function).
00038      o User can implement his own functions for read/write access with his desired
00039        configurations.
00040      o If interrupt mode is used for DMA transfer, the function BSP_SDRAM_DMA_IRQHandler()
00041        is called in IRQ handler file, to serve the generated interrupt once the DMA
00042        transfer is complete.
00043      o You can send a command to the SDRAM device in runtime using the function
00044        BSP_SDRAM_Sendcmd(), and giving the desired command as parameter chosen between
00045        the predefined commands of the "FMC_SDRAM_CommandTypeDef" structure.
00046   @endverbatim
00047   ******************************************************************************
00048   * @attention
00049   *
00050   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00051   *
00052   * Redistribution and use in source and binary forms, with or without modification,
00053   * are permitted provided that the following conditions are met:
00054   *   1. Redistributions of source code must retain the above copyright notice,
00055   *      this list of conditions and the following disclaimer.
00056   *   2. Redistributions in binary form must reproduce the above copyright notice,
00057   *      this list of conditions and the following disclaimer in the documentation
00058   *      and/or other materials provided with the distribution.
00059   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00060   *      may be used to endorse or promote products derived from this software
00061   *      without specific prior written permission.
00062   *
00063   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00064   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00065   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00066   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00067   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00068   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00069   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00070   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00071   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00072   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00073   *
00074   ******************************************************************************
00075   */
00076
00077 /* Includes ------------------------------------------------------------------*/
00078 #include "stm32756g_eval_sdram.h"
00079
00080 /** @addtogroup BSP
00081   * @{
00082   */
00083
00084 /** @addtogroup STM32756G_EVAL
00085   * @{
00086   */
00087
00088 /** @defgroup STM32756G_EVAL_SDRAM STM32756G_EVAL SDRAM
00089   * @{
00090   */
00091
00092 /** @defgroup STM32756G_EVAL_SDRAM_Private_Types_Definitions SDRAM Private Types Definitions
00093   * @{
00094   */
00095 /**
00096   * @}
00097   */
00098
00099 /** @defgroup STM32756G_EVAL_SDRAM_Private_Defines SDRAM Private Defines
00100   * @{
00101   */
00102 /**
00103   * @}
00104   */
00105
00106 /** @defgroup STM32756G_EVAL_SDRAM_Private_Macros SDRAM Private Macros
00107   * @{
00108   */
00109 /**
00110   * @}
00111   */
00112
00113 /** @defgroup STM32756G_EVAL_SDRAM_Private_Variables SDRAM Private Variables
00114   * @{
00115   */
00116 SDRAM_HandleTypeDef sdramHandle;
00117 static FMC_SDRAM_TimingTypeDef Timing;
00118 static FMC_SDRAM_CommandTypeDef Command;
00119 /**
00120   * @}
00121   */
00122
00123 /** @defgroup STM32756G_EVAL_SDRAM_Private_Functions_Prototypes SDRAM Private Functions Prototypes
00124   * @{
00125   */
00126 /**
00127   * @}
00128   */
00129
00130 /** @defgroup STM32756G_EVAL_SDRAM_Private_Functions SDRAM Private Functions
00131   * @{
00132   */
00133
00134 /**
00135   * @brief  Initializes the SDRAM device.
00136   * @retval SDRAM status
00137   */
00138 uint8_t BSP_SDRAM_Init(void)
00139 {
00140   static uint8_t sdramstatus = SDRAM_ERROR;
00141   /* SDRAM device configuration */
00142   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00143
00144   /* Timing configuration for 100Mhz as SDRAM clock frequency (System clock is up to 200Mhz) */
00145   Timing.LoadToActiveDelay    = 2;
00146   Timing.ExitSelfRefreshDelay = 7;
00147   Timing.SelfRefreshTime      = 4;
00148   Timing.RowCycleDelay        = 7;
00149   Timing.WriteRecoveryTime    = 2;
00150   Timing.RPDelay              = 2;
00151   Timing.RCDDelay             = 2;
00152
00153   sdramHandle.Init.SDBank             = FMC_SDRAM_BANK1;
00154   sdramHandle.Init.ColumnBitsNumber   = FMC_SDRAM_COLUMN_BITS_NUM_9;
00155   sdramHandle.Init.RowBitsNumber      = FMC_SDRAM_ROW_BITS_NUM_12;
00156   sdramHandle.Init.MemoryDataWidth    = SDRAM_MEMORY_WIDTH;
00157   sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
00158   sdramHandle.Init.CASLatency         = FMC_SDRAM_CAS_LATENCY_3;
00159   sdramHandle.Init.WriteProtection    = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
00160   sdramHandle.Init.SDClockPeriod      = SDCLOCK_PERIOD;
00161   sdramHandle.Init.ReadBurst          = FMC_SDRAM_RBURST_ENABLE;
00162   sdramHandle.Init.ReadPipeDelay      = FMC_SDRAM_RPIPE_DELAY_0;
00163
00164   /* SDRAM controller initialization */
00165
00166   BSP_SDRAM_MspInit(&sdramHandle, NULL); /* __weak function can be rewritten by the application */
00167
00168   if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)
00169   {
00170     sdramstatus = SDRAM_ERROR;
00171   }
00172   else
00173   {
00174     sdramstatus = SDRAM_OK;
00175   }
00176
00177   /* SDRAM initialization sequence */
00178   BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);
00179
00180   return sdramstatus;
00181 }
00182
00183 /**
00184   * @brief  DeInitializes the SDRAM device.
00185   * @retval SDRAM status
00186   */
00187 uint8_t BSP_SDRAM_DeInit(void)
00188 {
00189   static uint8_t sdramstatus = SDRAM_ERROR;
00190   /* SDRAM device de-initialization */
00191   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00192
00193   if(HAL_SDRAM_DeInit(&sdramHandle) != HAL_OK)
00194   {
00195     sdramstatus = SDRAM_ERROR;
00196   }
00197   else
00198   {
00199     sdramstatus = SDRAM_OK;
00200   }
00201
00202   /* SDRAM controller de-initialization */
00203   BSP_SDRAM_MspDeInit(&sdramHandle, NULL);
00204
00205   return sdramstatus;
00206 }
00207
00208 /**
00209   * @brief  Programs the SDRAM device.
00210   * @param  RefreshCount: SDRAM refresh counter value
00211   * @retval None
00212   */
00213 void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
00214 {
00215   __IO uint32_t tmpmrd = 0;
00216
00217   /* Step 1: Configure a clock configuration enable command */
00218   Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
00219   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00220   Command.AutoRefreshNumber      = 1;
00221   Command.ModeRegisterDefinition = 0;
00222
00223   /* Send the command */
00224   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00225
00226   /* Step 2: Insert 100 us minimum delay */
00227   /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
00228   HAL_Delay(1);
00229
00230   /* Step 3: Configure a PALL (precharge all) command */
00231   Command.CommandMode            = FMC_SDRAM_CMD_PALL;
00232   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00233   Command.AutoRefreshNumber      = 1;
00234   Command.ModeRegisterDefinition = 0;
00235
00236   /* Send the command */
00237   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00238
00239   /* Step 4: Configure an Auto Refresh command */
00240   Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
00241   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00242   Command.AutoRefreshNumber      = 8;
00243   Command.ModeRegisterDefinition = 0;
00244
00245   /* Send the command */
00246   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00247
00248   /* Step 5: Program the external memory mode register */
00249   tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |\
00250                      SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |\
00251                      SDRAM_MODEREG_CAS_LATENCY_3           |\
00252                      SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
00253                      SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
00254
00255   Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
00256   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00257   Command.AutoRefreshNumber      = 1;
00258   Command.ModeRegisterDefinition = tmpmrd;
00259
00260   /* Send the command */
00261   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00262
00263   /* Step 6: Set the refresh rate counter */
00264   /* Set the device refresh rate */
00265   HAL_SDRAM_ProgramRefreshRate(&sdramHandle, RefreshCount);
00266 }
00267
00268 /**
00269   * @brief  Reads an amount of data from the SDRAM memory in polling mode.
00270   * @param  uwStartAddress: Read start address
00271   * @param  pData: Pointer to data to be read
00272   * @param  uwDataSize: Size of read data from the memory
00273   * @retval SDRAM status
00274   */
00275 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00276 {
00277   if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00278   {
00279     return SDRAM_ERROR;
00280   }
00281   else
00282   {
00283     return SDRAM_OK;
00284   }
00285 }
00286
00287 /**
00288   * @brief  Reads an amount of data from the SDRAM memory in DMA mode.
00289   * @param  uwStartAddress: Read start address
00290   * @param  pData: Pointer to data to be read
00291   * @param  uwDataSize: Size of read data from the memory
00292   * @retval SDRAM status
00293   */
00294 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00295 {
00296   if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00297   {
00298     return SDRAM_ERROR;
00299   }
00300   else
00301   {
00302     return SDRAM_OK;
00303   }
00304 }
00305
00306 /**
00307   * @brief  Writes an amount of data to the SDRAM memory in polling mode.
00308   * @param  uwStartAddress: Write start address
00309   * @param  pData: Pointer to data to be written
00310   * @param  uwDataSize: Size of written data from the memory
00311   * @retval SDRAM status
00312   */
00313 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00314 {
00315   if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00316   {
00317     return SDRAM_ERROR;
00318   }
00319   else
00320   {
00321     return SDRAM_OK;
00322   }
00323 }
00324
00325 /**
00326   * @brief  Writes an amount of data to the SDRAM memory in DMA mode.
00327   * @param  uwStartAddress: Write start address
00328   * @param  pData: Pointer to data to be written
00329   * @param  uwDataSize: Size of written data from the memory
00330   * @retval SDRAM status
00331   */
00332 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00333 {
00334   if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00335   {
00336     return SDRAM_ERROR;
00337   }
00338   else
00339   {
00340     return SDRAM_OK;
00341   }
00342 }
00343
00344 /**
00345   * @brief  Sends command to the SDRAM bank.
00346   * @param  SdramCmd: Pointer to SDRAM command structure
00347   * @retval SDRAM status
00348   */
00349 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
00350 {
00351   if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK)
00352   {
00353     return SDRAM_ERROR;
00354   }
00355   else
00356   {
00357     return SDRAM_OK;
00358   }
00359 }
00360
00361
00362 /**
00363   * @brief  Initializes SDRAM MSP.
00364   * @param  hsdram: SDRAM handle
00365   * @param  Params
00366   * @retval None
00367   */
00368 __weak void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00369 {
00370   static DMA_HandleTypeDef dma_handle;
00371   GPIO_InitTypeDef gpio_init_structure;
00372
00373   /* Enable FMC clock */
00374   __HAL_RCC_FMC_CLK_ENABLE();
00375
00376   /* Enable chosen DMAx clock */
00377   __DMAx_CLK_ENABLE();
00378
00379   /* Enable GPIOs clock */
00380   __HAL_RCC_GPIOD_CLK_ENABLE();
00381   __HAL_RCC_GPIOE_CLK_ENABLE();
00382   __HAL_RCC_GPIOF_CLK_ENABLE();
00383   __HAL_RCC_GPIOG_CLK_ENABLE();
00384   __HAL_RCC_GPIOH_CLK_ENABLE();
00385   __HAL_RCC_GPIOI_CLK_ENABLE();
00386
00387   /* Common GPIO configuration */
00388   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00389   gpio_init_structure.Pull      = GPIO_PULLUP;
00390   gpio_init_structure.Speed     = GPIO_SPEED_FAST;
00391   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00392
00393   /* GPIOD configuration */
00394   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8| GPIO_PIN_9 | GPIO_PIN_10 |\
00395                               GPIO_PIN_14 | GPIO_PIN_15;
00396
00397
00398   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00399
00400   /* GPIOE configuration */
00401   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7| GPIO_PIN_8 | GPIO_PIN_9 |\
00402                               GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00403                               GPIO_PIN_15;
00404
00405   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00406
00407   /* GPIOF configuration */
00408   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4 |\
00409                               GPIO_PIN_5 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00410                               GPIO_PIN_15;
00411
00412   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00413
00414   /* GPIOG configuration */
00415   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4| GPIO_PIN_5 | GPIO_PIN_8 |\
00416                               GPIO_PIN_15;
00417   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00418
00419   /* GPIOH configuration */
00420   gpio_init_structure.Pin   = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_9 |\
00421                               GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00422                               GPIO_PIN_15;
00423   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00424
00425   /* GPIOI configuration */
00426   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 |\
00427                               GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_9 | GPIO_PIN_10;
00428   HAL_GPIO_Init(GPIOI, &gpio_init_structure);
00429
00430   /* Configure common DMA parameters */
00431   dma_handle.Init.Channel             = SDRAM_DMAx_CHANNEL;
00432   dma_handle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00433   dma_handle.Init.PeriphInc           = DMA_PINC_ENABLE;
00434   dma_handle.Init.MemInc              = DMA_MINC_ENABLE;
00435   dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00436   dma_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00437   dma_handle.Init.Mode                = DMA_NORMAL;
00438   dma_handle.Init.Priority            = DMA_PRIORITY_HIGH;
00439   dma_handle.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00440   dma_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00441   dma_handle.Init.MemBurst            = DMA_MBURST_SINGLE;
00442   dma_handle.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00443
00444   dma_handle.Instance = SDRAM_DMAx_STREAM;
00445
00446    /* Associate the DMA handle */
00447   __HAL_LINKDMA(hsdram, hdma, dma_handle);
00448
00449   /* Deinitialize the stream for new transfer */
00450   HAL_DMA_DeInit(&dma_handle);
00451
00452   /* Configure the DMA stream */
00453   HAL_DMA_Init(&dma_handle);
00454
00455   /* NVIC configuration for DMA transfer complete interrupt */
00456   HAL_NVIC_SetPriority(SDRAM_DMAx_IRQn, 0x0F, 0);
00457   HAL_NVIC_EnableIRQ(SDRAM_DMAx_IRQn);
00458 }
00459
00460 /**
00461   * @brief  DeInitializes SDRAM MSP.
00462   * @param  hsdram: SDRAM handle
00463   * @param  Params
00464   * @retval None
00465   */
00466 __weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00467 {
00468     static DMA_HandleTypeDef dma_handle;
00469
00470     /* Disable NVIC configuration for DMA interrupt */
00471     HAL_NVIC_DisableIRQ(SDRAM_DMAx_IRQn);
00472
00473     /* Deinitialize the stream for new transfer */
00474     dma_handle.Instance = SDRAM_DMAx_STREAM;
00475     HAL_DMA_DeInit(&dma_handle);
00476
00477     /* GPIO pins clock, FMC clock and DMA clock can be shut down in the applications
00478        by surcharging this __weak function */
00479 }
00480
00481 /**
00482   * @}
00483   */
00484
00485 /**
00486   * @}
00487   */
00488
00489 /**
00490   * @}
00491   */
00492
00493 /**
00494   * @}
00495   */
00496
00497 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_sdram.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_SDRAM_H
00041 #define __STM32756G_EVAL_SDRAM_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32f7xx_hal.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32756G_EVAL
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL_SDRAM
00059   * @{
00060   */
00061
00062 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Types SDRAM Exported Types
00063   * @{
00064   */
00065
00066 /**
00067   * @brief  SDRAM status structure definition
00068   */
00069 #define   SDRAM_OK         ((uint8_t)0x00)
00070 #define   SDRAM_ERROR      ((uint8_t)0x01)
00071
00072 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Constants SDRAM Exported Constants
00073   * @{
00074   */
00075 #define SDRAM_DEVICE_ADDR  ((uint32_t)0xC0000000)
00076 #define SDRAM_DEVICE_SIZE  ((uint32_t)0x800000)  /* SDRAM device size in MBytes */
00077
00078 /* #define SDRAM_MEMORY_WIDTH            FMC_SDRAM_MEM_BUS_WIDTH_8  */
00079 /* #define SDRAM_MEMORY_WIDTH            FMC_SDRAM_MEM_BUS_WIDTH_16 */
00080 #define SDRAM_MEMORY_WIDTH               FMC_SDRAM_MEM_BUS_WIDTH_32
00081
00082 #define SDCLOCK_PERIOD                   FMC_SDRAM_CLOCK_PERIOD_2
00083 /* #define SDCLOCK_PERIOD                FMC_SDRAM_CLOCK_PERIOD_3 */
00084
00085 #define REFRESH_COUNT                    ((uint32_t)0x0603)   /* SDRAM refresh counter (100Mhz SD clock) */
00086
00087 #define SDRAM_TIMEOUT                    ((uint32_t)0xFFFF)
00088
00089 /* DMA definitions for SDRAM DMA transfer */
00090 #define __DMAx_CLK_ENABLE                 __HAL_RCC_DMA2_CLK_ENABLE
00091 #define __DMAx_CLK_DISABLE                __HAL_RCC_DMA2_CLK_DISABLE
00092 #define SDRAM_DMAx_CHANNEL                DMA_CHANNEL_0
00093 #define SDRAM_DMAx_STREAM                 DMA2_Stream0
00094 #define SDRAM_DMAx_IRQn                   DMA2_Stream0_IRQn
00095 #define BSP_SDRAM_DMA_IRQHandler          DMA2_Stream0_IRQHandler
00096 /**
00097   * @}
00098   */
00099
00100 /**
00101   * @brief  FMC SDRAM Mode definition register defines
00102   */
00103 #define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
00104 #define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
00105 #define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
00106 #define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
00107 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
00108 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
00109 #define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
00110 #define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
00111 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
00112 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
00113 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)
00114 /**
00115   * @}
00116   */
00117
00118 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Macro SDRAM Exported Macro
00119   * @{
00120   */
00121 /**
00122   * @}
00123   */
00124
00125 /** @defgroup STM32756G_EVAL_SDRAM_Exported_Functions SDRAM Exported Functions
00126   * @{
00127   */
00128 uint8_t BSP_SDRAM_Init(void);
00129 uint8_t BSP_SDRAM_DeInit(void);
00130 void    BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
00131 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00132 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00133 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00134 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00135 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
00136
00137 /* These functions can be modified in case the current settings (e.g. DMA stream)
00138    need to be changed for specific application needs */
00139 void    BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00140 void    BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00141
00142
00143 /**
00144   * @}
00145   */
00146
00147 /**
00148   * @}
00149   */
00150
00151 /**
00152   * @}
00153   */
00154
00155 /**
00156   * @}
00157   */
00158
00159 #ifdef __cplusplus
00160 }
00161 #endif
00162
00163 #endif /* __STM32756G_EVAL_SDRAM_H */
00164
00165 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file includes the SRAM driver for the IS61WV102416BLL-10M memory
00008   *          device mounted on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the IS61WV102416BLL-10M SRAM external memory mounted
00013      on STM32756G-EVAL evaluation board.
00014    - This driver does not need a specific component driver for the SRAM device
00015      to be included with.
00016
00017   Driver description:
00018   ------------------
00019   + Initialization steps:
00020      o Initialize the SRAM external memory using the BSP_SRAM_Init() function. This
00021        function includes the MSP layer hardware resources initialization and the
00022        FMC controller configuration to interface with the external SRAM memory.
00023
00024   + SRAM read/write operations
00025      o SRAM external memory can be accessed with read/write operations once it is
00026        initialized.
00027        Read/write operation can be performed with AHB access using the functions
00028        BSP_SRAM_ReadData()/BSP_SRAM_WriteData(), or by DMA transfer using the functions
00029        BSP_SRAM_ReadData_DMA()/BSP_SRAM_WriteData_DMA().
00030      o The AHB access is performed with 16-bit width transaction, the DMA transfer
00031        configuration is fixed at single (no burst) halfword transfer
00032        (see the SRAM_MspInit() static function).
00033      o User can implement his own functions for read/write access with his desired
00034        configurations.
00035      o If interrupt mode is used for DMA transfer, the function BSP_SRAM_DMA_IRQHandler()
00036        is called in IRQ handler file, to serve the generated interrupt once the DMA
00037        transfer is complete.
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 /* Includes ------------------------------------------------------------------*/
00070 #include "stm32756g_eval_sram.h"
00071
00072 /** @addtogroup BSP
00073   * @{
00074   */
00075
00076 /** @addtogroup STM32756G_EVAL
00077   * @{
00078   */
00079
00080 /** @defgroup STM32756G_EVAL_SRAM STM32756G_EVAL SRAM
00081   * @{
00082   */
00083
00084 /** @defgroup STM32756G_EVAL_SRAM_Private_Types_Definitions SRAM Private Types Definitions
00085   * @{
00086   */
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32756G_EVAL_SRAM_Private_Defines SRAM Private Defines
00092   * @{
00093   */
00094 /**
00095   * @}
00096   */
00097
00098 /** @defgroup STM32756G_EVAL_SRAM_Private_Macros SRAM Private Macros
00099   * @{
00100   */
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32756G_EVAL_SRAM_Private_Variables SRAM Private Variables
00106   * @{
00107   */
00108 SRAM_HandleTypeDef sramHandle;
00109 static FMC_NORSRAM_TimingTypeDef Timing;
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32756G_EVAL_SRAM_Private_Functions_Prototypes SRAM Private Function Prototypes
00115   * @{
00116   */
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32756G_EVAL_SRAM_Private_Functions SRAM Private Functions
00122   * @{
00123   */
00124
00125 /**
00126   * @brief  Initializes the SRAM device.
00127   * @retval SRAM status
00128   */
00129 uint8_t BSP_SRAM_Init(void)
00130 {
00131   static uint8_t sram_status = SRAM_ERROR;
00132   /* SRAM device configuration */
00133   sramHandle.Instance = FMC_NORSRAM_DEVICE;
00134   sramHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00135
00136   /* SRAM device configuration */
00137   /* Timing configuration derived from system clock (up to 216Mhz)
00138      for 108Mhz as SRAM clock frequency */
00139   Timing.AddressSetupTime      = 2;
00140   Timing.AddressHoldTime       = 1;
00141   Timing.DataSetupTime         = 2;
00142   Timing.BusTurnAroundDuration = 1;
00143   Timing.CLKDivision           = 2;
00144   Timing.DataLatency           = 2;
00145   Timing.AccessMode            = FMC_ACCESS_MODE_A;
00146
00147   sramHandle.Init.NSBank             = FMC_NORSRAM_BANK3;
00148   sramHandle.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
00149   sramHandle.Init.MemoryType         = FMC_MEMORY_TYPE_SRAM;
00150   sramHandle.Init.MemoryDataWidth    = SRAM_MEMORY_WIDTH;
00151   sramHandle.Init.BurstAccessMode    = SRAM_BURSTACCESS;
00152   sramHandle.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
00153   sramHandle.Init.WaitSignalActive   = FMC_WAIT_TIMING_BEFORE_WS;
00154   sramHandle.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
00155   sramHandle.Init.WaitSignal         = FMC_WAIT_SIGNAL_DISABLE;
00156   sramHandle.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
00157   sramHandle.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_DISABLE;
00158   sramHandle.Init.WriteBurst         = SRAM_WRITEBURST;
00159   sramHandle.Init.ContinuousClock    = CONTINUOUSCLOCK_FEATURE;
00160
00161   /* SRAM controller initialization */
00162   BSP_SRAM_MspInit(&sramHandle, NULL); /* __weak function can be rewritten by the application */
00163   if(HAL_SRAM_Init(&sramHandle, &Timing, &Timing) != HAL_OK)
00164   {
00165     sram_status = SRAM_ERROR;
00166   }
00167   else
00168   {
00169     sram_status = SRAM_OK;
00170   }
00171   return sram_status;
00172 }
00173
00174 /**
00175   * @brief  DeInitializes the SRAM device.
00176   * @retval SRAM status
00177   */
00178 uint8_t BSP_SRAM_DeInit(void)
00179 {
00180   static uint8_t sram_status = SRAM_ERROR;
00181   /* SRAM device de-initialization */
00182   sramHandle.Instance = FMC_NORSRAM_DEVICE;
00183   sramHandle.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
00184
00185   if(HAL_SRAM_DeInit(&sramHandle) != HAL_OK)
00186   {
00187     sram_status = SRAM_ERROR;
00188   }
00189   else
00190   {
00191     sram_status = SRAM_OK;
00192   }
00193
00194   /* SRAM controller de-initialization */
00195   BSP_SRAM_MspDeInit(&sramHandle, NULL);
00196
00197   return sram_status;
00198 }
00199
00200 /**
00201   * @brief  Reads an amount of data from the SRAM device in polling mode.
00202   * @param  uwStartAddress: Read start address
00203   * @param  pData: Pointer to data to be read
00204   * @param  uwDataSize: Size of read data from the memory
00205   * @retval SRAM status
00206   */
00207 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00208 {
00209   if(HAL_SRAM_Read_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00210   {
00211     return SRAM_ERROR;
00212   }
00213   else
00214   {
00215     return SRAM_OK;
00216   }
00217 }
00218
00219 /**
00220   * @brief  Reads an amount of data from the SRAM device in DMA mode.
00221   * @param  uwStartAddress: Read start address
00222   * @param  pData: Pointer to data to be read
00223   * @param  uwDataSize: Size of read data from the memory
00224   * @retval SRAM status
00225   */
00226 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00227 {
00228   if(HAL_SRAM_Read_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00229   {
00230     return SRAM_ERROR;
00231   }
00232   else
00233   {
00234     return SRAM_OK;
00235   }
00236 }
00237
00238 /**
00239   * @brief  Writes an amount of data from the SRAM device in polling mode.
00240   * @param  uwStartAddress: Write start address
00241   * @param  pData: Pointer to data to be written
00242   * @param  uwDataSize: Size of written data from the memory
00243   * @retval SRAM status
00244   */
00245 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00246 {
00247   if(HAL_SRAM_Write_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00248   {
00249     return SRAM_ERROR;
00250   }
00251   else
00252   {
00253     return SRAM_OK;
00254   }
00255 }
00256
00257 /**
00258   * @brief  Writes an amount of data from the SRAM device in DMA mode.
00259   * @param  uwStartAddress: Write start address
00260   * @param  pData: Pointer to data to be written
00261   * @param  uwDataSize: Size of written data from the memory
00262   * @retval SRAM status
00263   */
00264 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00265 {
00266   if(HAL_SRAM_Write_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00267   {
00268     return SRAM_ERROR;
00269   }
00270   else
00271   {
00272     return SRAM_OK;
00273   }
00274 }
00275
00276 /**
00277   * @brief  Initializes SRAM MSP.
00278   * @param  hsram: SRAM handle
00279   * @param  Params
00280   * @retval None
00281   */
00282 __weak void BSP_SRAM_MspInit(SRAM_HandleTypeDef  *hsram, void *Params)
00283 {
00284   static DMA_HandleTypeDef dma_handle;
00285   GPIO_InitTypeDef gpio_init_structure;
00286
00287   /* Enable FMC clock */
00288   __HAL_RCC_FMC_CLK_ENABLE();
00289
00290   /* Enable chosen DMAx clock */
00291   __SRAM_DMAx_CLK_ENABLE();
00292
00293   /* Enable GPIOs clock */
00294   __HAL_RCC_GPIOD_CLK_ENABLE();
00295   __HAL_RCC_GPIOE_CLK_ENABLE();
00296   __HAL_RCC_GPIOF_CLK_ENABLE();
00297   __HAL_RCC_GPIOG_CLK_ENABLE();
00298
00299   /* Common GPIO configuration */
00300   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00301   gpio_init_structure.Pull      = GPIO_PULLUP;
00302   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00303   gpio_init_structure.Alternate = GPIO_AF12_FMC;
00304
00305   /* GPIOD configuration */
00306   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8     |\
00307                               GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 |\
00308                               GPIO_PIN_14 | GPIO_PIN_15;
00309   HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00310
00311   /* GPIOE configuration */
00312   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3| GPIO_PIN_4 | GPIO_PIN_7     |\
00313                               GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 |\
00314                               GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00315   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00316
00317   /* GPIOF configuration */
00318   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00319                               GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
00320   HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00321
00322   /* GPIOG configuration */
00323   gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4     |\
00324                               GPIO_PIN_5 | GPIO_PIN_10;
00325   HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00326
00327   /* Configure common DMA parameters */
00328   dma_handle.Init.Channel             = SRAM_DMAx_CHANNEL;
00329   dma_handle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00330   dma_handle.Init.PeriphInc           = DMA_PINC_ENABLE;
00331   dma_handle.Init.MemInc              = DMA_MINC_ENABLE;
00332   dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
00333   dma_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
00334   dma_handle.Init.Mode                = DMA_NORMAL;
00335   dma_handle.Init.Priority            = DMA_PRIORITY_HIGH;
00336   dma_handle.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00337   dma_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00338   dma_handle.Init.MemBurst            = DMA_MBURST_SINGLE;
00339   dma_handle.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00340
00341   dma_handle.Instance = SRAM_DMAx_STREAM;
00342
00343    /* Associate the DMA handle */
00344   __HAL_LINKDMA(hsram, hdma, dma_handle);
00345
00346   /* Deinitialize the Stream for new transfer */
00347   HAL_DMA_DeInit(&dma_handle);
00348
00349   /* Configure the DMA Stream */
00350   HAL_DMA_Init(&dma_handle);
00351
00352   /* NVIC configuration for DMA transfer complete interrupt */
00353   HAL_NVIC_SetPriority(SRAM_DMAx_IRQn, 0x0F, 0);
00354   HAL_NVIC_EnableIRQ(SRAM_DMAx_IRQn);
00355 }
00356
00357
00358 /**
00359   * @brief  DeInitializes SRAM MSP.
00360   * @param  hsram: SRAM handle
00361   * @param  Params
00362   * @retval None
00363   */
00364 __weak void BSP_SRAM_MspDeInit(SRAM_HandleTypeDef  *hsram, void *Params)
00365 {
00366     static DMA_HandleTypeDef dma_handle;
00367
00368     /* Disable NVIC configuration for DMA interrupt */
00369     HAL_NVIC_DisableIRQ(SRAM_DMAx_IRQn);
00370
00371     /* Deinitialize the stream for new transfer */
00372     dma_handle.Instance = SRAM_DMAx_STREAM;
00373     HAL_DMA_DeInit(&dma_handle);
00374
00375     /* GPIO pins clock, FMC clock and DMA clock can be shut down in the applications
00376        by surcharging this __weak function */
00377 }
00378
00379 /**
00380   * @}
00381   */
00382
00383 /**
00384   * @}
00385   */
00386
00387 /**
00388   * @}
00389   */
00390
00391 /**
00392   * @}
00393   */
00394
00395 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_sram.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_SRAM_H
00041 #define __STM32756G_EVAL_SRAM_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32f7xx_hal.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32756G_EVAL
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32756G_EVAL_SRAM
00059   * @{
00060   */
00061
00062 /** @defgroup STM32756G_EVAL_SRAM_Exported_Types SRAM Exported Types
00063   * @{
00064   */
00065 /**
00066   * @}
00067   */
00068
00069 /** @defgroup STM32756G_EVAL_SRAM_Exported_Constants SRAM Exported Constants
00070   * @{
00071   */
00072
00073 /**
00074   * @brief  SRAM status structure definition
00075   */
00076 #define   SRAM_OK         ((uint8_t)0x00)
00077 #define   SRAM_ERROR      ((uint8_t)0x01)
00078
00079 #define SRAM_DEVICE_ADDR  ((uint32_t)0x68000000)
00080 #define SRAM_DEVICE_SIZE  ((uint32_t)0x200000)  /* SRAM device size in MBytes */
00081
00082 /* #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8*/
00083 #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00084
00085 #define SRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_DISABLE
00086 /* #define SRAM_BURSTACCESS     FMC_BURST_ACCESS_MODE_ENABLE*/
00087
00088 #define SRAM_WRITEBURST      FMC_WRITE_BURST_DISABLE
00089 /* #define SRAM_WRITEBURST     FMC_WRITE_BURST_ENABLE */
00090
00091 #define CONTINUOUSCLOCK_FEATURE    FMC_CONTINUOUS_CLOCK_SYNC_ONLY
00092 /* #define CONTINUOUSCLOCK_FEATURE     FMC_CONTINUOUS_CLOCK_SYNC_ASYNC */
00093
00094 /* DMA definitions for SRAM DMA transfer */
00095 #define __SRAM_DMAx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00096 #define __SRAM_DMAx_CLK_DISABLE           __HAL_RCC_DMA2_CLK_DISABLE
00097 #define SRAM_DMAx_CHANNEL                 DMA_CHANNEL_0
00098 #define SRAM_DMAx_STREAM                  DMA2_Stream4
00099 #define SRAM_DMAx_IRQn                    DMA2_Stream4_IRQn
00100 #define BSP_SRAM_DMA_IRQHandler           DMA2_Stream4_IRQHandler
00101 /**
00102   * @}
00103   */
00104
00105 /** @defgroup STM32756G_EVAL_SRAM_Exported_Macro SRAM Exported Macro
00106   * @{
00107   */
00108 /**
00109   * @}
00110   */
00111
00112 /** @defgroup STM32756G_EVAL_SRAM_Exported_Functions SRAM Exported Functions
00113   * @{
00114   */
00115 uint8_t BSP_SRAM_Init(void);
00116 uint8_t BSP_SRAM_DeInit(void);
00117 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00118 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00119 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00120 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00121
00122 /* These functions can be modified in case the current settings (e.g. DMA stream)
00123    need to be changed for specific application needs */
00124 void    BSP_SRAM_MspInit(SRAM_HandleTypeDef  *hsram, void *Params);
00125 void    BSP_SRAM_MspDeInit(SRAM_HandleTypeDef  *hsram, void *Params);
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135 /**
00136   * @}
00137   */
00138
00139 /**
00140   * @}
00141   */
00142
00143
00144 #ifdef __cplusplus
00145 }
00146 #endif
00147
00148 #endif /* __STM32756G_EVAL_SRAM_H */
00149
00150 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file provides a set of functions needed to manage the Touch
00008   *          Screen on STM32756G-EVAL and STM32746G-EVAL evaluation boards.
00009   @verbatim
00010   How To use this driver:
00011   -----------------------
00012    - This driver is used to drive the touch screen module of the STM32756G-EVAL
00013      evaluation board on the AMPIRE 640x480 LCD mounted on MB1063 or AMPIRE
00014      480x272 LCD mounted on MB1046 daughter board.
00015    - If the AMPIRE 640x480 LCD is used, the TS3510 or EXC7200 component driver
00016      must be included according to the touch screen driver present on this board.
00017    - If the AMPIRE 480x272 LCD is used, the STMPE811 IO expander device component
00018      driver must be included in order to run the TS module commanded by the IO
00019      expander device, the MFXSTM32L152 IO expander device component driver must be
00020      also included in case of interrupt mode use of the TS.
00021
00022   Driver description:
00023   ------------------
00024   + Initialization steps:
00025      o Initialize the TS module using the BSP_TS_Init() function. This
00026        function includes the MSP layer hardware resources initialization and the
00027        communication layer configuration to start the TS use. The LCD size properties
00028        (x and y) are passed as parameters.
00029      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00030        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00031        as an external interrupt whenever a touch is detected.
00032        The interrupt mode internally uses the IO functionalities driver driven by
00033        the IO expander, to configure the IT line.
00034
00035   + Touch screen use
00036      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00037        used. This function returns information about the last LCD touch occurred
00038        in the TS_StateTypeDef structure.
00039      o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
00040        the interrupt status. To clear the IT pending bits, you should call the
00041        function BSP_TS_ITClear().
00042      o The IT is handled using the corresponding external interrupt IRQ handler,
00043        the user IT callback treatment is implemented on the same external interrupt
00044        callback.
00045   @endverbatim
00046   ******************************************************************************
00047   * @attention
00048   *
00049   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00050   *
00051   * Redistribution and use in source and binary forms, with or without modification,
00052   * are permitted provided that the following conditions are met:
00053   *   1. Redistributions of source code must retain the above copyright notice,
00054   *      this list of conditions and the following disclaimer.
00055   *   2. Redistributions in binary form must reproduce the above copyright notice,
00056   *      this list of conditions and the following disclaimer in the documentation
00057   *      and/or other materials provided with the distribution.
00058   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00059   *      may be used to endorse or promote products derived from this software
00060   *      without specific prior written permission.
00061   *
00062   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00063   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00064   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00065   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00066   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00067   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00068   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00069   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00070   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00071   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00072   *
00073   ******************************************************************************
00074   */
00075
00076 /* Includes ------------------------------------------------------------------*/
00077 #include "stm32756g_eval_ts.h"
00078 #include "stm32756g_eval_io.h"
00079
00080 /** @addtogroup BSP
00081   * @{
00082   */
00083
00084 /** @addtogroup STM32756G_EVAL
00085   * @{
00086   */
00087
00088 /** @defgroup STM32756G_EVAL_TS STM32756G_EVAL TS
00089   * @{
00090   */
00091
00092 /** @defgroup STM32756G_EVAL_TS_Private_Types_Definitions TS Private Types Definitions
00093   * @{
00094   */
00095 /**
00096   * @}
00097   */
00098
00099 /** @defgroup STM32756G_EVAL_TS_Private_Defines TS Private Defines
00100   * @{
00101   */
00102 /**
00103   * @}
00104   */
00105
00106 /** @defgroup STM32756G_EVAL_TS_Private_Macros TS Private Macros
00107   * @{
00108   */
00109 /**
00110   * @}
00111   */
00112
00113 /** @defgroup STM32756G_EVAL_TS_Private_Variables TS Private Variables
00114   * @{
00115   */
00116 static TS_DrvTypeDef *tsDriver;
00117 static uint16_t tsXBoundary, tsYBoundary;
00118 static uint8_t  tsOrientation;
00119 static uint8_t  I2cAddress;
00120 /**
00121   * @}
00122   */
00123
00124 /** @defgroup STM32756G_EVAL_TS_Private_Functions_Prototypes TS Private Functions Prototypes
00125   * @{
00126   */
00127 /**
00128   * @}
00129   */
00130
00131 /** @defgroup STM32756G_EVAL_TS_Private_Functions TS Private Functions
00132   * @{
00133   */
00134
00135 /**
00136   * @brief  Initializes and configures the touch screen functionalities and
00137   *         configures all necessary hardware resources (GPIOs, clocks..).
00138   * @param  xSize: Maximum X size of the TS area on LCD
00139   * @param  ySize: Maximum Y size of the TS area on LCD
00140   * @retval TS_OK if all initializations are OK. Other value if error.
00141   */
00142 uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize)
00143 {
00144   uint8_t status = TS_OK;
00145   tsXBoundary = xSize;
00146   tsYBoundary = ySize;
00147
00148   /* Read ID and verify if the IO expander is ready */
00149   if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
00150   {
00151     /* Initialize the TS driver structure */
00152     tsDriver = &stmpe811_ts_drv;
00153     I2cAddress = TS_I2C_ADDRESS;
00154     tsOrientation = TS_SWAP_Y;
00155   }
00156   else
00157   {
00158     IOE_Init();
00159
00160     /* Check TS3510 touch screen driver presence to determine if TS3510 or
00161      * EXC7200 driver will be used */
00162     if(BSP_TS3510_IsDetected() == 0)
00163     {
00164       /* Initialize the TS driver structure */
00165       tsDriver = &ts3510_ts_drv;
00166       I2cAddress = TS3510_I2C_ADDRESS;
00167     }
00168     else
00169     {
00170       /* Initialize the TS driver structure */
00171       tsDriver = &exc7200_ts_drv;
00172       I2cAddress = EXC7200_I2C_ADDRESS;
00173     }
00174     tsOrientation = TS_SWAP_NONE;
00175   }
00176
00177   /* Initialize the TS driver */
00178   tsDriver->Init(I2cAddress);
00179   tsDriver->Start(I2cAddress);
00180
00181   return status;
00182 }
00183
00184 /**
00185   * @brief  DeInitializes the TouchScreen.
00186   * @retval TS state
00187   */
00188 uint8_t BSP_TS_DeInit(void)
00189 {
00190   /* Actually ts_driver does not provide a DeInit function */
00191   return TS_OK;
00192 }
00193
00194 /**
00195   * @brief  Configures and enables the touch screen interrupts.
00196   * @retval TS_OK if all initializations are OK. Other value if error.
00197   */
00198 uint8_t BSP_TS_ITConfig(void)
00199 {
00200   /* Initialize the IO */
00201   BSP_IO_Init();
00202
00203   /* Configure TS IT line IO */
00204   BSP_IO_ConfigPin(TS_INT_PIN, IO_MODE_IT_FALLING_EDGE);
00205
00206   /* Enable the TS ITs */
00207   tsDriver->EnableIT(I2cAddress);
00208
00209   return TS_OK;
00210 }
00211
00212 /**
00213   * @brief  Gets the touch screen interrupt status.
00214   * @retval TS_OK if all initializations are OK. Other value if error.
00215   */
00216 uint8_t BSP_TS_ITGetStatus(void)
00217 {
00218   /* Return the TS IT status */
00219   return (tsDriver->GetITStatus(I2cAddress));
00220 }
00221
00222 /**
00223   * @brief  Returns status and positions of the touch screen.
00224   * @param  TS_State: Pointer to touch screen current state structure
00225   * @retval TS_OK if all initializations are OK. Other value if error.
00226   */
00227 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00228 {
00229   static uint32_t _x = 0, _y = 0;
00230   uint16_t x_diff, y_diff , x , y;
00231   uint16_t swap;
00232
00233   TS_State->TouchDetected = tsDriver->DetectTouch(I2cAddress);
00234
00235   if(TS_State->TouchDetected)
00236   {
00237     tsDriver->GetXY(I2cAddress, &x, &y);
00238
00239     if(tsOrientation & TS_SWAP_X)
00240     {
00241       x = 4096 - x;
00242     }
00243
00244     if(tsOrientation & TS_SWAP_Y)
00245     {
00246       y = 4096 - y;
00247     }
00248
00249     if(tsOrientation & TS_SWAP_XY)
00250     {
00251       swap = y;
00252       y = x;
00253       x = swap;
00254     }
00255
00256     x_diff = x > _x? (x - _x): (_x - x);
00257     y_diff = y > _y? (y - _y): (_y - y);
00258
00259     if (x_diff + y_diff > 5)
00260     {
00261       _x = x;
00262       _y = y;
00263     }
00264
00265       TS_State->x = (tsXBoundary * _x) >> 12;
00266       TS_State->y = (tsYBoundary * _y) >> 12;
00267   }
00268   return TS_OK;
00269 }
00270
00271 /**
00272   * @brief  Clears all touch screen interrupts.
00273   * @retval None
00274   */
00275 void BSP_TS_ITClear(void)
00276 {
00277   /* Clear all IO IT pin */
00278   BSP_IO_ITClear();
00279
00280   /* Clear TS IT pending bits */
00281   tsDriver->ClearIT(I2cAddress);
00282 }
00283
00284 /**
00285   * @}
00286   */
00287
00288 /**
00289   * @}
00290   */
00291
00292 /**
00293   * @}
00294   */
00295
00296 /**
00297   * @}
00298   */
00299
00300 /************************ (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   * @version V2.0.0
00006   * @date    30-December-2016
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32756g_eval_ts.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00013   *
00014   * Redistribution and use in source and binary forms, with or without modification,
00015   * are permitted provided that the following conditions are met:
00016   *   1. Redistributions of source code must retain the above copyright notice,
00017   *      this list of conditions and the following disclaimer.
00018   *   2. Redistributions in binary form must reproduce the above copyright notice,
00019   *      this list of conditions and the following disclaimer in the documentation
00020   *      and/or other materials provided with the distribution.
00021   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00022   *      may be used to endorse or promote products derived from this software
00023   *      without specific prior written permission.
00024   *
00025   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00028   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00029   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035   *
00036   ******************************************************************************
00037   */
00038
00039 /* Define to prevent recursive inclusion -------------------------------------*/
00040 #ifndef __STM32756G_EVAL_TS_H
00041 #define __STM32756G_EVAL_TS_H
00042
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32756g_eval.h"
00049 /* Include IOExpander(STMPE811) component Driver */
00050 #include "../Components/stmpe811/stmpe811.h"
00051 /* Include TouchScreen component drivers */
00052 #include "../Components/ts3510/ts3510.h"
00053 #include "../Components/exc7200/exc7200.h"
00054
00055 /** @addtogroup BSP
00056   * @{
00057   */
00058
00059 /** @addtogroup STM32756G_EVAL
00060   * @{
00061   */
00062
00063 /** @addtogroup STM32756G_EVAL_TS
00064   * @{
00065   */
00066
00067 /** @defgroup STM32756G_EVAL_TS_Exported_Types TS Exported Types
00068   * @{
00069   */
00070 typedef struct
00071 {
00072   uint16_t TouchDetected;
00073   uint16_t x;
00074   uint16_t y;
00075   uint16_t z;
00076 }TS_StateTypeDef;
00077 /**
00078   * @}
00079   */
00080
00081 /** @defgroup STM32756G_EVAL_TS_Exported_Constants TS Exported Constants
00082   * @{
00083   */
00084 #define TS_SWAP_NONE                    ((uint8_t)0x00)
00085 #define TS_SWAP_X                       ((uint8_t)0x01)
00086 #define TS_SWAP_Y                       ((uint8_t)0x02)
00087 #define TS_SWAP_XY                      ((uint8_t)0x04)
00088
00089 typedef enum
00090 {
00091   TS_OK       = 0x00,
00092   TS_ERROR    = 0x01,
00093   TS_TIMEOUT  = 0x02
00094 }TS_StatusTypeDef;
00095
00096 /* Interrupt sources pins definition */
00097 #define TS_INT_PIN                      LCD_INT_PIN
00098 /**
00099   * @}
00100   */
00101
00102 /** @defgroup STM32756G_EVAL_TS_Exported_Macros TS Exported Macros
00103   * @{
00104   */
00105 /**
00106   * @}
00107   */
00108
00109 /** @defgroup STM32756G_EVAL_TS_Exported_Functions TS Exported Functions
00110   * @{
00111   */
00112 uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize);
00113 uint8_t BSP_TS_DeInit(void);
00114 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00115 uint8_t BSP_TS_ITConfig(void);
00116 uint8_t BSP_TS_ITGetStatus(void);
00117 void    BSP_TS_ITClear(void);
00118
00119 /**
00120   * @}
00121   */
00122
00123 /**
00124   * @}
00125   */
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135
00136 #ifdef __cplusplus
00137 }
00138 #endif
00139
00140 #endif /* __STM32756G_EVAL_TS_H */
00141
00142 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32756G_EVAL BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference