./STM32469I-Discovery BSP User Manual: ./STM32469I-Discovery BSP Drivers

./STM32469I-Discovery BSP User Manual
  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories
./STM32469I-Discovery BSP Drivers

BSP Drivers User Manual

This document contains the User Manual (UM) of the ./STM32469I-Discovery BSP peripheral Firmware drivers.

Document tabsheets description:

  • "Modules" : List the different modules.
  • "Files" : List all the files and globals.
  • "Directories" : Firmware Directory hierarchy.

Revision History:

Date | Revision | Author | Development Platform
01/21/2022 | V1.0 |  | ./STM32469I-Discovery Board
Generated on Fri Jan 21 2022 15:08:53 for ./STM32469I-Discovery BSP User Manual by doxygen 1.7.6.1


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private TypesDefinitions

  • Data Structures
  • Files
  • Directories
STM32469I Discovery LOW LEVEL Private TypesDefinitions
STM32469I Discovery LOW LEVEL


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private Defines

Defines
STM32469I Discovery LOW LEVEL Private Defines
STM32469I Discovery LOW LEVEL

Defines

#define | __STM32469I_DISCOVERY_BSP_VERSION_MAIN (0x02)
STM32469I Discovery BSP Driver version number V2.1.1.
#define | __STM32469I_DISCOVERY_BSP_VERSION_SUB1 (0x01)
#define | __STM32469I_DISCOVERY_BSP_VERSION_SUB2 (0x01)
#define | __STM32469I_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32469I_DISCOVERY_BSP_VERSION

Define Documentation

#define __STM32469I_DISCOVERY_BSP_VERSION
Value:
((__STM32469I_DISCOVERY_BSP_VERSION_MAIN << 24)\
                                                 |(__STM32469I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
                                                 |(__STM32469I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
                                                 |(__STM32469I_DISCOVERY_BSP_VERSION_RC))

Definition at line 54 of file stm32469i_discovery.c.

Referenced by BSP_GetVersion().

#define __STM32469I_DISCOVERY_BSP_VERSION_MAIN (0x02)

STM32469I Discovery BSP Driver version number V2.1.1.

[31:24] main version

Definition at line 50 of file stm32469i_discovery.c.

#define __STM32469I_DISCOVERY_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 53 of file stm32469i_discovery.c.

#define __STM32469I_DISCOVERY_BSP_VERSION_SUB1 (0x01)

[23:16] sub1 version

Definition at line 51 of file stm32469i_discovery.c.

#define __STM32469I_DISCOVERY_BSP_VERSION_SUB2 (0x01)

[15:8] sub2 version

Definition at line 52 of file stm32469i_discovery.c.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private Macros

STM32469I Discovery LOW LEVEL Private Macros
STM32469I Discovery LOW LEVEL


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private Variables

Variables
STM32469I Discovery LOW LEVEL Private Variables
STM32469I Discovery LOW LEVEL

Variables

uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | GPIO_PORT [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }
const uint16_t | BUTTON_PIN [BUTTONn] = {WAKEUP_BUTTON_PIN }
const uint16_t | BUTTON_IRQn [BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }
static I2C_HandleTypeDef | heval_I2c1
static I2C_HandleTypeDef | heval_I2c2

Variable Documentation

const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }

Definition at line 86 of file stm32469i_discovery.c.

Referenced by BSP_PB_DeInit(), and BSP_PB_Init().

const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN }

Definition at line 84 of file stm32469i_discovery.c.

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

GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }

Definition at line 82 of file stm32469i_discovery.c.

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

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

Definition at line 72 of file stm32469i_discovery.c.

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

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

Definition at line 77 of file stm32469i_discovery.c.

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

I2C_HandleTypeDef heval_I2c1 [static]

Definition at line 89 of file stm32469i_discovery.c.

Referenced by I2C1_Error(), I2C1_Init(), I2C1_IsDeviceReady(), I2C1_Read(), I2C1_ReadMultiple(), I2C1_Write(), and I2C1_WriteMultiple().

I2C_HandleTypeDef heval_I2c2 [static]

Definition at line 90 of file stm32469i_discovery.c.

Referenced by I2C2_Error(), I2C2_Init(), I2C2_ReadMultiple(), and I2C2_WriteMultiple().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private FunctionPrototypes

Functions
STM32469I Discovery LOW LEVEL Private FunctionPrototypes
STM32469I Discovery LOW LEVEL

Functions

static void | I2C1_MspInit (void)
Initializes I2C MSP.
static void | I2C2_MspInit (void)
Initializes I2C MSP.
static void | I2C1_Init (void)
Initializes I2C HAL.
static void | I2C2_Init (void)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2C2_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
static HAL_StatusTypeDef | I2C2_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
static void | I2C2_Error (uint8_t Addr)
void | AUDIO_IO_Init (void)
Initializes Audio low level.
void | AUDIO_IO_DeInit (void)
DeInitializes Audio low level.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
void | TS_IO_Init (void)
Initialize I2C communication channel from MCU to TouchScreen (TS).

Function Documentation

void AUDIO_IO_DeInit ( void )

DeInitializes Audio low level.

Definition at line 750 of file stm32469i_discovery.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Definition at line 742 of file stm32469i_discovery.c.

References I2C2_Init().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Definition at line 795 of file stm32469i_discovery.c.

References I2C1_Init().

Referenced by BSP_EEPROM_Init().

static void I2C1_Init ( void ) [static]

Initializes I2C HAL.

Definition at line 480 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_MspInit().

Referenced by EEPROM_IO_Init(), I2C1_Error(), and TS_IO_Init().

static void I2C1_MspInit ( void ) [static]

Initializes I2C MSP.

Definition at line 378 of file stm32469i_discovery.c.

References DISCO_I2C1_CLK_ENABLE, DISCO_I2C1_ER_IRQn, DISCO_I2C1_EV_IRQn, DISCO_I2C1_FORCE_RESET, DISCO_I2C1_RELEASE_RESET, DISCO_I2C1_SCL_PIN, DISCO_I2C1_SCL_SDA_AF, DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE, DISCO_I2C1_SCL_SDA_GPIO_PORT, and DISCO_I2C1_SDA_PIN.

Referenced by I2C1_Init().

static void I2C2_Error ( uint8_t Addr ) [static]

Definition at line 720 of file stm32469i_discovery.c.

References heval_I2c2, and I2C2_Init().

Referenced by I2C2_ReadMultiple(), and I2C2_WriteMultiple().

static void I2C2_Init ( void ) [static]

Initializes I2C HAL.

Definition at line 503 of file stm32469i_discovery.c.

References heval_I2c2, and I2C2_MspInit().

Referenced by AUDIO_IO_Init(), and I2C2_Error().

static void I2C2_MspInit ( void ) [static]

Initializes I2C MSP.

Definition at line 438 of file stm32469i_discovery.c.

References DISCO_I2C2_CLK_ENABLE, DISCO_I2C2_ER_IRQn, DISCO_I2C2_EV_IRQn, DISCO_I2C2_FORCE_RESET, DISCO_I2C2_RELEASE_RESET, DISCO_I2C2_SCL_PIN, DISCO_I2C2_SCL_SDA_AF, DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE, DISCO_I2C2_SCL_SDA_GPIO_PORT, and DISCO_I2C2_SDA_PIN.

Referenced by I2C2_Init().

static HAL_StatusTypeDef I2C2_ReadMultiple | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  | [static]

Definition at line 611 of file stm32469i_discovery.c.

References heval_I2c2, and I2C2_Error().

Referenced by AUDIO_IO_Read().

static HAL_StatusTypeDef I2C2_WriteMultiple | ( | uint8_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | MemAddSize,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  | [static]

Definition at line 670 of file stm32469i_discovery.c.

References heval_I2c2, and I2C2_Error().

Referenced by AUDIO_IO_Write().

void TS_IO_Init ( void )

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

Definition at line 844 of file stm32469i_discovery.c.

References I2C1_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery BSP Public Functions

Functions
STM32469I Discovery BSP Public Functions
STM32469I Discovery LOW LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32469I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.

Function Documentation

uint32_t BSP_GetVersion ( void )

This method returns the STM32469I Discovery BSP Driver revision.

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

Definition at line 151 of file stm32469i_discovery.c.

References __STM32469I_DISCOVERY_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

Definition at line 216 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

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

Definition at line 165 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, LED1, LED1_GPIO_CLK_ENABLE, LED2, LED2_GPIO_CLK_ENABLE, LED3, LED3_GPIO_CLK_ENABLE, LED4, and LED4_GPIO_CLK_ENABLE.

void BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

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

Definition at line 259 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

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

Definition at line 241 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

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

Definition at line 276 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

void BSP_PB_DeInit ( Button_TypeDef Button )

Push Button DeInit.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Note:
PB DeInit does not disable the GPIO clock

Definition at line 338 of file stm32469i_discovery.c.

References BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

uint32_t BSP_PB_GetState ( Button_TypeDef Button )

Returns the selected button state.

Parameters:
Button,: Button to be checked This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Return values:
The Button GPIO pin value

Definition at line 356 of file stm32469i_discovery.c.

References BUTTON_PIN, and BUTTON_PORT.

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

Configures button GPIO and EXTI Line.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Button_Mode,: Button mode This parameter can be one of the following values:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability

Definition at line 296 of file stm32469i_discovery.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Private Functions

Functions
STM32469I Discovery LOW LEVEL Private Functions
STM32469I Discovery LOW LEVEL

Functions

static void | I2C1_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
static uint8_t | I2C1_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
static HAL_StatusTypeDef | I2C1_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2C1_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 | I2C1_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2C1_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.

Function Documentation

static void I2C1_Error ( uint8_t Addr ) [static]

Manages error callback by re-initializing I2C.

Parameters:
Addr,: I2C Address

Definition at line 711 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_Init().

Referenced by I2C1_Read(), I2C1_ReadMultiple(), I2C1_Write(), and I2C1_WriteMultiple().

static HAL_StatusTypeDef I2C1_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 702 of file stm32469i_discovery.c.

References heval_I2c1.

Referenced by EEPROM_IO_IsDeviceReady().

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

Reads a single data.

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

Definition at line 555 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_Error().

Referenced by TS_IO_Read().

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

Reads multiple data.

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

Definition at line 586 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_Error().

Referenced by EEPROM_IO_ReadData(), and TS_IO_ReadMultiple().

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

Writes a single data.

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

Definition at line 529 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_Error().

Referenced by TS_IO_Write().

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

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

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

Definition at line 645 of file stm32469i_discovery.c.

References heval_I2c1, and I2C1_Error().

Referenced by EEPROM_IO_WriteData(), and TS_IO_WriteMultiple().


./STM32469I-Discovery BSP User Manual: Exported_types

Enumerations
Exported_types
STM32469I Discovery LOW LEVEL Exported Types

Enumerations

enum | ButtonValue_TypeDef { PB_SET = 0, PB_RESET = !PB_SET }
enum | DISCO_Status_TypeDef { DISCO_OK = 0, DISCO_ERROR = 1 }
DISCO_Status_TypeDef STM32469I_DISCO board Status return possible values. More...

Enumeration Type Documentation

enum ButtonValue_TypeDef
Enumerator:
PB_SET
PB_RESET

Definition at line 93 of file stm32469i_discovery.h.

enum DISCO_Status_TypeDef

DISCO_Status_TypeDef STM32469I_DISCO board Status return possible values.

Enumerator:
DISCO_OK
DISCO_ERROR

Definition at line 103 of file stm32469i_discovery.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Exported Types

Modules | Defines | Enumerations
STM32469I Discovery LOW LEVEL Exported Types
STM32469I Discovery LOW LEVEL

Modules

Exported_types

Defines

#define | BUTTON_USER BUTTON_WAKEUP

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_ORANGE = LED2,
LED3 = 2, LED_RED = LED3, LED4 = 3, LED_BLUE = LED4
}
Led_TypeDef STM32469I_Discovery board leds definitions. More...
enum | Button_TypeDef { BUTTON_WAKEUP = 0 }
Button_TypeDef STM32469I_Discovery board Buttons definitions. More...
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
ButtonMode_TypeDef STM32469I_Discovery board Buttons Modes definitions. More...

Define Documentation

#define BUTTON_USER BUTTON_WAKEUP

Definition at line 78 of file stm32469i_discovery.h.

Enumeration Type Documentation

enum Button_TypeDef

Button_TypeDef STM32469I_Discovery board Buttons definitions.

Enumerator:
BUTTON_WAKEUP

Definition at line 73 of file stm32469i_discovery.h.

enum ButtonMode_TypeDef

ButtonMode_TypeDef STM32469I_Discovery board Buttons Modes definitions.

Enumerator:
BUTTON_MODE_GPIO
BUTTON_MODE_EXTI

Definition at line 83 of file stm32469i_discovery.h.

enum Led_TypeDef

Led_TypeDef STM32469I_Discovery board leds definitions.

Enumerator:
LED1
LED_GREEN
LED2
LED_ORANGE
LED3
LED_RED
LED4
LED_BLUE

Definition at line 57 of file stm32469i_discovery.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL LED

Defines
STM32469I Discovery LOW LEVEL LED
STM32469I Discovery LOW LEVEL Exported Constants

Defines

#define | LEDn ((uint8_t)4)
#define | LED1_GPIO_PORT ((GPIO_TypeDef*)GPIOG)
#define | LED2_GPIO_PORT ((GPIO_TypeDef*)GPIOD)
#define | LED3_GPIO_PORT ((GPIO_TypeDef*)GPIOD)
#define | LED4_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | LED1_PIN ((uint32_t)GPIO_PIN_6)
#define | LED2_PIN ((uint32_t)GPIO_PIN_4)
#define | LED3_PIN ((uint32_t)GPIO_PIN_5)
#define | LED4_PIN ((uint32_t)GPIO_PIN_3)

Define Documentation

#define LED1_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 137 of file stm32469i_discovery.h.

#define LED1_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 136 of file stm32469i_discovery.h.

Referenced by BSP_LED_Init().

#define LED1_GPIO_PORT ((GPIO_TypeDef*)GPIOG)

Definition at line 131 of file stm32469i_discovery.h.

#define LED1_PIN ((uint32_t)GPIO_PIN_6)

Definition at line 145 of file stm32469i_discovery.h.

#define LED2_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 139 of file stm32469i_discovery.h.

#define LED2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 138 of file stm32469i_discovery.h.

Referenced by BSP_LED_Init().

#define LED2_GPIO_PORT ((GPIO_TypeDef*)GPIOD)

Definition at line 132 of file stm32469i_discovery.h.

#define LED2_PIN ((uint32_t)GPIO_PIN_4)

Definition at line 146 of file stm32469i_discovery.h.

#define LED3_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 141 of file stm32469i_discovery.h.

#define LED3_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 140 of file stm32469i_discovery.h.

Referenced by BSP_LED_Init().

#define LED3_GPIO_PORT ((GPIO_TypeDef*)GPIOD)

Definition at line 133 of file stm32469i_discovery.h.

#define LED3_PIN ((uint32_t)GPIO_PIN_5)

Definition at line 147 of file stm32469i_discovery.h.

#define LED4_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOK_CLK_DISABLE()

Definition at line 143 of file stm32469i_discovery.h.

#define LED4_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOK_CLK_ENABLE()

Definition at line 142 of file stm32469i_discovery.h.

Referenced by BSP_LED_Init().

#define LED4_GPIO_PORT ((GPIO_TypeDef*)GPIOK)

Definition at line 134 of file stm32469i_discovery.h.

#define LED4_PIN ((uint32_t)GPIO_PIN_3)

Definition at line 148 of file stm32469i_discovery.h.

#define LEDn ((uint8_t)4)

Definition at line 127 of file stm32469i_discovery.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL BUTTON

Defines
STM32469I Discovery LOW LEVEL BUTTON
STM32469I Discovery LOW LEVEL Exported Constants

Defines

#define | BUTTONn ((uint8_t)1)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_0
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOA
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn
#define | USER_BUTTON_PIN WAKEUP_BUTTON_PIN
#define | USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
#define | USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
#define | USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
#define | USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
#define | BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()

Define Documentation

#define BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 175 of file stm32469i_discovery.h.

Referenced by BSP_PB_Init().

#define BUTTONn ((uint8_t)1)

Definition at line 157 of file stm32469i_discovery.h.

#define USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn

Definition at line 173 of file stm32469i_discovery.h.

#define USER_BUTTON_GPIO_CLK_DISABLE ( ) WAKEUP_BUTTON_GPIO_CLK_DISABLE()

Definition at line 172 of file stm32469i_discovery.h.

#define USER_BUTTON_GPIO_CLK_ENABLE ( ) WAKEUP_BUTTON_GPIO_CLK_ENABLE()

Definition at line 171 of file stm32469i_discovery.h.

#define USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT

Definition at line 170 of file stm32469i_discovery.h.

#define USER_BUTTON_PIN WAKEUP_BUTTON_PIN

Definition at line 169 of file stm32469i_discovery.h.

#define WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn

Definition at line 166 of file stm32469i_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 165 of file stm32469i_discovery.h.

#define WAKEUP_BUTTON_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 164 of file stm32469i_discovery.h.

#define WAKEUP_BUTTON_GPIO_PORT GPIOA

Definition at line 163 of file stm32469i_discovery.h.

#define WAKEUP_BUTTON_PIN GPIO_PIN_0

Wakeup push-button.

Definition at line 162 of file stm32469i_discovery.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Exported Constants

Modules | Defines
STM32469I Discovery LOW LEVEL Exported Constants
STM32469I Discovery LOW LEVEL

Modules

STM32469I Discovery LOW LEVEL LED
STM32469I Discovery LOW LEVEL BUTTON

Defines

#define | AUDIO_INT_PIN GPIO_PIN_7
OTG_FS1 OVER_CURRENT and POWER_SWITCH Pins definition.
#define | AUDIO_INT_PORT GPIOB
#define | AUDIO_INT_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OTG_FS1_OVER_CURRENT_PIN GPIO_PIN_7
#define | OTG_FS1_OVER_CURRENT_PORT GPIOB
#define | OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OTG_FS1_POWER_SWITCH_PIN GPIO_PIN_2
#define | OTG_FS1_POWER_SWITCH_PORT GPIOB
#define | OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | SD_DETECT_PIN ((uint32_t)GPIO_PIN_2)
SD-detect signal.
#define | SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOG)
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI2_IRQn
#define | TS_INT_PIN ((uint32_t)GPIO_PIN_5)
TS_INT signal from TouchScreen when it is configured in interrupt mode.
#define | TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOJ)
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_I2C_ADDRESS ((uint16_t)0x54)
TouchScreen FT6206 Slave I2C address 1.
#define | TS_I2C_ADDRESS_A02 ((uint16_t)0x70)
TouchScreen FT6336G Slave I2C address 2.
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x94)
Audio I2C Slave address.
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
EEPROM I2C Slave address 1.
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
EEPROM I2C Slave address 2.
#define | DISCO_I2C1 I2C1
I2C clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.
#define | DISCO_I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCO_I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCO_I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCO_I2C1_SCL_PIN GPIO_PIN_8
Definition for I2C1 Pins.
#define | DISCO_I2C1_SCL_SDA_GPIO_PORT GPIOB
#define | DISCO_I2C1_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCO_I2C1_SDA_PIN GPIO_PIN_9
#define | DISCO_I2C1_EV_IRQn I2C1_EV_IRQn
Definition of I2C interrupt requests.
#define | DISCO_I2C1_ER_IRQn I2C1_ER_IRQn
#define | DISCO_I2C2 I2C2
I2C2 clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.
#define | DISCO_I2C2_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCO_I2C2_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCO_I2C2_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCO_I2C2_SCL_PIN GPIO_PIN_4
Definition for I2C2 Pins.
#define | DISCO_I2C2_SCL_SDA_GPIO_PORT GPIOH
#define | DISCO_I2C2_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCO_I2C2_SDA_PIN GPIO_PIN_5
#define | DISCO_I2C2_EV_IRQn I2C2_EV_IRQn
Definition of I2C2 interrupt requests.
#define | DISCO_I2C2_ER_IRQn I2C2_ER_IRQn

Define Documentation

#define AUDIO_I2C_ADDRESS ((uint16_t)0x94)

Audio I2C Slave address.

Definition at line 228 of file stm32469i_discovery.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 AUDIO_INT_PIN GPIO_PIN_7

OTG_FS1 OVER_CURRENT and POWER_SWITCH Pins definition.

Definition at line 184 of file stm32469i_discovery.h.

#define AUDIO_INT_PORT GPIOB

Definition at line 185 of file stm32469i_discovery.h.

#define AUDIO_INT_PORT_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 186 of file stm32469i_discovery.h.

#define DISCO_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 257 of file stm32469i_discovery.h.

#define DISCO_I2C1 I2C1

I2C clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.

User can use this section to tailor I2C1/I2C1 instance used and associated resources. Definition for I2C1 clock resources

Definition at line 255 of file stm32469i_discovery.h.

#define DISCO_I2C1_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 256 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_ER_IRQn I2C1_ER_IRQn

Definition at line 273 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_EV_IRQn I2C1_EV_IRQn

Definition of I2C interrupt requests.

Definition at line 272 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 260 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 261 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_SCL_PIN GPIO_PIN_8

Definition for I2C1 Pins.

PB8

Definition at line 265 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 267 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 258 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_SCL_SDA_GPIO_PORT GPIOB

Definition at line 266 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C1_SDA_PIN GPIO_PIN_9

PB9

Definition at line 268 of file stm32469i_discovery.h.

Referenced by I2C1_MspInit().

#define DISCO_I2C2 I2C2

I2C2 clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.

User can use this section to tailor I2C2/I2C2 instance used and associated resources (audio codec). Definition for I2C2 clock resources

Definition at line 292 of file stm32469i_discovery.h.

#define DISCO_I2C2_CLK_ENABLE ( ) __HAL_RCC_I2C2_CLK_ENABLE()

Definition at line 293 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_ER_IRQn I2C2_ER_IRQn

Definition at line 309 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_EV_IRQn I2C2_EV_IRQn

Definition of I2C2 interrupt requests.

Definition at line 308 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_FORCE_RESET ( ) __HAL_RCC_I2C2_FORCE_RESET()

Definition at line 296 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_RELEASE_RESET ( ) __HAL_RCC_I2C2_RELEASE_RESET()

Definition at line 297 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_SCL_PIN GPIO_PIN_4

Definition for I2C2 Pins.

PH4

Definition at line 301 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_SCL_SDA_AF GPIO_AF4_I2C2

Definition at line 303 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 294 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_SCL_SDA_GPIO_PORT GPIOH

Definition at line 302 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define DISCO_I2C2_SDA_PIN GPIO_PIN_5

PH5

Definition at line 304 of file stm32469i_discovery.h.

Referenced by I2C2_MspInit().

#define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)

EEPROM I2C Slave address 1.

Definition at line 233 of file stm32469i_discovery.h.

Referenced by BSP_EEPROM_Init().

#define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)

EEPROM I2C Slave address 2.

Definition at line 238 of file stm32469i_discovery.h.

Referenced by BSP_EEPROM_Init().

#define OTG_FS1_OVER_CURRENT_PIN GPIO_PIN_7

Definition at line 188 of file stm32469i_discovery.h.

#define OTG_FS1_OVER_CURRENT_PORT GPIOB

Definition at line 189 of file stm32469i_discovery.h.

#define OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 190 of file stm32469i_discovery.h.

#define OTG_FS1_POWER_SWITCH_PIN GPIO_PIN_2

Definition at line 192 of file stm32469i_discovery.h.

#define OTG_FS1_POWER_SWITCH_PORT GPIOB

Definition at line 193 of file stm32469i_discovery.h.

#define OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 194 of file stm32469i_discovery.h.

#define SD_DETECT_EXTI_IRQn EXTI2_IRQn

Definition at line 203 of file stm32469i_discovery.h.

Referenced by BSP_SD_ITConfig().

#define SD_DETECT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 202 of file stm32469i_discovery.h.

#define SD_DETECT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 201 of file stm32469i_discovery.h.

Referenced by BSP_SD_Detect_MspInit().

#define SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOG)

Definition at line 200 of file stm32469i_discovery.h.

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

#define SD_DETECT_PIN ((uint32_t)GPIO_PIN_2)

SD-detect signal.

Definition at line 199 of file stm32469i_discovery.h.

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

#define TS_I2C_ADDRESS ((uint16_t)0x54)

TouchScreen FT6206 Slave I2C address 1.

Definition at line 217 of file stm32469i_discovery.h.

Referenced by BSP_TS_Init().

#define TS_I2C_ADDRESS_A02 ((uint16_t)0x70)

TouchScreen FT6336G Slave I2C address 2.

Definition at line 222 of file stm32469i_discovery.h.

Referenced by BSP_TS_Init().

#define TS_INT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 212 of file stm32469i_discovery.h.

Referenced by BSP_TS_ITConfig().

#define TS_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOJ_CLK_DISABLE()

Definition at line 211 of file stm32469i_discovery.h.

#define TS_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOJ_CLK_ENABLE()

Definition at line 210 of file stm32469i_discovery.h.

Referenced by BSP_TS_INT_MspInit().

#define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOJ)

Definition at line 209 of file stm32469i_discovery.h.

Referenced by BSP_TS_INT_MspInit(), and BSP_TS_ITConfig().

#define TS_INT_PIN ((uint32_t)GPIO_PIN_5)

TS_INT signal from TouchScreen when it is configured in interrupt mode.

Definition at line 208 of file stm32469i_discovery.h.

Referenced by BSP_TS_INT_MspInit(), and BSP_TS_ITConfig().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Exported Macros

STM32469I Discovery LOW LEVEL Exported Macros
STM32469I Discovery LOW LEVEL


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL Exported Functions

Functions
STM32469I Discovery LOW LEVEL Exported Functions
STM32469I Discovery LOW LEVEL

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32469I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.

Function Documentation

uint32_t BSP_GetVersion ( void )

This method returns the STM32469I Discovery BSP Driver revision.

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

Definition at line 151 of file stm32469i_discovery.c.

References __STM32469I_DISCOVERY_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

Definition at line 216 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIO.

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

Definition at line 165 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, LED1, LED1_GPIO_CLK_ENABLE, LED2, LED2_GPIO_CLK_ENABLE, LED3, LED3_GPIO_CLK_ENABLE, LED4, and LED4_GPIO_CLK_ENABLE.

void BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

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

Definition at line 259 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

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

Definition at line 241 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

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

Definition at line 276 of file stm32469i_discovery.c.

References GPIO_PIN, GPIO_PORT, and LED4.

void BSP_PB_DeInit ( Button_TypeDef Button )

Push Button DeInit.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Note:
PB DeInit does not disable the GPIO clock

Definition at line 338 of file stm32469i_discovery.c.

References BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

uint32_t BSP_PB_GetState ( Button_TypeDef Button )

Returns the selected button state.

Parameters:
Button,: Button to be checked This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Return values:
The Button GPIO pin value

Definition at line 356 of file stm32469i_discovery.c.

References BUTTON_PIN, and BUTTON_PORT.

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

Configures button GPIO and EXTI Line.

Parameters:
Button,: Button to be configured This parameter can be one of the following values:
  • BUTTON_WAKEUP: Wakeup Push Button
  • BUTTON_USER: User Push Button
Button_Mode,: Button mode This parameter can be one of the following values:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability

Definition at line 296 of file stm32469i_discovery.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LOW LEVEL

Modules | Functions
STM32469I Discovery LOW LEVEL
STM32469I Discovery

Modules

STM32469I Discovery LOW LEVEL Private TypesDefinitions
STM32469I Discovery LOW LEVEL Private Defines
STM32469I Discovery LOW LEVEL Private Macros
STM32469I Discovery LOW LEVEL Private Variables
STM32469I Discovery LOW LEVEL Private FunctionPrototypes
STM32469I Discovery BSP Public Functions
STM32469I Discovery LOW LEVEL Private Functions
STM32469I Discovery LOW LEVEL Exported Types
STM32469I Discovery LOW LEVEL Exported Constants
STM32469I Discovery LOW LEVEL Exported Macros
STM32469I Discovery LOW LEVEL Exported Functions

Functions

void | AUDIO_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | AUDIO_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
void | AUDIO_IO_Delay (uint32_t Delay)
AUDIO Codec delay.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes single data with I2C communication channel from MCU to TouchScreen.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from TouchScreen.
uint16_t | TS_IO_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Reads multiple data with I2C communication channel from TouchScreen.
void | TS_IO_WriteMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Writes multiple data with I2C communication channel from MCU to TouchScreen.
void | TS_IO_Delay (uint32_t Delay)
Delay function used in TouchScreen low level driver.
void | OTM8009A_IO_Delay (uint32_t Delay)
OTM8009A delay.
void | NT35510_IO_Delay (uint32_t Delay)
NT35510 delay.

Function Documentation

void AUDIO_IO_Delay ( uint32_t Delay )

AUDIO Codec delay.

Parameters:
Delay,: Delay in ms

Definition at line 785 of file stm32469i_discovery.c.

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

Reads a single data.

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

Definition at line 772 of file stm32469i_discovery.c.

References I2C2_ReadMultiple().

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

Writes a single data.

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

Definition at line 761 of file stm32469i_discovery.c.

References I2C2_WriteMultiple().

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

Checks if target device is ready for communication.

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

Definition at line 833 of file stm32469i_discovery.c.

References I2C1_IsDeviceReady().

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

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

Read data from I2C EEPROM driver in using DMA channel.

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

Definition at line 821 of file stm32469i_discovery.c.

References I2C1_ReadMultiple().

Referenced by BSP_EEPROM_ReadBuffer().

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

Write data to I2C EEPROM driver in using DMA channel.

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

Definition at line 808 of file stm32469i_discovery.c.

References I2C1_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().

void NT35510_IO_Delay ( uint32_t Delay )

NT35510 delay.

Parameters:
Delay,: Delay in ms

Definition at line 924 of file stm32469i_discovery.c.

void OTM8009A_IO_Delay ( uint32_t Delay )

OTM8009A delay.

Parameters:
Delay,: Delay in ms

Definition at line 914 of file stm32469i_discovery.c.

void TS_IO_Delay ( uint32_t Delay )

Delay function used in TouchScreen low level driver.

Parameters:
Delay,: Delay in ms

Definition at line 904 of file stm32469i_discovery.c.

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

Reads single data with I2C communication channel from TouchScreen.

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

Definition at line 868 of file stm32469i_discovery.c.

References I2C1_Read().

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

Reads multiple data with I2C communication channel from TouchScreen.

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

Definition at line 882 of file stm32469i_discovery.c.

References I2C1_ReadMultiple().

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

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

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

Definition at line 856 of file stm32469i_discovery.c.

References I2C1_Write().

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

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

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

Definition at line 895 of file stm32469i_discovery.c.

References I2C1_WriteMultiple().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Private Types

STM32469I Discovery AUDIO Private Types
STM32469I Discovery AUDIO


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Private Defines

Defines
STM32469I Discovery AUDIO Private Defines
STM32469I Discovery AUDIO

Headphone1 (CN27 of STM32469I-Discovery board) is connected to the HEADPHONE output of CS43L22 Audio Codec. More...

Defines

#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER

Detailed Description

Headphone1 (CN27 of STM32469I-Discovery board) is connected to the HEADPHONE output of CS43L22 Audio Codec.

Headphone2 (CN26 of STM32469I-Discovery board) is connected to the SPEAKER output of CS43L22 Audio Codec.

Define Documentation

#define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE

Definition at line 113 of file stm32469i_discovery_audio.c.

#define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER

Definition at line 116 of file stm32469i_discovery_audio.c.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Private macros

Defines
STM32469I Discovery AUDIO Private macros
STM32469I Discovery AUDIO

Defines

#define SAIClockDivider(__FREQUENCY__)

Define Documentation

#define SAIClockDivider ( __FREQUENCY__ )
Value:
(__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 12 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 2 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 6 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 1 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 3 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 0 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 2 : 1  \

Definition at line 127 of file stm32469i_discovery_audio.c.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Private Variables

Variables
STM32469I Discovery AUDIO Private Variables
STM32469I Discovery AUDIO

Variables

AUDIO_DrvTypeDef * | audio_drv
SAI_HandleTypeDef | haudio_out_sai
I2S_HandleTypeDef | haudio_in_i2s
TIM_HandleTypeDef | haudio_tim
PDM_Filter_Handler_t | PDM_FilterHandler [2]
PDM_Filter_Config_t | PDM_FilterConfig [2]
uint8_t | Channel_Demux [128]
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Variable Documentation

AUDIO_DrvTypeDef* audio_drv

Definition at line 152 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_DeInit(), 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 180 of file stm32469i_discovery_audio.c.

Referenced by 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 161 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM().

I2S_HandleTypeDef haudio_in_i2s

Definition at line 154 of file stm32469i_discovery_audio.c.

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

SAI_HandleTypeDef haudio_out_sai

Definition at line 153 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_ChangeAudioConfig(), 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 155 of file stm32469i_discovery_audio.c.

Referenced by TIMx_DeInit(), and TIMx_Init().

PDM_Filter_Config_t PDM_FilterConfig[2]

Definition at line 159 of file stm32469i_discovery_audio.c.

Referenced by PDMDecoder_Init().

PDM_Filter_Handler_t PDM_FilterHandler[2]

Definition at line 158 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_PDMToPCM(), and PDMDecoder_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Private Prototypes

Functions
STM32469I Discovery AUDIO Private Prototypes
STM32469I Discovery AUDIO

Functions

static void | SAIx_DeInit (void)
Deinitializes the Audio Codec audio interface (SAI).
static void | I2Sx_DeInit (void)
Deinitializes the Audio Codec audio interface (I2S).

Function Documentation

static void I2Sx_DeInit ( void ) [static]

Deinitializes the Audio Codec audio interface (I2S).

Definition at line 1320 of file stm32469i_discovery_audio.c.

References AUDIO_I2Sx, and haudio_in_i2s.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_IN_Init().

static void SAIx_DeInit ( void ) [static]

Deinitializes the Audio Codec audio interface (SAI).

Definition at line 882 of file stm32469i_discovery_audio.c.

References AUDIO_SAIx, and haudio_out_sai.

Referenced by BSP_AUDIO_OUT_DeInit(), and BSP_AUDIO_OUT_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO OUT Private Functions

Functions
STM32469I Discovery AUDIO OUT Private Functions
STM32469I Discovery AUDIO

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
uint8_t | BSP_AUDIO_OUT_Pause (void)
This function Pauses the audio file stream.
uint8_t | BSP_AUDIO_OUT_Resume (void)
This function Resumes the audio file stream.
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option)
Stops audio playing and Power down the Audio Codec.
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
Controls the current audio volume level.
uint8_t | BSP_AUDIO_OUT_SetMute (uint32_t Cmd)
Enables or disables the MUTE mode by software.
uint8_t | BSP_AUDIO_OUT_SetOutputMode (uint8_t Output)
Switch dynamically (while audio file is being 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 BSP_AUDIO_OUT MSP.
__weak void | BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
Clock Config.
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption)
Changes the Audio Out Configuration.
static uint8_t | SAIx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).

Function Documentation

void BSP_AUDIO_OUT_ChangeAudioConfig ( uint32_t AudioOutOption )

Changes the Audio Out Configuration.

Parameters:
AudioOutOption,: specifies the audio out new configuration This parameter can be any value of BSP AUDIO OUT Option
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio out configuration.

Definition at line 499 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_CIRCULARMODE, BSP_AUDIO_OUT_STEREOMODE, and haudio_out_sai.

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

Sends n-Bytes on the SAI interface.

Parameters:
pData,: pointer on PCM samples buffer
Size,: number of data to be written

Definition at line 305 of file stm32469i_discovery_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.
Note:
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Parameters:
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 766 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetFrequency().

void BSP_AUDIO_OUT_DeInit ( void )

Deinit the audio peripherals.

Definition at line 575 of file stm32469i_discovery_audio.c.

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

__weak void BSP_AUDIO_OUT_Error_CallBack ( void )

Manages the DMA FIFO error event.

Definition at line 633 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Definition at line 626 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_TxHalfCpltCallback().

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

Configures the audio peripherals.

Parameters:
OutputDevice,: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
Volume,: Initial volume level (from 0 (Mute) to 100 (Max))
AudioFreq,: Audio frequency used to play the audio stream.
Note:
The SAI PLL input clock must be done in the user application.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 218 of file stm32469i_discovery_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 BSP_AUDIO_OUT MSP.

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

Definition at line 720 of file stm32469i_discovery_audio.c.

References AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, AUDIO_SAIx, AUDIO_SAIx_CLK_DISABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_MCK_PIN, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_FS_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 : pointer on additional configuration parameters, can be NULL.

Definition at line 642 of file stm32469i_discovery_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_RESET_ENABLE, AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, 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_PIN, AUDIO_SAIx_MCK_PIN, AUDIO_SAIx_MCLK_ENABLE, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_SCK_SD_FS_AF, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_FS_ENABLE, AUDIO_SAIx_SCK_SD_FS_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.

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

Definition at line 318 of file stm32469i_discovery_audio.c.

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

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

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

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

Definition at line 278 of file stm32469i_discovery_audio.c.

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

uint8_t BSP_AUDIO_OUT_Resume ( void )

This function Resumes the audio file stream.

WARNING: When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 349 of file stm32469i_discovery_audio.c.

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

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t AudioFrameSlot )

Updates the Audio frame slot configuration.

Parameters:
AudioFrameSlot,: specifies the audio Frame slot This parameter can be any value of STM32469I Discovery Audio Slot TDM mode
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frame slot.

Definition at line 559 of file stm32469i_discovery_audio.c.

References haudio_out_sai.

void BSP_AUDIO_OUT_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: Audio frequency used to play the audio stream.
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frequency.

Definition at line 476 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_ClockConfig(), and haudio_out_sai.

uint8_t BSP_AUDIO_OUT_SetMute ( uint32_t Cmd )

Enables or disables the MUTE mode by software.

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

Definition at line 435 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetOutputMode ( uint8_t Output )

Switch dynamically (while audio file is being 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 456 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetVolume ( uint8_t Volume )

Controls the current audio volume level.

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

Definition at line 415 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_Stop ( uint32_t Option )

Stops audio playing and Power down the Audio Codec.

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

Definition at line 381 of file stm32469i_discovery_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.

Definition at line 619 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_TxCpltCallback().

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai,: SAI handle

Definition at line 611 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_Error_CallBack().

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Transfer completed callbacks.

Parameters:
hsai,: SAI handle

Definition at line 589 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_TransferComplete_CallBack().

void HAL_SAI_TxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Half Transfer completed callbacks.

Parameters:
hsai,: SAI handle

Definition at line 600 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_HalfTransfer_CallBack().

static uint8_t 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

Definition at line 811 of file stm32469i_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, AUDIO_SAIx, CODEC_AUDIOFRAME_SLOT_0123, and haudio_out_sai.

Referenced by BSP_AUDIO_OUT_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO IN Private functions

Functions
STM32469I Discovery AUDIO IN Private functions
STM32469I Discovery AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_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_ClockConfig (I2S_HandleTypeDef *hi2s, void *Params)
Clock Config.
__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)
BSP AUDIO IN MSP Init.
__weak void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.
static void | PDMDecoder_Init (uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
Initializes the PDM library.
static void | I2Sx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (I2S)
static void | TIMx_IC_MspInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_IC_MspDeInit (TIM_HandleTypeDef *htim)
Initializes the TIM INput Capture MSP.
static void | TIMx_Init (void)
Configure TIM as a clock divider by 2.
static void | TIMx_DeInit (void)
Configure TIM as a clock divider by 2.

Function Documentation

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

Clock Config.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application

Definition at line 1097 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Definition at line 1019 of file stm32469i_discovery_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.

Definition at line 1131 of file stm32469i_discovery_audio.c.

Referenced by HAL_I2S_ErrorCallback().

__weak void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Definition at line 1121 of file stm32469i_discovery_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 911 of file stm32469i_discovery_audio.c.

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

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

DeInitializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 1221 of file stm32469i_discovery_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
 | ) |  |

BSP AUDIO IN MSP Init.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 1142 of file stm32469i_discovery_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 979 of file stm32469i_discovery_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 1033 of file stm32469i_discovery_audio.c.

References AUDIO_OK, Channel_Demux, CHANNEL_DEMUX_MASK, DEFAULT_AUDIO_IN_CHANNEL_NBR, INTERNAL_BUFF_SIZE, and PDM_FilterHandler.

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 942 of file stm32469i_discovery_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 992 of file stm32469i_discovery_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 1007 of file stm32469i_discovery_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 959 of file stm32469i_discovery_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.

Definition at line 1111 of file stm32469i_discovery_audio.c.

Referenced by HAL_I2S_RxCpltCallback().

void HAL_I2S_ErrorCallback ( I2S_HandleTypeDef * hi2s )

I2S error callbacks.

Parameters:
hi2s,: I2S handle

Definition at line 1083 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_IN_Error_Callback().

void HAL_I2S_RxCpltCallback ( I2S_HandleTypeDef * hi2s )

Rx Transfer completed callbacks.

Parameters:
hi2s,: I2S handle

Definition at line 1062 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_IN_TransferComplete_CallBack().

void HAL_I2S_RxHalfCpltCallback ( I2S_HandleTypeDef * hi2s )

Rx Half Transfer completed callbacks.

Parameters:
hi2s,: I2S handle

Definition at line 1072 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_IN_HalfTransfer_CallBack().

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 dedicated PLLI2S_R) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the I2S peripheral.

Definition at line 1292 of file stm32469i_discovery_audio.c.

References AUDIO_I2Sx, and haudio_in_i2s.

Referenced by BSP_AUDIO_IN_Init().

static void PDMDecoder_Init | ( | uint32_t | AudioFreq,
 |  | uint32_t | ChnlNbrIn,
 |  | uint32_t | ChnlNbrOut
 | ) |  | [static]

Initializes the PDM library.

Parameters:
AudioFreq,: Audio sampling frequency
ChnlNbrIn,: Number of input audio channels in the PDM buffer
ChnlNbrOut,: Number of desired output audio channels in the resulting PCM buffer Number of audio channels (1: mono; 2: stereo)

Definition at line 1261 of file stm32469i_discovery_audio.c.

References PDM_FilterConfig, and PDM_FilterHandler.

Referenced by BSP_AUDIO_IN_Init().

static void TIMx_DeInit ( void ) [static]

Configure TIM as a clock divider by 2.

I2S_SCK is externally connected to TIMx input channel

Definition at line 1453 of file stm32469i_discovery_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

Definition at line 1368 of file stm32469i_discovery_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

Definition at line 1337 of file stm32469i_discovery_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

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Exported Types

STM32469I Discovery AUDIO Exported Types
STM32469I Discovery AUDIO


./STM32469I-Discovery BSP User Manual: BSP AUDIO OUT Option

Defines
BSP AUDIO OUT Option
STM32469I Discovery AUDIO Exported Constants

Defines

#define | BSP_AUDIO_OUT_CIRCULARMODE ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */
#define | BSP_AUDIO_OUT_NORMALMODE ((uint32_t)0x00000002) /* BUFFER NORMAL MODE */
#define | BSP_AUDIO_OUT_STEREOMODE ((uint32_t)0x00000004) /* STEREO MODE */
#define | BSP_AUDIO_OUT_MONOMODE ((uint32_t)0x00000008) /* MONO MODE */

Define Documentation

#define BSP_AUDIO_OUT_CIRCULARMODE ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */

Definition at line 68 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_ChangeAudioConfig().

#define BSP_AUDIO_OUT_MONOMODE ((uint32_t)0x00000008) /* MONO MODE */

Definition at line 71 of file stm32469i_discovery_audio.h.

#define BSP_AUDIO_OUT_NORMALMODE ((uint32_t)0x00000002) /* BUFFER NORMAL MODE */

Definition at line 69 of file stm32469i_discovery_audio.h.

#define BSP_AUDIO_OUT_STEREOMODE ((uint32_t)0x00000004) /* STEREO MODE */

Definition at line 70 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_ChangeAudioConfig().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery Audio Slot TDM mode

Defines
STM32469I Discovery Audio Slot TDM mode
STM32469I Discovery AUDIO Exported Constants

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 | +------------------------------------------------------------------------------+. More...

Defines

#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Detailed Description

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 Documentation

#define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

Definition at line 88 of file stm32469i_discovery_audio.h.

Referenced by SAIx_Init().

#define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2

Definition at line 90 of file stm32469i_discovery_audio.h.

#define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3

Definition at line 92 of file stm32469i_discovery_audio.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO Exported Constants

Modules | Defines
STM32469I Discovery AUDIO Exported Constants
STM32469I Discovery AUDIO

Modules

BSP AUDIO OUT Option
STM32469I Discovery Audio Slot TDM mode

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

Defines

#define | AUDIO_SAIx SAI1_Block_A
#define | AUDIO_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_SAIx_MCLK_SCK_SD_FS_AF GPIO_AF6_SAI1
#define | AUDIO_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_SAIx_MCLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | AUDIO_SAIx_MCK_PIN GPIO_PIN_7
#define | AUDIO_SAIx_MCLK_GPIO_PORT GPIOG
#define | AUDIO_SAIx_SCK_SD_FS_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_SCK_SD_FS_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_SAIx_FS_PIN GPIO_PIN_4
#define | AUDIO_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_SAIx_SCK_SD_FS_GPIO_PORT GPIOE
#define | AUDIO_RESET_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_RESET_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_RESET_PIN GPIO_PIN_2
#define | AUDIO_RESET_GPIO_PORT GPIOE
#define | AUDIO_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_SAIx_DMAx_CLK_DISABLE() __HAL_RCC_DMA2_CLK_DISABLE()
#define | AUDIO_SAIx_DMAx_STREAM DMA2_Stream3
#define | AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Stream3_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_Stream3_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_SAIx_PLL_DISABLE() HAL_RCCEx_DisablePLLSAI1()
#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_I2S3ext
#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)6) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_TIMx_CLK_ENABLE() __HAL_RCC_TIM4_CLK_ENABLE()
#define | AUDIO_TIMx_CLK_DISABLE() __HAL_RCC_TIM4_CLK_DISABLE()
#define | AUDIO_TIMx TIM4
#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_GPIOD_CLK_ENABLE()
#define | AUDIO_TIMx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | AUDIO_TIMx_GPIO_PORT GPIOD
#define | AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_12
#define | AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_13
#define | AUDIO_TIMx_AF GPIO_AF2_TIM4
#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*DEFAULT_AUDIO_IN_CHANNEL_NBR)
#define | CHANNEL_DEMUX_MASK ((uint8_t)0x55)
#define | CODEC_RESET_DELAY ((uint8_t)5)

Define Documentation

#define AUDIO_ERROR ((uint8_t)1)

Definition at line 197 of file stm32469i_discovery_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(), BSP_AUDIO_OUT_Stop(), and SAIx_Init().

#define AUDIO_I2Sx SPI3

Definition at line 142 of file stm32469i_discovery_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 144 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit().

#define AUDIO_I2Sx_CLK_ENABLE ( ) __HAL_RCC_SPI3_CLK_ENABLE()

Definition at line 143 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 161 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_CLK_DISABLE ( ) __HAL_RCC_DMA1_CLK_DISABLE()

Definition at line 159 of file stm32469i_discovery_audio.h.

#define AUDIO_I2Sx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 158 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_IRQ DMA1_Stream2_IRQn

Definition at line 162 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_IRQHandler DMA1_Stream2_IRQHandler

Definition at line 166 of file stm32469i_discovery_audio.h.

#define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 164 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 163 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_DMAx_STREAM DMA1_Stream2

Definition at line 160 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_AF GPIO_AF6_SPI3

Definition at line 149 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 148 of file stm32469i_discovery_audio.h.

#define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 147 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_GPIO_PORT GPIOB

Definition at line 146 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SCK_PIN GPIO_PIN_3

Definition at line 145 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_AF GPIO_AF5_I2S3ext

Definition at line 155 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 154 of file stm32469i_discovery_audio.h.

#define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 153 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_GPIO_PORT GPIOD

Definition at line 152 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

#define AUDIO_I2Sx_SD_PIN GPIO_PIN_6

Definition at line 151 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspDeInit(), and BSP_AUDIO_IN_MspInit().

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

Definition at line 169 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_MspInit().

#define AUDIO_OK ((uint8_t)0)

Definition at line 196 of file stm32469i_discovery_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(), BSP_AUDIO_OUT_Stop(), and SAIx_Init().

#define AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */

Definition at line 134 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_RESET_DISABLE ( ) __HAL_RCC_GPIOE_CLK_DISABLE()

Definition at line 117 of file stm32469i_discovery_audio.h.

#define AUDIO_RESET_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 116 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_RESET_GPIO_PORT GPIOE

Definition at line 119 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_RESET_PIN GPIO_PIN_2

Definition at line 118 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx SAI1_Block_A

Definition at line 98 of file stm32469i_discovery_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_SAI1_CLK_DISABLE()

Definition at line 100 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit().

#define AUDIO_SAIx_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 99 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 125 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_CLK_DISABLE ( ) __HAL_RCC_DMA2_CLK_DISABLE()

Definition at line 123 of file stm32469i_discovery_audio.h.

#define AUDIO_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 122 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_IRQ DMA2_Stream3_IRQn

Definition at line 126 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 131 of file stm32469i_discovery_audio.h.

#define AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 128 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 127 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_DMAx_STREAM DMA2_Stream3

Definition at line 124 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_FS_PIN GPIO_PIN_4

Definition at line 111 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCK_PIN GPIO_PIN_7

Definition at line 106 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 104 of file stm32469i_discovery_audio.h.

#define AUDIO_SAIx_MCLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 103 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_GPIO_PORT GPIOG

Definition at line 107 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_MCLK_SCK_SD_FS_AF GPIO_AF6_SAI1

Definition at line 101 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_PLL_DISABLE ( ) HAL_RCCEx_DisablePLLSAI1()

Definition at line 137 of file stm32469i_discovery_audio.h.

#define AUDIO_SAIx_SCK_PIN GPIO_PIN_5

Definition at line 112 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_SD_FS_DISABLE ( ) __HAL_RCC_GPIOE_CLK_DISABLE()

Definition at line 110 of file stm32469i_discovery_audio.h.

#define AUDIO_SAIx_SCK_SD_FS_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 109 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SCK_SD_FS_GPIO_PORT GPIOE

Definition at line 114 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_SAIx_SD_PIN GPIO_PIN_6

Definition at line 113 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_MspDeInit(), and BSP_AUDIO_OUT_MspInit().

#define AUDIO_TIMEOUT ((uint8_t)2)

Definition at line 198 of file stm32469i_discovery_audio.h.

#define AUDIO_TIMx TIM4

Definition at line 179 of file stm32469i_discovery_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_AF GPIO_AF2_TIM4

Definition at line 187 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_CLK_DISABLE ( ) __HAL_RCC_TIM4_CLK_DISABLE()

Definition at line 178 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Stop(), and TIMx_IC_MspDeInit().

#define AUDIO_TIMx_CLK_ENABLE ( ) __HAL_RCC_TIM4_CLK_ENABLE()

Definition at line 177 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 183 of file stm32469i_discovery_audio.h.

#define AUDIO_TIMx_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 182 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_GPIO_PORT GPIOD

Definition at line 184 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

#define AUDIO_TIMx_IN_CHANNEL TIM_CHANNEL_1

Definition at line 180 of file stm32469i_discovery_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_12

Definition at line 185 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

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

Definition at line 181 of file stm32469i_discovery_audio.h.

Referenced by TIMx_DeInit(), and TIMx_Init().

#define AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_13

Definition at line 186 of file stm32469i_discovery_audio.h.

Referenced by TIMx_IC_MspInit().

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

Definition at line 193 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().

#define CHANNEL_DEMUX_MASK ((uint8_t)0x55)

Definition at line 210 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define CODEC_RESET_DELAY ((uint8_t)5)

Definition at line 217 of file stm32469i_discovery_audio.h.

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16)

Definition at line 202 of file stm32469i_discovery_audio.h.

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

Definition at line 203 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define DEFAULT_AUDIO_IN_FREQ I2S_AUDIOFREQ_16K

Definition at line 201 of file stm32469i_discovery_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64)

Definition at line 204 of file stm32469i_discovery_audio.h.

#define DMA_MAX_SZE 0xFFFF

Definition at line 129 of file stm32469i_discovery_audio.h.

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

Definition at line 207 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_IN_PDMToPCM().

#define PCM_OUT_SIZE (DEFAULT_AUDIO_IN_FREQ/1000*DEFAULT_AUDIO_IN_CHANNEL_NBR)

Definition at line 209 of file stm32469i_discovery_audio.h.


./STM32469I-Discovery BSP User Manual: STM32469I-Discovery AUDIO Exported Variables

Variables
STM32469I-Discovery AUDIO Exported Variables
STM32469I Discovery AUDIO

Variables

__IO uint16_t AudioInVolume

Variable Documentation

__IO uint16_t AudioInVolume

Definition at line 180 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_SetVolume().


./STM32469I-Discovery BSP User Manual: STM32469I-Discovery AUDIO Exported Macros

Defines
STM32469I-Discovery AUDIO Exported Macros
STM32469I Discovery AUDIO

Defines

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

Define Documentation

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

Definition at line 238 of file stm32469i_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO OUT Exported Functions

Functions
STM32469I Discovery AUDIO OUT Exported Functions
STM32469I Discovery AUDIO

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
uint8_t | BSP_AUDIO_OUT_Pause (void)
This function Pauses the audio file stream.
uint8_t | BSP_AUDIO_OUT_Resume (void)
This function Resumes the audio file stream.
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option)
Stops audio playing and Power down the Audio Codec.
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
Controls the current audio volume level.
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 being 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 BSP_AUDIO_OUT 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 PCM samples buffer
Size,: number of data to be written

Definition at line 305 of file stm32469i_discovery_audio.c.

References haudio_out_sai.

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

Clock Config.

Parameters:
hsai,: might be required to set audio peripheral predivider if any.
AudioFreq,: Audio frequency used to play the audio stream.
Note:
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Parameters:
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 766 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetFrequency().

void BSP_AUDIO_OUT_DeInit ( void )

Deinit the audio peripherals.

Definition at line 575 of file stm32469i_discovery_audio.c.

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

void BSP_AUDIO_OUT_Error_CallBack ( void )

Manages the DMA FIFO error event.

Definition at line 633 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_ErrorCallback().

void BSP_AUDIO_OUT_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Definition at line 626 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_TxHalfCpltCallback().

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

Configures the audio peripherals.

Parameters:
OutputDevice,: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
Volume,: Initial volume level (from 0 (Mute) to 100 (Max))
AudioFreq,: Audio frequency used to play the audio stream.
Note:
The SAI PLL input clock must be done in the user application.
Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 218 of file stm32469i_discovery_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 BSP_AUDIO_OUT MSP.

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

Definition at line 720 of file stm32469i_discovery_audio.c.

References AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, AUDIO_SAIx, AUDIO_SAIx_CLK_DISABLE, AUDIO_SAIx_DMAx_IRQ, AUDIO_SAIx_FS_PIN, AUDIO_SAIx_MCK_PIN, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_FS_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 : pointer on additional configuration parameters, can be NULL.

Definition at line 642 of file stm32469i_discovery_audio.c.

References AUDIO_OUT_IRQ_PREPRIO, AUDIO_RESET_ENABLE, AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, 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_PIN, AUDIO_SAIx_MCK_PIN, AUDIO_SAIx_MCLK_ENABLE, AUDIO_SAIx_MCLK_GPIO_PORT, AUDIO_SAIx_MCLK_SCK_SD_FS_AF, AUDIO_SAIx_SCK_PIN, AUDIO_SAIx_SCK_SD_FS_ENABLE, AUDIO_SAIx_SCK_SD_FS_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.

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

Definition at line 318 of file stm32469i_discovery_audio.c.

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

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

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

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

Definition at line 278 of file stm32469i_discovery_audio.c.

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

uint8_t BSP_AUDIO_OUT_Resume ( void )

This function Resumes the audio file stream.

WARNING: When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).

Return values:
AUDIO_OK if correct communication, else wrong communication

Definition at line 349 of file stm32469i_discovery_audio.c.

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

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t AudioFrameSlot )

Updates the Audio frame slot configuration.

Parameters:
AudioFrameSlot,: specifies the audio Frame slot This parameter can be any value of STM32469I Discovery Audio Slot TDM mode
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frame slot.

Definition at line 559 of file stm32469i_discovery_audio.c.

References haudio_out_sai.

void BSP_AUDIO_OUT_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: Audio frequency used to play the audio stream.
Note:
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frequency.

Definition at line 476 of file stm32469i_discovery_audio.c.

References BSP_AUDIO_OUT_ClockConfig(), and haudio_out_sai.

uint8_t BSP_AUDIO_OUT_SetMute ( uint32_t Cmd )

Enables or disables the MUTE mode by software.

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

Definition at line 435 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetOutputMode ( uint8_t Output )

Switch dynamically (while audio file is being 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 456 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_SetVolume ( uint8_t Volume )

Controls the current audio volume level.

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

Definition at line 415 of file stm32469i_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.

uint8_t BSP_AUDIO_OUT_Stop ( uint32_t Option )

Stops audio playing and Power down the Audio Codec.

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

Definition at line 381 of file stm32469i_discovery_audio.c.

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

void BSP_AUDIO_OUT_TransferComplete_CallBack ( void )

Manages the DMA full Transfer complete event.

Definition at line 619 of file stm32469i_discovery_audio.c.

Referenced by HAL_SAI_TxCpltCallback().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO IN Exported Functions

Functions
STM32469I Discovery AUDIO IN Exported Functions
STM32469I Discovery AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes wave recording.
uint8_t | BSP_AUDIO_IN_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_ClockConfig (I2S_HandleTypeDef *hi2s, void *Params)
Clock Config.
void | BSP_AUDIO_IN_MspInit (I2S_HandleTypeDef *hi2s, void *Params)
BSP AUDIO IN MSP Init.
void | BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
DeInitializes BSP_AUDIO_IN MSP.

Function Documentation

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

Clock Config.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application

Definition at line 1097 of file stm32469i_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_DeInit ( void )

Deinit the audio IN peripherals.

Definition at line 1019 of file stm32469i_discovery_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.

Definition at line 1131 of file stm32469i_discovery_audio.c.

Referenced by HAL_I2S_ErrorCallback().

void BSP_AUDIO_IN_HalfTransfer_CallBack ( void )

Manages the DMA Half Transfer complete event.

Definition at line 1121 of file stm32469i_discovery_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 911 of file stm32469i_discovery_audio.c.

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

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

DeInitializes BSP_AUDIO_IN MSP.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 1221 of file stm32469i_discovery_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
 | ) |  |

BSP AUDIO IN MSP Init.

Parameters:
hi2s,: I2S handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 1142 of file stm32469i_discovery_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 979 of file stm32469i_discovery_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 1033 of file stm32469i_discovery_audio.c.

References AUDIO_OK, Channel_Demux, CHANNEL_DEMUX_MASK, DEFAULT_AUDIO_IN_CHANNEL_NBR, INTERNAL_BUFF_SIZE, and PDM_FilterHandler.

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 942 of file stm32469i_discovery_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 992 of file stm32469i_discovery_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 1007 of file stm32469i_discovery_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 959 of file stm32469i_discovery_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.

Definition at line 1111 of file stm32469i_discovery_audio.c.

Referenced by HAL_I2S_RxCpltCallback().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Types

STM32469I Discovery EEPROM Private Types
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Defines

STM32469I Discovery EEPROM Private Defines
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Macros

STM32469I Discovery EEPROM Private Macros
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Variables

Variables
STM32469I Discovery EEPROM Private Variables
STM32469I Discovery EEPROM

Variables

__IO uint16_t | EEPROMAddress = 0
__IO uint32_t | EEPROMTimeout = EEPROM_READ_TIMEOUT
__IO uint16_t | EEPROMDataRead
__IO uint8_t | EEPROMDataWrite

Variable Documentation

__IO uint16_t EEPROMAddress = 0

Definition at line 109 of file stm32469i_discovery_eeprom.c.

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

__IO uint16_t EEPROMDataRead

Definition at line 111 of file stm32469i_discovery_eeprom.c.

Referenced by BSP_EEPROM_ReadBuffer().

__IO uint8_t EEPROMDataWrite

Definition at line 112 of file stm32469i_discovery_eeprom.c.

Referenced by BSP_EEPROM_WritePage().

__IO uint32_t EEPROMTimeout = EEPROM_READ_TIMEOUT

Definition at line 110 of file stm32469i_discovery_eeprom.c.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Prototypes

STM32469I Discovery EEPROM Private Prototypes
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Private Functions

Functions
STM32469I Discovery EEPROM Private Functions
STM32469I Discovery EEPROM

Functions

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

Function Documentation

uint8_t BSP_EEPROM_DeInit ( void )

DeInitializes the EEPROM.

Return values:
EEPROM state

Definition at line 160 of file stm32469i_discovery_eeprom.c.

References EEPROM_OK.

uint32_t BSP_EEPROM_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

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

Definition at line 137 of file stm32469i_discovery_eeprom.c.

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

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

Reads a block of data from the EEPROM.

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

Definition at line 181 of file stm32469i_discovery_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.

Definition at line 435 of file stm32469i_discovery_eeprom.c.

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

uint32_t BSP_EEPROM_WaitEepromStandbyState ( void )

Wait for EEPROM Standby state.

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

Definition at line 420 of file stm32469i_discovery_eeprom.c.

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

Referenced by BSP_EEPROM_WritePage().

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

Writes buffer of data to the I2C EEPROM.

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

Definition at line 263 of file stm32469i_discovery_eeprom.c.

References BSP_EEPROM_WritePage(), EEPROM_OK, and EEPROM_PAGESIZE.

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

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

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

Definition at line 228 of file stm32469i_discovery_eeprom.c.

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

Referenced by BSP_EEPROM_WriteBuffer().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Exported Types

STM32469I Discovery EEPROM Exported Types
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Exported Constants

Defines
STM32469I Discovery EEPROM Exported Constants
STM32469I Discovery EEPROM

Defines

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

Define Documentation

#define EEPROM_FAIL 1

Definition at line 69 of file stm32469i_discovery_eeprom.h.

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

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

Definition at line 56 of file stm32469i_discovery_eeprom.h.

#define EEPROM_MAX_TRIALS 3000

Definition at line 66 of file stm32469i_discovery_eeprom.h.

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

#define EEPROM_OK 0

Definition at line 68 of file stm32469i_discovery_eeprom.h.

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

#define EEPROM_PAGESIZE ((uint8_t)4)

Definition at line 55 of file stm32469i_discovery_eeprom.h.

Referenced by BSP_EEPROM_WriteBuffer().

#define EEPROM_READ_TIMEOUT ((uint32_t)(1000))

Definition at line 61 of file stm32469i_discovery_eeprom.h.

#define EEPROM_TIMEOUT 2

Definition at line 70 of file stm32469i_discovery_eeprom.h.

Referenced by BSP_EEPROM_WaitEepromStandbyState().

#define EEPROM_WRITE_TIMEOUT ((uint32_t)(10))

Definition at line 63 of file stm32469i_discovery_eeprom.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Exported Macros

STM32469I Discovery EEPROM Exported Macros
STM32469I Discovery EEPROM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM Exported Functions

Functions
STM32469I Discovery EEPROM Exported Functions
STM32469I Discovery EEPROM

Functions

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

References EEPROM_OK.

uint32_t BSP_EEPROM_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

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

Definition at line 137 of file stm32469i_discovery_eeprom.c.

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

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

Reads a block of data from the EEPROM.

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

Definition at line 181 of file stm32469i_discovery_eeprom.c.

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

void BSP_EEPROM_TIMEOUT_UserCallback ( void )

Basic management of the timeout situation.

Definition at line 435 of file stm32469i_discovery_eeprom.c.

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

uint32_t BSP_EEPROM_WaitEepromStandbyState ( void )

Wait for EEPROM Standby state.

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

Definition at line 420 of file stm32469i_discovery_eeprom.c.

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

Referenced by BSP_EEPROM_WritePage().

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

Writes buffer of data to the I2C EEPROM.

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

Definition at line 263 of file stm32469i_discovery_eeprom.c.

References BSP_EEPROM_WritePage(), EEPROM_OK, and EEPROM_PAGESIZE.

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

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

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

Definition at line 228 of file stm32469i_discovery_eeprom.c.

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

Referenced by BSP_EEPROM_WriteBuffer().

void EEPROM_IO_Init ( void )

Initializes peripherals used by the I2C EEPROM driver.

Definition at line 795 of file stm32469i_discovery.c.

References I2C1_Init().

Referenced by BSP_EEPROM_Init().

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

Checks if target device is ready for communication.

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

Definition at line 833 of file stm32469i_discovery.c.

References I2C1_IsDeviceReady().

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

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

Read data from I2C EEPROM driver in using DMA channel.

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

Definition at line 821 of file stm32469i_discovery.c.

References I2C1_ReadMultiple().

Referenced by BSP_EEPROM_ReadBuffer().

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

Write data to I2C EEPROM driver in using DMA channel.

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

Definition at line 808 of file stm32469i_discovery.c.

References I2C1_WriteMultiple().

Referenced by BSP_EEPROM_WritePage().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Private TypesDefinitions

Variables
STM32469I Discovery LCD Private TypesDefinitions
STM32469I Discovery LCD

Variables

static DSI_VidCfgTypeDef hdsivideo_handle

Variable Documentation

DSI_VidCfgTypeDef hdsivideo_handle [static]

Definition at line 80 of file stm32469i_discovery_lcd.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Private Defines

STM32469I Discovery LCD Private Defines
STM32469I Discovery LCD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Private Macros

Defines
STM32469I Discovery LCD Private Macros
STM32469I Discovery LCD

Defines

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

Define Documentation

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

Definition at line 96 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_DrawLine(), and FillTriangle().

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

Definition at line 98 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().

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

Definition at line 99 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Exported Variables

STM32469I Discovery LCD Exported Variables
STM32469I Discovery LCD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Private Variables

Variables
STM32469I Discovery LCD Private Variables
STM32469I Discovery LCD

Variables

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

Variable Documentation

uint32_t ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND [static]

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

Definition at line 135 of file stm32469i_discovery_lcd.c.

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

LCD_DrawPropTypeDef DrawProp[LTDC_MAX_LAYER_NUMBER] [static]

Current Drawing Layer properties variable.

Definition at line 140 of file stm32469i_discovery_lcd.c.

DMA2D_HandleTypeDef hdma2d_eval

Definition at line 117 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_DMA2D_IRQHandler(), LL_ConvertLineToARGB8888(), and LL_FillBuffer().

DSI_HandleTypeDef hdsi_eval

Definition at line 119 of file stm32469i_discovery_lcd.c.

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

LTDC_HandleTypeDef hltdc_eval

Definition at line 118 of file stm32469i_discovery_lcd.c.

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

uint32_t lcd_x_size = OTM8009A_800X480_WIDTH

Definition at line 120 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_GetXSize(), and BSP_LCD_InitEx().

uint32_t lcd_y_size = OTM8009A_800X480_HEIGHT

Definition at line 121 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_GetYSize(), and BSP_LCD_InitEx().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Private FunctionPrototypes

STM32469I Discovery LCD Private FunctionPrototypes
STM32469I Discovery LCD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Exported Functions

Functions
STM32469I Discovery LCD Exported Functions
STM32469I Discovery LCD

Functions

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

Parameters:
Color,: Color of the background

Definition at line 698 of file stm32469i_discovery_lcd.c.

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

void BSP_LCD_ClearStringLine ( uint32_t Line )

Clears the selected line in currently active layer.

Parameters:
Line,: Line to be cleared

Definition at line 708 of file stm32469i_discovery_lcd.c.

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

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

Displays one character in currently active layer.

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

Definition at line 727 of file stm32469i_discovery_lcd.c.

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

Referenced by BSP_LCD_DisplayStringAt().

void BSP_LCD_DisplayOff ( void )

Switch Off the display.

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

Definition at line 1284 of file stm32469i_discovery_lcd.c.

References hdsi_eval, and hdsivideo_handle.

void BSP_LCD_DisplayOn ( void )

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

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

Definition at line 1269 of file stm32469i_discovery_lcd.c.

References hdsi_eval, and hdsivideo_handle.

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

Displays characters in currently active layer.

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

Definition at line 744 of file stm32469i_discovery_lcd.c.

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

Referenced by BSP_LCD_DisplayStringAtLine().

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

Displays a maximum of 60 characters on the LCD.

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

Definition at line 806 of file stm32469i_discovery_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

void BSP_LCD_DMA2D_IRQHandler ( void )

Handles DMA2D interrupt request.

Note:
: Can be surcharged by application code implementation of the function.

Definition at line 1321 of file stm32469i_discovery_lcd.c.

References hdma2d_eval.

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

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

Parameters:
Xpos,: Bmp X position in the LCD
Ypos,: Bmp Y position in the LCD
pbmp,: Pointer to Bmp picture address in the internal Flash

Definition at line 1048 of file stm32469i_discovery_lcd.c.

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

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

Draws a circle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Radius,: Circle radius

Definition at line 943 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and BSP_LCD_DrawPixel().

Referenced by BSP_LCD_FillCircle().

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

Draws an ellipse on LCD in currently active layer.

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

Definition at line 1016 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and BSP_LCD_DrawPixel().

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

Draws an horizontal line in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Length,: Line length

Definition at line 817 of file stm32469i_discovery_lcd.c.

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

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

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

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

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

Definition at line 852 of file stm32469i_discovery_lcd.c.

References ABS, ActiveLayer, and BSP_LCD_DrawPixel().

Referenced by BSP_LCD_DrawPolygon(), and FillTriangle().

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

Draws a pixel on LCD.

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

Definition at line 1428 of file stm32469i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hltdc_eval.

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

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

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

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

Definition at line 989 of file stm32469i_discovery_lcd.c.

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

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

Draws a rectangle in currently active layer.

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

Definition at line 926 of file stm32469i_discovery_lcd.c.

References BSP_LCD_DrawHLine(), and BSP_LCD_DrawVLine().

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

Draws a vertical line in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Length,: Line length

Definition at line 834 of file stm32469i_discovery_lcd.c.

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

Referenced by BSP_LCD_DrawRect().

void BSP_LCD_DSI_IRQHandler ( void )

Handles DSI interrupt request.

Note:
: Can be surcharged by application code implementation of the function.

Definition at line 1330 of file stm32469i_discovery_lcd.c.

References hdsi_eval.

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

Draws a full circle in currently active layer.

Parameters:
Xpos,: X position
Ypos,: Y position
Radius,: Circle radius

Definition at line 1125 of file stm32469i_discovery_lcd.c.

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

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

Draws a full ellipse in currently active layer.

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

Definition at line 1239 of file stm32469i_discovery_lcd.c.

References BSP_LCD_DrawHLine().

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

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

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

Definition at line 1172 of file stm32469i_discovery_lcd.c.

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

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

Draws a full rectangle in currently active layer.

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

Definition at line 1105 of file stm32469i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), BSP_LCD_SetTextColor(), hltdc_eval, 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 635 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::BackColor.

sFONT * BSP_LCD_GetFont ( void )

Gets the LCD text font.

Return values:
Used layer font

Definition at line 653 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

uint32_t BSP_LCD_GetTextColor ( void )

Gets the LCD text color.

Return values:
Used text color.

Definition at line 617 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::TextColor.

uint32_t BSP_LCD_GetXSize ( void )

Gets the LCD X size.

Return values:
Used LCD X size

Definition at line 441 of file stm32469i_discovery_lcd.c.

References lcd_x_size.

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

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Return values:
Used LCD Y size

Definition at line 450 of file stm32469i_discovery_lcd.c.

References lcd_y_size.

Referenced by BSP_LCD_Clear(), and BSP_LCD_LayerDefaultInit().

uint8_t BSP_LCD_Init ( void )

Initializes the DSI LCD.

Return values:
LCD state

Definition at line 164 of file stm32469i_discovery_lcd.c.

References BSP_LCD_InitEx(), and LCD_ORIENTATION_LANDSCAPE.

uint8_t BSP_LCD_InitEx ( LCD_OrientationTypeDef orientation )

Initializes the DSI LCD.

The ititialization is done as below:

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

< LcdClk = 27429 kHz

< Vertical start active time in units of lines

< Vertical Back Porch time in units of lines

< Vertical Front Porch time in units of lines

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

< Horizontal start active time in units of lcdClk

< Horizontal Back Porch time in units of lcdClk

< Horizontal Front Porch time in units of lcdClk

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

Definition at line 178 of file stm32469i_discovery_lcd.c.

References BSP_LCD_MspInit(), BSP_LCD_Reset(), BSP_LCD_SetFont(), BSP_SDRAM_Init(), hdsi_eval, hdsivideo_handle, hltdc_eval, LCD_DEFAULT_FONT, LCD_DSI_PIXEL_DATA_FMT_RBG888, LCD_OK, LCD_ORIENTATION_PORTRAIT, LCD_OTM8009A_ID, lcd_x_size, and lcd_y_size.

Referenced by BSP_LCD_Init().

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

Initializes the LCD layers.

Parameters:
LayerIndex,: Layer foreground or background
FB_Address,: Layer frame buffer

Definition at line 479 of file stm32469i_discovery_lcd.c.

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

void BSP_LCD_LTDC_ER_IRQHandler ( void )

This function handles LTDC Error interrupt Handler.

Note:
: Can be surcharged by application code implementation of the function.

Definition at line 1416 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_LTDC_IRQHandler ( void )

Handles LTDC interrupt request.

Note:
: Can be surcharged by application code implementation of the function.

Definition at line 1340 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_MspDeInit ( void )

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

Disable IRQ of LTDC IP

Disable IRQ of DMA2D IP

Disable IRQ of DSI IP

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

Disable the LTDC, DMA2D and DSI Host and Wrapper clocks

Definition at line 1349 of file stm32469i_discovery_lcd.c.

void BSP_LCD_MspInit ( void )

Initialize the BSP LCD Msp.

Application can surcharge if needed this function implementation

Enable the LTDC clock

Toggle Sw reset of LTDC IP

Enable the DMA2D clock

Toggle Sw reset of DMA2D IP

Enable DSI Host and wrapper clocks

Soft Reset the DSI Host and wrapper

NVIC configuration for LTDC interrupt that is now enabled

NVIC configuration for DMA2D interrupt that is now enabled

NVIC configuration for DSI interrupt that is now enabled

Definition at line 1375 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

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

Reads an LCD pixel.

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

Definition at line 664 of file stm32469i_discovery_lcd.c.

References ActiveLayer, BSP_LCD_GetXSize(), and hltdc_eval.

void BSP_LCD_Reset ( void )

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

This signal is only cabled on Discovery Rev B and beyond.

Definition at line 401 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

void BSP_LCD_ResetColorKeying ( uint32_t LayerIndex )

Disables the color keying.

Parameters:
LayerIndex,: Layer foreground or background

Definition at line 598 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_SelectLayer ( uint32_t LayerIndex )

Selects the LCD Layer.

Parameters:
LayerIndex,: Layer foreground or background

Definition at line 512 of file stm32469i_discovery_lcd.c.

References ActiveLayer.

void BSP_LCD_SetBackColor ( uint32_t Color )

Sets the LCD background color.

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

Definition at line 626 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::BackColor.

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

Configures and sets the color keying.

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

Definition at line 587 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

Parameters:
fonts,: Layer font to be used

Definition at line 644 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_InitEx().

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

Sets an LCD layer frame buffer address.

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

Definition at line 557 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

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

Sets an LCD Layer visible.

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

Definition at line 525 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

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

Sets display window.

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

Definition at line 572 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_SetTextColor ( uint32_t Color )

Sets the LCD text color.

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

Definition at line 608 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and LCD_DrawPropTypeDef::TextColor.

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

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

Configures the transparency.

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

Definition at line 545 of file stm32469i_discovery_lcd.c.

References hltdc_eval.

void BSP_LCD_SetXSize ( uint32_t imageWidthPixels )

Set the LCD X size.

Parameters:
imageWidthPixels : uint32_t image width in pixels unit

Definition at line 459 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and hltdc_eval.

void BSP_LCD_SetYSize ( uint32_t imageHeightPixels )

Set the LCD Y size.

Parameters:
imageHeightPixels : uint32_t image height in lines unit

Definition at line 468 of file stm32469i_discovery_lcd.c.

References ActiveLayer, and hltdc_eval.

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

Definition at line 1441 of file stm32469i_discovery_lcd.c.

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

Referenced by BSP_LCD_DisplayChar().

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

DCS or Generic short/long write command.

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

Definition at line 1302 of file stm32469i_discovery_lcd.c.

References hdsi_eval, and LCD_OTM8009A_ID.

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

Definition at line 1499 of file stm32469i_discovery_lcd.c.

References ABS, and BSP_LCD_DrawLine().

Referenced by BSP_LCD_FillPolygon().

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

Converts a line to an ARGB8888 pixel format.

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

Definition at line 1606 of file stm32469i_discovery_lcd.c.

References hdma2d_eval.

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

Definition at line 1576 of file stm32469i_discovery_lcd.c.

References hdma2d_eval.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Exported Constants

Defines
STM32469I Discovery LCD Exported Constants
STM32469I Discovery LCD

Defines

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

Define Documentation

#define LCD_COLOR_BLACK ((uint32_t) 0xFF000000)

Black value in ARGB8888 format.

Definition at line 192 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF)

LCD color definitions values in ARGB8888 format.

Blue value in ARGB8888 format

Definition at line 104 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A)

Brown value in ARGB8888 format.

Definition at line 196 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF)

Cyan value in ARGB8888 format.

Definition at line 116 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080)

Dark Blue value in ARGB8888 format.

Definition at line 152 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080)

Dark Cyan value in ARGB8888 format.

Definition at line 164 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040)

Dark Gray value in ARGB8888 format.

Definition at line 188 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000)

Light Dark Green value in ARGB8888 format.

Definition at line 156 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080)

Dark Magenta value in ARGB8888 format.

Definition at line 168 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKRED ((uint32_t) 0xFF800000)

Light Dark Red value in ARGB8888 format.

Definition at line 160 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000)

Dark Yellow value in ARGB8888 format.

Definition at line 172 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_GRAY ((uint32_t) 0xFF808080)

Gray value in ARGB8888 format.

Definition at line 184 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00)

Green value in ARGB8888 format.

Definition at line 108 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF)

Light Blue value in ARGB8888 format.

Definition at line 128 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF)

Light Cyan value in ARGB8888 format.

Definition at line 140 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3)

Light Gray value in ARGB8888 format.

Definition at line 180 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80)

Light Green value in ARGB8888 format.

Definition at line 132 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF)

Light Magenta value in ARGB8888 format.

Definition at line 144 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080)

Light Red value in ARGB8888 format.

Definition at line 136 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80)

Light Yellow value in ARGB8888 format.

Definition at line 148 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF)

Magenta value in ARGB8888 format.

Definition at line 120 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500)

Orange value in ARGB8888 format.

Definition at line 200 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_RED ((uint32_t) 0xFFFF0000)

Red value in ARGB8888 format.

Definition at line 112 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000)

Transparent value in ARGB8888 format.

Definition at line 204 of file stm32469i_discovery_lcd.h.

#define LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF)

White value in ARGB8888 format.

Definition at line 176 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00)

Yellow value in ARGB8888 format.

Definition at line 124 of file stm32469i_discovery_lcd.h.

#define LCD_DEFAULT_FONT Font24

LCD default font.

Definition at line 209 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_DSI_PIXEL_DATA_FMT_RBG565 DSI_RGB565

DSI packet pixel format chosen is RGB565 : 16 bpp

Definition at line 217 of file stm32469i_discovery_lcd.h.

#define LCD_DSI_PIXEL_DATA_FMT_RBG888 DSI_RGB888

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

DSI packet pixel format chosen is RGB888 : 24 bpp

Definition at line 216 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_ERROR 0x01

Definition at line 89 of file stm32469i_discovery_lcd.h.

#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)

LCD FB_StartAddress.

Definition at line 63 of file stm32469i_discovery_lcd.h.

#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef

Definition at line 59 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_LayerDefaultInit().

#define LCD_OK 0x00

LCD status structure definition.

Definition at line 88 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_OTM8009A_ID ((uint32_t) 0)

LCD Display OTM8009A ID.

Definition at line 95 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and DSI_IO_WriteCmd().

#define LCD_TIMEOUT 0x02

Definition at line 90 of file stm32469i_discovery_lcd.h.

#define LTDC_ACTIVE_LAYER_BACKGROUND ((uint32_t) 0)

LTDC Background layer index.

Definition at line 71 of file stm32469i_discovery_lcd.h.

#define LTDC_ACTIVE_LAYER_FOREGROUND ((uint32_t) 1)

LTDC Foreground layer index.

Definition at line 75 of file stm32469i_discovery_lcd.h.

#define LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_FOREGROUND

LTDC Default used layer index.

Definition at line 83 of file stm32469i_discovery_lcd.h.

#define LTDC_MAX_LAYER_NUMBER ((uint32_t) 2)

Maximum number of LTDC layers.

Definition at line 67 of file stm32469i_discovery_lcd.h.

#define LTDC_NB_OF_LAYERS ((uint32_t) 2)

Number of LTDC layers.

Definition at line 79 of file stm32469i_discovery_lcd.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Exported Types

Data Structures | Typedefs | Enumerations
STM32469I Discovery LCD Exported Types
STM32469I Discovery LCD

Data Structures

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

Typedefs

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

Enumerations

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

Typedef Documentation

typedef Point* pPoint

Pointer on LCD Drawing point (pixel) geometric definition.

Definition at line 251 of file stm32469i_discovery_lcd.h.

Enumeration Type Documentation

enum LCD_OrientationTypeDef

LCD_OrientationTypeDef Possible values of Display Orientation.

Enumerator:
LCD_ORIENTATION_PORTRAIT

Portrait orientation choice of LCD screen

LCD_ORIENTATION_LANDSCAPE

Landscape orientation choice of LCD screen

LCD_ORIENTATION_INVALID

Invalid orientation choice of LCD screen

Definition at line 269 of file stm32469i_discovery_lcd.h.

enum Text_AlignModeTypdef

LCD drawing Line alignment mode definitions.

Enumerator:
CENTER_MODE

Center mode

RIGHT_MODE

Right mode

LEFT_MODE

Left mode

Definition at line 256 of file stm32469i_discovery_lcd.h.


./STM32469I-Discovery BSP User Manual: LCD_DrawPropTypeDef Struct Reference

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

LCD Drawing main properties. More...

#include <stm32469i_discovery_lcd.h>

Data Fields

uint32_t | TextColor
uint32_t | BackColor
sFONT * | pFont

Detailed Description

LCD Drawing main properties.

Definition at line 230 of file stm32469i_discovery_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Specifies the background color below the text

Definition at line 233 of file stm32469i_discovery_lcd.h.

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

sFONT* LCD_DrawPropTypeDef::pFont

Specifies the font used for the text

Definition at line 234 of file stm32469i_discovery_lcd.h.

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

uint32_t LCD_DrawPropTypeDef::TextColor

Specifies the color of text

Definition at line 232 of file stm32469i_discovery_lcd.h.

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

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


./STM32469I-Discovery BSP User Manual: Point Struct Reference

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

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

#include <stm32469i_discovery_lcd.h>

Data Fields

int16_t | X
int16_t | Y

Detailed Description

LCD Drawing point (pixel) geometric definition.

Definition at line 241 of file stm32469i_discovery_lcd.h.

Field Documentation

int16_t Point::X

geometric X position of drawing

Definition at line 243 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

geometric Y position of drawing

Definition at line 244 of file stm32469i_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD Exported Macro

STM32469I Discovery LCD Exported Macro
STM32469I Discovery LCD


./STM32469I-Discovery BSP User Manual: STM32469I EVAL LCD Exported Variables

Variables
STM32469I EVAL LCD Exported Variables
STM32469I Discovery LCD

Variables

DMA2D_HandleTypeDef hdma2d_eval

Variable Documentation

DMA2D_HandleTypeDef hdma2d_eval

Definition at line 117 of file stm32469i_discovery_lcd.c.

Referenced by BSP_LCD_DMA2D_IRQHandler(), LL_ConvertLineToARGB8888(), and LL_FillBuffer().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI Private Variables

Variables
STM32469I Discovery QSPI Private Variables
STM32469I Discovery QSPI

Variables

QSPI_HandleTypeDef QSPIHandle

Variable Documentation

QSPI_HandleTypeDef QSPIHandle

Definition at line 72 of file stm32469i_discovery_qspi.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI Private Functions

Functions
STM32469I Discovery QSPI Private Functions
STM32469I Discovery QSPI

Functions

static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
This function configure the dummy cycles on memory side.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
__weak void | BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP Initialization This function configures the hardware resources used in this example:
__weak void | BSP_QSPI_MspDeInit (QSPI_HandleTypeDef *hqspi, void *Params)
QSPI MSP De-Initialization This function frees the hardware resources used in this example:

Function Documentation

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

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

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

Definition at line 540 of file stm32469i_discovery_qspi.c.

References QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_PIN, QSPI_D1_PIN, QSPI_D2_PIN, QSPI_D3_PIN, QSPI_DX_GPIO_PORT, 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

Definition at line 488 of file stm32469i_discovery_qspi.c.

References QSPI_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_CLK_ENABLE, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_PIN, QSPI_D1_PIN, QSPI_D2_PIN, QSPI_D3_PIN, QSPI_DX_CLK_GPIO_CLK_ENABLE, QSPI_DX_GPIO_PORT, 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,: timeout value before returning an error

Definition at line 711 of file stm32469i_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

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

static uint8_t QSPI_DummyCyclesCfg ( QSPI_HandleTypeDef * hqspi ) [static]

This function configure the dummy cycles on memory side.

Parameters:
hqspi,: QSPI handle

Definition at line 608 of file stm32469i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_ResetMemory ( QSPI_HandleTypeDef * hqspi ) [static]

This function reset the QSPI memory.

Parameters:
hqspi,: QSPI handle

Definition at line 567 of file stm32469i_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_WriteEnable ( QSPI_HandleTypeDef * hqspi ) [static]

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

Parameters:
hqspi,: QSPI handle

Definition at line 666 of file stm32469i_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI Exported Functions

Defines | Functions
STM32469I Discovery QSPI Exported Functions
STM32469I Discovery QSPI

Defines

#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_InfoTypeDef *pInfo)
Reads the configuration of the memory and fills QspiInfo struct.
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:

Define Documentation

#define BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode

Definition at line 119 of file stm32469i_discovery_qspi.h.

Function Documentation

uint8_t BSP_QSPI_DeInit ( void )

De-Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 151 of file stm32469i_discovery_qspi.c.

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

uint8_t BSP_QSPI_EnableMemoryMappedMode ( void )

Configure the QSPI in memory-mapped mode.

Return values:
QSPI memory status

Definition at line 445 of file stm32469i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_Erase_Block ( uint32_t BlockAddress )

Erases the specified block of the QSPI memory.

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

Definition at line 294 of file stm32469i_discovery_qspi.c.

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

uint8_t BSP_QSPI_Erase_Chip ( void )

Erases the entire QSPI memory.

Return values:
QSPI memory status

Definition at line 336 of file stm32469i_discovery_qspi.c.

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

uint8_t BSP_QSPI_GetInfo ( QSPI_InfoTypeDef * pInfo )

Reads the configuration of the memory and fills QspiInfo struct.

Parameters:
pInfo pointer to Info structure
Return values:
QSPI memory status

Definition at line 429 of file stm32469i_discovery_qspi.c.

References QSPI_InfoTypeDef::EraseSectorSize, QSPI_InfoTypeDef::EraseSectorsNumber, QSPI_InfoTypeDef::FlashSize, QSPI_InfoTypeDef::ProgPageSize, QSPI_InfoTypeDef::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 376 of file stm32469i_discovery_qspi.c.

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

uint8_t BSP_QSPI_Init ( void )

Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 103 of file stm32469i_discovery_qspi.c.

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

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

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

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

Definition at line 540 of file stm32469i_discovery_qspi.c.

References QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_PIN, QSPI_D1_PIN, QSPI_D2_PIN, QSPI_D3_PIN, QSPI_DX_GPIO_PORT, 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

Definition at line 488 of file stm32469i_discovery_qspi.c.

References QSPI_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_CLK_ENABLE, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_PIN, QSPI_D1_PIN, QSPI_D2_PIN, QSPI_D3_PIN, QSPI_DX_CLK_GPIO_CLK_ENABLE, QSPI_DX_GPIO_PORT, 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 174 of file stm32469i_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

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

Writes an amount of data to the QSPI memory.

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

Definition at line 220 of file stm32469i_discovery_qspi.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI Exported Constants

Defines
STM32469I Discovery QSPI Exported Constants
STM32469I Discovery QSPI

Defines

#define | QSPI_OK ((uint8_t)0x00)
#define | QSPI_ERROR ((uint8_t)0x01)
#define | QSPI_BUSY ((uint8_t)0x02)
#define | QSPI_NOT_SUPPORTED ((uint8_t)0x04)
#define | QSPI_SUSPENDED ((uint8_t)0x08)
#define | QSPI_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
#define | QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
#define | QSPI_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | QSPI_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | QSPI_DX_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_DX_CLK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#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_10
#define | QSPI_CLK_GPIO_PORT GPIOF
#define | QSPI_D0_PIN GPIO_PIN_8
#define | QSPI_D1_PIN GPIO_PIN_9
#define | QSPI_D2_PIN GPIO_PIN_7
#define | QSPI_D3_PIN GPIO_PIN_6
#define | QSPI_DX_GPIO_PORT GPIOF

Define Documentation

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 53 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().

#define QSPI_CLK_DISABLE ( ) __HAL_RCC_QSPI_CLK_DISABLE()

Definition at line 60 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit().

#define QSPI_CLK_ENABLE ( ) __HAL_RCC_QSPI_CLK_ENABLE()

Definition at line 59 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CLK_GPIO_PORT GPIOF

Definition at line 73 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CLK_PIN GPIO_PIN_10

Definition at line 72 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 62 of file stm32469i_discovery_qspi.h.

#define QSPI_CS_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 61 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_CS_GPIO_PORT GPIOB

Definition at line 71 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_CS_PIN GPIO_PIN_6

Definition at line 70 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D0_PIN GPIO_PIN_8

Definition at line 74 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D1_PIN GPIO_PIN_9

Definition at line 75 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D2_PIN GPIO_PIN_7

Definition at line 76 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_D3_PIN GPIO_PIN_6

Definition at line 77 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_DX_CLK_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 64 of file stm32469i_discovery_qspi.h.

#define QSPI_DX_CLK_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 63 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspInit().

#define QSPI_DX_GPIO_PORT GPIOF

Definition at line 78 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_ERROR ((uint8_t)0x01)

Definition at line 52 of file stm32469i_discovery_qspi.h.

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

#define QSPI_FORCE_RESET ( ) __HAL_RCC_QSPI_FORCE_RESET()

Definition at line 66 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)

Definition at line 54 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

Definition at line 51 of file stm32469i_discovery_qspi.h.

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

#define QSPI_RELEASE_RESET ( ) __HAL_RCC_QSPI_RELEASE_RESET()

Definition at line 67 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_MspDeInit(), and BSP_QSPI_MspInit().

#define QSPI_SUSPENDED ((uint8_t)0x08)

Definition at line 55 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus().


./STM32469I-Discovery BSP User Manual: QSPI_InfoTypeDef Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
QSPI_InfoTypeDef Struct Reference
STM32469I Discovery QSPI Exported Types

QSPI Info. More...

#include <stm32469i_discovery_qspi.h>

Data Fields

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

Detailed Description

QSPI Info.

Definition at line 92 of file stm32469i_discovery_qspi.h.

Field Documentation

uint32_t QSPI_InfoTypeDef::EraseSectorSize

Size of sectors for the erase operation

Definition at line 94 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_InfoTypeDef::EraseSectorsNumber

Number of sectors for the erase operation

Definition at line 95 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_InfoTypeDef::FlashSize

Size of the flash

Definition at line 93 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_InfoTypeDef::ProgPageSize

Size of pages for the program operation

Definition at line 96 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_InfoTypeDef::ProgPagesNumber

Number of pages for the program operation

Definition at line 97 of file stm32469i_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private TypesDef

STM32469I Discovery SD Private TypesDef
STM32469I Discovery SD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private Defines

STM32469I Discovery SD Private Defines
STM32469I Discovery SD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private Macro

STM32469I Discovery SD Private Macro
STM32469I Discovery SD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private Variables

Variables
STM32469I Discovery SD Private Variables
STM32469I Discovery SD

Variables

SD_HandleTypeDef uSdHandle

Variable Documentation

SD_HandleTypeDef uSdHandle

Definition at line 101 of file stm32469i_discovery_sd.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private Prototypes

STM32469I Discovery SD Private Prototypes
STM32469I Discovery SD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Private Functions

Functions
STM32469I Discovery SD Private Functions
STM32469I Discovery SD

Functions

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

Function Documentation

__weak void BSP_SD_AbortCallback ( void )

BSP SD Abort callbacks.

Return values:
None

Definition at line 541 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

uint8_t BSP_SD_DeInit ( void )

DeInitializes the SD card device.

Return values:
SD status

Definition at line 174 of file stm32469i_discovery_sd.c.

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

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

Initializes the SD Detect pin MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 434 of file stm32469i_discovery_sd.c.

References SD_DETECT_GPIO_CLK_ENABLE, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

Referenced by BSP_SD_Init().

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

Erases the specified memory area of the given SD card.

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

Definition at line 318 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( HAL_SD_CardInfoTypeDef * CardInfo )

Get SD information about specific SD card.

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

Definition at line 501 of file stm32469i_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_GetCardState ( void )

Gets the current SD card data status.

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

Definition at line 490 of file stm32469i_discovery_sd.c.

References SD_TRANSFER_BUSY, SD_TRANSFER_OK, and uSdHandle.

uint8_t BSP_SD_Init ( void )

Initializes the SD card device.

Return values:
SD status

Definition at line 122 of file stm32469i_discovery_sd.c.

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

uint8_t BSP_SD_IsDetected ( void )

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

Return values:
Returns if SD is detected or not

Definition at line 219 of file stm32469i_discovery_sd.c.

References SD_DETECT_GPIO_PORT, SD_DETECT_PIN, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_Init().

uint8_t BSP_SD_ITConfig ( void )

Configures Interrupt mode for SD detection pin.

Return values:
Returns 0

Definition at line 197 of file stm32469i_discovery_sd.c.

References MSD_OK, SD_DETECT_EXTI_IRQn, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

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

DeInitializes the SD MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 453 of file stm32469i_discovery_sd.c.

References SD_DMAx_Rx_IRQn, SD_DMAx_Rx_STREAM, SD_DMAx_Tx_IRQn, and SD_DMAx_Tx_STREAM.

Referenced by BSP_SD_DeInit().

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

Initializes the SD MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 335 of file stm32469i_discovery_sd.c.

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

Referenced by BSP_SD_Init().

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

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

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

Definition at line 240 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

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

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

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

Definition at line 279 of file stm32469i_discovery_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 559 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_RxCpltCallback().

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

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

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

Definition at line 260 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

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

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

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

Definition at line 299 of file stm32469i_discovery_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 550 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_TxCpltCallback().

void HAL_SD_AbortCallback ( SD_HandleTypeDef * hsd )

SD Abort callbacks.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 512 of file stm32469i_discovery_sd.c.

References BSP_SD_AbortCallback().

void HAL_SD_RxCpltCallback ( SD_HandleTypeDef * hsd )

Rx Transfer completed callbacks.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 532 of file stm32469i_discovery_sd.c.

References BSP_SD_ReadCpltCallback().

void HAL_SD_TxCpltCallback ( SD_HandleTypeDef * hsd )

Tx Transfer completed callbacks.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 522 of file stm32469i_discovery_sd.c.

References BSP_SD_WriteCpltCallback().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Exported Types

Defines
STM32469I Discovery SD Exported Types
STM32469I Discovery SD

Defines

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.

Define Documentation

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef

SD Card information structure.

Definition at line 50 of file stm32469i_discovery_sd.h.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Exported Constants

Defines
STM32469I Discovery SD Exported Constants
STM32469I Discovery SD

Defines

#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SD_DATATIMEOUT ((uint32_t)100000000)
#define | __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Tx_STREAM DMA2_Stream6
#define | SD_DMAx_Rx_STREAM DMA2_Stream3
#define | SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | BSP_SD_IRQHandler SDIO_IRQHandler
#define | BSP_SD_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | BSP_SD_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 77 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define BSP_SD_DMA_Rx_IRQHandler DMA2_Stream3_IRQHandler

Definition at line 86 of file stm32469i_discovery_sd.h.

#define BSP_SD_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler

Definition at line 85 of file stm32469i_discovery_sd.h.

#define BSP_SD_IRQHandler SDIO_IRQHandler

Definition at line 84 of file stm32469i_discovery_sd.h.

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 74 of file stm32469i_discovery_sd.h.

#define SD_DetectIRQHandler ( ) HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)

Definition at line 87 of file stm32469i_discovery_sd.h.

#define SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4

Definition at line 79 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn

Definition at line 83 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Rx_STREAM DMA2_Stream3

Definition at line 81 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4

Definition at line 78 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn

Definition at line 82 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_DMAx_Tx_STREAM DMA2_Stream6

Definition at line 80 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().

#define SD_NOT_PRESENT ((uint8_t)0x00)

Definition at line 72 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 71 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_Init(), and BSP_SD_IsDetected().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Exported Macro

STM32469I Discovery SD Exported Macro
STM32469I Discovery SD


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD Exported Functions

Functions
STM32469I Discovery SD Exported Functions
STM32469I Discovery SD

Functions

uint8_t | BSP_SD_Init (void)
Initializes the SD card device.
uint8_t | BSP_SD_DeInit (void)
DeInitializes the SD card device.
uint8_t | BSP_SD_ITConfig (void)
Configures Interrupt mode for SD detection pin.
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
void | BSP_SD_Detect_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin 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 541 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

uint8_t BSP_SD_DeInit ( void )

DeInitializes the SD card device.

Return values:
SD status

Definition at line 174 of file stm32469i_discovery_sd.c.

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

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

Initializes the SD Detect pin MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 434 of file stm32469i_discovery_sd.c.

References SD_DETECT_GPIO_CLK_ENABLE, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

Referenced by BSP_SD_Init().

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

Erases the specified memory area of the given SD card.

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

Definition at line 318 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( HAL_SD_CardInfoTypeDef * CardInfo )

Get SD information about specific SD card.

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

Definition at line 501 of file stm32469i_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_GetCardState ( void )

Gets the current SD card data status.

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

Definition at line 490 of file stm32469i_discovery_sd.c.

References SD_TRANSFER_BUSY, SD_TRANSFER_OK, and uSdHandle.

uint8_t BSP_SD_Init ( void )

Initializes the SD card device.

Return values:
SD status

Definition at line 122 of file stm32469i_discovery_sd.c.

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

uint8_t BSP_SD_IsDetected ( void )

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

Return values:
Returns if SD is detected or not

Definition at line 219 of file stm32469i_discovery_sd.c.

References SD_DETECT_GPIO_PORT, SD_DETECT_PIN, SD_NOT_PRESENT, and SD_PRESENT.

Referenced by BSP_SD_Init().

uint8_t BSP_SD_ITConfig ( void )

Configures Interrupt mode for SD detection pin.

Return values:
Returns 0

Definition at line 197 of file stm32469i_discovery_sd.c.

References MSD_OK, SD_DETECT_EXTI_IRQn, SD_DETECT_GPIO_PORT, and SD_DETECT_PIN.

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

DeInitializes the SD MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 453 of file stm32469i_discovery_sd.c.

References SD_DMAx_Rx_IRQn, SD_DMAx_Rx_STREAM, SD_DMAx_Tx_IRQn, and SD_DMAx_Tx_STREAM.

Referenced by BSP_SD_DeInit().

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

Initializes the SD MSP.

Parameters:
hsd,: SD handle
Params : pointer on additional configuration parameters, can be NULL.

Definition at line 335 of file stm32469i_discovery_sd.c.

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

Referenced by BSP_SD_Init().

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

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

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

Definition at line 240 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

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

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

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

Definition at line 279 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_ReadCpltCallback ( void )

BSP Rx Transfer completed callbacks.

Return values:
None

Definition at line 559 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_RxCpltCallback().

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

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

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

Definition at line 260 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

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

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

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

Definition at line 299 of file stm32469i_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_WriteCpltCallback ( void )

BSP Tx Transfer completed callbacks.

Return values:
None

Definition at line 550 of file stm32469i_discovery_sd.c.

Referenced by HAL_SD_TxCpltCallback().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SD

Modules | Defines
STM32469I Discovery SD
STM32469I Discovery

Modules

STM32469I Discovery SD Private TypesDef
STM32469I Discovery SD Private Defines
STM32469I Discovery SD Private Macro
STM32469I Discovery SD Private Variables
STM32469I Discovery SD Private Prototypes
STM32469I Discovery SD Private Functions
STM32469I Discovery SD Exported Types
STM32469I Discovery SD Exported Constants
STM32469I Discovery SD Exported Macro
STM32469I Discovery 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 59 of file stm32469i_discovery_sd.h.

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

#define MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)

Definition at line 60 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

Definition at line 58 of file stm32469i_discovery_sd.h.

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

#define SD_TRANSFER_BUSY ((uint8_t)0x01)

Definition at line 66 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK ((uint8_t)0x00)

SD transfer state definition.

Definition at line 65 of file stm32469i_discovery_sd.h.

Referenced by BSP_SD_GetCardState().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private TypesDef

STM32469I Discovery SDRAM Private TypesDef
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private Defines

STM32469I Discovery SDRAM Private Defines
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private Macros

STM32469I Discovery SDRAM Private Macros
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private Variables

Variables
STM32469I Discovery SDRAM Private Variables
STM32469I Discovery SDRAM

Variables

static SDRAM_HandleTypeDef | sdramHandle
static FMC_SDRAM_TimingTypeDef | Timing
static FMC_SDRAM_CommandTypeDef | Command

Variable Documentation

FMC_SDRAM_CommandTypeDef Command [static]

Definition at line 102 of file stm32469i_discovery_sdram.c.

Referenced by BSP_SDRAM_Initialization_sequence().

SDRAM_HandleTypeDef sdramHandle [static]

Definition at line 100 of file stm32469i_discovery_sdram.c.

Referenced by BSP_SDRAM_DeInit(), BSP_SDRAM_DMA_IRQHandler(), 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 101 of file stm32469i_discovery_sdram.c.

Referenced by BSP_SDRAM_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private Prototypes

STM32469I Discovery SDRAM Private Prototypes
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Private Functions

STM32469I Discovery SDRAM Private Functions
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Exported Functions

Functions
STM32469I Discovery SDRAM Exported Functions
STM32469I Discovery SDRAM

Functions

uint8_t | BSP_SDRAM_Init (void)
Initializes the SDRAM device.
uint8_t | BSP_SDRAM_DeInit (void)
DeInitializes the SDRAM device.
void | BSP_SDRAM_Initialization_sequence (uint32_t RefreshCount)
Programs the SDRAM device.
uint8_t | BSP_SDRAM_ReadData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an mount 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 mount 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 mount 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 mount 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_DMA_IRQHandler (void)
Handles SDRAM DMA transfer interrupt request.
__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 : SDRAM_OK or SDRAM_ERROR.

Definition at line 180 of file stm32469i_discovery_sdram.c.

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

void BSP_SDRAM_DMA_IRQHandler ( void )

Handles SDRAM DMA transfer interrupt request.

Definition at line 354 of file stm32469i_discovery_sdram.c.

References sdramHandle.

uint8_t BSP_SDRAM_Init ( void )

Initializes the SDRAM device.

Return values:
SDRAM status

Definition at line 131 of file stm32469i_discovery_sdram.c.

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

Referenced by BSP_LCD_InitEx().

void BSP_SDRAM_Initialization_sequence ( uint32_t RefreshCount )

Programs the SDRAM device.

Parameters:
RefreshCount,: SDRAM refresh counter value

Definition at line 203 of file stm32469i_discovery_sdram.c.

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

Referenced by BSP_SDRAM_Init().

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

DeInitializes SDRAM MSP.

Note:
This function can be surcharged by application code.
Parameters:
hsdram,: pointer on SDRAM handle
Params,: pointer on additional configuration parameters, can be NULL.

Definition at line 472 of file stm32469i_discovery_sdram.c.

References SDRAM_DMAx_IRQn, and SDRAM_DMAx_STREAM.

Referenced by BSP_SDRAM_DeInit().

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

Initializes SDRAM MSP.

Note:
This function can be surcharged by application code.
Parameters:
hsdram,: pointer on SDRAM handle
Params,: pointer on additional configuration parameters, can be NULL.

Definition at line 365 of file stm32469i_discovery_sdram.c.

References __DMAx_CLK_ENABLE, SDRAM_DMAx_CHANNEL, SDRAM_DMAx_IRQn, and SDRAM_DMAx_STREAM.

Referenced by BSP_SDRAM_Init().

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

Reads an mount 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 : SDRAM_OK or SDRAM_ERROR.

Definition at line 265 of file stm32469i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

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

Reads an mount 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 : SDRAM_OK or SDRAM_ERROR.

Definition at line 284 of file stm32469i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

uint8_t BSP_SDRAM_Sendcmd ( FMC_SDRAM_CommandTypeDef * SdramCmd )

Sends command to the SDRAM bank.

Parameters:
SdramCmd,: Pointer to SDRAM command structure
Return values:
HAL status : SDRAM_OK or SDRAM_ERROR.

Definition at line 339 of file stm32469i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, SDRAM_TIMEOUT, and sdramHandle.

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

Writes an mount 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 : SDRAM_OK or SDRAM_ERROR.

Definition at line 303 of file stm32469i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.

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

Writes an mount 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 : SDRAM_OK or SDRAM_ERROR.

Definition at line 322 of file stm32469i_discovery_sdram.c.

References SDRAM_ERROR, SDRAM_OK, and sdramHandle.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Exported Types

Defines
STM32469I Discovery SDRAM Exported Types
STM32469I Discovery SDRAM

Defines

#define | SDRAM_OK ((uint8_t)0x00)
SDRAM status structure definition.
#define | SDRAM_ERROR ((uint8_t)0x01)

Define Documentation

#define SDRAM_ERROR ((uint8_t)0x01)

Definition at line 51 of file stm32469i_discovery_sdram.h.

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

#define SDRAM_OK ((uint8_t)0x00)

SDRAM status structure definition.

Definition at line 50 of file stm32469i_discovery_sdram.h.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Exported Constants

Defines
STM32469I Discovery SDRAM Exported Constants
STM32469I Discovery SDRAM

Defines

#define | SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)
#define | SDRAM_DEVICE_SIZE ((uint32_t)0x1000000)
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0569)
#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 | SDRAM_DMAx_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)

Define Documentation

#define __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE

Definition at line 74 of file stm32469i_discovery_sdram.h.

#define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 73 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define REFRESH_COUNT ((uint32_t)0x0569)

Definition at line 69 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2

Definition at line 66 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)

Definition at line 60 of file stm32469i_discovery_sdram.h.

#define SDRAM_DEVICE_SIZE ((uint32_t)0x1000000)

Definition at line 63 of file stm32469i_discovery_sdram.h.

#define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0

Definition at line 75 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspInit().

#define SDRAM_DMAx_IRQHandler DMA2_Stream0_IRQHandler

Definition at line 78 of file stm32469i_discovery_sdram.h.

#define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn

Definition at line 77 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_DMAx_STREAM DMA2_Stream0

Definition at line 76 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_MspDeInit(), and BSP_SDRAM_MspInit().

#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32

Definition at line 65 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Init().

#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)

FMC SDRAM Mode definition register defines.

Definition at line 84 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)

Definition at line 85 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)

Definition at line 86 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)

Definition at line 87 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)

Definition at line 89 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)

Definition at line 88 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)

Definition at line 90 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)

Definition at line 91 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)

Definition at line 92 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)

Definition at line 93 of file stm32469i_discovery_sdram.h.

#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)

Definition at line 94 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence().

#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)

Definition at line 70 of file stm32469i_discovery_sdram.h.

Referenced by BSP_SDRAM_Initialization_sequence(), and BSP_SDRAM_Sendcmd().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM Exported Macro

STM32469I Discovery SDRAM Exported Macro
STM32469I Discovery SDRAM


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Private Types Definitions

STM32469I Discovery TS Private Types Definitions
STM32469I Discovery TS


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Private Types Defines

STM32469I Discovery TS Private Types Defines
STM32469I Discovery TS


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Private Macros

STM32469I Discovery TS Private Macros
STM32469I Discovery TS


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Imported Variables

Variables
STM32469I Discovery TS Imported Variables
STM32469I Discovery TS

Variables

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

Variable Documentation

char* ts_event_string_tab[TOUCH_EVENT_NB_MAX]

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

Definition at line 106 of file stm32469i_discovery_ts.c.

char* ts_gesture_id_string_tab[GEST_ID_NB_MAX]

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

Definition at line 113 of file stm32469i_discovery_ts.c.


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Private Variables

Variables
STM32469I Discovery TS Private Variables
STM32469I Discovery TS

Variables

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

Variable Documentation

uint8_t I2C_Address = 0

Definition at line 103 of file stm32469i_discovery_ts.c.

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

TS_DrvTypeDef* ts_driver [static]

Definition at line 101 of file stm32469i_discovery_ts.c.

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

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

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

Definition at line 106 of file stm32469i_discovery_ts.c.

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

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

Definition at line 113 of file stm32469i_discovery_ts.c.

uint8_t ts_orientation [static]

Definition at line 102 of file stm32469i_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Private Function Prototypes

STM32469I Discovery TS Private Function Prototypes
STM32469I Discovery TS


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Public Functions

Functions
STM32469I Discovery TS Public Functions
STM32469I Discovery TS

Functions

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

Function Documentation

uint8_t BSP_TS_GetState ( TS_StateTypeDef * TS_State )

Returns status and positions of the touch screen.

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

Definition at line 241 of file stm32469i_discovery_ts.c.

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

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

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

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

Definition at line 145 of file stm32469i_discovery_ts.c.

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

__weak void BSP_TS_INT_MspInit ( void )

Initializes the TS_INT pin MSP.

Definition at line 427 of file stm32469i_discovery_ts.c.

References TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITConfig().

uint8_t BSP_TS_ITConfig ( void )

Configures and enables the touch screen interrupts both at GPIO level and in TouchScreen IC driver configuration.

Return values:
TS_OK if all initializations are OK.

Definition at line 207 of file stm32469i_discovery_ts.c.

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Exported Constants

Defines
STM32469I Discovery TS Exported Constants
STM32469I Discovery TS

Defines

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

Define Documentation

#define TS_IRQ_PENDING ((uint8_t) 1)

Definition at line 54 of file stm32469i_discovery_ts.h.

#define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)

With FT6206 : maximum 2 touches detected simultaneously.

Definition at line 52 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_NO_IRQ_PENDING ((uint8_t) 0)

Definition at line 53 of file stm32469i_discovery_ts.h.

#define TS_SWAP_NONE ((uint8_t) 0x01)

Definition at line 56 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_Init().

#define TS_SWAP_X ((uint8_t) 0x02)

Definition at line 57 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_SWAP_XY ((uint8_t) 0x08)

Definition at line 59 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().

#define TS_SWAP_Y ((uint8_t) 0x04)

Definition at line 58 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_Init().


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Exported Types

Data Structures | Enumerations
STM32469I Discovery TS Exported Types
STM32469I Discovery TS

Data Structures

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

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02, TS_DEVICE_NOT_FOUND = 0x03 }
TS_StatusTypeDef Define BSP_TS_xxx() functions possible return value, when status is returned by those functions. More...
enum TS_GestureIdTypeDef {
GEST_ID_NO_GESTURE = 0x00, GEST_ID_MOVE_UP = 0x01, GEST_ID_MOVE_RIGHT = 0x02, GEST_ID_MOVE_DOWN = 0x03,
GEST_ID_MOVE_LEFT = 0x04, GEST_ID_ZOOM_IN = 0x05, GEST_ID_ZOOM_OUT = 0x06, GEST_ID_NB_MAX = 0x07
}
TS_GestureIdTypeDef Define Possible managed gesture identification values returned by touch screen driver. More...
enum TS_TouchEventTypeDef {
TOUCH_EVENT_NO_EVT = 0x00, TOUCH_EVENT_PRESS_DOWN = 0x01, TOUCH_EVENT_LIFT_UP = 0x02, TOUCH_EVENT_CONTACT = 0x03,
TOUCH_EVENT_NB_MAX = 0x04
}
TS_TouchEventTypeDef Define Possible touch events kind as returned values by touch screen IC Driver. More...

Enumeration Type Documentation

enum TS_GestureIdTypeDef

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

Enumerator:
GEST_ID_NO_GESTURE

Gesture not defined / recognized

GEST_ID_MOVE_UP

Gesture Move Up

GEST_ID_MOVE_RIGHT

Gesture Move Right

GEST_ID_MOVE_DOWN

Gesture Move Down

GEST_ID_MOVE_LEFT

Gesture Move Left

GEST_ID_ZOOM_IN

Gesture Zoom In

GEST_ID_ZOOM_OUT

Gesture Zoom Out

GEST_ID_NB_MAX

max number of gesture id

Definition at line 105 of file stm32469i_discovery_ts.h.

enum TS_StatusTypeDef

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

Enumerator:
TS_OK

Touch Ok

TS_ERROR

Touch Error

TS_TIMEOUT

Touch Timeout

TS_DEVICE_NOT_FOUND

Touchscreen device not found

Definition at line 92 of file stm32469i_discovery_ts.h.

enum TS_TouchEventTypeDef

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

Enumerator:
TOUCH_EVENT_NO_EVT

Touch Event : undetermined

TOUCH_EVENT_PRESS_DOWN

Touch Event Press Down

TOUCH_EVENT_LIFT_UP

Touch Event Lift Up

TOUCH_EVENT_CONTACT

Touch Event Contact

TOUCH_EVENT_NB_MAX

max number of touch events kind

Definition at line 122 of file stm32469i_discovery_ts.h.


./STM32469I-Discovery BSP User Manual: TS_StateTypeDef Struct Reference

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

TS_StateTypeDef Define TS State structure. More...

#include <stm32469i_discovery_ts.h>

Data Fields

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

Detailed Description

TS_StateTypeDef Define TS State structure.

Definition at line 72 of file stm32469i_discovery_ts.h.

Field Documentation

uint8_t TS_StateTypeDef::touchDetected

Total number of active touches detected at last scan

Definition at line 74 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::touchX[TS_MAX_NB_TOUCH]

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

Definition at line 75 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState().

uint16_t TS_StateTypeDef::touchY[TS_MAX_NB_TOUCH]

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

Definition at line 76 of file stm32469i_discovery_ts.h.

Referenced by BSP_TS_GetState().

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS Exported Functions

Functions
STM32469I Discovery TS Exported Functions
STM32469I Discovery TS

Functions

uint8_t | BSP_TS_Init (uint16_t ts_SizeX, uint16_t ts_SizeY)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
uint8_t | BSP_TS_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 both at GPIO level and in TouchScreen IC driver configuration.
void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.

Function Documentation

uint8_t BSP_TS_GetState ( TS_StateTypeDef * TS_State )

Returns status and positions of the touch screen.

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

Definition at line 241 of file stm32469i_discovery_ts.c.

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

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

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

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

Definition at line 145 of file stm32469i_discovery_ts.c.

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

void BSP_TS_INT_MspInit ( void )

Initializes the TS_INT pin MSP.

Definition at line 427 of file stm32469i_discovery_ts.c.

References TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITConfig().

uint8_t BSP_TS_ITConfig ( void )

Configures and enables the touch screen interrupts both at GPIO level and in TouchScreen IC driver configuration.

Return values:
TS_OK if all initializations are OK.

Definition at line 207 of file stm32469i_discovery_ts.c.

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


./STM32469I-Discovery BSP User Manual: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:
  • BackColor : LCD_DrawPropTypeDef
  • EraseSectorSize : QSPI_InfoTypeDef
  • EraseSectorsNumber : QSPI_InfoTypeDef
  • FlashSize : QSPI_InfoTypeDef
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_InfoTypeDef
  • ProgPagesNumber : QSPI_InfoTypeDef
  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point


./STM32469I-Discovery BSP User Manual: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • BackColor : LCD_DrawPropTypeDef
  • EraseSectorSize : QSPI_InfoTypeDef
  • EraseSectorsNumber : QSPI_InfoTypeDef
  • FlashSize : QSPI_InfoTypeDef
  • pFont : LCD_DrawPropTypeDef
  • ProgPageSize : QSPI_InfoTypeDef
  • ProgPagesNumber : QSPI_InfoTypeDef
  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef
  • X : Point
  • Y : Point


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_sdram.h
  • __DMAx_CLK_ENABLE : stm32469i_discovery_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32469i_discovery_sd.h
  • __STM32469I_DISCOVERY_BSP_VERSION : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_MAIN : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_RC : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_SUB1 : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_SUB2 : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_lcd.c
  • ActiveLayer : stm32469i_discovery_lcd.c
  • audio_drv : stm32469i_discovery_audio.c
  • AUDIO_ERROR : stm32469i_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32469i_discovery.h
  • AUDIO_I2Sx : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_IRQ : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_IRQHandler : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_MEM_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_STREAM : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_AF : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_AF : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_PIN : stm32469i_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32469i_discovery_audio.h
  • AUDIO_INT_PIN : stm32469i_discovery.h
  • AUDIO_INT_PORT : stm32469i_discovery.h
  • AUDIO_INT_PORT_CLK_ENABLE : stm32469i_discovery.h
  • AUDIO_IO_DeInit() : stm32469i_discovery.c
  • AUDIO_IO_Delay() : stm32469i_discovery.c
  • AUDIO_IO_Init() : stm32469i_discovery.c
  • AUDIO_IO_Read() : stm32469i_discovery.c
  • AUDIO_IO_Write() : stm32469i_discovery.c
  • AUDIO_OK : stm32469i_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32469i_discovery_audio.h
  • AUDIO_RESET_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_RESET_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_RESET_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_RESET_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx : stm32469i_discovery_audio.h
  • AUDIO_SAIx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_STREAM : stm32469i_discovery_audio.h
  • AUDIO_SAIx_FS_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_SCK_SD_FS_AF : stm32469i_discovery_audio.h
  • AUDIO_SAIx_PLL_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SD_PIN : stm32469i_discovery_audio.h
  • AUDIO_TIMEOUT : stm32469i_discovery_audio.h
  • AUDIO_TIMx : stm32469i_discovery_audio.h
  • AUDIO_TIMx_AF : stm32469i_discovery_audio.h
  • AUDIO_TIMx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_TIMx_IN_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_TIMx_IN_GPIO_PIN : stm32469i_discovery_audio.h
  • AUDIO_TIMx_OUT_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_TIMx_OUT_GPIO_PIN : stm32469i_discovery_audio.h
  • AUDIODATA_SIZE : stm32469i_discovery_audio.h
  • AudioInVolume : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

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

  • BSP_AUDIO_IN_ClockConfig() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_Error_Callback() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Pause() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_PDMToPCM() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Record() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Stop() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeAudioConfig() : stm32469i_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_CIRCULARMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_ClockConfig() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_DeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Error_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Init() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MONOMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MspDeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MspInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_NORMALMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Pause() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Play() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Resume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetFrequency() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetMute() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetOutputMode() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetVolume() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_OUT_STEREOMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Stop() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_EEPROM_DeInit() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_Init() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_ReadBuffer() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WaitEepromStandbyState() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WriteBuffer() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WritePage() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_GetVersion() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LCD_Clear() : stm32469i_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DMA2D_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DSI_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillCircle() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_Init() : stm32469i_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32469i_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_LTDC_ER_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_LTDC_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32469i_discovery_lcd.c
  • BSP_LCD_Reset() : stm32469i_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32469i_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32469i_discovery_lcd.c
  • BSP_LED_DeInit() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Init() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Off() : stm32469i_discovery.h , stm32469i_discovery.c
  • BSP_LED_On() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Toggle() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_DeInit() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_GetState() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_Init() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_QSPI_DeInit() : stm32469i_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32469i_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32469i_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Init() : stm32469i_discovery_qspi.c
  • BSP_QSPI_MemoryMappedMode : stm32469i_discovery_qspi.h
  • BSP_QSPI_MspDeInit() : stm32469i_discovery_qspi.c , stm32469i_discovery_qspi.h
  • BSP_QSPI_MspInit() : stm32469i_discovery_qspi.c , stm32469i_discovery_qspi.h
  • BSP_QSPI_Read() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Write() : stm32469i_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_CardInfo : stm32469i_discovery_sd.h
  • BSP_SD_DeInit() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_Detect_MspInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_DMA_Rx_IRQHandler : stm32469i_discovery_sd.h
  • BSP_SD_DMA_Tx_IRQHandler : stm32469i_discovery_sd.h
  • BSP_SD_Erase() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_GetCardState() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_Init() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_IRQHandler : stm32469i_discovery_sd.h
  • BSP_SD_IsDetected() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ITConfig() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_MspDeInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_MspInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ReadBlocks() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ReadBlocks_DMA() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_WriteBlocks() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_WriteCpltCallback() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SDRAM_DeInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_DMA_IRQHandler() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Init() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32469i_discovery_sdram.c
  • BSP_TS_GetState() : stm32469i_discovery_ts.c , stm32469i_discovery_ts.h
  • BSP_TS_Init() : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32469i_discovery_ts.c , stm32469i_discovery_ts.h
  • BSP_TS_ITConfig() : stm32469i_discovery_ts.c , stm32469i_discovery_ts.h
  • BUTTON_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • BUTTON_IRQn : stm32469i_discovery.c
  • BUTTON_MODE_EXTI : stm32469i_discovery.h
  • BUTTON_MODE_GPIO : stm32469i_discovery.h
  • BUTTON_PIN : stm32469i_discovery.c
  • BUTTON_PORT : stm32469i_discovery.c
  • Button_TypeDef : stm32469i_discovery.h
  • BUTTON_USER : stm32469i_discovery.h
  • BUTTON_WAKEUP : stm32469i_discovery.h
  • ButtonMode_TypeDef : stm32469i_discovery.h
  • BUTTONn : stm32469i_discovery.h
  • ButtonValue_TypeDef : stm32469i_discovery.h


./STM32469I-Discovery BSP User Manual: Globals

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

  • CENTER_MODE : stm32469i_discovery_lcd.h
  • Channel_Demux : stm32469i_discovery_audio.c
  • CHANNEL_DEMUX_MASK : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32469i_discovery_audio.h
  • CODEC_RESET_DELAY : stm32469i_discovery_audio.h
  • Command : stm32469i_discovery_sdram.c


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32469i_discovery_audio.h
  • DISCO_DMAx_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_ERROR : stm32469i_discovery.h
  • DISCO_I2C1 : stm32469i_discovery.h
  • DISCO_I2C1_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C1_ER_IRQn : stm32469i_discovery.h
  • DISCO_I2C1_EV_IRQn : stm32469i_discovery.h
  • DISCO_I2C1_FORCE_RESET : stm32469i_discovery.h
  • DISCO_I2C1_RELEASE_RESET : stm32469i_discovery.h
  • DISCO_I2C1_SCL_PIN : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_AF : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_GPIO_PORT : stm32469i_discovery.h
  • DISCO_I2C1_SDA_PIN : stm32469i_discovery.h
  • DISCO_I2C2 : stm32469i_discovery.h
  • DISCO_I2C2_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C2_ER_IRQn : stm32469i_discovery.h
  • DISCO_I2C2_EV_IRQn : stm32469i_discovery.h
  • DISCO_I2C2_FORCE_RESET : stm32469i_discovery.h
  • DISCO_I2C2_RELEASE_RESET : stm32469i_discovery.h
  • DISCO_I2C2_SCL_PIN : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_AF : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_GPIO_PORT : stm32469i_discovery.h
  • DISCO_I2C2_SDA_PIN : stm32469i_discovery.h
  • DISCO_OK : stm32469i_discovery.h
  • DISCO_Status_TypeDef : stm32469i_discovery.h
  • DMA_MAX : stm32469i_discovery_audio.h
  • DMA_MAX_SZE : stm32469i_discovery_audio.h
  • DrawChar() : stm32469i_discovery_lcd.c
  • DrawProp : stm32469i_discovery_lcd.c
  • DSI_IO_WriteCmd() : stm32469i_discovery_lcd.c


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32469i_discovery.h
  • EEPROM_I2C_ADDRESS_A02 : stm32469i_discovery.h
  • EEPROM_IO_Init() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_IO_ReadData() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_IO_WriteData() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_MAX_SIZE : stm32469i_discovery_eeprom.h
  • EEPROM_MAX_TRIALS : stm32469i_discovery_eeprom.h
  • EEPROM_OK : stm32469i_discovery_eeprom.h
  • EEPROM_PAGESIZE : stm32469i_discovery_eeprom.h
  • EEPROM_READ_TIMEOUT : stm32469i_discovery_eeprom.h
  • EEPROM_TIMEOUT : stm32469i_discovery_eeprom.h
  • EEPROM_WRITE_TIMEOUT : stm32469i_discovery_eeprom.h
  • EEPROMAddress : stm32469i_discovery_eeprom.c
  • EEPROMDataRead : stm32469i_discovery_eeprom.c
  • EEPROMDataWrite : stm32469i_discovery_eeprom.c
  • EEPROMTimeout : stm32469i_discovery_eeprom.c


./STM32469I-Discovery BSP User Manual: Globals

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


./STM32469I-Discovery BSP User Manual: Globals

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

  • GEST_ID_MOVE_DOWN : stm32469i_discovery_ts.h
  • GEST_ID_MOVE_LEFT : stm32469i_discovery_ts.h
  • GEST_ID_MOVE_RIGHT : stm32469i_discovery_ts.h
  • GEST_ID_MOVE_UP : stm32469i_discovery_ts.h
  • GEST_ID_NB_MAX : stm32469i_discovery_ts.h
  • GEST_ID_NO_GESTURE : stm32469i_discovery_ts.h
  • GEST_ID_ZOOM_IN : stm32469i_discovery_ts.h
  • GEST_ID_ZOOM_OUT : stm32469i_discovery_ts.h
  • GPIO_PIN : stm32469i_discovery.c
  • GPIO_PORT : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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_I2S_ErrorCallback() : stm32469i_discovery_audio.c
  • HAL_I2S_RxCpltCallback() : stm32469i_discovery_audio.c
  • HAL_I2S_RxHalfCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32469i_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32469i_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32469i_discovery_sd.c
  • haudio_in_i2s : stm32469i_discovery_audio.c
  • haudio_out_sai : stm32469i_discovery_audio.c
  • haudio_tim : stm32469i_discovery_audio.c
  • hdma2d_eval : stm32469i_discovery_lcd.c , stm32469i_discovery_lcd.h
  • hdsi_eval : stm32469i_discovery_lcd.c
  • hdsivideo_handle : stm32469i_discovery_lcd.c
  • heval_I2c1 : stm32469i_discovery.c
  • heval_I2c2 : stm32469i_discovery.c
  • hltdc_eval : stm32469i_discovery_lcd.c


./STM32469I-Discovery BSP User Manual: Globals

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

  • I2C1_Error() : stm32469i_discovery.c
  • I2C1_Init() : stm32469i_discovery.c
  • I2C1_IsDeviceReady() : stm32469i_discovery.c
  • I2C1_MspInit() : stm32469i_discovery.c
  • I2C1_Read() : stm32469i_discovery.c
  • I2C1_ReadMultiple() : stm32469i_discovery.c
  • I2C1_Write() : stm32469i_discovery.c
  • I2C1_WriteMultiple() : stm32469i_discovery.c
  • I2C2_Error() : stm32469i_discovery.c
  • I2C2_Init() : stm32469i_discovery.c
  • I2C2_MspInit() : stm32469i_discovery.c
  • I2C2_ReadMultiple() : stm32469i_discovery.c
  • I2C2_WriteMultiple() : stm32469i_discovery.c
  • I2C_Address : stm32469i_discovery_ts.c
  • I2Sx_DeInit() : stm32469i_discovery_audio.c
  • I2Sx_Init() : stm32469i_discovery_audio.c
  • INTERNAL_BUFF_SIZE : stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32469i_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32469i_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32469i_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32469i_discovery_lcd.h
  • LCD_COLOR_RED : stm32469i_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32469i_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32469i_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32469i_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32469i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG565 : stm32469i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG888 : stm32469i_discovery_lcd.h
  • LCD_ERROR : stm32469i_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32469i_discovery_lcd.h
  • LCD_LayerCfgTypeDef : stm32469i_discovery_lcd.h
  • LCD_OK : stm32469i_discovery_lcd.h
  • LCD_ORIENTATION_INVALID : stm32469i_discovery_lcd.h
  • LCD_ORIENTATION_LANDSCAPE : stm32469i_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32469i_discovery_lcd.h
  • LCD_OrientationTypeDef : stm32469i_discovery_lcd.h
  • LCD_OTM8009A_ID : stm32469i_discovery_lcd.h
  • LCD_TIMEOUT : stm32469i_discovery_lcd.h
  • lcd_x_size : stm32469i_discovery_lcd.c
  • lcd_y_size : stm32469i_discovery_lcd.c
  • LED1 : stm32469i_discovery.h
  • LED1_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED1_GPIO_PORT : stm32469i_discovery.h
  • LED1_PIN : stm32469i_discovery.h
  • LED2 : stm32469i_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED2_GPIO_PORT : stm32469i_discovery.h
  • LED2_PIN : stm32469i_discovery.h
  • LED3 : stm32469i_discovery.h
  • LED3_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED3_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED3_GPIO_PORT : stm32469i_discovery.h
  • LED3_PIN : stm32469i_discovery.h
  • LED4 : stm32469i_discovery.h
  • LED4_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED4_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED4_GPIO_PORT : stm32469i_discovery.h
  • LED4_PIN : stm32469i_discovery.h
  • LED_BLUE : stm32469i_discovery.h
  • LED_GREEN : stm32469i_discovery.h
  • LED_ORANGE : stm32469i_discovery.h
  • LED_RED : stm32469i_discovery.h
  • Led_TypeDef : stm32469i_discovery.h
  • LEDn : stm32469i_discovery.h
  • LEFT_MODE : stm32469i_discovery_lcd.h
  • LL_ConvertLineToARGB8888() : stm32469i_discovery_lcd.c
  • LL_FillBuffer() : stm32469i_discovery_lcd.c
  • LTDC_ACTIVE_LAYER_BACKGROUND : stm32469i_discovery_lcd.h
  • LTDC_ACTIVE_LAYER_FOREGROUND : stm32469i_discovery_lcd.h
  • LTDC_DEFAULT_ACTIVE_LAYER : stm32469i_discovery_lcd.h
  • LTDC_MAX_LAYER_NUMBER : stm32469i_discovery_lcd.h
  • LTDC_NB_OF_LAYERS : stm32469i_discovery_lcd.h


./STM32469I-Discovery BSP User Manual: Globals

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

  • MSD_ERROR : stm32469i_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32469i_discovery_sd.h
  • MSD_OK : stm32469i_discovery_sd.h


./STM32469I-Discovery BSP User Manual: Globals

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

  • NT35510_IO_Delay() : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

  • OTG_FS1_OVER_CURRENT_PIN : stm32469i_discovery.h
  • OTG_FS1_OVER_CURRENT_PORT : stm32469i_discovery.h
  • OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PIN : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PORT : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE : stm32469i_discovery.h
  • OTM8009A_IO_Delay() : stm32469i_discovery.c
  • OUTPUT_DEVICE_HEADPHONE1 : stm32469i_discovery_audio.c
  • OUTPUT_DEVICE_HEADPHONE2 : stm32469i_discovery_audio.c


./STM32469I-Discovery BSP User Manual: Globals

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

  • PB_RESET : stm32469i_discovery.h
  • PB_SET : stm32469i_discovery.h
  • PCM_OUT_SIZE : stm32469i_discovery_audio.h
  • PDM_FilterConfig : stm32469i_discovery_audio.c
  • PDM_FilterHandler : stm32469i_discovery_audio.c
  • PDMDecoder_Init() : stm32469i_discovery_audio.c
  • POLY_X : stm32469i_discovery_lcd.c
  • POLY_Y : stm32469i_discovery_lcd.c
  • pPoint : stm32469i_discovery_lcd.h


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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() : stm32469i_discovery_qspi.c
  • QSPI_BUSY : stm32469i_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_CLK_PIN : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_CS_PIN : stm32469i_discovery_qspi.h
  • QSPI_D0_PIN : stm32469i_discovery_qspi.h
  • QSPI_D1_PIN : stm32469i_discovery_qspi.h
  • QSPI_D2_PIN : stm32469i_discovery_qspi.h
  • QSPI_D3_PIN : stm32469i_discovery_qspi.h
  • QSPI_DummyCyclesCfg() : stm32469i_discovery_qspi.c
  • QSPI_DX_CLK_GPIO_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_DX_CLK_GPIO_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_DX_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_ERROR : stm32469i_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32469i_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32469i_discovery_qspi.h
  • QSPI_OK : stm32469i_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32469i_discovery_qspi.h
  • QSPI_ResetMemory() : stm32469i_discovery_qspi.c
  • QSPI_SUSPENDED : stm32469i_discovery_qspi.h
  • QSPI_WriteEnable() : stm32469i_discovery_qspi.c
  • QSPIHandle : stm32469i_discovery_qspi.c


./STM32469I-Discovery BSP User Manual: Globals

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


./STM32469I-Discovery BSP User Manual: Globals

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

  • SAIClockDivider : stm32469i_discovery_audio.c
  • SAIx_DeInit() : stm32469i_discovery_audio.c
  • SAIx_Init() : stm32469i_discovery_audio.c
  • SD_DATATIMEOUT : stm32469i_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32469i_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • SD_DETECT_GPIO_PORT : stm32469i_discovery.h
  • SD_DETECT_PIN : stm32469i_discovery.h
  • SD_DetectIRQHandler : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_IRQn : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_STREAM : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_IRQn : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_STREAM : stm32469i_discovery_sd.h
  • SD_NOT_PRESENT : stm32469i_discovery_sd.h
  • SD_PRESENT : stm32469i_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32469i_discovery_sd.h
  • SD_TRANSFER_OK : stm32469i_discovery_sd.h
  • SDCLOCK_PERIOD : stm32469i_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32469i_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_IRQHandler : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_IRQn : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_STREAM : stm32469i_discovery_sdram.h
  • SDRAM_ERROR : stm32469i_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32469i_discovery_sdram.h
  • SDRAM_OK : stm32469i_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32469i_discovery_sdram.h
  • sdramHandle : stm32469i_discovery_sdram.c


./STM32469I-Discovery BSP User Manual: Globals

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

  • Text_AlignModeTypdef : stm32469i_discovery_lcd.h
  • Timing : stm32469i_discovery_sdram.c
  • TIMx_DeInit() : stm32469i_discovery_audio.c
  • TIMx_IC_MspDeInit() : stm32469i_discovery_audio.c
  • TIMx_IC_MspInit() : stm32469i_discovery_audio.c
  • TIMx_Init() : stm32469i_discovery_audio.c
  • TOUCH_EVENT_CONTACT : stm32469i_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32469i_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32469i_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32469i_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32469i_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32469i_discovery_ts.h
  • ts_driver : stm32469i_discovery_ts.c
  • TS_ERROR : stm32469i_discovery_ts.h
  • ts_event_string_tab : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • ts_gesture_id_string_tab : stm32469i_discovery_ts.c , stm32469i_discovery_ts.h
  • TS_GestureIdTypeDef : stm32469i_discovery_ts.h
  • TS_I2C_ADDRESS : stm32469i_discovery.h
  • TS_I2C_ADDRESS_A02 : stm32469i_discovery.h
  • TS_INT_EXTI_IRQn : stm32469i_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • TS_INT_GPIO_PORT : stm32469i_discovery.h
  • TS_INT_PIN : stm32469i_discovery.h
  • TS_IO_Delay() : stm32469i_discovery.c
  • TS_IO_Init() : stm32469i_discovery.c
  • TS_IO_Read() : stm32469i_discovery.c
  • TS_IO_ReadMultiple() : stm32469i_discovery.c
  • TS_IO_Write() : stm32469i_discovery.c
  • TS_IO_WriteMultiple() : stm32469i_discovery.c
  • TS_IRQ_PENDING : stm32469i_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32469i_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32469i_discovery_ts.h
  • TS_OK : stm32469i_discovery_ts.h
  • ts_orientation : stm32469i_discovery_ts.c
  • TS_StatusTypeDef : stm32469i_discovery_ts.h
  • TS_SWAP_NONE : stm32469i_discovery_ts.h
  • TS_SWAP_X : stm32469i_discovery_ts.h
  • TS_SWAP_XY : stm32469i_discovery_ts.h
  • TS_SWAP_Y : stm32469i_discovery_ts.h
  • TS_TIMEOUT : stm32469i_discovery_ts.h
  • TS_TouchEventTypeDef : stm32469i_discovery_ts.h


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery_sd.c
  • USER_BUTTON_EXTI_IRQn : stm32469i_discovery.h
  • USER_BUTTON_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • USER_BUTTON_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • USER_BUTTON_GPIO_PORT : stm32469i_discovery.h
  • USER_BUTTON_PIN : stm32469i_discovery.h


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • 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 : stm32469i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • WAKEUP_BUTTON_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • WAKEUP_BUTTON_GPIO_PORT : stm32469i_discovery.h
  • WAKEUP_BUTTON_PIN : stm32469i_discovery.h


./STM32469I-Discovery BSP User Manual: Globals

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

- a -

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


./STM32469I-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_IN_ClockConfig() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_DeInit() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_Error_Callback() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_HalfTransfer_CallBack() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_Init() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_MspDeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_MspInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Pause() : stm32469i_discovery_audio.h , stm32469i_discovery_audio.c
  • BSP_AUDIO_IN_PDMToPCM() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Record() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_SetVolume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_Stop() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_IN_TransferComplete_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeAudioConfig() : stm32469i_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_ClockConfig() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_DeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Error_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_HalfTransfer_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Init() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MspDeInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MspInit() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Pause() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Play() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Resume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetAudioFrameSlot() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetFrequency() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetMute() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetOutputMode() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_SetVolume() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_Stop() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_TransferComplete_CallBack() : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h
  • BSP_EEPROM_DeInit() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_Init() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_ReadBuffer() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_TIMEOUT_UserCallback() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WaitEepromStandbyState() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WriteBuffer() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_EEPROM_WritePage() : stm32469i_discovery_eeprom.c , stm32469i_discovery_eeprom.h
  • BSP_GetVersion() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LCD_Clear() : stm32469i_discovery_lcd.c
  • BSP_LCD_ClearStringLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayChar() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayOff() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayOn() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayStringAt() : stm32469i_discovery_lcd.c
  • BSP_LCD_DisplayStringAtLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DMA2D_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawCircle() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawEllipse() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawHLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawPixel() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawRect() : stm32469i_discovery_lcd.c
  • BSP_LCD_DrawVLine() : stm32469i_discovery_lcd.c
  • BSP_LCD_DSI_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillCircle() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillEllipse() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32469i_discovery_lcd.c
  • BSP_LCD_FillRect() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetFont() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetTextColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_GetYSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_Init() : stm32469i_discovery_lcd.c
  • BSP_LCD_InitEx() : stm32469i_discovery_lcd.c
  • BSP_LCD_LayerDefaultInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_LTDC_ER_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_LTDC_IRQHandler() : stm32469i_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_MspInit() : stm32469i_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32469i_discovery_lcd.c
  • BSP_LCD_Reset() : stm32469i_discovery_lcd.c
  • BSP_LCD_ResetColorKeying() : stm32469i_discovery_lcd.c
  • BSP_LCD_SelectLayer() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetColorKeying() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetFont() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerAddress() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerVisible() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetLayerWindow() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetTransparency() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetXSize() : stm32469i_discovery_lcd.c
  • BSP_LCD_SetYSize() : stm32469i_discovery_lcd.c
  • BSP_LED_DeInit() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Init() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Off() : stm32469i_discovery.h , stm32469i_discovery.c
  • BSP_LED_On() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_LED_Toggle() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_DeInit() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_GetState() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_PB_Init() : stm32469i_discovery.c , stm32469i_discovery.h
  • BSP_QSPI_DeInit() : stm32469i_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32469i_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32469i_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Init() : stm32469i_discovery_qspi.c
  • BSP_QSPI_MspDeInit() : stm32469i_discovery_qspi.h , stm32469i_discovery_qspi.c
  • BSP_QSPI_MspInit() : stm32469i_discovery_qspi.h , stm32469i_discovery_qspi.c
  • BSP_QSPI_Read() : stm32469i_discovery_qspi.c
  • BSP_QSPI_Write() : stm32469i_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_DeInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_Detect_MspInit() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_Erase() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_GetCardState() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_Init() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_IsDetected() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ITConfig() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_MspDeInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_MspInit() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ReadBlocks() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_ReadBlocks_DMA() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SD_WriteBlocks_DMA() : stm32469i_discovery_sd.h , stm32469i_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32469i_discovery_sd.c , stm32469i_discovery_sd.h
  • BSP_SDRAM_DeInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_DMA_IRQHandler() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Init() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Initialization_sequence() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_MspDeInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_MspInit() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_ReadData() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_ReadData_DMA() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_Sendcmd() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_WriteData() : stm32469i_discovery_sdram.c
  • BSP_SDRAM_WriteData_DMA() : stm32469i_discovery_sdram.c
  • BSP_TS_GetState() : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • BSP_TS_Init() : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • BSP_TS_ITConfig() : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c


./STM32469I-Discovery BSP User Manual: Globals

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

- d -

  • DrawChar() : stm32469i_discovery_lcd.c
  • DSI_IO_WriteCmd() : stm32469i_discovery_lcd.c


./STM32469I-Discovery BSP User Manual: Globals

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

- e -

  • EEPROM_IO_Init() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_IO_IsDeviceReady() : stm32469i_discovery_eeprom.h , stm32469i_discovery.c
  • EEPROM_IO_ReadData() : stm32469i_discovery.c , stm32469i_discovery_eeprom.h
  • EEPROM_IO_WriteData() : stm32469i_discovery_eeprom.h , stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

- f -

  • FillTriangle() : stm32469i_discovery_lcd.c


./STM32469I-Discovery BSP User Manual: Globals

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

- h -

  • HAL_I2S_ErrorCallback() : stm32469i_discovery_audio.c
  • HAL_I2S_RxCpltCallback() : stm32469i_discovery_audio.c
  • HAL_I2S_RxHalfCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32469i_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32469i_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32469i_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32469i_discovery_sd.c


./STM32469I-Discovery BSP User Manual: Globals

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

- i -

  • I2C1_Error() : stm32469i_discovery.c
  • I2C1_Init() : stm32469i_discovery.c
  • I2C1_IsDeviceReady() : stm32469i_discovery.c
  • I2C1_MspInit() : stm32469i_discovery.c
  • I2C1_Read() : stm32469i_discovery.c
  • I2C1_ReadMultiple() : stm32469i_discovery.c
  • I2C1_Write() : stm32469i_discovery.c
  • I2C1_WriteMultiple() : stm32469i_discovery.c
  • I2C2_Error() : stm32469i_discovery.c
  • I2C2_Init() : stm32469i_discovery.c
  • I2C2_MspInit() : stm32469i_discovery.c
  • I2C2_ReadMultiple() : stm32469i_discovery.c
  • I2C2_WriteMultiple() : stm32469i_discovery.c
  • I2Sx_DeInit() : stm32469i_discovery_audio.c
  • I2Sx_Init() : stm32469i_discovery_audio.c


./STM32469I-Discovery BSP User Manual: Globals

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

- l -

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


./STM32469I-Discovery BSP User Manual: Globals

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

- n -

  • NT35510_IO_Delay() : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

- o -

  • OTM8009A_IO_Delay() : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

- p -

  • PDMDecoder_Init() : stm32469i_discovery_audio.c


./STM32469I-Discovery BSP User Manual: Globals

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

- q -

  • QSPI_AutoPollingMemReady() : stm32469i_discovery_qspi.c
  • QSPI_DummyCyclesCfg() : stm32469i_discovery_qspi.c
  • QSPI_ResetMemory() : stm32469i_discovery_qspi.c
  • QSPI_WriteEnable() : stm32469i_discovery_qspi.c


./STM32469I-Discovery BSP User Manual: Globals

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

- s -

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


./STM32469I-Discovery BSP User Manual: Globals

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

- t -

  • TIMx_DeInit() : stm32469i_discovery_audio.c
  • TIMx_IC_MspDeInit() : stm32469i_discovery_audio.c
  • TIMx_IC_MspInit() : stm32469i_discovery_audio.c
  • TIMx_Init() : stm32469i_discovery_audio.c
  • TS_IO_Delay() : stm32469i_discovery.c
  • TS_IO_Init() : stm32469i_discovery.c
  • TS_IO_Read() : stm32469i_discovery.c
  • TS_IO_ReadMultiple() : stm32469i_discovery.c
  • TS_IO_Write() : stm32469i_discovery.c
  • TS_IO_WriteMultiple() : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

- a -

  • ActiveLayer : stm32469i_discovery_lcd.c
  • audio_drv : stm32469i_discovery_audio.c
  • AudioInVolume : stm32469i_discovery_audio.c , stm32469i_discovery_audio.h

- b -

  • BUTTON_IRQn : stm32469i_discovery.c
  • BUTTON_PIN : stm32469i_discovery.c
  • BUTTON_PORT : stm32469i_discovery.c

- c -

  • Channel_Demux : stm32469i_discovery_audio.c
  • Command : stm32469i_discovery_sdram.c

- d -

  • DrawProp : stm32469i_discovery_lcd.c

- e -

  • EEPROMAddress : stm32469i_discovery_eeprom.c
  • EEPROMDataRead : stm32469i_discovery_eeprom.c
  • EEPROMDataWrite : stm32469i_discovery_eeprom.c
  • EEPROMTimeout : stm32469i_discovery_eeprom.c

- g -

  • GPIO_PIN : stm32469i_discovery.c
  • GPIO_PORT : stm32469i_discovery.c

- h -

  • haudio_in_i2s : stm32469i_discovery_audio.c
  • haudio_out_sai : stm32469i_discovery_audio.c
  • haudio_tim : stm32469i_discovery_audio.c
  • hdma2d_eval : stm32469i_discovery_lcd.c , stm32469i_discovery_lcd.h
  • hdsi_eval : stm32469i_discovery_lcd.c
  • hdsivideo_handle : stm32469i_discovery_lcd.c
  • heval_I2c1 : stm32469i_discovery.c
  • heval_I2c2 : stm32469i_discovery.c
  • hltdc_eval : stm32469i_discovery_lcd.c

- i -

  • I2C_Address : stm32469i_discovery_ts.c

- l -

  • lcd_x_size : stm32469i_discovery_lcd.c
  • lcd_y_size : stm32469i_discovery_lcd.c

- p -

  • PDM_FilterConfig : stm32469i_discovery_audio.c
  • PDM_FilterHandler : stm32469i_discovery_audio.c

- q -

  • QSPIHandle : stm32469i_discovery_qspi.c

- s -

  • sdramHandle : stm32469i_discovery_sdram.c

- t -

  • Timing : stm32469i_discovery_sdram.c
  • ts_driver : stm32469i_discovery_ts.c
  • ts_event_string_tab : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • ts_gesture_id_string_tab : stm32469i_discovery_ts.h , stm32469i_discovery_ts.c
  • ts_orientation : stm32469i_discovery_ts.c

- u -

  • uSdHandle : stm32469i_discovery_sd.c


./STM32469I-Discovery BSP User Manual: Globals

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


./STM32469I-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Button_TypeDef : stm32469i_discovery.h
  • ButtonMode_TypeDef : stm32469i_discovery.h
  • ButtonValue_TypeDef : stm32469i_discovery.h
  • DISCO_Status_TypeDef : stm32469i_discovery.h
  • LCD_OrientationTypeDef : stm32469i_discovery_lcd.h
  • Led_TypeDef : stm32469i_discovery.h
  • Text_AlignModeTypdef : stm32469i_discovery_lcd.h
  • TS_GestureIdTypeDef : stm32469i_discovery_ts.h
  • TS_StatusTypeDef : stm32469i_discovery_ts.h
  • TS_TouchEventTypeDef : stm32469i_discovery_ts.h


./STM32469I-Discovery BSP User Manual: Globals

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

- b -

  • BUTTON_MODE_EXTI : stm32469i_discovery.h
  • BUTTON_MODE_GPIO : stm32469i_discovery.h
  • BUTTON_WAKEUP : stm32469i_discovery.h

- c -

  • CENTER_MODE : stm32469i_discovery_lcd.h

- d -

  • DISCO_ERROR : stm32469i_discovery.h
  • DISCO_OK : stm32469i_discovery.h

- g -

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

- l -

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

- p -

  • PB_RESET : stm32469i_discovery.h
  • PB_SET : stm32469i_discovery.h

- r -

  • RIGHT_MODE : stm32469i_discovery_lcd.h

- t -

  • TOUCH_EVENT_CONTACT : stm32469i_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32469i_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32469i_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32469i_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32469i_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32469i_discovery_ts.h
  • TS_ERROR : stm32469i_discovery_ts.h
  • TS_OK : stm32469i_discovery_ts.h
  • TS_TIMEOUT : stm32469i_discovery_ts.h


./STM32469I-Discovery BSP User Manual: Globals

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

- _ -

  • __DMAx_CLK_DISABLE : stm32469i_discovery_sdram.h
  • __DMAx_CLK_ENABLE : stm32469i_discovery_sdram.h
  • __DMAx_TxRx_CLK_ENABLE : stm32469i_discovery_sd.h
  • __STM32469I_DISCOVERY_BSP_VERSION : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_MAIN : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_RC : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_SUB1 : stm32469i_discovery.c
  • __STM32469I_DISCOVERY_BSP_VERSION_SUB2 : stm32469i_discovery.c


./STM32469I-Discovery BSP User Manual: Globals

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

- a -

  • ABS : stm32469i_discovery_lcd.c
  • AUDIO_ERROR : stm32469i_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32469i_discovery.h
  • AUDIO_I2Sx : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_IRQ : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_IRQHandler : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_MEM_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_DMAx_STREAM : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_AF : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_AF : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_I2Sx_SD_PIN : stm32469i_discovery_audio.h
  • AUDIO_IN_IRQ_PREPRIO : stm32469i_discovery_audio.h
  • AUDIO_INT_PIN : stm32469i_discovery.h
  • AUDIO_INT_PORT : stm32469i_discovery.h
  • AUDIO_INT_PORT_CLK_ENABLE : stm32469i_discovery.h
  • AUDIO_OK : stm32469i_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32469i_discovery_audio.h
  • AUDIO_RESET_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_RESET_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_RESET_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_RESET_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx : stm32469i_discovery_audio.h
  • AUDIO_SAIx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_DMAx_STREAM : stm32469i_discovery_audio.h
  • AUDIO_SAIx_FS_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_SAIx_MCLK_SCK_SD_FS_AF : stm32469i_discovery_audio.h
  • AUDIO_SAIx_PLL_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_PIN : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SCK_SD_FS_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_SAIx_SD_PIN : stm32469i_discovery_audio.h
  • AUDIO_TIMEOUT : stm32469i_discovery_audio.h
  • AUDIO_TIMx : stm32469i_discovery_audio.h
  • AUDIO_TIMx_AF : stm32469i_discovery_audio.h
  • AUDIO_TIMx_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_CLK_DISABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_CLK_ENABLE : stm32469i_discovery_audio.h
  • AUDIO_TIMx_GPIO_PORT : stm32469i_discovery_audio.h
  • AUDIO_TIMx_IN_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_TIMx_IN_GPIO_PIN : stm32469i_discovery_audio.h
  • AUDIO_TIMx_OUT_CHANNEL : stm32469i_discovery_audio.h
  • AUDIO_TIMx_OUT_GPIO_PIN : stm32469i_discovery_audio.h
  • AUDIODATA_SIZE : stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_OUT_CIRCULARMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_MONOMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_NORMALMODE : stm32469i_discovery_audio.h
  • BSP_AUDIO_OUT_STEREOMODE : stm32469i_discovery_audio.h
  • BSP_QSPI_MemoryMappedMode : stm32469i_discovery_qspi.h
  • BSP_SD_CardInfo : stm32469i_discovery_sd.h
  • BSP_SD_DMA_Rx_IRQHandler : stm32469i_discovery_sd.h
  • BSP_SD_DMA_Tx_IRQHandler : stm32469i_discovery_sd.h
  • BSP_SD_IRQHandler : stm32469i_discovery_sd.h
  • BUTTON_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • BUTTON_USER : stm32469i_discovery.h
  • BUTTONn : stm32469i_discovery.h


./STM32469I-Discovery BSP User Manual: Globals

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

- c -

  • CHANNEL_DEMUX_MASK : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_0123 : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_02 : stm32469i_discovery_audio.h
  • CODEC_AUDIOFRAME_SLOT_13 : stm32469i_discovery_audio.h
  • CODEC_RESET_DELAY : stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

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

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32469i_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32469i_discovery_audio.h
  • DISCO_DMAx_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C1 : stm32469i_discovery.h
  • DISCO_I2C1_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C1_ER_IRQn : stm32469i_discovery.h
  • DISCO_I2C1_EV_IRQn : stm32469i_discovery.h
  • DISCO_I2C1_FORCE_RESET : stm32469i_discovery.h
  • DISCO_I2C1_RELEASE_RESET : stm32469i_discovery.h
  • DISCO_I2C1_SCL_PIN : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_AF : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C1_SCL_SDA_GPIO_PORT : stm32469i_discovery.h
  • DISCO_I2C1_SDA_PIN : stm32469i_discovery.h
  • DISCO_I2C2 : stm32469i_discovery.h
  • DISCO_I2C2_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C2_ER_IRQn : stm32469i_discovery.h
  • DISCO_I2C2_EV_IRQn : stm32469i_discovery.h
  • DISCO_I2C2_FORCE_RESET : stm32469i_discovery.h
  • DISCO_I2C2_RELEASE_RESET : stm32469i_discovery.h
  • DISCO_I2C2_SCL_PIN : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_AF : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • DISCO_I2C2_SCL_SDA_GPIO_PORT : stm32469i_discovery.h
  • DISCO_I2C2_SDA_PIN : stm32469i_discovery.h
  • DMA_MAX : stm32469i_discovery_audio.h
  • DMA_MAX_SZE : stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

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

- e -

  • EEPROM_FAIL : stm32469i_discovery_eeprom.h
  • EEPROM_I2C_ADDRESS_A01 : stm32469i_discovery.h
  • EEPROM_I2C_ADDRESS_A02 : stm32469i_discovery.h
  • EEPROM_MAX_SIZE : stm32469i_discovery_eeprom.h
  • EEPROM_MAX_TRIALS : stm32469i_discovery_eeprom.h
  • EEPROM_OK : stm32469i_discovery_eeprom.h
  • EEPROM_PAGESIZE : stm32469i_discovery_eeprom.h
  • EEPROM_READ_TIMEOUT : stm32469i_discovery_eeprom.h
  • EEPROM_TIMEOUT : stm32469i_discovery_eeprom.h
  • EEPROM_WRITE_TIMEOUT : stm32469i_discovery_eeprom.h


./STM32469I-Discovery BSP User Manual: Globals

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

- i -

  • INTERNAL_BUFF_SIZE : stm32469i_discovery_audio.h


./STM32469I-Discovery BSP User Manual: Globals

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

- l -

  • LCD_COLOR_BLACK : stm32469i_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32469i_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32469i_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32469i_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTCYAN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32469i_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32469i_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32469i_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32469i_discovery_lcd.h
  • LCD_COLOR_RED : stm32469i_discovery_lcd.h
  • LCD_COLOR_TRANSPARENT : stm32469i_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32469i_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32469i_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32469i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG565 : stm32469i_discovery_lcd.h
  • LCD_DSI_PIXEL_DATA_FMT_RBG888 : stm32469i_discovery_lcd.h
  • LCD_ERROR : stm32469i_discovery_lcd.h
  • LCD_FB_START_ADDRESS : stm32469i_discovery_lcd.h
  • LCD_LayerCfgTypeDef : stm32469i_discovery_lcd.h
  • LCD_OK : stm32469i_discovery_lcd.h
  • LCD_OTM8009A_ID : stm32469i_discovery_lcd.h
  • LCD_TIMEOUT : stm32469i_discovery_lcd.h
  • LED1_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED1_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED1_GPIO_PORT : stm32469i_discovery.h
  • LED1_PIN : stm32469i_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED2_GPIO_PORT : stm32469i_discovery.h
  • LED2_PIN : stm32469i_discovery.h
  • LED3_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED3_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED3_GPIO_PORT : stm32469i_discovery.h
  • LED3_PIN : stm32469i_discovery.h
  • LED4_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • LED4_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • LED4_GPIO_PORT : stm32469i_discovery.h
  • LED4_PIN : stm32469i_discovery.h
  • LEDn : stm32469i_discovery.h
  • LTDC_ACTIVE_LAYER_BACKGROUND : stm32469i_discovery_lcd.h
  • LTDC_ACTIVE_LAYER_FOREGROUND : stm32469i_discovery_lcd.h
  • LTDC_DEFAULT_ACTIVE_LAYER : stm32469i_discovery_lcd.h
  • LTDC_MAX_LAYER_NUMBER : stm32469i_discovery_lcd.h
  • LTDC_NB_OF_LAYERS : stm32469i_discovery_lcd.h


./STM32469I-Discovery BSP User Manual: Globals

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

- m -

  • MSD_ERROR : stm32469i_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32469i_discovery_sd.h
  • MSD_OK : stm32469i_discovery_sd.h


./STM32469I-Discovery BSP User Manual: Globals

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

- o -

  • OTG_FS1_OVER_CURRENT_PIN : stm32469i_discovery.h
  • OTG_FS1_OVER_CURRENT_PORT : stm32469i_discovery.h
  • OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PIN : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PORT : stm32469i_discovery.h
  • OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE : stm32469i_discovery.h
  • OUTPUT_DEVICE_HEADPHONE1 : stm32469i_discovery_audio.c
  • OUTPUT_DEVICE_HEADPHONE2 : stm32469i_discovery_audio.c


./STM32469I-Discovery BSP User Manual: Globals

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

- p -

  • PCM_OUT_SIZE : stm32469i_discovery_audio.h
  • POLY_X : stm32469i_discovery_lcd.c
  • POLY_Y : stm32469i_discovery_lcd.c


./STM32469I-Discovery BSP User Manual: Globals

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

- q -

  • QSPI_BUSY : stm32469i_discovery_qspi.h
  • QSPI_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_CLK_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_CLK_PIN : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_CS_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_CS_PIN : stm32469i_discovery_qspi.h
  • QSPI_D0_PIN : stm32469i_discovery_qspi.h
  • QSPI_D1_PIN : stm32469i_discovery_qspi.h
  • QSPI_D2_PIN : stm32469i_discovery_qspi.h
  • QSPI_D3_PIN : stm32469i_discovery_qspi.h
  • QSPI_DX_CLK_GPIO_CLK_DISABLE : stm32469i_discovery_qspi.h
  • QSPI_DX_CLK_GPIO_CLK_ENABLE : stm32469i_discovery_qspi.h
  • QSPI_DX_GPIO_PORT : stm32469i_discovery_qspi.h
  • QSPI_ERROR : stm32469i_discovery_qspi.h
  • QSPI_FORCE_RESET : stm32469i_discovery_qspi.h
  • QSPI_NOT_SUPPORTED : stm32469i_discovery_qspi.h
  • QSPI_OK : stm32469i_discovery_qspi.h
  • QSPI_RELEASE_RESET : stm32469i_discovery_qspi.h
  • QSPI_SUSPENDED : stm32469i_discovery_qspi.h


./STM32469I-Discovery BSP User Manual: Globals

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

- r -

  • REFRESH_COUNT : stm32469i_discovery_sdram.h


./STM32469I-Discovery BSP User Manual: Globals

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

- s -

  • SAIClockDivider : stm32469i_discovery_audio.c
  • SD_DATATIMEOUT : stm32469i_discovery_sd.h
  • SD_DETECT_EXTI_IRQn : stm32469i_discovery.h
  • SD_DETECT_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • SD_DETECT_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • SD_DETECT_GPIO_PORT : stm32469i_discovery.h
  • SD_DETECT_PIN : stm32469i_discovery.h
  • SD_DetectIRQHandler : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_CHANNEL : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_IRQn : stm32469i_discovery_sd.h
  • SD_DMAx_Rx_STREAM : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_CHANNEL : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_IRQn : stm32469i_discovery_sd.h
  • SD_DMAx_Tx_STREAM : stm32469i_discovery_sd.h
  • SD_NOT_PRESENT : stm32469i_discovery_sd.h
  • SD_PRESENT : stm32469i_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32469i_discovery_sd.h
  • SD_TRANSFER_OK : stm32469i_discovery_sd.h
  • SDCLOCK_PERIOD : stm32469i_discovery_sdram.h
  • SDRAM_DEVICE_ADDR : stm32469i_discovery_sdram.h
  • SDRAM_DEVICE_SIZE : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_CHANNEL : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_IRQHandler : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_IRQn : stm32469i_discovery_sdram.h
  • SDRAM_DMAx_STREAM : stm32469i_discovery_sdram.h
  • SDRAM_ERROR : stm32469i_discovery_sdram.h
  • SDRAM_MEMORY_WIDTH : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_1 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_2 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_4 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_LENGTH_8 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_INTERLEAVED : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_2 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_CAS_LATENCY_3 : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_OPERATING_MODE_STANDARD : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED : stm32469i_discovery_sdram.h
  • SDRAM_MODEREG_WRITEBURST_MODE_SINGLE : stm32469i_discovery_sdram.h
  • SDRAM_OK : stm32469i_discovery_sdram.h
  • SDRAM_TIMEOUT : stm32469i_discovery_sdram.h


./STM32469I-Discovery BSP User Manual: Globals

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

- t -

  • TS_I2C_ADDRESS : stm32469i_discovery.h
  • TS_I2C_ADDRESS_A02 : stm32469i_discovery.h
  • TS_INT_EXTI_IRQn : stm32469i_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • TS_INT_GPIO_PORT : stm32469i_discovery.h
  • TS_INT_PIN : stm32469i_discovery.h
  • TS_IRQ_PENDING : stm32469i_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32469i_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32469i_discovery_ts.h
  • TS_SWAP_NONE : stm32469i_discovery_ts.h
  • TS_SWAP_X : stm32469i_discovery_ts.h
  • TS_SWAP_XY : stm32469i_discovery_ts.h
  • TS_SWAP_Y : stm32469i_discovery_ts.h


./STM32469I-Discovery BSP User Manual: Globals

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

- u -

  • USER_BUTTON_EXTI_IRQn : stm32469i_discovery.h
  • USER_BUTTON_GPIO_CLK_DISABLE : stm32469i_discovery.h
  • USER_BUTTON_GPIO_CLK_ENABLE : stm32469i_discovery.h
  • USER_BUTTON_GPIO_PORT : stm32469i_discovery.h
  • USER_BUTTON_PIN : stm32469i_discovery.h


./STM32469I-Discovery BSP User Manual: Globals

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

- w -

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


./STM32469I-Discovery BSP User Manual: stm32469i_discovery.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions | Variables
stm32469i_discovery.c File Reference

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, RF EEPROM, available on STM32469I-Discovery board (MB1189) RevA/B/C from STMicroelectronics. More...

#include "stm32469i_discovery.h"

Go to the source code of this file.

Defines

#define | __STM32469I_DISCOVERY_BSP_VERSION_MAIN (0x02)
STM32469I Discovery BSP Driver version number V2.1.1.
#define | __STM32469I_DISCOVERY_BSP_VERSION_SUB1 (0x01)
#define | __STM32469I_DISCOVERY_BSP_VERSION_SUB2 (0x01)
#define | __STM32469I_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32469I_DISCOVERY_BSP_VERSION

Functions

static void | I2C1_MspInit (void)
Initializes I2C MSP.
static void | I2C2_MspInit (void)
Initializes I2C MSP.
static void | I2C1_Init (void)
Initializes I2C HAL.
static void | I2C2_Init (void)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2C1_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2C2_ReadMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
static HAL_StatusTypeDef | I2C1_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 | I2C2_WriteMultiple (uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
static HAL_StatusTypeDef | I2C1_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
static void | I2C1_Error (uint8_t Addr)
Manages error callback by re-initializing I2C.
static void | I2C2_Error (uint8_t Addr)
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, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | AUDIO_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
void | AUDIO_IO_Delay (uint32_t Delay)
AUDIO Codec delay.
void | EEPROM_IO_Init (void)
Initializes peripherals used by the I2C EEPROM driver.
HAL_StatusTypeDef | EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
HAL_StatusTypeDef | EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
void | TS_IO_Init (void)
Initialize I2C communication channel from MCU to TouchScreen (TS).
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes single data with I2C communication channel from MCU to TouchScreen.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from TouchScreen.
uint16_t | TS_IO_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Reads multiple data with I2C communication channel from TouchScreen.
void | TS_IO_WriteMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Writes multiple data with I2C communication channel from MCU to TouchScreen.
void | TS_IO_Delay (uint32_t Delay)
Delay function used in TouchScreen low level driver.
void | OTM8009A_IO_Delay (uint32_t Delay)
OTM8009A delay.
void | NT35510_IO_Delay (uint32_t Delay)
NT35510 delay.
uint32_t | BSP_GetVersion (void)
This method returns the STM32469I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.
static void | I2C1_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
static uint8_t | I2C1_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.

Variables

uint32_t | GPIO_PIN [LEDn]
GPIO_TypeDef * | GPIO_PORT [LEDn]
GPIO_TypeDef * | BUTTON_PORT [BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT }
const uint16_t | BUTTON_PIN [BUTTONn] = {WAKEUP_BUTTON_PIN }
const uint16_t | BUTTON_IRQn [BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn }
static I2C_HandleTypeDef | heval_I2c1
static I2C_HandleTypeDef | heval_I2c2

Detailed Description

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, RF EEPROM, available on STM32469I-Discovery board (MB1189) RevA/B/C from STMicroelectronics.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Enumerations | Functions
stm32469i_discovery.h File Reference

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

#include "stm32f4xx_hal.h"

Go to the source code of this file.

Defines

#define | BUTTON_USER BUTTON_WAKEUP
#define | LEDn ((uint8_t)4)
#define | LED1_GPIO_PORT ((GPIO_TypeDef*)GPIOG)
#define | LED2_GPIO_PORT ((GPIO_TypeDef*)GPIOD)
#define | LED3_GPIO_PORT ((GPIO_TypeDef*)GPIOD)
#define | LED4_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
#define | LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
#define | LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
#define | LED1_PIN ((uint32_t)GPIO_PIN_6)
#define | LED2_PIN ((uint32_t)GPIO_PIN_4)
#define | LED3_PIN ((uint32_t)GPIO_PIN_5)
#define | LED4_PIN ((uint32_t)GPIO_PIN_3)
#define | BUTTONn ((uint8_t)1)
#define | WAKEUP_BUTTON_PIN GPIO_PIN_0
Wakeup push-button.
#define | WAKEUP_BUTTON_GPIO_PORT GPIOA
#define | WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn
#define | USER_BUTTON_PIN WAKEUP_BUTTON_PIN
#define | USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
#define | USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
#define | USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
#define | USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
#define | BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | AUDIO_INT_PIN GPIO_PIN_7
OTG_FS1 OVER_CURRENT and POWER_SWITCH Pins definition.
#define | AUDIO_INT_PORT GPIOB
#define | AUDIO_INT_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OTG_FS1_OVER_CURRENT_PIN GPIO_PIN_7
#define | OTG_FS1_OVER_CURRENT_PORT GPIOB
#define | OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | OTG_FS1_POWER_SWITCH_PIN GPIO_PIN_2
#define | OTG_FS1_POWER_SWITCH_PORT GPIOB
#define | OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | SD_DETECT_PIN ((uint32_t)GPIO_PIN_2)
SD-detect signal.
#define | SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOG)
#define | SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | SD_DETECT_EXTI_IRQn EXTI2_IRQn
#define | TS_INT_PIN ((uint32_t)GPIO_PIN_5)
TS_INT signal from TouchScreen when it is configured in interrupt mode.
#define | TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOJ)
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI9_5_IRQn
#define | TS_I2C_ADDRESS ((uint16_t)0x54)
TouchScreen FT6206 Slave I2C address 1.
#define | TS_I2C_ADDRESS_A02 ((uint16_t)0x70)
TouchScreen FT6336G Slave I2C address 2.
#define | AUDIO_I2C_ADDRESS ((uint16_t)0x94)
Audio I2C Slave address.
#define | EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
EEPROM I2C Slave address 1.
#define | EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
EEPROM I2C Slave address 2.
#define | DISCO_I2C1 I2C1
I2C clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.
#define | DISCO_I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCO_I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCO_I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCO_I2C1_SCL_PIN GPIO_PIN_8
Definition for I2C1 Pins.
#define | DISCO_I2C1_SCL_SDA_GPIO_PORT GPIOB
#define | DISCO_I2C1_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCO_I2C1_SDA_PIN GPIO_PIN_9
#define | DISCO_I2C1_EV_IRQn I2C1_EV_IRQn
Definition of I2C interrupt requests.
#define | DISCO_I2C1_ER_IRQn I2C1_ER_IRQn
#define | DISCO_I2C2 I2C2
I2C2 clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in other files It can be used in parallel by other modules.
#define | DISCO_I2C2_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCO_I2C2_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCO_I2C2_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCO_I2C2_SCL_PIN GPIO_PIN_4
Definition for I2C2 Pins.
#define | DISCO_I2C2_SCL_SDA_GPIO_PORT GPIOH
#define | DISCO_I2C2_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCO_I2C2_SDA_PIN GPIO_PIN_5
#define | DISCO_I2C2_EV_IRQn I2C2_EV_IRQn
Definition of I2C2 interrupt requests.
#define | DISCO_I2C2_ER_IRQn I2C2_ER_IRQn

Enumerations

enum Led_TypeDef {
LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_ORANGE = LED2,
LED3 = 2, LED_RED = LED3, LED4 = 3, LED_BLUE = LED4
}
Led_TypeDef STM32469I_Discovery board leds definitions. More...
enum | Button_TypeDef { BUTTON_WAKEUP = 0 }
Button_TypeDef STM32469I_Discovery board Buttons definitions. More...
enum | ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
ButtonMode_TypeDef STM32469I_Discovery board Buttons Modes definitions. More...
enum | ButtonValue_TypeDef { PB_SET = 0, PB_RESET = !PB_SET }
enum | DISCO_Status_TypeDef { DISCO_OK = 0, DISCO_ERROR = 1 }
DISCO_Status_TypeDef STM32469I_DISCO board Status return possible values. More...

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32469I Discovery BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIO.
void | BSP_LED_DeInit (Led_TypeDef Led)
DeInit LEDs.
void | BSP_LED_On (Led_TypeDef Led)
Turns selected LED On.
void | BSP_LED_Off (Led_TypeDef Led)
Turns selected LED Off.
void | BSP_LED_Toggle (Led_TypeDef Led)
Toggles the selected LED.
void | BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
void | BSP_PB_DeInit (Button_TypeDef Button)
Push Button DeInit.
uint32_t | BSP_PB_GetState (Button_TypeDef Button)
Returns the selected button state.

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_audio.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions | Variables
stm32469i_discovery_audio.c File Reference

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

#include <string.h>
#include "stm32469i_discovery_audio.h"

Go to the source code of this file.

Defines

#define | OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
#define | OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER
#define | SAIClockDivider(__FREQUENCY__)

Functions

static uint8_t | 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 ChnlNbrIn, uint32_t ChnlNbrOut)
Initializes the PDM library.
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption)
Changes the Audio Out Configuration.
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 being 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 BSP_AUDIO_OUT 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_ClockConfig (I2S_HandleTypeDef *hi2s, void *Params)
Clock Config.
__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)
BSP AUDIO IN MSP Init.
__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
PDM_Filter_Handler_t | PDM_FilterHandler [2]
PDM_Filter_Config_t | PDM_FilterConfig [2]
uint8_t | Channel_Demux [128]
uint16_t __IO | AudioInVolume = DEFAULT_AUDIO_IN_VOLUME

Detailed Description

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

Author:
MCD Application Team
Version:
V2.0.0
Date:
27-January-2017
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_audio.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_audio.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions | Variables
stm32469i_discovery_audio.h File Reference

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

#include <stdlib.h>
#include "../Components/cs43l22/cs43l22.h"
#include "stm32469i_discovery.h"
#include "../../../Middlewares/ST/STM32_Audio/Addons/PDM/Inc/pdm2pcm_glo.h"

Go to the source code of this file.

Defines

#define | BSP_AUDIO_OUT_CIRCULARMODE ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */
#define | BSP_AUDIO_OUT_NORMALMODE ((uint32_t)0x00000002) /* BUFFER NORMAL MODE */
#define | BSP_AUDIO_OUT_STEREOMODE ((uint32_t)0x00000004) /* STEREO MODE */
#define | BSP_AUDIO_OUT_MONOMODE ((uint32_t)0x00000008) /* MONO MODE */
#define | CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
#define | CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
#define | CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
#define | AUDIO_SAIx SAI1_Block_A
#define | AUDIO_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_SAIx_MCLK_SCK_SD_FS_AF GPIO_AF6_SAI1
#define | AUDIO_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | AUDIO_SAIx_MCLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | AUDIO_SAIx_MCK_PIN GPIO_PIN_7
#define | AUDIO_SAIx_MCLK_GPIO_PORT GPIOG
#define | AUDIO_SAIx_SCK_SD_FS_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_SCK_SD_FS_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_SAIx_FS_PIN GPIO_PIN_4
#define | AUDIO_SAIx_SCK_PIN GPIO_PIN_5
#define | AUDIO_SAIx_SD_PIN GPIO_PIN_6
#define | AUDIO_SAIx_SCK_SD_FS_GPIO_PORT GPIOE
#define | AUDIO_RESET_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_RESET_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_RESET_PIN GPIO_PIN_2
#define | AUDIO_RESET_GPIO_PORT GPIOE
#define | AUDIO_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define | AUDIO_SAIx_DMAx_CLK_DISABLE() __HAL_RCC_DMA2_CLK_DISABLE()
#define | AUDIO_SAIx_DMAx_STREAM DMA2_Stream3
#define | AUDIO_SAIx_DMAx_CHANNEL DMA_CHANNEL_0
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Stream3_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_Stream3_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_SAIx_PLL_DISABLE() HAL_RCCEx_DisablePLLSAI1()
#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_I2S3ext
#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)6) /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_TIMx_CLK_ENABLE() __HAL_RCC_TIM4_CLK_ENABLE()
#define | AUDIO_TIMx_CLK_DISABLE() __HAL_RCC_TIM4_CLK_DISABLE()
#define | AUDIO_TIMx TIM4
#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_GPIOD_CLK_ENABLE()
#define | AUDIO_TIMx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | AUDIO_TIMx_GPIO_PORT GPIOD
#define | AUDIO_TIMx_IN_GPIO_PIN GPIO_PIN_12
#define | AUDIO_TIMx_OUT_GPIO_PIN GPIO_PIN_13
#define | AUDIO_TIMx_AF GPIO_AF2_TIM4
#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*DEFAULT_AUDIO_IN_CHANNEL_NBR)
#define | CHANNEL_DEMUX_MASK ((uint8_t)0x55)
#define | CODEC_RESET_DELAY ((uint8_t)5)
#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 being 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 BSP_AUDIO_OUT 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_ClockConfig (I2S_HandleTypeDef *hi2s, void *Params)
Clock Config.
void | BSP_AUDIO_IN_MspInit (I2S_HandleTypeDef *hi2s, void *Params)
BSP AUDIO IN MSP Init.
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 stm32469i_discovery_audio.c driver.

Author:
MCD Application Team
Version:
V2.0.0
Date:
27-January-2017
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_audio.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_eeprom.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Functions | Variables
stm32469i_discovery_eeprom.c File Reference

This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory. To be able to use this driver, the switch EE_M24LR64 must be defined in your toolchain compiler preprocessor. More...

#include "stm32469i_discovery_eeprom.h"

Go to the source code of this file.

Functions

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

Variables

__IO uint16_t | EEPROMAddress = 0
__IO uint32_t | EEPROMTimeout = EEPROM_READ_TIMEOUT
__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. To be able to use this driver, the switch EE_M24LR64 must be defined in your toolchain compiler preprocessor.

Author:
MCD Application Team =================================================================== Notes:
  • This driver is intended for STM32F4xx families devices only.
  • The I2C EEPROM memory (M24LR64) is available on separate daughter board ANT7-M24LR-A, which is not provided with the STM32469I-Discovery board. To use this driver you have to connect the ANT7-M24LR-A to CN11 connector of STM32469I-Discovery board. ===================================================================

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

Note:
In this driver, basic read and write functions (BSP_EEPROM_ReadBuffer() and BSP_EEPROM_WritePage()) use DMA mode to perform the data transfer to/from EEPROM memory.
Regarding BSP_EEPROM_WritePage(), it is a 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 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).

+-----------------------------------------------------------------+ | Pin assignment for M24LR64 EEPROM | +---------------------------------------+-----------+-------------+ | STM32F4xx 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) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_eeprom.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_eeprom.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions
stm32469i_discovery_eeprom.h File Reference

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

#include "stm32469i_discovery.h"

Go to the source code of this file.

Defines

#define | EEPROM_PAGESIZE ((uint8_t)4)
#define | EEPROM_MAX_SIZE ((uint16_t)0x2000) /* 64Kbit */
#define | EEPROM_READ_TIMEOUT ((uint32_t)(1000))
#define | EEPROM_WRITE_TIMEOUT ((uint32_t)(10))
#define | EEPROM_MAX_TRIALS 3000
#define | EEPROM_OK 0
#define | EEPROM_FAIL 1
#define | EEPROM_TIMEOUT 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 stm32469i_discovery_eeprom.c firmware driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_eeprom.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_lcd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions | Variables
stm32469i_discovery_lcd.c File Reference

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

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

Go to the source code of this file.

Defines

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

Functions

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

Variables

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

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_lcd.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_lcd.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
stm32469i_discovery_lcd.h File Reference

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

#include "../Components/otm8009a/otm8009a.h"
#include "../Components/nt35510/nt35510.h"
#include "stm32469i_discovery_sdram.h"
#include "stm32469i_discovery.h"
#include "../../../Utilities/Fonts/fonts.h"
#include <string.h>

Go to the source code of this file.

Data Structures

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

Defines

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

Typedefs

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

Enumerations

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

Functions

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

Variables

DMA2D_HandleTypeDef | hdma2d_eval

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_lcd.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_qspi.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Functions | Variables
stm32469i_discovery_qspi.c File Reference

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

#include "stm32469i_discovery_qspi.h"

Go to the source code of this file.

Functions

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

Variables

QSPI_HandleTypeDef | QSPIHandle

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

  ==============================================================================
                     ##### How to use this driver #####
  ==============================================================================
  [..]
   (#) This driver is used to drive the N25Q128A QSPI external
       memory mounted on STM32469I-Discovery board.

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

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

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

Definition in file stm32469i_discovery_qspi.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_qspi.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Data Structures | Defines | Functions
stm32469i_discovery_qspi.h File Reference

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

#include "stm32f4xx_hal.h"
#include "../Components/n25q128a/n25q128a.h"

Go to the source code of this file.

Data Structures

struct | QSPI_InfoTypeDef
QSPI Info. More...

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_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | QSPI_DX_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | QSPI_DX_CLK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#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_10
#define | QSPI_CLK_GPIO_PORT GPIOF
#define | QSPI_D0_PIN GPIO_PIN_8
#define | QSPI_D1_PIN GPIO_PIN_9
#define | QSPI_D2_PIN GPIO_PIN_7
#define | QSPI_D3_PIN GPIO_PIN_6
#define | QSPI_DX_GPIO_PORT GPIOF
#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_InfoTypeDef *pInfo)
Reads the configuration of the memory and fills QspiInfo struct.
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 stm32469i_discovery_qspi.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_qspi.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Functions | Variables
stm32469i_discovery_sd.c File Reference

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

#include "stm32469i_discovery_sd.h"

Go to the source code of this file.

Functions

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

Variables

SD_HandleTypeDef | uSdHandle

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_sd.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sd.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions
stm32469i_discovery_sd.h File Reference

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

#include "stm32469i_discovery.h"

Go to the source code of this file.

Defines

#define | BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.
#define | MSD_OK ((uint8_t)0x00)
SD status structure definition.
#define | MSD_ERROR ((uint8_t)0x01)
#define | MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)
#define | SD_TRANSFER_OK ((uint8_t)0x00)
SD transfer state definition.
#define | SD_TRANSFER_BUSY ((uint8_t)0x01)
#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SD_DATATIMEOUT ((uint32_t)100000000)
#define | __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_Tx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Rx_CHANNEL DMA_CHANNEL_4
#define | SD_DMAx_Tx_STREAM DMA2_Stream6
#define | SD_DMAx_Rx_STREAM DMA2_Stream3
#define | SD_DMAx_Tx_IRQn DMA2_Stream6_IRQn
#define | SD_DMAx_Rx_IRQn DMA2_Stream3_IRQn
#define | BSP_SD_IRQHandler SDIO_IRQHandler
#define | BSP_SD_DMA_Tx_IRQHandler DMA2_Stream6_IRQHandler
#define | BSP_SD_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.
uint8_t | BSP_SD_ReadBlocks (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_WriteBlocks (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
void | BSP_SD_Detect_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin 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 stm32469i_discovery_sd.c driver.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_sd.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sdram.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Functions | Variables
stm32469i_discovery_sdram.c File Reference

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

#include "stm32469i_discovery_sdram.h"

Go to the source code of this file.

Functions

uint8_t | BSP_SDRAM_Init (void)
Initializes the SDRAM device.
uint8_t | BSP_SDRAM_DeInit (void)
DeInitializes the SDRAM device.
void | BSP_SDRAM_Initialization_sequence (uint32_t RefreshCount)
Programs the SDRAM device.
uint8_t | BSP_SDRAM_ReadData (uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
Reads an mount 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 mount 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 mount 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 mount 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_DMA_IRQHandler (void)
Handles SDRAM DMA transfer interrupt request.
__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

static 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 STM32469I-Discovery board.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_sdram.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sdram.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Defines | Functions
stm32469i_discovery_sdram.h File Reference

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

#include "stm32f4xx_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)0x1000000)
#define | SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
#define | SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
#define | REFRESH_COUNT ((uint32_t)0x0569)
#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 | SDRAM_DMAx_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 mount 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 mount 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 mount 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 mount 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_DMA_IRQHandler (void)
Handles SDRAM DMA transfer interrupt request.
__weak void | BSP_SDRAM_MspInit (SDRAM_HandleTypeDef *hsdram, void *Params)
Initializes SDRAM MSP.
__weak void | BSP_SDRAM_MspDeInit (SDRAM_HandleTypeDef *hsdram, void *Params)
DeInitializes SDRAM MSP.

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_sdram.h.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_ts.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Functions | Variables
stm32469i_discovery_ts.c File Reference

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

#include "stm32469i_discovery_ts.h"

Go to the source code of this file.

Functions

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

Variables

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

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_ts.c.


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_ts.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
Data Structures | Defines | Enumerations | Functions | Variables
stm32469i_discovery_ts.h File Reference

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

#include "stm32469i_discovery.h"
#include "stm32469i_discovery_lcd.h"
#include "../Components/ft6x06/ft6x06.h"

Go to the source code of this file.

Data Structures

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

Defines

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

Enumerations

enum | TS_StatusTypeDef { TS_OK = 0x00, TS_ERROR = 0x01, TS_TIMEOUT = 0x02, TS_DEVICE_NOT_FOUND = 0x03 }
TS_StatusTypeDef Define BSP_TS_xxx() functions possible return value, when status is returned by those functions. More...
enum TS_GestureIdTypeDef {
GEST_ID_NO_GESTURE = 0x00, GEST_ID_MOVE_UP = 0x01, GEST_ID_MOVE_RIGHT = 0x02, GEST_ID_MOVE_DOWN = 0x03,
GEST_ID_MOVE_LEFT = 0x04, GEST_ID_ZOOM_IN = 0x05, GEST_ID_ZOOM_OUT = 0x06, GEST_ID_NB_MAX = 0x07
}
TS_GestureIdTypeDef Define Possible managed gesture identification values returned by touch screen driver. More...
enum TS_TouchEventTypeDef {
TOUCH_EVENT_NO_EVT = 0x00, TOUCH_EVENT_PRESS_DOWN = 0x01, TOUCH_EVENT_LIFT_UP = 0x02, TOUCH_EVENT_CONTACT = 0x03,
TOUCH_EVENT_NB_MAX = 0x04
}
TS_TouchEventTypeDef Define Possible touch events kind as returned values by touch screen IC Driver. More...

Functions

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

Variables

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

Detailed Description

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

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32469i_discovery_ts.h.


./STM32469I-Discovery BSP User Manual: Data Structures

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


./STM32469I-Discovery BSP User Manual: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
L | P | Q | T
L
P
Q
T
LCD_DrawPropTypeDef Point QSPI_InfoTypeDef TS_StateTypeDef
L | P | Q | T


./STM32469I-Discovery BSP User Manual: C:/git/f4_master/Firmware/Drivers/BSP/STM32469I-Discovery/ Directory Reference

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

Files

file | stm32469i_discovery.c [code]

This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, RF EEPROM, available on STM32469I-Discovery board (MB1189) RevA/B/C from STMicroelectronics.

file | stm32469i_discovery.h [code]

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

file | stm32469i_discovery_audio.c [code]

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

file | stm32469i_discovery_audio.h [code]

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

file | stm32469i_discovery_eeprom.c [code]

This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory. To be able to use this driver, the switch EE_M24LR64 must be defined in your toolchain compiler preprocessor.

file | stm32469i_discovery_eeprom.h [code]

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

file | stm32469i_discovery_lcd.c [code]

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

file | stm32469i_discovery_lcd.h [code]

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

file | stm32469i_discovery_qspi.c [code]

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

file | stm32469i_discovery_qspi.h [code]

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

file | stm32469i_discovery_sd.c [code]

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

file | stm32469i_discovery_sd.h [code]

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

file | stm32469i_discovery_sdram.c [code]

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

file | stm32469i_discovery_sdram.h [code]

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

file | stm32469i_discovery_ts.c [code]

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

file | stm32469i_discovery_ts.h [code]

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


./STM32469I-Discovery BSP User Manual: C:/git/f4_master/Firmware/Drivers/ Directory Reference

  • Firmware
  • Drivers
Drivers Directory Reference

Directories

directory BSP


./STM32469I-Discovery BSP User Manual: C:/git/f4_master/Firmware/Drivers/BSP/ Directory Reference

  • Firmware
  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32469I-Discovery


./STM32469I-Discovery BSP User Manual: C:/git/f4_master/Firmware/ Directory Reference

  • Firmware
Firmware Directory Reference

Directories

directory Drivers


./STM32469I-Discovery BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Firmware
    • Drivers
      • BSP
        • STM32469I-Discovery


./STM32469I-Discovery BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32469i_discovery.c [code] | This file provides a set of firmware functions to manage LEDs, push-buttons, external SDRAM, external QSPI Flash, RF EEPROM, available on STM32469I-Discovery board (MB1189) RevA/B/C from STMicroelectronics
stm32469i_discovery.h [code] | This file contains definitions for STM32469I-Discovery LEDs, push-buttons hardware resources
stm32469i_discovery_audio.c [code] | This file provides the Audio driver for the STM32469I-Discovery board
stm32469i_discovery_audio.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_audio.c driver
stm32469i_discovery_eeprom.c [code] | This file provides a set of functions needed to manage an I2C M24LR64 EEPROM memory. To be able to use this driver, the switch EE_M24LR64 must be defined in your toolchain compiler preprocessor
stm32469i_discovery_eeprom.h [code] | This file contains all the functions prototypes for the stm32469i_discovery_eeprom.c firmware driver
stm32469i_discovery_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32469I-Discovery evaluation board
stm32469i_discovery_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_lcd.c driver
stm32469i_discovery_qspi.c [code] | This file includes a standard driver for the N25Q128A QSPI memory mounted on STM32469I-Discovery board
stm32469i_discovery_qspi.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_qspi.c driver
stm32469i_discovery_sd.c [code] | This file includes the uSD card driver mounted on STM32469I-Discovery board
stm32469i_discovery_sd.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_sd.c driver
stm32469i_discovery_sdram.c [code] | This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory device mounted on STM32469I-Discovery board
stm32469i_discovery_sdram.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_sdram.c driver
stm32469i_discovery_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32469I-Discovery board
stm32469i_discovery_ts.h [code] | This file contains the common defines and functions prototypes for the stm32469i_discovery_ts.c driver


./STM32469I-Discovery BSP User Manual: BSP

Modules
BSP

Modules

STM32469I Discovery


./STM32469I-Discovery BSP User Manual: STM32469I Discovery AUDIO

Modules
STM32469I Discovery AUDIO
STM32469I Discovery

This file includes the low layer driver for CS43L22 Audio Codec available on STM32469I-Discovery board(MB1189). More...

Modules

STM32469I Discovery AUDIO Private Types
STM32469I Discovery AUDIO Private Defines

Headphone1 (CN27 of STM32469I-Discovery board) is connected to the HEADPHONE output of CS43L22 Audio Codec.

STM32469I Discovery AUDIO Private macros
STM32469I Discovery AUDIO Private Variables
STM32469I Discovery AUDIO Private Prototypes
STM32469I Discovery AUDIO OUT Private Functions
STM32469I Discovery AUDIO IN Private functions
STM32469I Discovery AUDIO Exported Types
STM32469I Discovery AUDIO Exported Constants
STM32469I-Discovery AUDIO Exported Variables
STM32469I-Discovery AUDIO Exported Macros
STM32469I Discovery AUDIO OUT Exported Functions
STM32469I Discovery AUDIO IN Exported Functions

Detailed Description

This file includes the low layer driver for CS43L22 Audio Codec available on STM32469I-Discovery board(MB1189).


./STM32469I-Discovery BSP User Manual: STM32469I Discovery EEPROM

Modules
STM32469I Discovery EEPROM
STM32469I Discovery

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

Modules

STM32469I Discovery EEPROM Private Types
STM32469I Discovery EEPROM Private Defines
STM32469I Discovery EEPROM Private Macros
STM32469I Discovery EEPROM Private Variables
STM32469I Discovery EEPROM Private Prototypes
STM32469I Discovery EEPROM Private Functions
STM32469I Discovery EEPROM Exported Types
STM32469I Discovery EEPROM Exported Constants
STM32469I Discovery EEPROM Exported Macros
STM32469I Discovery EEPROM Exported Functions

Detailed Description

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


./STM32469I-Discovery BSP User Manual: STM32469I Discovery LCD

Modules
STM32469I Discovery LCD
STM32469I Discovery

Modules

STM32469I Discovery LCD Private TypesDefinitions
STM32469I Discovery LCD Private Defines
STM32469I Discovery LCD Private Macros
STM32469I Discovery LCD Exported Variables
STM32469I Discovery LCD Private Variables
STM32469I Discovery LCD Private FunctionPrototypes
STM32469I Discovery LCD Exported Functions
STM32469I Discovery LCD Exported Constants
STM32469I Discovery LCD Exported Types
STM32469I Discovery LCD Exported Macro
STM32469I EVAL LCD Exported Variables


./STM32469I-Discovery BSP User Manual: STM32469I Discovery SDRAM

Modules
STM32469I Discovery SDRAM
STM32469I Discovery

Modules

STM32469I Discovery SDRAM Private TypesDef
STM32469I Discovery SDRAM Private Defines
STM32469I Discovery SDRAM Private Macros
STM32469I Discovery SDRAM Private Variables
STM32469I Discovery SDRAM Private Prototypes
STM32469I Discovery SDRAM Private Functions
STM32469I Discovery SDRAM Exported Functions
STM32469I Discovery SDRAM Exported Types
STM32469I Discovery SDRAM Exported Constants
STM32469I Discovery SDRAM Exported Macro


./STM32469I-Discovery BSP User Manual: STM32469I Discovery TS

Modules
STM32469I Discovery TS
STM32469I Discovery

Modules

STM32469I Discovery TS Private Types Definitions
STM32469I Discovery TS Private Types Defines
STM32469I Discovery TS Private Macros
STM32469I Discovery TS Imported Variables
STM32469I Discovery TS Private Variables
STM32469I Discovery TS Private Function Prototypes
STM32469I Discovery TS Public Functions
STM32469I Discovery TS Exported Constants
STM32469I Discovery TS Exported Types
STM32469I Discovery TS Exported Functions


./STM32469I-Discovery BSP User Manual: STM32469I Discovery

Modules
STM32469I Discovery
BSP

Modules

STM32469I Discovery LOW LEVEL
STM32469I Discovery AUDIO

This file includes the low layer driver for CS43L22 Audio Codec available on STM32469I-Discovery board(MB1189).

STM32469I Discovery EEPROM

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

STM32469I Discovery LCD
STM32469I Discovery QSPI
STM32469I Discovery SD
STM32469I Discovery SDRAM
STM32469I Discovery TS


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI

Modules
STM32469I Discovery QSPI
STM32469I Discovery

Modules

STM32469I Discovery QSPI Private Variables
STM32469I Discovery QSPI Private Functions
STM32469I Discovery QSPI Exported Functions
STM32469I Discovery QSPI Exported Constants
STM32469I Discovery QSPI Exported Types


./STM32469I-Discovery BSP User Manual: STM32469I Discovery QSPI Exported Types

Data Structures
STM32469I Discovery QSPI Exported Types
STM32469I Discovery QSPI

Data Structures

struct QSPI_InfoTypeDef
QSPI Info. More...


./STM32469I-Discovery BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • STM32469I Discovery
      • STM32469I Discovery LOW LEVEL
        • STM32469I Discovery LOW LEVEL Private TypesDefinitions
        • STM32469I Discovery LOW LEVEL Private Defines
        • STM32469I Discovery LOW LEVEL Private Macros
        • STM32469I Discovery LOW LEVEL Private Variables
        • STM32469I Discovery LOW LEVEL Private FunctionPrototypes
        • STM32469I Discovery BSP Public Functions
        • STM32469I Discovery LOW LEVEL Private Functions
        • STM32469I Discovery LOW LEVEL Exported Types
          • Exported_types
        • STM32469I Discovery LOW LEVEL Exported Constants
          • STM32469I Discovery LOW LEVEL LED
          • STM32469I Discovery LOW LEVEL BUTTON
        • STM32469I Discovery LOW LEVEL Exported Macros
        • STM32469I Discovery LOW LEVEL Exported Functions
      • STM32469I Discovery AUDIO
        • STM32469I Discovery AUDIO Private Types
        • STM32469I Discovery AUDIO Private Defines
        • STM32469I Discovery AUDIO Private macros
        • STM32469I Discovery AUDIO Private Variables
        • STM32469I Discovery AUDIO Private Prototypes
        • STM32469I Discovery AUDIO OUT Private Functions
        • STM32469I Discovery AUDIO IN Private functions
        • STM32469I Discovery AUDIO Exported Types
        • STM32469I Discovery AUDIO Exported Constants
          • BSP AUDIO OUT Option
          • STM32469I Discovery Audio Slot TDM mode
        • STM32469I-Discovery AUDIO Exported Variables
        • STM32469I-Discovery AUDIO Exported Macros
        • STM32469I Discovery AUDIO OUT Exported Functions
        • STM32469I Discovery AUDIO IN Exported Functions
      • STM32469I Discovery EEPROM
        • STM32469I Discovery EEPROM Private Types
        • STM32469I Discovery EEPROM Private Defines
        • STM32469I Discovery EEPROM Private Macros
        • STM32469I Discovery EEPROM Private Variables
        • STM32469I Discovery EEPROM Private Prototypes
        • STM32469I Discovery EEPROM Private Functions
        • STM32469I Discovery EEPROM Exported Types
        • STM32469I Discovery EEPROM Exported Constants
        • STM32469I Discovery EEPROM Exported Macros
        • STM32469I Discovery EEPROM Exported Functions
      • STM32469I Discovery LCD
        • STM32469I Discovery LCD Private TypesDefinitions
        • STM32469I Discovery LCD Private Defines
        • STM32469I Discovery LCD Private Macros
        • STM32469I Discovery LCD Exported Variables
        • STM32469I Discovery LCD Private Variables
        • STM32469I Discovery LCD Private FunctionPrototypes
        • STM32469I Discovery LCD Exported Functions
        • STM32469I Discovery LCD Exported Constants
        • STM32469I Discovery LCD Exported Types
        • STM32469I Discovery LCD Exported Macro
        • STM32469I EVAL LCD Exported Variables
      • STM32469I Discovery QSPI
        • STM32469I Discovery QSPI Private Variables
        • STM32469I Discovery QSPI Private Functions
        • STM32469I Discovery QSPI Exported Functions
        • STM32469I Discovery QSPI Exported Constants
        • STM32469I Discovery QSPI Exported Types
      • STM32469I Discovery SD
        • STM32469I Discovery SD Private TypesDef
        • STM32469I Discovery SD Private Defines
        • STM32469I Discovery SD Private Macro
        • STM32469I Discovery SD Private Variables
        • STM32469I Discovery SD Private Prototypes
        • STM32469I Discovery SD Private Functions
        • STM32469I Discovery SD Exported Types
        • STM32469I Discovery SD Exported Constants
        • STM32469I Discovery SD Exported Macro
        • STM32469I Discovery SD Exported Functions
      • STM32469I Discovery SDRAM
        • STM32469I Discovery SDRAM Private TypesDef
        • STM32469I Discovery SDRAM Private Defines
        • STM32469I Discovery SDRAM Private Macros
        • STM32469I Discovery SDRAM Private Variables
        • STM32469I Discovery SDRAM Private Prototypes
        • STM32469I Discovery SDRAM Private Functions
        • STM32469I Discovery SDRAM Exported Functions
        • STM32469I Discovery SDRAM Exported Types
        • STM32469I Discovery SDRAM Exported Constants
        • STM32469I Discovery SDRAM Exported Macro
      • STM32469I Discovery TS
        • STM32469I Discovery TS Private Types Definitions
        • STM32469I Discovery TS Private Types Defines
        • STM32469I Discovery TS Private Macros
        • STM32469I Discovery TS Imported Variables
        • STM32469I Discovery TS Private Variables
        • STM32469I Discovery TS Private Function Prototypes
        • STM32469I Discovery TS Public Functions
        • STM32469I Discovery TS Exported Constants
        • STM32469I Discovery TS Exported Types
        • STM32469I Discovery TS Exported Functions


./STM32469I-Discovery BSP User Manual: stm32469i_discovery.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to manage LEDs,
00006   *          push-buttons, external SDRAM, external QSPI Flash, RF EEPROM,
00007   *          available on STM32469I-Discovery
00008   *          board (MB1189) RevA/B/C from STMicroelectronics.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * Copyright (c) 2017 STMicroelectronics.
00013   * All rights reserved.
00014   *
00015   * This software is licensed under terms that can be found in the LICENSE file
00016   * in the root directory of this software component.
00017   * If no LICENSE file comes with this software, it is provided AS-IS.
00018   *
00019   ******************************************************************************
00020   */
00021
00022 /* Includes ------------------------------------------------------------------*/
00023 #include "stm32469i_discovery.h"
00024
00025 /** @defgroup BSP BSP
00026   * @{
00027   */
00028
00029 /** @defgroup STM32469I_Discovery STM32469I Discovery
00030   * @{
00031   */
00032
00033 /** @defgroup STM32469I_Discovery_LOW_LEVEL STM32469I Discovery LOW LEVEL
00034   * @{
00035   */
00036
00037 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_TypesDefinitions STM32469I Discovery LOW LEVEL Private TypesDefinitions
00038   * @{
00039   */
00040 /**
00041   * @}
00042   */
00043
00044 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_Defines STM32469I Discovery LOW LEVEL Private Defines
00045   * @{
00046   */
00047 /**
00048  * @brief STM32469I Discovery BSP Driver version number V2.1.1
00049    */
00050 #define __STM32469I_DISCOVERY_BSP_VERSION_MAIN   (0x02) /*!< [31:24] main version */
00051 #define __STM32469I_DISCOVERY_BSP_VERSION_SUB1   (0x01) /*!< [23:16] sub1 version */
00052 #define __STM32469I_DISCOVERY_BSP_VERSION_SUB2   (0x01) /*!< [15:8]  sub2 version */
00053 #define __STM32469I_DISCOVERY_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00054 #define __STM32469I_DISCOVERY_BSP_VERSION        ((__STM32469I_DISCOVERY_BSP_VERSION_MAIN << 24)\
00055                                                  |(__STM32469I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
00056                                                  |(__STM32469I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
00057                                                  |(__STM32469I_DISCOVERY_BSP_VERSION_RC))
00058 /**
00059   * @}
00060   */
00061
00062 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_Macros  STM32469I Discovery LOW LEVEL Private Macros
00063   * @{
00064   */
00065 /**
00066   * @}
00067   */
00068
00069 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_Variables STM32469I Discovery LOW LEVEL Private Variables
00070   * @{
00071   */
00072 uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
00073                            LED2_PIN,
00074                            LED3_PIN,
00075                            LED4_PIN};
00076
00077 GPIO_TypeDef* GPIO_PORT[LEDn] = {LED1_GPIO_PORT,
00078                                  LED2_GPIO_PORT,
00079                                  LED3_GPIO_PORT,
00080                                  LED4_GPIO_PORT};
00081
00082 GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT };
00083
00084 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN };
00085
00086 const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn };
00087
00088
00089 static I2C_HandleTypeDef heval_I2c1;
00090 static I2C_HandleTypeDef heval_I2c2;
00091
00092 /**
00093   * @}
00094   */
00095
00096 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_FunctionPrototypes STM32469I Discovery LOW LEVEL Private FunctionPrototypes
00097   * @{
00098   */
00099 static void            I2C1_MspInit(void);
00100 static void            I2C2_MspInit(void);
00101 static void            I2C1_Init(void);
00102 static void            I2C2_Init(void);
00103
00104 #if defined(USE_IOEXPANDER)
00105 static void            I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00106 static uint8_t       I2C1_Read(uint8_t Addr, uint8_t Reg);
00107 #endif /* USE_IOEXPANDER */
00108 static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00109 static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00110 static HAL_StatusTypeDef I2C1_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00111 static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00112 static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00113 static void              I2C1_Error(uint8_t Addr);
00114 static void              I2C2_Error(uint8_t Addr);
00115
00116 /* AUDIO IO functions */
00117 void              AUDIO_IO_Init(void);
00118 void              AUDIO_IO_DeInit(void);
00119 void              AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00120 uint8_t           AUDIO_IO_Read(uint8_t Addr, uint8_t Reg);
00121 void              AUDIO_IO_Delay(uint32_t Delay);
00122
00123
00124 /* I2C EEPROM IO function */
00125 void                EEPROM_IO_Init(void);
00126 HAL_StatusTypeDef   EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00127 HAL_StatusTypeDef   EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
00128 HAL_StatusTypeDef   EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00129
00130 /* TouchScreen (TS) IO functions */
00131 void    TS_IO_Init(void);
00132 void    TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00133 uint8_t  TS_IO_Read(uint8_t Addr, uint8_t Reg);
00134 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00135 void    TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00136 void    TS_IO_Delay(uint32_t Delay);
00137 void     OTM8009A_IO_Delay(uint32_t Delay);
00138 void     NT35510_IO_Delay(uint32_t Delay);
00139 /**
00140   * @}
00141   */
00142
00143 /** @defgroup STM32469I_Discovery_BSP_Public_Functions STM32469I Discovery BSP Public Functions
00144   * @{
00145   */
00146
00147   /**
00148   * @brief  This method returns the STM32469I Discovery BSP Driver revision
00149   * @retval version: 0xXYZR (8bits for each decimal, R for RC)
00150   */
00151 uint32_t BSP_GetVersion(void)
00152 {
00153   return __STM32469I_DISCOVERY_BSP_VERSION;
00154 }
00155
00156 /**
00157   * @brief  Configures LED GPIO.
00158   * @param  Led: LED to be configured.
00159   *          This parameter can be one of the following values:
00160   *            @arg  LED1
00161   *            @arg  LED2
00162   *            @arg  LED3
00163   *            @arg  LED4
00164   */
00165 void BSP_LED_Init(Led_TypeDef Led)
00166 {
00167   GPIO_InitTypeDef  gpio_init_structure;
00168
00169   if (Led <= LED4)
00170   {
00171     /* Configure the GPIO_LED pin */
00172     gpio_init_structure.Pin   = GPIO_PIN[Led];
00173     gpio_init_structure.Mode  = GPIO_MODE_OUTPUT_PP;
00174     gpio_init_structure.Pull  = GPIO_PULLUP;
00175     gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00176
00177     switch(Led)
00178     {
00179     case LED1 :
00180       LED1_GPIO_CLK_ENABLE();
00181       break;
00182     case LED2 :
00183       LED2_GPIO_CLK_ENABLE();
00184       break;
00185     case LED3 :
00186       LED3_GPIO_CLK_ENABLE();
00187       break;
00188     case LED4 :
00189       LED4_GPIO_CLK_ENABLE();
00190       break;
00191     default :
00192       break;
00193
00194     } /* end switch */
00195
00196     HAL_GPIO_Init(GPIO_PORT[Led], &gpio_init_structure);
00197
00198     /* By default, turn off LED by setting a high level on corresponding GPIO */
00199     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
00200
00201   } /* of if (Led <= LED4) */
00202
00203 }
00204
00205
00206 /**
00207   * @brief  DeInit LEDs.
00208   * @param  Led: LED to be configured.
00209   *          This parameter can be one of the following values:
00210   *            @arg  LED1
00211   *            @arg  LED2
00212   *            @arg  LED3
00213   *            @arg  LED4
00214   * @note Led DeInit does not disable the GPIO clock nor disable the Mfx
00215   */
00216 void BSP_LED_DeInit(Led_TypeDef Led)
00217 {
00218   GPIO_InitTypeDef  gpio_init_structure;
00219
00220   if (Led <= LED4)
00221   {
00222     /* DeInit the GPIO_LED pin */
00223     gpio_init_structure.Pin = GPIO_PIN[Led];
00224
00225     /* Turn off LED */
00226     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
00227     HAL_GPIO_DeInit(GPIO_PORT[Led], gpio_init_structure.Pin);
00228   }
00229
00230 }
00231
00232 /**
00233   * @brief  Turns selected LED On.
00234   * @param  Led: LED to be set on
00235   *          This parameter can be one of the following values:
00236   *            @arg  LED1
00237   *            @arg  LED2
00238   *            @arg  LED3
00239   *            @arg  LED4
00240   */
00241 void BSP_LED_On(Led_TypeDef Led)
00242 {
00243   if (Led <= LED4)
00244   {
00245      HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_RESET);
00246   }
00247
00248 }
00249
00250 /**
00251   * @brief  Turns selected LED Off.
00252   * @param  Led: LED to be set off
00253   *          This parameter can be one of the following values:
00254   *            @arg  LED1
00255   *            @arg  LED2
00256   *            @arg  LED3
00257   *            @arg  LED4
00258   */
00259 void BSP_LED_Off(Led_TypeDef Led)
00260 {
00261   if (Led <= LED4)
00262   {
00263     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
00264   }
00265 }
00266
00267 /**
00268   * @brief  Toggles the selected LED.
00269   * @param  Led: LED to be toggled
00270   *          This parameter can be one of the following values:
00271   *            @arg  LED1
00272   *            @arg  LED2
00273   *            @arg  LED3
00274   *            @arg  LED4
00275   */
00276 void BSP_LED_Toggle(Led_TypeDef Led)
00277 {
00278   if (Led <= LED4)
00279   {
00280      HAL_GPIO_TogglePin(GPIO_PORT[Led], GPIO_PIN[Led]);
00281   }
00282 }
00283
00284 /**
00285   * @brief  Configures button GPIO and EXTI Line.
00286   * @param  Button: Button to be configured
00287   *          This parameter can be one of the following values:
00288   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00289   *            @arg  BUTTON_USER: User Push Button
00290   * @param  Button_Mode: Button mode
00291   *          This parameter can be one of the following values:
00292   *            @arg  BUTTON_MODE_GPIO: Button will be used as simple IO
00293   *            @arg  BUTTON_MODE_EXTI: Button will be connected to EXTI line
00294   *                                    with interrupt generation capability
00295   */
00296 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
00297 {
00298   GPIO_InitTypeDef gpio_init_structure;
00299
00300   /* Enable the BUTTON clock */
00301   BUTTON_GPIO_CLK_ENABLE();
00302
00303   if(Button_Mode == BUTTON_MODE_GPIO)
00304   {
00305     /* Configure Button pin as input */
00306     gpio_init_structure.Pin = BUTTON_PIN[Button];
00307     gpio_init_structure.Mode = GPIO_MODE_INPUT;
00308     gpio_init_structure.Pull = GPIO_NOPULL;
00309     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00310     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00311   }
00312
00313   if(Button_Mode == BUTTON_MODE_EXTI)
00314   {
00315     /* Configure Button pin as input with External interrupt */
00316     gpio_init_structure.Pin = BUTTON_PIN[Button];
00317     gpio_init_structure.Pull = GPIO_NOPULL;
00318     gpio_init_structure.Speed = GPIO_SPEED_FAST;
00319
00320     gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
00321
00322     HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
00323
00324     /* Enable and set Button EXTI Interrupt to the lowest priority */
00325     HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
00326     HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00327   }
00328 }
00329
00330 /**
00331   * @brief  Push Button DeInit.
00332   * @param  Button: Button to be configured
00333   *          This parameter can be one of the following values:
00334   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00335   *            @arg  BUTTON_USER: User Push Button
00336   * @note PB DeInit does not disable the GPIO clock
00337   */
00338 void BSP_PB_DeInit(Button_TypeDef Button)
00339 {
00340     GPIO_InitTypeDef gpio_init_structure;
00341
00342     gpio_init_structure.Pin = BUTTON_PIN[Button];
00343     HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
00344     HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
00345 }
00346
00347
00348 /**
00349   * @brief  Returns the selected button state.
00350   * @param  Button: Button to be checked
00351   *          This parameter can be one of the following values:
00352   *            @arg  BUTTON_WAKEUP: Wakeup Push Button
00353   *            @arg  BUTTON_USER: User Push Button
00354   * @retval The Button GPIO pin value
00355   */
00356 uint32_t BSP_PB_GetState(Button_TypeDef Button)
00357 {
00358   return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
00359 }
00360
00361 /**
00362   * @}
00363   */
00364
00365 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Private_Functions STM32469I Discovery LOW LEVEL Private Functions
00366   * @{
00367   */
00368
00369
00370 /*******************************************************************************
00371                             BUS OPERATIONS
00372 *******************************************************************************/
00373
00374 /******************************* I2C Routines *********************************/
00375 /**
00376   * @brief  Initializes I2C MSP.
00377   */
00378 static void I2C1_MspInit(void)
00379 {
00380   GPIO_InitTypeDef  gpio_init_structure;
00381
00382   /*** Configure the GPIOs ***/
00383   /* Enable GPIO clock */
00384   DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE();
00385
00386 #if defined(USE_STM32469I_DISCO_REVC)
00387   /* Perform 10 pulses on SCL to unlock I2C devices if previous I2C transaction aborted.*/
00388   /* This configuration is needed with STM32F469i Disco RevC when using touch screen controller FT6336U */
00389   gpio_init_structure.Pin = DISCO_I2C1_SCL_PIN;
00390   gpio_init_structure.Mode = GPIO_MODE_OUTPUT_OD;
00391   gpio_init_structure.Pull = GPIO_NOPULL;
00392   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00393   gpio_init_structure.Alternate = 0;
00394   HAL_GPIO_Init( DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure );
00395   for(uint8_t count = 10; count > 0; count-- )
00396   {
00397     HAL_GPIO_WritePin( DISCO_I2C1_SCL_SDA_GPIO_PORT, DISCO_I2C1_SCL_PIN, GPIO_PIN_SET );
00398     HAL_Delay(1);
00399     HAL_GPIO_WritePin( DISCO_I2C1_SCL_SDA_GPIO_PORT, DISCO_I2C1_SCL_PIN, GPIO_PIN_RESET );
00400     HAL_Delay(1);
00401   }
00402 #endif /* USE_STM32469I_DISCO_REVC */
00403
00404   /* Configure I2C Tx as alternate function */
00405   gpio_init_structure.Pin = DISCO_I2C1_SCL_PIN;
00406   gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00407   gpio_init_structure.Pull = GPIO_NOPULL;
00408   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00409   gpio_init_structure.Alternate = DISCO_I2C1_SCL_SDA_AF;
00410   HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00411
00412   /* Configure I2C Rx as alternate function */
00413   gpio_init_structure.Pin = DISCO_I2C1_SDA_PIN;
00414   HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00415
00416   /*** Configure the I2C peripheral ***/
00417   /* Enable I2C clock */
00418   DISCO_I2C1_CLK_ENABLE();
00419
00420   /* Force the I2C peripheral clock reset */
00421   DISCO_I2C1_FORCE_RESET();
00422
00423   /* Release the I2C peripheral clock reset */
00424   DISCO_I2C1_RELEASE_RESET();
00425
00426   /* Enable and set I2C1 Interrupt to a lower priority */
00427   HAL_NVIC_SetPriority(DISCO_I2C1_EV_IRQn, 0x05, 0);
00428   HAL_NVIC_EnableIRQ(DISCO_I2C1_EV_IRQn);
00429
00430   /* Enable and set I2C1 Interrupt to a lower priority */
00431   HAL_NVIC_SetPriority(DISCO_I2C1_ER_IRQn, 0x05, 0);
00432   HAL_NVIC_EnableIRQ(DISCO_I2C1_ER_IRQn);
00433 }
00434
00435 /**
00436   * @brief  Initializes I2C MSP.
00437   */
00438 static void I2C2_MspInit(void)
00439 {
00440   GPIO_InitTypeDef  gpio_init_structure;
00441
00442   /*** Configure the GPIOs ***/
00443   /* Enable GPIO clock */
00444   DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE();
00445
00446   /* Configure I2C Tx as alternate function */
00447   gpio_init_structure.Pin = DISCO_I2C2_SCL_PIN;
00448   gpio_init_structure.Mode = GPIO_MODE_AF_OD;
00449   gpio_init_structure.Pull = GPIO_NOPULL;
00450   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00451   gpio_init_structure.Alternate = DISCO_I2C2_SCL_SDA_AF;
00452   HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00453
00454   /* Configure I2C Rx as alternate function */
00455   gpio_init_structure.Pin = DISCO_I2C2_SDA_PIN;
00456   HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
00457
00458   /*** Configure the I2C peripheral ***/
00459   /* Enable I2C clock */
00460   DISCO_I2C2_CLK_ENABLE();
00461
00462   /* Force the I2C peripheral clock reset */
00463   DISCO_I2C2_FORCE_RESET();
00464
00465   /* Release the I2C peripheral clock reset */
00466   DISCO_I2C2_RELEASE_RESET();
00467
00468   /* Enable and set I2C1 Interrupt to a lower priority */
00469   HAL_NVIC_SetPriority(DISCO_I2C2_EV_IRQn, 0x05, 0);
00470   HAL_NVIC_EnableIRQ(DISCO_I2C2_EV_IRQn);
00471
00472   /* Enable and set I2C1 Interrupt to a lower priority */
00473   HAL_NVIC_SetPriority(DISCO_I2C2_ER_IRQn, 0x05, 0);
00474   HAL_NVIC_EnableIRQ(DISCO_I2C2_ER_IRQn);
00475 }
00476
00477 /**
00478   * @brief  Initializes I2C HAL.
00479   */
00480 static void I2C1_Init(void)
00481 {
00482   if(HAL_I2C_GetState(&heval_I2c1) == HAL_I2C_STATE_RESET)
00483   {
00484     heval_I2c1.Instance = I2C1;
00485     heval_I2c1.Init.ClockSpeed      = I2C1_SCL_FREQ_KHZ;
00486     heval_I2c1.Init.DutyCycle       = I2C_DUTYCYCLE_2;
00487     heval_I2c1.Init.OwnAddress1     = 0;
00488     heval_I2c1.Init.AddressingMode  = I2C_ADDRESSINGMODE_7BIT;
00489     heval_I2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
00490     heval_I2c1.Init.OwnAddress2     = 0;
00491     heval_I2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
00492     heval_I2c1.Init.NoStretchMode   = I2C_NOSTRETCH_DISABLE;
00493
00494     /* Init the I2C */
00495     I2C1_MspInit();
00496     HAL_I2C_Init(&heval_I2c1);
00497   }
00498 }
00499
00500 /**
00501   * @brief  Initializes I2C HAL.
00502   */
00503 static void I2C2_Init(void)
00504 {
00505   if(HAL_I2C_GetState(&heval_I2c2) == HAL_I2C_STATE_RESET)
00506   {
00507     heval_I2c2.Instance = I2C2;
00508     heval_I2c2.Init.ClockSpeed      = I2C2_SCL_FREQ_KHZ;
00509     heval_I2c2.Init.DutyCycle       = I2C_DUTYCYCLE_2;
00510     heval_I2c2.Init.OwnAddress1     = 0;
00511     heval_I2c2.Init.AddressingMode  = I2C_ADDRESSINGMODE_7BIT;
00512     heval_I2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
00513     heval_I2c2.Init.OwnAddress2     = 0;
00514     heval_I2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
00515     heval_I2c2.Init.NoStretchMode   = I2C_NOSTRETCH_DISABLE;
00516
00517     /* Init the I2C */
00518     I2C2_MspInit();
00519     HAL_I2C_Init(&heval_I2c2);
00520   }
00521 }
00522
00523 /**
00524   * @brief  Writes a single data.
00525   * @param  Addr: I2C address
00526   * @param  Reg: Register address
00527   * @param  Value: Data to be written
00528   */
00529 static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00530 {
00531   HAL_StatusTypeDef status = HAL_OK;
00532
00533   status = HAL_I2C_Mem_Write(&heval_I2c1,
00534                          Addr,
00535                          (uint16_t)Reg,
00536                          I2C_MEMADD_SIZE_8BIT,
00537                          &Value,
00538                          1,
00539                          100);
00540
00541   /* Check the communication status */
00542   if(status != HAL_OK)
00543   {
00544     /* Execute user timeout callback */
00545     I2C1_Error(Addr);
00546   }
00547 }
00548
00549 /**
00550   * @brief  Reads a single data.
00551   * @param  Addr: I2C address
00552   * @param  Reg: Register address
00553   * @retval Read data
00554   */
00555 static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg)
00556 {
00557   HAL_StatusTypeDef status = HAL_OK;
00558   uint8_t Value = 0;
00559
00560   status = HAL_I2C_Mem_Read(&heval_I2c1,
00561                         Addr,
00562                         Reg,
00563                         I2C_MEMADD_SIZE_8BIT,
00564                         &Value,
00565                         1,
00566                         1000);
00567
00568   /* Check the communication status */
00569   if(status != HAL_OK)
00570   {
00571     /* Execute user timeout callback */
00572     I2C1_Error(Addr);
00573   }
00574   return Value;
00575 }
00576
00577 /**
00578   * @brief  Reads multiple data.
00579   * @param  Addr: I2C address
00580   * @param  Reg: Reg address
00581   * @param  MemAddress: memory address
00582   * @param  Buffer: Pointer to data buffer
00583   * @param  Length: Length of the data
00584   * @retval HAL status
00585   */
00586 static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr,
00587                                        uint16_t Reg,
00588                                        uint16_t MemAddress,
00589                                        uint8_t *Buffer,
00590                                        uint16_t Length)
00591 {
00592   HAL_StatusTypeDef status = HAL_OK;
00593
00594   status = HAL_I2C_Mem_Read(&heval_I2c1,
00595                         Addr,
00596                         (uint16_t)Reg,
00597                         MemAddress,
00598                         Buffer,
00599                         Length,
00600                         1000);
00601
00602   /* Check the communication status */
00603   if(status != HAL_OK)
00604   {
00605     /* I2C error occured */
00606     I2C1_Error(Addr);
00607   }
00608   return status;
00609 }
00610
00611 static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr,
00612                                        uint16_t Reg,
00613                                        uint16_t MemAddress,
00614                                        uint8_t *Buffer,
00615                                        uint16_t Length)
00616 {
00617   HAL_StatusTypeDef status = HAL_OK;
00618
00619   status = HAL_I2C_Mem_Read(&heval_I2c2,
00620                         Addr,
00621                         (uint16_t)Reg,
00622                         MemAddress,
00623                         Buffer,
00624                         Length,
00625                         1000);
00626
00627   /* Check the communication status */
00628   if(status != HAL_OK)
00629   {
00630     /* I2C2 error occured */
00631     I2C2_Error(Addr);
00632   }
00633   return status;
00634 }
00635
00636 /**
00637   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00638   * @param  Addr: Device address on BUS Bus.
00639   * @param  Reg: The target register address to write
00640   * @param  MemAddress: memory address
00641   * @param  Buffer: The target register value to be written
00642   * @param  Length: buffer size to be written
00643   * @retval HAL status
00644   */
00645 static HAL_StatusTypeDef I2C1_WriteMultiple(uint8_t Addr,
00646                                         uint16_t Reg,
00647                                         uint16_t MemAddress,
00648                                         uint8_t *Buffer,
00649                                         uint16_t Length)
00650 {
00651   HAL_StatusTypeDef status = HAL_OK;
00652
00653   status = HAL_I2C_Mem_Write(&heval_I2c1,
00654                          Addr,
00655                          (uint16_t)Reg,
00656                          MemAddress,
00657                          Buffer,
00658                          Length,
00659                          1000);
00660
00661   /* Check the communication status */
00662   if(status != HAL_OK)
00663   {
00664     /* Re-Initiaize the I2C Bus */
00665     I2C1_Error(Addr);
00666   }
00667   return status;
00668 }
00669
00670 static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr,
00671                                         uint16_t Reg,
00672                                         uint16_t MemAddress,
00673                                         uint8_t *Buffer,
00674                                         uint16_t Length)
00675 {
00676   HAL_StatusTypeDef status = HAL_OK;
00677
00678   status = HAL_I2C_Mem_Write(&heval_I2c2,
00679                          Addr,
00680                          (uint16_t)Reg,
00681                          MemAddress,
00682                          Buffer,
00683                          Length,
00684                          1000);
00685
00686   /* Check the communication status */
00687   if(status != HAL_OK)
00688   {
00689     /* Re-Initiaize the I2C2 Bus */
00690     I2C2_Error(Addr);
00691   }
00692   return status;
00693 }
00694
00695 /**
00696   * @brief  Checks if target device is ready for communication.
00697   * @note   This function is used with Memory devices
00698   * @param  DevAddress: Target device address
00699   * @param  Trials: Number of trials
00700   * @retval HAL status
00701   */
00702 static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00703 {
00704   return (HAL_I2C_IsDeviceReady(&heval_I2c1, DevAddress, Trials, 1000));
00705 }
00706
00707 /**
00708   * @brief  Manages error callback by re-initializing I2C.
00709   * @param  Addr: I2C Address
00710   */
00711 static void I2C1_Error(uint8_t Addr)
00712 {
00713   /* De-initialize the I2C comunication bus */
00714   HAL_I2C_DeInit(&heval_I2c1);
00715
00716   /* Re-Initiaize the I2C comunication bus */
00717   I2C1_Init();
00718 }
00719
00720 static void I2C2_Error(uint8_t Addr)
00721 {
00722   /* De-initialize the I2C2 comunication bus */
00723   HAL_I2C_DeInit(&heval_I2c2);
00724
00725   /* Re-Initiaize the I2C2 comunication bus */
00726   I2C2_Init();
00727 }
00728
00729 /**
00730   * @}
00731   */
00732
00733 /*******************************************************************************
00734                             LINK OPERATIONS
00735 *******************************************************************************/
00736
00737 /********************************* LINK AUDIO *********************************/
00738
00739 /**
00740   * @brief  Initializes Audio low level.
00741   */
00742 void AUDIO_IO_Init(void)
00743 {
00744   I2C2_Init();
00745 }
00746
00747 /**
00748   * @brief  DeInitializes Audio low level.
00749   */
00750 void AUDIO_IO_DeInit(void)
00751 {
00752
00753 }
00754
00755 /**
00756   * @brief  Writes a single data.
00757   * @param  Addr: I2C address
00758   * @param  Reg: Reg address
00759   * @param  Value: Data to be written
00760   */
00761 void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00762 {
00763   I2C2_WriteMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Value, 1);
00764 }
00765
00766 /**
00767   * @brief  Reads a single data.
00768   * @param  Addr: I2C address
00769   * @param  Reg: Reg address
00770   * @retval Data to be read
00771   */
00772 uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
00773 {
00774   uint8_t read_value = 0;
00775
00776   I2C2_ReadMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
00777
00778   return read_value;
00779 }
00780
00781 /**
00782   * @brief  AUDIO Codec delay
00783   * @param  Delay: Delay in ms
00784   */
00785 void AUDIO_IO_Delay(uint32_t Delay)
00786 {
00787   HAL_Delay(Delay);
00788 }
00789
00790 /******************************** LINK I2C EEPROM *****************************/
00791
00792 /**
00793   * @brief  Initializes peripherals used by the I2C EEPROM driver.
00794   */
00795 void EEPROM_IO_Init(void)
00796 {
00797   I2C1_Init();
00798 }
00799
00800 /**
00801   * @brief  Write data to I2C EEPROM driver in using DMA channel.
00802   * @param  DevAddress: Target device address
00803   * @param  MemAddress: Internal memory address
00804   * @param  pBuffer: Pointer to data buffer
00805   * @param  BufferSize: Amount of data to be sent
00806   * @retval HAL status
00807   */
00808 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00809 {
00810   return (I2C1_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00811 }
00812
00813 /**
00814   * @brief  Read data from I2C EEPROM driver in using DMA channel.
00815   * @param  DevAddress: Target device address
00816   * @param  MemAddress: Internal memory address
00817   * @param  pBuffer: Pointer to data buffer
00818   * @param  BufferSize: Amount of data to be read
00819   * @retval HAL status
00820   */
00821 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
00822 {
00823   return (I2C1_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
00824 }
00825
00826 /**
00827   * @brief  Checks if target device is ready for communication.
00828   * @note   This function is used with Memory devices
00829   * @param  DevAddress: Target device address
00830   * @param  Trials: Number of trials
00831   * @retval HAL status
00832   */
00833 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
00834 {
00835   return (I2C1_IsDeviceReady(DevAddress, Trials));
00836 }
00837
00838 /******************************** LINK TS (TouchScreen) ***********************/
00839
00840 /**
00841   * @brief  Initialize I2C communication
00842   *         channel from MCU to TouchScreen (TS).
00843   */
00844 void TS_IO_Init(void)
00845 {
00846   I2C1_Init();
00847 }
00848
00849 /**
00850   * @brief  Writes single data with I2C communication
00851   *         channel from MCU to TouchScreen.
00852   * @param  Addr: I2C address
00853   * @param  Reg: Register address
00854   * @param  Value: Data to be written
00855   */
00856 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
00857 {
00858   I2C1_Write(Addr, Reg, Value);
00859 }
00860
00861 /**
00862   * @brief  Reads single data with I2C communication
00863   *         channel from TouchScreen.
00864   * @param  Addr: I2C address
00865   * @param  Reg: Register address
00866   * @retval Read data
00867   */
00868 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
00869 {
00870   return I2C1_Read(Addr, Reg);
00871 }
00872
00873 /**
00874   * @brief  Reads multiple data with I2C communication
00875   *         channel from TouchScreen.
00876   * @param  Addr: I2C address
00877   * @param  Reg: Register address
00878   * @param  Buffer: Pointer to data buffer
00879   * @param  Length: Length of the data
00880   * @retval Number of read data
00881   */
00882 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
00883 {
00884  return I2C1_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
00885 }
00886
00887 /**
00888   * @brief  Writes multiple data with I2C communication
00889   *         channel from MCU to TouchScreen.
00890   * @param  Addr: I2C address
00891   * @param  Reg: Register address
00892   * @param  Buffer: Pointer to data buffer
00893   * @param  Length: Length of the data
00894   */
00895 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
00896 {
00897   I2C1_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
00898 }
00899
00900 /**
00901   * @brief  Delay function used in TouchScreen low level driver.
00902   * @param  Delay: Delay in ms
00903   */
00904 void TS_IO_Delay(uint32_t Delay)
00905 {
00906   HAL_Delay(Delay);
00907 }
00908
00909 /**************************** LINK OTM8009A (Display driver) ******************/
00910 /**
00911   * @brief  OTM8009A delay
00912   * @param  Delay: Delay in ms
00913   */
00914 void OTM8009A_IO_Delay(uint32_t Delay)
00915 {
00916   HAL_Delay(Delay);
00917 }
00918
00919 /**************************** LINK NT35510 (Display driver) ******************/
00920 /**
00921   * @brief  NT35510 delay
00922   * @param  Delay: Delay in ms
00923   */
00924 void NT35510_IO_Delay(uint32_t Delay)
00925 {
00926   HAL_Delay(Delay);
00927 }
00928
00929 /**
00930   * @}
00931   */
00932
00933 /**
00934   * @}
00935   */
00936
00937 /**
00938   * @}
00939   */
00940
00941 /**
00942   * @}
00943   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32469I-Discovery LEDs,
00006   *          push-buttons hardware resources.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* IMPORTANT: One of the following flags must be defined in the preprocessor */
00021 /* options in order to select the target board revision: !!!!!!!!!! */
00022 /* USE_STM32469I_DISCO_REVA */
00023 /* USE_STM32469I_DISCO_REVB */
00024 /* USE_STM32469I_DISCO_REVC */
00025
00026 /* Define to prevent recursive inclusion -------------------------------------*/
00027 #ifndef __STM32469I_DISCOVERY_H
00028 #define __STM32469I_DISCOVERY_H
00029
00030 #ifdef __cplusplus
00031  extern "C" {
00032 #endif
00033
00034
00035  /* Includes ------------------------------------------------------------------*/
00036 #include "stm32f4xx_hal.h"
00037
00038 /** @addtogroup BSP
00039   * @{
00040   */
00041
00042 /** @addtogroup STM32469I_Discovery
00043   * @{
00044   */
00045
00046 /** @addtogroup STM32469I_Discovery_LOW_LEVEL
00047   * @{
00048   */
00049
00050 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Types STM32469I Discovery LOW LEVEL Exported Types
00051  * @{
00052  */
00053
00054 /** @brief Led_TypeDef
00055   *  STM32469I_Discovery board leds definitions.
00056   */
00057 typedef enum
00058 {
00059  LED1 = 0,
00060  LED_GREEN = LED1,
00061  LED2 = 1,
00062  LED_ORANGE = LED2,
00063  LED3 = 2,
00064  LED_RED = LED3,
00065  LED4 = 3,
00066  LED_BLUE = LED4
00067
00068 } Led_TypeDef;
00069
00070 /** @brief Button_TypeDef
00071   *  STM32469I_Discovery board Buttons definitions.
00072   */
00073 typedef enum
00074 {
00075   BUTTON_WAKEUP = 0
00076 } Button_TypeDef;
00077
00078 #define BUTTON_USER BUTTON_WAKEUP
00079
00080 /** @brief ButtonMode_TypeDef
00081   *  STM32469I_Discovery board Buttons Modes definitions.
00082   */
00083 typedef enum
00084 {
00085  BUTTON_MODE_GPIO = 0,
00086  BUTTON_MODE_EXTI = 1
00087
00088 } ButtonMode_TypeDef;
00089
00090 /** @addtogroup Exported_types
00091   * @{
00092   */
00093 typedef enum
00094 {
00095   PB_SET = 0,
00096   PB_RESET = !PB_SET
00097 } ButtonValue_TypeDef;
00098
00099
00100 /** @brief DISCO_Status_TypeDef
00101   *  STM32469I_DISCO board Status return possible values.
00102   */
00103 typedef enum
00104 {
00105  DISCO_OK    = 0,
00106  DISCO_ERROR = 1
00107
00108 } DISCO_Status_TypeDef;
00109
00110 /**
00111   * @}
00112   */
00113
00114 /**
00115   * @}
00116   */
00117
00118 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Constants STM32469I Discovery LOW LEVEL Exported Constants
00119   * @{
00120   */
00121
00122
00123 /** @defgroup STM32469I_Discovery_LOW_LEVEL_LED STM32469I Discovery LOW LEVEL LED
00124   * @{
00125   */
00126 /* Always four leds for all revisions of Discovery boards */
00127 #define LEDn                             ((uint8_t)4)
00128
00129
00130 /* 4 Leds are connected to MCU directly on PG6, PD4, PD5, PK3 */
00131 #define LED1_GPIO_PORT                   ((GPIO_TypeDef*)GPIOG)
00132 #define LED2_GPIO_PORT                   ((GPIO_TypeDef*)GPIOD)
00133 #define LED3_GPIO_PORT                   ((GPIO_TypeDef*)GPIOD)
00134 #define LED4_GPIO_PORT                   ((GPIO_TypeDef*)GPIOK)
00135
00136 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOG_CLK_ENABLE()
00137 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOG_CLK_DISABLE()
00138 #define LED2_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOD_CLK_ENABLE()
00139 #define LED2_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOD_CLK_DISABLE()
00140 #define LED3_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOD_CLK_ENABLE()
00141 #define LED3_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOD_CLK_DISABLE()
00142 #define LED4_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOK_CLK_ENABLE()
00143 #define LED4_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOK_CLK_DISABLE()
00144
00145 #define LED1_PIN                         ((uint32_t)GPIO_PIN_6)
00146 #define LED2_PIN                         ((uint32_t)GPIO_PIN_4)
00147 #define LED3_PIN                         ((uint32_t)GPIO_PIN_5)
00148 #define LED4_PIN                         ((uint32_t)GPIO_PIN_3)
00149 /**
00150   * @}
00151   */
00152
00153 /** @addtogroup STM32469I_Discovery_LOW_LEVEL_BUTTON STM32469I Discovery LOW LEVEL BUTTON
00154   * @{
00155   */
00156 /* Only one User/Wakeup button */
00157 #define BUTTONn                             ((uint8_t)1)
00158
00159 /**
00160   * @brief Wakeup push-button
00161   */
00162 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_0
00163 #define WAKEUP_BUTTON_GPIO_PORT             GPIOA
00164 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00165 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00166 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI0_IRQn
00167
00168 /* Define the USER button as an alias of the Wakeup button */
00169 #define USER_BUTTON_PIN                   WAKEUP_BUTTON_PIN
00170 #define USER_BUTTON_GPIO_PORT             WAKEUP_BUTTON_GPIO_PORT
00171 #define USER_BUTTON_GPIO_CLK_ENABLE()     WAKEUP_BUTTON_GPIO_CLK_ENABLE()
00172 #define USER_BUTTON_GPIO_CLK_DISABLE()    WAKEUP_BUTTON_GPIO_CLK_DISABLE()
00173 #define USER_BUTTON_EXTI_IRQn             WAKEUP_BUTTON_EXTI_IRQn
00174
00175 #define BUTTON_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOA_CLK_ENABLE()
00176
00177 /**
00178   * @}
00179   */
00180
00181 /**
00182   * @brief OTG_FS1 OVER_CURRENT and POWER_SWITCH Pins definition
00183   */
00184 #define AUDIO_INT_PIN                  GPIO_PIN_7
00185 #define AUDIO_INT_PORT                 GPIOB
00186 #define AUDIO_INT_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00187
00188 #define OTG_FS1_OVER_CURRENT_PIN                  GPIO_PIN_7
00189 #define OTG_FS1_OVER_CURRENT_PORT                 GPIOB
00190 #define OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00191
00192 #define OTG_FS1_POWER_SWITCH_PIN                  GPIO_PIN_2
00193 #define OTG_FS1_POWER_SWITCH_PORT                 GPIOB
00194 #define OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00195
00196 /**
00197   * @brief SD-detect signal
00198   */
00199 #define SD_DETECT_PIN                        ((uint32_t)GPIO_PIN_2)
00200 #define SD_DETECT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOG)
00201 #define SD_DETECT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOG_CLK_ENABLE()
00202 #define SD_DETECT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOG_CLK_DISABLE()
00203 #define SD_DETECT_EXTI_IRQn                  EXTI2_IRQn
00204
00205 /**
00206   * @brief TS_INT signal from TouchScreen when it is configured in interrupt mode
00207   */
00208 #define TS_INT_PIN                        ((uint32_t)GPIO_PIN_5)
00209 #define TS_INT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOJ)
00210 #define TS_INT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOJ_CLK_ENABLE()
00211 #define TS_INT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOJ_CLK_DISABLE()
00212 #define TS_INT_EXTI_IRQn                  EXTI9_5_IRQn
00213
00214 /**
00215   * @brief TouchScreen FT6206 Slave I2C address 1
00216   */
00217 #define TS_I2C_ADDRESS                   ((uint16_t)0x54)
00218
00219 /**
00220   * @brief TouchScreen FT6336G Slave I2C address 2
00221   */
00222 #define TS_I2C_ADDRESS_A02               ((uint16_t)0x70)
00223
00224
00225 /**
00226   * @brief Audio I2C Slave address
00227   */
00228 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x94)
00229
00230 /**
00231   * @brief EEPROM I2C Slave address 1
00232   */
00233 #define EEPROM_I2C_ADDRESS_A01           ((uint16_t)0xA0)
00234
00235 /**
00236   * @brief EEPROM I2C Slave address 2
00237   */
00238 #define EEPROM_I2C_ADDRESS_A02           ((uint16_t)0xA6)
00239
00240 /**
00241   * @brief I2C clock speed configuration (in Hz)
00242   * WARNING:
00243   * Make sure that this define is not already declared in other files
00244   * It can be used in parallel by other modules.
00245   */
00246 #ifndef I2C1_SCL_FREQ_KHZ
00247 #define I2C1_SCL_FREQ_KHZ                  400000 /*!< f(I2C_SCL) = 400 kHz */
00248 #endif /* I2C1_SCL_FREQ_KHZ */
00249
00250 /**
00251   * @brief User can use this section to tailor I2C1/I2C1 instance used and associated
00252   * resources.
00253   * Definition for I2C1 clock resources
00254   */
00255 #define DISCO_I2C1                             I2C1
00256 #define DISCO_I2C1_CLK_ENABLE()                __HAL_RCC_I2C1_CLK_ENABLE()
00257 #define DISCO_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00258 #define DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
00259
00260 #define DISCO_I2C1_FORCE_RESET()               __HAL_RCC_I2C1_FORCE_RESET()
00261 #define DISCO_I2C1_RELEASE_RESET()             __HAL_RCC_I2C1_RELEASE_RESET()
00262
00263 /** @brief Definition for I2C1 Pins
00264   */
00265 #define DISCO_I2C1_SCL_PIN                     GPIO_PIN_8 /*!< PB8 */
00266 #define DISCO_I2C1_SCL_SDA_GPIO_PORT           GPIOB
00267 #define DISCO_I2C1_SCL_SDA_AF                  GPIO_AF4_I2C1
00268 #define DISCO_I2C1_SDA_PIN                     GPIO_PIN_9 /*!< PB9 */
00269
00270 /** @brief Definition of I2C interrupt requests
00271   */
00272 #define DISCO_I2C1_EV_IRQn                     I2C1_EV_IRQn
00273 #define DISCO_I2C1_ER_IRQn                     I2C1_ER_IRQn
00274
00275
00276
00277 /**
00278   * @brief I2C2 clock speed configuration (in Hz)
00279   * WARNING:
00280   * Make sure that this define is not already declared in other files
00281   * It can be used in parallel by other modules.
00282   */
00283 #ifndef I2C2_SCL_FREQ_KHZ
00284 #define I2C2_SCL_FREQ_KHZ                  100000 /*!< f(I2C2_SCL) < 100 kHz */
00285 #endif /* I2C2_SCL_FREQ_KHZ */
00286
00287 /**
00288   * @brief User can use this section to tailor I2C2/I2C2 instance used and associated
00289   * resources (audio codec).
00290   * Definition for I2C2 clock resources
00291   */
00292 #define DISCO_I2C2                             I2C2
00293 #define DISCO_I2C2_CLK_ENABLE()                __HAL_RCC_I2C2_CLK_ENABLE()
00294 #define DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
00295
00296 #define DISCO_I2C2_FORCE_RESET()               __HAL_RCC_I2C2_FORCE_RESET()
00297 #define DISCO_I2C2_RELEASE_RESET()             __HAL_RCC_I2C2_RELEASE_RESET()
00298
00299 /** @brief Definition for I2C2 Pins
00300   */
00301 #define DISCO_I2C2_SCL_PIN                     GPIO_PIN_4 /*!< PH4 */
00302 #define DISCO_I2C2_SCL_SDA_GPIO_PORT           GPIOH
00303 #define DISCO_I2C2_SCL_SDA_AF                  GPIO_AF4_I2C2
00304 #define DISCO_I2C2_SDA_PIN                     GPIO_PIN_5 /*!< PH5 */
00305
00306 /** @brief Definition of I2C2 interrupt requests
00307   */
00308 #define DISCO_I2C2_EV_IRQn                     I2C2_EV_IRQn
00309 #define DISCO_I2C2_ER_IRQn                     I2C2_ER_IRQn
00310
00311 #if !defined(USE_STM32469I_DISCO_REVA) && \
00312     !defined(USE_STM32469I_DISCO_REVB) && \
00313     !defined(USE_STM32469I_DISCO_REVC)
00314 #define USE_STM32469I_DISCO_REVC
00315 #endif
00316
00317 /**
00318   * @}
00319   */
00320
00321 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Macros STM32469I Discovery LOW LEVEL Exported Macros
00322   * @{
00323   */
00324 /**
00325   * @}
00326   */
00327
00328 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Functions STM32469I Discovery LOW LEVEL Exported Functions
00329   * @{
00330   */
00331 uint32_t         BSP_GetVersion(void);
00332 void             BSP_LED_Init(Led_TypeDef Led);
00333 void             BSP_LED_DeInit(Led_TypeDef Led);
00334 void             BSP_LED_On(Led_TypeDef Led);
00335 void             BSP_LED_Off(Led_TypeDef Led);
00336 void             BSP_LED_Toggle(Led_TypeDef Led);
00337 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00338 void             BSP_PB_DeInit(Button_TypeDef Button);
00339 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00340
00341 /**
00342   * @}
00343   */
00344
00345 /**
00346   * @}
00347   */
00348
00349 /**
00350   * @}
00351   */
00352
00353 /**
00354   * @}
00355   */
00356
00357
00358 #ifdef __cplusplus
00359 }
00360 #endif
00361
00362 #endif /* __STM32469I_DISCOVERY_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_audio.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_audio.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_audio.c
00004   * @author  MCD Application Team
00005   * @version V2.0.0
00006   * @date    27-January-2017
00007   * @brief   This file provides the Audio driver for the STM32469I-Discovery board.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * Copyright (c) 2017 STMicroelectronics.
00012   * All rights reserved.
00013   *
00014   * This software is licensed under terms that can be found in the LICENSE file
00015   * in the root directory of this software component.
00016   * If no LICENSE file comes with this software, it is provided AS-IS.
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /*==============================================================================
00022                                  User NOTES
00023
00024 How To use this driver:
00025 -----------------------
00026    + This driver supports STM32F4xx devices on STM32469I-Discovery (MB1189) Discovery boards.
00027    + Call the function BSP_AUDIO_OUT_Init(
00028                                     OutputDevice: physical output mode (OUTPUT_DEVICE_HEADPHONE1,
00029                                                   OUTPUT_DEVICE_HEADPHONE2 or OUTPUT_DEVICE_BOTH)
00030                                     Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
00031                                     AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
00032                                                   this parameter is relative to the audio file/stream type.
00033                                    )
00034       This function configures all the hardware required for the audio application (codec, I2C, SAI,
00035       GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
00036       If the returned value is different from AUDIO_OK or the function is stuck then the communication with
00037       the codec or the MFX has failed (try to un-plug the power or reset device in this case).
00038       - OUTPUT_DEVICE_HEADPHONE1 : only headphones 1 will be set as output for the audio stream.
00039       - OUTPUT_DEVICE_HEADPHONE2 : only headphones 2 will be set as output for the audio stream.
00040       - OUTPUT_DEVICE_BOTH       : both Headphones are used as outputs for the audio stream
00041                                  at the same time.
00042       Note. On STM32469I-Discovery SAI_DMA is configured in CIRCULAR mode. Due to this the application
00043         does NOT need to call BSP_AUDIO_OUT_ChangeBuffer() to assure straming.
00044    + Call the function BSP_Discovery_AUDIO_OUT_Play(
00045                                   pBuffer: pointer to the audio data file address
00046                                   Size   : size of the buffer to be sent in Bytes
00047                                  )
00048       to start playing (for the first time) from the audio file/stream.
00049    + Call the function BSP_AUDIO_OUT_Pause() to pause playing
00050    + Call the function BSP_AUDIO_OUT_Resume() to resume playing.
00051        Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00052           for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00053        Note. This function should be called only when the audio file is played or paused (not stopped).
00054    + For each mode, you may need to implement the relative callback functions into your code.
00055       The Callback functions are named AUDIO_OUT_XXX_CallBack() and only their prototypes are declared in
00056       the stm32469i_discovery_audio.h file. (refer to the example for more details on the callbacks implementations)
00057    + To Stop playing, to modify the volume level, the frequency, the audio frame slot,
00058       the device output mode the mute or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
00059       AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetAudioFrameSlot(), BSP_AUDIO_OUT_SetOutputMode(),
00060       BSP_AUDIO_OUT_SetMute() and BSP_AUDIO_OUT_Stop().
00061    + The driver API and the callback functions are at the end of the stm32469i_discovery_audio.h file.
00062
00063 Driver architecture:
00064 --------------------
00065    + This driver provide the High Audio Layer: consists of the function API exported in the stm32469i_discovery_audio.h file
00066      (BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_Play() ...)
00067    + This driver provide also the Media Access Layer (MAL): which consists of functions allowing to access the media containing/
00068      providing the audio file/stream. These functions are also included as local functions into
00069      the stm32469i_discovery_audio_codec.c file (I2Sx_Init(), I2Sx_DeInit(), SAIx_Init() and SAIx_DeInit())
00070
00071 Known Limitations:
00072 ------------------
00073    1- If the TDM Format used to paly in parallel 2 audio Stream (the first Stream is configured in codec SLOT0 and second
00074       Stream in SLOT1) the Pause/Resume, volume and mute feature will control the both streams.
00075    2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
00076       File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
00077    3- Supports only Stereo audio streaming.
00078    4- Supports only 16-bits audio data size.
00079 ==============================================================================*/
00080
00081 /* Includes ------------------------------------------------------------------*/
00082 #include <string.h>
00083 #include "stm32469i_discovery_audio.h"
00084
00085 /** @addtogroup BSP
00086   * @{
00087   */
00088
00089 /** @addtogroup STM32469I_Discovery
00090   * @{
00091   */
00092
00093 /** @defgroup STM32469I-Discovery_AUDIO STM32469I Discovery AUDIO
00094   * @brief This file includes the low layer driver for CS43L22 Audio Codec
00095   *        available on STM32469I-Discovery board(MB1189).
00096   * @{
00097   */
00098
00099 /** @defgroup STM32469I-Discovery_AUDIO_Private_Types STM32469I Discovery AUDIO Private Types
00100   * @{
00101   */
00102 /**
00103   * @}
00104   */
00105
00106 /** @defgroup STM32469I-Discovery_AUDIO_Private_Defines STM32469I Discovery AUDIO Private Defines
00107  *  @brief Headphone1 (CN27 of STM32469I-Discovery board) is connected to the
00108  *         HEADPHONE output of CS43L22 Audio Codec.
00109  *         Headphone2 (CN26 of STM32469I-Discovery board) is connected to the
00110  *         SPEAKER output of CS43L22 Audio Codec.
00111   * @{
00112   */
00113 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE
00114
00115 /* Headphone2 is connected to Speaker output of the CS43L22 codec */
00116 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32469I-Discovery_AUDIO_Private_Macros STM32469I Discovery AUDIO Private macros
00122   * @{
00123   */
00124
00125 /*### PLAY ###*/
00126 /* SCK(kHz) = SAI_CK_x/(SAIClockDivider*2*256) */
00127 #define SAIClockDivider(__FREQUENCY__) \
00128         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 12 \
00129       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 2 \
00130       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 6 \
00131       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 1 \
00132       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 3 \
00133       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 0 \
00134       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 2 : 1  \
00135
00136 /**
00137   * @}
00138   */
00139
00140 /** @defgroup STM32469I-Discovery_AUDIO_Private_Variables STM32469I Discovery AUDIO Private Variables
00141   * @{
00142   */
00143
00144 /*
00145 Note:
00146   these global variables are not compliant to naming rules (upper case without "_" ),
00147   but we keep this naming for compatibility, in fact these variables (not static)
00148   could have been used by the application, example the stm32f4xx_it.c:
00149     void DMA2_Stream6_IRQHandler(void)
00150      {  HAL_DMA_IRQHandler(haudio_out_sai.hdmatx);  }
00151 */
00152 AUDIO_DrvTypeDef          *audio_drv;
00153 SAI_HandleTypeDef         haudio_out_sai;
00154 I2S_HandleTypeDef         haudio_in_i2s;
00155 TIM_HandleTypeDef         haudio_tim;
00156
00157 /* PDM filters params */
00158 PDM_Filter_Handler_t  PDM_FilterHandler[2];
00159 PDM_Filter_Config_t   PDM_FilterConfig[2];
00160
00161 uint8_t Channel_Demux[128] = {
00162     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00163     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00164     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00165     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00166     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00167     0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
00168     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00169     0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07,
00170     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00171     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00172     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00173     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00174     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00175     0x08, 0x09, 0x08, 0x09, 0x0a, 0x0b, 0x0a, 0x0b,
00176     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f,
00177     0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x0f, 0x0e, 0x0f
00178 };
00179
00180 uint16_t __IO AudioInVolume = DEFAULT_AUDIO_IN_VOLUME;
00181
00182 /**
00183   * @}
00184   */
00185
00186 /** @defgroup STM32469I-Discovery_AUDIO_Private_Function_Prototypes STM32469I Discovery AUDIO Private Prototypes
00187   * @{
00188   */
00189 static uint8_t SAIx_Init(uint32_t AudioFreq);
00190 static void SAIx_DeInit(void);
00191 static void I2Sx_Init(uint32_t AudioFreq);
00192 static void I2Sx_DeInit(void);
00193 static void TIMx_IC_MspInit(TIM_HandleTypeDef *htim);
00194 static void TIMx_IC_MspDeInit(TIM_HandleTypeDef *htim);
00195 static void TIMx_Init(void);
00196 static void TIMx_DeInit(void);
00197 static void PDMDecoder_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut);
00198
00199 void BSP_AUDIO_OUT_ChangeAudioConfig(uint32_t AudioOutOption);
00200
00201 /**
00202   * @}
00203   */
00204
00205 /** @defgroup STM32469I-Discovery_AUDIO_out_Private_Functions STM32469I Discovery AUDIO OUT Private Functions
00206   * @{
00207   */
00208
00209 /**
00210   * @brief  Configures the audio peripherals.
00211   * @param  OutputDevice: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
00212   *                       or OUTPUT_DEVICE_BOTH.
00213   * @param  Volume: Initial volume level (from 0 (Mute) to 100 (Max))
00214   * @param  AudioFreq: Audio frequency used to play the audio stream.
00215   * @note   The SAI PLL input clock must be done in the user application.
00216   * @retval AUDIO_OK if correct communication, else wrong communication
00217   */
00218 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice,
00219                            uint8_t Volume,
00220                            uint32_t AudioFreq)
00221 {
00222   uint8_t ret = AUDIO_OK;
00223
00224   SAIx_DeInit();
00225
00226   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00227   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00228
00229   /* SAI data transfer preparation:
00230   Prepare the Media to be used for the audio transfer from memory to SAI peripheral */
00231   haudio_out_sai.Instance = AUDIO_SAIx;
00232   if(HAL_SAI_GetState(&haudio_out_sai) == HAL_SAI_STATE_RESET)
00233   {
00234     /* Init the SAI MSP: this __weak function can be redefined by the application*/
00235     BSP_AUDIO_OUT_MspInit(&haudio_out_sai, NULL);
00236   }
00237
00238   if (SAIx_Init(AudioFreq) != AUDIO_OK)
00239   {
00240     ret = AUDIO_ERROR;
00241   }
00242
00243   if(ret == AUDIO_OK)
00244   {
00245     /* Retieve audio codec identifier */
00246     if (cs43l22_drv.ReadID(AUDIO_I2C_ADDRESS) == CS43L22_ID)
00247     {
00248       /* Initialize the audio driver structure */
00249       audio_drv = &cs43l22_drv;
00250     }
00251     else
00252     {
00253       ret = AUDIO_ERROR;
00254     }
00255   }
00256
00257   if(ret == AUDIO_OK)
00258   {
00259     /* Initialize the audio codec internal registers */
00260     if (audio_drv->Init(AUDIO_I2C_ADDRESS,
00261                         OutputDevice,
00262                         Volume,
00263                         AudioFreq) != AUDIO_OK)
00264     {
00265       ret = AUDIO_ERROR;
00266     }
00267   }
00268
00269   return ret;
00270 }
00271
00272 /**
00273   * @brief  Starts playing audio stream from a data buffer for a determined size.
00274   * @param  pBuffer: Pointer to the buffer
00275   * @param  Size: Number of audio data BYTES.
00276   * @retval AUDIO_OK if correct communication, else wrong communication
00277   */
00278 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size)
00279 {
00280   uint8_t ret = AUDIO_OK;
00281
00282   /* Call the audio Codec Play function */
00283   if(audio_drv->Play(AUDIO_I2C_ADDRESS, pBuffer, Size) != 0)
00284   {
00285     ret = AUDIO_ERROR;
00286   }
00287
00288   /* Initiate a DMA transfer of PCM samples towards the serial audio interface */
00289   if(ret == AUDIO_OK)
00290   {
00291     if (HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pBuffer, DMA_MAX(Size / AUDIODATA_SIZE))!= HAL_OK)
00292     {
00293       ret = AUDIO_ERROR;
00294     }
00295   }
00296
00297   return ret;
00298 }
00299
00300 /**
00301   * @brief  Sends n-Bytes on the SAI interface.
00302   * @param  pData: pointer on PCM samples buffer
00303   * @param  Size: number of data to be written
00304   */
00305 void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
00306 {
00307    HAL_SAI_Transmit_DMA(&haudio_out_sai, (uint8_t*) pData, Size);
00308 }
00309
00310 /**
00311   * @brief   This function Pauses the audio file stream. In case
00312   *          of using DMA, the DMA Pause feature is used.
00313   * @warning When calling BSP_AUDIO_OUT_Pause() function for pause, only
00314   *          BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play()
00315   *          function for resume could lead to unexpected behavior).
00316   * @retval  AUDIO_OK if correct communication, else wrong communication
00317   */
00318 uint8_t BSP_AUDIO_OUT_Pause(void)
00319 {
00320   uint8_t ret = AUDIO_OK;
00321
00322   /* Call the Audio Codec Pause/Resume function */
00323   if(audio_drv->Pause(AUDIO_I2C_ADDRESS) != 0)
00324   {
00325     ret =  AUDIO_ERROR;
00326   }
00327
00328   /* Pause DMA transfer of PCM samples towards the serial audio interface */
00329   if(ret == AUDIO_OK)
00330   {
00331     if (HAL_SAI_DMAPause(&haudio_out_sai)!= HAL_OK)
00332     {
00333       ret =  AUDIO_ERROR;
00334     }
00335   }
00336
00337   /* Return AUDIO_OK when all operations are correctly done */
00338   return ret;
00339 }
00340
00341 /**
00342   * @brief  This function  Resumes the audio file stream.
00343   * WARNING: When calling BSP_AUDIO_OUT_Pause() function for pause, only
00344   *          BSP_AUDIO_OUT_Resume() function should be called for resume
00345   *          (use of BSP_AUDIO_OUT_Play() function for resume could lead to
00346   *           unexpected behavior).
00347   * @retval AUDIO_OK if correct communication, else wrong communication
00348   */
00349 uint8_t BSP_AUDIO_OUT_Resume(void)
00350 {
00351   uint8_t ret = AUDIO_OK;
00352
00353   /* Call the Audio Codec Pause/Resume function */
00354   if(audio_drv->Resume(AUDIO_I2C_ADDRESS) != 0)
00355   {
00356     ret =  AUDIO_ERROR;
00357   }
00358
00359   /* Resume DMA transfer of PCM samples towards the serial audio interface */
00360   if(ret == AUDIO_OK)
00361   {
00362     if (HAL_SAI_DMAResume(&haudio_out_sai)!= HAL_OK)
00363     {
00364       ret =  AUDIO_ERROR;
00365     }
00366   }
00367
00368   /* Return AUDIO_OK when all operations are correctly done */
00369   return ret;
00370 }
00371
00372 /**
00373   * @brief  Stops audio playing and Power down the Audio Codec.
00374   * @param  Option: could be one of the following parameters
00375   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00376   *                            Then no need to reconfigure the Codec after power on.
00377   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00378   *                            Then need to reconfigure the Codec after power on.
00379   * @retval AUDIO_OK if correct communication, else wrong communication
00380   */
00381 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
00382 {
00383   uint8_t ret = AUDIO_OK;
00384
00385  /* Call Audio Codec Stop function */
00386   if(audio_drv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
00387   {
00388     ret = AUDIO_ERROR;
00389   }
00390
00391   if(ret == AUDIO_OK)
00392   {
00393     if(Option == CODEC_PDWN_HW)
00394     {
00395       /* Wait at least 100us */
00396       HAL_Delay(2);
00397     }
00398
00399     /* Stop DMA transfer of PCM samples towards the serial audio interface */
00400     if (HAL_SAI_DMAStop(&haudio_out_sai)!= HAL_OK)
00401     {
00402       ret = AUDIO_ERROR;
00403     }
00404   }
00405   /* Return AUDIO_OK when all operations are correctly done */
00406   return ret;
00407 }
00408
00409 /**
00410   * @brief  Controls the current audio volume level.
00411   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00412   *         Mute and 100 for Max volume level).
00413   * @retval AUDIO_OK if correct communication, else wrong communication
00414   */
00415 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
00416 {
00417   uint8_t ret = AUDIO_OK;
00418
00419   /* Call the codec volume control function with converted volume value */
00420   if(audio_drv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
00421   {
00422     ret =  AUDIO_ERROR;
00423   }
00424
00425   /* Return AUDIO_OK when all operations are correctly done */
00426   return ret;
00427 }
00428
00429 /**
00430   * @brief  Enables or disables the MUTE mode by software
00431   * @param  Cmd: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to
00432   *         unmute the codec and restore previous volume level.
00433   * @retval AUDIO_OK if correct communication, else wrong communication
00434   */
00435 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
00436 {
00437   uint8_t ret = AUDIO_OK;
00438
00439   /* Call the Codec Mute function */
00440   if(audio_drv->SetMute(AUDIO_I2C_ADDRESS, Cmd) != 0)
00441   {
00442     ret = AUDIO_ERROR;
00443   }
00444
00445   /* Return AUDIO_OK when all operations are correctly done */
00446   return ret;
00447 }
00448
00449 /**
00450   * @brief  Switch dynamically (while audio file is being played) the output
00451   *          target (speaker or headphone).
00452   * @param  Output: The audio output target: OUTPUT_DEVICE_SPEAKER,
00453   *         OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
00454   * @retval AUDIO_OK if correct communication, else wrong communication
00455   */
00456 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output)
00457 {
00458   uint8_t ret = AUDIO_OK;
00459
00460   /* Call the Codec output device function */
00461   if(audio_drv->SetOutputMode(AUDIO_I2C_ADDRESS, Output) != 0)
00462   {
00463     ret = AUDIO_ERROR;
00464   }
00465
00466   /* Return AUDIO_OK when all operations are correctly done */
00467   return ret;
00468 }
00469
00470 /**
00471   * @brief  Updates the audio frequency.
00472   * @param  AudioFreq: Audio frequency used to play the audio stream.
00473   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00474   *         audio frequency.
00475   */
00476 void BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq)
00477 {
00478   /* PLL clock is set depending by the AudioFreq (44.1khz vs 48khz groups) */
00479   BSP_AUDIO_OUT_ClockConfig(&haudio_out_sai, AudioFreq, NULL);
00480
00481   /* Disable SAI peripheral to allow access to SAI internal registers */
00482   __HAL_SAI_DISABLE(&haudio_out_sai);
00483
00484   /* Update the SAI audio frequency configuration */
00485   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00486   HAL_SAI_Init(&haudio_out_sai);
00487
00488   /* Enable SAI peripheral to generate MCLK */
00489   __HAL_SAI_ENABLE(&haudio_out_sai);
00490 }
00491
00492 /**
00493   * @brief  Changes the Audio Out Configuration.
00494   * @param  AudioOutOption: specifies the audio out new configuration
00495   *         This parameter can be any value of @ref BSP_Audio_Out_Option
00496   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00497   *         audio out configuration.
00498   */
00499 void BSP_AUDIO_OUT_ChangeAudioConfig(uint32_t AudioOutOption)
00500 {
00501   /********** Playback Buffer circular/normal mode **********/
00502   if(AudioOutOption & BSP_AUDIO_OUT_CIRCULARMODE)
00503   {
00504     /* Deinitialize the Stream to update DMA mode */
00505     HAL_DMA_DeInit(haudio_out_sai.hdmatx);
00506
00507     /* Update the SAI audio Transfer DMA mode */
00508     haudio_out_sai.hdmatx->Init.Mode = DMA_CIRCULAR;
00509
00510     /* Configure the DMA Stream with new Transfer DMA mode */
00511     HAL_DMA_Init(haudio_out_sai.hdmatx);
00512   }
00513   else /* BSP_AUDIO_OUT_NORMALMODE */
00514   {
00515     /* Deinitialize the Stream to update DMA mode */
00516     HAL_DMA_DeInit(haudio_out_sai.hdmatx);
00517
00518     /* Update the SAI audio Transfer DMA mode */
00519     haudio_out_sai.hdmatx->Init.Mode = DMA_NORMAL;
00520
00521     /* Configure the DMA Stream with new Transfer DMA mode */
00522     HAL_DMA_Init(haudio_out_sai.hdmatx);
00523   }
00524
00525   /********** Playback Buffer stereo/mono mode **********/
00526   if(AudioOutOption & BSP_AUDIO_OUT_STEREOMODE)
00527   {
00528     /* Disable SAI peripheral to allow access to SAI internal registers */
00529     __HAL_SAI_DISABLE(&haudio_out_sai);
00530
00531     /* Update the SAI audio frame slot configuration */
00532     haudio_out_sai.Init.MonoStereoMode = SAI_STEREOMODE;
00533     HAL_SAI_Init(&haudio_out_sai);
00534
00535     /* Enable SAI peripheral to generate MCLK */
00536     __HAL_SAI_ENABLE(&haudio_out_sai);
00537   }
00538   else /* BSP_AUDIO_OUT_MONOMODE */
00539   {
00540     /* Disable SAI peripheral to allow access to SAI internal registers */
00541     __HAL_SAI_DISABLE(&haudio_out_sai);
00542
00543     /* Update the SAI audio frame slot configuration */
00544     haudio_out_sai.Init.MonoStereoMode = SAI_MONOMODE;
00545     HAL_SAI_Init(&haudio_out_sai);
00546
00547     /* Enable SAI peripheral to generate MCLK */
00548     __HAL_SAI_ENABLE(&haudio_out_sai);
00549   }
00550 }
00551
00552 /**
00553   * @brief  Updates the Audio frame slot configuration.
00554   * @param  AudioFrameSlot: specifies the audio Frame slot
00555   *         This parameter can be any value of @ref CODEC_AudioFrame_SLOT_TDMMode
00556   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00557   *         audio frame slot.
00558   */
00559 void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
00560 {
00561   /* Disable SAI peripheral to allow access to SAI internal registers */
00562   __HAL_SAI_DISABLE(&haudio_out_sai);
00563
00564   /* Update the SAI audio frame slot configuration */
00565   haudio_out_sai.SlotInit.SlotActive = AudioFrameSlot;
00566   HAL_SAI_Init(&haudio_out_sai);
00567
00568   /* Enable SAI peripheral to generate MCLK */
00569   __HAL_SAI_ENABLE(&haudio_out_sai);
00570 }
00571
00572 /**
00573   * @brief  Deinit the audio peripherals.
00574   */
00575 void BSP_AUDIO_OUT_DeInit(void)
00576 {
00577   SAIx_DeInit();
00578   /* DeInit the SAI MSP : this __weak function can be rewritten by the applic */
00579   BSP_AUDIO_OUT_MspDeInit(&haudio_out_sai, NULL);
00580
00581   /* Reset the audio output context */
00582   memset(&audio_drv, 0, sizeof(audio_drv));
00583 }
00584
00585 /**
00586   * @brief  Tx Transfer completed callbacks.
00587   * @param  hsai: SAI handle
00588   */
00589 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
00590 {
00591   /* Manage the remaining file size and new address offset: This function
00592      should be coded by user (its prototype is already declared in stm32469i_discovery_audio.h) */
00593   BSP_AUDIO_OUT_TransferComplete_CallBack();
00594 }
00595
00596 /**
00597   * @brief  Tx Half Transfer completed callbacks.
00598   * @param  hsai: SAI handle
00599   */
00600 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
00601 {
00602   /* Manage the remaining file size and new address offset: This function
00603      should be coded by user (its prototype is already declared in stm32469i_discovery_audio.h) */
00604   BSP_AUDIO_OUT_HalfTransfer_CallBack();
00605 }
00606
00607 /**
00608   * @brief  SAI error callbacks.
00609   * @param  hsai: SAI handle
00610   */
00611 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
00612 {
00613   BSP_AUDIO_OUT_Error_CallBack();
00614 }
00615
00616 /**
00617   * @brief  Manages the DMA full Transfer complete event.
00618   */
00619 __weak void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
00620 {
00621 }
00622
00623 /**
00624   * @brief  Manages the DMA Half Transfer complete event.
00625   */
00626 __weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
00627 {
00628 }
00629
00630 /**
00631   * @brief  Manages the DMA FIFO error event.
00632   */
00633 __weak void BSP_AUDIO_OUT_Error_CallBack(void)
00634 {
00635 }
00636
00637 /**
00638   * @brief  Initializes BSP_AUDIO_OUT MSP.
00639   * @param  hsai: SAI handle
00640   * @param  Params : pointer on additional configuration parameters, can be NULL.
00641   */
00642 __weak void BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params)
00643 {
00644   static DMA_HandleTypeDef hdma_sai_tx;
00645   GPIO_InitTypeDef  gpio_init_structure;
00646
00647   /* Put CS43L2 codec reset high -----------------------------------*/
00648   AUDIO_RESET_ENABLE();
00649   gpio_init_structure.Pin =  AUDIO_RESET_PIN;
00650   gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
00651   gpio_init_structure.Pull = GPIO_NOPULL;
00652   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00653   HAL_GPIO_Init(AUDIO_RESET_GPIO_PORT, &gpio_init_structure);
00654   HAL_GPIO_WritePin(AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, GPIO_PIN_SET);
00655
00656   /* Enable SAI clock */
00657   AUDIO_SAIx_CLK_ENABLE();
00658
00659   /* Enable GPIO clock */
00660   AUDIO_SAIx_MCLK_ENABLE();
00661   AUDIO_SAIx_SCK_SD_FS_ENABLE();
00662
00663   /* CODEC_SAI pins configuration: MCK pin -----------------------------------*/
00664   gpio_init_structure.Pin =  AUDIO_SAIx_MCK_PIN;
00665   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00666   gpio_init_structure.Pull = GPIO_NOPULL;
00667   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00668   gpio_init_structure.Alternate = AUDIO_SAIx_MCLK_SCK_SD_FS_AF;
00669   HAL_GPIO_Init(AUDIO_SAIx_MCLK_GPIO_PORT, &gpio_init_structure);
00670
00671   /* CODEC_SAI pins configuration: FS, SCK, MCK and SD pins ------------------*/
00672   gpio_init_structure.Pin = AUDIO_SAIx_FS_PIN | AUDIO_SAIx_SCK_PIN | AUDIO_SAIx_SD_PIN;
00673   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00674   gpio_init_structure.Pull = GPIO_NOPULL;
00675   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00676   gpio_init_structure.Alternate = AUDIO_SAIx_MCLK_SCK_SD_FS_AF;
00677   HAL_GPIO_Init(AUDIO_SAIx_SCK_SD_FS_GPIO_PORT, &gpio_init_structure);
00678
00679   /* Enable the DMA clock */
00680   AUDIO_SAIx_DMAx_CLK_ENABLE();
00681
00682   if(hsai->Instance == AUDIO_SAIx)
00683   {
00684     /* Configure the hdma_saiTx handle parameters */
00685     hdma_sai_tx.Init.Channel             = AUDIO_SAIx_DMAx_CHANNEL;
00686     hdma_sai_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00687     hdma_sai_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
00688     hdma_sai_tx.Init.MemInc              = DMA_MINC_ENABLE;
00689     hdma_sai_tx.Init.PeriphDataAlignment = AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE;
00690     hdma_sai_tx.Init.MemDataAlignment    = AUDIO_SAIx_DMAx_MEM_DATA_SIZE;
00691     hdma_sai_tx.Init.Mode                = DMA_CIRCULAR;
00692     hdma_sai_tx.Init.Priority            = DMA_PRIORITY_HIGH;
00693     hdma_sai_tx.Init.FIFOMode            = DMA_FIFOMODE_ENABLE;
00694     hdma_sai_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00695     hdma_sai_tx.Init.MemBurst            = DMA_MBURST_SINGLE;
00696     hdma_sai_tx.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00697
00698     hdma_sai_tx.Instance = AUDIO_SAIx_DMAx_STREAM;
00699
00700     /* Associate the DMA handle */
00701     __HAL_LINKDMA(hsai, hdmatx, hdma_sai_tx);
00702
00703     /* Deinitialize the Stream for new transfer */
00704     HAL_DMA_DeInit(&hdma_sai_tx);
00705
00706     /* Configure the DMA Stream */
00707     HAL_DMA_Init(&hdma_sai_tx);
00708   }
00709
00710   /* SAI DMA IRQ Channel configuration */
00711   HAL_NVIC_SetPriority(AUDIO_SAIx_DMAx_IRQ, AUDIO_OUT_IRQ_PREPRIO, 0);
00712   HAL_NVIC_EnableIRQ(AUDIO_SAIx_DMAx_IRQ);
00713
00714 }
00715 /**
00716   * @brief  Deinitializes BSP_AUDIO_OUT MSP.
00717   * @param  hsai: SAI handle
00718   * @param  Params : pointer on additional configuration parameters, can be NULL.
00719   */
00720 __weak void BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params)
00721 {
00722   GPIO_InitTypeDef  gpio_init_structure;
00723
00724   /* SAI DMA IRQ Channel deactivation */
00725   HAL_NVIC_DisableIRQ(AUDIO_SAIx_DMAx_IRQ);
00726
00727   if(hsai->Instance == AUDIO_SAIx)
00728   {
00729     /* Deinitialize the DMA stream */
00730     HAL_DMA_DeInit(hsai->hdmatx);
00731   }
00732
00733   /* Disable SAI peripheral */
00734   __HAL_SAI_DISABLE(hsai);
00735
00736   /* Put CS43L2 codec reset low -----------------------------------*/
00737   HAL_GPIO_WritePin(AUDIO_RESET_GPIO_PORT, AUDIO_RESET_PIN, GPIO_PIN_RESET);
00738
00739   /* Deactives CODEC_SAI pins FS, SCK, MCK and SD by putting them in input mode */
00740   gpio_init_structure.Pin = AUDIO_SAIx_MCK_PIN;
00741   HAL_GPIO_DeInit(AUDIO_SAIx_MCLK_GPIO_PORT, gpio_init_structure.Pin);
00742
00743   gpio_init_structure.Pin = AUDIO_SAIx_FS_PIN | AUDIO_SAIx_SCK_PIN | AUDIO_SAIx_SD_PIN;
00744   HAL_GPIO_DeInit(AUDIO_SAIx_SCK_SD_FS_GPIO_PORT, gpio_init_structure.Pin);
00745
00746   gpio_init_structure.Pin = AUDIO_RESET_PIN;
00747   HAL_GPIO_DeInit(AUDIO_RESET_GPIO_PORT, gpio_init_structure.Pin);
00748
00749
00750   /* Disable SAI clock */
00751   AUDIO_SAIx_CLK_DISABLE();
00752
00753
00754   /* GPIO pins clock and DMA clock can be shut down in the applic
00755      by surcgarging this __weak function */
00756 }
00757
00758 /**
00759   * @brief  Clock Config.
00760   * @param  hsai: might be required to set audio peripheral predivider if any.
00761   * @param  AudioFreq: Audio frequency used to play the audio stream.
00762   * @note   This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency()
00763   *         Being __weak it can be overwritten by the application
00764   * @param  Params : pointer on additional configuration parameters, can be NULL.
00765   */
00766 __weak void BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
00767 {
00768   RCC_PeriphCLKInitTypeDef rcc_ex_clk_init_struct;
00769
00770   HAL_RCCEx_GetPeriphCLKConfig(&rcc_ex_clk_init_struct);
00771
00772   /* Set the PLL configuration according to the audio frequency */
00773   if((AudioFreq == AUDIO_FREQUENCY_11K) || (AudioFreq == AUDIO_FREQUENCY_22K) || (AudioFreq == AUDIO_FREQUENCY_44K))
00774   {
00775     /* Configure PLLI2S prescalers */
00776     /* PLLI2S_VCO: VCO_429M
00777     I2S_CLK(first level) = PLLI2S_VCO/PLLI2SQ = 429/2 = 214.5 Mhz
00778     I2S_CLK_x = I2S_CLK(first level)/PLLI2SDIVQ = 214.5/19 = 11.289 Mhz */
00779     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI_PLLI2S;
00780     rcc_ex_clk_init_struct.PLLI2S.PLLI2SN = 429;
00781     rcc_ex_clk_init_struct.PLLI2S.PLLI2SQ = 2;
00782     rcc_ex_clk_init_struct.PLLI2SDivQ = 19;
00783
00784     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00785
00786   }
00787   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_48K), AUDIO_FREQUENCY_96K */
00788   {
00789     /* SAI clock config
00790     PLLSAI_VCO: VCO_344M
00791     I2S_CLK(first level) = PLLI2S_VCO/PLLI2SQ = 344/7 = 49.142 Mhz
00792     I2S_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ = 49.142/1 = 49.142 Mhz */
00793     rcc_ex_clk_init_struct.PeriphClockSelection = RCC_PERIPHCLK_SAI_PLLI2S;
00794     rcc_ex_clk_init_struct.PLLI2S.PLLI2SN = 344;
00795     rcc_ex_clk_init_struct.PLLI2S.PLLI2SQ = 7;
00796     rcc_ex_clk_init_struct.PLLI2SDivQ = 1;
00797
00798     HAL_RCCEx_PeriphCLKConfig(&rcc_ex_clk_init_struct);
00799   }
00800 }
00801
00802 /*******************************************************************************
00803                             Static Functions
00804 *******************************************************************************/
00805 /**
00806   * @brief  Initializes the Audio Codec audio interface (SAI).
00807   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00808   * @note   The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123
00809   *         and user can update this configuration using
00810   */
00811 static uint8_t SAIx_Init(uint32_t AudioFreq)
00812 {
00813   uint8_t ret = AUDIO_OK;
00814
00815   /* Initialize the haudio_out_sai Instance parameter */
00816   haudio_out_sai.Instance = AUDIO_SAIx;
00817
00818   /* Disable SAI peripheral to allow access to SAI internal registers */
00819   __HAL_SAI_DISABLE(&haudio_out_sai);
00820
00821   /* Configure SAI_Block_x
00822   LSBFirst: Disabled
00823   DataSize: 16 */
00824   haudio_out_sai.Init.AudioFrequency = AudioFreq;
00825   haudio_out_sai.Init.ClockSource = SAI_CLKSOURCE_PLLI2S;
00826   haudio_out_sai.Init.AudioMode = SAI_MODEMASTER_TX;
00827   haudio_out_sai.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;
00828   haudio_out_sai.Init.Protocol = SAI_FREE_PROTOCOL;
00829   haudio_out_sai.Init.DataSize = SAI_DATASIZE_16;
00830   haudio_out_sai.Init.FirstBit = SAI_FIRSTBIT_MSB;
00831   haudio_out_sai.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE;
00832   haudio_out_sai.Init.Synchro = SAI_ASYNCHRONOUS;
00833   haudio_out_sai.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE;
00834   haudio_out_sai.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
00835 /*
00836   haudio_out_sai.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_MCKDIV;
00837   haudio_out_sai.Init.SynchroExt     = SAI_SYNCEXT_DISABLE;
00838   haudio_out_sai.Init.Mckdiv         = SAIClockDivider(AudioFreq);
00839   haudio_out_sai.Init.MonoStereoMode = SAI_STEREOMODE;
00840   haudio_out_sai.Init.CompandingMode = SAI_NOCOMPANDING;
00841   haudio_out_sai.Init.TriState       = SAI_OUTPUT_NOTRELEASED;
00842 */
00843
00844   /* Configure SAI_Block_x Frame
00845   Frame Length: 64
00846   Frame active Length: 32
00847   FS Definition: Start frame + Channel Side identification
00848   FS Polarity: FS active Low
00849   FS Offset: FS asserted one bit before the first bit of slot 0 */
00850   haudio_out_sai.FrameInit.FrameLength = 64;
00851   haudio_out_sai.FrameInit.ActiveFrameLength = 32;
00852   haudio_out_sai.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
00853   haudio_out_sai.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
00854   haudio_out_sai.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
00855
00856   /* Configure SAI Block_x Slot
00857   Slot First Bit Offset: 0
00858   Slot Size  : 16
00859   Slot Number: 4
00860   Slot Active: All slot actives */
00861   haudio_out_sai.SlotInit.FirstBitOffset = 0;
00862   haudio_out_sai.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
00863   haudio_out_sai.SlotInit.SlotNumber = 4;
00864   haudio_out_sai.SlotInit.SlotActive = CODEC_AUDIOFRAME_SLOT_0123;
00865
00866   /* Initializes the SAI peripheral*/
00867   if (HAL_SAI_Init(&haudio_out_sai) != HAL_OK)
00868   {
00869     ret = AUDIO_ERROR;
00870   }
00871
00872   /* Enable SAI peripheral to generate MCLK */
00873   __HAL_SAI_ENABLE(&haudio_out_sai);
00874
00875   return ret;
00876
00877 }
00878
00879 /**
00880   * @brief  Deinitializes the Audio Codec audio interface (SAI).
00881   */
00882 static void SAIx_DeInit(void)
00883 {
00884   /* Initialize the hAudioOutSai Instance parameter */
00885   haudio_out_sai.Instance = AUDIO_SAIx;
00886
00887   /* Disable SAI peripheral */
00888   __HAL_SAI_DISABLE(&haudio_out_sai);
00889
00890   HAL_SAI_DeInit(&haudio_out_sai);
00891 }
00892
00893 /**
00894   * @}
00895   */
00896
00897 /** @defgroup STM32469I-Discovery_AUDIO_in_Private_Functions STM32469I Discovery AUDIO IN Private functions
00898   * @{
00899   */
00900
00901 /**
00902   * @brief  Initializes wave recording.
00903   * @note   This function assumes that the I2S input clock (through PLL_R in
00904   *         Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y)
00905   *         is already configured and ready to be used.
00906   * @param  AudioFreq: Audio frequency to be configured for the I2S peripheral.
00907   * @param  BitRes: Audio frequency to be configured for the I2S peripheral.
00908   * @param  ChnlNbr: Audio frequency to be configured for the I2S peripheral.
00909   * @retval AUDIO_OK if correct communication, else wrong communication
00910   */
00911 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00912 {
00913   /* DeInit the I2S */
00914   I2Sx_DeInit();
00915
00916   /* Configure PLL clock */
00917   BSP_AUDIO_IN_ClockConfig(&haudio_in_i2s, NULL);
00918
00919   /* Configure the PDM library */
00920   PDMDecoder_Init(AudioFreq, ChnlNbr, ChnlNbr);
00921
00922   /* Configure the I2S peripheral */
00923   haudio_in_i2s.Instance = AUDIO_I2Sx;
00924   if(HAL_I2S_GetState(&haudio_in_i2s) == HAL_I2S_STATE_RESET)
00925   {
00926     /* Initialize the I2S Msp: this __weak function can be rewritten by the application */
00927     BSP_AUDIO_IN_MspInit(&haudio_in_i2s, NULL);
00928   }
00929
00930   I2Sx_Init(AudioFreq);
00931
00932   /* Return AUDIO_OK when all operations are correctly done */
00933   return AUDIO_OK;
00934 }
00935
00936 /**
00937   * @brief  Starts audio recording.
00938   * @param  pbuf: Main buffer pointer for the recorded data storing
00939   * @param  size: Current size of the recorded buffer
00940   * @retval AUDIO_OK if correct communication, else wrong communication
00941   */
00942 uint8_t BSP_AUDIO_IN_Record(uint16_t* pbuf, uint32_t size)
00943 {
00944   uint32_t ret = AUDIO_ERROR;
00945
00946   /* Start the process receive DMA */
00947   HAL_I2S_Receive_DMA(&haudio_in_i2s, pbuf, size);
00948
00949   /* Return AUDIO_OK when all operations are correctly done */
00950   ret = AUDIO_OK;
00951
00952   return ret;
00953 }
00954
00955 /**
00956   * @brief  Stops audio recording.
00957   * @retval AUDIO_OK if correct communication, else wrong communication
00958   */
00959 uint8_t BSP_AUDIO_IN_Stop(void)
00960 {
00961   uint32_t ret = AUDIO_ERROR;
00962
00963   /* Call the Media layer pause function */
00964   HAL_I2S_DMAPause(&haudio_in_i2s);
00965
00966   /* TIMx Peripheral clock disable */
00967   AUDIO_TIMx_CLK_DISABLE();
00968
00969   /* Return AUDIO_OK when all operations are correctly done */
00970   ret = AUDIO_OK;
00971
00972   return ret;
00973 }
00974
00975 /**
00976   * @brief  Pauses the audio file stream.
00977   * @retval AUDIO_OK if correct communication, else wrong communication
00978   */
00979 uint8_t BSP_AUDIO_IN_Pause(void)
00980 {
00981   /* Call the Media layer pause function */
00982   HAL_I2S_DMAPause(&haudio_in_i2s);
00983
00984   /* Return AUDIO_OK when all operations are correctly done */
00985   return AUDIO_OK;
00986 }
00987
00988 /**
00989   * @brief  Resumes the audio file stream.
00990   * @retval AUDIO_OK if correct communication, else wrong communication
00991   */
00992 uint8_t BSP_AUDIO_IN_Resume(void)
00993 {
00994   /* Call the Media layer pause/resume function */
00995   HAL_I2S_DMAResume(&haudio_in_i2s);
00996
00997   /* Return AUDIO_OK when all operations are correctly done */
00998   return AUDIO_OK;
00999 }
01000
01001 /**
01002   * @brief  Controls the audio in volume level.
01003   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
01004   *         Mute and 100 for Max volume level).
01005   * @retval AUDIO_OK if correct communication, else wrong communication
01006   */
01007 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume)
01008 {
01009   /* Set the Global variable AudioInVolume  */
01010   AudioInVolume = Volume;
01011
01012   /* Return AUDIO_OK when all operations are correctly done */
01013   return AUDIO_OK;
01014 }
01015
01016 /**
01017   * @brief  Deinit the audio IN peripherals.
01018   */
01019 void BSP_AUDIO_IN_DeInit(void)
01020 {
01021   I2Sx_DeInit();
01022     /* DeInit the I2S MSP : this __weak function can be rewritten by the applic */
01023   BSP_AUDIO_IN_MspDeInit(&haudio_in_i2s, NULL);
01024   TIMx_DeInit();
01025 }
01026
01027 /**
01028   * @brief  Converts audio format from PDM to PCM.
01029   * @param  PDMBuf: Pointer to data PDM buffer
01030   * @param  PCMBuf: Pointer to data PCM buffer
01031   * @retval AUDIO_OK if correct communication, else wrong communication
01032   */
01033 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf)
01034 {
01035   uint8_t app_pdm[INTERNAL_BUFF_SIZE*2];
01036   uint8_t byte1 = 0, byte2 = 0;
01037   uint32_t index = 0;
01038
01039   /* PDM Demux */
01040   for(index = 0; index<INTERNAL_BUFF_SIZE/2; index++)
01041   {
01042     byte2 = (PDMBuf[index] >> 8)& 0xFF;
01043     byte1 = (PDMBuf[index] & 0xFF);
01044     app_pdm[(index*2)+1] = Channel_Demux[byte1 & CHANNEL_DEMUX_MASK] | Channel_Demux[byte2 & CHANNEL_DEMUX_MASK] << 4;
01045     app_pdm[(index*2)] = Channel_Demux[(byte1 >> 1) & CHANNEL_DEMUX_MASK] | Channel_Demux[(byte2 >> 1) & CHANNEL_DEMUX_MASK] << 4;
01046   }
01047
01048   for(index = 0; index < DEFAULT_AUDIO_IN_CHANNEL_NBR; index++)
01049   {
01050     /* PDM to PCM filter */
01051     PDM_Filter((uint8_t*)&app_pdm[index], (uint16_t*)&(PCMBuf[index]), &PDM_FilterHandler[index]);
01052   }
01053
01054   /* Return AUDIO_OK when all operations are correctly done */
01055   return AUDIO_OK;
01056 }
01057
01058  /**
01059   * @brief  Rx Transfer completed callbacks.
01060   * @param  hi2s: I2S handle
01061   */
01062 void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s)
01063 {
01064   /* Call the record update function to get the next buffer to fill and its size (size is ignored) */
01065   BSP_AUDIO_IN_TransferComplete_CallBack();
01066 }
01067
01068 /**
01069   * @brief  Rx Half Transfer completed callbacks.
01070   * @param  hi2s: I2S handle
01071   */
01072 void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
01073 {
01074   /* Manage the remaining file size and new address offset: This function
01075      should be coded by user (its prototype is already declared in stm32469i_discovery_audio.h) */
01076   BSP_AUDIO_IN_HalfTransfer_CallBack();
01077 }
01078
01079 /**
01080   * @brief  I2S error callbacks.
01081   * @param  hi2s: I2S handle
01082   */
01083 void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s)
01084 {
01085   /* Manage the error generated on DMA FIFO: This function
01086      should be coded by user (its prototype is already declared in stm32469i_discovery_audio.h) */
01087   BSP_AUDIO_IN_Error_Callback();
01088 }
01089
01090 /**
01091   * @brief  Clock Config.
01092   * @param  hi2s: I2S handle
01093   * @param  Params : pointer on additional configuration parameters, can be NULL.
01094   * @note   This API is called by BSP_AUDIO_IN_Init()
01095   *         Being __weak it can be overwritten by the application
01096   */
01097 __weak void BSP_AUDIO_IN_ClockConfig(I2S_HandleTypeDef *hi2s, void *Params)
01098 {
01099   RCC_PeriphCLKInitTypeDef RCC_ExCLKInitStruct;
01100
01101   HAL_RCCEx_GetPeriphCLKConfig(&RCC_ExCLKInitStruct);
01102   RCC_ExCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
01103   RCC_ExCLKInitStruct.PLLI2S.PLLI2SN = 384;
01104   RCC_ExCLKInitStruct.PLLI2S.PLLI2SR = 2;
01105   HAL_RCCEx_PeriphCLKConfig(&RCC_ExCLKInitStruct);
01106 }
01107
01108 /**
01109   * @brief  User callback when record buffer is filled.
01110   */
01111 __weak void BSP_AUDIO_IN_TransferComplete_CallBack(void)
01112 {
01113   /* This function should be implemented by the user application.
01114      It is called into this driver when the current buffer is filled
01115      to prepare the next buffer pointer and its size. */
01116 }
01117
01118 /**
01119   * @brief  Manages the DMA Half Transfer complete event.
01120   */
01121 __weak void BSP_AUDIO_IN_HalfTransfer_CallBack(void)
01122 {
01123   /* This function should be implemented by the user application.
01124      It is called into this driver when the current buffer is filled
01125      to prepare the next buffer pointer and its size. */
01126 }
01127
01128 /**
01129   * @brief  Audio IN Error callback function.
01130   */
01131 __weak void BSP_AUDIO_IN_Error_Callback(void)
01132 {
01133   /* This function is called when an Interrupt due to transfer error on or peripheral
01134      error occurs. */
01135 }
01136
01137 /**
01138   * @brief  BSP AUDIO IN MSP Init.
01139   * @param  hi2s: I2S handle
01140   * @param  Params : pointer on additional configuration parameters, can be NULL.
01141   */
01142 __weak void BSP_AUDIO_IN_MspInit(I2S_HandleTypeDef *hi2s, void *Params)
01143 {
01144   static DMA_HandleTypeDef hdma_i2s_rx;
01145   GPIO_InitTypeDef  gpio_init_structure;
01146
01147   /* Configure the Timer which clocks the MEMS */
01148   /* Moved inside MSP to allow applic to redefine the TIMx_MspInit */
01149   TIMx_Init();
01150
01151   /* Enable I2S clock */
01152   AUDIO_I2Sx_CLK_ENABLE();
01153
01154   /* Enable SCK and SD GPIO clock */
01155   AUDIO_I2Sx_SD_GPIO_CLK_ENABLE();
01156   AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE();
01157   /* CODEC_I2S pins configuration: SCK and SD pins */
01158   gpio_init_structure.Pin = AUDIO_I2Sx_SCK_PIN;
01159   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01160   gpio_init_structure.Pull = GPIO_NOPULL;
01161   gpio_init_structure.Speed = GPIO_SPEED_FAST;
01162   gpio_init_structure.Alternate = AUDIO_I2Sx_SCK_AF;
01163   HAL_GPIO_Init(AUDIO_I2Sx_SCK_GPIO_PORT, &gpio_init_structure);
01164
01165   gpio_init_structure.Pin = AUDIO_I2Sx_SD_PIN;
01166   gpio_init_structure.Alternate = AUDIO_I2Sx_SD_AF;
01167   HAL_GPIO_Init(AUDIO_I2Sx_SD_GPIO_PORT, &gpio_init_structure);
01168
01169   /* Enable PD12 (I2S3_CLK) connected to PB3 via jamper JP4 */
01170   /* on Eval this was provided by PC6 (initialized in TIMx section) */
01171 /*
01172   gpio_init_structure.Pin = GPIO_PIN_12;
01173   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01174   gpio_init_structure.Pull = GPIO_NOPULL;
01175   gpio_init_structure.Speed = GPIO_SPEED_FAST;
01176   gpio_init_structure.Alternate = AUDIO_I2Sx_SCK_AF;
01177   HAL_GPIO_Init(GPIOD, &gpio_init_structure); */
01178
01179
01180   /* Enable the DMA clock */
01181   AUDIO_I2Sx_DMAx_CLK_ENABLE();
01182
01183   if(hi2s->Instance == AUDIO_I2Sx)
01184   {
01185     /* Configure the hdma_i2sRx handle parameters */
01186     hdma_i2s_rx.Init.Channel             = AUDIO_I2Sx_DMAx_CHANNEL;
01187     hdma_i2s_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01188     hdma_i2s_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
01189     hdma_i2s_rx.Init.MemInc              = DMA_MINC_ENABLE;
01190     hdma_i2s_rx.Init.PeriphDataAlignment = AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE;
01191     hdma_i2s_rx.Init.MemDataAlignment    = AUDIO_I2Sx_DMAx_MEM_DATA_SIZE;
01192     hdma_i2s_rx.Init.Mode                = DMA_CIRCULAR;
01193     hdma_i2s_rx.Init.Priority            = DMA_PRIORITY_HIGH;
01194     hdma_i2s_rx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
01195     hdma_i2s_rx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
01196     hdma_i2s_rx.Init.MemBurst            = DMA_MBURST_SINGLE;
01197     hdma_i2s_rx.Init.PeriphBurst         = DMA_MBURST_SINGLE;
01198
01199     hdma_i2s_rx.Instance = AUDIO_I2Sx_DMAx_STREAM;
01200
01201     /* Associate the DMA handle */
01202     __HAL_LINKDMA(hi2s, hdmarx, hdma_i2s_rx);
01203
01204     /* Deinitialize the Stream for new transfer */
01205     HAL_DMA_DeInit(&hdma_i2s_rx);
01206
01207     /* Configure the DMA Stream */
01208     HAL_DMA_Init(&hdma_i2s_rx);
01209   }
01210
01211   /* I2S DMA IRQ Channel configuration */
01212   HAL_NVIC_SetPriority(AUDIO_I2Sx_DMAx_IRQ, AUDIO_IN_IRQ_PREPRIO, 0);
01213   HAL_NVIC_EnableIRQ(AUDIO_I2Sx_DMAx_IRQ);
01214 }
01215
01216 /**
01217   * @brief  DeInitializes BSP_AUDIO_IN MSP.
01218   * @param  hi2s: I2S handle
01219   * @param  Params : pointer on additional configuration parameters, can be NULL.
01220   */
01221 __weak void BSP_AUDIO_IN_MspDeInit(I2S_HandleTypeDef *hi2s, void *Params)
01222 {
01223   GPIO_InitTypeDef  gpio_init_structure;
01224
01225   /* I2S DMA IRQ Channel deactivation */
01226   HAL_NVIC_DisableIRQ(AUDIO_I2Sx_DMAx_IRQ);
01227
01228   if(hi2s->Instance == AUDIO_I2Sx)
01229   {
01230     /* Deinitialize the Stream for new transfer */
01231     HAL_DMA_DeInit(hi2s->hdmarx);
01232   }
01233
01234  /* Disable I2S block */
01235   __HAL_I2S_DISABLE(hi2s);
01236
01237   /* Disable pins: SCK and SD pins */
01238   gpio_init_structure.Pin = AUDIO_I2Sx_SCK_PIN;
01239   HAL_GPIO_DeInit(AUDIO_I2Sx_SCK_GPIO_PORT, gpio_init_structure.Pin);
01240   gpio_init_structure.Pin = AUDIO_I2Sx_SD_PIN;
01241   HAL_GPIO_DeInit(AUDIO_I2Sx_SD_GPIO_PORT, gpio_init_structure.Pin);
01242
01243   /* Disable I2S clock */
01244   AUDIO_I2Sx_CLK_DISABLE();
01245
01246   /* GPIO pins clock and DMA clock can be shut down in the applic
01247      by surcgarging this __weak function */
01248 }
01249
01250 /*******************************************************************************
01251                             Static Functions
01252 *******************************************************************************/
01253
01254 /**
01255   * @brief  Initializes the PDM library.
01256   * @param  AudioFreq: Audio sampling frequency
01257   * @param  ChnlNbrIn: Number of input audio channels in the PDM buffer
01258   * @param  ChnlNbrOut: Number of desired output audio channels in the  resulting PCM buffer
01259   *         Number of audio channels (1: mono; 2: stereo)
01260   */
01261 static void PDMDecoder_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
01262 {
01263   uint32_t index = 0;
01264
01265   /* Enable CRC peripheral to unlock the PDM library */
01266   __HAL_RCC_CRC_CLK_ENABLE();
01267
01268   for(index = 0; index < ChnlNbrIn; index++)
01269   {
01270     /* Init PDM filters */
01271     PDM_FilterHandler[index].bit_order  = PDM_FILTER_BIT_ORDER_LSB;
01272     PDM_FilterHandler[index].endianness = PDM_FILTER_ENDIANNESS_LE;
01273     PDM_FilterHandler[index].high_pass_tap = 2122358088;
01274     PDM_FilterHandler[index].out_ptr_channels = ChnlNbrOut;
01275     PDM_FilterHandler[index].in_ptr_channels  = ChnlNbrIn;
01276     PDM_Filter_Init((PDM_Filter_Handler_t *)(&PDM_FilterHandler[index]));
01277
01278     /* PDM lib config phase */
01279     PDM_FilterConfig[index].output_samples_number = AudioFreq/1000;
01280     PDM_FilterConfig[index].mic_gain = 24;
01281     PDM_FilterConfig[index].decimation_factor = PDM_FILTER_DEC_FACTOR_64;
01282     PDM_Filter_setConfig((PDM_Filter_Handler_t *)&PDM_FilterHandler[index], &PDM_FilterConfig[index]);
01283   }
01284 }
01285
01286 /**
01287   * @brief  Initializes the Audio Codec audio interface (I2S)
01288   * @note   This function assumes that the I2S input clock (through dedicated PLLI2S_R)
01289   *         is already configured and ready to be used.
01290   * @param  AudioFreq: Audio frequency to be configured for the I2S peripheral.
01291   */
01292 static void I2Sx_Init(uint32_t AudioFreq)
01293 {
01294   /* Initialize the haudio_in_i2s Instance parameter */
01295   haudio_in_i2s.Instance = AUDIO_I2Sx;
01296
01297  /* Disable I2S block */
01298   __HAL_I2S_DISABLE(&haudio_in_i2s);
01299
01300   /* I2S2 peripheral configuration */
01301   haudio_in_i2s.Init.AudioFreq = 4 * AudioFreq;
01302   haudio_in_i2s.Init.ClockSource = I2S_CLOCK_PLL;
01303   haudio_in_i2s.Init.CPOL = I2S_CPOL_LOW;
01304   haudio_in_i2s.Init.DataFormat = I2S_DATAFORMAT_16B;
01305   haudio_in_i2s.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
01306   haudio_in_i2s.Init.Mode = I2S_MODE_MASTER_RX;
01307   haudio_in_i2s.Init.Standard = I2S_STANDARD_LSB;
01308
01309   /* Init the I2S */
01310   HAL_I2S_Init(&haudio_in_i2s);
01311
01312  /* Disable I2S block */
01313   __HAL_I2S_ENABLE(&haudio_in_i2s);
01314
01315 }
01316
01317 /**
01318   * @brief  Deinitializes the Audio Codec audio interface (I2S).
01319   */
01320 static void I2Sx_DeInit(void)
01321 {
01322   /* Initialize the hAudioInI2s Instance parameter */
01323   haudio_in_i2s.Instance = AUDIO_I2Sx;
01324
01325  /* Disable I2S block */
01326   __HAL_I2S_DISABLE(&haudio_in_i2s);
01327
01328   /* DeInit the I2S */
01329   HAL_I2S_DeInit(&haudio_in_i2s);
01330 }
01331
01332
01333 /**
01334   * @brief  Initializes the TIM INput Capture MSP.
01335   * @param  htim: TIM handle
01336   */
01337 static void TIMx_IC_MspInit(TIM_HandleTypeDef *htim)
01338 {
01339   GPIO_InitTypeDef   gpio_init_structure;
01340
01341   /* Enable peripherals and GPIO Clocks --------------------------------------*/
01342   /* TIMx Peripheral clock enable */
01343   AUDIO_TIMx_CLK_ENABLE();
01344
01345   /* Enable GPIO Channels Clock */
01346   AUDIO_TIMx_GPIO_CLK_ENABLE();
01347
01348   /* Configure I/Os ----------------------------------------------------------*/
01349   /* Common configuration for all channels */
01350   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
01351   gpio_init_structure.Pull = GPIO_NOPULL;
01352   gpio_init_structure.Speed = GPIO_SPEED_HIGH;
01353   gpio_init_structure.Alternate = AUDIO_TIMx_AF;
01354
01355   /* Configure TIM input channel */
01356   gpio_init_structure.Pin = AUDIO_TIMx_IN_GPIO_PIN;
01357   HAL_GPIO_Init(AUDIO_TIMx_GPIO_PORT, &gpio_init_structure);
01358
01359   /* Configure TIM output channel */
01360   gpio_init_structure.Pin = AUDIO_TIMx_OUT_GPIO_PIN;
01361   HAL_GPIO_Init(AUDIO_TIMx_GPIO_PORT, &gpio_init_structure);
01362 }
01363
01364 /**
01365   * @brief  Initializes the TIM INput Capture MSP.
01366   * @param  htim: TIM handle
01367   */
01368 static void TIMx_IC_MspDeInit(TIM_HandleTypeDef *htim)
01369 {
01370     /* Disable TIMx Peripheral clock  */
01371     AUDIO_TIMx_CLK_DISABLE();
01372
01373     /* GPIO pins clock and DMA clock can be shut down in the applic
01374        by surcgarging this __weak function */
01375 }
01376
01377 /**
01378   * @brief  Configure TIM as a clock divider by 2.
01379   *         I2S_SCK is externally connected to TIMx input channel
01380   */
01381 static void TIMx_Init(void)
01382 {
01383   TIM_IC_InitTypeDef     s_ic_config;
01384   TIM_OC_InitTypeDef     s_oc_config;
01385   TIM_ClockConfigTypeDef s_clk_source_config;
01386   TIM_SlaveConfigTypeDef s_slave_config;
01387
01388   /* Configure the TIM peripheral --------------------------------------------*/
01389   /* Set TIMx instance */
01390   haudio_tim.Instance = AUDIO_TIMx;
01391   /* Timer Input Capture Configuration Structure declaration */
01392    /* Initialize TIMx peripheral as follow:
01393        + Period = 0xFFFF
01394        + Prescaler = 0
01395        + ClockDivision = 0
01396        + Counter direction = Up
01397   */
01398   haudio_tim.Init.Period        = 1;
01399   haudio_tim.Init.Prescaler     = 0;
01400   haudio_tim.Init.ClockDivision = 0;
01401   haudio_tim.Init.CounterMode   = TIM_COUNTERMODE_UP;
01402
01403   /* Initialize the TIMx peripheral with the structure above */
01404   TIMx_IC_MspInit(&haudio_tim);
01405   HAL_TIM_IC_Init(&haudio_tim);
01406
01407   /* Configure the Input Capture channel -------------------------------------*/
01408   /* Configure the Input Capture of channel 2 */
01409   s_ic_config.ICPolarity  = TIM_ICPOLARITY_FALLING;
01410   s_ic_config.ICSelection = TIM_ICSELECTION_DIRECTTI;
01411   s_ic_config.ICPrescaler = TIM_ICPSC_DIV1;
01412   s_ic_config.ICFilter    = 0;
01413   HAL_TIM_IC_ConfigChannel(&haudio_tim, &s_ic_config, AUDIO_TIMx_IN_CHANNEL);
01414
01415   /* Select external clock mode 1 */
01416   s_clk_source_config.ClockSource = TIM_CLOCKSOURCE_ETRMODE1;
01417   s_clk_source_config.ClockPolarity = TIM_CLOCKPOLARITY_NONINVERTED;
01418   s_clk_source_config.ClockPrescaler = TIM_CLOCKPRESCALER_DIV1;
01419   s_clk_source_config.ClockFilter = 0;
01420   HAL_TIM_ConfigClockSource(&haudio_tim, &s_clk_source_config);
01421
01422   /* Select Input Channel as input trigger */
01423   s_slave_config.InputTrigger = TIM_TS_TI1FP1;
01424   s_slave_config.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
01425   s_slave_config.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
01426   s_slave_config.TriggerPrescaler = TIM_CLOCKPRESCALER_DIV1;
01427   s_slave_config.TriggerFilter = 0;
01428   HAL_TIM_SlaveConfigSynchronization(&haudio_tim, &s_slave_config);
01429
01430   /* Output Compare PWM Mode configuration: Channel2 */
01431   s_oc_config.OCMode = TIM_OCMODE_PWM1;
01432   s_oc_config.OCIdleState = TIM_OCIDLESTATE_SET;
01433   s_oc_config.Pulse = 1;
01434   s_oc_config.OCPolarity = TIM_OCPOLARITY_HIGH;
01435   s_oc_config.OCNPolarity = TIM_OCNPOLARITY_HIGH;
01436   s_oc_config.OCFastMode = TIM_OCFAST_DISABLE;
01437   s_oc_config.OCNIdleState = TIM_OCNIDLESTATE_SET;
01438
01439   /* Initialize the TIM3 Channel2 with the structure above */
01440   HAL_TIM_PWM_ConfigChannel(&haudio_tim, &s_oc_config, AUDIO_TIMx_OUT_CHANNEL);
01441
01442   /* Start the TIM3 Channel2 */
01443   HAL_TIM_PWM_Start(&haudio_tim, AUDIO_TIMx_OUT_CHANNEL);
01444
01445   /* Start the TIM3 Channel1 */
01446   HAL_TIM_IC_Start(&haudio_tim, AUDIO_TIMx_IN_CHANNEL);
01447 }
01448
01449 /**
01450   * @brief  Configure TIM as a clock divider by 2.
01451   *         I2S_SCK is externally connected to TIMx input channel
01452   */
01453 static void TIMx_DeInit(void)
01454 {
01455   haudio_tim.Instance = AUDIO_TIMx;
01456
01457   /* Stop the TIM3 Channel2 */
01458   HAL_TIM_PWM_Stop(&haudio_tim, AUDIO_TIMx_OUT_CHANNEL);
01459   /* Stop the TIM3 Channel1 */
01460   HAL_TIM_IC_Stop(&haudio_tim, AUDIO_TIMx_IN_CHANNEL);
01461
01462   HAL_TIM_IC_DeInit(&haudio_tim);
01463
01464   /* Initialize the TIMx peripheral with the structure above */
01465   TIMx_IC_MspDeInit(&haudio_tim);
01466 }
01467
01468 /**
01469   * @}
01470   */
01471
01472 /**
01473   * @}
01474   */
01475
01476 /**
01477   * @}
01478   */
01479
01480 /**
01481   * @}
01482   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_audio.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_audio.h
00004   * @author  MCD Application Team
00005   * @version V2.0.0
00006   * @date    27-January-2017
00007   * @brief   This file contains the common defines and functions prototypes for
00008   *          the stm32469i_discovery_audio.c driver.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * Copyright (c) 2017 STMicroelectronics.
00013   * All rights reserved.
00014   *
00015   * This software is licensed under terms that can be found in the LICENSE file
00016   * in the root directory of this software component.
00017   * If no LICENSE file comes with this software, it is provided AS-IS.
00018   *
00019   ******************************************************************************
00020   */
00021
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32469I_DISCOVERY_AUDIO_H
00024 #define __STM32469I_DISCOVERY_AUDIO_H
00025
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029
00030 /* Includes ------------------------------------------------------------------*/
00031 #if defined(BSP_AUDIO_USE_RTOS)
00032 #include "k_mem.h"
00033 #else
00034 #include <stdlib.h>
00035 #endif
00036
00037 /* Include audio component Driver */
00038 #include "../Components/cs43l22/cs43l22.h"
00039 #include "stm32469i_discovery.h"
00040 #include "../../../Middlewares/ST/STM32_Audio/Addons/PDM/Inc/pdm2pcm_glo.h"
00041
00042 /** @addtogroup BSP
00043   * @{
00044   */
00045
00046 /** @addtogroup STM32469I_Discovery
00047   * @{
00048   */
00049
00050 /** @addtogroup STM32469I-Discovery_AUDIO
00051   * @{
00052   */
00053
00054 /** @defgroup STM32469I-Discovery_AUDIO_Exported_Types STM32469I Discovery AUDIO Exported Types
00055   * @{
00056   */
00057 /**
00058   * @}
00059   */
00060
00061 /** @defgroup STM32469I-Discovery_AUDIO_Exported_Constants  STM32469I Discovery AUDIO Exported Constants
00062   * @{
00063   */
00064
00065 /** @defgroup BSP_Audio_Out_Option BSP AUDIO OUT Option
00066   * @{
00067   */
00068 #define BSP_AUDIO_OUT_CIRCULARMODE      ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */
00069 #define BSP_AUDIO_OUT_NORMALMODE        ((uint32_t)0x00000002) /* BUFFER NORMAL MODE   */
00070 #define BSP_AUDIO_OUT_STEREOMODE        ((uint32_t)0x00000004) /* STEREO MODE          */
00071 #define BSP_AUDIO_OUT_MONOMODE          ((uint32_t)0x00000008) /* MONO MODE            */
00072 /**
00073   * @}
00074   */
00075
00076 /*------------------------------------------------------------------------------
00077                           USER SAI defines parameters
00078  -----------------------------------------------------------------------------*/
00079 /** @defgroup CODEC_AudioFrame_SLOT_TDMMode  STM32469I Discovery Audio Slot TDM mode
00080   * @brief In W8994 codec the Audio frame contains 4 slots : TDM Mode
00081   * TDM format :
00082   * +------------------|------------------|--------------------|-------------------+
00083   * | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right  | CODEC_SLOT1 Right |
00084   * +------------------------------------------------------------------------------+
00085   * @{
00086   */
00087 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */
00088 #define CODEC_AUDIOFRAME_SLOT_0123                   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
00089 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */
00090 #define CODEC_AUDIOFRAME_SLOT_02                     SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
00091 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */
00092 #define CODEC_AUDIOFRAME_SLOT_13                     SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
00093 /**
00094   * @}
00095   */
00096
00097 /* SAI peripheral configuration defines */
00098 #define AUDIO_SAIx                           SAI1_Block_A
00099 #define AUDIO_SAIx_CLK_ENABLE()              __HAL_RCC_SAI1_CLK_ENABLE()
00100 #define AUDIO_SAIx_CLK_DISABLE()             __HAL_RCC_SAI1_CLK_DISABLE()
00101 #define AUDIO_SAIx_MCLK_SCK_SD_FS_AF         GPIO_AF6_SAI1
00102
00103 #define AUDIO_SAIx_MCLK_ENABLE()             __HAL_RCC_GPIOG_CLK_ENABLE()
00104 #define AUDIO_SAIx_MCLK_DISABLE()            __HAL_RCC_GPIOG_CLK_DISABLE()
00105
00106 #define AUDIO_SAIx_MCK_PIN                   GPIO_PIN_7
00107 #define AUDIO_SAIx_MCLK_GPIO_PORT            GPIOG
00108
00109 #define AUDIO_SAIx_SCK_SD_FS_ENABLE()        __HAL_RCC_GPIOE_CLK_ENABLE()
00110 #define AUDIO_SAIx_SCK_SD_FS_DISABLE()       __HAL_RCC_GPIOE_CLK_DISABLE()
00111 #define AUDIO_SAIx_FS_PIN                    GPIO_PIN_4
00112 #define AUDIO_SAIx_SCK_PIN                   GPIO_PIN_5
00113 #define AUDIO_SAIx_SD_PIN                    GPIO_PIN_6
00114 #define AUDIO_SAIx_SCK_SD_FS_GPIO_PORT       GPIOE
00115
00116 #define AUDIO_RESET_ENABLE()                 __HAL_RCC_GPIOE_CLK_ENABLE()
00117 #define AUDIO_RESET_DISABLE()                __HAL_RCC_GPIOE_CLK_DISABLE()
00118 #define AUDIO_RESET_PIN                      GPIO_PIN_2
00119 #define AUDIO_RESET_GPIO_PORT                GPIOE
00120
00121 /* SAI DMA Stream definitions */
00122 #define AUDIO_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00123 #define AUDIO_SAIx_DMAx_CLK_DISABLE()        __HAL_RCC_DMA2_CLK_DISABLE()
00124 #define AUDIO_SAIx_DMAx_STREAM               DMA2_Stream3
00125 #define AUDIO_SAIx_DMAx_CHANNEL              DMA_CHANNEL_0
00126 #define AUDIO_SAIx_DMAx_IRQ                  DMA2_Stream3_IRQn
00127 #define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00128 #define AUDIO_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00129 #define DMA_MAX_SZE                          0xFFFF
00130
00131 #define AUDIO_SAIx_DMAx_IRQHandler           DMA2_Stream3_IRQHandler
00132
00133 /* Select the interrupt preemption priority for the DMA interrupt */
00134 #define AUDIO_OUT_IRQ_PREPRIO           5   /* Select the preemption priority level(0 is the highest) */
00135
00136 /* Disable SAIx PLL */
00137 #define AUDIO_SAIx_PLL_DISABLE()             HAL_RCCEx_DisablePLLSAI1()
00138 /*------------------------------------------------------------------------------
00139                         AUDIO IN CONFIGURATION
00140 ------------------------------------------------------------------------------*/
00141 /* SPI Configuration defines */
00142 #define AUDIO_I2Sx                           SPI3
00143 #define AUDIO_I2Sx_CLK_ENABLE()              __HAL_RCC_SPI3_CLK_ENABLE()
00144 #define AUDIO_I2Sx_CLK_DISABLE()             __HAL_RCC_SPI3_CLK_DISABLE()
00145 #define AUDIO_I2Sx_SCK_PIN                   GPIO_PIN_3
00146 #define AUDIO_I2Sx_SCK_GPIO_PORT             GPIOB
00147 #define AUDIO_I2Sx_SCK_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00148 #define AUDIO_I2Sx_SCK_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOB_CLK_DISABLE()
00149 #define AUDIO_I2Sx_SCK_AF                    GPIO_AF6_SPI3
00150
00151 #define AUDIO_I2Sx_SD_PIN                    GPIO_PIN_6
00152 #define AUDIO_I2Sx_SD_GPIO_PORT              GPIOD
00153 #define AUDIO_I2Sx_SD_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOD_CLK_ENABLE()
00154 #define AUDIO_I2Sx_SD_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOD_CLK_DISABLE()
00155 #define AUDIO_I2Sx_SD_AF                     GPIO_AF5_I2S3ext
00156
00157 /* I2S DMA Stream Rx definitions */
00158 #define AUDIO_I2Sx_DMAx_CLK_ENABLE()        __HAL_RCC_DMA1_CLK_ENABLE()
00159 #define AUDIO_I2Sx_DMAx_CLK_DISABLE()       __HAL_RCC_DMA1_CLK_DISABLE()
00160 #define AUDIO_I2Sx_DMAx_STREAM              DMA1_Stream2
00161 #define AUDIO_I2Sx_DMAx_CHANNEL             DMA_CHANNEL_0
00162 #define AUDIO_I2Sx_DMAx_IRQ                 DMA1_Stream2_IRQn
00163 #define AUDIO_I2Sx_DMAx_PERIPH_DATA_SIZE    DMA_PDATAALIGN_HALFWORD
00164 #define AUDIO_I2Sx_DMAx_MEM_DATA_SIZE       DMA_MDATAALIGN_HALFWORD
00165
00166 #define AUDIO_I2Sx_DMAx_IRQHandler          DMA1_Stream2_IRQHandler
00167
00168 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
00169 #define AUDIO_IN_IRQ_PREPRIO                ((uint32_t)6)   /* Select the preemption priority level(0 is the highest) */
00170
00171
00172 /* Two channels are used:
00173    - one channel as input which is connected to I2S SCK in stereo mode
00174    - one channel as outupt which divides the frequency on the input
00175 */
00176
00177 #define AUDIO_TIMx_CLK_ENABLE()             __HAL_RCC_TIM4_CLK_ENABLE()
00178 #define AUDIO_TIMx_CLK_DISABLE()            __HAL_RCC_TIM4_CLK_DISABLE()
00179 #define AUDIO_TIMx                          TIM4
00180 #define AUDIO_TIMx_IN_CHANNEL               TIM_CHANNEL_1
00181 #define AUDIO_TIMx_OUT_CHANNEL              TIM_CHANNEL_2 /* Select channel 2 as output */
00182 #define AUDIO_TIMx_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOD_CLK_ENABLE()
00183 #define AUDIO_TIMx_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOD_CLK_DISABLE()
00184 #define AUDIO_TIMx_GPIO_PORT                GPIOD
00185 #define AUDIO_TIMx_IN_GPIO_PIN              GPIO_PIN_12
00186 #define AUDIO_TIMx_OUT_GPIO_PIN             GPIO_PIN_13
00187 #define AUDIO_TIMx_AF                       GPIO_AF2_TIM4
00188
00189 /*------------------------------------------------------------------------------
00190              CONFIGURATION: Audio Driver Configuration parameters
00191 ------------------------------------------------------------------------------*/
00192
00193 #define AUDIODATA_SIZE                      2   /* 16-bits audio data size */
00194
00195 /* Audio status definition */
00196 #define AUDIO_OK                            ((uint8_t)0)
00197 #define AUDIO_ERROR                         ((uint8_t)1)
00198 #define AUDIO_TIMEOUT                       ((uint8_t)2)
00199
00200 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
00201 #define DEFAULT_AUDIO_IN_FREQ               I2S_AUDIOFREQ_16K
00202 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     ((uint8_t)16)
00203 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        ((uint8_t)2) /* Mono = 1, Stereo = 2 */
00204 #define DEFAULT_AUDIO_IN_VOLUME             ((uint16_t)64)
00205
00206 /* PDM buffer input size */
00207 #define INTERNAL_BUFF_SIZE                  (128*DEFAULT_AUDIO_IN_FREQ/16000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
00208 /* PCM buffer output size */
00209 #define PCM_OUT_SIZE                        (DEFAULT_AUDIO_IN_FREQ/1000*DEFAULT_AUDIO_IN_CHANNEL_NBR)
00210 #define CHANNEL_DEMUX_MASK                  ((uint8_t)0x55)
00211
00212 /*------------------------------------------------------------------------------
00213                     OPTIONAL Configuration defines parameters
00214 ------------------------------------------------------------------------------*/
00215
00216 /* Delay for the Codec to be correctly reset */
00217 #define CODEC_RESET_DELAY           ((uint8_t)5)
00218
00219 /*------------------------------------------------------------------------------
00220                             OUTPUT DEVICES definition
00221 ------------------------------------------------------------------------------*/
00222
00223 /**
00224   * @}
00225   */
00226
00227 /** @defgroup STM32469I-Discovery_AUDIO_Exported_Variables  STM32469I-Discovery AUDIO Exported Variables
00228   * @{
00229   */
00230 extern __IO uint16_t AudioInVolume;
00231  /**
00232   * @}
00233   */
00234
00235 /** @defgroup STM32469I-Discovery_AUDIO_Exported_Macros STM32469I-Discovery AUDIO Exported Macros
00236   * @{
00237   */
00238 #define DMA_MAX(x)           (((x) <= DMA_MAX_SZE)? (x):DMA_MAX_SZE)
00239 /**
00240   * @}
00241   */
00242
00243 /** @defgroup STM32469I-Discovery_AUDIO_OUT_Exported_Functions  STM32469I Discovery AUDIO OUT Exported Functions
00244   * @{
00245   */
00246 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00247 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size);
00248 void    BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00249 uint8_t BSP_AUDIO_OUT_Pause(void);
00250 uint8_t BSP_AUDIO_OUT_Resume(void);
00251 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00252 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00253 void    BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00254 void    BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot);
00255 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00256 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00257 void    BSP_AUDIO_OUT_DeInit(void);
00258
00259 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00260 /* This function is called when the requested data has been completely transferred.*/
00261 void    BSP_AUDIO_OUT_TransferComplete_CallBack(void);
00262
00263 /* This function is called when half of the requested buffer has been transferred. */
00264 void    BSP_AUDIO_OUT_HalfTransfer_CallBack(void);
00265
00266 /* This function is called when an Interrupt due to transfer error on or peripheral
00267    error occurs. */
00268 void    BSP_AUDIO_OUT_Error_CallBack(void);
00269
00270 /* These function can be modified in case the current settings (e.g. DMA stream)
00271    need to be changed for specific application needs */
00272 void  BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params);
00273 void  BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params);
00274 void  BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params);
00275
00276 /**
00277   * @}
00278   */
00279
00280 /** @defgroup STM32469I-Discovery_AUDIO_IN_Exported_Functions  STM32469I Discovery AUDIO IN Exported Functions
00281   * @{
00282   */
00283 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00284 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
00285 uint8_t BSP_AUDIO_IN_Stop(void);
00286 uint8_t BSP_AUDIO_IN_Pause(void);
00287 uint8_t BSP_AUDIO_IN_Resume(void);
00288 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume);
00289 void    BSP_AUDIO_IN_DeInit(void);
00290 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t* PDMBuf, uint16_t* PCMBuf);
00291 /* User Callbacks: user has to implement these functions in his code if they are needed. */
00292 /* This function should be implemented by the user application.
00293    It is called into this driver when the current buffer is filled to prepare the next
00294    buffer pointer and its size. */
00295 void    BSP_AUDIO_IN_TransferComplete_CallBack(void);
00296 void    BSP_AUDIO_IN_HalfTransfer_CallBack(void);
00297
00298 /* This function is called when an Interrupt due to transfer error on or peripheral
00299    error occurs. */
00300 void    BSP_AUDIO_IN_Error_Callback(void);
00301
00302 /* These function can be modified in case the current settings (e.g. DMA stream)
00303    need to be changed for specific application needs */
00304 void  BSP_AUDIO_IN_ClockConfig(I2S_HandleTypeDef *hi2s, void *Params);
00305 void  BSP_AUDIO_IN_MspInit(I2S_HandleTypeDef *hi2s, void *Params);
00306 void  BSP_AUDIO_IN_MspDeInit(I2S_HandleTypeDef *hi2s, void *Params);
00307
00308 /**
00309   * @}
00310   */
00311
00312 /**
00313   * @}
00314   */
00315
00316 /**
00317   * @}
00318   */
00319
00320 /**
00321   * @}
00322   */
00323
00324 #ifdef __cplusplus
00325 }
00326 #endif
00327
00328 #endif /* __STM32469I_DISCOVERY_AUDIO_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_eeprom.c Source File

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


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_eeprom.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_eeprom.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_eeprom.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains all the functions prototypes for
00006   *          the stm32469i_discovery_eeprom.c firmware driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32F469I_DISCOVERY_EEPROM_H
00022 #define __STM32F469I_DISCOVERY_EEPROM_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32469i_discovery.h"
00030
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034
00035 /** @addtogroup STM32469I_Discovery
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32469I-Discovery_EEPROM
00040   * @brief This file includes the I2C EEPROM driver of STM32469I-Discovery board.
00041   * @{
00042   */
00043
00044 /** @defgroup STM32469I-Discovery_EEPROM_Exported_Types STM32469I Discovery EEPROM Exported Types
00045   * @{
00046   */
00047 /**
00048   * @}
00049   */
00050
00051 /** @defgroup STM32469I-Discovery_EEPROM_Exported_Constants STM32469I Discovery EEPROM Exported Constants
00052   * @{
00053   */
00054 /* EEPROM hardware address and page size */
00055 #define EEPROM_PAGESIZE             ((uint8_t)4)
00056 #define EEPROM_MAX_SIZE             ((uint16_t)0x2000) /* 64Kbit */
00057
00058 /* Maximum Timeout values for flags and events waiting loops.
00059 This timeout is based on systick set to 1ms*/
00060 /* Timeout for read based if read all the EEPROM : EEPROM_MAX_SIZE * I2C_SPEED (640ms) */
00061 #define EEPROM_READ_TIMEOUT         ((uint32_t)(1000))
00062 /* Timeout for write based on max write which is EEPROM_PAGESIZE bytes: EEPROM_PAGESIZE * I2C_SPEED (320us) */
00063 #define EEPROM_WRITE_TIMEOUT         ((uint32_t)(10))
00064
00065 /* Maximum number of trials for EEPROM_WaitEepromStandbyState() function */
00066 #define EEPROM_MAX_TRIALS           3000
00067
00068 #define EEPROM_OK                   0
00069 #define EEPROM_FAIL                 1
00070 #define EEPROM_TIMEOUT              2
00071 /**
00072   * @}
00073   */
00074
00075 /** @defgroup STM32469I-Discovery_EEPROM_Exported_Macros STM32469I Discovery EEPROM Exported Macros
00076   * @{
00077   */
00078 /**
00079   * @}
00080   */
00081
00082 /** @defgroup STM32469I-Discovery_EEPROM_Exported_Functions STM32469I Discovery EEPROM Exported Functions
00083   * @{
00084   */
00085 uint32_t BSP_EEPROM_Init(void);
00086 uint8_t  BSP_EEPROM_DeInit(void);
00087 uint32_t BSP_EEPROM_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead);
00088 uint32_t BSP_EEPROM_WritePage(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t* NumByteToWrite);
00089 uint32_t BSP_EEPROM_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
00090 uint32_t BSP_EEPROM_WaitEepromStandbyState(void);
00091
00092 /* USER Callbacks: This function is declared as __weak in EEPROM driver and
00093    should be implemented into user application.
00094    BSP_EEPROM_TIMEOUT_UserCallback() function is called whenever a timeout condition
00095    occure during communication (waiting on an event that doesn't occur, bus
00096    errors, busy devices ...). */
00097 void     BSP_EEPROM_TIMEOUT_UserCallback(void);
00098
00099 /* Link function for I2C EEPROM peripheral */
00100 void              EEPROM_IO_Init(void);
00101 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00102 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize);
00103 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
00104
00105 /**
00106   * @}
00107   */
00108
00109 /**
00110   * @}
00111   */
00112
00113 /**
00114   * @}
00115   */
00116
00117 /**
00118   * @}
00119   */
00120
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124
00125 #endif /* __STM32F469I_DISCOVERY_EEPROM_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_lcd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_lcd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_lcd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00006   *          mounted on STM32469I-Discovery evaluation board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* File Info: ------------------------------------------------------------------
00021                                    User NOTES
00022 1. How To use this driver:
00023 --------------------------
00024    - This driver is used to drive directly in video mode a LCD TFT using the DSI interface.
00025      The following IPs are implied : DSI Host IP block working
00026      in conjunction to the LTDC controller.
00027    - This driver is linked by construction to LCD KoD mounted on board MB1166.
00028
00029 2. Driver description:
00030 ---------------------
00031   + Initialization steps:
00032      o Initialize the LCD using the BSP_LCD_Init() function.
00033      o Select the LCD layer to be used using the BSP_LCD_SelectLayer() function.
00034      o Enable the LCD display using the BSP_LCD_DisplayOn() function.
00035
00036   + Options
00037      o Configure and enable the color keying functionality using the
00038        BSP_LCD_SetColorKeying() function.
00039      o Modify in the fly the transparency and/or the frame buffer address
00040        using the following functions:
00041        - BSP_LCD_SetTransparency()
00042        - BSP_LCD_SetLayerAddress()
00043
00044   + Display on LCD
00045      o Clear the whole LCD using BSP_LCD_Clear() function or only one specified string
00046        line using the BSP_LCD_ClearStringLine() function.
00047      o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
00048        function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
00049      o Display a string line on the specified position (x,y in pixel) and align mode
00050        using the BSP_LCD_DisplayStringAtLine() function.
00051      o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00052        on LCD using the available set of functions.
00053
00054 ------------------------------------------------------------------------------*/
00055
00056 /* Includes ------------------------------------------------------------------*/
00057 #include "stm32469i_discovery_lcd.h"
00058 #include "../../../Utilities/Fonts/fonts.h"
00059 #include "../../../Utilities/Fonts/font24.c"
00060 #include "../../../Utilities/Fonts/font20.c"
00061 #include "../../../Utilities/Fonts/font16.c"
00062 #include "../../../Utilities/Fonts/font12.c"
00063 #include "../../../Utilities/Fonts/font8.c"
00064
00065 /** @addtogroup BSP
00066   * @{
00067   */
00068
00069 /** @addtogroup STM32469I_Discovery
00070   * @{
00071   */
00072
00073 /** @defgroup STM32469I-Discovery_LCD STM32469I Discovery LCD
00074   * @{
00075   */
00076
00077 /** @defgroup STM32469I-Discovery_LCD_Private_TypesDefinitions STM32469I Discovery LCD Private TypesDefinitions
00078   * @{
00079   */
00080 static DSI_VidCfgTypeDef hdsivideo_handle;
00081
00082 /**
00083   * @}
00084   */
00085
00086 /** @defgroup STM32469I-Discovery_LCD_Private_Defines STM32469I Discovery LCD Private Defines
00087   * @{
00088   */
00089 /**
00090   * @}
00091   */
00092
00093 /** @defgroup STM32469I-Discovery_LCD_Private_Macros STM32469I Discovery LCD Private Macros
00094   * @{
00095   */
00096 #define ABS(X)                 ((X) > 0 ? (X) : -(X))
00097
00098 #define POLY_X(Z)              ((int32_t)((Points + (Z))->X))
00099 #define POLY_Y(Z)              ((int32_t)((Points + (Z))->Y))
00100 /**
00101   * @}
00102   */
00103
00104 /** @defgroup STM32469I-Discovery_LCD_Exported_Variables STM32469I Discovery LCD Exported Variables
00105   * @{
00106   */
00107
00108 /**
00109   * @}
00110   */
00111
00112
00113 /** @defgroup STM32469I-Discovery_LCD_Private_Variables STM32469I Discovery LCD Private Variables
00114   * @{
00115   */
00116
00117 DMA2D_HandleTypeDef hdma2d_eval;
00118 LTDC_HandleTypeDef  hltdc_eval;
00119 DSI_HandleTypeDef hdsi_eval;
00120 uint32_t lcd_x_size = OTM8009A_800X480_WIDTH;
00121 uint32_t lcd_y_size = OTM8009A_800X480_HEIGHT;
00122
00123 /**
00124   * @}
00125   */
00126
00127
00128 /** @defgroup STM32469I-Discovery_LCD_Private_Variables STM32469I Discovery LCD Private Variables
00129   * @{
00130   */
00131
00132 /**
00133   * @brief  Default Active LTDC Layer in which drawing is made is LTDC Layer Background
00134   */
00135 static uint32_t  ActiveLayer = LTDC_ACTIVE_LAYER_BACKGROUND;
00136
00137 /**
00138   * @brief  Current Drawing Layer properties variable
00139   */
00140 static LCD_DrawPropTypeDef DrawProp[LTDC_MAX_LAYER_NUMBER];
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32469I-Discovery_LCD_Private_FunctionPrototypes STM32469I Discovery LCD Private FunctionPrototypes
00146   * @{
00147   */
00148 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c);
00149 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3);
00150 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex);
00151 static void LL_ConvertLineToARGB8888(void * pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode);
00152 /**
00153   * @}
00154   */
00155
00156 /** @defgroup STM32469I-Discovery_LCD_Exported_Functions STM32469I Discovery LCD Exported Functions
00157   * @{
00158   */
00159
00160 /**
00161   * @brief  Initializes the DSI LCD.
00162   * @retval LCD state
00163   */
00164 uint8_t BSP_LCD_Init(void)
00165 {
00166   return (BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE));
00167 }
00168
00169 /**
00170   * @brief  Initializes the DSI LCD.
00171   * The ititialization is done as below:
00172   *     - DSI PLL ititialization
00173   *     - DSI ititialization
00174   *     - LTDC ititialization
00175   *     - OTM8009A LCD Display IC Driver ititialization
00176   * @retval LCD state
00177   */
00178 uint8_t BSP_LCD_InitEx(LCD_OrientationTypeDef orientation)
00179 {
00180   DSI_PLLInitTypeDef dsiPllInit;
00181   DSI_PHY_TimerTypeDef  PhyTimings;
00182   static RCC_PeriphCLKInitTypeDef  PeriphClkInitStruct;
00183   uint32_t LcdClock  = 27429; /*!< LcdClk = 27429 kHz */
00184
00185   uint32_t laneByteClk_kHz = 0;
00186   uint32_t                   VSA; /*!< Vertical start active time in units of lines */
00187   uint32_t                   VBP; /*!< Vertical Back Porch time in units of lines */
00188   uint32_t                   VFP; /*!< Vertical Front Porch time in units of lines */
00189   uint32_t                   VACT; /*!< Vertical Active time in units of lines = imageSize Y in pixels to display */
00190   uint32_t                   HSA; /*!< Horizontal start active time in units of lcdClk */
00191   uint32_t                   HBP; /*!< Horizontal Back Porch time in units of lcdClk */
00192   uint32_t                   HFP; /*!< Horizontal Front Porch time in units of lcdClk */
00193   uint32_t                   HACT; /*!< Horizontal Active time in units of lcdClk = imageSize X in pixels to display */
00194
00195
00196   /* Toggle Hardware Reset of the DSI LCD using
00197   * its XRES signal (active low) */
00198   BSP_LCD_Reset();
00199
00200   /* Call first MSP Initialize only in case of first initialization
00201   * This will set IP blocks LTDC, DSI and DMA2D
00202   * - out of reset
00203   * - clocked
00204   * - NVIC IRQ related to IP blocks enabled
00205   */
00206   BSP_LCD_MspInit();
00207
00208 /*************************DSI Initialization***********************************/
00209
00210   /* Base address of DSI Host/Wrapper registers to be set before calling De-Init */
00211   hdsi_eval.Instance = DSI;
00212
00213   HAL_DSI_DeInit(&(hdsi_eval));
00214
00215 #if !defined(USE_STM32469I_DISCO_REVA)
00216   dsiPllInit.PLLNDIV  = 125;
00217   dsiPllInit.PLLIDF   = DSI_PLL_IN_DIV2;
00218   dsiPllInit.PLLODF   = DSI_PLL_OUT_DIV1;
00219 #else
00220   dsiPllInit.PLLNDIV  = 100;
00221   dsiPllInit.PLLIDF   = DSI_PLL_IN_DIV5;
00222   dsiPllInit.PLLODF   = DSI_PLL_OUT_DIV1;
00223 #endif
00224   laneByteClk_kHz = 62500; /* 500 MHz / 8 = 62.5 MHz = 62500 kHz */
00225
00226   /* Set number of Lanes */
00227   hdsi_eval.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
00228
00229   /* TXEscapeCkdiv = f(LaneByteClk)/15.62 = 4 */
00230   hdsi_eval.Init.TXEscapeCkdiv = laneByteClk_kHz/15620;
00231
00232   HAL_DSI_Init(&(hdsi_eval), &(dsiPllInit));
00233
00234   /* Timing parameters for all Video modes
00235   * Set Timing parameters of LTDC depending on its chosen orientation
00236   */
00237   if(orientation == LCD_ORIENTATION_PORTRAIT)
00238   {
00239     lcd_x_size = OTM8009A_480X800_WIDTH;  /* 480 */
00240     lcd_y_size = OTM8009A_480X800_HEIGHT; /* 800 */
00241   }
00242   else
00243   {
00244     /* lcd_orientation == LCD_ORIENTATION_LANDSCAPE */
00245     lcd_x_size = OTM8009A_800X480_WIDTH;  /* 800 */
00246     lcd_y_size = OTM8009A_800X480_HEIGHT; /* 480 */
00247   }
00248
00249   HACT = lcd_x_size;
00250   VACT = lcd_y_size;
00251
00252   /* The following values are same for portrait and landscape orientations */
00253 #if defined (USE_STM32469I_DISCO_REVC)
00254   VSA  = NT35510_480X800_VSYNC;
00255   VBP  = NT35510_480X800_VBP;
00256   VFP  = NT35510_480X800_VFP;
00257   HSA  = NT35510_480X800_HSYNC;
00258   HBP  = NT35510_480X800_HBP;
00259   HFP  = NT35510_480X800_HFP;
00260 #else
00261   VSA  = OTM8009A_480X800_VSYNC;
00262   VBP  = OTM8009A_480X800_VBP;
00263   VFP  = OTM8009A_480X800_VFP;
00264   HSA  = OTM8009A_480X800_HSYNC;
00265   HBP  = OTM8009A_480X800_HBP;
00266   HFP  = OTM8009A_480X800_HFP;
00267 #endif /* USE_STM32469I_DISCO_REVC */
00268
00269
00270   hdsivideo_handle.VirtualChannelID = LCD_OTM8009A_ID;
00271   hdsivideo_handle.ColorCoding = LCD_DSI_PIXEL_DATA_FMT_RBG888;
00272   hdsivideo_handle.VSPolarity = DSI_VSYNC_ACTIVE_HIGH;
00273   hdsivideo_handle.HSPolarity = DSI_HSYNC_ACTIVE_HIGH;
00274   hdsivideo_handle.DEPolarity = DSI_DATA_ENABLE_ACTIVE_HIGH;
00275   hdsivideo_handle.Mode = DSI_VID_MODE_BURST; /* Mode Video burst ie : one LgP per line */
00276   hdsivideo_handle.NullPacketSize = 0xFFF;
00277   hdsivideo_handle.NumberOfChunks = 0;
00278   hdsivideo_handle.PacketSize                = HACT; /* Value depending on display orientation choice portrait/landscape */
00279   hdsivideo_handle.HorizontalSyncActive      = (HSA * laneByteClk_kHz) / LcdClock;
00280   hdsivideo_handle.HorizontalBackPorch       = (HBP * laneByteClk_kHz) / LcdClock;
00281   hdsivideo_handle.HorizontalLine            = ((HACT + HSA + HBP + HFP) * laneByteClk_kHz) / LcdClock; /* Value depending on display orientation choice portrait/landscape */
00282   hdsivideo_handle.VerticalSyncActive        = VSA;
00283   hdsivideo_handle.VerticalBackPorch         = VBP;
00284   hdsivideo_handle.VerticalFrontPorch        = VFP;
00285   hdsivideo_handle.VerticalActive            = VACT; /* Value depending on display orientation choice portrait/landscape */
00286
00287   /* Enable or disable sending LP command while streaming is active in video mode */
00288   hdsivideo_handle.LPCommandEnable = DSI_LP_COMMAND_ENABLE; /* Enable sending commands in mode LP (Low Power) */
00289
00290   /* Largest packet size possible to transmit in LP mode in VSA, VBP, VFP regions */
00291   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00292   hdsivideo_handle.LPLargestPacketSize = 16;
00293
00294   /* Largest packet size possible to transmit in LP mode in HFP region during VACT period */
00295   /* Only useful when sending LP packets is allowed while streaming is active in video mode */
00296   hdsivideo_handle.LPVACTLargestPacketSize = 0;
00297
00298
00299   /* Specify for each region of the video frame, if the transmission of command in LP mode is allowed in this region */
00300   /* while streaming is active in video mode                                                                         */
00301   hdsivideo_handle.LPHorizontalFrontPorchEnable = DSI_LP_HFP_ENABLE;   /* Allow sending LP commands during HFP period */
00302   hdsivideo_handle.LPHorizontalBackPorchEnable  = DSI_LP_HBP_ENABLE;   /* Allow sending LP commands during HBP period */
00303   hdsivideo_handle.LPVerticalActiveEnable = DSI_LP_VACT_ENABLE;  /* Allow sending LP commands during VACT period */
00304   hdsivideo_handle.LPVerticalFrontPorchEnable = DSI_LP_VFP_ENABLE;   /* Allow sending LP commands during VFP period */
00305   hdsivideo_handle.LPVerticalBackPorchEnable = DSI_LP_VBP_ENABLE;   /* Allow sending LP commands during VBP period */
00306   hdsivideo_handle.LPVerticalSyncActiveEnable = DSI_LP_VSYNC_ENABLE; /* Allow sending LP commands during VSync = VSA period */
00307
00308   /* Configure DSI Video mode timings with settings set above */
00309   HAL_DSI_ConfigVideoMode(&(hdsi_eval), &(hdsivideo_handle));
00310
00311   /* Configure DSI PHY HS2LP and LP2HS timings */
00312   PhyTimings.ClockLaneHS2LPTime = 35;
00313   PhyTimings.ClockLaneLP2HSTime = 35;
00314   PhyTimings.DataLaneHS2LPTime = 35;
00315   PhyTimings.DataLaneLP2HSTime = 35;
00316   PhyTimings.DataLaneMaxReadTime = 0;
00317   PhyTimings.StopWaitTime = 10;
00318   HAL_DSI_ConfigPhyTimer(&hdsi_eval, &PhyTimings);
00319
00320 /*************************End DSI Initialization*******************************/
00321
00322
00323 /************************LTDC Initialization***********************************/
00324
00325   /* Timing Configuration */
00326   hltdc_eval.Init.HorizontalSync = (HSA - 1);
00327   hltdc_eval.Init.AccumulatedHBP = (HSA + HBP - 1);
00328   hltdc_eval.Init.AccumulatedActiveW = (lcd_x_size + HSA + HBP - 1);
00329   hltdc_eval.Init.TotalWidth = (lcd_x_size + HSA + HBP + HFP - 1);
00330
00331   /* Initialize the LCD pixel width and pixel height */
00332   hltdc_eval.LayerCfg->ImageWidth  = lcd_x_size;
00333   hltdc_eval.LayerCfg->ImageHeight = lcd_y_size;
00334
00335
00336   /* LCD clock configuration */
00337   /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */
00338   /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 384 Mhz */
00339   /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 384 MHz / 7 = 54.857 MHz */
00340   /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_2 = 54.857 MHz / 2 = 27.429 MHz */
00341   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
00342   PeriphClkInitStruct.PLLSAI.PLLSAIN = 384;
00343   PeriphClkInitStruct.PLLSAI.PLLSAIR = 7;
00344   PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
00345   HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
00346
00347   /* Background value */
00348   hltdc_eval.Init.Backcolor.Blue = 0;
00349   hltdc_eval.Init.Backcolor.Green = 0;
00350   hltdc_eval.Init.Backcolor.Red = 0;
00351   hltdc_eval.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
00352   hltdc_eval.Instance = LTDC;
00353
00354   /* Get LTDC Configuration from DSI Configuration */
00355   HAL_LTDCEx_StructInitFromVideoConfig(&(hltdc_eval), &(hdsivideo_handle));
00356
00357   /* Initialize the LTDC */
00358   HAL_LTDC_Init(&hltdc_eval);
00359
00360   /* Enable the DSI host and wrapper after the LTDC initialization
00361      To avoid any synchronization issue, the DSI shall be started after enabling the LTDC */
00362   HAL_DSI_Start(&(hdsi_eval));
00363
00364 #if !defined(DATA_IN_ExtSDRAM)
00365   /* Initialize the SDRAM */
00366   BSP_SDRAM_Init();
00367 #endif /* DATA_IN_ExtSDRAM */
00368
00369   /* Initialize the font */
00370   BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00371
00372 /************************End LTDC Initialization*******************************/
00373
00374 #if defined(USE_STM32469I_DISCO_REVC)
00375 /***********************NT35510 Initialization********************************/
00376
00377   /* Initialize the NT35510 LCD Display IC Driver (TechShine LCD IC Driver)
00378    * depending on configuration set in 'hdsivideo_handle'.
00379    */
00380   NT35510_Init(NT35510_FORMAT_RGB888, orientation);
00381 /***********************End NT35510 Initialization****************************/
00382 #else
00383 /***********************OTM8009A Initialization********************************/
00384
00385   /* Initialize the OTM8009A LCD Display IC Driver (KoD LCD IC Driver)
00386   *  depending on configuration set in 'hdsivideo_handle'.
00387   */
00388   OTM8009A_Init(OTM8009A_FORMAT_RGB888, orientation);
00389 /***********************End OTM8009A Initialization****************************/
00390 #endif /* USE_STM32469I_DISCO_REVC */
00391
00392   return LCD_OK;
00393 }
00394
00395 /**
00396   * @brief  BSP LCD Reset
00397   *         Hw reset the LCD DSI activating its XRES signal (active low for some time)
00398   *         and desactivating it later.
00399   *         This signal is only cabled on Discovery Rev B and beyond.
00400   */
00401 void BSP_LCD_Reset(void)
00402 {
00403 #if !defined(USE_STM32469I_DISCO_REVA)
00404   /* Disco Rev B and beyond : reset the LCD by activation of XRES (active low) connected to PH7 */
00405   GPIO_InitTypeDef  gpio_init_structure;
00406
00407   __HAL_RCC_GPIOH_CLK_ENABLE();
00408
00409     /* Configure the GPIO on PH7 */
00410     gpio_init_structure.Pin   = GPIO_PIN_7;
00411 #if defined(USE_STM32469I_DISCO_REVC)
00412     /* Push Pull Mode is required for TechShine LCD (NT35510) */
00413     gpio_init_structure.Mode  = GPIO_MODE_OUTPUT_PP;
00414 #else
00415     gpio_init_structure.Mode  = GPIO_MODE_OUTPUT_OD;
00416 #endif
00417     gpio_init_structure.Pull  = GPIO_NOPULL;
00418     gpio_init_structure.Speed = GPIO_SPEED_HIGH;
00419
00420     HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00421
00422     /* Activate XRES active low */
00423     HAL_GPIO_WritePin(GPIOH, GPIO_PIN_7, GPIO_PIN_RESET);
00424
00425     HAL_Delay(20); /* wait 20 ms */
00426
00427     /* Desactivate XRES */
00428     HAL_GPIO_WritePin(GPIOH, GPIO_PIN_7, GPIO_PIN_SET);
00429
00430     /* Wait for 20ms after releasing XRES before sending commands */
00431     HAL_Delay(20);
00432 #else
00433   /* Nothing to do in case of Disco Rev A */
00434 #endif /* USE_STM32469I_DISCO_REVA == 0 */
00435 }
00436
00437 /**
00438   * @brief  Gets the LCD X size.
00439   * @retval Used LCD X size
00440   */
00441 uint32_t BSP_LCD_GetXSize(void)
00442 {
00443   return (lcd_x_size);
00444 }
00445
00446 /**
00447   * @brief  Gets the LCD Y size.
00448   * @retval Used LCD Y size
00449   */
00450 uint32_t BSP_LCD_GetYSize(void)
00451 {
00452   return (lcd_y_size);
00453 }
00454
00455 /**
00456   * @brief  Set the LCD X size.
00457   * @param  imageWidthPixels : uint32_t image width in pixels unit
00458   */
00459 void BSP_LCD_SetXSize(uint32_t imageWidthPixels)
00460 {
00461   hltdc_eval.LayerCfg[ActiveLayer].ImageWidth = imageWidthPixels;
00462 }
00463
00464 /**
00465   * @brief  Set the LCD Y size.
00466   * @param  imageHeightPixels : uint32_t image height in lines unit
00467   */
00468 void BSP_LCD_SetYSize(uint32_t imageHeightPixels)
00469 {
00470   hltdc_eval.LayerCfg[ActiveLayer].ImageHeight = imageHeightPixels;
00471 }
00472
00473
00474 /**
00475   * @brief  Initializes the LCD layers.
00476   * @param  LayerIndex: Layer foreground or background
00477   * @param  FB_Address: Layer frame buffer
00478   */
00479 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
00480 {
00481     LCD_LayerCfgTypeDef  Layercfg;
00482
00483   /* Layer Init */
00484   Layercfg.WindowX0 = 0;
00485   Layercfg.WindowX1 = BSP_LCD_GetXSize();
00486   Layercfg.WindowY0 = 0;
00487   Layercfg.WindowY1 = BSP_LCD_GetYSize();
00488   Layercfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
00489   Layercfg.FBStartAdress = FB_Address;
00490   Layercfg.Alpha = 255;
00491   Layercfg.Alpha0 = 0;
00492   Layercfg.Backcolor.Blue = 0;
00493   Layercfg.Backcolor.Green = 0;
00494   Layercfg.Backcolor.Red = 0;
00495   Layercfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
00496   Layercfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
00497   Layercfg.ImageWidth = BSP_LCD_GetXSize();
00498   Layercfg.ImageHeight = BSP_LCD_GetYSize();
00499
00500   HAL_LTDC_ConfigLayer(&hltdc_eval, &Layercfg, LayerIndex);
00501
00502   DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE;
00503   DrawProp[LayerIndex].pFont     = &Font24;
00504   DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK;
00505 }
00506
00507
00508 /**
00509   * @brief  Selects the LCD Layer.
00510   * @param  LayerIndex: Layer foreground or background
00511   */
00512 void BSP_LCD_SelectLayer(uint32_t LayerIndex)
00513 {
00514   ActiveLayer = LayerIndex;
00515 }
00516
00517 /**
00518   * @brief  Sets an LCD Layer visible
00519   * @param  LayerIndex: Visible Layer
00520   * @param  State: New state of the specified layer
00521   *          This parameter can be one of the following values:
00522   *            @arg  ENABLE
00523   *            @arg  DISABLE
00524   */
00525 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State)
00526 {
00527   if(State == ENABLE)
00528   {
00529     __HAL_LTDC_LAYER_ENABLE(&(hltdc_eval), LayerIndex);
00530   }
00531   else
00532   {
00533     __HAL_LTDC_LAYER_DISABLE(&(hltdc_eval), LayerIndex);
00534   }
00535   __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(&(hltdc_eval));
00536
00537 }
00538
00539 /**
00540   * @brief  Configures the transparency.
00541   * @param  LayerIndex: Layer foreground or background.
00542   * @param  Transparency: Transparency
00543   *           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF
00544   */
00545 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency)
00546 {
00547
00548   HAL_LTDC_SetAlpha(&(hltdc_eval), Transparency, LayerIndex);
00549
00550 }
00551
00552 /**
00553   * @brief  Sets an LCD layer frame buffer address.
00554   * @param  LayerIndex: Layer foreground or background
00555   * @param  Address: New LCD frame buffer value
00556   */
00557 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address)
00558 {
00559
00560   HAL_LTDC_SetAddress(&(hltdc_eval), Address, LayerIndex);
00561
00562 }
00563
00564 /**
00565   * @brief  Sets display window.
00566   * @param  LayerIndex: Layer index
00567   * @param  Xpos: LCD X position
00568   * @param  Ypos: LCD Y position
00569   * @param  Width: LCD window width
00570   * @param  Height: LCD window height
00571   */
00572 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00573 {
00574   /* Reconfigure the layer size */
00575   HAL_LTDC_SetWindowSize(&(hltdc_eval), Width, Height, LayerIndex);
00576
00577   /* Reconfigure the layer position */
00578   HAL_LTDC_SetWindowPosition(&(hltdc_eval), Xpos, Ypos, LayerIndex);
00579
00580 }
00581
00582 /**
00583   * @brief  Configures and sets the color keying.
00584   * @param  LayerIndex: Layer foreground or background
00585   * @param  RGBValue: Color reference
00586   */
00587 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue)
00588 {
00589   /* Configure and Enable the color Keying for LCD Layer */
00590   HAL_LTDC_ConfigColorKeying(&(hltdc_eval), RGBValue, LayerIndex);
00591   HAL_LTDC_EnableColorKeying(&(hltdc_eval), LayerIndex);
00592 }
00593
00594 /**
00595   * @brief  Disables the color keying.
00596   * @param  LayerIndex: Layer foreground or background
00597   */
00598 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex)
00599 {
00600   /* Disable the color Keying for LCD Layer */
00601   HAL_LTDC_DisableColorKeying(&(hltdc_eval), LayerIndex);
00602 }
00603
00604 /**
00605   * @brief  Sets the LCD text color.
00606   * @param  Color: Text color code ARGB(8-8-8-8)
00607   */
00608 void BSP_LCD_SetTextColor(uint32_t Color)
00609 {
00610   DrawProp[ActiveLayer].TextColor = Color;
00611 }
00612
00613 /**
00614   * @brief  Gets the LCD text color.
00615   * @retval Used text color.
00616   */
00617 uint32_t BSP_LCD_GetTextColor(void)
00618 {
00619   return DrawProp[ActiveLayer].TextColor;
00620 }
00621
00622 /**
00623   * @brief  Sets the LCD background color.
00624   * @param  Color: Layer background color code ARGB(8-8-8-8)
00625   */
00626 void BSP_LCD_SetBackColor(uint32_t Color)
00627 {
00628   DrawProp[ActiveLayer].BackColor = Color;
00629 }
00630
00631 /**
00632   * @brief  Gets the LCD background color.
00633   * @retval Used background color
00634   */
00635 uint32_t BSP_LCD_GetBackColor(void)
00636 {
00637   return DrawProp[ActiveLayer].BackColor;
00638 }
00639
00640 /**
00641   * @brief  Sets the LCD text font.
00642   * @param  fonts: Layer font to be used
00643   */
00644 void BSP_LCD_SetFont(sFONT *fonts)
00645 {
00646   DrawProp[ActiveLayer].pFont = fonts;
00647 }
00648
00649 /**
00650   * @brief  Gets the LCD text font.
00651   * @retval Used layer font
00652   */
00653 sFONT *BSP_LCD_GetFont(void)
00654 {
00655   return DrawProp[ActiveLayer].pFont;
00656 }
00657
00658 /**
00659   * @brief  Reads an LCD pixel.
00660   * @param  Xpos: X position
00661   * @param  Ypos: Y position
00662   * @retval RGB pixel color
00663   */
00664 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
00665 {
00666   uint32_t ret = 0;
00667
00668   if(hltdc_eval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
00669   {
00670     /* Read data value from SDRAM memory */
00671     ret = *(__IO uint32_t*) (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00672   }
00673   else if(hltdc_eval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888)
00674   {
00675     /* Read data value from SDRAM memory */
00676     ret = (*(__IO uint32_t*) (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) & 0x00FFFFFF);
00677   }
00678   else if((hltdc_eval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
00679           (hltdc_eval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
00680           (hltdc_eval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_AL88))
00681   {
00682     /* Read data value from SDRAM memory */
00683     ret = *(__IO uint16_t*) (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00684   }
00685   else
00686   {
00687     /* Read data value from SDRAM memory */
00688     ret = *(__IO uint8_t*) (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
00689   }
00690
00691   return ret;
00692 }
00693
00694 /**
00695   * @brief  Clears the whole currently active layer of LTDC.
00696   * @param  Color: Color of the background
00697   */
00698 void BSP_LCD_Clear(uint32_t Color)
00699 {
00700   /* Clear the LCD */
00701   LL_FillBuffer(ActiveLayer, (uint32_t *)(hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);
00702 }
00703
00704 /**
00705   * @brief  Clears the selected line in currently active layer.
00706   * @param  Line: Line to be cleared
00707   */
00708 void BSP_LCD_ClearStringLine(uint32_t Line)
00709 {
00710   uint32_t color_backup = DrawProp[ActiveLayer].TextColor;
00711   DrawProp[ActiveLayer].TextColor = DrawProp[ActiveLayer].BackColor;
00712
00713   /* Draw rectangle with background color */
00714   BSP_LCD_FillRect(0, (Line * DrawProp[ActiveLayer].pFont->Height), BSP_LCD_GetXSize(), DrawProp[ActiveLayer].pFont->Height);
00715
00716   DrawProp[ActiveLayer].TextColor = color_backup;
00717   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
00718 }
00719
00720 /**
00721   * @brief  Displays one character in currently active layer.
00722   * @param  Xpos: Start column address
00723   * @param  Ypos: Line where to display the character shape.
00724   * @param  Ascii: Character ascii code
00725   *           This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
00726   */
00727 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00728 {
00729   DrawChar(Xpos, Ypos, &DrawProp[ActiveLayer].pFont->table[(Ascii-' ') *\
00730     DrawProp[ActiveLayer].pFont->Height * ((DrawProp[ActiveLayer].pFont->Width + 7) / 8)]);
00731 }
00732
00733 /**
00734   * @brief  Displays characters in currently active layer.
00735   * @param  Xpos: X position (in pixel)
00736   * @param  Ypos: Y position (in pixel)
00737   * @param  Text: Pointer to string to display on LCD
00738   * @param  Mode: Display mode
00739   *          This parameter can be one of the following values:
00740   *            @arg  CENTER_MODE
00741   *            @arg  RIGHT_MODE
00742   *            @arg  LEFT_MODE
00743   */
00744 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
00745 {
00746   uint16_t refcolumn = 1, i = 0;
00747   uint32_t size = 0, xsize = 0;
00748   uint8_t  *ptr = Text;
00749
00750   /* Get the text size */
00751   while (*ptr++) size ++ ;
00752
00753   /* Characters number per line */
00754   xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
00755
00756   switch (Mode)
00757   {
00758   case CENTER_MODE:
00759     {
00760       refcolumn = Xpos + ((xsize - size)* DrawProp[ActiveLayer].pFont->Width) / 2;
00761       break;
00762     }
00763   case LEFT_MODE:
00764     {
00765       refcolumn = Xpos;
00766       break;
00767     }
00768   case RIGHT_MODE:
00769     {
00770       refcolumn = - Xpos + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
00771       break;
00772     }
00773   default:
00774     {
00775       refcolumn = Xpos;
00776       break;
00777     }
00778   }
00779
00780   /* Check that the Start column is located in the screen */
00781   if ((refcolumn < 1) || (refcolumn >= 0x8000))
00782   {
00783     refcolumn = 1;
00784   }
00785
00786   /* Send the string character by character on LCD */
00787   while ((*Text != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
00788   {
00789     /* Display one character on LCD */
00790     BSP_LCD_DisplayChar(refcolumn, Ypos, *Text);
00791     /* Decrement the column position by 16 */
00792     refcolumn += DrawProp[ActiveLayer].pFont->Width;
00793
00794     /* Point on the next character */
00795     Text++;
00796     i++;
00797   }
00798
00799 }
00800
00801 /**
00802   * @brief  Displays a maximum of 60 characters on the LCD.
00803   * @param  Line: Line where to display the character shape
00804   * @param  ptr: Pointer to string to display on LCD
00805   */
00806 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
00807 {
00808   BSP_LCD_DisplayStringAt(0, LINE(Line), ptr, LEFT_MODE);
00809 }
00810
00811 /**
00812   * @brief  Draws an horizontal line in currently active layer.
00813   * @param  Xpos: X position
00814   * @param  Ypos: Y position
00815   * @param  Length: Line length
00816   */
00817 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00818 {
00819   uint32_t  Xaddress = 0;
00820
00821   /* Get the line address */
00822   Xaddress = (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00823
00824   /* Write line */
00825   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, DrawProp[ActiveLayer].TextColor);
00826 }
00827
00828 /**
00829   * @brief  Draws a vertical line in currently active layer.
00830   * @param  Xpos: X position
00831   * @param  Ypos: Y position
00832   * @param  Length: Line length
00833   */
00834 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00835 {
00836   uint32_t  Xaddress = 0;
00837
00838   /* Get the line address */
00839   Xaddress = (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
00840
00841   /* Write line */
00842   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, 1, Length, (BSP_LCD_GetXSize() - 1), DrawProp[ActiveLayer].TextColor);
00843 }
00844
00845 /**
00846   * @brief  Draws an uni-line (between two points) in currently active layer.
00847   * @param  x1: Point 1 X position
00848   * @param  y1: Point 1 Y position
00849   * @param  x2: Point 2 X position
00850   * @param  y2: Point 2 Y position
00851   */
00852 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
00853 {
00854   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
00855   yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
00856   curpixel = 0;
00857
00858   deltax = ABS(x2 - x1);        /* The difference between the x's */
00859   deltay = ABS(y2 - y1);        /* The difference between the y's */
00860   x = x1;                       /* Start x off at the first pixel */
00861   y = y1;                       /* Start y off at the first pixel */
00862
00863   if (x2 >= x1)                 /* The x-values are increasing */
00864   {
00865     xinc1 = 1;
00866     xinc2 = 1;
00867   }
00868   else                          /* The x-values are decreasing */
00869   {
00870     xinc1 = -1;
00871     xinc2 = -1;
00872   }
00873
00874   if (y2 >= y1)                 /* The y-values are increasing */
00875   {
00876     yinc1 = 1;
00877     yinc2 = 1;
00878   }
00879   else                          /* The y-values are decreasing */
00880   {
00881     yinc1 = -1;
00882     yinc2 = -1;
00883   }
00884
00885   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
00886   {
00887     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
00888     yinc2 = 0;                  /* Don't change the y for every iteration */
00889     den = deltax;
00890     num = deltax / 2;
00891     numadd = deltay;
00892     numpixels = deltax;         /* There are more x-values than y-values */
00893   }
00894   else                          /* There is at least one y-value for every x-value */
00895   {
00896     xinc2 = 0;                  /* Don't change the x for every iteration */
00897     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
00898     den = deltay;
00899     num = deltay / 2;
00900     numadd = deltax;
00901     numpixels = deltay;         /* There are more y-values than x-values */
00902   }
00903
00904   for (curpixel = 0; curpixel <= numpixels; curpixel++)
00905   {
00906     BSP_LCD_DrawPixel(x, y, DrawProp[ActiveLayer].TextColor);   /* Draw the current pixel */
00907     num += numadd;                            /* Increase the numerator by the top of the fraction */
00908     if (num >= den)                           /* Check if numerator >= denominator */
00909     {
00910       num -= den;                             /* Calculate the new numerator value */
00911       x += xinc1;                             /* Change the x as appropriate */
00912       y += yinc1;                             /* Change the y as appropriate */
00913     }
00914     x += xinc2;                               /* Change the x as appropriate */
00915     y += yinc2;                               /* Change the y as appropriate */
00916   }
00917 }
00918
00919 /**
00920   * @brief  Draws a rectangle in currently active layer.
00921   * @param  Xpos: X position
00922   * @param  Ypos: Y position
00923   * @param  Width: Rectangle width
00924   * @param  Height: Rectangle height
00925   */
00926 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00927 {
00928   /* Draw horizontal lines */
00929   BSP_LCD_DrawHLine(Xpos, Ypos, Width);
00930   BSP_LCD_DrawHLine(Xpos, (Ypos+ Height), Width);
00931
00932   /* Draw vertical lines */
00933   BSP_LCD_DrawVLine(Xpos, Ypos, Height);
00934   BSP_LCD_DrawVLine((Xpos + Width), Ypos, Height);
00935 }
00936
00937 /**
00938   * @brief  Draws a circle in currently active layer.
00939   * @param  Xpos: X position
00940   * @param  Ypos: Y position
00941   * @param  Radius: Circle radius
00942   */
00943 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00944 {
00945   int32_t   D;    /* Decision Variable */
00946   uint32_t  CurX; /* Current X Value */
00947   uint32_t  CurY; /* Current Y Value */
00948
00949   D = 3 - (Radius << 1);
00950   CurX = 0;
00951   CurY = Radius;
00952
00953   while (CurX <= CurY)
00954   {
00955     BSP_LCD_DrawPixel((Xpos + CurX), (Ypos - CurY), DrawProp[ActiveLayer].TextColor);
00956
00957     BSP_LCD_DrawPixel((Xpos - CurX), (Ypos - CurY), DrawProp[ActiveLayer].TextColor);
00958
00959     BSP_LCD_DrawPixel((Xpos + CurY), (Ypos - CurX), DrawProp[ActiveLayer].TextColor);
00960
00961     BSP_LCD_DrawPixel((Xpos - CurY), (Ypos - CurX), DrawProp[ActiveLayer].TextColor);
00962
00963     BSP_LCD_DrawPixel((Xpos + CurX), (Ypos + CurY), DrawProp[ActiveLayer].TextColor);
00964
00965     BSP_LCD_DrawPixel((Xpos - CurX), (Ypos + CurY), DrawProp[ActiveLayer].TextColor);
00966
00967     BSP_LCD_DrawPixel((Xpos + CurY), (Ypos + CurX), DrawProp[ActiveLayer].TextColor);
00968
00969     BSP_LCD_DrawPixel((Xpos - CurY), (Ypos + CurX), DrawProp[ActiveLayer].TextColor);
00970
00971     if (D < 0)
00972     {
00973       D += (CurX << 2) + 6;
00974     }
00975     else
00976     {
00977       D += ((CurX - CurY) << 2) + 10;
00978       CurY--;
00979     }
00980     CurX++;
00981   }
00982 }
00983
00984 /**
00985   * @brief  Draws an poly-line (between many points) in currently active layer.
00986   * @param  Points: Pointer to the points array
00987   * @param  PointCount: Number of points
00988   */
00989 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount)
00990 {
00991   int16_t X = 0, Y = 0;
00992
00993   if(PointCount < 2)
00994   {
00995     return;
00996   }
00997
00998   BSP_LCD_DrawLine(Points->X, Points->Y, (Points+PointCount-1)->X, (Points+PointCount-1)->Y);
00999
01000   while(--PointCount)
01001   {
01002     X = Points->X;
01003     Y = Points->Y;
01004     Points++;
01005     BSP_LCD_DrawLine(X, Y, Points->X, Points->Y);
01006   }
01007 }
01008
01009 /**
01010   * @brief  Draws an ellipse on LCD in currently active layer.
01011   * @param  Xpos: X position
01012   * @param  Ypos: Y position
01013   * @param  XRadius: Ellipse X radius
01014   * @param  YRadius: Ellipse Y radius
01015   */
01016 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01017 {
01018   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01019   float K = 0, rad1 = 0, rad2 = 0;
01020
01021   rad1 = XRadius;
01022   rad2 = YRadius;
01023
01024   K = (float)(rad2/rad1);
01025
01026   do {
01027     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/K)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
01028     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/K)), (Ypos+y), DrawProp[ActiveLayer].TextColor);
01029     BSP_LCD_DrawPixel((Xpos+(uint16_t)(x/K)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
01030     BSP_LCD_DrawPixel((Xpos-(uint16_t)(x/K)), (Ypos-y), DrawProp[ActiveLayer].TextColor);
01031
01032     e2 = err;
01033     if (e2 <= x) {
01034       err += ++x*2+1;
01035       if (-y == x && e2 <= y) e2 = 0;
01036     }
01037     if (e2 > y) err += ++y*2+1;
01038   }
01039   while (y <= 0);
01040 }
01041
01042 /**
01043   * @brief  Draws a bitmap picture loaded in the internal Flash (32 bpp) in currently active layer.
01044   * @param  Xpos: Bmp X position in the LCD
01045   * @param  Ypos: Bmp Y position in the LCD
01046   * @param  pbmp: Pointer to Bmp picture address in the internal Flash
01047   */
01048 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp)
01049 {
01050   uint32_t index = 0, width = 0, height = 0, bit_pixel = 0;
01051   uint32_t Address;
01052   uint32_t InputColorMode = 0;
01053
01054   /* Get bitmap data address offset */
01055   index = pbmp[10] + (pbmp[11] << 8) + (pbmp[12] << 16)  + (pbmp[13] << 24);
01056
01057   /* Read bitmap width */
01058   width = pbmp[18] + (pbmp[19] << 8) + (pbmp[20] << 16)  + (pbmp[21] << 24);
01059
01060   /* Read bitmap height */
01061   height = pbmp[22] + (pbmp[23] << 8) + (pbmp[24] << 16)  + (pbmp[25] << 24);
01062
01063   /* Read bit/pixel */
01064   bit_pixel = pbmp[28] + (pbmp[29] << 8);
01065
01066   /* Set the address */
01067   Address = hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (((BSP_LCD_GetXSize()*Ypos) + Xpos)*(4));
01068
01069   /* Get the layer pixel format */
01070   if ((bit_pixel/8) == 4)
01071   {
01072     InputColorMode = CM_ARGB8888;
01073   }
01074   else if ((bit_pixel/8) == 2)
01075   {
01076     InputColorMode = CM_RGB565;
01077   }
01078   else
01079   {
01080     InputColorMode = CM_RGB888;
01081   }
01082
01083   /* Bypass the bitmap header */
01084   pbmp += (index + (width * (height - 1) * (bit_pixel/8)));
01085
01086   /* Convert picture to ARGB8888 pixel format */
01087   for(index=0; index < height; index++)
01088   {
01089     /* Pixel format conversion */
01090     LL_ConvertLineToARGB8888((uint32_t *)pbmp, (uint32_t *)Address, width, InputColorMode);
01091
01092     /* Increment the source and destination buffers */
01093     Address+=  (BSP_LCD_GetXSize()*4);
01094     pbmp -= width*(bit_pixel/8);
01095   }
01096 }
01097
01098 /**
01099   * @brief  Draws a full rectangle in currently active layer.
01100   * @param  Xpos: X position
01101   * @param  Ypos: Y position
01102   * @param  Width: Rectangle width
01103   * @param  Height: Rectangle height
01104   */
01105 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01106 {
01107   uint32_t  Xaddress = 0;
01108
01109   /* Set the text color */
01110   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01111
01112   /* Get the rectangle start address */
01113   Xaddress = (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos);
01114
01115   /* Fill the rectangle */
01116   LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Width, Height, (BSP_LCD_GetXSize() - Width), DrawProp[ActiveLayer].TextColor);
01117 }
01118
01119 /**
01120   * @brief  Draws a full circle in currently active layer.
01121   * @param  Xpos: X position
01122   * @param  Ypos: Y position
01123   * @param  Radius: Circle radius
01124   */
01125 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
01126 {
01127   int32_t  D;     /* Decision Variable */
01128   uint32_t  CurX; /* Current X Value */
01129   uint32_t  CurY; /* Current Y Value */
01130
01131   D = 3 - (Radius << 1);
01132
01133   CurX = 0;
01134   CurY = Radius;
01135
01136   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01137
01138   while (CurX <= CurY)
01139   {
01140     if(CurY > 0)
01141     {
01142       BSP_LCD_DrawHLine(Xpos - CurY, Ypos + CurX, 2*CurY);
01143       BSP_LCD_DrawHLine(Xpos - CurY, Ypos - CurX, 2*CurY);
01144     }
01145
01146     if(CurX > 0)
01147     {
01148       BSP_LCD_DrawHLine(Xpos - CurX, Ypos - CurY, 2*CurX);
01149       BSP_LCD_DrawHLine(Xpos - CurX, Ypos + CurY, 2*CurX);
01150     }
01151     if (D < 0)
01152     {
01153       D += (CurX << 2) + 6;
01154     }
01155     else
01156     {
01157       D += ((CurX - CurY) << 2) + 10;
01158       CurY--;
01159     }
01160     CurX++;
01161   }
01162
01163   BSP_LCD_SetTextColor(DrawProp[ActiveLayer].TextColor);
01164   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
01165 }
01166
01167 /**
01168   * @brief  Draws a full poly-line (between many points) in currently active layer.
01169   * @param  Points: Pointer to the points array
01170   * @param  PointCount: Number of points
01171   */
01172 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount)
01173 {
01174   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;
01175   uint16_t  IMAGE_LEFT = 0, IMAGE_RIGHT = 0, IMAGE_TOP = 0, IMAGE_BOTTOM = 0;
01176
01177   IMAGE_LEFT = IMAGE_RIGHT = Points->X;
01178   IMAGE_TOP= IMAGE_BOTTOM = Points->Y;
01179
01180   for(counter = 1; counter < PointCount; counter++)
01181   {
01182     pixelX = POLY_X(counter);
01183     if(pixelX < IMAGE_LEFT)
01184     {
01185       IMAGE_LEFT = pixelX;
01186     }
01187     if(pixelX > IMAGE_RIGHT)
01188     {
01189       IMAGE_RIGHT = pixelX;
01190     }
01191
01192     pixelY = POLY_Y(counter);
01193     if(pixelY < IMAGE_TOP)
01194     {
01195       IMAGE_TOP = pixelY;
01196     }
01197     if(pixelY > IMAGE_BOTTOM)
01198     {
01199       IMAGE_BOTTOM = pixelY;
01200     }
01201   }
01202
01203   if(PointCount < 2)
01204   {
01205     return;
01206   }
01207
01208   X_center = (IMAGE_LEFT + IMAGE_RIGHT)/2;
01209   Y_center = (IMAGE_BOTTOM + IMAGE_TOP)/2;
01210
01211   X_first = Points->X;
01212   Y_first = Points->Y;
01213
01214   while(--PointCount)
01215   {
01216     X = Points->X;
01217     Y = Points->Y;
01218     Points++;
01219     X2 = Points->X;
01220     Y2 = Points->Y;
01221
01222     FillTriangle(X, X2, X_center, Y, Y2, Y_center);
01223     FillTriangle(X, X_center, X2, Y, Y_center, Y2);
01224     FillTriangle(X_center, X2, X, Y_center, Y2, Y);
01225   }
01226
01227   FillTriangle(X_first, X2, X_center, Y_first, Y2, Y_center);
01228   FillTriangle(X_first, X_center, X2, Y_first, Y_center, Y2);
01229   FillTriangle(X_center, X2, X_first, Y_center, Y2, Y_first);
01230 }
01231
01232 /**
01233   * @brief  Draws a full ellipse in currently active layer.
01234   * @param  Xpos: X position
01235   * @param  Ypos: Y position
01236   * @param  XRadius: Ellipse X radius
01237   * @param  YRadius: Ellipse Y radius
01238   */
01239 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
01240 {
01241   int x = 0, y = -YRadius, err = 2-2*XRadius, e2;
01242   float K = 0, rad1 = 0, rad2 = 0;
01243
01244   rad1 = XRadius;
01245   rad2 = YRadius;
01246
01247   K = (float)(rad2/rad1);
01248
01249   do
01250   {
01251     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/K)), (Ypos+y), (2*(uint16_t)(x/K) + 1));
01252     BSP_LCD_DrawHLine((Xpos-(uint16_t)(x/K)), (Ypos-y), (2*(uint16_t)(x/K) + 1));
01253
01254     e2 = err;
01255     if (e2 <= x)
01256     {
01257       err += ++x*2+1;
01258       if (-y == x && e2 <= y) e2 = 0;
01259     }
01260     if (e2 > y) err += ++y*2+1;
01261   }
01262   while (y <= 0);
01263 }
01264
01265 /**
01266   * @brief  Switch back on the display if was switched off by previous call of BSP_LCD_DisplayOff().
01267   *         Exit DSI ULPM mode if was allowed and configured in Dsi Configuration.
01268   */
01269 void BSP_LCD_DisplayOn(void)
01270 {
01271   /* Send Display on DCS command to display */
01272   HAL_DSI_ShortWrite(&(hdsi_eval),
01273                      hdsivideo_handle.VirtualChannelID,
01274                      DSI_DCS_SHORT_PKT_WRITE_P1,
01275                      OTM8009A_CMD_DISPON,
01276                      0x00);
01277
01278 }
01279
01280 /**
01281   * @brief  Switch Off the display.
01282   *         Enter DSI ULPM mode if was allowed and configured in Dsi Configuration.
01283   */
01284 void BSP_LCD_DisplayOff(void)
01285 {
01286   /* Send Display off DCS Command to display */
01287   HAL_DSI_ShortWrite(&(hdsi_eval),
01288                      hdsivideo_handle.VirtualChannelID,
01289                      DSI_DCS_SHORT_PKT_WRITE_P1,
01290                      OTM8009A_CMD_DISPOFF,
01291                      0x00);
01292
01293 }
01294
01295 /**
01296   * @brief  DCS or Generic short/long write command
01297   * @param  NbrParams: Number of parameters. It indicates the write command mode:
01298   *                 If inferior to 2, a long write command is performed else short.
01299   * @param  pParams: Pointer to parameter values table.
01300   * @retval HAL status
01301   */
01302 void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams)
01303 {
01304   if(NbrParams <= 1)
01305   {
01306    HAL_DSI_ShortWrite(&hdsi_eval, LCD_OTM8009A_ID, DSI_DCS_SHORT_PKT_WRITE_P1, pParams[0], pParams[1]);
01307   }
01308   else
01309   {
01310    HAL_DSI_LongWrite(&hdsi_eval,  LCD_OTM8009A_ID, DSI_DCS_LONG_PKT_WRITE, NbrParams, pParams[NbrParams], pParams);
01311   }
01312 }
01313
01314 /*******************************************************************************
01315                        LTDC, DMA2D and DSI BSP Routines
01316 *******************************************************************************/
01317 /**
01318   * @brief  Handles DMA2D interrupt request.
01319   * @note : Can be surcharged by application code implementation of the function.
01320   */
01321 __weak void BSP_LCD_DMA2D_IRQHandler(void)
01322 {
01323   HAL_DMA2D_IRQHandler(&hdma2d_eval);
01324 }
01325
01326 /**
01327   * @brief  Handles DSI interrupt request.
01328   * @note : Can be surcharged by application code implementation of the function.
01329   */
01330 __weak void BSP_LCD_DSI_IRQHandler(void)
01331 {
01332   HAL_DSI_IRQHandler(&(hdsi_eval));
01333 }
01334
01335
01336 /**
01337   * @brief  Handles LTDC interrupt request.
01338   * @note : Can be surcharged by application code implementation of the function.
01339   */
01340 __weak void BSP_LCD_LTDC_IRQHandler(void)
01341 {
01342   HAL_LTDC_IRQHandler(&(hltdc_eval));
01343 }
01344
01345 /**
01346   * @brief  De-Initializes the BSP LCD Msp
01347   * Application can surcharge if needed this function implementation.
01348   */
01349 __weak void BSP_LCD_MspDeInit(void)
01350 {
01351   /** @brief Disable IRQ of LTDC IP */
01352   HAL_NVIC_DisableIRQ(LTDC_IRQn);
01353
01354   /** @brief Disable IRQ of DMA2D IP */
01355   HAL_NVIC_DisableIRQ(DMA2D_IRQn);
01356
01357   /** @brief Disable IRQ of DSI IP */
01358   HAL_NVIC_DisableIRQ(DSI_IRQn);
01359
01360   /** @brief Force and let in reset state LTDC, DMA2D and DSI Host + Wrapper IPs */
01361   __HAL_RCC_LTDC_FORCE_RESET();
01362   __HAL_RCC_DMA2D_FORCE_RESET();
01363   __HAL_RCC_DSI_FORCE_RESET();
01364
01365   /** @brief Disable the LTDC, DMA2D and DSI Host and Wrapper clocks */
01366   __HAL_RCC_LTDC_CLK_DISABLE();
01367   __HAL_RCC_DMA2D_CLK_DISABLE();
01368   __HAL_RCC_DSI_CLK_DISABLE();
01369 }
01370
01371 /**
01372   * @brief  Initialize the BSP LCD Msp.
01373   * Application can surcharge if needed this function implementation
01374   */
01375 __weak void BSP_LCD_MspInit(void)
01376 {
01377   /** @brief Enable the LTDC clock */
01378   __HAL_RCC_LTDC_CLK_ENABLE();
01379
01380   /** @brief Toggle Sw reset of LTDC IP */
01381   __HAL_RCC_LTDC_FORCE_RESET();
01382   __HAL_RCC_LTDC_RELEASE_RESET();
01383
01384   /** @brief Enable the DMA2D clock */
01385   __HAL_RCC_DMA2D_CLK_ENABLE();
01386
01387   /** @brief Toggle Sw reset of DMA2D IP */
01388   __HAL_RCC_DMA2D_FORCE_RESET();
01389   __HAL_RCC_DMA2D_RELEASE_RESET();
01390
01391   /** @brief Enable DSI Host and wrapper clocks */
01392   __HAL_RCC_DSI_CLK_ENABLE();
01393
01394   /** @brief Soft Reset the DSI Host and wrapper */
01395   __HAL_RCC_DSI_FORCE_RESET();
01396   __HAL_RCC_DSI_RELEASE_RESET();
01397
01398   /** @brief NVIC configuration for LTDC interrupt that is now enabled */
01399   HAL_NVIC_SetPriority(LTDC_IRQn, 3, 0);
01400   HAL_NVIC_EnableIRQ(LTDC_IRQn);
01401
01402   /** @brief NVIC configuration for DMA2D interrupt that is now enabled */
01403   HAL_NVIC_SetPriority(DMA2D_IRQn, 3, 0);
01404   HAL_NVIC_EnableIRQ(DMA2D_IRQn);
01405
01406   /** @brief NVIC configuration for DSI interrupt that is now enabled */
01407   HAL_NVIC_SetPriority(DSI_IRQn, 3, 0);
01408   HAL_NVIC_EnableIRQ(DSI_IRQn);
01409 }
01410
01411 /**
01412   * @brief  This function handles LTDC Error interrupt Handler.
01413   * @note : Can be surcharged by application code implementation of the function.
01414   */
01415
01416 __weak void BSP_LCD_LTDC_ER_IRQHandler(void)
01417 {
01418   HAL_LTDC_IRQHandler(&(hltdc_eval));
01419 }
01420
01421
01422 /**
01423   * @brief  Draws a pixel on LCD.
01424   * @param  Xpos: X position
01425   * @param  Ypos: Y position
01426   * @param  RGB_Code: Pixel color in ARGB mode (8-8-8-8)
01427   */
01428 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
01429 {
01430   /* Write data value to all SDRAM memory */
01431   *(__IO uint32_t*) (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
01432 }
01433
01434
01435 /**
01436   * @brief  Draws a character on LCD.
01437   * @param  Xpos: Line where to display the character shape
01438   * @param  Ypos: Start column address
01439   * @param  c: Pointer to the character data
01440   */
01441 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
01442 {
01443   uint32_t i = 0, j = 0;
01444   uint16_t height, width;
01445   uint8_t  offset;
01446   uint8_t  *pchar;
01447   uint32_t line;
01448
01449   height = DrawProp[ActiveLayer].pFont->Height;
01450   width  = DrawProp[ActiveLayer].pFont->Width;
01451
01452   offset =  8 *((width + 7)/8) -  width ;
01453
01454   for(i = 0; i < height; i++)
01455   {
01456     pchar = ((uint8_t *)c + (width + 7)/8 * i);
01457
01458     switch(((width + 7)/8))
01459     {
01460
01461     case 1:
01462       line =  pchar[0];
01463       break;
01464
01465     case 2:
01466       line =  (pchar[0]<< 8) | pchar[1];
01467       break;
01468
01469     case 3:
01470     default:
01471       line =  (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];
01472       break;
01473     }
01474
01475     for (j = 0; j < width; j++)
01476     {
01477       if(line & (1 << (width- j + offset- 1)))
01478       {
01479         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].TextColor);
01480       }
01481       else
01482       {
01483         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp[ActiveLayer].BackColor);
01484       }
01485     }
01486     Ypos++;
01487   }
01488 }
01489
01490 /**
01491   * @brief  Fills a triangle (between 3 points).
01492   * @param  x1: Point 1 X position
01493   * @param  y1: Point 1 Y position
01494   * @param  x2: Point 2 X position
01495   * @param  y2: Point 2 Y position
01496   * @param  x3: Point 3 X position
01497   * @param  y3: Point 3 Y position
01498   */
01499 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
01500 {
01501   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01502   yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
01503   curpixel = 0;
01504
01505   deltax = ABS(x2 - x1);        /* The difference between the x's */
01506   deltay = ABS(y2 - y1);        /* The difference between the y's */
01507   x = x1;                       /* Start x off at the first pixel */
01508   y = y1;                       /* Start y off at the first pixel */
01509
01510   if (x2 >= x1)                 /* The x-values are increasing */
01511   {
01512     xinc1 = 1;
01513     xinc2 = 1;
01514   }
01515   else                          /* The x-values are decreasing */
01516   {
01517     xinc1 = -1;
01518     xinc2 = -1;
01519   }
01520
01521   if (y2 >= y1)                 /* The y-values are increasing */
01522   {
01523     yinc1 = 1;
01524     yinc2 = 1;
01525   }
01526   else                          /* The y-values are decreasing */
01527   {
01528     yinc1 = -1;
01529     yinc2 = -1;
01530   }
01531
01532   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01533   {
01534     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01535     yinc2 = 0;                  /* Don't change the y for every iteration */
01536     den = deltax;
01537     num = deltax / 2;
01538     numadd = deltay;
01539     numpixels = deltax;         /* There are more x-values than y-values */
01540   }
01541   else                          /* There is at least one y-value for every x-value */
01542   {
01543     xinc2 = 0;                  /* Don't change the x for every iteration */
01544     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01545     den = deltay;
01546     num = deltay / 2;
01547     numadd = deltax;
01548     numpixels = deltay;         /* There are more y-values than x-values */
01549   }
01550
01551   for (curpixel = 0; curpixel <= numpixels; curpixel++)
01552   {
01553     BSP_LCD_DrawLine(x, y, x3, y3);
01554
01555     num += numadd;              /* Increase the numerator by the top of the fraction */
01556     if (num >= den)             /* Check if numerator >= denominator */
01557     {
01558       num -= den;               /* Calculate the new numerator value */
01559       x += xinc1;               /* Change the x as appropriate */
01560       y += yinc1;               /* Change the y as appropriate */
01561     }
01562     x += xinc2;                 /* Change the x as appropriate */
01563     y += yinc2;                 /* Change the y as appropriate */
01564   }
01565 }
01566
01567 /**
01568   * @brief  Fills a buffer.
01569   * @param  LayerIndex: Layer index
01570   * @param  pDst: Pointer to destination buffer
01571   * @param  xSize: Buffer width
01572   * @param  ySize: Buffer height
01573   * @param  OffLine: Offset
01574   * @param  ColorIndex: Color index
01575   */
01576 static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)
01577 {
01578   /* Register to memory mode with ARGB8888 as color Mode */
01579   hdma2d_eval.Init.Mode         = DMA2D_R2M;
01580   hdma2d_eval.Init.ColorMode    = DMA2D_ARGB8888;
01581   hdma2d_eval.Init.OutputOffset = OffLine;
01582
01583   hdma2d_eval.Instance = DMA2D;
01584
01585   /* DMA2D Initialization */
01586   if(HAL_DMA2D_Init(&hdma2d_eval) == HAL_OK)
01587   {
01588     if(HAL_DMA2D_ConfigLayer(&hdma2d_eval, LayerIndex) == HAL_OK)
01589     {
01590       if (HAL_DMA2D_Start(&hdma2d_eval, ColorIndex, (uint32_t)pDst, xSize, ySize) == HAL_OK)
01591       {
01592         /* Polling For DMA transfer */
01593         HAL_DMA2D_PollForTransfer(&hdma2d_eval, 10);
01594       }
01595     }
01596   }
01597 }
01598
01599 /**
01600   * @brief  Converts a line to an ARGB8888 pixel format.
01601   * @param  pSrc: Pointer to source buffer
01602   * @param  pDst: Output color
01603   * @param  xSize: Buffer width
01604   * @param  ColorMode: Input color mode
01605   */
01606 static void LL_ConvertLineToARGB8888(void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)
01607 {
01608   /* Configure the DMA2D Mode, Color Mode and output offset */
01609   hdma2d_eval.Init.Mode         = DMA2D_M2M_PFC;
01610   hdma2d_eval.Init.ColorMode    = DMA2D_ARGB8888;
01611   hdma2d_eval.Init.OutputOffset = 0;
01612
01613   /* Foreground Configuration */
01614   hdma2d_eval.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
01615   hdma2d_eval.LayerCfg[1].InputAlpha = 0xFF;
01616   hdma2d_eval.LayerCfg[1].InputColorMode = ColorMode;
01617   hdma2d_eval.LayerCfg[1].InputOffset = 0;
01618
01619   hdma2d_eval.Instance = DMA2D;
01620
01621   /* DMA2D Initialization */
01622   if(HAL_DMA2D_Init(&hdma2d_eval) == HAL_OK)
01623   {
01624     if(HAL_DMA2D_ConfigLayer(&hdma2d_eval, 1) == HAL_OK)
01625     {
01626       if (HAL_DMA2D_Start(&hdma2d_eval, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1) == HAL_OK)
01627       {
01628         /* Polling For DMA transfer */
01629         HAL_DMA2D_PollForTransfer(&hdma2d_eval, 10);
01630       }
01631     }
01632   }
01633 }
01634
01635 /**
01636   * @}
01637   */
01638
01639 /**
01640   * @}
01641   */
01642
01643 /**
01644   * @}
01645   */
01646
01647 /**
01648   * @}
01649   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_lcd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32469i_discovery_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32469I_DISCOVERY_LCD_H
00022 #define __STM32469I_DISCOVERY_LCD_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 /* Include LCD component Driver */
00030
00031 /* Include OTM8009A LCD Driver IC driver code */
00032 #include "../Components/otm8009a/otm8009a.h"
00033 /* Include NT35510 LCD Driver IC driver code */
00034 #include "../Components/nt35510/nt35510.h"
00035
00036 /* Include SDRAM Driver */
00037 #include "stm32469i_discovery_sdram.h"
00038 #include "stm32469i_discovery.h"
00039 #include "../../../Utilities/Fonts/fonts.h"
00040
00041 #include <string.h> /* use of memset() */
00042
00043 /** @addtogroup BSP
00044   * @{
00045   */
00046
00047 /** @addtogroup STM32469I_Discovery
00048   * @{
00049   */
00050
00051 /** @addtogroup STM32469I-Discovery_LCD
00052   * @{
00053   */
00054
00055 /** @defgroup STM32469I-Discovery_LCD_Exported_Constants STM32469I Discovery LCD Exported Constants
00056   * @{
00057   */
00058
00059 #define LCD_LayerCfgTypeDef    LTDC_LayerCfgTypeDef
00060 /**
00061   * @brief  LCD FB_StartAddress
00062   */
00063 #define LCD_FB_START_ADDRESS       ((uint32_t)0xC0000000)
00064
00065 /** @brief Maximum number of LTDC layers
00066  */
00067 #define LTDC_MAX_LAYER_NUMBER             ((uint32_t) 2)
00068
00069 /** @brief LTDC Background layer index
00070  */
00071 #define LTDC_ACTIVE_LAYER_BACKGROUND      ((uint32_t) 0)
00072
00073 /** @brief LTDC Foreground layer index
00074  */
00075 #define LTDC_ACTIVE_LAYER_FOREGROUND      ((uint32_t) 1)
00076
00077 /** @brief Number of LTDC layers
00078  */
00079 #define LTDC_NB_OF_LAYERS                 ((uint32_t) 2)
00080
00081 /** @brief LTDC Default used layer index
00082  */
00083 #define LTDC_DEFAULT_ACTIVE_LAYER         LTDC_ACTIVE_LAYER_FOREGROUND
00084
00085 /**
00086   * @brief  LCD status structure definition
00087   */
00088 #define   LCD_OK         0x00
00089 #define   LCD_ERROR      0x01
00090 #define   LCD_TIMEOUT    0x02
00091
00092 /**
00093   * @brief  LCD Display OTM8009A ID
00094   */
00095 #define LCD_OTM8009A_ID  ((uint32_t) 0)
00096
00097 /**
00098   * @brief  LCD color definitions values
00099   * in ARGB8888 format.
00100   */
00101
00102 /** @brief Blue value in ARGB8888 format
00103  */
00104 #define LCD_COLOR_BLUE          ((uint32_t) 0xFF0000FF)
00105
00106 /** @brief Green value in ARGB8888 format
00107  */
00108 #define LCD_COLOR_GREEN         ((uint32_t) 0xFF00FF00)
00109
00110 /** @brief Red value in ARGB8888 format
00111  */
00112 #define LCD_COLOR_RED           ((uint32_t) 0xFFFF0000)
00113
00114 /** @brief Cyan value in ARGB8888 format
00115  */
00116 #define LCD_COLOR_CYAN          ((uint32_t) 0xFF00FFFF)
00117
00118 /** @brief Magenta value in ARGB8888 format
00119  */
00120 #define LCD_COLOR_MAGENTA       ((uint32_t) 0xFFFF00FF)
00121
00122 /** @brief Yellow value in ARGB8888 format
00123  */
00124 #define LCD_COLOR_YELLOW        ((uint32_t) 0xFFFFFF00)
00125
00126 /** @brief Light Blue value in ARGB8888 format
00127  */
00128 #define LCD_COLOR_LIGHTBLUE     ((uint32_t) 0xFF8080FF)
00129
00130 /** @brief Light Green value in ARGB8888 format
00131  */
00132 #define LCD_COLOR_LIGHTGREEN    ((uint32_t) 0xFF80FF80)
00133
00134 /** @brief Light Red value in ARGB8888 format
00135  */
00136 #define LCD_COLOR_LIGHTRED      ((uint32_t) 0xFFFF8080)
00137
00138 /** @brief Light Cyan value in ARGB8888 format
00139  */
00140 #define LCD_COLOR_LIGHTCYAN     ((uint32_t) 0xFF80FFFF)
00141
00142 /** @brief Light Magenta value in ARGB8888 format
00143  */
00144 #define LCD_COLOR_LIGHTMAGENTA  ((uint32_t) 0xFFFF80FF)
00145
00146 /** @brief Light Yellow value in ARGB8888 format
00147  */
00148 #define LCD_COLOR_LIGHTYELLOW   ((uint32_t) 0xFFFFFF80)
00149
00150 /** @brief Dark Blue value in ARGB8888 format
00151  */
00152 #define LCD_COLOR_DARKBLUE      ((uint32_t) 0xFF000080)
00153
00154 /** @brief Light Dark Green value in ARGB8888 format
00155  */
00156 #define LCD_COLOR_DARKGREEN     ((uint32_t) 0xFF008000)
00157
00158 /** @brief Light Dark Red value in ARGB8888 format
00159  */
00160 #define LCD_COLOR_DARKRED       ((uint32_t) 0xFF800000)
00161
00162 /** @brief Dark Cyan value in ARGB8888 format
00163  */
00164 #define LCD_COLOR_DARKCYAN      ((uint32_t) 0xFF008080)
00165
00166 /** @brief Dark Magenta value in ARGB8888 format
00167  */
00168 #define LCD_COLOR_DARKMAGENTA   ((uint32_t) 0xFF800080)
00169
00170 /** @brief Dark Yellow value in ARGB8888 format
00171  */
00172 #define LCD_COLOR_DARKYELLOW    ((uint32_t) 0xFF808000)
00173
00174 /** @brief White value in ARGB8888 format
00175  */
00176 #define LCD_COLOR_WHITE         ((uint32_t) 0xFFFFFFFF)
00177
00178 /** @brief Light Gray value in ARGB8888 format
00179  */
00180 #define LCD_COLOR_LIGHTGRAY     ((uint32_t) 0xFFD3D3D3)
00181
00182 /** @brief Gray value in ARGB8888 format
00183  */
00184 #define LCD_COLOR_GRAY          ((uint32_t) 0xFF808080)
00185
00186 /** @brief Dark Gray value in ARGB8888 format
00187  */
00188 #define LCD_COLOR_DARKGRAY      ((uint32_t) 0xFF404040)
00189
00190 /** @brief Black value in ARGB8888 format
00191  */
00192 #define LCD_COLOR_BLACK         ((uint32_t) 0xFF000000)
00193
00194 /** @brief Brown value in ARGB8888 format
00195  */
00196 #define LCD_COLOR_BROWN         ((uint32_t) 0xFFA52A2A)
00197
00198 /** @brief Orange value in ARGB8888 format
00199  */
00200 #define LCD_COLOR_ORANGE        ((uint32_t) 0xFFFFA500)
00201
00202 /** @brief Transparent value in ARGB8888 format
00203  */
00204 #define LCD_COLOR_TRANSPARENT   ((uint32_t) 0xFF000000)
00205
00206 /**
00207   * @brief LCD default font
00208   */
00209 #define LCD_DEFAULT_FONT        Font24
00210
00211 /**
00212  *  @brief  Possible values of
00213  *  pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets
00214  */
00215
00216 #define   LCD_DSI_PIXEL_DATA_FMT_RBG888  DSI_RGB888 /*!< DSI packet pixel format chosen is RGB888 : 24 bpp */
00217 #define   LCD_DSI_PIXEL_DATA_FMT_RBG565  DSI_RGB565 /*!< DSI packet pixel format chosen is RGB565 : 16 bpp */
00218
00219 /**
00220   * @}
00221   */
00222
00223 /** @defgroup STM32469I-Discovery_LCD_Exported_Types STM32469I Discovery LCD Exported Types
00224   * @{
00225   */
00226
00227 /**
00228 * @brief  LCD Drawing main properties
00229 */
00230 typedef struct
00231 {
00232   uint32_t TextColor; /*!< Specifies the color of text */
00233   uint32_t BackColor; /*!< Specifies the background color below the text */
00234   sFONT    *pFont;    /*!< Specifies the font used for the text */
00235
00236 } LCD_DrawPropTypeDef;
00237
00238 /**
00239   * @brief  LCD Drawing point (pixel) geometric definition
00240   */
00241 typedef struct
00242 {
00243   int16_t X; /*!< geometric X position of drawing */
00244   int16_t Y; /*!< geometric Y position of drawing */
00245
00246 } Point;
00247
00248 /**
00249   * @brief  Pointer on LCD Drawing point (pixel) geometric definition
00250   */
00251 typedef Point * pPoint;
00252
00253 /**
00254   * @brief  LCD drawing Line alignment mode definitions
00255   */
00256 typedef enum
00257 {
00258   CENTER_MODE             = 0x01,    /*!< Center mode */
00259   RIGHT_MODE              = 0x02,    /*!< Right mode  */
00260   LEFT_MODE               = 0x03     /*!< Left mode   */
00261
00262 } Text_AlignModeTypdef;
00263
00264
00265 /**
00266  *  @brief LCD_OrientationTypeDef
00267  *  Possible values of Display Orientation
00268  */
00269 typedef enum
00270 {
00271   LCD_ORIENTATION_PORTRAIT  = 0x00, /*!< Portrait orientation choice of LCD screen  */
00272   LCD_ORIENTATION_LANDSCAPE = 0x01, /*!< Landscape orientation choice of LCD screen */
00273   LCD_ORIENTATION_INVALID   = 0x02  /*!< Invalid orientation choice of LCD screen   */
00274 } LCD_OrientationTypeDef;
00275
00276 /**
00277   * @}
00278   */
00279
00280 /** @defgroup STM32469I-Discovery_LCD_Exported_Macro STM32469I Discovery LCD Exported Macro
00281   * @{
00282   */
00283
00284 /**
00285   * @}
00286   */
00287
00288 /** @defgroup STM32469I-Discovery_LCD_Exported_Functions STM32469I Discovery LCD Exported Functions
00289   * @{
00290   */
00291 void     BSP_LCD_DMA2D_IRQHandler(void);
00292 void     BSP_LCD_DSI_IRQHandler(void);
00293 void     BSP_LCD_LTDC_IRQHandler(void);
00294 void     BSP_LCD_LTDC_ER_IRQHandler(void);
00295
00296 uint8_t  BSP_LCD_Init(void);
00297 uint8_t  BSP_LCD_InitEx(LCD_OrientationTypeDef orientation);
00298
00299 void     BSP_LCD_MspDeInit(void);
00300 void     BSP_LCD_MspInit(void);
00301 void     BSP_LCD_Reset(void);
00302
00303 uint32_t BSP_LCD_GetXSize(void);
00304 uint32_t BSP_LCD_GetYSize(void);
00305 void     BSP_LCD_SetXSize(uint32_t imageWidthPixels);
00306 void     BSP_LCD_SetYSize(uint32_t imageHeightPixels);
00307
00308 void     BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address);
00309 void     BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
00310 void     BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
00311 void     BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
00312 void     BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
00313 void     BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00314
00315 void     BSP_LCD_SelectLayer(uint32_t LayerIndex);
00316 void     BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
00317
00318 void     BSP_LCD_SetTextColor(uint32_t Color);
00319 uint32_t BSP_LCD_GetTextColor(void);
00320 void     BSP_LCD_SetBackColor(uint32_t Color);
00321 uint32_t BSP_LCD_GetBackColor(void);
00322 void     BSP_LCD_SetFont(sFONT *fonts);
00323 sFONT    *BSP_LCD_GetFont(void);
00324
00325 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00326 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
00327 void     BSP_LCD_Clear(uint32_t Color);
00328 void     BSP_LCD_ClearStringLine(uint32_t Line);
00329 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00330 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
00331 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00332
00333 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00334 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00335 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00336 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00337 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00338 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00339 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00340 void     BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
00341
00342 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00343 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00344 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00345 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00346
00347 void     BSP_LCD_DisplayOff(void);
00348 void     BSP_LCD_DisplayOn(void);
00349
00350 /**
00351   * @}
00352   */
00353
00354 /** @defgroup STM32469I-EVAL_LCD_Exported_Variables STM32469I EVAL LCD Exported Variables
00355   * @{
00356   */
00357
00358 /* @brief DMA2D handle variable */
00359 extern DMA2D_HandleTypeDef hdma2d_eval;
00360
00361 /**
00362   * @}
00363   */
00364
00365 /** @defgroup STM32469I-Discovery_LCD_Exported_Variables STM32469I Discovery LCD Exported Variables
00366   * @{
00367   */
00368
00369 /**
00370   * @}
00371   */
00372
00373 /**
00374   * @}
00375   */
00376
00377 /**
00378   * @}
00379   */
00380
00381 /**
00382   * @}
00383   */
00384
00385 #ifdef __cplusplus
00386 }
00387 #endif
00388
00389 #endif /* __STM32469I_DISCOVERY_LCD_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_qspi.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_qspi.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_qspi.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the N25Q128A QSPI
00006   *          memory mounted on STM32469I-Discovery board.
00007   *
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * Copyright (c) 2017 STMicroelectronics.
00012   * All rights reserved.
00013   *
00014   * This software is licensed under terms that can be found in the LICENSE file
00015   * in the root directory of this software component.
00016   * If no LICENSE file comes with this software, it is provided AS-IS.
00017   *
00018   ******************************************************************************
00019   @verbatim
00020   ==============================================================================
00021                      ##### How to use this driver #####
00022   ==============================================================================
00023   [..]
00024    (#) This driver is used to drive the N25Q128A QSPI external
00025        memory mounted on STM32469I-Discovery board.
00026
00027    (#) This driver need a specific component driver N25Q128A to be included with.
00028
00029    (#) Initialization steps:
00030        (++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
00031             function includes the MSP layer hardware resources initialization and the
00032             QSPI interface with the external memory.
00033
00034    (#) QSPI memory operations
00035        (++) QSPI memory can be accessed with read/write operations once it is
00036             initialized.
00037             Read/write operation can be performed with AHB access using the functions
00038             BSP_QSPI_Read()/BSP_QSPI_Write().
00039        (++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
00040             (see the QSPI memory data sheet)
00041        (++) Perform erase block operation using the function BSP_QSPI_Erase_Block() and by
00042             specifying the block address. You can perform an erase operation of the whole
00043             chip by calling the function BSP_QSPI_Erase_Chip().
00044        (++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
00045             (see the QSPI memory data sheet)
00046   @endverbatim
00047   ******************************************************************************
00048   */
00049
00050 /* Includes ------------------------------------------------------------------*/
00051 #include "stm32469i_discovery_qspi.h"
00052
00053 /** @addtogroup BSP
00054   * @{
00055   */
00056
00057 /** @addtogroup STM32469I_Discovery
00058   * @{
00059   */
00060
00061 /** @defgroup STM32469I_Discovery_QSPI STM32469I Discovery QSPI
00062   * @{
00063   */
00064
00065
00066 /* Private variables ---------------------------------------------------------*/
00067
00068
00069 /** @defgroup STM32469I_Discovery_QSPI_Private_Variables STM32469I Discovery QSPI Private Variables
00070   * @{
00071   */
00072 QSPI_HandleTypeDef QSPIHandle;
00073
00074 /**
00075   * @}
00076   */
00077
00078
00079
00080 /* Private functions ---------------------------------------------------------*/
00081
00082 /** @defgroup STM32469I_Discovery_QSPI_Private_Functions STM32469I Discovery QSPI Private Functions
00083   * @{
00084   */
00085 static uint8_t QSPI_ResetMemory          (QSPI_HandleTypeDef *hqspi);
00086 static uint8_t QSPI_DummyCyclesCfg       (QSPI_HandleTypeDef *hqspi);
00087 static uint8_t QSPI_WriteEnable          (QSPI_HandleTypeDef *hqspi);
00088 static uint8_t QSPI_AutoPollingMemReady  (QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
00089
00090
00091 /**
00092   * @}
00093   */
00094
00095 /** @defgroup STM32469I_Discovery_QSPI_Exported_Functions STM32469I Discovery QSPI Exported Functions
00096   * @{
00097   */
00098
00099 /**
00100   * @brief  Initializes the QSPI interface.
00101   * @retval QSPI memory status
00102   */
00103 uint8_t BSP_QSPI_Init(void)
00104 {
00105   QSPIHandle.Instance = QUADSPI;
00106
00107   /* Call the DeInit function to reset the driver */
00108   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00109   {
00110     return QSPI_ERROR;
00111   }
00112
00113   /* System level initialization */
00114   BSP_QSPI_MspInit(&QSPIHandle, NULL);
00115
00116   /* QSPI initialization */
00117   QSPIHandle.Init.ClockPrescaler     = 1; /* QSPI Freq= 180 MHz / (1+1) = 90 MHz */
00118   QSPIHandle.Init.FifoThreshold      = 1;
00119   QSPIHandle.Init.SampleShifting     = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
00120   QSPIHandle.Init.FlashSize          = POSITION_VAL(N25Q128A_FLASH_SIZE) - 1;
00121   QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_5_CYCLE;
00122   QSPIHandle.Init.ClockMode          = QSPI_CLOCK_MODE_0;
00123   QSPIHandle.Init.FlashID            = QSPI_FLASH_ID_1;
00124   QSPIHandle.Init.DualFlash          = QSPI_DUALFLASH_DISABLE;
00125
00126   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00127   {
00128     return QSPI_ERROR;
00129   }
00130
00131   /* QSPI memory reset */
00132   if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
00133   {
00134     return QSPI_NOT_SUPPORTED;
00135   }
00136
00137
00138   /* Configuration of the dummy cucles on QSPI memory side */
00139   if (QSPI_DummyCyclesCfg(&QSPIHandle) != QSPI_OK)
00140   {
00141     return QSPI_NOT_SUPPORTED;
00142   }
00143
00144   return QSPI_OK;
00145 }
00146
00147 /**
00148   * @brief  De-Initializes the QSPI interface.
00149   * @retval QSPI memory status
00150   */
00151 uint8_t BSP_QSPI_DeInit(void)
00152 {
00153   QSPIHandle.Instance = QUADSPI;
00154
00155   /* Call the DeInit function to reset the driver */
00156   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00157   {
00158     return QSPI_ERROR;
00159   }
00160
00161   /* System level De-initialization */
00162   BSP_QSPI_MspDeInit(&QSPIHandle, NULL);
00163
00164   return QSPI_OK;
00165 }
00166
00167 /**
00168   * @brief  Reads an amount of data from the QSPI memory.
00169   * @param  pData: Pointer to data to be read
00170   * @param  ReadAddr: Read start address
00171   * @param  Size: Size of data to read
00172   * @retval QSPI memory status
00173   */
00174 uint8_t BSP_QSPI_Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
00175 {
00176   QSPI_CommandTypeDef s_command;
00177
00178   /* Initialize the read command */
00179   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00180   s_command.Instruction       = QUAD_INOUT_FAST_READ_CMD;
00181   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00182   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00183   s_command.Address           = ReadAddr;
00184   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00185   s_command.DataMode          = QSPI_DATA_4_LINES;
00186   s_command.DummyCycles       = N25Q128A_DUMMY_CYCLES_READ_QUAD;
00187   s_command.NbData            = Size;
00188   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00189   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00190   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00191
00192   /* Configure the command */
00193   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00194   {
00195     return QSPI_ERROR;
00196   }
00197
00198   /* Set S# timing for Read command: Min 20ns for N25Q128A memory */
00199   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_2_CYCLE);
00200
00201   /* Reception of the data */
00202   if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00203   {
00204     return QSPI_ERROR;
00205   }
00206
00207   /* Restore S# timing for nonRead commands */
00208   MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_5_CYCLE);
00209
00210   return QSPI_OK;
00211 }
00212
00213 /**
00214   * @brief  Writes an amount of data to the QSPI memory.
00215   * @param  pData: Pointer to data to be written
00216   * @param  WriteAddr: Write start address
00217   * @param  Size: Size of data to write
00218   * @retval QSPI memory status
00219   */
00220 uint8_t BSP_QSPI_Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
00221 {
00222   QSPI_CommandTypeDef s_command;
00223   uint32_t end_addr, current_size, current_addr;
00224
00225   /* Calculation of the size between the write address and the end of the page */
00226   current_size = N25Q128A_PAGE_SIZE - (WriteAddr % N25Q128A_PAGE_SIZE);
00227
00228   /* Check if the size of the data is less than the remaining place in the page */
00229   if (current_size > Size)
00230   {
00231     current_size = Size;
00232   }
00233
00234   /* Initialize the address variables */
00235   current_addr = WriteAddr;
00236   end_addr = WriteAddr + Size;
00237
00238   /* Initialize the program command */
00239   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00240   s_command.Instruction       = EXT_QUAD_IN_FAST_PROG_CMD;
00241   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00242   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00243   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00244   s_command.DataMode          = QSPI_DATA_4_LINES;
00245   s_command.DummyCycles       = 0;
00246   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00247   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00248   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00249
00250   /* Perform the write page by page */
00251   do
00252   {
00253     s_command.Address = current_addr;
00254     s_command.NbData  = current_size;
00255
00256     /* Enable write operations */
00257     if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00258     {
00259       return QSPI_ERROR;
00260     }
00261
00262     /* Configure the command */
00263     if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00264     {
00265       return QSPI_ERROR;
00266     }
00267
00268     /* Transmission of the data */
00269     if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00270     {
00271       return QSPI_ERROR;
00272     }
00273
00274     /* Configure automatic polling mode to wait for end of program */
00275     if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00276     {
00277       return QSPI_ERROR;
00278     }
00279
00280     /* Update the address and size variables for next page programming */
00281     current_addr += current_size;
00282     pData += current_size;
00283     current_size = ((current_addr + N25Q128A_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : N25Q128A_PAGE_SIZE;
00284   } while (current_addr < end_addr);
00285
00286   return QSPI_OK;
00287 }
00288
00289 /**
00290   * @brief  Erases the specified block of the QSPI memory.
00291   * @param  BlockAddress: Block address to erase
00292   * @retval QSPI memory status
00293   */
00294 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
00295 {
00296   QSPI_CommandTypeDef s_command;
00297
00298   /* Initialize the erase command */
00299   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00300   s_command.Instruction       = SUBSECTOR_ERASE_CMD;
00301   s_command.AddressMode       = QSPI_ADDRESS_1_LINE;
00302   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00303   s_command.Address           = BlockAddress;
00304   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00305   s_command.DataMode          = QSPI_DATA_NONE;
00306   s_command.DummyCycles       = 0;
00307   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00308   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00309   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00310
00311   /* Enable write operations */
00312   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00313   {
00314     return QSPI_ERROR;
00315   }
00316
00317   /* Send the command */
00318   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00319   {
00320     return QSPI_ERROR;
00321   }
00322
00323   /* Configure automatic polling mode to wait for end of erase */
00324   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_SUBSECTOR_ERASE_MAX_TIME) != QSPI_OK)
00325   {
00326     return QSPI_ERROR;
00327   }
00328
00329   return QSPI_OK;
00330 }
00331
00332 /**
00333   * @brief  Erases the entire QSPI memory.
00334   * @retval QSPI memory status
00335   */
00336 uint8_t BSP_QSPI_Erase_Chip(void)
00337 {
00338   QSPI_CommandTypeDef s_command;
00339
00340   /* Initialize the erase command */
00341   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00342   s_command.Instruction       = BULK_ERASE_CMD;
00343   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00344   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00345   s_command.DataMode          = QSPI_DATA_NONE;
00346   s_command.DummyCycles       = 0;
00347   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00348   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00349   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00350
00351   /* Enable write operations */
00352   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00353   {
00354     return QSPI_ERROR;
00355   }
00356
00357   /* Send the command */
00358   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00359   {
00360     return QSPI_ERROR;
00361   }
00362
00363   /* Configure automatic polling mode to wait for end of erase */
00364   if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_BULK_ERASE_MAX_TIME) != QSPI_OK)
00365   {
00366     return QSPI_ERROR;
00367   }
00368
00369   return QSPI_OK;
00370 }
00371
00372 /**
00373   * @brief  Reads current status of the QSPI memory.
00374   * @retval QSPI memory status
00375   */
00376 uint8_t BSP_QSPI_GetStatus(void)
00377 {
00378   QSPI_CommandTypeDef s_command;
00379   uint8_t reg;
00380
00381   /* Initialize the read flag status register command */
00382   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00383   s_command.Instruction       = READ_FLAG_STATUS_REG_CMD;
00384   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00385   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00386   s_command.DataMode          = QSPI_DATA_1_LINE;
00387   s_command.DummyCycles       = 0;
00388   s_command.NbData            = 1;
00389   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00390   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00391   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00392
00393   /* Configure the command */
00394   if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00395   {
00396     return QSPI_ERROR;
00397   }
00398
00399   /* Reception of the data */
00400   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00401   {
00402     return QSPI_ERROR;
00403   }
00404
00405   /* Check the value of the register */
00406   if ((reg & (N25Q128A_FSR_PRERR | N25Q128A_FSR_VPPERR | N25Q128A_FSR_PGERR | N25Q128A_FSR_ERERR)) != 0)
00407   {
00408     return QSPI_ERROR;
00409   }
00410   else if ((reg & (N25Q128A_FSR_PGSUS | N25Q128A_FSR_ERSUS)) != 0)
00411   {
00412     return QSPI_SUSPENDED;
00413   }
00414   else if ((reg & N25Q128A_FSR_READY) != 0)
00415   {
00416     return QSPI_OK;
00417   }
00418   else
00419   {
00420     return QSPI_BUSY;
00421   }
00422 }
00423
00424 /**
00425   * @brief  Reads the configuration of the memory and fills QspiInfo struct
00426   * @param  pInfo pointer to Info structure
00427   * @retval QSPI memory status
00428   */
00429 uint8_t BSP_QSPI_GetInfo(QSPI_InfoTypeDef* pInfo)
00430 {
00431   /* Configure the structure with the memory configuration */
00432   pInfo->FlashSize          = N25Q128A_FLASH_SIZE;
00433   pInfo->EraseSectorSize    = N25Q128A_SUBSECTOR_SIZE;
00434   pInfo->EraseSectorsNumber = (N25Q128A_FLASH_SIZE/N25Q128A_SUBSECTOR_SIZE);
00435   pInfo->ProgPageSize       = N25Q128A_PAGE_SIZE;
00436   pInfo->ProgPagesNumber    = (N25Q128A_FLASH_SIZE/N25Q128A_PAGE_SIZE);
00437
00438   return QSPI_OK;
00439 }
00440
00441 /**
00442   * @brief  Configure the QSPI in memory-mapped mode
00443   * @retval QSPI memory status
00444   */
00445 uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
00446 {
00447   QSPI_CommandTypeDef      s_command;
00448   QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
00449
00450   /* Configure the command for the read instruction */
00451   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00452   s_command.Instruction       = QUAD_INOUT_FAST_READ_CMD;
00453   s_command.AddressMode       = QSPI_ADDRESS_4_LINES;
00454   s_command.AddressSize       = QSPI_ADDRESS_24_BITS;
00455   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00456   s_command.DataMode          = QSPI_DATA_4_LINES;
00457   s_command.DummyCycles       = N25Q128A_DUMMY_CYCLES_READ_QUAD;
00458   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00459   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00460   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00461
00462   /* Configure the memory mapped mode */
00463   s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
00464
00465   if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
00466   {
00467     return QSPI_ERROR;
00468   }
00469
00470   return QSPI_OK;
00471 }
00472
00473 /**
00474   * @}
00475   */
00476
00477 /** @defgroup STM32469I_Discovery_QSPI_Private_Functions STM32469I Discovery QSPI Private Functions
00478   * @{
00479   */
00480
00481 /**
00482   * @brief QSPI MSP Initialization
00483   *        This function configures the hardware resources used in this example:
00484   *           - Peripheral's clock enable
00485   *           - Peripheral's GPIO Configuration
00486   *           - NVIC configuration for QSPI interrupt
00487   */
00488 __weak void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params)
00489 {
00490   GPIO_InitTypeDef gpio_init_structure;
00491
00492   /*##-1- Enable peripherals and GPIO Clocks #################################*/
00493   /* Enable the QuadSPI memory interface clock */
00494   QSPI_CLK_ENABLE();
00495   /* Reset the QuadSPI memory interface */
00496   QSPI_FORCE_RESET();
00497   QSPI_RELEASE_RESET();
00498   /* Enable GPIO clocks */
00499   QSPI_CS_GPIO_CLK_ENABLE();
00500   QSPI_DX_CLK_GPIO_CLK_ENABLE();
00501
00502   /*##-2- Configure peripheral GPIO ##########################################*/
00503   /* QSPI CS GPIO pin configuration  */
00504   gpio_init_structure.Pin       = QSPI_CS_PIN;
00505   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00506   gpio_init_structure.Pull      = GPIO_PULLUP;
00507   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00508   gpio_init_structure.Alternate = GPIO_AF10_QSPI;
00509   HAL_GPIO_Init(QSPI_CS_GPIO_PORT, &gpio_init_structure);
00510
00511   /* QSPI CLK GPIO pin configuration  */
00512   gpio_init_structure.Pin       = QSPI_CLK_PIN;
00513   gpio_init_structure.Pull      = GPIO_NOPULL;
00514   gpio_init_structure.Alternate = GPIO_AF9_QSPI;
00515   HAL_GPIO_Init(QSPI_CLK_GPIO_PORT, &gpio_init_structure);
00516
00517   /* QSPI D0 and D1 GPIO pin configuration  */
00518   gpio_init_structure.Pin       = (QSPI_D0_PIN | QSPI_D1_PIN);
00519   gpio_init_structure.Alternate = GPIO_AF10_QSPI;
00520   HAL_GPIO_Init(QSPI_DX_GPIO_PORT, &gpio_init_structure);
00521
00522   /* QSPI D2 and D3 GPIO pin configuration  */
00523   gpio_init_structure.Pin       = (QSPI_D2_PIN | QSPI_D3_PIN) ;
00524   gpio_init_structure.Alternate = GPIO_AF9_QSPI;
00525   HAL_GPIO_Init(QSPI_DX_GPIO_PORT, &gpio_init_structure);
00526
00527   /*##-3- Configure the NVIC for QSPI #########################################*/
00528   /* NVIC configuration for QSPI interrupt */
00529   HAL_NVIC_SetPriority(QUADSPI_IRQn, 0x0F, 0);
00530   HAL_NVIC_EnableIRQ(QUADSPI_IRQn);
00531
00532 }
00533
00534 /**
00535   * @brief QSPI MSP De-Initialization
00536   *        This function frees the hardware resources used in this example:
00537   *          - Disable the Peripheral's clock
00538   *          - Revert GPIO and NVIC configuration to their default state
00539   */
00540 __weak void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params)
00541 {
00542   /*##-1- Disable the NVIC for QSPI ###########################################*/
00543   HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
00544
00545   /*##-2- Disable peripherals and GPIO Clocks ################################*/
00546   /* De-Configure QSPI pins */
00547   HAL_GPIO_DeInit(QSPI_CS_GPIO_PORT, QSPI_CS_PIN);
00548   HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
00549   HAL_GPIO_DeInit(QSPI_DX_GPIO_PORT, QSPI_D0_PIN);
00550   HAL_GPIO_DeInit(QSPI_DX_GPIO_PORT, QSPI_D1_PIN);
00551   HAL_GPIO_DeInit(QSPI_DX_GPIO_PORT, QSPI_D2_PIN);
00552   HAL_GPIO_DeInit(QSPI_DX_GPIO_PORT, QSPI_D3_PIN);
00553
00554   /*##-3- Reset peripherals ##################################################*/
00555   /* Reset the QuadSPI memory interface */
00556   QSPI_FORCE_RESET();
00557   QSPI_RELEASE_RESET();
00558
00559   /* Disable the QuadSPI memory interface clock */
00560   QSPI_CLK_DISABLE();
00561 }
00562
00563 /**
00564   * @brief  This function reset the QSPI memory.
00565   * @param  hqspi: QSPI handle
00566   */
00567 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
00568 {
00569   QSPI_CommandTypeDef s_command;
00570
00571   /* Initialize the reset enable command */
00572   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00573   s_command.Instruction       = RESET_ENABLE_CMD;
00574   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00575   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00576   s_command.DataMode          = QSPI_DATA_NONE;
00577   s_command.DummyCycles       = 0;
00578   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00579   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00580   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00581
00582   /* Send the command */
00583   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00584   {
00585     return QSPI_ERROR;
00586   }
00587
00588   /* Send the reset memory command */
00589   s_command.Instruction = RESET_MEMORY_CMD;
00590   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00591   {
00592     return QSPI_ERROR;
00593   }
00594
00595   /* Configure automatic polling mode to wait the memory is ready */
00596   if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00597   {
00598     return QSPI_ERROR;
00599   }
00600
00601   return QSPI_OK;
00602 }
00603
00604 /**
00605   * @brief  This function configure the dummy cycles on memory side.
00606   * @param  hqspi: QSPI handle
00607   */
00608 static uint8_t QSPI_DummyCyclesCfg(QSPI_HandleTypeDef *hqspi)
00609 {
00610   QSPI_CommandTypeDef s_command;
00611   uint8_t reg;
00612
00613   /* Initialize the read volatile configuration register command */
00614   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00615   s_command.Instruction       = READ_VOL_CFG_REG_CMD;
00616   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00617   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00618   s_command.DataMode          = QSPI_DATA_1_LINE;
00619   s_command.DummyCycles       = 0;
00620   s_command.NbData            = 1;
00621   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00622   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00623   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00624
00625   /* Configure the command */
00626   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00627   {
00628     return QSPI_ERROR;
00629   }
00630
00631   /* Reception of the data */
00632   if (HAL_QSPI_Receive(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00633   {
00634     return QSPI_ERROR;
00635   }
00636
00637   /* Enable write operations */
00638   if (QSPI_WriteEnable(hqspi) != QSPI_OK)
00639   {
00640     return QSPI_ERROR;
00641   }
00642
00643   /* Update volatile configuration register (with new dummy cycles) */
00644   s_command.Instruction = WRITE_VOL_CFG_REG_CMD;
00645   MODIFY_REG(reg, N25Q128A_VCR_NB_DUMMY, (N25Q128A_DUMMY_CYCLES_READ_QUAD << POSITION_VAL(N25Q128A_VCR_NB_DUMMY)));
00646
00647   /* Configure the write volatile configuration register command */
00648   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00649   {
00650     return QSPI_ERROR;
00651   }
00652
00653   /* Transmission of the data */
00654   if (HAL_QSPI_Transmit(hqspi, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00655   {
00656     return QSPI_ERROR;
00657   }
00658
00659   return QSPI_OK;
00660 }
00661
00662 /**
00663   * @brief  This function send a Write Enable and wait it is effective.
00664   * @param  hqspi: QSPI handle
00665   */
00666 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
00667 {
00668   QSPI_CommandTypeDef     s_command;
00669   QSPI_AutoPollingTypeDef s_config;
00670
00671   /* Enable write operations */
00672   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00673   s_command.Instruction       = WRITE_ENABLE_CMD;
00674   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00675   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00676   s_command.DataMode          = QSPI_DATA_NONE;
00677   s_command.DummyCycles       = 0;
00678   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00679   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00680   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00681
00682   if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00683   {
00684     return QSPI_ERROR;
00685   }
00686
00687   /* Configure automatic polling mode to wait for write enabling */
00688   s_config.Match           = N25Q128A_SR_WREN;
00689   s_config.Mask            = N25Q128A_SR_WREN;
00690   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00691   s_config.StatusBytesSize = 1;
00692   s_config.Interval        = 0x10;
00693   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00694
00695   s_command.Instruction    = READ_STATUS_REG_CMD;
00696   s_command.DataMode       = QSPI_DATA_1_LINE;
00697
00698   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00699   {
00700     return QSPI_ERROR;
00701   }
00702
00703   return QSPI_OK;
00704 }
00705
00706 /**
00707   * @brief  This function read the SR of the memory and wait the EOP.
00708   * @param  hqspi: QSPI handle
00709   * @param  Timeout: timeout value before returning an error
00710   */
00711 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
00712 {
00713   QSPI_CommandTypeDef     s_command;
00714   QSPI_AutoPollingTypeDef s_config;
00715
00716   /* Configure automatic polling mode to wait for memory ready */
00717   s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00718   s_command.Instruction       = READ_STATUS_REG_CMD;
00719   s_command.AddressMode       = QSPI_ADDRESS_NONE;
00720   s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00721   s_command.DataMode          = QSPI_DATA_1_LINE;
00722   s_command.DummyCycles       = 0;
00723   s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
00724   s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00725   s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00726
00727   s_config.Match           = 0;
00728   s_config.Mask            = N25Q128A_SR_WIP;
00729   s_config.MatchMode       = QSPI_MATCH_MODE_AND;
00730   s_config.StatusBytesSize = 1;
00731   s_config.Interval        = 0x10;
00732   s_config.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00733
00734   if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, Timeout) != HAL_OK)
00735   {
00736     return QSPI_ERROR;
00737   }
00738
00739   return QSPI_OK;
00740 }
00741 /**
00742   * @}
00743   */
00744
00745 /**
00746   * @}
00747   */
00748
00749 /**
00750   * @}
00751   */
00752
00753 /**
00754   * @}
00755   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_qspi.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_qspi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32469i_discovery_qspi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /** @addtogroup BSP
00021   * @{
00022   */
00023
00024 /** @addtogroup STM32469I_Discovery
00025   * @{
00026   */
00027
00028 /* Define to prevent recursive inclusion -------------------------------------*/
00029 #ifndef __STM32469I_DISCOVERY_QSPI_H
00030 #define __STM32469I_DISCOVERY_QSPI_H
00031
00032 #ifdef __cplusplus
00033  extern "C" {
00034 #endif
00035
00036 /* Includes ------------------------------------------------------------------*/
00037 #include "stm32f4xx_hal.h"
00038 #include "../Components/n25q128a/n25q128a.h"
00039
00040
00041 /** @addtogroup STM32469I_Discovery_QSPI
00042   * @{
00043   */
00044
00045
00046 /* Exported constants --------------------------------------------------------*/
00047 /** @defgroup STM32469I_Discovery_QSPI_Exported_Constants STM32469I Discovery QSPI Exported Constants
00048   * @{
00049   */
00050 /* QSPI Error codes */
00051 #define QSPI_OK            ((uint8_t)0x00)
00052 #define QSPI_ERROR         ((uint8_t)0x01)
00053 #define QSPI_BUSY          ((uint8_t)0x02)
00054 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00055 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00056
00057
00058 /* Definition for QSPI clock resources */
00059 #define QSPI_CLK_ENABLE()             __HAL_RCC_QSPI_CLK_ENABLE()
00060 #define QSPI_CLK_DISABLE()            __HAL_RCC_QSPI_CLK_DISABLE()
00061 #define QSPI_CS_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00062 #define QSPI_CS_GPIO_CLK_DISABLE()  __HAL_RCC_GPIOB_CLK_DISABLE()
00063 #define QSPI_DX_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
00064 #define QSPI_DX_CLK_GPIO_CLK_DISABLE()  __HAL_RCC_GPIOF_CLK_DISABLE()
00065
00066 #define QSPI_FORCE_RESET()            __HAL_RCC_QSPI_FORCE_RESET()
00067 #define QSPI_RELEASE_RESET()          __HAL_RCC_QSPI_RELEASE_RESET()
00068
00069 /* Definition for QSPI Pins */
00070 #define QSPI_CS_PIN                GPIO_PIN_6
00071 #define QSPI_CS_GPIO_PORT          GPIOB
00072 #define QSPI_CLK_PIN               GPIO_PIN_10
00073 #define QSPI_CLK_GPIO_PORT         GPIOF
00074 #define QSPI_D0_PIN                GPIO_PIN_8
00075 #define QSPI_D1_PIN                GPIO_PIN_9
00076 #define QSPI_D2_PIN                GPIO_PIN_7
00077 #define QSPI_D3_PIN                GPIO_PIN_6
00078 #define QSPI_DX_GPIO_PORT          GPIOF
00079
00080
00081 /**
00082   * @}
00083   */
00084
00085 /* Exported types ------------------------------------------------------------*/
00086 /** @defgroup STM32469I_Discovery_QSPI_Exported_Types STM32469I Discovery QSPI Exported Types
00087   * @{
00088   */
00089 /**
00090  * @brief QSPI Info
00091  * */
00092 typedef struct {
00093   uint32_t FlashSize;          /*!< Size of the flash                         */
00094   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation   */
00095   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00096   uint32_t ProgPageSize;       /*!< Size of pages for the program operation   */
00097   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00098 } QSPI_InfoTypeDef;
00099
00100 /**
00101   * @}
00102   */
00103
00104
00105 /* Exported functions --------------------------------------------------------*/
00106 /** @addtogroup STM32469I_Discovery_QSPI_Exported_Functions STM32469I Discovery QSPI Exported Functions
00107   * @{
00108   */
00109 uint8_t BSP_QSPI_Init       (void);
00110 uint8_t BSP_QSPI_DeInit     (void);
00111 uint8_t BSP_QSPI_Read       (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
00112 uint8_t BSP_QSPI_Write      (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
00113 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00114 uint8_t BSP_QSPI_Erase_Chip (void);
00115 uint8_t BSP_QSPI_GetStatus  (void);
00116 uint8_t BSP_QSPI_GetInfo    (QSPI_InfoTypeDef* pInfo);
00117 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00118 /* BSP Aliased function maintained for legacy purpose */
00119 #define BSP_QSPI_MemoryMappedMode      BSP_QSPI_EnableMemoryMappedMode
00120
00121 /* These function can be modified in case the current settings (e.g. DMA stream)
00122    need to be changed for specific application needs */
00123 void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params);
00124 void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params);
00125
00126 /**
00127   * @}
00128   */
00129
00130 /**
00131   * @}
00132   */
00133
00134 #ifdef __cplusplus
00135 }
00136 #endif
00137
00138 #endif /* __STM32469I_DISCOVERY_QSPI_H */
00139 /**
00140   * @}
00141   */
00142
00143 /**
00144   * @}
00145   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sd.c Source File

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


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32469i_discovery_sd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32469I_DISCOVERY_SD_H
00022 #define __STM32469I_DISCOVERY_SD_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32469i_discovery.h"
00030
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034
00035 /** @addtogroup STM32469I_Discovery
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32469I-Discovery_SD
00040   * @{
00041   */
00042
00043 /** @defgroup STM32469I-Discovery_SD_Exported_Types STM32469I Discovery SD Exported Types
00044   * @{
00045   */
00046
00047 /**
00048   * @brief SD Card information structure
00049   */
00050 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00051 /**
00052   * @}
00053   */
00054
00055 /**
00056   * @brief  SD status structure definition
00057   */
00058 #define   MSD_OK                        ((uint8_t)0x00)
00059 #define   MSD_ERROR                     ((uint8_t)0x01)
00060 #define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00061
00062 /**
00063   * @brief  SD transfer state definition
00064   */
00065 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00066 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00067
00068 /** @defgroup STM32469I-Discovery_SD_Exported_Constants STM32469I Discovery SD Exported Constants
00069   * @{
00070   */
00071 #define SD_PRESENT               ((uint8_t)0x01)
00072 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00073
00074 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00075
00076 /* DMA definitions for SD DMA transfer */
00077 #define __DMAx_TxRx_CLK_ENABLE            __HAL_RCC_DMA2_CLK_ENABLE
00078 #define SD_DMAx_Tx_CHANNEL                DMA_CHANNEL_4
00079 #define SD_DMAx_Rx_CHANNEL                DMA_CHANNEL_4
00080 #define SD_DMAx_Tx_STREAM                 DMA2_Stream6
00081 #define SD_DMAx_Rx_STREAM                 DMA2_Stream3
00082 #define SD_DMAx_Tx_IRQn                   DMA2_Stream6_IRQn
00083 #define SD_DMAx_Rx_IRQn                   DMA2_Stream3_IRQn
00084 #define BSP_SD_IRQHandler                 SDIO_IRQHandler
00085 #define BSP_SD_DMA_Tx_IRQHandler          DMA2_Stream6_IRQHandler
00086 #define BSP_SD_DMA_Rx_IRQHandler          DMA2_Stream3_IRQHandler
00087 #define SD_DetectIRQHandler()             HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8)
00088 /**
00089   * @}
00090   */
00091
00092 /** @defgroup STM32469I-Discovery_SD_Exported_Macro STM32469I Discovery SD Exported Macro
00093   * @{
00094   */
00095 /**
00096   * @}
00097   */
00098
00099 /** @defgroup STM32469I-Discovery_SD_Exported_Functions STM32469I Discovery SD Exported Functions
00100   * @{
00101   */
00102 uint8_t BSP_SD_Init(void);
00103 uint8_t BSP_SD_DeInit(void);
00104 uint8_t BSP_SD_ITConfig(void);
00105 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00106 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00107 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00108 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00109 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00110 uint8_t BSP_SD_GetCardState(void);
00111 void    BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
00112 uint8_t BSP_SD_IsDetected(void);
00113
00114 /* These functions can be modified in case the current settings (e.g. DMA stream)
00115    need to be changed for specific application needs */
00116 void    BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00117 void    BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
00118 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00119 void    BSP_SD_AbortCallback(void);
00120 void    BSP_SD_WriteCpltCallback(void);
00121 void    BSP_SD_ReadCpltCallback(void);
00122
00123 /**
00124   * @}
00125   */
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135 /**
00136   * @}
00137   */
00138
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142
00143 #endif /* __STM32469I_DISCOVERY_SD_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sdram.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_sdram.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_sdram.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory
00006   *          device mounted on STM32469I-Discovery board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* File Info : -----------------------------------------------------------------
00021                                    User NOTES
00022 1. How To use this driver:
00023 --------------------------
00024    - This driver is used to drive the MT48LC4M32B2B5-7 SDRAM external memory mounted
00025      on STM32469I-Discovery board.
00026    - This driver does not need a specific component driver for the SDRAM device
00027      to be included with.
00028
00029 2. Driver description:
00030 ---------------------
00031   + Initialization steps:
00032      o Initialize the SDRAM external memory using the BSP_SDRAM_Init() function. This
00033        function includes the MSP layer hardware resources initialization and the
00034        FMC controller configuration to interface with the external SDRAM memory.
00035      o It contains the SDRAM initialization sequence to program the SDRAM external
00036        device using the function BSP_SDRAM_Initialization_sequence(). Note that this
00037        sequence is standard for all SDRAM devices, but can include some differences
00038        from a device to another. If it is the case, the right sequence should be
00039        implemented separately.
00040
00041   + SDRAM read/write operations
00042      o SDRAM external memory can be accessed with read/write operations once it is
00043        initialized.
00044        Read/write operation can be performed with AHB access using the functions
00045        BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by DMA transfer using the functions
00046        BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
00047      o The AHB access is performed with 32-bit width transaction, the DMA transfer
00048        configuration is fixed at single (no burst) word transfer (see the
00049        BSP_SDRAM_MspInit() weak function).
00050      o User can implement his own functions for read/write access with his desired
00051        configurations.
00052      o If interrupt mode is used for DMA transfer, the function BSP_SDRAM_DMA_IRQHandler()
00053        is called in IRQ handler file, to serve the generated interrupt once the DMA
00054        transfer is complete.
00055      o You can send a command to the SDRAM device in runtime using the function
00056        BSP_SDRAM_Sendcmd(), and giving the desired command as parameter chosen between
00057        the predefined commands of the "FMC_SDRAM_CommandTypeDef" structure.
00058
00059 ------------------------------------------------------------------------------*/
00060
00061 /* Includes ------------------------------------------------------------------*/
00062 #include "stm32469i_discovery_sdram.h"
00063
00064 /** @addtogroup BSP
00065   * @{
00066   */
00067
00068 /** @addtogroup STM32469I_Discovery
00069   * @{
00070   */
00071
00072 /** @defgroup STM32469I-Discovery_SDRAM STM32469I Discovery SDRAM
00073   * @{
00074   */
00075
00076 /** @defgroup STM32469I-Discovery_SDRAM_Private_Types_Definitions STM32469I Discovery SDRAM Private TypesDef
00077   * @{
00078   */
00079 /**
00080   * @}
00081   */
00082
00083 /** @defgroup STM32469I-Discovery_SDRAM_Private_Defines STM32469I Discovery SDRAM Private Defines
00084   * @{
00085   */
00086 /**
00087   * @}
00088   */
00089
00090 /** @defgroup STM32469I-Discovery_SDRAM_Private_Macros STM32469I Discovery SDRAM Private Macros
00091   * @{
00092   */
00093 /**
00094   * @}
00095   */
00096
00097 /** @defgroup STM32469I-Discovery_SDRAM_Private_Variables STM32469I Discovery SDRAM Private Variables
00098   * @{
00099   */
00100 static SDRAM_HandleTypeDef sdramHandle;
00101 static FMC_SDRAM_TimingTypeDef Timing;
00102 static FMC_SDRAM_CommandTypeDef Command;
00103 /**
00104   * @}
00105   */
00106
00107 /** @defgroup STM32469I-Discovery_SDRAM_Private_Function_Prototypes STM32469I Discovery SDRAM Private Prototypes
00108   * @{
00109   */
00110
00111 /**
00112   * @}
00113   */
00114
00115 /** @defgroup STM32469I-Discovery_SDRAM_Private_Functions STM32469I Discovery SDRAM Private Functions
00116   * @{
00117   */
00118
00119 /**
00120   * @}
00121   */
00122
00123 /** @defgroup STM32469I_Discovery_SDRAM_Exported_Functions STM32469I Discovery SDRAM Exported Functions
00124   * @{
00125   */
00126
00127 /**
00128   * @brief  Initializes the SDRAM device.
00129   * @retval SDRAM status
00130   */
00131 uint8_t BSP_SDRAM_Init(void)
00132 {
00133   static uint8_t sdramstatus = SDRAM_ERROR;
00134
00135   /* SDRAM device configuration */
00136   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00137
00138   /* Timing configuration for 90 MHz as SD clock frequency (System clock is up to 180 MHz) */
00139   Timing.LoadToActiveDelay    = 2;
00140   Timing.ExitSelfRefreshDelay = 7;
00141   Timing.SelfRefreshTime      = 4;
00142   Timing.RowCycleDelay        = 7;
00143   Timing.WriteRecoveryTime    = 2;
00144   Timing.RPDelay              = 2;
00145   Timing.RCDDelay             = 2;
00146
00147   sdramHandle.Init.SDBank             = FMC_SDRAM_BANK1;
00148   sdramHandle.Init.ColumnBitsNumber   = FMC_SDRAM_COLUMN_BITS_NUM_8;
00149   sdramHandle.Init.RowBitsNumber      = FMC_SDRAM_ROW_BITS_NUM_12;
00150   sdramHandle.Init.MemoryDataWidth    = SDRAM_MEMORY_WIDTH;
00151   sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
00152   sdramHandle.Init.CASLatency         = FMC_SDRAM_CAS_LATENCY_3;
00153   sdramHandle.Init.WriteProtection    = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
00154   sdramHandle.Init.SDClockPeriod      = SDCLOCK_PERIOD;
00155   sdramHandle.Init.ReadBurst          = FMC_SDRAM_RBURST_ENABLE;
00156   sdramHandle.Init.ReadPipeDelay      = FMC_SDRAM_RPIPE_DELAY_0;
00157
00158   /* SDRAM controller initialization */
00159   /* __weak function can be surcharged by the application code */
00160   BSP_SDRAM_MspInit(&sdramHandle, (void *)NULL);
00161   if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)
00162   {
00163     sdramstatus = SDRAM_ERROR;
00164   }
00165   else
00166   {
00167     sdramstatus = SDRAM_OK;
00168   }
00169
00170   /* SDRAM initialization sequence */
00171   BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);
00172
00173   return sdramstatus;
00174 }
00175
00176 /**
00177   * @brief  DeInitializes the SDRAM device.
00178   * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR.
00179   */
00180 uint8_t BSP_SDRAM_DeInit(void)
00181 {
00182   static uint8_t sdramstatus = SDRAM_ERROR;
00183
00184   /* SDRAM device configuration */
00185   sdramHandle.Instance = FMC_SDRAM_DEVICE;
00186
00187   if(HAL_SDRAM_DeInit(&sdramHandle) == HAL_OK)
00188   {
00189     sdramstatus = SDRAM_OK;
00190
00191   /* SDRAM controller De-initialization */
00192    BSP_SDRAM_MspDeInit(&sdramHandle, (void *)NULL);
00193   }
00194
00195   return sdramstatus;
00196 }
00197
00198
00199 /**
00200   * @brief  Programs the SDRAM device.
00201   * @param  RefreshCount: SDRAM refresh counter value
00202   */
00203 void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
00204 {
00205   __IO uint32_t tmpmrd = 0;
00206
00207   /* Step 1: Configure a clock configuration enable command */
00208   Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
00209   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00210   Command.AutoRefreshNumber      = 1;
00211   Command.ModeRegisterDefinition = 0;
00212
00213   /* Send the command */
00214   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00215
00216   /* Step 2: Insert 100 us minimum delay */
00217   /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
00218   HAL_Delay(1);
00219
00220   /* Step 3: Configure a PALL (precharge all) command */
00221   Command.CommandMode            = FMC_SDRAM_CMD_PALL;
00222   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00223   Command.AutoRefreshNumber      = 1;
00224   Command.ModeRegisterDefinition = 0;
00225
00226   /* Send the command */
00227   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00228
00229   /* Step 4: Configure an Auto Refresh command */
00230   Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
00231   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00232   Command.AutoRefreshNumber      = 8;
00233   Command.ModeRegisterDefinition = 0;
00234
00235   /* Send the command */
00236   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00237
00238   /* Step 5: Program the external memory mode register */
00239   tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1          |\
00240                      SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |\
00241                      SDRAM_MODEREG_CAS_LATENCY_3           |\
00242                      SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
00243                      SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
00244
00245   Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
00246   Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
00247   Command.AutoRefreshNumber      = 1;
00248   Command.ModeRegisterDefinition = tmpmrd;
00249
00250   /* Send the command */
00251   HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
00252
00253   /* Step 6: Set the refresh rate counter */
00254   /* Set the device refresh rate */
00255   HAL_SDRAM_ProgramRefreshRate(&sdramHandle, RefreshCount);
00256 }
00257
00258 /**
00259   * @brief  Reads an mount of data from the SDRAM memory in polling mode.
00260   * @param  uwStartAddress: Read start address
00261   * @param  pData: Pointer to data to be read
00262   * @param  uwDataSize: Size of read data from the memory
00263   * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR.
00264   */
00265 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00266 {
00267   if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00268   {
00269     return SDRAM_ERROR;
00270   }
00271   else
00272   {
00273     return SDRAM_OK;
00274   }
00275 }
00276
00277 /**
00278   * @brief  Reads an mount of data from the SDRAM memory in DMA mode.
00279   * @param  uwStartAddress: Read start address
00280   * @param  pData: Pointer to data to be read
00281   * @param  uwDataSize: Size of read data from the memory
00282   * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR.
00283   */
00284 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00285 {
00286   if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00287   {
00288     return SDRAM_ERROR;
00289   }
00290   else
00291   {
00292     return SDRAM_OK;
00293   }
00294 }
00295
00296 /**
00297   * @brief  Writes an mount of data to the SDRAM memory in polling mode.
00298   * @param  uwStartAddress: Write start address
00299   * @param  pData: Pointer to data to be written
00300   * @param  uwDataSize: Size of written data from the memory
00301   * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR.
00302   */
00303 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00304 {
00305   if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00306   {
00307     return SDRAM_ERROR;
00308   }
00309   else
00310   {
00311     return SDRAM_OK;
00312   }
00313 }
00314
00315 /**
00316   * @brief  Writes an mount of data to the SDRAM memory in DMA mode.
00317   * @param  uwStartAddress: Write start address
00318   * @param  pData: Pointer to data to be written
00319   * @param  uwDataSize: Size of written data from the memory
00320   * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR.
00321   */
00322 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
00323 {
00324   if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00325   {
00326     return SDRAM_ERROR;
00327   }
00328   else
00329   {
00330     return SDRAM_OK;
00331   }
00332 }
00333
00334 /**
00335   * @brief  Sends command to the SDRAM bank.
00336   * @param  SdramCmd: Pointer to SDRAM command structure
00337   * @retval HAL status : SDRAM_OK or SDRAM_ERROR.
00338   */
00339 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
00340 {
00341   if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK)
00342   {
00343     return SDRAM_ERROR;
00344   }
00345   else
00346   {
00347     return SDRAM_OK;
00348   }
00349 }
00350
00351 /**
00352   * @brief  Handles SDRAM DMA transfer interrupt request.
00353   */
00354 void BSP_SDRAM_DMA_IRQHandler(void)
00355 {
00356   HAL_DMA_IRQHandler(sdramHandle.hdma);
00357 }
00358
00359 /**
00360   * @brief  Initializes SDRAM MSP.
00361   * @note   This function can be surcharged by application code.
00362   * @param  hsdram: pointer on SDRAM handle
00363   * @param  Params: pointer on additional configuration parameters, can be NULL.
00364   */
00365 __weak void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00366 {
00367   static DMA_HandleTypeDef dma_handle;
00368   GPIO_InitTypeDef gpio_init_structure;
00369
00370   if(hsdram != (SDRAM_HandleTypeDef  *)NULL)
00371   {
00372     /* Enable FMC clock */
00373     __HAL_RCC_FMC_CLK_ENABLE();
00374
00375     /* Enable chosen DMAx clock */
00376     __DMAx_CLK_ENABLE();
00377
00378     /* Enable GPIOs clock */
00379     __HAL_RCC_GPIOC_CLK_ENABLE();
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     /* GPIOC configuration : PC0 is SDNWE */
00394     gpio_init_structure.Pin   = GPIO_PIN_0;
00395     HAL_GPIO_Init(GPIOC, &gpio_init_structure);
00396
00397     /* GPIOD configuration */
00398     gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8| GPIO_PIN_9 | GPIO_PIN_10 |\
00399                                 GPIO_PIN_14 | GPIO_PIN_15;
00400
00401
00402     HAL_GPIO_Init(GPIOD, &gpio_init_structure);
00403
00404     /* GPIOE configuration */
00405     gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7| GPIO_PIN_8 | GPIO_PIN_9 |\
00406                                 GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00407                                 GPIO_PIN_15;
00408
00409     HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00410
00411     /* GPIOF configuration */
00412     gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4 |\
00413                                 GPIO_PIN_5 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00414                                 GPIO_PIN_15;
00415
00416     HAL_GPIO_Init(GPIOF, &gpio_init_structure);
00417
00418     /* GPIOG configuration */
00419     gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4| GPIO_PIN_5 | GPIO_PIN_8 |\
00420                                 GPIO_PIN_15;
00421     HAL_GPIO_Init(GPIOG, &gpio_init_structure);
00422
00423     /* GPIOH configuration */
00424     gpio_init_structure.Pin   = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_8 | GPIO_PIN_9 |\
00425                                 GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
00426                                 GPIO_PIN_15;
00427     HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00428
00429     /* GPIOI configuration */
00430     gpio_init_structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 |\
00431                                 GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_9 | GPIO_PIN_10;
00432     HAL_GPIO_Init(GPIOI, &gpio_init_structure);
00433
00434     /* Configure common DMA parameters */
00435     dma_handle.Init.Channel             = SDRAM_DMAx_CHANNEL;
00436     dma_handle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00437     dma_handle.Init.PeriphInc           = DMA_PINC_ENABLE;
00438     dma_handle.Init.MemInc              = DMA_MINC_ENABLE;
00439     dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00440     dma_handle.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00441     dma_handle.Init.Mode                = DMA_NORMAL;
00442     dma_handle.Init.Priority            = DMA_PRIORITY_HIGH;
00443     dma_handle.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;
00444     dma_handle.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
00445     dma_handle.Init.MemBurst            = DMA_MBURST_SINGLE;
00446     dma_handle.Init.PeriphBurst         = DMA_PBURST_SINGLE;
00447
00448     dma_handle.Instance = SDRAM_DMAx_STREAM;
00449
00450     /* Associate the DMA handle */
00451     __HAL_LINKDMA(hsdram, hdma, dma_handle);
00452
00453     /* Deinitialize the stream for new transfer */
00454     HAL_DMA_DeInit(&dma_handle);
00455
00456     /* Configure the DMA stream */
00457     HAL_DMA_Init(&dma_handle);
00458
00459     /* NVIC configuration for DMA transfer complete interrupt */
00460     HAL_NVIC_SetPriority(SDRAM_DMAx_IRQn, 5, 0);
00461     HAL_NVIC_EnableIRQ(SDRAM_DMAx_IRQn);
00462
00463   } /* of if(hsdram != (SDRAM_HandleTypeDef  *)NULL) */
00464 }
00465
00466 /**
00467   * @brief  DeInitializes SDRAM MSP.
00468   * @note   This function can be surcharged by application code.
00469   * @param  hsdram: pointer on SDRAM handle
00470   * @param  Params: pointer on additional configuration parameters, can be NULL.
00471   */
00472 __weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params)
00473 {
00474     static DMA_HandleTypeDef dma_handle;
00475
00476     if(hsdram != (SDRAM_HandleTypeDef  *)NULL)
00477     {
00478       /* Disable NVIC configuration for DMA interrupt */
00479       HAL_NVIC_DisableIRQ(SDRAM_DMAx_IRQn);
00480
00481       /* Deinitialize the stream for new transfer */
00482       dma_handle.Instance = SDRAM_DMAx_STREAM;
00483       HAL_DMA_DeInit(&dma_handle);
00484
00485       /* DeInit GPIO pins can be done in the application
00486        (by surcharging this __weak function) */
00487
00488       /* GPIO pins clock, FMC clock and DMA clock can be shut down in the application
00489        by surcharging this __weak function */
00490
00491     } /* of if(hsdram != (SDRAM_HandleTypeDef  *)NULL) */
00492 }
00493
00494 /**
00495   * @}
00496   */
00497
00498 /**
00499   * @}
00500   */
00501
00502 /**
00503   * @}
00504   */
00505
00506 /**
00507   * @}
00508   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_sdram.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_sdram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_sdram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32469i_discovery_sdram.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32469I_DISCOVERY_SDRAM_H
00022 #define __STM32469I_DISCOVERY_SDRAM_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32f4xx_hal.h"
00030
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034
00035 /** @addtogroup STM32469I_Discovery
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32469I-Discovery_SDRAM
00040   * @{
00041   */
00042
00043 /** @defgroup STM32469I-Discovery_SDRAM_Exported_Types STM32469I Discovery SDRAM Exported Types
00044   * @{
00045   */
00046
00047 /**
00048   * @brief  SDRAM status structure definition
00049   */
00050 #define   SDRAM_OK         ((uint8_t)0x00)
00051 #define   SDRAM_ERROR      ((uint8_t)0x01)
00052
00053 /**
00054   * @}
00055   */
00056
00057 /** @defgroup STM32469I-Discovery_SDRAM_Exported_Constants STM32469I Discovery SDRAM Exported Constants
00058   * @{
00059   */
00060 #define SDRAM_DEVICE_ADDR  ((uint32_t)0xC0000000)
00061
00062  /* SDRAM device size in Bytes */
00063  #define SDRAM_DEVICE_SIZE  ((uint32_t)0x1000000)
00064
00065 #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32
00066 #define SDCLOCK_PERIOD     FMC_SDRAM_CLOCK_PERIOD_2
00067
00068 /* SDRAM refresh counter (90 MHz SD clock) */
00069 #define REFRESH_COUNT       ((uint32_t)0x0569)
00070 #define  SDRAM_TIMEOUT      ((uint32_t)0xFFFF)
00071
00072 /* DMA definitions for SDRAM DMA transfer */
00073 #define __DMAx_CLK_ENABLE     __HAL_RCC_DMA2_CLK_ENABLE
00074 #define __DMAx_CLK_DISABLE    __HAL_RCC_DMA2_CLK_DISABLE
00075 #define SDRAM_DMAx_CHANNEL    DMA_CHANNEL_0
00076 #define SDRAM_DMAx_STREAM     DMA2_Stream0
00077 #define SDRAM_DMAx_IRQn       DMA2_Stream0_IRQn
00078 #define SDRAM_DMAx_IRQHandler DMA2_Stream0_IRQHandler
00079
00080
00081 /**
00082   * @brief  FMC SDRAM Mode definition register defines
00083   */
00084 #define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
00085 #define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
00086 #define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
00087 #define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
00088 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
00089 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
00090 #define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
00091 #define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
00092 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
00093 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
00094 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)
00095 /**
00096   * @}
00097   */
00098
00099 /** @defgroup STM32469I-Discovery_SDRAM_Exported_Macro STM32469I Discovery SDRAM Exported Macro
00100   * @{
00101   */
00102 /**
00103   * @}
00104   */
00105
00106 /** @addtogroup STM32469I_Discovery_SDRAM_Exported_Functions
00107   * @{
00108   */
00109 uint8_t BSP_SDRAM_Init(void);
00110 uint8_t BSP_SDRAM_DeInit(void);
00111 void    BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
00112 uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00113 uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00114 uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00115 uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
00116 uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
00117 void    BSP_SDRAM_DMA_IRQHandler(void);
00118
00119 /* These function can be modified in case the current settings (e.g. DMA stream)
00120    need to be changed for specific application needs */
00121 void    BSP_SDRAM_MspInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00122 void    BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef  *hsdram, void *Params);
00123
00124 /**
00125   * @}
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 /* __STM32469I_DISCOVERY_SDRAM_H */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_ts.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_ts.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the Touch
00006   *          Screen on STM32469I-Discovery board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* File Info : -----------------------------------------------------------------
00021                                    User NOTES
00022 1. How To use this driver:
00023 --------------------------
00024    - This driver is used to drive the touch screen module of the STM32469I-Discovery
00025      board on the K.O.D Optica Technology 480x800 TFT-LCD mounted on
00026      MB1189 board. The touch screen driver IC inside the K.O.D module KM-040TMP-02
00027    is a FT6206 by Focal Tech.
00028
00029 2. Driver description:
00030 ---------------------
00031   + Initialization steps:
00032      o Initialize the TS module using the BSP_TS_Init() function. This
00033        function includes the MSP layer hardware resources initialization and the
00034        communication layer configuration to start the TS use. The LCD size properties
00035        (x and y) are passed as parameters.
00036      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00037        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00038        as an external interrupt whenever a touch is detected.
00039        The interrupt mode internally uses the IO functionalities driver driven by
00040        the IO expander, to configure the IT line.
00041
00042   + Touch screen use
00043      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00044        used. This function returns information about the last LCD touch occurred
00045        in the TS_StateTypeDef structure.
00046      o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
00047        the interrupt status. To clear the IT pending bits, you should call the
00048        function BSP_TS_ITClear().
00049      o The IT is handled using the corresponding external interrupt IRQ handler,
00050        the user IT callback treatment is implemented on the same external interrupt
00051        callback.
00052
00053 ------------------------------------------------------------------------------*/
00054
00055 /* Includes ------------------------------------------------------------------*/
00056 #include "stm32469i_discovery_ts.h"
00057
00058 /** @addtogroup BSP
00059   * @{
00060   */
00061
00062 /** @addtogroup STM32469I_Discovery
00063   * @{
00064   */
00065
00066 /** @defgroup STM32469I-Discovery_TS STM32469I Discovery TS
00067   * @{
00068   */
00069
00070 /** @defgroup STM32469I-Discovery_TS_Private_Types_Definitions STM32469I Discovery TS Private Types Definitions
00071   * @{
00072   */
00073 /**
00074   * @}
00075   */
00076
00077 /** @defgroup STM32469I-Discovery_TS_Private_Defines STM32469I Discovery TS Private Types Defines
00078   * @{
00079   */
00080 /**
00081   * @}
00082   */
00083
00084 /** @defgroup STM32469I-Discovery_TS_Private_Macros STM32469I Discovery TS Private Macros
00085   * @{
00086   */
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32469I-Discovery_TS_Imported_Variables STM32469I Discovery TS Imported Variables
00092   * @{
00093   */
00094   /**
00095     * @}
00096     */
00097
00098 /** @defgroup STM32469I-Discovery_TS_Private_Variables STM32469I Discovery TS Private Variables
00099   * @{
00100   */
00101 static TS_DrvTypeDef *ts_driver;
00102 static uint8_t  ts_orientation;
00103 uint8_t  I2C_Address = 0;
00104
00105 /* Table for touchscreen event information display on LCD : table indexed on enum @ref TS_TouchEventTypeDef information */
00106 char * ts_event_string_tab[TOUCH_EVENT_NB_MAX] = { "None",
00107                                                    "Press down",
00108                                                    "Lift up",
00109                                                    "Contact"
00110                                                   };
00111
00112 /* Table for touchscreen gesture Id information display on LCD : table indexed on enum @ref TS_GestureIdTypeDef information */
00113 char * ts_gesture_id_string_tab[GEST_ID_NB_MAX] = { "None",
00114                                                     "Move Up",
00115                                                     "Move Right",
00116                                                     "Move Down",
00117                                                     "Move Left",
00118                                                     "Zoom In",
00119                                                     "Zoom Out"
00120                                                   };
00121
00122 /**
00123   * @}
00124   */
00125
00126 /** @defgroup STM32469I-Discovery_TS_Private_Function_Prototypes STM32469I Discovery TS Private Function Prototypes
00127   * @{
00128   */
00129
00130 /**
00131   * @}
00132   */
00133
00134 /** @defgroup STM32469I-Discovery_TS_Public_Functions STM32469I Discovery TS Public Functions
00135   * @{
00136   */
00137
00138 /**
00139   * @brief  Initializes and configures the touch screen functionalities and
00140   *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00141   * @param  ts_SizeX : Maximum X size of the TS area on LCD
00142   * @param  ts_SizeY : Maximum Y size of the TS area on LCD
00143   * @retval TS_OK if all initializations are OK. Other value if error.
00144   */
00145 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
00146 {
00147   uint8_t ts_status = TS_OK;
00148   uint8_t ts_id1, ts_id2 = 0;
00149   /* Note : I2C_Address is un-initialized here, but is not used at all in init function */
00150   /* but the prototype of Init() is like that in template and should be respected       */
00151
00152   /* Initialize the communication channel to sensor (I2C) if necessary */
00153   /* that is initialization is done only once after a power up         */
00154   ft6x06_ts_drv.Init(I2C_Address);
00155
00156   ts_id1 = ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS);
00157   if(ts_id1 != FT6206_ID_VALUE)
00158   {
00159     ts_id2 = ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS_A02);
00160     I2C_Address    = TS_I2C_ADDRESS_A02;
00161   }
00162   else
00163   {
00164     I2C_Address    = TS_I2C_ADDRESS;
00165   }
00166
00167   /* Scan FT6xx6 TouchScreen IC controller ID register by I2C Read       */
00168   /* Verify this is a FT6206 or FT6336G, otherwise this is an error case */
00169   if((ts_id1 == FT6206_ID_VALUE) || (ts_id2 == FT6206_ID_VALUE) || (ts_id2 == FT6X36_ID2_VALUE))
00170   {
00171     /* Found FT6206 : Initialize the TS driver structure */
00172     ts_driver = &ft6x06_ts_drv;
00173
00174     /* Get LCD chosen orientation */
00175     if(ts_SizeX < ts_SizeY)
00176     {
00177       ts_orientation = TS_SWAP_NONE;
00178     }
00179     else
00180     {
00181       ts_orientation = TS_SWAP_XY | TS_SWAP_Y;
00182     }
00183
00184     if(ts_status == TS_OK)
00185     {
00186       /* Software reset the TouchScreen */
00187       ts_driver->Reset(I2C_Address);
00188
00189       /* Calibrate, Configure and Start the TouchScreen driver */
00190       ts_driver->Start(I2C_Address);
00191
00192     } /* of if(ts_status == TS_OK) */
00193   }
00194   else
00195   {
00196     ts_status = TS_DEVICE_NOT_FOUND;
00197   }
00198
00199   return (ts_status);
00200 }
00201
00202 /**
00203   * @brief  Configures and enables the touch screen interrupts both at GPIO level and
00204   * in TouchScreen IC driver configuration.
00205   * @retval TS_OK if all initializations are OK.
00206   */
00207 uint8_t BSP_TS_ITConfig(void)
00208 {
00209   uint8_t ts_status = TS_OK;
00210   GPIO_InitTypeDef gpio_init_structure;
00211
00212   /* Msp Init of GPIO used for TS_INT pin coming from TouchScreen driver IC FT6x06 */
00213   /* When touchscreen is operated in interrupt mode */
00214   BSP_TS_INT_MspInit();
00215
00216   /* Configure Interrupt mode for TS_INT pin falling edge : when a new touch is available */
00217   /* TS_INT pin is active on low level on new touch available */
00218   gpio_init_structure.Pin = TS_INT_PIN;
00219   gpio_init_structure.Pull = GPIO_PULLUP;
00220   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00221   gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00222   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00223
00224   /* Enable and set the TS_INT EXTI Interrupt to an intermediate priority */
00225   HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x05, 0x00);
00226   HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00227
00228   /* Enable the TS in interrupt mode */
00229   /* In that case the INT output of FT6206 when new touch is available */
00230   /* is active on low level and directed on EXTI */
00231   ts_driver->EnableIT(I2C_Address);
00232
00233   return (ts_status);
00234 }
00235
00236 /**
00237   * @brief  Returns status and positions of the touch screen.
00238   * @param  TS_State: Pointer to touch screen current state structure
00239   * @retval TS_OK if all initializations are OK. Other value if error.
00240   */
00241 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00242 {
00243   static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0};
00244   static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0};
00245   uint8_t ts_status = TS_OK;
00246   uint16_t tmp;
00247   uint16_t Raw_x[TS_MAX_NB_TOUCH];
00248   uint16_t Raw_y[TS_MAX_NB_TOUCH];
00249   uint16_t xDiff;
00250   uint16_t yDiff;
00251   uint32_t index;
00252 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00253   uint32_t weight = 0;
00254   uint32_t area = 0;
00255   uint32_t event = 0;
00256 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00257
00258   /* Check and update the number of touches active detected */
00259   TS_State->touchDetected = ts_driver->DetectTouch(I2C_Address);
00260   if(TS_State->touchDetected)
00261   {
00262     for(index=0; index < TS_State->touchDetected; index++)
00263     {
00264       /* Get each touch coordinates */
00265       ts_driver->GetXY(I2C_Address, &(Raw_x[index]), &(Raw_y[index]));
00266
00267       if(ts_orientation & TS_SWAP_XY)
00268       {
00269         tmp = Raw_x[index];
00270         Raw_x[index] = Raw_y[index];
00271         Raw_y[index] = tmp;
00272       }
00273
00274       if(ts_orientation & TS_SWAP_X)
00275       {
00276         Raw_x[index] = FT_6206_MAX_WIDTH - 1 - Raw_x[index];
00277       }
00278
00279       if(ts_orientation & TS_SWAP_Y)
00280       {
00281         Raw_y[index] = FT_6206_MAX_HEIGHT - 1 - Raw_y[index];
00282       }
00283
00284       xDiff = Raw_x[index] > _x[index]? (Raw_x[index] - _x[index]): (_x[index] - Raw_x[index]);
00285       yDiff = Raw_y[index] > _y[index]? (Raw_y[index] - _y[index]): (_y[index] - Raw_y[index]);
00286
00287       if ((xDiff + yDiff) > 5)
00288       {
00289         _x[index] = Raw_x[index];
00290         _y[index] = Raw_y[index];
00291       }
00292
00293
00294       TS_State->touchX[index] = _x[index];
00295       TS_State->touchY[index] = _y[index];
00296
00297 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00298
00299       /* Get touch info related to the current touch */
00300       ft6x06_TS_GetTouchInfo(I2C_Address, index, &weight, &area, &event);
00301
00302       /* Update TS_State structure */
00303       TS_State->touchWeight[index] = weight;
00304       TS_State->touchArea[index]   = area;
00305
00306       /* Remap touch event */
00307       switch(event)
00308       {
00309         case FT6206_TOUCH_EVT_FLAG_PRESS_DOWN  :
00310           TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN;
00311           break;
00312         case FT6206_TOUCH_EVT_FLAG_LIFT_UP :
00313           TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP;
00314           break;
00315         case FT6206_TOUCH_EVT_FLAG_CONTACT :
00316           TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT;
00317           break;
00318         case FT6206_TOUCH_EVT_FLAG_NO_EVENT :
00319           TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00320           break;
00321         default :
00322           ts_status = TS_ERROR;
00323           break;
00324       } /* of switch(event) */
00325
00326 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00327
00328     } /* of for(index=0; index < TS_State->touchDetected; index++) */
00329
00330 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00331     /* Get gesture Id */
00332     ts_status = BSP_TS_Get_GestureId(TS_State);
00333 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00334
00335   } /* end of if(TS_State->touchDetected != 0) */
00336
00337   return (ts_status);
00338 }
00339
00340 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00341 /**
00342   * @brief  Update gesture Id following a touch detected.
00343   * @param  TS_State: Pointer to touch screen current state structure
00344   * @retval TS_OK if all initializations are OK. Other value if error.
00345   */
00346 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State)
00347 {
00348   uint32_t gestureId = 0;
00349   uint8_t  ts_status = TS_OK;
00350
00351   /* Get gesture Id */
00352   ft6x06_TS_GetGestureID(I2C_Address, &gestureId);
00353
00354   /* Remap gesture Id to a TS_GestureIdTypeDef value */
00355   switch(gestureId)
00356   {
00357     case FT6206_GEST_ID_NO_GESTURE :
00358       TS_State->gestureId = GEST_ID_NO_GESTURE;
00359       break;
00360     case FT6206_GEST_ID_MOVE_UP :
00361       TS_State->gestureId = GEST_ID_MOVE_UP;
00362       break;
00363     case FT6206_GEST_ID_MOVE_RIGHT :
00364       TS_State->gestureId = GEST_ID_MOVE_RIGHT;
00365       break;
00366     case FT6206_GEST_ID_MOVE_DOWN :
00367       TS_State->gestureId = GEST_ID_MOVE_DOWN;
00368       break;
00369     case FT6206_GEST_ID_MOVE_LEFT :
00370       TS_State->gestureId = GEST_ID_MOVE_LEFT;
00371       break;
00372     case FT6206_GEST_ID_ZOOM_IN :
00373       TS_State->gestureId = GEST_ID_ZOOM_IN;
00374       break;
00375     case FT6206_GEST_ID_ZOOM_OUT :
00376       TS_State->gestureId = GEST_ID_ZOOM_OUT;
00377       break;
00378     default :
00379       ts_status = TS_ERROR;
00380       break;
00381   } /* of switch(gestureId) */
00382
00383   return(ts_status);
00384 }
00385
00386
00387 /** @defgroup STM32469I-Discovery_TS_Private_Functions STM32469I Discovery TS Private Functions
00388   * @{
00389   */
00390
00391
00392 /**
00393   * @brief  Function used to reset all touch data before a new acquisition
00394   *         of touch information.
00395   * @param  TS_State: Pointer to touch screen current state structure
00396   * @retval TS_OK if OK, TE_ERROR if problem found.
00397   */
00398 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State)
00399 {
00400   uint8_t ts_status = TS_ERROR;
00401   uint32_t index;
00402
00403   if (TS_State != (TS_StateTypeDef *)NULL)
00404   {
00405     TS_State->gestureId = GEST_ID_NO_GESTURE;
00406     TS_State->touchDetected = 0;
00407
00408     for(index = 0; index < TS_MAX_NB_TOUCH; index++)
00409     {
00410       TS_State->touchX[index]       = 0;
00411       TS_State->touchY[index]       = 0;
00412       TS_State->touchArea[index]    = 0;
00413       TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00414       TS_State->touchWeight[index]  = 0;
00415     }
00416
00417     ts_status = TS_OK;
00418
00419   } /* of if (TS_State != (TS_StateTypeDef *)NULL) */
00420
00421   return (ts_status);
00422 }
00423 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00424 /**
00425   * @brief  Initializes the TS_INT pin MSP.
00426   */
00427 __weak void BSP_TS_INT_MspInit(void)
00428 {
00429   GPIO_InitTypeDef  gpio_init_structure;
00430
00431   TS_INT_GPIO_CLK_ENABLE();
00432
00433   /* GPIO configuration in input for TouchScreen interrupt signal on TS_INT pin */
00434   gpio_init_structure.Pin       = TS_INT_PIN;
00435
00436   gpio_init_structure.Mode      = GPIO_MODE_INPUT;
00437   gpio_init_structure.Pull      = GPIO_PULLUP;
00438   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00439   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00440 }
00441
00442
00443 /**
00444   * @}
00445   */
00446
00447 /**
00448   * @}
00449   */
00450
00451 /**
00452   * @}
00453   */
00454
00455 /**
00456   * @}
00457   */
00458
00459 /**
00460   * @}
00461   */


./STM32469I-Discovery BSP User Manual: stm32469i_discovery_ts.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32469I-Discovery
stm32469i_discovery_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32469i_discovery_ts.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.
00012   *
00013   * This software is licensed under terms that can be found in the LICENSE file
00014   * in the root directory of this software component.
00015   * If no LICENSE file comes with this software, it is provided AS-IS.
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32469I_DISCOVERY_TS_H
00022 #define __STM32469I_DISCOVERY_TS_H
00023
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32469i_discovery.h"
00030 #include "stm32469i_discovery_lcd.h"
00031
00032 /* Include TouchScreen component driver */
00033 #include "../Components/ft6x06/ft6x06.h"
00034
00035 /** @addtogroup BSP
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32469I_Discovery
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32469I-Discovery_TS
00044   * @{
00045   */
00046
00047  /** @defgroup STM32469I-Discovery_TS_Exported_Constants STM32469I Discovery TS Exported Constants
00048    * @{
00049    */
00050 /** @brief With FT6206 : maximum 2 touches detected simultaneously
00051   */
00052 #define TS_MAX_NB_TOUCH                 ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
00053 #define TS_NO_IRQ_PENDING               ((uint8_t) 0)
00054 #define TS_IRQ_PENDING                  ((uint8_t) 1)
00055
00056 #define TS_SWAP_NONE                    ((uint8_t) 0x01)
00057 #define TS_SWAP_X                       ((uint8_t) 0x02)
00058 #define TS_SWAP_Y                       ((uint8_t) 0x04)
00059 #define TS_SWAP_XY                      ((uint8_t) 0x08)
00060
00061  /**
00062    * @}
00063    */
00064
00065 /** @defgroup STM32469I-Discovery_TS_Exported_Types  STM32469I Discovery TS Exported Types
00066   * @{
00067   */
00068 /**
00069 *  @brief TS_StateTypeDef
00070 *  Define TS State structure
00071 */
00072 typedef struct
00073 {
00074   uint8_t  touchDetected;                /*!< Total number of active touches detected at last scan */
00075   uint16_t touchX[TS_MAX_NB_TOUCH];      /*!< Touch X[0], X[1] coordinates on 12 bits */
00076   uint16_t touchY[TS_MAX_NB_TOUCH];      /*!< Touch Y[0], Y[1] coordinates on 12 bits */
00077
00078 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00079   uint8_t  touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */
00080   uint8_t  touchEventId[TS_MAX_NB_TOUCH];     /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
00081   uint8_t  touchArea[TS_MAX_NB_TOUCH];   /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */
00082   uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
00083 #endif  /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00084
00085 } TS_StateTypeDef;
00086
00087 /**
00088  *  @brief TS_StatusTypeDef
00089  *  Define BSP_TS_xxx() functions possible return value,
00090  *  when status is returned by those functions.
00091  */
00092 typedef enum
00093 {
00094   TS_OK                = 0x00, /*!< Touch Ok */
00095   TS_ERROR             = 0x01, /*!< Touch Error */
00096   TS_TIMEOUT           = 0x02, /*!< Touch Timeout */
00097   TS_DEVICE_NOT_FOUND  = 0x03  /*!< Touchscreen device not found */
00098 } TS_StatusTypeDef;
00099
00100 /**
00101  *  @brief TS_GestureIdTypeDef
00102  *  Define Possible managed gesture identification values returned by touch screen
00103  *  driver.
00104  */
00105 typedef enum
00106 {
00107   GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
00108   GEST_ID_MOVE_UP    = 0x01, /*!< Gesture Move Up */
00109   GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
00110   GEST_ID_MOVE_DOWN  = 0x03, /*!< Gesture Move Down */
00111   GEST_ID_MOVE_LEFT  = 0x04, /*!< Gesture Move Left */
00112   GEST_ID_ZOOM_IN    = 0x05, /*!< Gesture Zoom In */
00113   GEST_ID_ZOOM_OUT   = 0x06, /*!< Gesture Zoom Out */
00114   GEST_ID_NB_MAX     = 0x07 /*!< max number of gesture id */
00115 } TS_GestureIdTypeDef;
00116
00117 /**
00118  *  @brief TS_TouchEventTypeDef
00119  *  Define Possible touch events kind as returned values
00120  *  by touch screen IC Driver.
00121  */
00122 typedef enum
00123 {
00124   TOUCH_EVENT_NO_EVT        = 0x00, /*!< Touch Event : undetermined */
00125   TOUCH_EVENT_PRESS_DOWN    = 0x01, /*!< Touch Event Press Down */
00126   TOUCH_EVENT_LIFT_UP       = 0x02, /*!< Touch Event Lift Up */
00127   TOUCH_EVENT_CONTACT       = 0x03, /*!< Touch Event Contact */
00128   TOUCH_EVENT_NB_MAX        = 0x04  /*!< max number of touch events kind */
00129 } TS_TouchEventTypeDef;
00130
00131 /**
00132   * @}
00133   */
00134
00135 /** @defgroup STM32469I-Discovery_TS_Imported_Variables STM32469I Discovery TS Imported Variables
00136   * @{
00137   */
00138 /**
00139  *  @brief Table for touchscreen event information display on LCD :
00140  *  table indexed on enum @ref TS_TouchEventTypeDef information
00141  */
00142 extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
00143
00144 /**
00145  *  @brief Table for touchscreen gesture Id information display on LCD : table indexed
00146  *  on enum @ref TS_GestureIdTypeDef information
00147  */
00148 extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
00149 /**
00150   * @}
00151   */
00152
00153 /** @defgroup STM32469I-Discovery_TS_Exported_Functions STM32469I Discovery TS Exported Functions
00154   * @{
00155   */
00156 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
00157 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00158
00159 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00160 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
00161 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);
00162 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00163
00164 uint8_t BSP_TS_ITConfig(void);
00165
00166
00167 /* These __weak function can be surcharged by application code in case the current settings
00168    need to be changed for specific (example GPIO allocation) */
00169 void BSP_TS_INT_MspInit(void);
00170
00171 /**
00172   * @}
00173   */
00174
00175 /**
00176   * @}
00177   */
00178
00179 /**
00180   * @}
00181   */
00182
00183 /**
00184   * @}
00185   */
00186
00187
00188 #ifdef __cplusplus
00189 }
00190 #endif
00191
00192 #endif /* __STM32469I_DISCOVERY_TS_H */


./STM32469I-Discovery BSP User Manual: userManualMainpage.txt File Reference

  • File List
  • Globals
userManualMainpage.txt File Reference