STM32L496G-Discovery BSP User Manual: STM32L496G-Discovery BSP Drivers

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

BSP Drivers User Manual

This document contains the User Manual (UM) of the STM32L496G-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
02/10/2021 | V1.0 |  | STM32L496G-Discovery Board
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Types Definitions

  • Data Structures
  • Files
  • Directories
Private Types Definitions
STM32L496G-DISCOVERY Common

This file provides firmware functions to manage Leds, push-buttons, COM ports, SD card on SPI and temperature sensor (TS751) available on STM32L496G-DISCOVERY discoveryuation board from STMicroelectronics. More...

This file provides firmware functions to manage Leds, push-buttons, COM ports, SD card on SPI and temperature sensor (TS751) available on STM32L496G-DISCOVERY discoveryuation board from STMicroelectronics.

Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Defines

Defines
Private Defines
STM32L496G-DISCOVERY Common

Defines

#define | __STM32L496G_DISCOVERY_BSP_VERSION_MAIN (0x01)
STM32L496G DISCOVERY BSP Driver version number.
#define | __STM32L496G_DISCOVERY_BSP_VERSION_SUB1 (0x01)
#define | __STM32L496G_DISCOVERY_BSP_VERSION_SUB2 (0x06)
#define | __STM32L496G_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32L496G_DISCOVERY_BSP_VERSION

Define Documentation

#define __STM32L496G_DISCOVERY_BSP_VERSION
Value:
((__STM32L496G_DISCOVERY_BSP_VERSION_MAIN << 24)\
                                                      |(__STM32L496G_DISCOVERY_BSP_VERSION_SUB1 << 16)\
                                                      |(__STM32L496G_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
                                                      |(__STM32L496G_DISCOVERY_BSP_VERSION_RC))

Definition at line 60 of file stm32l496g_discovery.c.

Referenced by BSP_GetVersion().

#define __STM32L496G_DISCOVERY_BSP_VERSION_MAIN (0x01)

STM32L496G DISCOVERY BSP Driver version number.

[31:24] main version

Definition at line 56 of file stm32l496g_discovery.c.

#define __STM32L496G_DISCOVERY_BSP_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 59 of file stm32l496g_discovery.c.

#define __STM32L496G_DISCOVERY_BSP_VERSION_SUB1 (0x01)

[23:16] sub1 version

Definition at line 57 of file stm32l496g_discovery.c.

#define __STM32L496G_DISCOVERY_BSP_VERSION_SUB2 (0x06)

[15:8] sub2 version

Definition at line 58 of file stm32l496g_discovery.c.


STM32L496G-Discovery BSP User Manual: Private Macros

Private Macros
STM32L496G-DISCOVERY Common
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32L496G-DISCOVERY Common

Variables

const uint16_t | LED_PIN [LEDn]
LED variables.
GPIO_TypeDef * | JOY_PORT [JOYn]
JOYSTICK variables.
const uint16_t | JOY_PIN [JOYn]
const uint8_t | JOY_IRQn [JOYn]
USART_TypeDef * | COM_USART [COMn] = {DISCOVERY_COM1}
COM port variables.
GPIO_TypeDef * | COM_TX_PORT [COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {DISCOVERY_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {DISCOVERY_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {DISCOVERY_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {DISCOVERY_COM1_RX_AF}
uint32_t | I2c1Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
BUS variables.
uint32_t | I2c2Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
uint32_t | ts_io_init = 0
static I2C_HandleTypeDef | I2c2Handle = {0}
static I2C_HandleTypeDef | hI2cTSHandler = {0}
static I2C_HandleTypeDef | hI2cAudioHandler = {0}
static I2C_HandleTypeDef | hI2cCameraHandler = {0}

Variable Documentation

const uint16_t COM_RX_AF[COMn] = {DISCOVERY_COM1_RX_AF}

Definition at line 124 of file stm32l496g_discovery.c.

Referenced by BSP_COM_Init().

const uint16_t COM_RX_PIN[COMn] = {DISCOVERY_COM1_RX_PIN}

Definition at line 122 of file stm32l496g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

GPIO_TypeDef* COM_RX_PORT[COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}

Definition at line 120 of file stm32l496g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

const uint16_t COM_TX_AF[COMn] = {DISCOVERY_COM1_TX_AF}

Definition at line 123 of file stm32l496g_discovery.c.

Referenced by BSP_COM_Init().

const uint16_t COM_TX_PIN[COMn] = {DISCOVERY_COM1_TX_PIN}

Definition at line 121 of file stm32l496g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

GPIO_TypeDef* COM_TX_PORT[COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}

Definition at line 119 of file stm32l496g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

USART_TypeDef* COM_USART[COMn] = {DISCOVERY_COM1}

COM port variables.

Definition at line 118 of file stm32l496g_discovery.c.

Referenced by BSP_COM_DeInit(), and BSP_COM_Init().

I2C_HandleTypeDef hI2cAudioHandler = {0} [static]

Definition at line 137 of file stm32l496g_discovery.c.

Referenced by I2Cx_Init().

I2C_HandleTypeDef hI2cCameraHandler = {0} [static]

Definition at line 138 of file stm32l496g_discovery.c.

Referenced by CAMERA_IO_Init(), CAMERA_IO_Read(), CAMERA_IO_Write(), and I2Cx_Init().

I2C_HandleTypeDef hI2cTSHandler = {0} [static]

Definition at line 136 of file stm32l496g_discovery.c.

Referenced by I2Cx_Error(), I2Cx_Init(), TS_IO_Init(), TS_IO_ReadMultiple(), TS_IO_Write(), and TS_IO_WriteMultiple().

uint32_t I2c1Timeout = DISCOVERY_I2C2_TIMEOUT_MAX

BUS variables.

Definition at line 132 of file stm32l496g_discovery.c.

I2C_HandleTypeDef I2c2Handle = {0} [static]

Definition at line 135 of file stm32l496g_discovery.c.

Referenced by I2C2_DeInit(), I2C2_Error(), I2C2_Init(), I2C2_isDeviceReady(), I2C2_ReadBuffer(), I2C2_ReadData(), I2C2_WriteBuffer(), and I2C2_WriteData().

uint32_t I2c2Timeout = DISCOVERY_I2C2_TIMEOUT_MAX

Definition at line 133 of file stm32l496g_discovery.c.

Referenced by I2C2_ReadBuffer(), I2C2_ReadData(), I2C2_WriteBuffer(), and I2C2_WriteData().

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

Definition at line 106 of file stm32l496g_discovery.c.

Referenced by BSP_JOY_Init().

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

Definition at line 99 of file stm32l496g_discovery.c.

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

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

JOYSTICK variables.

Definition at line 92 of file stm32l496g_discovery.c.

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

const uint16_t LED_PIN[LEDn]
Initial value:
                 {LED1_PIN,
                                                 LED2_PIN
                                                }

LED variables.

Definition at line 85 of file stm32l496g_discovery.c.

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

uint32_t ts_io_init = 0

Definition at line 134 of file stm32l496g_discovery.c.

Referenced by BSP_LCD_DeInit(), and TS_IO_Init().


STM32L496G-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32L496G-DISCOVERY Common

Functions

void | IOE_Init (void)
void | IOE_ITConfig (void)
void | IOE_Delay (uint32_t Delay)
void | IOE_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
uint8_t | IOE_Read (uint8_t Addr, uint8_t Reg)
uint16_t | IOE_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
static uint8_t | I2C2_isDeviceReady (uint16_t Addr, uint32_t trial)

Function Documentation

static uint8_t I2C2_isDeviceReady | ( | uint16_t | Addr,
 |  | uint32_t | trial
 | ) |  | [static]

Definition at line 755 of file stm32l496g_discovery.c.

References I2C2_Error(), and I2c2Handle.

Referenced by MFX_IO_Init().

void IOE_Delay ( uint32_t Delay )
void IOE_Init ( void )
void IOE_ITConfig ( void )
uint8_t IOE_Read | ( | uint8_t | Addr,
 |  | uint8_t | Reg
 | ) |  |
uint16_t IOE_ReadMultiple | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t * | Buffer,
 |  | uint16_t | Length
 | ) |  |
void IOE_Write | ( | uint8_t | Addr,
 |  | uint8_t | Reg,
 |  | uint8_t | Value
 | ) |  |


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G-DISCOVERY Common

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32L496 DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIOs.
void | BSP_LED_DeInit (Led_TypeDef Led)
Unconfigures LED GPIOs.
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.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all buttons of the joystick in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Unconfigures all GPIOs used as buttons of the joystick.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
void | BSP_ErrorHandler (void)
void | FMC_BANK1_MspInit (void)
Initializes FMC_BANK1_LCD_IO MSP.
void | FMC_BANK1_MspDeInit (void)
DeInitializes FMC_BANK1_LCD_IO MSP.
void | I2C2_Init (void)
Discovery I2C2 Bus initialization.
void | I2C2_DeInit (void)
Discovery I2C2 Bus Deinitialization.

Function Documentation

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

DeInit COM port.

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

Definition at line 519 of file stm32l496g_discovery.c.

References COM_RX_PIN, COM_RX_PORT, COM_TX_PIN, COM_TX_PORT, COM_USART, and DISCOVERY_COMx_CLK_DISABLE.

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

Configures COM port.

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

Definition at line 482 of file stm32l496g_discovery.c.

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

void BSP_ErrorHandler ( void )

Definition at line 237 of file stm32l496g_discovery.c.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspInit(), BSP_LCD_ScreenDimmingOff(), BSP_LCD_ScreenDimmingOn(), BSP_LED_Init(), HAL_DFSDM_FilterRegConvCpltCallback(), HAL_DFSDM_FilterRegConvHalfCpltCallback(), I2C2_Error(), I2Cx_Error(), MFX_IO_Init(), SD_Detect_MspDeInit(), SD_Detect_MspInit(), and TS_IO_Init().

uint32_t BSP_GetVersion ( void )

This method returns the STM32L496 DISCOVERY BSP Driver revision.

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

Definition at line 250 of file stm32l496g_discovery.c.

References __STM32L496G_DISCOVERY_BSP_VERSION.

void BSP_JOY_DeInit ( void )

Unconfigures all GPIOs used as buttons of the joystick.

Return values:
None.

Definition at line 431 of file stm32l496g_discovery.c.

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

JOYState_TypeDef BSP_JOY_GetState ( void )

Returns the current joystick status.

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

Definition at line 456 of file stm32l496g_discovery.c.

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

uint8_t BSP_JOY_Init ( JOYMode_TypeDef Joy_Mode )

Configures all buttons of the joystick in GPIO or EXTI modes.

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

Definition at line 392 of file stm32l496g_discovery.c.

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

void BSP_LED_DeInit ( Led_TypeDef Led )

Unconfigures LED GPIOs.

Parameters:
Led,: Specifies the Led to be unconfigured. This parameter can be one of following parameters:
  • LED1
  • LED2
Return values:
None

Definition at line 309 of file stm32l496g_discovery.c.

References LED2, LED2_GPIO_CLK_ENABLE, LED2_GPIO_PORT, and LED_PIN.

void BSP_LED_Init ( Led_TypeDef Led )

Configures LED GPIOs.

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

Definition at line 265 of file stm32l496g_discovery.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_Init(), BSP_IO_WritePin(), IO_ERROR, LED2, LED2_GPIO_CLK_ENABLE, LED2_GPIO_PORT, and LED_PIN.

void BSP_LED_Off ( Led_TypeDef Led )

Turns selected LED Off.

Parameters:
Led,: Specifies the Led to be set off. This parameter can be one of following parameters:
  • LED1
  • LED2
Return values:
None

Definition at line 350 of file stm32l496g_discovery.c.

References BSP_IO_WritePin(), LED2, LED2_GPIO_PORT, and LED_PIN.

void BSP_LED_On ( Led_TypeDef Led )

Turns selected LED On.

Parameters:
Led,: Specifies the Led to be set on. This parameter can be one of following parameters:
  • LED1
  • LED2
Return values:
None

Definition at line 329 of file stm32l496g_discovery.c.

References BSP_IO_WritePin(), LED2, LED2_GPIO_PORT, and LED_PIN.

void BSP_LED_Toggle ( Led_TypeDef Led )

Toggles the selected LED.

Parameters:
Led,: Specifies the Led to be toggled. This parameter can be one of following parameters:
  • LED1
  • LED2
Return values:
None

Definition at line 371 of file stm32l496g_discovery.c.

References BSP_IO_TogglePin(), LED2, LED2_GPIO_PORT, and LED_PIN.

void FMC_BANK1_MspDeInit ( void )

DeInitializes FMC_BANK1_LCD_IO MSP.

Parameters:
None
Return values:
None

Definition at line 1351 of file stm32l496g_discovery.c.

void FMC_BANK1_MspInit ( void )

Initializes FMC_BANK1_LCD_IO MSP.

Parameters:
None
Return values:
None

Definition at line 1246 of file stm32l496g_discovery.c.

Referenced by FMC_BANK1_Init().

void I2C2_DeInit ( void )

Discovery I2C2 Bus Deinitialization.

Return values:
None

Definition at line 627 of file stm32l496g_discovery.c.

References I2C2_MspDeInit(), and I2c2Handle.

Referenced by I2Cx_Error(), and MFX_IO_DeInit().

void I2C2_Init ( void )

Discovery I2C2 Bus initialization.

Return values:
None

Definition at line 554 of file stm32l496g_discovery.c.

References DISCOVERY_I2C2, I2C2_MspInit(), and I2c2Handle.

Referenced by AUDIO_IO_Init(), I2C2_Error(), and MFX_IO_Init().


STM32L496G-Discovery BSP User Manual: Bus Operations Functions

Functions
Bus Operations Functions
STM32L496G-DISCOVERY Common

Functions

void | I2C2_Init (void)
Discovery I2C2 Bus initialization.
void | I2C2_DeInit (void)
Discovery I2C2 Bus Deinitialization.
void | FMC_BANK1_MspInit (void)
Initializes FMC_BANK1_LCD_IO MSP.
void | FMC_BANK1_MspDeInit (void)
DeInitializes FMC_BANK1_LCD_IO MSP.
__weak uint8_t | BSP_LCD_Init (void)
static void | I2C2_MspInit (I2C_HandleTypeDef *hi2c)
Discovery I2C2 MSP Initialization.
static void | I2C2_MspDeInit (I2C_HandleTypeDef *hi2c)
Discovery I2C2 MSP DeInitialization.
static void | I2C2_WriteData (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t Value)
Write a value in a register of the device through BUS.
static HAL_StatusTypeDef | I2C2_WriteBuffer (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
Write a value in a register of the device through BUS.
static uint8_t | I2C2_ReadData (uint16_t Addr, uint16_t Reg, uint16_t RegSize)
Read a register of the device through BUS.
static HAL_StatusTypeDef | I2C2_ReadBuffer (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
Reads multiple data on the BUS.
static void | I2C2_Error (void)
Discovery I2C2 error treatment function.
static void | I2Cx_Init (I2C_HandleTypeDef *i2c_handler)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static void | I2Cx_Error (I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
Manages error callback by re-initializing I2C.
void | MFX_IO_Init (void)
Initializes MFX low level.
void | MFX_IO_DeInit (void)
Deinitializes MFX low level.
void | MFX_IO_ITConfig (void)
Configures MFX low level interrupt.
void | MFX_IO_EnableWakeupPin (void)
Configures MFX wke up pin.
void | MFX_IO_Wakeup (void)
Wakeup MFX.
void | MFX_IO_Write (uint16_t Addr, uint8_t Reg, uint8_t Value)
MFX writes single data.
uint8_t | MFX_IO_Read (uint16_t Addr, uint8_t Reg)
MFX reads single data.
uint16_t | MFX_IO_ReadMultiple (uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
MFX reads multiple data.
void | MFX_IO_WriteMultiple (uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
MFX writes multiple data.
void | MFX_IO_Delay (uint32_t Delay)
MFX delay.
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.
static void | FMC_BANK1_Init (void)
Initializes LCD IO.
static void | FMC_BANK1_WriteData (uint16_t Data)
Writes register value.
static void | FMC_BANK1_WriteReg (uint8_t Reg)
Writes register address.
static uint16_t | FMC_BANK1_ReadData (void)
Reads register value.
void | LCD_IO_Init (void)
Initializes LCD low level.
void | LCD_IO_WriteData (uint16_t RegValue)
Writes data on LCD data register.
void | LCD_IO_WriteMultipleData (uint16_t *pData, uint32_t Size)
Writes several data on LCD data register.
void | LCD_IO_WriteReg (uint8_t Reg)
Writes register on LCD register.
uint16_t | LCD_IO_ReadData (void)
Reads data from LCD data register.
void | LCD_IO_Delay (uint32_t Delay)
LCD delay.
void | TS_IO_Init (void)
Initializes Touchscreen low level.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
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 | CAMERA_IO_Init (void)
Initializes Camera low level.
void | CAMERA_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Camera writes single data.
uint8_t | CAMERA_IO_Read (uint8_t Addr, uint8_t Reg)
Camera reads single data.
void | CAMERA_Delay (uint32_t Delay)
Camera delay.

Function Documentation

void AUDIO_IO_DeInit ( void )

Deinitializes Audio low level.

Return values:
None

Definition at line 1172 of file stm32l496g_discovery.c.

References AUDIO_I2C_ADDRESS, AUDIO_IO_Read(), AUDIO_IO_Write(), and CODEC_AUDIO_POWER_OFF.

void AUDIO_IO_Delay ( uint32_t Delay )

AUDIO Codec delay.

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

Definition at line 1232 of file stm32l496g_discovery.c.

void AUDIO_IO_Init ( void )

Initializes Audio low level.

Return values:
None

Definition at line 1131 of file stm32l496g_discovery.c.

References AUDIO_I2C_ADDRESS, AUDIO_IO_Read(), AUDIO_IO_Write(), AUDIO_RESET_GPIO, AUDIO_RESET_GPIO_CLK_ENABLE, AUDIO_RESET_PIN, CODEC_AUDIO_POWER_OFF, CODEC_AUDIO_POWER_ON, and I2C2_Init().

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 1218 of file stm32l496g_discovery.c.

References I2C2_ReadBuffer().

Referenced by AUDIO_IO_DeInit(), and AUDIO_IO_Init().

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

Definition at line 1207 of file stm32l496g_discovery.c.

References I2C2_WriteBuffer().

Referenced by AUDIO_IO_DeInit(), and AUDIO_IO_Init().

__weak uint8_t BSP_LCD_Init ( void )

Definition at line 1623 of file stm32l496g_discovery.c.

Referenced by TS_IO_Init().

void CAMERA_Delay ( uint32_t Delay )

Camera delay.

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

Definition at line 1615 of file stm32l496g_discovery.c.

void CAMERA_IO_Init ( void )

Initializes Camera low level.

Return values:
None

Definition at line 1578 of file stm32l496g_discovery.c.

References hI2cCameraHandler, and I2Cx_Init().

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

Camera reads single data.

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

Definition at line 1601 of file stm32l496g_discovery.c.

References hI2cCameraHandler, and I2Cx_ReadMultiple().

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

Camera writes single data.

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

Definition at line 1590 of file stm32l496g_discovery.c.

References hI2cCameraHandler, and I2Cx_WriteMultiple().

void FMC_BANK1_Init ( void ) [static]

Initializes LCD IO.

Parameters:
None
Return values:
None

Definition at line 1293 of file stm32l496g_discovery.c.

References FMC_BANK1_MspInit().

Referenced by LCD_IO_Init().

void FMC_BANK1_MspDeInit ( void )

DeInitializes FMC_BANK1_LCD_IO MSP.

Parameters:
None
Return values:
None

Definition at line 1351 of file stm32l496g_discovery.c.

void FMC_BANK1_MspInit ( void )

Initializes FMC_BANK1_LCD_IO MSP.

Parameters:
None
Return values:
None

Definition at line 1246 of file stm32l496g_discovery.c.

Referenced by FMC_BANK1_Init().

static uint16_t FMC_BANK1_ReadData ( void ) [static]

Reads register value.

Parameters:
None
Return values:
Read value

Definition at line 1404 of file stm32l496g_discovery.c.

References LCD_ADDR.

Referenced by LCD_IO_ReadData().

static void FMC_BANK1_WriteData ( uint16_t Data ) [static]

Writes register value.

Parameters:
Data,: Data to be written
Return values:
None

Definition at line 1382 of file stm32l496g_discovery.c.

References LCD_ADDR.

Referenced by LCD_IO_WriteData(), and LCD_IO_WriteMultipleData().

static void FMC_BANK1_WriteReg ( uint8_t Reg ) [static]

Writes register address.

Parameters:
Reg,: Register to be written
Return values:
None

Definition at line 1393 of file stm32l496g_discovery.c.

References FMC_BANK1_ADDR.

Referenced by LCD_IO_WriteReg().

void I2C2_DeInit ( void )

Discovery I2C2 Bus Deinitialization.

Return values:
None

Definition at line 627 of file stm32l496g_discovery.c.

References I2C2_MspDeInit(), and I2c2Handle.

Referenced by I2Cx_Error(), and MFX_IO_DeInit().

static void I2C2_Error ( void ) [static]

Discovery I2C2 error treatment function.

Return values:
None

Definition at line 810 of file stm32l496g_discovery.c.

References BSP_ErrorHandler(), I2C2_Init(), and I2c2Handle.

Referenced by I2C2_isDeviceReady(), I2C2_ReadBuffer(), I2C2_ReadData(), I2C2_WriteBuffer(), and I2C2_WriteData().

void I2C2_Init ( void )

Discovery I2C2 Bus initialization.

Return values:
None

Definition at line 554 of file stm32l496g_discovery.c.

References DISCOVERY_I2C2, I2C2_MspInit(), and I2c2Handle.

Referenced by AUDIO_IO_Init(), I2C2_Error(), and MFX_IO_Init().

static void I2C2_MspDeInit ( I2C_HandleTypeDef * hi2c ) [static]

Discovery I2C2 MSP DeInitialization.

Parameters:
hi2c,: I2C2 handle
Return values:
None

Definition at line 642 of file stm32l496g_discovery.c.

References DISCOVERY_I2C2, DISCOVERY_I2C2_CLK_DISABLE, DISCOVERY_I2C2_ER_IRQn, DISCOVERY_I2C2_EV_IRQn, DISCOVERY_I2C2_FORCE_RESET, DISCOVERY_I2C2_RELEASE_RESET, DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE, DISCOVERY_I2C2_SCL_GPIO_PORT, DISCOVERY_I2C2_SCL_PIN, DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE, DISCOVERY_I2C2_SDA_GPIO_PORT, and DISCOVERY_I2C2_SDA_PIN.

Referenced by I2C2_DeInit().

static void I2C2_MspInit ( I2C_HandleTypeDef * hi2c ) [static]

Discovery I2C2 MSP Initialization.

Parameters:
hi2c,: I2C2 handle
Return values:
None

Definition at line 578 of file stm32l496g_discovery.c.

References DISCOVERY_I2C2, DISCOVERY_I2C2_CLK_ENABLE, DISCOVERY_I2C2_ER_IRQn, DISCOVERY_I2C2_EV_IRQn, DISCOVERY_I2C2_FORCE_RESET, DISCOVERY_I2C2_RELEASE_RESET, DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE, DISCOVERY_I2C2_SCL_GPIO_PORT, DISCOVERY_I2C2_SCL_PIN, DISCOVERY_I2C2_SCL_SDA_AF, DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE, DISCOVERY_I2C2_SDA_GPIO_PORT, and DISCOVERY_I2C2_SDA_PIN.

Referenced by I2C2_Init().

static HAL_StatusTypeDef I2C2_ReadBuffer | ( | uint16_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | RegSize,
 |  | uint8_t * | pBuffer,
 |  | uint16_t | Length
 | ) |  | [static]

Reads multiple data on the BUS.

Parameters:
Addr,: I2C Address
Reg,: Reg Address
RegSize : The target register size (can be 8BIT or 16BIT)
pBuffer,: pointer to read data buffer
Length,: length of the data
Return values:
0 if no problems to read multiple data

Definition at line 786 of file stm32l496g_discovery.c.

References I2C2_Error(), I2c2Handle, and I2c2Timeout.

Referenced by AUDIO_IO_Read(), and MFX_IO_ReadMultiple().

static uint8_t I2C2_ReadData | ( | uint16_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | RegSize
 | ) |  | [static]

Read a register of the device through BUS.

Parameters:
Addr,: Device address on BUS
Reg,: The target register address to read
RegSize,: The target register size (can be 8BIT or 16BIT)
Return values:
read register value

Definition at line 733 of file stm32l496g_discovery.c.

References I2C2_Error(), I2c2Handle, and I2c2Timeout.

Referenced by MFX_IO_Read(), and TS_IO_Read().

static HAL_StatusTypeDef I2C2_WriteBuffer | ( | uint16_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | RegSize,
 |  | uint8_t * | pBuffer,
 |  | uint16_t | Length
 | ) |  | [static]

Write a value in a register of the device through BUS.

Parameters:
Addr,: Device address on BUS Bus.
Reg,: The target register address to write
RegSize,: The target register size (can be 8BIT or 16BIT)
pBuffer,: The target register value to be written
Length,: buffer size to be written
Return values:
None

Definition at line 705 of file stm32l496g_discovery.c.

References I2C2_Error(), I2c2Handle, and I2c2Timeout.

Referenced by AUDIO_IO_Write(), and MFX_IO_WriteMultiple().

static void I2C2_WriteData | ( | uint16_t | Addr,
 |  | uint16_t | Reg,
 |  | uint16_t | RegSize,
 |  | uint8_t | Value
 | ) |  | [static]

Write a value in a register of the device through BUS.

Parameters:
Addr,: Device address on BUS Bus.
Reg,: The target register address to write
RegSize,: The target register size (can be 8BIT or 16BIT)
Value,: The target register value to be written
Return values:
None

Definition at line 677 of file stm32l496g_discovery.c.

References I2C2_Error(), I2c2Handle, and I2c2Timeout.

Referenced by MFX_IO_Write().

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

Manages error callback by re-initializing I2C.

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

Definition at line 940 of file stm32l496g_discovery.c.

References BSP_ErrorHandler(), hI2cTSHandler, I2C2_DeInit(), and I2Cx_Init().

Referenced by I2Cx_ReadMultiple(), and I2Cx_WriteMultiple().

static void I2Cx_Init ( I2C_HandleTypeDef * i2c_handler ) [static]

Initializes I2C HAL.

Parameters:
i2c_handler : I2C handler
Return values:
None

Definition at line 829 of file stm32l496g_discovery.c.

References DISCOVERY_AUDIO_I2Cx, DISCOVERY_CAMERA_I2Cx, DISCOVERY_EXT_I2Cx, DISCOVERY_TS_I2Cx, hI2cAudioHandler, hI2cCameraHandler, and hI2cTSHandler.

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

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

Reads multiple data.

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

Definition at line 884 of file stm32l496g_discovery.c.

References I2Cx_Error().

Referenced by CAMERA_IO_Read(), and TS_IO_ReadMultiple().

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

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

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

Definition at line 914 of file stm32l496g_discovery.c.

References I2Cx_Error().

Referenced by CAMERA_IO_Write(), TS_IO_Write(), and TS_IO_WriteMultiple().

void LCD_IO_Delay ( uint32_t Delay )

LCD delay.

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

Definition at line 1478 of file stm32l496g_discovery.c.

void LCD_IO_Init ( void )

Initializes LCD low level.

Parameters:
None
Return values:
None

Definition at line 1420 of file stm32l496g_discovery.c.

References FMC_BANK1_Init().

uint16_t LCD_IO_ReadData ( void )

Reads data from LCD data register.

Parameters:
None
Return values:
Read data.

Definition at line 1468 of file stm32l496g_discovery.c.

References FMC_BANK1_ReadData().

void LCD_IO_WriteData ( uint16_t RegValue )

Writes data on LCD data register.

Parameters:
Data,: Data to be written
Return values:
None

Definition at line 1430 of file stm32l496g_discovery.c.

References FMC_BANK1_WriteData().

Referenced by BSP_LCD_InitEx().

void LCD_IO_WriteMultipleData | ( | uint16_t * | pData,
 |  | uint32_t | Size
 | ) |  |

Writes several data on LCD data register.

Parameters:
Data,: pointer on data to be written
Size,: data amount in 16bits short unit
Return values:
None

Definition at line 1442 of file stm32l496g_discovery.c.

References FMC_BANK1_WriteData().

void LCD_IO_WriteReg ( uint8_t Reg )

Writes register on LCD register.

Parameters:
Reg,: Register to be written
Return values:
None

Definition at line 1457 of file stm32l496g_discovery.c.

References FMC_BANK1_WriteReg().

void MFX_IO_DeInit ( void )

Deinitializes MFX low level.

Return values:
None

Definition at line 985 of file stm32l496g_discovery.c.

References I2C2_DeInit(), MFX_INT_EXTI_IRQn, MFX_INT_GPIO_CLK_ENABLE, MFX_INT_GPIO_PORT, MFX_INT_PIN, MFX_WAKEUP_GPIO_CLK_ENABLE, MFX_WAKEUP_GPIO_PORT, and MFX_WAKEUP_PIN.

void MFX_IO_Delay ( uint32_t Delay )

MFX delay.

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

Definition at line 1120 of file stm32l496g_discovery.c.

void MFX_IO_EnableWakeupPin ( void )

Configures MFX wke up pin.

Return values:
None

Definition at line 1035 of file stm32l496g_discovery.c.

References MFX_WAKEUP_GPIO_CLK_ENABLE, MFX_WAKEUP_GPIO_PORT, and MFX_WAKEUP_PIN.

void MFX_IO_Init ( void )

Initializes MFX low level.

Return values:
None

Definition at line 970 of file stm32l496g_discovery.c.

References BSP_ErrorHandler(), I2C2_Init(), I2C2_isDeviceReady(), and IO1_I2C_ADDRESS.

void MFX_IO_ITConfig ( void )

Configures MFX low level interrupt.

Return values:
None

Definition at line 1012 of file stm32l496g_discovery.c.

References MFX_INT_EXTI_IRQn, MFX_INT_GPIO_CLK_ENABLE, MFX_INT_GPIO_PORT, and MFX_INT_PIN.

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

MFX reads single data.

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

Definition at line 1084 of file stm32l496g_discovery.c.

References I2C2_ReadData().

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

MFX reads multiple data.

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 1097 of file stm32l496g_discovery.c.

References I2C2_ReadBuffer().

void MFX_IO_Wakeup ( void )

Wakeup MFX.

Return values:
None

Definition at line 1054 of file stm32l496g_discovery.c.

References MFX_WAKEUP_GPIO_PORT, and MFX_WAKEUP_PIN.

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

MFX writes single data.

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

Definition at line 1073 of file stm32l496g_discovery.c.

References I2C2_WriteData().

Referenced by BSP_CAMERA_Init().

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

MFX writes multiple data.

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

Definition at line 1110 of file stm32l496g_discovery.c.

References I2C2_WriteBuffer().

void TS_IO_Delay ( uint32_t Delay )

Delay function used in TouchScreen low level driver.

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

Definition at line 1567 of file stm32l496g_discovery.c.

void TS_IO_Init ( void )

Initializes Touchscreen low level.

Return values:
None

Definition at line 1489 of file stm32l496g_discovery.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_WritePin(), BSP_LCD_Init(), hI2cTSHandler, I2Cx_Init(), LCD_ERROR, ts_io_init, and TS_RST_PIN.

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

Reads a single data.

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

Definition at line 1529 of file stm32l496g_discovery.c.

References I2C2_ReadData().

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 1543 of file stm32l496g_discovery.c.

References hI2cTSHandler, and I2Cx_ReadMultiple().

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

Writes a single data.

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

Definition at line 1518 of file stm32l496g_discovery.c.

References hI2cTSHandler, and I2Cx_WriteMultiple().

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

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

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

Definition at line 1557 of file stm32l496g_discovery.c.

References hI2cTSHandler, and I2Cx_WriteMultiple().


STM32L496G-Discovery BSP User Manual: Exported Types

Data Structures | Enumerations
Exported Types
STM32L496G-DISCOVERY Common

Data Structures

struct | LCD_CONTROLLER_TypeDef
LCD constroller Types Definition. More...

Enumerations

enum | Led_TypeDef { LED1 = 0, LED2 = 1, LED_ORANGE = LED1, LED_GREEN = LED2 }
LED Types Definition. More...
enum JOYState_TypeDef {
JOY_SEL = 0, JOY_LEFT = 1, JOY_RIGHT = 2, JOY_DOWN = 3,
JOY_UP = 4, JOY_NONE = 5
}
JOYSTICK Types Definition. More...
enum | JOYMode_TypeDef { JOY_MODE_GPIO = 0, JOY_MODE_EXTI = 1 }
enum | COM_TypeDef { COM1 = 0 }

Enumeration Type Documentation

enum COM_TypeDef
Enumerator:
COM1

Definition at line 86 of file stm32l496g_discovery.h.

enum JOYMode_TypeDef
Enumerator:
JOY_MODE_GPIO
JOY_MODE_EXTI

Definition at line 80 of file stm32l496g_discovery.h.

enum JOYState_TypeDef

JOYSTICK Types Definition.

Enumerator:
JOY_SEL
JOY_LEFT
JOY_RIGHT
JOY_DOWN
JOY_UP
JOY_NONE

Definition at line 70 of file stm32l496g_discovery.h.

enum Led_TypeDef

LED Types Definition.

Enumerator:
LED1
LED2
LED_ORANGE
LED_GREEN

Definition at line 57 of file stm32l496g_discovery.h.


STM32L496G-Discovery BSP User Manual: LCD_CONTROLLER_TypeDef Struct Reference

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

LCD constroller Types Definition. More...

#include <stm32l496g_discovery.h>

Data Fields

__IO uint16_t | REG
__IO uint16_t | RAM

Detailed Description

LCD constroller Types Definition.

Definition at line 94 of file stm32l496g_discovery.h.

Field Documentation

__IO uint16_t LCD_CONTROLLER_TypeDef::RAM

Definition at line 97 of file stm32l496g_discovery.h.

__IO uint16_t LCD_CONTROLLER_TypeDef::REG

Definition at line 96 of file stm32l496g_discovery.h.

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: FMC LCD Constants

Defines
FMC LCD Constants
Exported Constants

Defines

#define | FMC_BANK1_BASE ((uint32_t)(0x60000000 | 0x00000000))
#define | FMC_LCD_BASE ((uint32_t)(0x60000000 | 0x00080000)) /*using A18*/
#define | FMC_BANK1_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)
#define | LCD_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_LCD_BASE)

Define Documentation

#define FMC_BANK1_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)

Definition at line 114 of file stm32l496g_discovery.h.

Referenced by FMC_BANK1_WriteReg().

#define FMC_BANK1_BASE ((uint32_t)(0x60000000 | 0x00000000))

Definition at line 112 of file stm32l496g_discovery.h.

#define FMC_LCD_BASE ((uint32_t)(0x60000000 | 0x00080000)) /*using A18*/

Definition at line 113 of file stm32l496g_discovery.h.

#define LCD_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_LCD_BASE)

Definition at line 115 of file stm32l496g_discovery.h.

Referenced by FMC_BANK1_ReadData(), and FMC_BANK1_WriteData().


STM32L496G-Discovery BSP User Manual: LED Constants

Defines
LED Constants
Exported Constants

Defines

#define | LEDn 2
#define | LED1_PIN IO1_PIN_4
#define | LED2_PIN GPIO_PIN_13
#define | LED2_GPIO_PORT GPIOB
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()

Define Documentation

#define LED1_PIN IO1_PIN_4

Definition at line 128 of file stm32l496g_discovery.h.

#define LED2_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 133 of file stm32l496g_discovery.h.

#define LED2_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 132 of file stm32l496g_discovery.h.

Referenced by BSP_LED_DeInit(), and BSP_LED_Init().

#define LED2_GPIO_PORT GPIOB

Definition at line 131 of file stm32l496g_discovery.h.

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

#define LED2_PIN GPIO_PIN_13

Definition at line 130 of file stm32l496g_discovery.h.

#define LEDn 2

Definition at line 125 of file stm32l496g_discovery.h.


STM32L496G-Discovery BSP User Manual: BUTTON Constants

Defines
BUTTON Constants
Exported Constants

Defines

#define | JOYn 5
#define | RIGHT_JOY_PIN GPIO_PIN_11 /* PF.11 */
Joystick Right push-button.
#define | RIGHT_JOY_GPIO_PORT GPIOF
#define | RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | RIGHT_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | LEFT_JOY_PIN GPIO_PIN_9 /* PI.09 */
Joystick Left push-button.
#define | LEFT_JOY_GPIO_PORT GPIOI
#define | LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LEFT_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | UP_JOY_PIN GPIO_PIN_8 /* PI.08 */
Joystick Up push-button.
#define | UP_JOY_GPIO_PORT GPIOI
#define | UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | UP_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | DOWN_JOY_PIN GPIO_PIN_10 /* PI.10 */
Joystick Down push-button.
#define | DOWN_JOY_GPIO_PORT GPIOI
#define | DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | DOWN_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | SEL_JOY_PIN GPIO_PIN_13 /* PC.13 */
Joystick Sel push-button.
#define | SEL_JOY_GPIO_PORT GPIOC
#define | SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | SEL_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | JOYx_GPIO_CLK_ENABLE(__JOY__)
#define | JOYx_GPIO_CLK_DISABLE(__JOY__)
#define | JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)

Define Documentation

#define DOWN_JOY_EXTI_IRQn EXTI15_10_IRQn

Definition at line 179 of file stm32l496g_discovery.h.

#define DOWN_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 178 of file stm32l496g_discovery.h.

#define DOWN_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 177 of file stm32l496g_discovery.h.

#define DOWN_JOY_GPIO_PORT GPIOI

Definition at line 176 of file stm32l496g_discovery.h.

#define DOWN_JOY_PIN GPIO_PIN_10 /* PI.10 */

Joystick Down push-button.

Definition at line 175 of file stm32l496g_discovery.h.

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

Definition at line 202 of file stm32l496g_discovery.h.

#define JOYn 5

Definition at line 143 of file stm32l496g_discovery.h.

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

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

Definition at line 196 of file stm32l496g_discovery.h.

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

Definition at line 190 of file stm32l496g_discovery.h.

Referenced by BSP_JOY_DeInit(), and BSP_JOY_Init().

#define LEFT_JOY_EXTI_IRQn EXTI9_5_IRQn

Definition at line 161 of file stm32l496g_discovery.h.

#define LEFT_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 160 of file stm32l496g_discovery.h.

#define LEFT_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 159 of file stm32l496g_discovery.h.

#define LEFT_JOY_GPIO_PORT GPIOI

Definition at line 158 of file stm32l496g_discovery.h.

#define LEFT_JOY_PIN GPIO_PIN_9 /* PI.09 */

Joystick Left push-button.

Definition at line 157 of file stm32l496g_discovery.h.

#define RIGHT_JOY_EXTI_IRQn EXTI15_10_IRQn

Definition at line 152 of file stm32l496g_discovery.h.

#define RIGHT_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOF_CLK_DISABLE()

Definition at line 151 of file stm32l496g_discovery.h.

#define RIGHT_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOF_CLK_ENABLE()

Definition at line 150 of file stm32l496g_discovery.h.

#define RIGHT_JOY_GPIO_PORT GPIOF

Definition at line 149 of file stm32l496g_discovery.h.

#define RIGHT_JOY_PIN GPIO_PIN_11 /* PF.11 */

Joystick Right push-button.

Definition at line 148 of file stm32l496g_discovery.h.

#define SEL_JOY_EXTI_IRQn EXTI15_10_IRQn

Definition at line 188 of file stm32l496g_discovery.h.

#define SEL_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 187 of file stm32l496g_discovery.h.

#define SEL_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 186 of file stm32l496g_discovery.h.

#define SEL_JOY_GPIO_PORT GPIOC

Definition at line 185 of file stm32l496g_discovery.h.

#define SEL_JOY_PIN GPIO_PIN_13 /* PC.13 */

Joystick Sel push-button.

Definition at line 184 of file stm32l496g_discovery.h.

#define UP_JOY_EXTI_IRQn EXTI9_5_IRQn

Definition at line 170 of file stm32l496g_discovery.h.

#define UP_JOY_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 169 of file stm32l496g_discovery.h.

#define UP_JOY_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 168 of file stm32l496g_discovery.h.

#define UP_JOY_GPIO_PORT GPIOI

Definition at line 167 of file stm32l496g_discovery.h.

#define UP_JOY_PIN GPIO_PIN_8 /* PI.08 */

Joystick Up push-button.

Definition at line 166 of file stm32l496g_discovery.h.


STM32L496G-Discovery BSP User Manual: COM Constants

Defines
COM Constants
Exported Constants

Defines

#define | COMn 1
#define | DISCOVERY_COM1 USART2
Definition for COM port1, connected to USART2 (ST-Link USB Virtual Com Port)
#define | DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
#define | DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART2_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_PIN GPIO_PIN_2
#define | DISCOVERY_COM1_TX_GPIO_PORT GPIOA
#define | DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_AF GPIO_AF7_USART2
#define | DISCOVERY_COM1_RX_PIN GPIO_PIN_6
#define | DISCOVERY_COM1_RX_GPIO_PORT GPIOD
#define | DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | DISCOVERY_COM1_RX_AF GPIO_AF7_USART2
#define | DISCOVERY_COM1_IRQn USART2_IRQn
#define | DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_DISABLE();}} while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_DISABLE();}} while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_DISABLE();}} while(0)

Define Documentation

#define COMn 1

Definition at line 211 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1 USART2

Definition for COM port1, connected to USART2 (ST-Link USB Virtual Com Port)

Definition at line 216 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_CLK_DISABLE ( ) __HAL_RCC_USART2_CLK_DISABLE()

Definition at line 218 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_CLK_ENABLE ( ) __HAL_RCC_USART2_CLK_ENABLE()

Definition at line 217 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_IRQn USART2_IRQn

Definition at line 232 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_RX_AF GPIO_AF7_USART2

Definition at line 230 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOD_CLK_DISABLE()

Definition at line 229 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOD_CLK_ENABLE()

Definition at line 228 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_RX_GPIO_PORT GPIOD

Definition at line 227 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_RX_PIN GPIO_PIN_6

Definition at line 226 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_TX_AF GPIO_AF7_USART2

Definition at line 224 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOA_CLK_DISABLE()

Definition at line 223 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOA_CLK_ENABLE()

Definition at line 222 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_TX_GPIO_PORT GPIOA

Definition at line 221 of file stm32l496g_discovery.h.

#define DISCOVERY_COM1_TX_PIN GPIO_PIN_2

Definition at line 220 of file stm32l496g_discovery.h.

#define DISCOVERY_COMx_CLK_DISABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_DISABLE();}} while(0)

Definition at line 236 of file stm32l496g_discovery.h.

Referenced by BSP_COM_DeInit().

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

Definition at line 235 of file stm32l496g_discovery.h.

Referenced by BSP_COM_Init().

#define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_DISABLE();}} while(0)

Definition at line 242 of file stm32l496g_discovery.h.

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

Definition at line 241 of file stm32l496g_discovery.h.

Referenced by BSP_COM_Init().

#define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE ( __INDEX__ ) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_DISABLE();}} while(0)

Definition at line 239 of file stm32l496g_discovery.h.

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

Definition at line 238 of file stm32l496g_discovery.h.

Referenced by BSP_COM_Init().


STM32L496G-Discovery BSP User Manual: BUS Constants

Defines
BUS Constants
Exported Constants

Defines

#define | DISCOVERY_I2C1_SCL_GPIO_PORT GPIOG
#define | DISCOVERY_I2C1_SDA_GPIO_PORT GPIOG
#define | DISCOVERY_I2C1_SCL_PIN GPIO_PIN_14
#define | DISCOVERY_I2C1_SDA_PIN GPIO_PIN_13
#define | DISCOVERY_I2C1_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_I2C1 I2C1
#define | DISCOVERY_I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_I2C1_CLK_DISABLE() __HAL_RCC_I2C1_CLK_DISABLE()
#define | DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | DISCOVERY_I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_I2C1_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_I2C1_EV_IRQHandler I2C1_EV_IRQHandler
#define | DISCOVERY_I2C1_ER_IRQn I2C1_ER_IRQn
#define | DISCOVERY_I2C1_ER_IRQHandler I2C1_ER_IRQHandler
#define | DISCOVERY_I2C1_TIMEOUT_MAX 3000
#define | DISCOVERY_I2C2_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_I2C2_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_I2C2_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_I2C2_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_I2C2_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_I2C2 I2C2
#define | DISCOVERY_I2C2_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_I2C2_CLK_DISABLE() __HAL_RCC_I2C2_CLK_DISABLE()
#define | DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_I2C2_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_I2C2_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_I2C2_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_I2C2_ER_IRQn I2C2_ER_IRQn
#define | IDD_I2C_ADDRESS ((uint16_t) 0x84)
#define | IO1_I2C_ADDRESS ((uint16_t) 0x84)
#define | AUDIO_I2C_ADDRESS ((uint16_t) 0x94)
#define | TS_I2C_ADDRESS ((uint16_t) 0x70)
#define | CAMERA_I2C_ADDRESS ((uint16_t) 0x60)
#define | DISCOVERY_I2C2_TIMEOUT_MAX 3000
#define | DISCOVERY_AUDIO_I2Cx I2C1
#define | DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_6
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_7
#define | DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C1_ER_IRQn
#define | DISCOVERY_TS_I2Cx I2C2
#define | DISCOVERY_TS_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_TS_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_TS_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_TS_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_TS_I2Cx_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_TS_I2Cx_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_TS_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_TS_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_TS_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | DISCOVERY_TS_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2
#define | DISCOVERY_TS_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK
#define | DISCOVERY_CAMERA_I2Cx I2C2
#define | DISCOVERY_CAMERA_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_CAMERA_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_CAMERA_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_CAMERA_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_CAMERA_I2Cx_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_CAMERA_I2Cx_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_CAMERA_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_CAMERA_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2
#define | DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK
#define | DISCOVERY_EXT_I2Cx I2C2
#define | DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_10
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_EXT_I2Cx_SCL_AF GPIO_AF4_I2C2
#define | DISCOVERY_EXT_I2Cx_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9
#define | DISCOVERY_EXT_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_EXT_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | CODEC_AUDIO_POWER_OFF() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_RESET)
Audio codec chip reset definition.
#define | CODEC_AUDIO_POWER_ON() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_SET)
#define | AUDIO_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_RESET_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | AUDIO_RESET_PIN GPIO_PIN_6
#define | AUDIO_RESET_GPIO GPIOC
#define | MFX_INT_GPIO_PORT GPIOC /* GPIOC */
MFX interface pins.
#define | MFX_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | MFX_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | MFX_INT_PIN GPIO_PIN_5 /* PC.05 */
#define | MFX_INT_EXTI_IRQn EXTI9_5_IRQn
#define | MFX_WAKEUP_GPIO_PORT GPIOH /* GPIOH */
#define | MFX_WAKEUP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | MFX_WAKEUP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | MFX_WAKEUP_PIN GPIO_PIN_6 /* PH.06 */
#define | IDD_INT_GPIO_PORT MFX_INT_GPIO_PORT
#define | IDD_INT_GPIO_CLK_ENABLE() MFX_INT_GPIO_CLK_ENABLE()
#define | IDD_INT_GPIO_CLK_DISABLE() MFX_INT_GPIO_CLK_DISABLE()
#define | IDD_INT_PIN MFX_INT_PIN
#define | IDD_INT_EXTI_IRQn MFX_INT_EXTI_IRQn
#define | IDD_WAKEUP_GPIO_PORT MFX_WAKEUP_GPIO_PORT
#define | IDD_WAKEUP_GPIO_CLK_ENABLE() MFX_WAKEUP_GPIO_CLK_ENABLE()
#define | IDD_WAKEUP_GPIO_CLK_DISABLE() MFX_WAKEUP_GPIO_CLK_DISABLE()
#define | IDD_WAKEUP_PIN MFX_WAKEUP_PIN
#define | IDD_AMP_CONTROL_PIN AGPIO_PIN_1
Idd current measurement interface pins on MFX.
#define | TS_INT_PIN GPIO_PIN_14
TS INT pin.
#define | TS_INT_GPIO_PORT GPIOG
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI15_10_IRQn
#define | TS_RST_PIN IO1_PIN_1
TS RST pin.

Define Documentation

#define AUDIO_I2C_ADDRESS ((uint16_t) 0x94)

Definition at line 337 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_DeInit(), AUDIO_IO_Init(), BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Stop(), 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().

#define AUDIO_RESET_GPIO GPIOC

Definition at line 476 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_Init().

#define AUDIO_RESET_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 474 of file stm32l496g_discovery.h.

#define AUDIO_RESET_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 473 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_Init().

#define AUDIO_RESET_PIN GPIO_PIN_6

Definition at line 475 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_Init().

#define CAMERA_I2C_ADDRESS ((uint16_t) 0x60)

Definition at line 339 of file stm32l496g_discovery.h.

Referenced by BSP_CAMERA_Init().

#define CODEC_AUDIO_POWER_OFF ( ) HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_RESET)

Audio codec chip reset definition.

Definition at line 469 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_DeInit(), and AUDIO_IO_Init().

#define CODEC_AUDIO_POWER_ON ( ) HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_SET)

Definition at line 470 of file stm32l496g_discovery.h.

Referenced by AUDIO_IO_Init().

#define DISCOVERY_AUDIO_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 358 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx I2C1

Definition at line 356 of file stm32l496g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 357 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C1_ER_IRQn

Definition at line 372 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C1_EV_IRQn

Definition at line 371 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 361 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 362 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_6

Definition at line 365 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 367 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 359 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOB

Definition at line 366 of file stm32l496g_discovery.h.

#define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_7

Definition at line 368 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 407 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx I2C2

Definition at line 405 of file stm32l496g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_CAMERA_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C2_CLK_ENABLE()

Definition at line 406 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_ER_IRQn I2C2_ER_IRQn

Definition at line 425 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_EV_IRQn I2C2_EV_IRQn

Definition at line 424 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C2_FORCE_RESET()

Definition at line 413 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C2_RELEASE_RESET()

Definition at line 414 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 411 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 410 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT GPIOH

Definition at line 418 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SCL_PIN GPIO_PIN_4

Definition at line 417 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2

Definition at line 421 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 409 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 408 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 420 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_I2Cx_SDA_PIN GPIO_PIN_14

Definition at line 419 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK

Definition at line 429 of file stm32l496g_discovery.h.

#define DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2

Definition at line 428 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 438 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx I2C2

Definition at line 436 of file stm32l496g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_EXT_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C2_CLK_ENABLE()

Definition at line 437 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_ER_IRQn I2C2_ER_IRQn

Definition at line 453 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_EV_IRQn I2C2_EV_IRQn

Definition at line 452 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C2_FORCE_RESET()

Definition at line 441 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C2_RELEASE_RESET()

Definition at line 442 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SCL_AF GPIO_AF4_I2C2

Definition at line 447 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_10

Definition at line 445 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 439 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB

Definition at line 446 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SDA_AF GPIO_AF4_I2C2

Definition at line 448 of file stm32l496g_discovery.h.

#define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9

Definition at line 449 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1 I2C1

Definition at line 265 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_CLK_DISABLE ( ) __HAL_RCC_I2C1_CLK_DISABLE()

Definition at line 267 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_CLK_ENABLE ( ) __HAL_RCC_I2C1_CLK_ENABLE()

Definition at line 266 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_ER_IRQHandler I2C1_ER_IRQHandler

Definition at line 279 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_ER_IRQn I2C1_ER_IRQn

Definition at line 278 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_EV_IRQHandler I2C1_EV_IRQHandler

Definition at line 277 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_EV_IRQn I2C1_EV_IRQn

Definition at line 276 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_FORCE_RESET ( ) __HAL_RCC_I2C1_FORCE_RESET()

Definition at line 272 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_RELEASE_RESET ( ) __HAL_RCC_I2C1_RELEASE_RESET()

Definition at line 273 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 271 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 269 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SCL_GPIO_PORT GPIOG

Definition at line 257 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SCL_PIN GPIO_PIN_14

Definition at line 259 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SCL_SDA_AF GPIO_AF4_I2C1

Definition at line 262 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 270 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 268 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SDA_GPIO_PORT GPIOG

Definition at line 258 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_SDA_PIN GPIO_PIN_13

Definition at line 260 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C1_TIMEOUT_MAX 3000

Definition at line 301 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C2 I2C2

Definition at line 314 of file stm32l496g_discovery.h.

Referenced by I2C2_Init(), I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_CLK_DISABLE ( ) __HAL_RCC_I2C2_CLK_DISABLE()

Definition at line 316 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit().

#define DISCOVERY_I2C2_CLK_ENABLE ( ) __HAL_RCC_I2C2_CLK_ENABLE()

Definition at line 315 of file stm32l496g_discovery.h.

Referenced by I2C2_MspInit().

#define DISCOVERY_I2C2_ER_IRQn I2C2_ER_IRQn

Definition at line 326 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_EV_IRQn I2C2_EV_IRQn

Definition at line 325 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_FORCE_RESET ( ) __HAL_RCC_I2C2_FORCE_RESET()

Definition at line 321 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_RELEASE_RESET ( ) __HAL_RCC_I2C2_RELEASE_RESET()

Definition at line 322 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 320 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 318 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SCL_GPIO_PORT GPIOH

Definition at line 309 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SCL_PIN GPIO_PIN_4

Definition at line 308 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SCL_SDA_AF GPIO_AF4_I2C2

Definition at line 312 of file stm32l496g_discovery.h.

Referenced by I2C2_MspInit().

#define DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 319 of file stm32l496g_discovery.h.

#define DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 317 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SDA_GPIO_PORT GPIOB

Definition at line 311 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_SDA_PIN GPIO_PIN_14

Definition at line 310 of file stm32l496g_discovery.h.

Referenced by I2C2_MspDeInit(), and I2C2_MspInit().

#define DISCOVERY_I2C2_TIMEOUT_MAX 3000

Definition at line 346 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 378 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx I2C2

Definition at line 376 of file stm32l496g_discovery.h.

Referenced by I2Cx_Init().

#define DISCOVERY_TS_I2Cx_CLK_ENABLE ( ) __HAL_RCC_I2C2_CLK_ENABLE()

Definition at line 377 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_ER_IRQn I2C2_ER_IRQn

Definition at line 396 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_EV_IRQn I2C2_EV_IRQn

Definition at line 395 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_FORCE_RESET ( ) __HAL_RCC_I2C2_FORCE_RESET()

Definition at line 384 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_RELEASE_RESET ( ) __HAL_RCC_I2C2_RELEASE_RESET()

Definition at line 385 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 382 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 381 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SCL_GPIO_PORT GPIOH

Definition at line 389 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SCL_PIN GPIO_PIN_4

Definition at line 388 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2

Definition at line 392 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOB_CLK_DISABLE()

Definition at line 380 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOB_CLK_ENABLE()

Definition at line 379 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 391 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_I2Cx_SDA_PIN GPIO_PIN_14

Definition at line 390 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK

Definition at line 400 of file stm32l496g_discovery.h.

#define DISCOVERY_TS_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2

Definition at line 399 of file stm32l496g_discovery.h.

#define IDD_AMP_CONTROL_PIN AGPIO_PIN_1

Idd current measurement interface pins on MFX.

Definition at line 514 of file stm32l496g_discovery.h.

Referenced by BSP_IDD_GetValue(), and BSP_IDD_StartMeasure().

#define IDD_I2C_ADDRESS ((uint16_t) 0x84)

Definition at line 335 of file stm32l496g_discovery.h.

Referenced by BSP_IDD_ClearIT(), BSP_IDD_Config(), BSP_IDD_DeInit(), BSP_IDD_DisableIT(), BSP_IDD_EnableIT(), BSP_IDD_ErrorClearIT(), BSP_IDD_ErrorDisableIT(), BSP_IDD_ErrorEnableIT(), BSP_IDD_ErrorGetCode(), BSP_IDD_ErrorGetITStatus(), BSP_IDD_GetITStatus(), BSP_IDD_GetValue(), BSP_IDD_Init(), BSP_IDD_LowPower(), BSP_IDD_Reset(), BSP_IDD_StartMeasure(), and BSP_IDD_WakeUp().

#define IDD_INT_EXTI_IRQn MFX_INT_EXTI_IRQn

Definition at line 504 of file stm32l496g_discovery.h.

#define IDD_INT_GPIO_CLK_DISABLE ( ) MFX_INT_GPIO_CLK_DISABLE()

Definition at line 502 of file stm32l496g_discovery.h.

#define IDD_INT_GPIO_CLK_ENABLE ( ) MFX_INT_GPIO_CLK_ENABLE()

Definition at line 501 of file stm32l496g_discovery.h.

#define IDD_INT_GPIO_PORT MFX_INT_GPIO_PORT

Definition at line 500 of file stm32l496g_discovery.h.

#define IDD_INT_PIN MFX_INT_PIN

Definition at line 503 of file stm32l496g_discovery.h.

#define IDD_WAKEUP_GPIO_CLK_DISABLE ( ) MFX_WAKEUP_GPIO_CLK_DISABLE()

Definition at line 507 of file stm32l496g_discovery.h.

#define IDD_WAKEUP_GPIO_CLK_ENABLE ( ) MFX_WAKEUP_GPIO_CLK_ENABLE()

Definition at line 506 of file stm32l496g_discovery.h.

#define IDD_WAKEUP_GPIO_PORT MFX_WAKEUP_GPIO_PORT

Definition at line 505 of file stm32l496g_discovery.h.

#define IDD_WAKEUP_PIN MFX_WAKEUP_PIN

Definition at line 508 of file stm32l496g_discovery.h.

#define IO1_I2C_ADDRESS ((uint16_t) 0x84)

Definition at line 336 of file stm32l496g_discovery.h.

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

#define MFX_INT_EXTI_IRQn EXTI9_5_IRQn

Definition at line 490 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), and MFX_IO_ITConfig().

#define MFX_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOC_CLK_DISABLE()

Definition at line 488 of file stm32l496g_discovery.h.

#define MFX_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOC_CLK_ENABLE()

Definition at line 487 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), and MFX_IO_ITConfig().

#define MFX_INT_GPIO_PORT GPIOC /* GPIOC */

MFX interface pins.

Definition at line 486 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), and MFX_IO_ITConfig().

#define MFX_INT_PIN GPIO_PIN_5 /* PC.05 */

Definition at line 489 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), and MFX_IO_ITConfig().

#define MFX_WAKEUP_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 494 of file stm32l496g_discovery.h.

#define MFX_WAKEUP_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 493 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), and MFX_IO_EnableWakeupPin().

#define MFX_WAKEUP_GPIO_PORT GPIOH /* GPIOH */

Definition at line 492 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), MFX_IO_EnableWakeupPin(), and MFX_IO_Wakeup().

#define MFX_WAKEUP_PIN GPIO_PIN_6 /* PH.06 */

Definition at line 495 of file stm32l496g_discovery.h.

Referenced by MFX_IO_DeInit(), MFX_IO_EnableWakeupPin(), and MFX_IO_Wakeup().

#define TS_I2C_ADDRESS ((uint16_t) 0x70)

Definition at line 338 of file stm32l496g_discovery.h.

Referenced by BSP_TS_InitEx().

#define TS_INT_EXTI_IRQn EXTI15_10_IRQn

Definition at line 523 of file stm32l496g_discovery.h.

Referenced by BSP_TS_INT_MspDeInit(), and BSP_TS_INT_MspInit().

#define TS_INT_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOG_CLK_DISABLE()

Definition at line 522 of file stm32l496g_discovery.h.

#define TS_INT_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOG_CLK_ENABLE()

Definition at line 521 of file stm32l496g_discovery.h.

Referenced by BSP_TS_INT_MspDeInit(), and BSP_TS_INT_MspInit().

#define TS_INT_GPIO_PORT GPIOG

Definition at line 520 of file stm32l496g_discovery.h.

Referenced by BSP_TS_INT_MspDeInit(), and BSP_TS_INT_MspInit().

#define TS_INT_PIN GPIO_PIN_14

TS INT pin.

Definition at line 519 of file stm32l496g_discovery.h.

Referenced by BSP_TS_INT_MspDeInit(), and BSP_TS_INT_MspInit().

#define TS_RST_PIN IO1_PIN_1

TS RST pin.

Definition at line 529 of file stm32l496g_discovery.h.

Referenced by TS_IO_Init().


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY Common

Modules | Functions
STM32L496G-DISCOVERY Common
STM32L496G-DISCOVERY

Modules

Private Types Definitions

This file provides firmware functions to manage Leds, push-buttons, COM ports, SD card on SPI and temperature sensor (TS751) available on STM32L496G-DISCOVERY discoveryuation board from STMicroelectronics.

Private Defines
Private Macros
Exported Variables
Private Functions
Exported Functions
Bus Operations Functions
Exported Types
Exported Constants

Functions

__weak void BSP_ErrorHandler (void)

Function Documentation

__weak void BSP_ErrorHandler ( void )

Definition at line 237 of file stm32l496g_discovery.c.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspInit(), BSP_LCD_ScreenDimmingOff(), BSP_LCD_ScreenDimmingOn(), BSP_LED_Init(), HAL_DFSDM_FilterRegConvCpltCallback(), HAL_DFSDM_FilterRegConvHalfCpltCallback(), I2C2_Error(), I2Cx_Error(), MFX_IO_Init(), SD_Detect_MspDeInit(), SD_Detect_MspInit(), and TS_IO_Init().


STM32L496G-Discovery BSP User Manual: AUDIO_OUT_TypeDef Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
AUDIO_OUT_TypeDef Struct Reference
Private Types

Data Fields

AUDIO_DrvTypeDef * | AudioDrv
uint32_t | OutputDevice
uint32_t | Frequency
uint32_t | Volume
Audio_CallbackTypeDef CbError
Audio_CallbackTypeDef CbHalfTransfer
Audio_CallbackTypeDef CbTransferComplete

Detailed Description

Definition at line 134 of file stm32l496g_discovery_audio.c.

Field Documentation

AUDIO_DrvTypeDef* AUDIO_OUT_TypeDef::AudioDrv

Definition at line 136 of file stm32l496g_discovery_audio.c.

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

Audio_CallbackTypeDef AUDIO_OUT_TypeDef::CbError

Definition at line 140 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_RegisterCallbacks(), and HAL_SAI_ErrorCallback().

Audio_CallbackTypeDef AUDIO_OUT_TypeDef::CbHalfTransfer

Definition at line 141 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_RegisterCallbacks(), and HAL_SAI_TxHalfCpltCallback().

Audio_CallbackTypeDef AUDIO_OUT_TypeDef::CbTransferComplete

Definition at line 142 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_OUT_Init(), BSP_AUDIO_OUT_RegisterCallbacks(), and HAL_SAI_TxCpltCallback().

uint32_t AUDIO_OUT_TypeDef::Frequency

Definition at line 138 of file stm32l496g_discovery_audio.c.

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

uint32_t AUDIO_OUT_TypeDef::OutputDevice

Definition at line 137 of file stm32l496g_discovery_audio.c.

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

uint32_t AUDIO_OUT_TypeDef::Volume

Definition at line 139 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetVolume().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_audio.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: AUDIO_IN_TypeDef Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
AUDIO_IN_TypeDef Struct Reference
Private Types

Data Fields

AUDIO_DrvTypeDef * | AudioDrv
DFSDM_Channel_HandleTypeDef | hDfsdmLeftChannel
DFSDM_Channel_HandleTypeDef | hDfsdmRightChannel
DMA_HandleTypeDef | hDmaDfsdmLeft
DMA_HandleTypeDef | hDmaDfsdmRight
int32_t * | LeftRecBuff
int32_t * | RightRecBuff
uint32_t | InputDevice
uint32_t | Frequency
uint32_t | BitResolution
uint32_t | ChannelNbr
uint16_t * | pRecBuf
uint32_t | RecSize
Audio_CallbackTypeDef CbError
Audio_CallbackTypeDef CbHalfTransfer
Audio_CallbackTypeDef CbTransferComplete

Detailed Description

Definition at line 145 of file stm32l496g_discovery_audio.c.

Field Documentation

AUDIO_DrvTypeDef* AUDIO_IN_TypeDef::AudioDrv

Definition at line 147 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Stop(), and BSP_AUDIO_OUT_DeInit().

uint32_t AUDIO_IN_TypeDef::BitResolution

Definition at line 156 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx().

Audio_CallbackTypeDef AUDIO_IN_TypeDef::CbError

Definition at line 160 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_RegisterCallbacks(), HAL_DFSDM_FilterErrorCallback(), and HAL_SAI_ErrorCallback().

Audio_CallbackTypeDef AUDIO_IN_TypeDef::CbHalfTransfer

Definition at line 161 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_RegisterCallbacks(), HAL_DFSDM_FilterRegConvHalfCpltCallback(), and HAL_SAI_RxHalfCpltCallback().

Audio_CallbackTypeDef AUDIO_IN_TypeDef::CbTransferComplete

Definition at line 162 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_RegisterCallbacks(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_SAI_RxCpltCallback().

uint32_t AUDIO_IN_TypeDef::ChannelNbr

Definition at line 157 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

uint32_t AUDIO_IN_TypeDef::Frequency

Definition at line 155 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_OUT_DeInit(), and BSP_AUDIO_OUT_Init().

DFSDM_Channel_HandleTypeDef AUDIO_IN_TypeDef::hDfsdmLeftChannel

Definition at line 148 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), and AUDIO_DFSDMx_Init().

DFSDM_Channel_HandleTypeDef AUDIO_IN_TypeDef::hDfsdmRightChannel

Definition at line 149 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), and AUDIO_DFSDMx_Init().

DMA_HandleTypeDef AUDIO_IN_TypeDef::hDmaDfsdmLeft

Definition at line 150 of file stm32l496g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterMspDeInit(), and HAL_DFSDM_FilterMspInit().

DMA_HandleTypeDef AUDIO_IN_TypeDef::hDmaDfsdmRight

Definition at line 151 of file stm32l496g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterMspDeInit(), and HAL_DFSDM_FilterMspInit().

uint32_t AUDIO_IN_TypeDef::InputDevice

Definition at line 154 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), BSP_AUDIO_OUT_Init(), HAL_DFSDM_ChannelMspDeInit(), HAL_DFSDM_ChannelMspInit(), HAL_DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

int32_t* AUDIO_IN_TypeDef::LeftRecBuff

Definition at line 152 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

uint16_t* AUDIO_IN_TypeDef::pRecBuf

Definition at line 158 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

uint32_t AUDIO_IN_TypeDef::RecSize

Definition at line 159 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

int32_t* AUDIO_IN_TypeDef::RightRecBuff

Definition at line 153 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_audio.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Constants

Private Constants
STM32L496G-DISCOVERY AUDIO
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Macros

Defines
Private Macros
STM32L496G-DISCOVERY AUDIO

Defines

#define | SAIClockDivider(__FREQUENCY__)
#define | DFSDMOverSampling(__FREQUENCY__)
#define | DFSDMClockDivider(__FREQUENCY__)
#define | DFSDMFilterOrder(__FREQUENCY__)
#define | DFSDMRightBitShift(__FREQUENCY__)
#define | SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Define Documentation

#define DFSDMClockDivider ( __FREQUENCY__ )
Value:
(__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 24 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 4 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 24 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 4 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 24 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 4  \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 32 : 32  \

Definition at line 202 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_Init().

#define DFSDMFilterOrder ( __FREQUENCY__ )
Value:
(__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? DFSDM_FILTER_SINC3_ORDER \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? DFSDM_FILTER_SINC3_ORDER \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? DFSDM_FILTER_SINC3_ORDER \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? DFSDM_FILTER_SINC3_ORDER \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? DFSDM_FILTER_SINC4_ORDER \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? DFSDM_FILTER_SINC3_ORDER  \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? DFSDM_FILTER_SINC4_ORDER : DFSDM_FILTER_SINC5_ORDER  \

Definition at line 211 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_Init().

#define DFSDMOverSampling ( __FREQUENCY__ )
Value:
(__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 256 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 256 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 128 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 128 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 64 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 64  \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 32 : 16  \

Definition at line 193 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_Init().

#define DFSDMRightBitShift ( __FREQUENCY__ )
Value:
(__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 8 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 8 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 6 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 6 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 8 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 2 \
      : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 4 : 4  \

Definition at line 220 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_Init().

#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 183 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_SAIx_Init(), BSP_AUDIO_IN_SetFrequency(), and BSP_AUDIO_OUT_SetFrequency().

#define SaturaLH | ( | N,
 |  | L,
 |  | H
 | ) | (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Definition at line 230 of file stm32l496g_discovery_audio.c.

Referenced by HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G-DISCOVERY AUDIO

Variables

static AUDIO_OUT_TypeDef | hAudioOut = {0}
static AUDIO_IN_TypeDef | hAudioIn = {0}
static DMA_HandleTypeDef | hDmaSaiTx
static DMA_HandleTypeDef | hDmaSaiRx
static uint32_t | DmaLeftRecHalfBuffCplt
static uint32_t | DmaLeftRecBuffCplt
static uint32_t | DmaRightRecHalfBuffCplt
static uint32_t | DmaRightRecBuffCplt

Variable Documentation

uint32_t DmaLeftRecBuffCplt [static]

Definition at line 251 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), and HAL_DFSDM_FilterRegConvCpltCallback().

uint32_t DmaLeftRecHalfBuffCplt [static]

Definition at line 250 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

uint32_t DmaRightRecBuffCplt [static]

Definition at line 253 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), and HAL_DFSDM_FilterRegConvCpltCallback().

uint32_t DmaRightRecHalfBuffCplt [static]

Definition at line 252 of file stm32l496g_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

AUDIO_IN_TypeDef hAudioIn = {0} [static]

Definition at line 244 of file stm32l496g_discovery_audio.c.

AUDIO_OUT_TypeDef hAudioOut = {0} [static]

Definition at line 241 of file stm32l496g_discovery_audio.c.

DMA_HandleTypeDef hDmaSaiRx [static]

Definition at line 248 of file stm32l496g_discovery_audio.c.

Referenced by HAL_SAI_MspDeInit(), and HAL_SAI_MspInit().

DMA_HandleTypeDef hDmaSaiTx [static]

Definition at line 247 of file stm32l496g_discovery_audio.c.

Referenced by HAL_SAI_MspDeInit(), and HAL_SAI_MspInit().


STM32L496G-Discovery BSP User Manual: Exported Variables

Variables
Exported Variables
STM32L496G-DISCOVERY AUDIO

Variables

SAI_HandleTypeDef | BSP_AUDIO_hSai_Tx
SAI_HandleTypeDef | BSP_AUDIO_hSai_Rx
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmLeftFilter
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmRightFilter
SAI_HandleTypeDef | BSP_AUDIO_hSai_Tx
SAI_HandleTypeDef | BSP_AUDIO_hSai_Rx
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmLeftFilter
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmRightFilter

Variable Documentation

DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmLeftFilter

Definition at line 269 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmLeftFilter

Definition at line 269 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmRightFilter

Definition at line 270 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), and BSP_AUDIO_IN_Stop().

DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmRightFilter

Definition at line 270 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), and BSP_AUDIO_IN_Stop().

SAI_HandleTypeDef BSP_AUDIO_hSai_Rx

Definition at line 266 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), and BSP_AUDIO_OUT_SetFrequency().

SAI_HandleTypeDef BSP_AUDIO_hSai_Rx

Definition at line 266 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), and BSP_AUDIO_OUT_SetFrequency().

SAI_HandleTypeDef BSP_AUDIO_hSai_Tx

Definition at line 265 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_OUT_ChangeAudioConfig(), BSP_AUDIO_OUT_ChangeBuffer(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetFrequency(), and BSP_AUDIO_OUT_Stop().

SAI_HandleTypeDef BSP_AUDIO_hSai_Tx

Definition at line 265 of file stm32l496g_discovery_audio.c.

Referenced by AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_OUT_ChangeAudioConfig(), BSP_AUDIO_OUT_ChangeBuffer(), BSP_AUDIO_OUT_Pause(), BSP_AUDIO_OUT_Play(), BSP_AUDIO_OUT_Resume(), BSP_AUDIO_OUT_SetFrequency(), and BSP_AUDIO_OUT_Stop().


STM32L496G-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32L496G-DISCOVERY AUDIO

Functions

static uint8_t | AUDIO_SAIx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static uint8_t | AUDIO_SAIx_DeInit (void)
De-initializes the Audio Codec audio interface (SAI).
static uint8_t | AUDIO_DFSDMx_Init (uint32_t AudioFreq)
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
static uint8_t | AUDIO_DFSDMx_DeInit (void)
De-initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
static uint8_t | AUDIO_SAIPLLConfig (uint32_t Frequency)
Configures the SAI PLL clock according to the required audio frequency.
void | HAL_SAI_MspInit (SAI_HandleTypeDef *hsai)
SAI MSP Init.
void | HAL_SAI_MspDeInit (SAI_HandleTypeDef *hsai)
SAI MSP De-init.
void | HAL_DFSDM_ChannelMspInit (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Initializes the DFSDM channel MSP.
void | HAL_DFSDM_ChannelMspDeInit (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
De-initializes the DFSDM channel MSP.
void | HAL_DFSDM_FilterMspInit (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Initializes the DFSDM filter MSP.
void | HAL_DFSDM_FilterMspDeInit (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
De-initializes the DFSDM filter MSP.

Function Documentation

static uint8_t AUDIO_DFSDMx_DeInit ( void ) [static]

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

Return values:
BSP AUDIO status

Definition at line 1832 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, AUDIO_IN_TypeDef::hDfsdmLeftChannel, AUDIO_IN_TypeDef::hDfsdmRightChannel, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_IN_SetFrequency().

static uint8_t AUDIO_DFSDMx_Init ( uint32_t AudioFreq ) [static]

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

Parameters:
AudioFreq,: Audio frequency to be used to set correctly the DFSDM peripheral.
Return values:
BSP AUDIO status

Definition at line 1700 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, DFSDMClockDivider, DFSDMFilterOrder, DFSDMOverSampling, DFSDMRightBitShift, AUDIO_IN_TypeDef::hDfsdmLeftChannel, AUDIO_IN_TypeDef::hDfsdmRightChannel, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_IN_SetFrequency().

static uint8_t AUDIO_SAIPLLConfig ( uint32_t Frequency ) [static]

Configures the SAI PLL clock according to the required audio frequency.

Parameters:
Frequency,: Audio frequency.
Return values:
BSP AUDIO status
Note:
The SAI PLL input clock must be configured in the user application. The SAI PLL configuration done within this function assumes that the SAI PLL input clock runs at 8 MHz.

Definition at line 2036 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, and AUDIO_OK.

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

static uint8_t AUDIO_SAIx_DeInit ( void ) [static]

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

Return values:
BSP AUDIO status

Definition at line 1543 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hSai_Rx, and BSP_AUDIO_hSai_Tx.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_OUT_DeInit().

static uint8_t AUDIO_SAIx_Init ( uint32_t AudioFreq ) [static]

Initializes the Audio Codec audio interface (SAI).

Parameters:
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
Return values:
BSP AUDIO status

Definition at line 1414 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hSai_Rx, BSP_AUDIO_hSai_Tx, and SAIClockDivider.

Referenced by BSP_AUDIO_IN_InitEx(), and BSP_AUDIO_OUT_Init().

void HAL_DFSDM_ChannelMspDeInit ( DFSDM_Channel_HandleTypeDef * hdfsdm_channel )

De-initializes the DFSDM channel MSP.

Parameters:
hdfsdm_channel : DFSDM channel handle.
Return values:
None

Definition at line 1915 of file stm32l496g_discovery_audio.c.

References INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

void HAL_DFSDM_ChannelMspInit ( DFSDM_Channel_HandleTypeDef * hdfsdm_channel )

Initializes the DFSDM channel MSP.

Parameters:
hdfsdm_channel : DFSDM channel handle.
Return values:
None

Definition at line 1878 of file stm32l496g_discovery_audio.c.

References INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

void HAL_DFSDM_FilterMspDeInit ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

De-initializes the DFSDM filter MSP.

Parameters:
hdfsdm_filter : DFSDM filter handle.
Return values:
None

Definition at line 2008 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::hDmaDfsdmLeft, and AUDIO_IN_TypeDef::hDmaDfsdmRight.

void HAL_DFSDM_FilterMspInit ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Initializes the DFSDM filter MSP.

Parameters:
hdfsdm_filter : DFSDM filter handle.
Return values:
None

Definition at line 1938 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::hDmaDfsdmLeft, AUDIO_IN_TypeDef::hDmaDfsdmRight, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

void HAL_SAI_MspDeInit ( SAI_HandleTypeDef * hsai )

SAI MSP De-init.

Parameters:
hsai : pointer to a SAI_HandleTypeDef structure
Return values:
None

Definition at line 1652 of file stm32l496g_discovery_audio.c.

References hDmaSaiRx, and hDmaSaiTx.

void HAL_SAI_MspInit ( SAI_HandleTypeDef * hsai )

SAI MSP Init.

Parameters:
hsai : pointer to a SAI_HandleTypeDef structure
Return values:
None

Definition at line 1567 of file stm32l496g_discovery_audio.c.

References hDmaSaiRx, and hDmaSaiTx.


STM32L496G-Discovery BSP User Manual: Exported Types

Typedefs
Exported Types
STM32L496G-DISCOVERY AUDIO

Typedefs

typedef void(* Audio_CallbackTypeDef )(void)

Typedef Documentation

typedef void(* Audio_CallbackTypeDef)(void)

Definition at line 54 of file stm32l496g_discovery_audio.h.


STM32L496G-Discovery BSP User Manual: BSP Audio Out Option

Defines
BSP Audio Out Option
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 66 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_ChangeAudioConfig().

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

Definition at line 69 of file stm32l496g_discovery_audio.h.

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

Definition at line 67 of file stm32l496g_discovery_audio.h.

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

Definition at line 68 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_ChangeAudioConfig().


STM32L496G-Discovery BSP User Manual: BSP Audio Sample Rate

Defines
BSP Audio Sample Rate
Exported Constants

Defines

#define | BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K
#define | BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K
#define | BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K
#define | BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K
#define | BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K
#define | BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K
#define | BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K
#define | BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K

Define Documentation

#define BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K

Definition at line 83 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K

Definition at line 82 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K

Definition at line 81 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K

Definition at line 80 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K

Definition at line 79 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K

Definition at line 78 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K

Definition at line 84 of file stm32l496g_discovery_audio.h.

#define BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K

Definition at line 77 of file stm32l496g_discovery_audio.h.


STM32L496G-Discovery BSP User Manual: Exported Constants

Modules | Defines
Exported Constants
STM32L496G-DISCOVERY AUDIO

Modules

BSP Audio Out Option
BSP Audio Sample Rate

Defines

#define | AUDIO_SAIx_TX_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_SAIx_TX_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF GPIO_AF13_SAI1
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_SAIx_TX_FS_PIN GPIO_PIN_4
#define | AUDIO_SAIx_TX_SCK_PIN GPIO_PIN_5
#define | AUDIO_SAIx_TX_SD_PIN GPIO_PIN_6
#define | AUDIO_SAIx_TX_MCK_PIN GPIO_PIN_2
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_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_CHANNEL DMA2_Channel1
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Channel1_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 (uint32_t)0xFFFF
#define | AUDIO_SAIx_DMAx_IRQHandler DMA2_Channel1_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_SAIx_PLL_DISABLE() HAL_RCCEx_DisablePLLSAI2()
#define | AUDIO_DFSDMx_LEFT_CHANNEL DFSDM1_Channel2
#define | AUDIO_DFSDMx_LEFT_FILTER DFSDM1_Filter0
#define | AUDIO_DFSDMx_CLK_ENABLE() __HAL_RCC_DFSDM1_CLK_ENABLE()
#define | AUDIO_DFSDMx_CLK_DISABLE() __HAL_RCC_DFSDM1_CLK_DISABLE()
#define | AUDIO_DFSDMx_CKOUT_PIN GPIO_PIN_9
#define | AUDIO_DFSDMx_DMIC_DATIN_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF GPIO_AF6_DFSDM1
#define | AUDIO_DFSDMx_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | AUDIO_DFSDMx_DMAx_CLK_DISABLE() __HAL_RCC_DMA1_CLK_DISABLE()
#define | AUDIO_DFSDMx_DMAx_LEFT_CHANNEL DMA1_Channel4
#define | AUDIO_DFSDMx_DMAx_LEFT_IRQ DMA1_Channel4_IRQn
#define | AUDIO_DFSDM_DMAx_LEFT_IRQHandler DMA1_Channel4_IRQHandler
#define | AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL DMA1_Channel5
#define | AUDIO_DFSDMx_DMAx_RIGHT_IRQ DMA1_Channel5_IRQn
#define | AUDIO_DFSDM_DMAx_RIGHT_IRQHandler DMA1_Channel5_IRQHandler
#define | AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD
#define | AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD
#define | AUDIO_IN_IRQ_PREPRIO 6 /* Select the preemption priority level(0 is the highest) */
#define | AUDIODATA_SIZE 2 /* 16-bits audio data size */
#define | AUDIO_OK 0
#define | AUDIO_ERROR 1
#define | AUDIO_TIMEOUT 2
#define | DEFAULT_AUDIO_OUT_FREQ BSP_AUDIO_FREQUENCY_48K
#define | DEFAULT_AUDIO_OUT_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_OUT_CHANNEL_NBR ((uint8_t)2) /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_OUT_VOLUME ((uint16_t)80)
#define | DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION 16
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR 1 /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_IN_VOLUME 80
#define | CODEC_RESET_DELAY 5
#define | INPUT_DEVICE_DIGITAL_MIC1 0x20 /* Left microphone */
#define | INPUT_DEVICE_DIGITAL_MIC2 0x40 /* Right microphone */
#define | INPUT_DEVICE_DIGITAL_MIC (INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2)
#define | INPUT_DEVICE_ANALOG_MIC INPUT_DEVICE_MIC1

Define Documentation

#define AUDIO_DFSDM_DMAx_LEFT_IRQHandler DMA1_Channel4_IRQHandler

Definition at line 141 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDM_DMAx_RIGHT_IRQHandler DMA1_Channel5_IRQHandler

Definition at line 144 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF GPIO_AF6_DFSDM1

Definition at line 134 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOE_CLK_DISABLE()

Definition at line 133 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 132 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT GPIOE

Definition at line 131 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CKOUT_PIN GPIO_PIN_9

Definition at line 129 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CLK_DISABLE ( ) __HAL_RCC_DFSDM1_CLK_DISABLE()

Definition at line 128 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_CLK_ENABLE ( ) __HAL_RCC_DFSDM1_CLK_ENABLE()

Definition at line 127 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_CLK_DISABLE ( ) __HAL_RCC_DMA1_CLK_DISABLE()

Definition at line 138 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA1_CLK_ENABLE()

Definition at line 137 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_LEFT_CHANNEL DMA1_Channel4

Definition at line 139 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_LEFT_IRQ DMA1_Channel4_IRQn

Definition at line 140 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD

Definition at line 146 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD

Definition at line 145 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL DMA1_Channel5

Definition at line 142 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMAx_RIGHT_IRQ DMA1_Channel5_IRQn

Definition at line 143 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_DMIC_DATIN_PIN GPIO_PIN_7

Definition at line 130 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_LEFT_CHANNEL DFSDM1_Channel2

Definition at line 125 of file stm32l496g_discovery_audio.h.

#define AUDIO_DFSDMx_LEFT_FILTER DFSDM1_Filter0

Definition at line 126 of file stm32l496g_discovery_audio.h.

#define AUDIO_ERROR 1

Definition at line 160 of file stm32l496g_discovery_audio.h.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), AUDIO_SAIPLLConfig(), AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), 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_SetFrequency(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

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

Definition at line 150 of file stm32l496g_discovery_audio.h.

#define AUDIO_OK 0

Definition at line 159 of file stm32l496g_discovery_audio.h.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), AUDIO_SAIPLLConfig(), AUDIO_SAIx_DeInit(), AUDIO_SAIx_Init(), BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), 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_SetFrequency(), BSP_AUDIO_OUT_SetMute(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetVolume(), and BSP_AUDIO_OUT_Stop().

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

Definition at line 116 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_CHANNEL DMA2_Channel1

Definition at line 107 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_CLK_DISABLE ( ) __HAL_RCC_DMA2_CLK_DISABLE()

Definition at line 106 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_CLK_ENABLE ( ) __HAL_RCC_DMA2_CLK_ENABLE()

Definition at line 105 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_IRQ DMA2_Channel1_IRQn

Definition at line 108 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_IRQHandler DMA2_Channel1_IRQHandler

Definition at line 113 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD

Definition at line 110 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD

Definition at line 109 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_PLL_DISABLE ( ) HAL_RCCEx_DisablePLLSAI2()

Definition at line 119 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), and BSP_AUDIO_OUT_DeInit().

#define AUDIO_SAIx_TX_CLK_DISABLE ( ) __HAL_RCC_SAI1_CLK_DISABLE()

Definition at line 93 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_CLK_ENABLE ( ) __HAL_RCC_SAI1_CLK_ENABLE()

Definition at line 92 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_FS_PIN GPIO_PIN_4

Definition at line 98 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_MCK_PIN GPIO_PIN_2

Definition at line 101 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF GPIO_AF13_SAI1

Definition at line 94 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE ( ) __HAL_RCC_GPIOE_CLK_DISABLE()

Definition at line 97 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE ( ) __HAL_RCC_GPIOE_CLK_ENABLE()

Definition at line 96 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_MCK_SCK_SD_FS_GPIO_PORT GPIOE

Definition at line 102 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_SCK_PIN GPIO_PIN_5

Definition at line 99 of file stm32l496g_discovery_audio.h.

#define AUDIO_SAIx_TX_SD_PIN GPIO_PIN_6

Definition at line 100 of file stm32l496g_discovery_audio.h.

#define AUDIO_TIMEOUT 2

Definition at line 161 of file stm32l496g_discovery_audio.h.

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

Definition at line 156 of file stm32l496g_discovery_audio.h.

#define CODEC_RESET_DELAY 5

Definition at line 180 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_BIT_RESOLUTION 16

Definition at line 171 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_CHANNEL_NBR 1 /* Mono = 1, Stereo = 2 */

Definition at line 172 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K

Definition at line 170 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_IN_VOLUME 80

Definition at line 173 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_OUT_BIT_RESOLUTION ((uint8_t)16)

Definition at line 165 of file stm32l496g_discovery_audio.h.

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

Definition at line 166 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_OUT_FREQ BSP_AUDIO_FREQUENCY_48K

Definition at line 164 of file stm32l496g_discovery_audio.h.

#define DEFAULT_AUDIO_OUT_VOLUME ((uint16_t)80)

Definition at line 167 of file stm32l496g_discovery_audio.h.

#define DMA_MAX_SZE (uint32_t)0xFFFF

Definition at line 111 of file stm32l496g_discovery_audio.h.

#define INPUT_DEVICE_ANALOG_MIC INPUT_DEVICE_MIC1

Definition at line 190 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_DeInit(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_SetFrequency(), BSP_AUDIO_IN_Stop(), BSP_AUDIO_OUT_DeInit(), and BSP_AUDIO_OUT_Init().

#define INPUT_DEVICE_DIGITAL_MIC (INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2)

Definition at line 188 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_IN_Init(), BSP_AUDIO_IN_InitEx(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

#define INPUT_DEVICE_DIGITAL_MIC1 0x20 /* Left microphone */

Definition at line 186 of file stm32l496g_discovery_audio.h.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_ChannelMspDeInit(), HAL_DFSDM_ChannelMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().

#define INPUT_DEVICE_DIGITAL_MIC2 0x40 /* Right microphone */

Definition at line 187 of file stm32l496g_discovery_audio.h.

Referenced by AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), BSP_AUDIO_IN_InitEx(), BSP_AUDIO_IN_Pause(), BSP_AUDIO_IN_Record(), BSP_AUDIO_IN_Resume(), BSP_AUDIO_IN_Stop(), HAL_DFSDM_ChannelMspDeInit(), HAL_DFSDM_ChannelMspInit(), HAL_DFSDM_FilterMspInit(), HAL_DFSDM_FilterRegConvCpltCallback(), and HAL_DFSDM_FilterRegConvHalfCpltCallback().


STM32L496G-Discovery BSP User Manual: Exported Macros

Defines
Exported Macros
STM32L496G-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 211 of file stm32l496g_discovery_audio.h.

Referenced by BSP_AUDIO_OUT_Play().


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G-DISCOVERY AUDIO

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_DeInit (void)
De-Initializes audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pData, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
uint8_t | 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).
uint8_t | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption)
Changes the Audio Out Configuration.
void | BSP_AUDIO_OUT_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes micropone related peripherals.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_DeInit (void)
De-Initializes microphone related peripherals.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
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.
void | BSP_AUDIO_IN_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions

Function Documentation

uint8_t BSP_AUDIO_IN_DeInit ( void )

De-Initializes microphone related peripherals.

Return values:
BSP AUDIO status

Definition at line 868 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_DeInit(), AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIx_DeInit(), AUDIO_SAIx_PLL_DISABLE, AUDIO_OUT_TypeDef::AudioDrv, AUDIO_IN_TypeDef::AudioDrv, AUDIO_OUT_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, AUDIO_OUT_TypeDef::OutputDevice, and AUDIO_OUT_TypeDef::Volume.

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

Initializes micropone related peripherals.

Note:
This function assumes that the SAI input clock (through PLL_M) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
BitRes,: Audio frequency to be configured for the SAI peripheral.
ChnlNbr,: Audio frequency to be configured for the SAI peripheral.
Return values:
BSP AUDIO status

Definition at line 768 of file stm32l496g_discovery_audio.c.

References BSP_AUDIO_IN_InitEx(), and INPUT_DEVICE_DIGITAL_MIC.

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

Initialize wave recording.

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

Definition at line 782 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIPLLConfig(), AUDIO_SAIx_Init(), AUDIO_IN_TypeDef::AudioDrv, AUDIO_IN_TypeDef::BitResolution, AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, AUDIO_IN_TypeDef::CbTransferComplete, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecBuffCplt, DmaLeftRecHalfBuffCplt, DmaRightRecBuffCplt, DmaRightRecHalfBuffCplt, AUDIO_OUT_TypeDef::Frequency, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_OUT_TypeDef::OutputDevice, and AUDIO_OUT_TypeDef::Volume.

Referenced by BSP_AUDIO_IN_Init().

uint8_t BSP_AUDIO_IN_Pause ( void )

Pauses the audio file stream.

Return values:
BSP AUDIO status

Definition at line 1309 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

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
Note:
The Right channel is start at first with synchro on start of Left channel
Return values:
BSP AUDIO status

Definition at line 928 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_IN_TypeDef::AudioDrv, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, AUDIO_IN_TypeDef::ChannelNbr, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.

void BSP_AUDIO_IN_RegisterCallbacks | ( | Audio_CallbackTypeDef | ErrorCallback,
 |  | Audio_CallbackTypeDef | HalfTransferCallback,
 |  | Audio_CallbackTypeDef | TransferCompleteCallback
 | ) |  |

register user callback functions

Parameters:
ErrorCallback,: pointer to the error callback function
HalfTransferCallback,: pointer to the half transfer callback function
TransferCompleteCallback,: pointer to the transfer complete callback function
Return values:
None

Definition at line 1393 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, and AUDIO_IN_TypeDef::CbTransferComplete.

uint8_t BSP_AUDIO_IN_Resume ( void )

Resumes the audio file stream.

Return values:
BSP AUDIO status

Definition at line 1347 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, AUDIO_IN_TypeDef::ChannelNbr, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.

uint8_t BSP_AUDIO_IN_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: Audio frequency used to record the audio stream.
Note:
This API should be called after the BSP_AUDIO_IN_Init() to adjust the audio frequency.
Return values:
BSP AUDIO status

Definition at line 1012 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_OK, AUDIO_SAIPLLConfig(), BSP_AUDIO_hSai_Rx, BSP_AUDIO_hSai_Tx, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, and SAIClockDivider.

uint8_t BSP_AUDIO_IN_Stop ( void )

Stops audio recording.

Return values:
BSP AUDIO status

Definition at line 1243 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_IN_TypeDef::AudioDrv, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, and AUDIO_IN_TypeDef::RightRecBuff.

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

Definition at line 629 of file stm32l496g_discovery_audio.c.

References BSP_AUDIO_hSai_Tx, BSP_AUDIO_OUT_CIRCULARMODE, and BSP_AUDIO_OUT_STEREOMODE.

uint8_t 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
Return values:
BSP AUDIO status

Definition at line 432 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, and BSP_AUDIO_hSai_Tx.

uint8_t BSP_AUDIO_OUT_DeInit ( void )

De-Initializes audio codec related peripherals.

Return values:
BSP AUDIO status

Definition at line 363 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIx_DeInit(), AUDIO_SAIx_PLL_DISABLE, AUDIO_OUT_TypeDef::AudioDrv, AUDIO_IN_TypeDef::AudioDrv, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, and AUDIO_OUT_TypeDef::Volume.

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

Configures the audio codec related peripherals.

Parameters:
OutputDevice,: OUTPUT_DEVICE_HEADPHONE.
Volume,: Initial volume level (from 0 (Mute) to 100 (Max))
AudioFreq,: Audio frequency used to play the audio stream.
Return values:
BSP AUDIO status
Note:
The SAI PLL input clock must be configure in the user application. The SAI PLL configuration done within this function assumes that the SAI PLL input clock runs at 8 MHz.

Definition at line 303 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIPLLConfig(), AUDIO_SAIx_Init(), AUDIO_OUT_TypeDef::AudioDrv, AUDIO_OUT_TypeDef::CbError, AUDIO_OUT_TypeDef::CbHalfTransfer, AUDIO_OUT_TypeDef::CbTransferComplete, AUDIO_OUT_TypeDef::Frequency, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, AUDIO_OUT_TypeDef::OutputDevice, and AUDIO_OUT_TypeDef::Volume.

uint8_t BSP_AUDIO_OUT_Pause ( void )

This function Pauses the audio file stream.

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

Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values:
BSP AUDIO status

Definition at line 452 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai_Tx.

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

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

Parameters:
pData,: pointer on PCM samples buffer
Size,: Number of audio data HALF WORD.
Return values:
BSP AUDIO status

Definition at line 409 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, BSP_AUDIO_hSai_Tx, and DMA_MAX.

void BSP_AUDIO_OUT_RegisterCallbacks | ( | Audio_CallbackTypeDef | ErrorCallback,
 |  | Audio_CallbackTypeDef | HalfTransferCallback,
 |  | Audio_CallbackTypeDef | TransferCompleteCallback
 | ) |  |

register user callback functions

Parameters:
ErrorCallback,: pointer to the error callback function
HalfTransferCallback,: pointer to the half transfer callback function
TransferCompleteCallback,: pointer to the transfer complete callback function
Return values:
None

Definition at line 695 of file stm32l496g_discovery_audio.c.

References AUDIO_OUT_TypeDef::CbError, AUDIO_OUT_TypeDef::CbHalfTransfer, and AUDIO_OUT_TypeDef::CbTransferComplete.

uint8_t BSP_AUDIO_OUT_Resume ( void )

This function Resumes the audio file stream.

Note:
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values:
BSP AUDIO status

Definition at line 477 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai_Tx.

uint8_t BSP_AUDIO_OUT_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: Audio frequency used to play the audio stream.
Note:
The SAI PLL input clock must be configure in the user application. The SAI PLL configuration done within this function assumes that the SAI PLL input clock runs at 8 MHz.
Return values:
BSP AUDIO status

Definition at line 588 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, AUDIO_SAIPLLConfig(), BSP_AUDIO_hSai_Rx, BSP_AUDIO_hSai_Tx, AUDIO_OUT_TypeDef::Frequency, and SAIClockDivider.

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:
BSP AUDIO status

Definition at line 551 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AUDIO_OUT_TypeDef::AudioDrv.

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:
BSP AUDIO status

Definition at line 569 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AUDIO_OUT_TypeDef::AudioDrv.

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:
BSP AUDIO status

Definition at line 532 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and AUDIO_OUT_TypeDef::Volume.

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:
BSP AUDIO status

Definition at line 503 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai_Tx.

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef * hsai )

SAI error callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 737 of file stm32l496g_discovery_audio.c.

References AUDIO_OUT_TypeDef::CbError, and AUDIO_IN_TypeDef::CbError.

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 709 of file stm32l496g_discovery_audio.c.

References AUDIO_OUT_TypeDef::CbTransferComplete.

void HAL_SAI_TxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

Tx Half Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 723 of file stm32l496g_discovery_audio.c.

References AUDIO_OUT_TypeDef::CbHalfTransfer.


STM32L496G-Discovery BSP User Manual: STM32L496G_EVAL_AUDIO_Exported_Functions

Functions
STM32L496G_EVAL_AUDIO_Exported_Functions
STM32L496G-DISCOVERY AUDIO

Functions

uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes micropone related peripherals.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_DeInit (void)
De-Initializes microphone related peripherals.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | HAL_DFSDM_FilterRegConvCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
void | HAL_DFSDM_FilterRegConvHalfCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
void | HAL_DFSDM_FilterErrorCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Error callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
SAI Rx Transfer completed callbacks.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
SAI Rx Half Transfer completed callbacks.
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.
void | BSP_AUDIO_IN_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions

Function Documentation

uint8_t BSP_AUDIO_IN_DeInit ( void )

De-Initializes microphone related peripherals.

Return values:
BSP AUDIO status

Definition at line 868 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_DeInit(), AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIx_DeInit(), AUDIO_SAIx_PLL_DISABLE, AUDIO_OUT_TypeDef::AudioDrv, AUDIO_IN_TypeDef::AudioDrv, AUDIO_OUT_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, AUDIO_OUT_TypeDef::OutputDevice, and AUDIO_OUT_TypeDef::Volume.

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

Initializes micropone related peripherals.

Note:
This function assumes that the SAI input clock (through PLL_M) is already configured and ready to be used.
Parameters:
AudioFreq,: Audio frequency to be configured for the SAI peripheral.
BitRes,: Audio frequency to be configured for the SAI peripheral.
ChnlNbr,: Audio frequency to be configured for the SAI peripheral.
Return values:
BSP AUDIO status

Definition at line 768 of file stm32l496g_discovery_audio.c.

References BSP_AUDIO_IN_InitEx(), and INPUT_DEVICE_DIGITAL_MIC.

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

Initialize wave recording.

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

Definition at line 782 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIPLLConfig(), AUDIO_SAIx_Init(), AUDIO_IN_TypeDef::AudioDrv, AUDIO_IN_TypeDef::BitResolution, AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, AUDIO_IN_TypeDef::CbTransferComplete, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecBuffCplt, DmaLeftRecHalfBuffCplt, DmaRightRecBuffCplt, DmaRightRecHalfBuffCplt, AUDIO_OUT_TypeDef::Frequency, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_OUT_TypeDef::OutputDevice, and AUDIO_OUT_TypeDef::Volume.

Referenced by BSP_AUDIO_IN_Init().

uint8_t BSP_AUDIO_IN_Pause ( void )

Pauses the audio file stream.

Return values:
BSP AUDIO status

Definition at line 1309 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, and AUDIO_IN_TypeDef::InputDevice.

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
Note:
The Right channel is start at first with synchro on start of Left channel
Return values:
BSP AUDIO status

Definition at line 928 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_IN_TypeDef::AudioDrv, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, AUDIO_IN_TypeDef::ChannelNbr, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.

void BSP_AUDIO_IN_RegisterCallbacks | ( | Audio_CallbackTypeDef | ErrorCallback,
 |  | Audio_CallbackTypeDef | HalfTransferCallback,
 |  | Audio_CallbackTypeDef | TransferCompleteCallback
 | ) |  |

register user callback functions

Parameters:
ErrorCallback,: pointer to the error callback function
HalfTransferCallback,: pointer to the half transfer callback function
TransferCompleteCallback,: pointer to the transfer complete callback function
Return values:
None

Definition at line 1393 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, and AUDIO_IN_TypeDef::CbTransferComplete.

uint8_t BSP_AUDIO_IN_Resume ( void )

Resumes the audio file stream.

Return values:
BSP AUDIO status

Definition at line 1347 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, AUDIO_IN_TypeDef::ChannelNbr, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.

uint8_t BSP_AUDIO_IN_SetFrequency ( uint32_t AudioFreq )

Updates the audio frequency.

Parameters:
AudioFreq,: Audio frequency used to record the audio stream.
Note:
This API should be called after the BSP_AUDIO_IN_Init() to adjust the audio frequency.
Return values:
BSP AUDIO status

Definition at line 1012 of file stm32l496g_discovery_audio.c.

References AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_OK, AUDIO_SAIPLLConfig(), BSP_AUDIO_hSai_Rx, BSP_AUDIO_hSai_Tx, AUDIO_IN_TypeDef::Frequency, INPUT_DEVICE_ANALOG_MIC, AUDIO_IN_TypeDef::InputDevice, and SAIClockDivider.

uint8_t BSP_AUDIO_IN_Stop ( void )

Stops audio recording.

Return values:
BSP AUDIO status

Definition at line 1243 of file stm32l496g_discovery_audio.c.

References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_IN_TypeDef::AudioDrv, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, BSP_AUDIO_hSai_Rx, INPUT_DEVICE_ANALOG_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, and AUDIO_IN_TypeDef::RightRecBuff.

void HAL_DFSDM_FilterErrorCallback ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Error callback.

Parameters:
hdfsdm_filter : DFSDM filter handle.
Return values:
None

Definition at line 1202 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::CbError.

void HAL_DFSDM_FilterRegConvCpltCallback ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Regular conversion complete callback.

Note:
In interrupt mode, user has to read conversion value in this function using HAL_DFSDM_FilterGetRegularValue.
Parameters:
hdfsdm_filter : DFSDM filter handle.
Return values:
None

Definition at line 1070 of file stm32l496g_discovery_audio.c.

References BSP_AUDIO_hDfsdmLeftFilter, BSP_ErrorHandler(), AUDIO_IN_TypeDef::CbTransferComplete, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecBuffCplt, DmaRightRecBuffCplt, INPUT_DEVICE_DIGITAL_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, AUDIO_IN_TypeDef::RightRecBuff, and SaturaLH.

void HAL_DFSDM_FilterRegConvHalfCpltCallback ( DFSDM_Filter_HandleTypeDef * hdfsdm_filter )

Half regular conversion complete callback.

Parameters:
hdfsdm_filter : DFSDM filter handle.
Return values:
None

Definition at line 1136 of file stm32l496g_discovery_audio.c.

References BSP_AUDIO_hDfsdmLeftFilter, BSP_ErrorHandler(), AUDIO_IN_TypeDef::CbHalfTransfer, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecHalfBuffCplt, DmaRightRecHalfBuffCplt, INPUT_DEVICE_DIGITAL_MIC, INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2, AUDIO_IN_TypeDef::InputDevice, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, AUDIO_IN_TypeDef::RightRecBuff, and SaturaLH.

void HAL_SAI_RxCpltCallback ( SAI_HandleTypeDef * hsai )

SAI Rx Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 1216 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::CbTransferComplete.

void HAL_SAI_RxHalfCpltCallback ( SAI_HandleTypeDef * hsai )

SAI Rx Half Transfer completed callbacks.

Parameters:
hsai,: SAI handle
Return values:
None

Definition at line 1230 of file stm32l496g_discovery_audio.c.

References AUDIO_IN_TypeDef::CbHalfTransfer.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Defines

Private Defines
STM32L496G-DISCOVERY IDD
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G-DISCOVERY IDD

Variables

static IDD_DrvTypeDef * IddDrv

Variable Documentation

IDD_DrvTypeDef* IddDrv [static]

Definition at line 52 of file stm32l496g_discovery_idd.c.

Referenced by BSP_IDD_ClearIT(), BSP_IDD_Config(), BSP_IDD_DeInit(), BSP_IDD_DisableIT(), BSP_IDD_EnableIT(), BSP_IDD_ErrorClearIT(), BSP_IDD_ErrorDisableIT(), BSP_IDD_ErrorEnableIT(), BSP_IDD_ErrorGetCode(), BSP_IDD_ErrorGetITStatus(), BSP_IDD_GetITStatus(), BSP_IDD_GetValue(), BSP_IDD_Init(), BSP_IDD_LowPower(), BSP_IDD_Reset(), BSP_IDD_StartMeasure(), and BSP_IDD_WakeUp().


STM32L496G-Discovery BSP User Manual: Private Functions

Private Functions
STM32L496G-DISCOVERY IDD
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G-DISCOVERY IDD

Functions

uint8_t | BSP_IDD_Init (void)
Configures IDD measurement component.
void | BSP_IDD_DeInit (void)
Unconfigures IDD measurement component.
void | BSP_IDD_Reset (void)
Reset Idd measurement component.
void | BSP_IDD_LowPower (void)
Turn Idd measurement component in low power (standby/sleep) mode.
void | BSP_IDD_StartMeasure (void)
Start Measurement campaign.
void | BSP_IDD_Config (IDD_ConfigTypeDef IddConfig)
Configure Idd component.
void | BSP_IDD_GetValue (uint32_t *IddValue)
Get Idd current value.
void | BSP_IDD_EnableIT (void)
Enable Idd interrupt that warn end of measurement.
void | BSP_IDD_ClearIT (void)
Clear Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_GetITStatus (void)
Get Idd interrupt status.
void | BSP_IDD_DisableIT (void)
Disable Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetCode (void)
Get Error Code .
void | BSP_IDD_ErrorEnableIT (void)
Enable error interrupt that warn end of measurement.
void | BSP_IDD_ErrorClearIT (void)
Clear Error interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetITStatus (void)
Get Error interrupt status.
void | BSP_IDD_ErrorDisableIT (void)
Disable Error interrupt.
void | BSP_IDD_WakeUp (void)
Wake up Idd measurement component.

Function Documentation

void BSP_IDD_ClearIT ( void )

Clear Idd interrupt that warn end of measurement.

Return values:
None

Definition at line 231 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_Config ( IDD_ConfigTypeDef IddConfig )

Configure Idd component.

Parameters:
IddConfig,: structure of idd parameters
Return values:
None

Definition at line 190 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

Referenced by BSP_IDD_Init().

void BSP_IDD_DeInit ( void )

Unconfigures IDD measurement component.

Return values:
IDD_OK if no problem during deinitialization

Definition at line 136 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_DisableIT ( void )

Disable Idd interrupt that warn end of measurement.

Return values:
None

Definition at line 259 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_EnableIT ( void )

Enable Idd interrupt that warn end of measurement.

Return values:
None

Definition at line 219 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_ErrorClearIT ( void )

Clear Error interrupt that warn end of measurement.

Return values:
None

Definition at line 314 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_ErrorDisableIT ( void )

Disable Error interrupt.

Return values:
None

Definition at line 342 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_ErrorEnableIT ( void )

Enable error interrupt that warn end of measurement.

Return values:
None

Definition at line 302 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

uint8_t BSP_IDD_ErrorGetCode ( void )

Get Error Code .

Return values:
Error code or error status

Definition at line 271 of file stm32l496g_discovery_idd.c.

References IDD_ERROR, IDD_I2C_ADDRESS, and IddDrv.

uint8_t BSP_IDD_ErrorGetITStatus ( void )

Get Error interrupt status.

Return values:
Status

Definition at line 326 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

uint8_t BSP_IDD_GetITStatus ( void )

Get Idd interrupt status.

Return values:
status

Definition at line 243 of file stm32l496g_discovery_idd.c.

References IDD_ERROR, IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_GetValue ( uint32_t * IddValue )

Get Idd current value.

Parameters:
IddValue,: Pointer on u32 to store Idd. Value unit is 10 nA.
Return values:
None

Definition at line 203 of file stm32l496g_discovery_idd.c.

References BSP_IO_ConfigPin(), BSP_IO_WritePin(), IDD_AMP_CONTROL_PIN, IDD_I2C_ADDRESS, and IddDrv.

uint8_t BSP_IDD_Init ( void )

Configures IDD measurement component.

Return values:
IDD_OK if no problem during initialization

Definition at line 74 of file stm32l496g_discovery_idd.c.

References BSP_IDD_Config(), DISCOVERY_IDD_AMPLI_GAIN, DISCOVERY_IDD_SHUNT0_STABDELAY, DISCOVERY_IDD_SHUNT0_VALUE, DISCOVERY_IDD_SHUNT1_STABDELAY, DISCOVERY_IDD_SHUNT1_VALUE, DISCOVERY_IDD_SHUNT2_STABDELAY, DISCOVERY_IDD_SHUNT2_VALUE, DISCOVERY_IDD_SHUNT4_STABDELAY, DISCOVERY_IDD_SHUNT4_VALUE, DISCOVERY_IDD_VDD_MIN, IDD_ERROR, IDD_I2C_ADDRESS, IDD_OK, and IddDrv.

void BSP_IDD_LowPower ( void )

Turn Idd measurement component in low power (standby/sleep) mode.

Return values:
None

Definition at line 160 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_Reset ( void )

Reset Idd measurement component.

Return values:
None

Definition at line 148 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_StartMeasure ( void )

Start Measurement campaign.

Return values:
None

Definition at line 172 of file stm32l496g_discovery_idd.c.

References BSP_IO_ConfigPin(), BSP_IO_WritePin(), IDD_AMP_CONTROL_PIN, IDD_I2C_ADDRESS, and IddDrv.

void BSP_IDD_WakeUp ( void )

Wake up Idd measurement component.

Return values:
None

Definition at line 354 of file stm32l496g_discovery_idd.c.

References IDD_I2C_ADDRESS, and IddDrv.


STM32L496G-Discovery BSP User Manual: IDD Config

Enumerations
IDD Config
Exported Types

Enumerations

enum IDD_StatusTypeDef { IDD_OK = 0, IDD_TIMEOUT = 1, IDD_ZERO_VALUE = 2, IDD_ERROR = 0xFF }

Enumeration Type Documentation

enum IDD_StatusTypeDef
Enumerator:
IDD_OK
IDD_TIMEOUT
IDD_ZERO_VALUE
IDD_ERROR

Definition at line 52 of file stm32l496g_discovery_idd.h.


STM32L496G-Discovery BSP User Manual: Exported Defines

Defines
Exported Defines
STM32L496G-DISCOVERY IDD

Defines

#define | DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000)
Shunt values on discovery in milli ohms.
#define | DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24)
#define | DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620)
#define | DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000)
#define | DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149)
Shunt stabilization delay on discovery in milli ohms.
#define | DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149)
#define | DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149)
#define | DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255)
#define | DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967)
IDD Ampli Gain on discovery.
#define | DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000)
IDD Vdd Min on discovery.

Define Documentation

#define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967)

IDD Ampli Gain on discovery.

value is gain * 100

Definition at line 90 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149)

Shunt stabilization delay on discovery in milli ohms.

value in millisec

Definition at line 82 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000)

Shunt values on discovery in milli ohms.

value in milliohm

Definition at line 74 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149)

value in millisec

Definition at line 83 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24)

value in ohm

Definition at line 75 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149)

value in millisec

Definition at line 84 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620)

value in ohm

Definition at line 76 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255)

value in millisec

Definition at line 85 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000)

value in ohm

Definition at line 77 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().

#define DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000)

IDD Vdd Min on discovery.

value in millivolt

Definition at line 95 of file stm32l496g_discovery_idd.h.

Referenced by BSP_IDD_Init().


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private TypesDef

STM32L496G Discovery Lcd Private TypesDef
STM32L496G-DISCOVERY LCD
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private Defines

Defines
STM32L496G Discovery Lcd Private Defines
STM32L496G-DISCOVERY LCD

Defines

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

Define Documentation

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

Definition at line 115 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().

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

Definition at line 116 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_FillPolygon().


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private Macros

Defines
STM32L496G Discovery Lcd Private Macros
STM32L496G-DISCOVERY LCD

Defines

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

Define Documentation

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

Definition at line 124 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_DrawLine(), and FillTriangle().


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private Variables

Variables
STM32L496G Discovery Lcd Private Variables
STM32L496G-DISCOVERY LCD

Variables

LCD_DrawPropTypeDef DrawProp
static LCD_DrvTypeDef * LcdDrv

Variable Documentation

LCD_DrawPropTypeDef DrawProp

Definition at line 132 of file stm32l496g_discovery_lcd.c.

LCD_DrvTypeDef* LcdDrv [static]

Definition at line 133 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_DisplayOff(), BSP_LCD_DisplayOn(), BSP_LCD_DrawBitmap(), BSP_LCD_DrawHLine(), BSP_LCD_DrawPixel(), BSP_LCD_DrawRGBImage(), BSP_LCD_DrawVLine(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_InitEx(), BSP_LCD_ReadPixel(), and SetDisplayWindow().


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private Prototypes

STM32L496G Discovery Lcd Private Prototypes
STM32L496G-DISCOVERY LCD
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G Discovery Lcd Private Functions

Functions
STM32L496G Discovery Lcd Private Functions
STM32L496G-DISCOVERY LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t orientation)
Initializes the LCD with a given orientation.
void | BSP_LCD_Reset (void)
Reset the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
uint16_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
uint16_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetTextColor (uint16_t Color)
Sets the LCD text color.
void | BSP_LCD_SetBackColor (uint16_t Color)
Sets 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.
void | BSP_LCD_Clear (uint16_t Color)
Clears the hole LCD.
void | BSP_LCD_ClearStringLine (uint16_t Line)
Clears the selected line.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode)
Displays characters on the LCD.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a character on the LCD.
uint16_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawBitmap (uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
Draws a bitmap picture (16 bpp).
void | BSP_LCD_DrawRGBImage (uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
Draws RGB Image (16 bpp).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_DisplayOff (void)
Disables the display.
void | BSP_LCD_ScreenDimmingConfig (const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOn (void)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOff (void)
LCD screen dimming disable.
void | HAL_TIM_PWM_MspInit (TIM_HandleTypeDef *htim)
TIM MSP Initialization This function configures the hardware resources used for screen dimming:
uint8_t | BSP_LCD_GetOrientation (void)
__weak void | BSP_LCD_MspInit (void)
Initializes the LCD GPIO special pins MSP.
__weak void | BSP_LCD_MspDeInit (void)
DeInitializes LCD GPIO special pins MSP.
static void | DrawChar (uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
Draws a character on LCD.
static void | SetDisplayWindow (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
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).

Function Documentation

void BSP_LCD_Clear ( uint16_t Color )

Clears the hole LCD.

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

Definition at line 361 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

void BSP_LCD_ClearStringLine ( uint16_t Line )

Clears the selected line.

Parameters:
Line,: Line to be cleared This parameter can be one of the following values:
  • 0..9: if the Current fonts is Font16x24
  • 0..19: if the Current fonts is Font12x12 or Font8x12
  • 0..29: if the Current fonts is Font8x8
Return values:
None

Definition at line 387 of file stm32l496g_discovery_lcd.c.

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

uint8_t BSP_LCD_DeInit ( void )

DeInitializes the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 266 of file stm32l496g_discovery_lcd.c.

References bsp_lcd_initialized, BSP_LCD_MspDeInit(), LCD_OK, and ts_io_init.

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

Displays one character.

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

Definition at line 408 of file stm32l496g_discovery_lcd.c.

References DrawChar(), and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DisplayStringAt().

void BSP_LCD_DisplayOff ( void )

Disables the display.

Parameters:
None
Return values:
None

Definition at line 1032 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Parameters:
None
Return values:
None

Definition at line 1022 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

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

Displays characters on the LCD.

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

Definition at line 426 of file stm32l496g_discovery_lcd.c.

References 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 character on the LCD.

Parameters:
Line,: Line where to display the character shape This parameter can be one of the following values:
  • 0..9: if the Current fonts is Font16x24
  • 0..19: if the Current fonts is Font12x12 or Font8x12
  • 0..29: if the Current fonts is Font8x8
ptr,: Pointer to string to display on LCD
Return values:
None

Definition at line 494 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

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

Draws a bitmap picture (16 bpp).

Parameters:
Xpos,: Bmp X position in the LCD
Ypos,: Bmp Y position in the LCD
pbmp,: Pointer to Bmp picture address.
Return values:
None

Definition at line 800 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), LcdDrv, and SetDisplayWindow().

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

Draws a circle.

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

Definition at line 681 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), BSP_LCD_SetFont(), LCD_DEFAULT_FONT, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_FillCircle().

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

Draws an ellipse on LCD.

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

Definition at line 759 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), and LCD_DrawPropTypeDef::TextColor.

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

Draws an horizontal line.

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

Definition at line 539 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), LcdDrv, and LCD_DrawPropTypeDef::TextColor.

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

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

Draws an uni-line (between two points).

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

Definition at line 588 of file stm32l496g_discovery_lcd.c.

References ABS, BSP_LCD_DrawPixel(), and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_DrawPolygon(), and FillTriangle().

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

Draws a pixel on LCD.

Parameters:
Xpos,: X position
Ypos,: Y position
RGB_Code,: Pixel color in RGB mode (5-6-5)
Return values:
None

Definition at line 524 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

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

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

Draws an poly-line (between many points).

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

Definition at line 731 of file stm32l496g_discovery_lcd.c.

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

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

Draws a rectangle.

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

Definition at line 663 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), and BSP_LCD_DrawVLine().

void BSP_LCD_DrawRGBImage | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Xsize,
 |  | uint16_t | Ysize,
 |  | uint8_t * | pdata
 | ) |  |

Draws RGB Image (16 bpp).

Parameters:
Xpos,: X position in the LCD
Ypos,: Y position in the LCD
Xsize,: X size in the LCD
Ysize,: Y size in the LCD
pdata,: Pointer to the RGB Image address.
Return values:
None

Definition at line 832 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), LcdDrv, and SetDisplayWindow().

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

Draws a vertical line.

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

Definition at line 563 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), LcdDrv, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_DrawRect().

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

Draws a full circle.

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

Definition at line 869 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawCircle(), BSP_LCD_DrawHLine(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

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

Draws a full ellipse.

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

Definition at line 985 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine().

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

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

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

Definition at line 917 of file stm32l496g_discovery_lcd.c.

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

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

Draws a full rectangle.

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

Definition at line 852 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_ClearStringLine().

uint16_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Parameters:
None
Return values:
Used background color

Definition at line 311 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor.

sFONT* BSP_LCD_GetFont ( void )

Gets the LCD text font.

Parameters:
None
Return values:
Used font

Definition at line 351 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::pFont.

uint8_t BSP_LCD_GetOrientation ( void )

Definition at line 1334 of file stm32l496g_discovery_lcd.c.

References LCD_orientation.

uint16_t BSP_LCD_GetTextColor ( void )

Gets the LCD text color.

Parameters:
None
Return values:
Used text color.

Definition at line 301 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::TextColor.

uint32_t BSP_LCD_GetXSize ( void )

Gets the LCD X size.

Parameters:
None
Return values:
Used LCD X size

Definition at line 281 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

Referenced by BSP_LCD_Clear(), BSP_LCD_ClearStringLine(), BSP_LCD_DisplayStringAt(), BSP_LCD_DrawBitmap(), and BSP_LCD_DrawRGBImage().

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Parameters:
None
Return values:
Used LCD Y size

Definition at line 291 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

Referenced by BSP_LCD_Clear(), BSP_LCD_DrawBitmap(), and BSP_LCD_DrawRGBImage().

uint8_t BSP_LCD_Init ( void )

Initializes the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 158 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_InitEx(), and LCD_ORIENTATION_LANDSCAPE.

uint8_t BSP_LCD_InitEx ( uint32_t orientation )

Initializes the LCD with a given orientation.

Parameters:
orientation,: LCD_ORIENTATION_PORTRAIT or LCD_ORIENTATION_LANDSCAPE
Return values:
LCD state

Definition at line 168 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor, BSP_ErrorHandler(), BSP_IO_Init(), bsp_lcd_initialized, BSP_LCD_MspInit(), BSP_LCD_Reset(), BSP_LCD_SetFont(), IO_ERROR, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DEFAULT_FONT, LCD_ERROR, LCD_IO_WriteData(), LCD_OK, LCD_orientation, LCD_ORIENTATION_LANDSCAPE, LCD_ORIENTATION_PORTRAIT, LCD_PWR_CTRL_GPIO_PORT, LCD_PWR_CTRL_PIN, LcdDrv, LCD_DrawPropTypeDef::pFont, LCD_DrawPropTypeDef::TextColor, WakeUpFromShutdown, and WakeUpFromStandby.

Referenced by BSP_LCD_Init().

__weak void BSP_LCD_MspDeInit ( void )

DeInitializes LCD GPIO special pins MSP.

Parameters:
None
Return values:
None

Definition at line 1382 of file stm32l496g_discovery_lcd.c.

References LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_PWR_CTRL_GPIO_PORT, and LCD_PWR_CTRL_PIN.

Referenced by BSP_LCD_DeInit().

__weak void BSP_LCD_MspInit ( void )

Initializes the LCD GPIO special pins MSP.

Parameters:
None
Return values:
None

Definition at line 1344 of file stm32l496g_discovery_lcd.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_Init(), IO_ERROR, LCD_BL_CTRL_GPIO_CLK_ENABLE, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_PWR_CTRL_GPIO_CLK_ENABLE, LCD_PWR_CTRL_GPIO_PORT, LCD_PWR_CTRL_PIN, LCD_RST_PIN, and LCD_TE_GPIO_CLK_ENABLE.

Referenced by BSP_LCD_InitEx().

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

References LcdDrv.

void BSP_LCD_Reset ( void )

Reset the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 248 of file stm32l496g_discovery_lcd.c.

References BSP_IO_WritePin(), and LCD_RST_PIN.

Referenced by BSP_LCD_InitEx().

void BSP_LCD_ScreenDimmingConfig | ( | const uint8_t | start,
 |  | const uint8_t | stop,
 |  | const uint8_t | step,
 |  | const uint8_t | delay
 | ) |  |

LCD screen dimming enable.

Note:
Screen brightness is gradually decreased
Parameters:
start | : value in percent to start from
stop | : value in percent to stop to
step | : step value in percent
delay | : delay in milliseconds between each step
Return values:
None

Definition at line 1047 of file stm32l496g_discovery_lcd.c.

References dimming_config_s::delay, dimming_config_s::ongoing, dimming_config_s::start, dimming_config_s::step, and dimming_config_s::stop.

void BSP_LCD_ScreenDimmingOff ( void )

LCD screen dimming disable.

Note:
Screen brightness is immediately set to its highest level
Parameters:
None
Return values:
None

Definition at line 1222 of file stm32l496g_discovery_lcd.c.

References BSP_ErrorHandler(), dimming_on, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_TimHandle, dimming_config_s::ongoing, TIMx_CHANNEL, and TIMx_CLK_DISABLE.

void BSP_LCD_ScreenDimmingOn ( void )

LCD screen dimming enable.

Note:
Screen brightness is gradually decreased
Parameters:
None
Return values:
None

Definition at line 1067 of file stm32l496g_discovery_lcd.c.

References __DIMMING_CYCLE_VALUE, BSP_ErrorHandler(), dimming_config_s::delay, dimming_on, LCD_sConfig, LCD_TimHandle, dimming_config_s::ongoing, PERIOD_VALUE, PULSE_DECREASE_DELAY, PULSE_DECREASE_START, PULSE_VALUE, dimming_config_s::start, dimming_config_s::step, dimming_config_s::stop, TIMx, and TIMx_CHANNEL.

void BSP_LCD_SetBackColor ( uint16_t Color )

Sets the LCD background color.

Parameters:
Color,: Background color code RGB(5-6-5)
Return values:
None

Definition at line 331 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor.

void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

Parameters:
fonts,: Font to be used
Return values:
None

Definition at line 341 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DrawCircle(), and BSP_LCD_InitEx().

void BSP_LCD_SetTextColor ( uint16_t Color )

Sets the LCD text color.

Parameters:
Color,: Text color code RGB(5-6-5)
Return values:
None

Definition at line 321 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::TextColor.

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

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

Draws a character on LCD.

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

Definition at line 1409 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor, BSP_LCD_DrawPixel(), LCD_DrawPropTypeDef::pFont, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_DisplayChar().

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

Fills a triangle (between 3 points).

Parameters:
Points,: Pointer to the points array
x1,: Point 1 X position
y1,: Point 1 Y position
x2,: Point 2 X position
y2,: Point 2 Y position
x3,: Point 3 X position
y3,: Point 3 Y position
Return values:
None

Definition at line 1485 of file stm32l496g_discovery_lcd.c.

References ABS, and BSP_LCD_DrawLine().

Referenced by BSP_LCD_FillPolygon().

void HAL_TIM_PWM_MspInit ( TIM_HandleTypeDef * htim )

TIM MSP Initialization This function configures the hardware resources used for screen dimming:

  • Peripheral's clock enable
  • Peripheral's GPIO Configuration
    Parameters:
    htim,: TIM handle pointer
    Return values:
    None

Definition at line 1278 of file stm32l496g_discovery_lcd.c.

References TIMx_CHANNEl_AF, and TIMx_CLK_ENABLE.

static void SetDisplayWindow | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Width,
 |  | uint16_t | Height
 | ) |  | [static]

Sets display window.

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

Definition at line 1466 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

Referenced by BSP_LCD_DrawBitmap(), and BSP_LCD_DrawRGBImage().


STM32L496G-Discovery BSP User Manual: LCD_DrawPropTypeDef Struct Reference

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

#include <stm32l496g_discovery_lcd.h>

Data Fields

uint32_t | TextColor
uint32_t | BackColor
sFONT * | pFont

Detailed Description

Definition at line 51 of file stm32l496g_discovery_lcd.h.

Field Documentation

uint32_t LCD_DrawPropTypeDef::BackColor

Definition at line 54 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ClearStringLine(), BSP_LCD_GetBackColor(), BSP_LCD_InitEx(), BSP_LCD_SetBackColor(), and DrawChar().

sFONT* LCD_DrawPropTypeDef::pFont

Definition at line 55 of file stm32l496g_discovery_lcd.h.

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

uint32_t LCD_DrawPropTypeDef::TextColor

Definition at line 53 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_Clear(), BSP_LCD_ClearStringLine(), BSP_LCD_DrawCircle(), BSP_LCD_DrawEllipse(), BSP_LCD_DrawHLine(), BSP_LCD_DrawLine(), BSP_LCD_DrawVLine(), BSP_LCD_FillCircle(), BSP_LCD_FillRect(), BSP_LCD_GetTextColor(), BSP_LCD_InitEx(), BSP_LCD_SetTextColor(), and DrawChar().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G DISCOVERY LCD Exported Constants

Data Structures | Defines | Typedefs | Enumerations | Variables
STM32L496G DISCOVERY LCD Exported Constants
STM32L496G-DISCOVERY LCD

Data Structures

struct | Point

Defines

#define | LCD_OK ((uint8_t)0x00)
LCD status structure definition.
#define | LCD_ERROR ((uint8_t)0x01)
#define | LCD_TIMEOUT ((uint8_t)0x02)
#define | LCD_ORIENTATION_PORTRAIT ((uint8_t)0x00)
#define | LCD_ORIENTATION_LANDSCAPE ((uint8_t)0x01)
#define | LCD_ORIENTATION_UNDEFINED ((uint8_t)0x02)
#define | LCD_COLOR_BLUE ((uint16_t)0x001F)
LCD color.
#define | LCD_COLOR_GREEN ((uint16_t)0x07E0)
#define | LCD_COLOR_RED ((uint16_t)0xF800)
#define | LCD_COLOR_CYAN ((uint16_t)0x07FF)
#define | LCD_COLOR_MAGENTA ((uint16_t)0xF81F)
#define | LCD_COLOR_YELLOW ((uint16_t)0xFFE0)
#define | LCD_COLOR_LIGHTBLUE ((uint16_t)0x841F)
#define | LCD_COLOR_LIGHTGREEN ((uint16_t)0x87F0)
#define | LCD_COLOR_LIGHTRED ((uint16_t)0xFC10)
#define | LCD_COLOR_LIGHTMAGENTA ((uint16_t)0xFC1F)
#define | LCD_COLOR_LIGHTYELLOW ((uint16_t)0xFFF0)
#define | LCD_COLOR_DARKBLUE ((uint16_t)0x0010)
#define | LCD_COLOR_DARKGREEN ((uint16_t)0x0400)
#define | LCD_COLOR_DARKRED ((uint16_t)0x8000)
#define | LCD_COLOR_DARKCYAN ((uint16_t)0x0410)
#define | LCD_COLOR_DARKMAGENTA ((uint16_t)0x8010)
#define | LCD_COLOR_DARKYELLOW ((uint16_t)0x8400)
#define | LCD_COLOR_WHITE ((uint16_t)0xFFFF)
#define | LCD_COLOR_LIGHTGRAY ((uint16_t)0xD69A)
#define | LCD_COLOR_GRAY ((uint16_t)0x8410)
#define | LCD_COLOR_DARKGRAY ((uint16_t)0x4208)
#define | LCD_COLOR_BLACK ((uint16_t)0x0000)
#define | LCD_COLOR_BROWN ((uint16_t)0xA145)
#define | LCD_COLOR_ORANGE ((uint16_t)0xFD20)
#define | LCD_DEFAULT_FONT Font12
LCD default font.
#define | LCD_RST_PIN IO1_PIN_2
LCD special pins.
#define | LCD_TE_PIN GPIO_PIN_7
#define | LCD_TE_GPIO_PORT GPIOH
#define | LCD_TE_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | LCD_TE_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_0
#define | LCD_BL_CTRL_GPIO_PORT GPIOI
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LCD_PWR_CTRL_PIN GPIO_PIN_0
#define | LCD_PWR_CTRL_GPIO_PORT GPIOH
#define | LCD_PWR_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | LCD_PWR_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | TIMx TIM5
#define | TIMx_CLK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE()
#define | TIMx_CLK_DISABLE() __HAL_RCC_TIM5_CLK_DISABLE()
#define | TIMx_CHANNEL TIM_CHANNEL_4
#define | TIMx_CHANNEl_AF GPIO_AF2_TIM5
#define | PERIOD_VALUE (uint32_t)(666 - 1) /* Period Value */
#define | PULSE_VALUE (uint32_t)((PERIOD_VALUE*5)/100) /* 5% cycle */
#define | PULSE_DECREASE_START (uint32_t)(PULSE_VALUE + 120) /* cycle start level when starting to dim the screen */
#define | PULSE_DECREASE_DELAY (uint32_t)(20) /* gradually decrease cycle level every 20 milliseconds */

Typedefs

typedef struct Point * | pPoint

Enumerations

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

Variables

FlagStatus | WakeUpFromStandby
FlagStatus | WakeUpFromShutdown

Define Documentation

#define LCD_BL_CTRL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOI_CLK_DISABLE()

Definition at line 149 of file stm32l496g_discovery_lcd.h.

#define LCD_BL_CTRL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOI_CLK_ENABLE()

Definition at line 148 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit().

#define LCD_BL_CTRL_GPIO_PORT GPIOI

Definition at line 147 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspDeInit(), BSP_LCD_MspInit(), and BSP_LCD_ScreenDimmingOff().

#define LCD_BL_CTRL_PIN GPIO_PIN_0

Definition at line 146 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspDeInit(), BSP_LCD_MspInit(), and BSP_LCD_ScreenDimmingOff().

#define LCD_COLOR_BLACK ((uint16_t)0x0000)

Definition at line 117 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_BLUE ((uint16_t)0x001F)

LCD color.

Definition at line 96 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_BROWN ((uint16_t)0xA145)

Definition at line 118 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_CYAN ((uint16_t)0x07FF)

Definition at line 99 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKBLUE ((uint16_t)0x0010)

Definition at line 107 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKCYAN ((uint16_t)0x0410)

Definition at line 110 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKGRAY ((uint16_t)0x4208)

Definition at line 116 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKGREEN ((uint16_t)0x0400)

Definition at line 108 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKMAGENTA ((uint16_t)0x8010)

Definition at line 111 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKRED ((uint16_t)0x8000)

Definition at line 109 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_DARKYELLOW ((uint16_t)0x8400)

Definition at line 112 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_GRAY ((uint16_t)0x8410)

Definition at line 115 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_GREEN ((uint16_t)0x07E0)

Definition at line 97 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTBLUE ((uint16_t)0x841F)

Definition at line 102 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTGRAY ((uint16_t)0xD69A)

Definition at line 114 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTGREEN ((uint16_t)0x87F0)

Definition at line 103 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTMAGENTA ((uint16_t)0xFC1F)

Definition at line 105 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTRED ((uint16_t)0xFC10)

Definition at line 104 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_LIGHTYELLOW ((uint16_t)0xFFF0)

Definition at line 106 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_MAGENTA ((uint16_t)0xF81F)

Definition at line 100 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_ORANGE ((uint16_t)0xFD20)

Definition at line 119 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_RED ((uint16_t)0xF800)

Definition at line 98 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_WHITE ((uint16_t)0xFFFF)

Definition at line 113 of file stm32l496g_discovery_lcd.h.

#define LCD_COLOR_YELLOW ((uint16_t)0xFFE0)

Definition at line 101 of file stm32l496g_discovery_lcd.h.

#define LCD_DEFAULT_FONT Font12

LCD default font.

Definition at line 124 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_DrawCircle(), and BSP_LCD_InitEx().

#define LCD_ERROR ((uint8_t)0x01)

Definition at line 68 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), and TS_IO_Init().

#define LCD_OK ((uint8_t)0x00)

LCD status structure definition.

Definition at line 67 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_DeInit(), and BSP_LCD_InitEx().

#define LCD_ORIENTATION_LANDSCAPE ((uint8_t)0x01)

Landscape orientation choice of LCD screen

Definition at line 89 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_Init(), and BSP_LCD_InitEx().

#define LCD_ORIENTATION_PORTRAIT ((uint8_t)0x00)

Portrait orientation choice of LCD screen

Definition at line 88 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx().

#define LCD_ORIENTATION_UNDEFINED ((uint8_t)0x02)

Undefined LCD screen orientation

Definition at line 90 of file stm32l496g_discovery_lcd.h.

#define LCD_PWR_CTRL_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 157 of file stm32l496g_discovery_lcd.h.

#define LCD_PWR_CTRL_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 156 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit().

#define LCD_PWR_CTRL_GPIO_PORT GPIOH

Definition at line 155 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspDeInit(), and BSP_LCD_MspInit().

#define LCD_PWR_CTRL_PIN GPIO_PIN_0

Definition at line 154 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_InitEx(), BSP_LCD_MspDeInit(), and BSP_LCD_MspInit().

#define LCD_RST_PIN IO1_PIN_2

LCD special pins.

Definition at line 131 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit(), and BSP_LCD_Reset().

#define LCD_TE_GPIO_CLK_DISABLE ( ) __HAL_RCC_GPIOH_CLK_DISABLE()

Definition at line 137 of file stm32l496g_discovery_lcd.h.

#define LCD_TE_GPIO_CLK_ENABLE ( ) __HAL_RCC_GPIOH_CLK_ENABLE()

Definition at line 136 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_MspInit().

#define LCD_TE_GPIO_PORT GPIOH

Definition at line 135 of file stm32l496g_discovery_lcd.h.

#define LCD_TE_PIN GPIO_PIN_7

Definition at line 134 of file stm32l496g_discovery_lcd.h.

#define LCD_TIMEOUT ((uint8_t)0x02)

Definition at line 69 of file stm32l496g_discovery_lcd.h.

#define PERIOD_VALUE (uint32_t)(666 - 1) /* Period Value */

Definition at line 177 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOn().

#define PULSE_DECREASE_DELAY (uint32_t)(20) /* gradually decrease cycle level every 20 milliseconds */

Definition at line 180 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOn().

#define PULSE_DECREASE_START (uint32_t)(PULSE_VALUE + 120) /* cycle start level when starting to dim the screen */

Definition at line 179 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOn().

#define PULSE_VALUE (uint32_t)((PERIOD_VALUE*5)/100) /* 5% cycle */

Definition at line 178 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOn().

#define TIMx TIM5

Definition at line 166 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOn().

#define TIMx_CHANNEL TIM_CHANNEL_4

Definition at line 169 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOff(), and BSP_LCD_ScreenDimmingOn().

#define TIMx_CHANNEl_AF GPIO_AF2_TIM5

Definition at line 170 of file stm32l496g_discovery_lcd.h.

Referenced by HAL_TIM_PWM_MspInit().

#define TIMx_CLK_DISABLE ( ) __HAL_RCC_TIM5_CLK_DISABLE()

Definition at line 168 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_ScreenDimmingOff().

#define TIMx_CLK_ENABLE ( ) __HAL_RCC_TIM5_CLK_ENABLE()

Definition at line 167 of file stm32l496g_discovery_lcd.h.

Referenced by HAL_TIM_PWM_MspInit().

Typedef Documentation

typedef struct Point * pPoint

Enumeration Type Documentation

enum Line_ModeTypdef

Line mode structures definition.

Enumerator:
CENTER_MODE
RIGHT_MODE
LEFT_MODE

Definition at line 80 of file stm32l496g_discovery_lcd.h.

Variable Documentation

FlagStatus WakeUpFromShutdown

Definition at line 90 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().

FlagStatus WakeUpFromStandby

Definition at line 89 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_InitEx().


STM32L496G-Discovery BSP User Manual: Point Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
Point Struct Reference
STM32L496G DISCOVERY LCD Exported Constants

#include <stm32l496g_discovery_lcd.h>

Data Fields

int16_t | X
int16_t | Y

Detailed Description

Definition at line 71 of file stm32l496g_discovery_lcd.h.

Field Documentation

int16_t Point::X

Definition at line 73 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

int16_t Point::Y

Definition at line 74 of file stm32l496g_discovery_lcd.h.

Referenced by BSP_LCD_DrawPolygon(), and BSP_LCD_FillPolygon().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G DISCOVERY LCD Exported Functions

Functions
STM32L496G DISCOVERY LCD Exported Functions
STM32L496G-DISCOVERY LCD

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t orientation)
Initializes the LCD with a given orientation.
void | BSP_LCD_Reset (void)
Reset the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
uint16_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
uint16_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetTextColor (__IO uint16_t Color)
void | BSP_LCD_SetBackColor (__IO uint16_t Color)
void | BSP_LCD_SetFont (sFONT *fonts)
Sets the LCD text font.
sFONT * | BSP_LCD_GetFont (void)
Gets the LCD text font.
void | BSP_LCD_Clear (uint16_t Color)
Clears the hole LCD.
void | BSP_LCD_ClearStringLine (uint16_t Line)
Clears the selected line.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a character on the LCD.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode)
Displays characters on the LCD.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
uint16_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawBitmap (uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
Draws a bitmap picture (16 bpp).
void | BSP_LCD_DrawRGBImage (uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp)
Draws RGB Image (16 bpp).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOff (void)
Disables the display.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_ScreenDimmingOn (void)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOff (void)
LCD screen dimming disable.
void | BSP_LCD_ScreenDimmingConfig (const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay)
LCD screen dimming enable.
uint8_t | BSP_LCD_GetOrientation (void)
__weak void | BSP_LCD_MspInit (void)
Initializes the LCD GPIO special pins MSP.
__weak void | BSP_LCD_MspDeInit (void)
DeInitializes LCD GPIO special pins MSP.

Function Documentation

void BSP_LCD_Clear ( uint16_t Color )

Clears the hole LCD.

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

Definition at line 361 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

void BSP_LCD_ClearStringLine ( uint16_t Line )

Clears the selected line.

Parameters:
Line,: Line to be cleared This parameter can be one of the following values:
  • 0..9: if the Current fonts is Font16x24
  • 0..19: if the Current fonts is Font12x12 or Font8x12
  • 0..29: if the Current fonts is Font8x8
Return values:
None

Definition at line 387 of file stm32l496g_discovery_lcd.c.

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

uint8_t BSP_LCD_DeInit ( void )

DeInitializes the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 266 of file stm32l496g_discovery_lcd.c.

References bsp_lcd_initialized, BSP_LCD_MspDeInit(), LCD_OK, and ts_io_init.

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

Displays one character.

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

Definition at line 408 of file stm32l496g_discovery_lcd.c.

References DrawChar(), and LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DisplayStringAt().

void BSP_LCD_DisplayOff ( void )

Disables the display.

Parameters:
None
Return values:
None

Definition at line 1032 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

void BSP_LCD_DisplayOn ( void )

Enables the display.

Parameters:
None
Return values:
None

Definition at line 1022 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

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

Displays characters on the LCD.

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

Definition at line 426 of file stm32l496g_discovery_lcd.c.

References 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 character on the LCD.

Parameters:
Line,: Line where to display the character shape This parameter can be one of the following values:
  • 0..9: if the Current fonts is Font16x24
  • 0..19: if the Current fonts is Font12x12 or Font8x12
  • 0..29: if the Current fonts is Font8x8
ptr,: Pointer to string to display on LCD
Return values:
None

Definition at line 494 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DisplayStringAt(), and LEFT_MODE.

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

Draws a bitmap picture (16 bpp).

Parameters:
Xpos,: Bmp X position in the LCD
Ypos,: Bmp Y position in the LCD
pbmp,: Pointer to Bmp picture address.
Return values:
None

Definition at line 800 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), LcdDrv, and SetDisplayWindow().

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

Draws a circle.

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

Definition at line 681 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), BSP_LCD_SetFont(), LCD_DEFAULT_FONT, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_FillCircle().

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

Draws an ellipse on LCD.

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

Definition at line 759 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), and LCD_DrawPropTypeDef::TextColor.

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

Draws an horizontal line.

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

Definition at line 539 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), LcdDrv, and LCD_DrawPropTypeDef::TextColor.

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

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

Draws an uni-line (between two points).

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

Definition at line 588 of file stm32l496g_discovery_lcd.c.

References ABS, BSP_LCD_DrawPixel(), and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_DrawPolygon(), and FillTriangle().

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

Draws a pixel on LCD.

Parameters:
Xpos,: X position
Ypos,: Y position
RGB_Code,: Pixel color in RGB mode (5-6-5)
Return values:
None

Definition at line 524 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

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

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

Draws an poly-line (between many points).

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

Definition at line 731 of file stm32l496g_discovery_lcd.c.

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

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

Draws a rectangle.

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

Definition at line 663 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), and BSP_LCD_DrawVLine().

void BSP_LCD_DrawRGBImage | ( | uint16_t | Xpos,
 |  | uint16_t | Ypos,
 |  | uint16_t | Xsize,
 |  | uint16_t | Ysize,
 |  | uint8_t * | pdata
 | ) |  |

Draws RGB Image (16 bpp).

Parameters:
Xpos,: X position in the LCD
Ypos,: Y position in the LCD
Xsize,: X size in the LCD
Ysize,: Y size in the LCD
pdata,: Pointer to the RGB Image address.
Return values:
None

Definition at line 832 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), LcdDrv, and SetDisplayWindow().

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

Draws a vertical line.

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

Definition at line 563 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawPixel(), LcdDrv, and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_DrawRect().

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

Draws a full circle.

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

Definition at line 869 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawCircle(), BSP_LCD_DrawHLine(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

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

Draws a full ellipse.

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

Definition at line 985 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine().

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

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

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

Definition at line 917 of file stm32l496g_discovery_lcd.c.

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

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

Draws a full rectangle.

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

Definition at line 852 of file stm32l496g_discovery_lcd.c.

References BSP_LCD_DrawHLine(), BSP_LCD_SetTextColor(), and LCD_DrawPropTypeDef::TextColor.

Referenced by BSP_LCD_ClearStringLine().

uint16_t BSP_LCD_GetBackColor ( void )

Gets the LCD background color.

Parameters:
None
Return values:
Used background color

Definition at line 311 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor.

sFONT* BSP_LCD_GetFont ( void )

Gets the LCD text font.

Parameters:
None
Return values:
Used font

Definition at line 351 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::pFont.

uint8_t BSP_LCD_GetOrientation ( void )

Definition at line 1334 of file stm32l496g_discovery_lcd.c.

References LCD_orientation.

uint16_t BSP_LCD_GetTextColor ( void )

Gets the LCD text color.

Parameters:
None
Return values:
Used text color.

Definition at line 301 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::TextColor.

uint32_t BSP_LCD_GetXSize ( void )

Gets the LCD X size.

Parameters:
None
Return values:
Used LCD X size

Definition at line 281 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

Referenced by BSP_LCD_Clear(), BSP_LCD_ClearStringLine(), BSP_LCD_DisplayStringAt(), BSP_LCD_DrawBitmap(), and BSP_LCD_DrawRGBImage().

uint32_t BSP_LCD_GetYSize ( void )

Gets the LCD Y size.

Parameters:
None
Return values:
Used LCD Y size

Definition at line 291 of file stm32l496g_discovery_lcd.c.

References LcdDrv.

Referenced by BSP_LCD_Clear(), BSP_LCD_DrawBitmap(), and BSP_LCD_DrawRGBImage().

uint8_t BSP_LCD_Init ( void )

Initializes the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 1623 of file stm32l496g_discovery.c.

References BSP_LCD_InitEx(), and LCD_ORIENTATION_LANDSCAPE.

Referenced by TS_IO_Init().

uint8_t BSP_LCD_InitEx ( uint32_t orientation )

Initializes the LCD with a given orientation.

Parameters:
orientation,: LCD_ORIENTATION_PORTRAIT or LCD_ORIENTATION_LANDSCAPE
Return values:
LCD state

Definition at line 168 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::BackColor, BSP_ErrorHandler(), BSP_IO_Init(), bsp_lcd_initialized, BSP_LCD_MspInit(), BSP_LCD_Reset(), BSP_LCD_SetFont(), IO_ERROR, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_DEFAULT_FONT, LCD_ERROR, LCD_IO_WriteData(), LCD_OK, LCD_orientation, LCD_ORIENTATION_LANDSCAPE, LCD_ORIENTATION_PORTRAIT, LCD_PWR_CTRL_GPIO_PORT, LCD_PWR_CTRL_PIN, LcdDrv, LCD_DrawPropTypeDef::pFont, LCD_DrawPropTypeDef::TextColor, WakeUpFromShutdown, and WakeUpFromStandby.

Referenced by BSP_LCD_Init().

__weak void BSP_LCD_MspDeInit ( void )

DeInitializes LCD GPIO special pins MSP.

Parameters:
None
Return values:
None

Definition at line 1382 of file stm32l496g_discovery_lcd.c.

References LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_PWR_CTRL_GPIO_PORT, and LCD_PWR_CTRL_PIN.

Referenced by BSP_LCD_DeInit().

__weak void BSP_LCD_MspInit ( void )

Initializes the LCD GPIO special pins MSP.

Parameters:
None
Return values:
None

Definition at line 1344 of file stm32l496g_discovery_lcd.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_Init(), IO_ERROR, LCD_BL_CTRL_GPIO_CLK_ENABLE, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_PWR_CTRL_GPIO_CLK_ENABLE, LCD_PWR_CTRL_GPIO_PORT, LCD_PWR_CTRL_PIN, LCD_RST_PIN, and LCD_TE_GPIO_CLK_ENABLE.

Referenced by BSP_LCD_InitEx().

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

References LcdDrv.

void BSP_LCD_Reset ( void )

Reset the LCD.

Parameters:
None
Return values:
LCD state

Definition at line 248 of file stm32l496g_discovery_lcd.c.

References BSP_IO_WritePin(), and LCD_RST_PIN.

Referenced by BSP_LCD_InitEx().

void BSP_LCD_ScreenDimmingConfig | ( | const uint8_t | start,
 |  | const uint8_t | stop,
 |  | const uint8_t | step,
 |  | const uint8_t | delay
 | ) |  |

LCD screen dimming enable.

Note:
Screen brightness is gradually decreased
Parameters:
start | : value in percent to start from
stop | : value in percent to stop to
step | : step value in percent
delay | : delay in milliseconds between each step
Return values:
None

Definition at line 1047 of file stm32l496g_discovery_lcd.c.

References dimming_config_s::delay, dimming_config_s::ongoing, dimming_config_s::start, dimming_config_s::step, and dimming_config_s::stop.

void BSP_LCD_ScreenDimmingOff ( void )

LCD screen dimming disable.

Note:
Screen brightness is immediately set to its highest level
Parameters:
None
Return values:
None

Definition at line 1222 of file stm32l496g_discovery_lcd.c.

References BSP_ErrorHandler(), dimming_on, LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, LCD_TimHandle, dimming_config_s::ongoing, TIMx_CHANNEL, and TIMx_CLK_DISABLE.

void BSP_LCD_ScreenDimmingOn ( void )

LCD screen dimming enable.

Note:
Screen brightness is gradually decreased
Parameters:
None
Return values:
None

Definition at line 1067 of file stm32l496g_discovery_lcd.c.

References __DIMMING_CYCLE_VALUE, BSP_ErrorHandler(), dimming_config_s::delay, dimming_on, LCD_sConfig, LCD_TimHandle, dimming_config_s::ongoing, PERIOD_VALUE, PULSE_DECREASE_DELAY, PULSE_DECREASE_START, PULSE_VALUE, dimming_config_s::start, dimming_config_s::step, dimming_config_s::stop, TIMx, and TIMx_CHANNEL.

void BSP_LCD_SetBackColor ( __IO uint16_t Color )
void BSP_LCD_SetFont ( sFONT * fonts )

Sets the LCD text font.

Parameters:
fonts,: Font to be used
Return values:
None

Definition at line 341 of file stm32l496g_discovery_lcd.c.

References LCD_DrawPropTypeDef::pFont.

Referenced by BSP_LCD_DrawCircle(), and BSP_LCD_InitEx().

void BSP_LCD_SetTextColor ( __IO uint16_t Color )


STM32L496G-Discovery BSP User Manual: Private Constants

Defines
Private Constants
STM32L496G-DISCOVERY QSPI

Defines

#define | QSPI_QUAD_DISABLE 0x0
#define | QSPI_QUAD_ENABLE 0x1
#define | QSPI_HIGH_PERF_DISABLE 0x0
#define | QSPI_HIGH_PERF_ENABLE 0x1

Define Documentation

#define QSPI_HIGH_PERF_DISABLE 0x0

Definition at line 81 of file stm32l496g_discovery_qspi.c.

Referenced by QSPI_HighPerfMode().

#define QSPI_HIGH_PERF_ENABLE 0x1

Definition at line 82 of file stm32l496g_discovery_qspi.c.

Referenced by BSP_QSPI_Init(), and QSPI_HighPerfMode().

#define QSPI_QUAD_DISABLE 0x0

Definition at line 78 of file stm32l496g_discovery_qspi.c.

Referenced by QSPI_QuadMode().

#define QSPI_QUAD_ENABLE 0x1

Definition at line 79 of file stm32l496g_discovery_qspi.c.

Referenced by BSP_QSPI_Init(), and QSPI_QuadMode().


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G-DISCOVERY QSPI

Variables

QSPI_HandleTypeDef QSPIHandle

Variable Documentation

QSPI_HandleTypeDef QSPIHandle

Definition at line 91 of file stm32l496g_discovery_qspi.c.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_EnterDeepPowerDown(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Erase_Sector(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_LeaveDeepPowerDown(), BSP_QSPI_Read(), BSP_QSPI_ResumeErase(), BSP_QSPI_SuspendErase(), BSP_QSPI_Write(), QSPI_AutoPollingMemReady(), QSPI_HighPerfMode(), QSPI_QuadMode(), QSPI_ResetMemory(), and QSPI_WriteEnable().


STM32L496G-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32L496G-DISCOVERY QSPI

Functions

static void | QSPI_MspInit (void)
Initializes the QSPI MSP.
static void | QSPI_MspDeInit (void)
De-Initializes the QSPI MSP.
static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
static uint8_t | QSPI_QuadMode (QSPI_HandleTypeDef *hqspi, uint8_t Operation)
This function enables/disables the Quad mode of the memory.
static uint8_t | QSPI_HighPerfMode (QSPI_HandleTypeDef *hqspi, uint8_t Operation)
This function enables/disables the high performance mode of the memory.

Function Documentation

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

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

Parameters:
hqspi | : QSPI handle
Timeout | : Timeout for auto-polling
Return values:
None

Definition at line 891 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

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

static uint8_t QSPI_HighPerfMode | ( | QSPI_HandleTypeDef * | hqspi,
 |  | uint8_t | Operation
 | ) |  | [static]

This function enables/disables the high performance mode of the memory.

Parameters:
hqspi | : QSPI handle
Operation | : QSPI_HIGH_PERF_ENABLE or QSPI_HIGH_PERF_DISABLE high performance mode
Return values:
None

Definition at line 1017 of file stm32l496g_discovery_qspi.c.

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

Referenced by BSP_QSPI_Init().

static void QSPI_MspDeInit ( void ) [static]

De-Initializes the QSPI MSP.

Return values:
None

Definition at line 764 of file stm32l496g_discovery_qspi.c.

Referenced by BSP_QSPI_DeInit().

static void QSPI_MspInit ( void ) [static]

Initializes the QSPI MSP.

Return values:
None

Definition at line 728 of file stm32l496g_discovery_qspi.c.

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_QuadMode | ( | QSPI_HandleTypeDef * | hqspi,
 |  | uint8_t | Operation
 | ) |  | [static]

This function enables/disables the Quad mode of the memory.

Parameters:
hqspi | : QSPI handle
Operation | : QSPI_QUAD_ENABLE or QSPI_QUAD_DISABLE mode
Return values:
None

Definition at line 928 of file stm32l496g_discovery_qspi.c.

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

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_ResetMemory ( QSPI_HandleTypeDef * hqspi ) [static]

This function reset the QSPI memory.

Parameters:
hqspi : QSPI handle
Return values:
None

Definition at line 803 of file stm32l496g_discovery_qspi.c.

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

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_WriteEnable ( QSPI_HandleTypeDef * hqspi ) [static]

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

Parameters:
hqspi : QSPI handle
Return values:
None

Definition at line 845 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Erase_Sector(), BSP_QSPI_Write(), QSPI_HighPerfMode(), and QSPI_QuadMode().


STM32L496G-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32L496G-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 Documentation

#define QSPI_BUSY ((uint8_t)0x02)

Definition at line 52 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus(), BSP_QSPI_ResumeErase(), and BSP_QSPI_SuspendErase().

#define QSPI_ERROR ((uint8_t)0x01)

Definition at line 51 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_EnterDeepPowerDown(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Erase_Sector(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_LeaveDeepPowerDown(), BSP_QSPI_Read(), BSP_QSPI_ResumeErase(), BSP_QSPI_SuspendErase(), BSP_QSPI_Write(), QSPI_AutoPollingMemReady(), QSPI_HighPerfMode(), QSPI_QuadMode(), QSPI_ResetMemory(), and QSPI_WriteEnable().

#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)

Definition at line 53 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_Init().

#define QSPI_OK ((uint8_t)0x00)

Definition at line 50 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_DeInit(), BSP_QSPI_EnableMemoryMappedMode(), BSP_QSPI_EnterDeepPowerDown(), BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Erase_Sector(), BSP_QSPI_GetInfo(), BSP_QSPI_GetStatus(), BSP_QSPI_Init(), BSP_QSPI_LeaveDeepPowerDown(), BSP_QSPI_Read(), BSP_QSPI_ResumeErase(), BSP_QSPI_SuspendErase(), BSP_QSPI_Write(), QSPI_AutoPollingMemReady(), QSPI_HighPerfMode(), QSPI_QuadMode(), QSPI_ResetMemory(), and QSPI_WriteEnable().

#define QSPI_SUSPENDED ((uint8_t)0x08)

Definition at line 54 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetStatus(), BSP_QSPI_ResumeErase(), and BSP_QSPI_SuspendErase().


STM32L496G-Discovery BSP User Manual: QSPI_Info Struct Reference

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

#include <stm32l496g_discovery_qspi.h>

Data Fields

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

Detailed Description

Definition at line 65 of file stm32l496g_discovery_qspi.h.

Field Documentation

uint32_t QSPI_Info::EraseSectorSize

Size of sectors for the erase operation

Definition at line 68 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::EraseSectorsNumber

Number of sectors for the erase operation

Definition at line 69 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::FlashSize

Size of the flash

Definition at line 67 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPageSize

Size of pages for the program operation

Definition at line 70 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

uint32_t QSPI_Info::ProgPagesNumber

Number of pages for the program operation

Definition at line 71 of file stm32l496g_discovery_qspi.h.

Referenced by BSP_QSPI_GetInfo().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_qspi.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G-DISCOVERY QSPI

Functions

uint8_t | BSP_QSPI_Init (void)
Initializes the QSPI interface.
uint8_t | BSP_QSPI_DeInit (void)
De-Initializes the QSPI interface.
uint8_t | BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the QSPI memory.
uint8_t | BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the QSPI memory.
uint8_t | BSP_QSPI_Erase_Block (uint32_t BlockAddress)
Erases the specified block of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Sector (uint32_t Sector)
Erases the specified sector of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
uint8_t | BSP_QSPI_SuspendErase (void)
This function suspends an ongoing erase command.
uint8_t | BSP_QSPI_ResumeErase (void)
This function resumes a paused erase command.
uint8_t | BSP_QSPI_EnterDeepPowerDown (void)
This function enter the QSPI memory in deep power down mode.
uint8_t | BSP_QSPI_LeaveDeepPowerDown (void)
This function leave the QSPI memory from deep power down mode.

Function Documentation

uint8_t BSP_QSPI_DeInit ( void )

De-Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 184 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_MspDeInit(), 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 539 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_EnterDeepPowerDown ( void )

This function enter the QSPI memory in deep power down mode.

Return values:
QSPI memory status

Definition at line 659 of file stm32l496g_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 324 of file stm32l496g_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 413 of file stm32l496g_discovery_qspi.c.

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

uint8_t BSP_QSPI_Erase_Sector ( uint32_t Sector )

Erases the specified sector of the QSPI memory.

Parameters:
Sector : Sector address to erase (0 to 255)
Return values:
QSPI memory status
Note:
This function is non blocking meaning that sector erase operation is started but not completed when the function returns. Application has to call BSP_QSPI_GetStatus() to know when the device is available again (i.e. erase operation completed).

Definition at line 372 of file stm32l496g_discovery_qspi.c.

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

uint8_t BSP_QSPI_GetInfo ( QSPI_Info * pInfo )

Return the configuration of the QSPI memory.

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

Definition at line 523 of file stm32l496g_discovery_qspi.c.

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

uint8_t BSP_QSPI_GetStatus ( void )

Reads current status of the QSPI memory.

Return values:
QSPI memory status

Definition at line 453 of file stm32l496g_discovery_qspi.c.

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

Referenced by BSP_QSPI_ResumeErase(), and BSP_QSPI_SuspendErase().

uint8_t BSP_QSPI_Init ( void )

Initializes the QSPI interface.

Return values:
QSPI memory status

Definition at line 125 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_HIGH_PERF_ENABLE, QSPI_HighPerfMode(), QSPI_MspInit(), QSPI_NOT_SUPPORTED, QSPI_OK, QSPI_QUAD_ENABLE, QSPI_QuadMode(), QSPI_ResetMemory(), and QSPIHandle.

uint8_t BSP_QSPI_LeaveDeepPowerDown ( void )

This function leave the QSPI memory from deep power down mode.

Return values:
QSPI memory status

Definition at line 690 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

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 207 of file stm32l496g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_ResumeErase ( void )

This function resumes a paused erase command.

Return values:
QSPI memory status

Definition at line 614 of file stm32l496g_discovery_qspi.c.

References BSP_QSPI_GetStatus(), QSPI_BUSY, QSPI_ERROR, QSPI_OK, QSPI_SUSPENDED, and QSPIHandle.

uint8_t BSP_QSPI_SuspendErase ( void )

This function suspends an ongoing erase command.

Return values:
QSPI memory status

Definition at line 573 of file stm32l496g_discovery_qspi.c.

References BSP_QSPI_GetStatus(), QSPI_BUSY, QSPI_ERROR, QSPI_OK, QSPI_SUSPENDED, 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 249 of file stm32l496g_discovery_qspi.c.

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


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G_DISCOVERY SD

Variables

SD_HandleTypeDef uSdHandle

Variable Documentation

SD_HandleTypeDef uSdHandle

Definition at line 76 of file stm32l496g_discovery_sd.c.

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


STM32L496G-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32L496G_DISCOVERY SD

Functions

static void | SD_Detect_MspInit (void)
Initializes the SD Detect pin MSP.
static void | SD_Detect_MspDeInit (void)
Initializes the SD Detect pin MSP.
static HAL_StatusTypeDef | SD_DMAConfigRx (SD_HandleTypeDef *hsd)
Configure the DMA to receive data from the SD card.
static HAL_StatusTypeDef | SD_DMAConfigTx (SD_HandleTypeDef *hsd)
Configure the DMA to transmit data to the SD card.

Function Documentation

static void SD_Detect_MspDeInit ( void ) [static]

Initializes the SD Detect pin MSP.

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

Definition at line 608 of file stm32l496g_discovery_sd.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_Init(), IO_ERROR, and SD_DETECT_PIN.

Referenced by BSP_SD_DeInit().

static void SD_Detect_MspInit ( void ) [static]

Initializes the SD Detect pin MSP.

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

Definition at line 593 of file stm32l496g_discovery_sd.c.

References BSP_ErrorHandler(), BSP_IO_ConfigPin(), BSP_IO_Init(), IO_ERROR, and SD_DETECT_PIN.

Referenced by BSP_SD_Init().

static HAL_StatusTypeDef SD_DMAConfigRx ( SD_HandleTypeDef * hsd ) [static]

Configure the DMA to receive data from the SD card.

Return values:
HAL_ERROR or HAL_OK

Definition at line 625 of file stm32l496g_discovery_sd.c.

References SD_DMAx_IRQn, and SD_DMAx_STREAM.

Referenced by BSP_SD_ReadBlocks_DMA().

static HAL_StatusTypeDef SD_DMAConfigTx ( SD_HandleTypeDef * hsd ) [static]

Configure the DMA to transmit data to the SD card.

Return values:
HAL_ERROR or HAL_OK

Definition at line 665 of file stm32l496g_discovery_sd.c.

References SD_DMAx_IRQn, and SD_DMAx_STREAM.

Referenced by BSP_SD_WriteBlocks_DMA().


STM32L496G-Discovery BSP User Manual: Exported Types

Defines
Exported Types
STM32L496G_DISCOVERY SD

Defines

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
SD Card information structure.

Define Documentation

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef

SD Card information structure.

Definition at line 52 of file stm32l496g_discovery_sd.h.


STM32L496G-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32L496G_DISCOVERY SD

Defines

#define | SD_DETECT_PIN IO1_PIN_8
#define | SD_DATATIMEOUT ((uint32_t)100000000)
#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SDMMCx_IRQHandler SDMMC1_IRQHandler
#define | SDMMCx_IRQn SDMMC1_IRQn
#define | SD_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SD_DMAx_STREAM DMA2_Channel5
#define | SD_DMAx_IRQn DMA2_Channel5_IRQn
#define | SD_DMAx_IRQHandler DMA2_Channel5_IRQHandler

Define Documentation

#define SD_DATATIMEOUT ((uint32_t)100000000)

Definition at line 78 of file stm32l496g_discovery_sd.h.

#define SD_DETECT_PIN IO1_PIN_8

Definition at line 76 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_IsDetected(), BSP_SD_ITConfig(), SD_Detect_MspDeInit(), and SD_Detect_MspInit().

#define SD_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE

Definition at line 90 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit().

#define SD_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE

Definition at line 89 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_MspInit().

#define SD_DMAx_IRQHandler DMA2_Channel5_IRQHandler

Definition at line 93 of file stm32l496g_discovery_sd.h.

#define SD_DMAx_IRQn DMA2_Channel5_IRQn

Definition at line 92 of file stm32l496g_discovery_sd.h.

Referenced by SD_DMAConfigRx(), and SD_DMAConfigTx().

#define SD_DMAx_STREAM DMA2_Channel5

Definition at line 91 of file stm32l496g_discovery_sd.h.

Referenced by SD_DMAConfigRx(), and SD_DMAConfigTx().

#define SD_NOT_PRESENT ((uint8_t)0x00)

Definition at line 81 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_IsDetected().

#define SD_PRESENT ((uint8_t)0x01)

Definition at line 80 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_Init(), and BSP_SD_IsDetected().

#define SDMMCx_IRQHandler SDMMC1_IRQHandler

Definition at line 84 of file stm32l496g_discovery_sd.h.

#define SDMMCx_IRQn SDMMC1_IRQn

Definition at line 85 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_MspDeInit(), and BSP_SD_MspInit().


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G_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.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
void | BSP_SD_DMA_Tx_IRQHandler (void)
Handles SD DMA Tx transfer interrupt request.
void | BSP_SD_DMA_Rx_IRQHandler (void)
Handles SD DMA Rx transfer interrupt request.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
De-Initializes the SD MSP.
__weak void | BSP_SD_AbortCallback (void)
BSP SD Abort callback.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callback.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callback.
void | HAL_SD_AbortCallback (SD_HandleTypeDef *hsd)
SD Abort callback.
void | HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd)
Tx Transfer completed callback.
void | HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd)
Rx Transfer completed callback.

Function Documentation

void BSP_SD_AbortCallback ( void )

BSP SD Abort callback.

Return values:
None

Definition at line 525 of file stm32l496g_discovery_sd.c.

Referenced by HAL_SD_AbortCallback().

uint8_t BSP_SD_DeInit ( void )

DeInitializes the SD card device.

Parameters:
None
Return values:
SD status

Definition at line 159 of file stm32l496g_discovery_sd.c.

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

void BSP_SD_DMA_Rx_IRQHandler ( void )

Handles SD DMA Rx transfer interrupt request.

Return values:
None

Definition at line 374 of file stm32l496g_discovery_sd.c.

References uSdHandle.

void BSP_SD_DMA_Tx_IRQHandler ( void )

Handles SD DMA Tx transfer interrupt request.

Return values:
None

Definition at line 365 of file stm32l496g_discovery_sd.c.

References uSdHandle.

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

Erases the specified memory area of the given SD card.

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

Definition at line 336 of file stm32l496g_discovery_sd.c.

References MSD_ERROR, MSD_OK, and uSdHandle.

void BSP_SD_GetCardInfo ( BSP_SD_CardInfo * CardInfo )

Get SD information about specific SD card.

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

Definition at line 410 of file stm32l496g_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_GetCardState ( void )

Gets the current SD card data status.

Parameters:
None
Return values:
Data transfer state.

Definition at line 384 of file stm32l496g_discovery_sd.c.

References SD_TRANSFER_BUSY, SD_TRANSFER_ERROR, SD_TRANSFER_OK, and uSdHandle.

uint8_t BSP_SD_Init ( void )

Initializes the SD card device.

Parameters:
None
Return values:
SD status

Definition at line 106 of file stm32l496g_discovery_sd.c.

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

void BSP_SD_IRQHandler ( void )

Handles SD card interrupt request.

Return values:
None

Definition at line 356 of file stm32l496g_discovery_sd.c.

References uSdHandle.

uint8_t BSP_SD_IsDetected ( void )

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

Parameters:
None
Return values:
Returns if SD is detected or not

Definition at line 203 of file stm32l496g_discovery_sd.c.

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

Parameters:
None
Return values:
IO_OK,: if all initializations are OK. Other value if error.

Definition at line 183 of file stm32l496g_discovery_sd.c.

References BSP_IO_ConfigPin(), BSP_IO_ReadPin(), and SD_DETECT_PIN.

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

De-Initializes the SD MSP.

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

Definition at line 484 of file stm32l496g_discovery_sd.c.

References SD_DMAx_CLK_DISABLE, and SDMMCx_IRQn.

Referenced by BSP_SD_DeInit().

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

Initializes the SD MSP.

Note:
The SDMMC clock configuration done within this function assumes that the PLLSAI1 input clock runs at 8 MHz.
Parameters:
hsd,: SD handle
Params,: Additional parameters
Return values:
None

Definition at line 424 of file stm32l496g_discovery_sd.c.

References SD_DMAx_CLK_ENABLE, and SDMMCx_IRQn.

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 224 of file stm32l496g_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 271 of file stm32l496g_discovery_sd.c.

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

void BSP_SD_ReadCpltCallback ( void )

BSP Rx Transfer completed callback.

Return values:
None

Definition at line 543 of file stm32l496g_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 248 of file stm32l496g_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 304 of file stm32l496g_discovery_sd.c.

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

void BSP_SD_WriteCpltCallback ( void )

BSP Tx Transfer completed callback.

Return values:
None

Definition at line 534 of file stm32l496g_discovery_sd.c.

Referenced by HAL_SD_TxCpltCallback().

void HAL_SD_AbortCallback ( SD_HandleTypeDef * hsd )

SD Abort callback.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 553 of file stm32l496g_discovery_sd.c.

References BSP_SD_AbortCallback().

void HAL_SD_RxCpltCallback ( SD_HandleTypeDef * hsd )

Rx Transfer completed callback.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 573 of file stm32l496g_discovery_sd.c.

References BSP_SD_ReadCpltCallback().

void HAL_SD_TxCpltCallback ( SD_HandleTypeDef * hsd )

Tx Transfer completed callback.

Parameters:
hsd,: SD handle
Return values:
None

Definition at line 563 of file stm32l496g_discovery_sd.c.

References BSP_SD_WriteCpltCallback().


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY SD

Modules | Defines
STM32L496G_DISCOVERY SD
STM32L496G-DISCOVERY

Modules

Private Variables
Private Functions
Exported Types
Exported Constants
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 | SD_TRANSFER_ERROR ((uint8_t)0x02)

Define Documentation

#define MSD_ERROR ((uint8_t)0x01)

Definition at line 61 of file stm32l496g_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 62 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_Init().

#define MSD_OK ((uint8_t)0x00)

SD status structure definition.

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

Definition at line 68 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_ERROR ((uint8_t)0x02)

Definition at line 69 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().

#define SD_TRANSFER_OK ((uint8_t)0x00)

SD transfer state definition.

Definition at line 67 of file stm32l496g_discovery_sd.h.

Referenced by BSP_SD_GetCardState().


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G-DISCOVERY SRAM

Variables

static SRAM_HandleTypeDef | sramHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Variable Documentation

SRAM_HandleTypeDef sramHandle [static]

Definition at line 73 of file stm32l496g_discovery_sram.c.

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

FMC_NORSRAM_TimingTypeDef Timing [static]

Definition at line 74 of file stm32l496g_discovery_sram.c.

Referenced by BSP_SRAM_Init().


STM32L496G-Discovery BSP User Manual: Private Constants

Defines
Private Constants
STM32L496G-DISCOVERY SRAM

Defines

#define | SRAM_ADDR_SETUP_TIME 5 /* 60ns with a clock at 80 MHz (period of 12.5 ns) */
#define | SRAM_DATA_SETUP_TIME 3 /* 30ns with a clock at 80 MHz (period of 12.5 ns) */
#define | SRAM_TURN_AROUND_TIME 1 /* 5ns with a clock at 80 MHz (perido of 12.5 ns) */

Define Documentation

#define SRAM_ADDR_SETUP_TIME 5 /* 60ns with a clock at 80 MHz (period of 12.5 ns) */

Definition at line 87 of file stm32l496g_discovery_sram.c.

Referenced by BSP_SRAM_Init().

#define SRAM_DATA_SETUP_TIME 3 /* 30ns with a clock at 80 MHz (period of 12.5 ns) */

Definition at line 88 of file stm32l496g_discovery_sram.c.

Referenced by BSP_SRAM_Init().

#define SRAM_TURN_AROUND_TIME 1 /* 5ns with a clock at 80 MHz (perido of 12.5 ns) */

Definition at line 89 of file stm32l496g_discovery_sram.c.

Referenced by BSP_SRAM_Init().


STM32L496G-Discovery BSP User Manual: Private Functions

Functions
Private Functions
STM32L496G-DISCOVERY SRAM

Functions

static void SRAM_MspInit (void)
Initializes SRAM MSP.

Function Documentation

static void SRAM_MspInit ( void ) [static]

Initializes SRAM MSP.

Return values:
None

Definition at line 245 of file stm32l496g_discovery_sram.c.

References SRAM_DMAx_CHANNEL, SRAM_DMAx_CLK_ENABLE, SRAM_DMAx_IRQn, and sramHandle.

Referenced by BSP_SRAM_Init().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L476G_EVAL_SRAM_Private_Functions

STM32L476G_EVAL_SRAM_Private_Functions
Exported Functions
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Functions

Modules | Functions
Exported Functions
STM32L496G-DISCOVERY SRAM

Modules

STM32L476G_EVAL_SRAM_Private_Functions

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
void | BSP_SRAM_DMA_IRQHandler (void)
Handles SRAM DMA transfer interrupt request.

Function Documentation

void BSP_SRAM_DMA_IRQHandler ( void )

Handles SRAM DMA transfer interrupt request.

Return values:
None

Definition at line 232 of file stm32l496g_discovery_sram.c.

References sramHandle.

uint8_t BSP_SRAM_Init ( void )

Initializes the SRAM device.

Return values:
SRAM status

Definition at line 116 of file stm32l496g_discovery_sram.c.

References SRAM_ADDR_SETUP_TIME, SRAM_DATA_SETUP_TIME, SRAM_ERROR, SRAM_MspInit(), SRAM_OK, SRAM_TURN_AROUND_TIME, sramHandle, and Timing.

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

Reads an amount of data from the SRAM device in polling mode.

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

Definition at line 159 of file stm32l496g_discovery_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

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

Reads an amount of data from the SRAM device in DMA mode.

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

Definition at line 178 of file stm32l496g_discovery_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

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

Writes an amount of data from the SRAM device in polling mode.

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

Definition at line 197 of file stm32l496g_discovery_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

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

Writes an amount of data from the SRAM device in DMA mode.

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

Definition at line 216 of file stm32l496g_discovery_sram.c.

References SRAM_ERROR, SRAM_OK, and sramHandle.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32L496G-DISCOVERY SRAM

Defines

#define | SRAM_OK 0x00
SRAM status structure definition.
#define | SRAM_ERROR 0x01
#define | SRAM_DEVICE_ADDR ((uint32_t)0x64000000)
#define | SRAM_DEVICE_SIZE ((uint32_t)0x80000) /* SRAM device size in MBytes */
#define | SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
#define | SRAM_DMAx_CHANNEL DMA1_Channel1
#define | SRAM_DMAx_IRQn DMA1_Channel1_IRQn
#define | SRAM_DMAx_IRQHandler DMA1_Channel1_IRQHandler

Define Documentation

#define SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE

Definition at line 63 of file stm32l496g_discovery_sram.h.

#define SRAM_DEVICE_ADDR ((uint32_t)0x64000000)

Definition at line 57 of file stm32l496g_discovery_sram.h.

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

Definition at line 58 of file stm32l496g_discovery_sram.h.

#define SRAM_DMAx_CHANNEL DMA1_Channel1

Definition at line 71 of file stm32l496g_discovery_sram.h.

Referenced by SRAM_MspInit().

#define SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE

Definition at line 70 of file stm32l496g_discovery_sram.h.

Referenced by SRAM_MspInit().

#define SRAM_DMAx_IRQHandler DMA1_Channel1_IRQHandler

Definition at line 73 of file stm32l496g_discovery_sram.h.

#define SRAM_DMAx_IRQn DMA1_Channel1_IRQn

Definition at line 72 of file stm32l496g_discovery_sram.h.

Referenced by SRAM_MspInit().

#define SRAM_ERROR 0x01

Definition at line 55 of file stm32l496g_discovery_sram.h.

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

#define SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16

Definition at line 61 of file stm32l496g_discovery_sram.h.

#define SRAM_OK 0x00

SRAM status structure definition.

Definition at line 54 of file stm32l496g_discovery_sram.h.

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

#define SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE

Definition at line 66 of file stm32l496g_discovery_sram.h.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Private Types Definitions

STM32L496G_DISCOVERY_CAMERA Private Types Definitions
STM32L496G_DISCOVERY_CAMERA
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Private Defines

Defines
STM32L496G_DISCOVERY_CAMERA Private Defines
STM32L496G_DISCOVERY_CAMERA

Defines

#define | CAMERA_VGA_RES_X 640
#define | CAMERA_VGA_RES_Y 480
#define | CAMERA_480x272_RES_X 480
#define | CAMERA_480x272_RES_Y 272
#define | CAMERA_QVGA_RES_X 320
#define | CAMERA_QVGA_RES_Y 240
#define | CAMERA_QQVGA_RES_X 160
#define | CAMERA_QQVGA_RES_Y 120

Define Documentation

#define CAMERA_480x272_RES_X 480

Definition at line 74 of file stm32l496g_discovery_camera.c.

#define CAMERA_480x272_RES_Y 272

Definition at line 75 of file stm32l496g_discovery_camera.c.

#define CAMERA_QQVGA_RES_X 160

Definition at line 78 of file stm32l496g_discovery_camera.c.

#define CAMERA_QQVGA_RES_Y 120

Definition at line 79 of file stm32l496g_discovery_camera.c.

#define CAMERA_QVGA_RES_X 320

Definition at line 76 of file stm32l496g_discovery_camera.c.

#define CAMERA_QVGA_RES_Y 240

Definition at line 77 of file stm32l496g_discovery_camera.c.

#define CAMERA_VGA_RES_X 640

Definition at line 72 of file stm32l496g_discovery_camera.c.

#define CAMERA_VGA_RES_Y 480

Definition at line 73 of file stm32l496g_discovery_camera.c.


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Private Macros

STM32L496G_DISCOVERY_CAMERA Private Macros
STM32L496G_DISCOVERY_CAMERA
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Private Variables

Variables
STM32L496G_DISCOVERY_CAMERA Private Variables
STM32L496G_DISCOVERY_CAMERA

Variables

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

Variable Documentation

CAMERA_DrvTypeDef* camera_drv

Definition at line 95 of file stm32l496g_discovery_camera.c.

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

uint32_t CameraCurrentResolution [static]

Definition at line 97 of file stm32l496g_discovery_camera.c.

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

uint32_t CameraHwAddress [static]

Definition at line 100 of file stm32l496g_discovery_camera.c.

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

DCMI_HandleTypeDef hDcmiHandler

Definition at line 94 of file stm32l496g_discovery_camera.c.

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


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Private Function Prototypes

STM32L496G_DISCOVERY_CAMERA Private Function Prototypes
STM32L496G_DISCOVERY_CAMERA
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Exported Functions

Functions
STM32L496G_DISCOVERY_CAMERA Exported Functions
STM32L496G_DISCOVERY_CAMERA | STM32L496G-DISCOVERY

Functions

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

Function Documentation

void BSP_CAMERA_BlackWhiteConfig ( uint32_t Mode )

Configures the camera white balance.

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

Definition at line 338 of file stm32l496g_discovery_camera.c.

References camera_drv, and CameraHwAddress.

void BSP_CAMERA_ColorEffectConfig ( uint32_t Effect )

Configures the camera color effect.

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

Definition at line 356 of file stm32l496g_discovery_camera.c.

References camera_drv, and CameraHwAddress.

void BSP_CAMERA_ContinuousStart ( uint8_t * buff )

Starts the camera capture in continuous mode.

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

Definition at line 224 of file stm32l496g_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiHandler.

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

Configures the camera contrast and brightness.

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

Definition at line 320 of file stm32l496g_discovery_camera.c.

References camera_drv, and CameraHwAddress.

uint8_t BSP_CAMERA_DeInit ( void )

DeInitializes the camera.

Return values:
Camera status

Definition at line 210 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_MspDeInit(), CAMERA_OK, and hDcmiHandler.

void BSP_CAMERA_ErrorCallback ( void )

Error callback.

Return values:
None

Definition at line 590 of file stm32l496g_discovery_camera.c.

Referenced by HAL_DCMI_ErrorCallback().

void BSP_CAMERA_FrameEventCallback ( void )

Frame Event callback.

Return values:
None

Definition at line 569 of file stm32l496g_discovery_camera.c.

Referenced by HAL_DCMI_FrameEventCallback().

uint8_t BSP_CAMERA_Init ( uint32_t Resolution )

Initializes the camera.

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

Definition at line 124 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_MspInit(), BSP_IO_Init(), camera_drv, CAMERA_ERROR, CAMERA_I2C_ADDRESS, CAMERA_NOT_SUPPORTED, CAMERA_OK, CameraCurrentResolution, CameraHwAddress, hDcmiHandler, and MFX_IO_Write().

void BSP_CAMERA_LineEventCallback ( void )

Line Event callback.

Return values:
None

Definition at line 527 of file stm32l496g_discovery_camera.c.

Referenced by HAL_DCMI_LineEventCallback().

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

DeInitializes the DCMI MSP.

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

Definition at line 495 of file stm32l496g_discovery_camera.c.

Referenced by BSP_CAMERA_DeInit().

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

Initializes the DCMI MSP.

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

Definition at line 411 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_DMA_INSTANCE.

Referenced by BSP_CAMERA_Init().

void BSP_CAMERA_PwrDown ( void )

CAMERA power down.

Return values:
None

Definition at line 296 of file stm32l496g_discovery_camera.c.

References BSP_IO_WritePin(), and CAMERA_PWR_EN_PIN.

Referenced by BSP_CAMERA_Stop().

void BSP_CAMERA_PwrUp ( void )

CANERA power up.

Return values:
None

Definition at line 284 of file stm32l496g_discovery_camera.c.

References BSP_IO_WritePin(), and CAMERA_PWR_EN_PIN.

void BSP_CAMERA_Resume ( void )

Resume the CAMERA capture.

Return values:
None

Definition at line 255 of file stm32l496g_discovery_camera.c.

References hDcmiHandler.

void BSP_CAMERA_SnapshotStart ( uint8_t * buff )

Starts the camera capture in snapshot mode.

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

Definition at line 235 of file stm32l496g_discovery_camera.c.

References CameraCurrentResolution, GetSize(), and hDcmiHandler.

uint8_t BSP_CAMERA_Stop ( void )

Stop the CAMERA capture.

Return values:
Camera status

Definition at line 265 of file stm32l496g_discovery_camera.c.

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

void BSP_CAMERA_Suspend ( void )

Suspend the CAMERA capture.

Return values:
None

Definition at line 245 of file stm32l496g_discovery_camera.c.

References hDcmiHandler.

void BSP_CAMERA_VsyncEventCallback ( void )

VSYNC Event callback.

Return values:
None

Definition at line 548 of file stm32l496g_discovery_camera.c.

Referenced by HAL_DCMI_VsyncEventCallback().

static uint32_t GetSize ( uint32_t resolution ) [static]

Get the capture size in pixels unit.

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

Definition at line 369 of file stm32l496g_discovery_camera.c.

Referenced by BSP_CAMERA_ContinuousStart(), and BSP_CAMERA_SnapshotStart().

void HAL_DCMI_ErrorCallback ( DCMI_HandleTypeDef * hdcmi )

Error callback.

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

Definition at line 581 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_ErrorCallback().

void HAL_DCMI_FrameEventCallback ( DCMI_HandleTypeDef * hdcmi )

Frame event callback.

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

Definition at line 560 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_FrameEventCallback().

void HAL_DCMI_LineEventCallback ( DCMI_HandleTypeDef * hdcmi )

Line event callback.

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

Definition at line 518 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_LineEventCallback().

void HAL_DCMI_VsyncEventCallback ( DCMI_HandleTypeDef * hdcmi )

VSYNC event callback.

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

Definition at line 539 of file stm32l496g_discovery_camera.c.

References BSP_CAMERA_VsyncEventCallback().


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Exported Types

Defines | Enumerations
STM32L496G_DISCOVERY_CAMERA Exported Types
STM32L496G_DISCOVERY_CAMERA

Defines

#define | RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
#define | RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
#define | RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
#define | RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Enumerations

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

Define Documentation

#define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */

Definition at line 64 of file stm32l496g_discovery_camera.h.

#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */

Definition at line 65 of file stm32l496g_discovery_camera.h.

#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */

Definition at line 66 of file stm32l496g_discovery_camera.h.

#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */

Definition at line 67 of file stm32l496g_discovery_camera.h.

Enumeration Type Documentation

enum Camera_StatusTypeDef

Camera State structures definition.

Enumerator:
CAMERA_OK
CAMERA_ERROR
CAMERA_TIMEOUT
CAMERA_NOT_DETECTED
CAMERA_NOT_SUPPORTED

Definition at line 53 of file stm32l496g_discovery_camera.h.


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA Exported Constants

Defines
STM32L496G_DISCOVERY_CAMERA Exported Constants
STM32L496G_DISCOVERY_CAMERA

Defines

#define | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Channel6_IRQHandler
#define | BSP_CAMERA_DMA_IRQn DMA2_Channel6_IRQn
#define | BSP_CAMERA_DMA_INSTANCE DMA2_Channel6

Define Documentation

#define BSP_CAMERA_DMA_INSTANCE DMA2_Channel6

Definition at line 78 of file stm32l496g_discovery_camera.h.

Referenced by BSP_CAMERA_MspInit().

#define BSP_CAMERA_DMA_IRQHandler DMA2_Channel6_IRQHandler

Definition at line 76 of file stm32l496g_discovery_camera.h.

#define BSP_CAMERA_DMA_IRQn DMA2_Channel6_IRQn

Definition at line 77 of file stm32l496g_discovery_camera.h.

#define BSP_CAMERA_IRQHandler DCMI_IRQHandler

Definition at line 75 of file stm32l496g_discovery_camera.h.


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCOVERY_CAMERA

Modules | Defines
STM32L496G_DISCOVERY_CAMERA
STM32L496G-DISCOVERY

Modules

STM32L496G_DISCOVERY_CAMERA Private Types Definitions
STM32L496G_DISCOVERY_CAMERA Private Defines
STM32L496G_DISCOVERY_CAMERA Private Macros
STM32L496G_DISCOVERY_CAMERA Private Variables
STM32L496G_DISCOVERY_CAMERA Private Function Prototypes
STM32L496G_DISCOVERY_CAMERA Exported Functions
STM32L496G_DISCOVERY_CAMERA Exported Types
STM32L496G_DISCOVERY_CAMERA Exported Constants

Defines

#define CAMERA_PWR_EN_PIN IO1_PIN_6
Camera special pins.

Define Documentation

#define CAMERA_PWR_EN_PIN IO1_PIN_6

Camera special pins.

Definition at line 88 of file stm32l496g_discovery_camera.h.

Referenced by BSP_CAMERA_PwrDown(), and BSP_CAMERA_PwrUp().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Constants

Private Constants
STM32L496G-DISCO IO
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Macros

Private Macros
STM32L496G-DISCO IO
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Private Variables

Variables
Private Variables
STM32L496G-DISCO IO

Variables

static IO_DrvTypeDef * io1_driver

Variable Documentation

IO_DrvTypeDef* io1_driver [static]

Definition at line 94 of file stm32l496g_discovery_io.c.

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


STM32L496G-Discovery BSP User Manual: Private Functions

Private Functions
STM32L496G-DISCO IO
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCO_IO_Exported_Functions

Functions
STM32L496G-DISCO_IO_Exported_Functions
STM32L496G-DISCO IO

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (GPIOs, clocks..).
uint32_t | BSP_IO_ITGetStatus (uint32_t IO_Pin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (uint32_t IO_Pin)
Clears the selected IO IT pending bit.
uint8_t | BSP_IO_ConfigPin (uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IO_Pin, uint8_t PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IO_Pin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IO_Pin)
Toggles the selected pins state.

Function Documentation

uint8_t BSP_IO_ConfigPin | ( | uint32_t | IO_Pin,
 |  | IO_ModeTypedef | IO_Mode
 | ) |  |

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

Parameters:
IO_Pin,: Output pin to be set or reset. This parameter can be any combination of the IO pins.
IO_Mode,: IO pin mode to configure This parameter can be one of the following values:
  • IO_MODE_INPUT
  • IO_MODE_OUTPUT
  • IO_MODE_IT_RISING_EDGE
  • IO_MODE_IT_FALLING_EDGE
  • IO_MODE_IT_LOW_LEVEL
  • IO_MODE_IT_HIGH_LEVEL
Return values:
IO_OK,: if all initializations are OK. Other value if error.

Definition at line 214 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, IO1_PIN_OFFSET, and IO_OK.

Referenced by BSP_IDD_GetValue(), BSP_IDD_StartMeasure(), BSP_LCD_MspInit(), BSP_LED_Init(), BSP_SD_ITConfig(), SD_Detect_MspDeInit(), SD_Detect_MspInit(), and TS_IO_Init().

uint8_t BSP_IO_Init ( void )

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

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

Definition at line 127 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, IO1_PIN_OFFSET, IO_ALREADY_INITIALIZED, IO_ERROR, and IO_OK.

Referenced by BSP_CAMERA_Init(), BSP_LCD_InitEx(), BSP_LCD_MspInit(), BSP_LED_Init(), SD_Detect_MspDeInit(), and SD_Detect_MspInit().

void BSP_IO_ITClear ( uint32_t IO_Pin )

Clears the selected IO IT pending bit.

Parameters:
IO_Pin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
None

Definition at line 189 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

uint32_t BSP_IO_ITGetStatus ( uint32_t IO_Pin )

Gets the selected pins IT status.

Parameters:
IO_Pin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
Status of the checked IO pin(s).

Definition at line 170 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

uint32_t BSP_IO_ReadPin ( uint32_t IO_Pin )

Gets the selected pins current state.

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

Definition at line 251 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_SD_IsDetected(), and BSP_SD_ITConfig().

void BSP_IO_TogglePin ( uint32_t IO_Pin )

Toggles the selected pins state.

Parameters:
IO_Pin,: Selected pins to toggle. This parameter can be any combination of the IO pins.
Return values:
None

Definition at line 271 of file stm32l496g_discovery_io.c.

References BSP_IO_WritePin(), io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_LED_Toggle().

void BSP_IO_WritePin | ( | uint32_t | IO_Pin,
 |  | uint8_t | PinState
 | ) |  |

Sets the selected pins state.

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

Definition at line 234 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_CAMERA_PwrDown(), BSP_CAMERA_PwrUp(), BSP_IDD_GetValue(), BSP_IDD_StartMeasure(), BSP_IO_TogglePin(), BSP_LCD_Reset(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and TS_IO_Init().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Types

Enumerations
Exported Types
STM32L496G_DISCO_IO

Enumerations

enum IO_StatusTypeDef { IO_OK = 0x00, IO_ERROR = 0x01, IO_TIMEOUT = 0x02, IO_ALREADY_INITIALIZED = 0x03 }

Enumeration Type Documentation

enum IO_StatusTypeDef
Enumerator:
IO_OK
IO_ERROR
IO_TIMEOUT
IO_ALREADY_INITIALIZED

Definition at line 50 of file stm32l496g_discovery_io.h.


STM32L496G-Discovery BSP User Manual: Exported Constants

Defines
Exported Constants
STM32L496G_DISCO_IO

Defines

#define | IO1_PIN_OFFSET 0
#define | IO1_PIN_0 (uint32_t)(0x00000001 << IO1_PIN_OFFSET)
#define | IO1_PIN_1 (uint32_t)(0x00000002 << IO1_PIN_OFFSET)
#define | IO1_PIN_2 (uint32_t)(0x00000004 << IO1_PIN_OFFSET)
#define | IO1_PIN_3 (uint32_t)(0x00000008 << IO1_PIN_OFFSET)
#define | IO1_PIN_4 (uint32_t)(0x00000010 << IO1_PIN_OFFSET)
#define | IO1_PIN_5 (uint32_t)(0x00000020 << IO1_PIN_OFFSET)
#define | IO1_PIN_6 (uint32_t)(0x00000040 << IO1_PIN_OFFSET)
#define | IO1_PIN_7 (uint32_t)(0x00000080 << IO1_PIN_OFFSET)
#define | IO1_PIN_8 (uint32_t)(0x00000100 << IO1_PIN_OFFSET)
#define | AGPIO_PIN_0 (uint32_t)(0x00010000 << IO1_PIN_OFFSET)
#define | AGPIO_PIN_1 (uint32_t)(0x00020000 << IO1_PIN_OFFSET)
#define | IO1_PIN_ALL (uint32_t)(0x000301FF << IO1_PIN_OFFSET)

Define Documentation

#define AGPIO_PIN_0 (uint32_t)(0x00010000 << IO1_PIN_OFFSET)

Definition at line 80 of file stm32l496g_discovery_io.h.

#define AGPIO_PIN_1 (uint32_t)(0x00020000 << IO1_PIN_OFFSET)

Definition at line 81 of file stm32l496g_discovery_io.h.

#define IO1_PIN_0 (uint32_t)(0x00000001 << IO1_PIN_OFFSET)

Definition at line 71 of file stm32l496g_discovery_io.h.

#define IO1_PIN_1 (uint32_t)(0x00000002 << IO1_PIN_OFFSET)

Definition at line 72 of file stm32l496g_discovery_io.h.

#define IO1_PIN_2 (uint32_t)(0x00000004 << IO1_PIN_OFFSET)

Definition at line 73 of file stm32l496g_discovery_io.h.

#define IO1_PIN_3 (uint32_t)(0x00000008 << IO1_PIN_OFFSET)

Definition at line 74 of file stm32l496g_discovery_io.h.

#define IO1_PIN_4 (uint32_t)(0x00000010 << IO1_PIN_OFFSET)

Definition at line 75 of file stm32l496g_discovery_io.h.

#define IO1_PIN_5 (uint32_t)(0x00000020 << IO1_PIN_OFFSET)

Definition at line 76 of file stm32l496g_discovery_io.h.

#define IO1_PIN_6 (uint32_t)(0x00000040 << IO1_PIN_OFFSET)

Definition at line 77 of file stm32l496g_discovery_io.h.

#define IO1_PIN_7 (uint32_t)(0x00000080 << IO1_PIN_OFFSET)

Definition at line 78 of file stm32l496g_discovery_io.h.

#define IO1_PIN_8 (uint32_t)(0x00000100 << IO1_PIN_OFFSET)

Definition at line 79 of file stm32l496g_discovery_io.h.

#define IO1_PIN_ALL (uint32_t)(0x000301FF << IO1_PIN_OFFSET)

Definition at line 83 of file stm32l496g_discovery_io.h.

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

#define IO1_PIN_OFFSET 0

Definition at line 67 of file stm32l496g_discovery_io.h.

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


STM32L496G-Discovery BSP User Manual: Exported Functions

Functions
Exported Functions
STM32L496G_DISCO_IO

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (GPIOs, clocks..).
void | BSP_IO_ITClear (uint32_t IO_Pin)
Clears the selected IO IT pending bit.
uint32_t | BSP_IO_ITGetStatus (uint32_t IO_Pin)
Gets the selected pins IT status.
uint8_t | BSP_IO_ConfigPin (uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IO_Pin, uint8_t PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IO_Pin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IO_Pin)
Toggles the selected pins state.

Function Documentation

uint8_t BSP_IO_ConfigPin | ( | uint32_t | IO_Pin,
 |  | IO_ModeTypedef | IO_Mode
 | ) |  |

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

Parameters:
IO_Pin,: Output pin to be set or reset. This parameter can be any combination of the IO pins.
IO_Mode,: IO pin mode to configure This parameter can be one of the following values:
  • IO_MODE_INPUT
  • IO_MODE_OUTPUT
  • IO_MODE_IT_RISING_EDGE
  • IO_MODE_IT_FALLING_EDGE
  • IO_MODE_IT_LOW_LEVEL
  • IO_MODE_IT_HIGH_LEVEL
Return values:
IO_OK,: if all initializations are OK. Other value if error.

Definition at line 214 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, IO1_PIN_OFFSET, and IO_OK.

Referenced by BSP_IDD_GetValue(), BSP_IDD_StartMeasure(), BSP_LCD_MspInit(), BSP_LED_Init(), BSP_SD_ITConfig(), SD_Detect_MspDeInit(), SD_Detect_MspInit(), and TS_IO_Init().

uint8_t BSP_IO_Init ( void )

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

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

Definition at line 127 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, IO1_PIN_OFFSET, IO_ALREADY_INITIALIZED, IO_ERROR, and IO_OK.

Referenced by BSP_CAMERA_Init(), BSP_LCD_InitEx(), BSP_LCD_MspInit(), BSP_LED_Init(), SD_Detect_MspDeInit(), and SD_Detect_MspInit().

void BSP_IO_ITClear ( uint32_t IO_Pin )

Clears the selected IO IT pending bit.

Parameters:
IO_Pin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
None

Definition at line 189 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

uint32_t BSP_IO_ITGetStatus ( uint32_t IO_Pin )

Gets the selected pins IT status.

Parameters:
IO_Pin,: Selected pins to check the status. This parameter can be any combination of the IO pins.
Return values:
Status of the checked IO pin(s).

Definition at line 170 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

uint32_t BSP_IO_ReadPin ( uint32_t IO_Pin )

Gets the selected pins current state.

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

Definition at line 251 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_SD_IsDetected(), and BSP_SD_ITConfig().

void BSP_IO_TogglePin ( uint32_t IO_Pin )

Toggles the selected pins state.

Parameters:
IO_Pin,: Selected pins to toggle. This parameter can be any combination of the IO pins.
Return values:
None

Definition at line 271 of file stm32l496g_discovery_io.c.

References BSP_IO_WritePin(), io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_LED_Toggle().

void BSP_IO_WritePin | ( | uint32_t | IO_Pin,
 |  | uint8_t | PinState
 | ) |  |

Sets the selected pins state.

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

Definition at line 234 of file stm32l496g_discovery_io.c.

References io1_driver, IO1_I2C_ADDRESS, IO1_PIN_ALL, and IO1_PIN_OFFSET.

Referenced by BSP_CAMERA_PwrDown(), BSP_CAMERA_PwrUp(), BSP_IDD_GetValue(), BSP_IDD_StartMeasure(), BSP_IO_TogglePin(), BSP_LCD_Reset(), BSP_LED_Init(), BSP_LED_Off(), BSP_LED_On(), and TS_IO_Init().


STM32L496G-Discovery BSP User Manual: TS Private Types Definitions

TS Private Types Definitions
STM32L496G-DISCOVERY TS
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Private Types Defines

TS Private Types Defines
STM32L496G-DISCOVERY TS
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Private Macros

TS Private Macros
STM32L496G-DISCOVERY TS
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Imported Variables

Variables
TS Imported Variables
STM32L496G-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 100 of file stm32l496g_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 107 of file stm32l496g_discovery_ts.c.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Private Variables

Variables
TS Private Variables
STM32L496G-DISCOVERY TS

Variables

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

Variable Documentation

uint8_t I2C_Address = 0 [static]

Definition at line 95 of file stm32l496g_discovery_ts.c.

Referenced by BSP_TS_GetState(), BSP_TS_InitEx(), BSP_TS_ITConfig(), and BSP_TS_ITDeConfig().

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 100 of file stm32l496g_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 107 of file stm32l496g_discovery_ts.c.

uint8_t TS_orientation = TS_ORIENTATION_UNDEFINED [static]

Definition at line 97 of file stm32l496g_discovery_ts.c.

Referenced by BSP_TS_GetOrientation(), and BSP_TS_InitEx().

TS_DrvTypeDef* tsDriver [static]

Definition at line 94 of file stm32l496g_discovery_ts.c.

Referenced by BSP_TS_GetState(), BSP_TS_InitEx(), BSP_TS_ITConfig(), and BSP_TS_ITDeConfig().

uint8_t tsOrientation = TS_SWAP_NONE [static]

Definition at line 96 of file stm32l496g_discovery_ts.c.

Referenced by BSP_TS_GetState(), and BSP_TS_InitEx().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Private Function Prototypes

TS Private Function Prototypes
STM32L496G-DISCOVERY TS
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Private Functions

Functions
TS Private Functions
TS Public Functions

Functions

uint8_t | BSP_TS_GetOrientation (void)
__weak void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.
__weak void | BSP_TS_INT_MspDeInit (void)
Initializes the TS_INT pin MSP.

Function Documentation

uint8_t BSP_TS_GetOrientation ( void )

Definition at line 436 of file stm32l496g_discovery_ts.c.

References TS_orientation.

__weak void BSP_TS_INT_MspDeInit ( void )

Initializes the TS_INT pin MSP.

Parameters:
None
Return values:
None

Definition at line 476 of file stm32l496g_discovery_ts.c.

References TS_INT_EXTI_IRQn, TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITDeConfig().

__weak void BSP_TS_INT_MspInit ( void )

Initializes the TS_INT pin MSP.

Parameters:
None
Return values:
None

Definition at line 446 of file stm32l496g_discovery_ts.c.

References TS_INT_EXTI_IRQn, TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITConfig().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Public Functions

Modules | Functions
TS Public Functions
STM32L496G-DISCOVERY TS

Modules

TS Private Functions

Functions

uint8_t | BSP_TS_Init (uint16_t ts_SizeX, uint16_t ts_SizeY)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..).
uint8_t | BSP_TS_InitEx (uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..) with a given orientation.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITDeConfig (void)
deConfigures and enables the touch screen interrupts.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.

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 250 of file stm32l496g_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_ERROR, TS_MAX_NB_TOUCH, TS_OK, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, and tsOrientation.

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 136 of file stm32l496g_discovery_ts.c.

References BSP_TS_InitEx(), and TS_ORIENTATION_LANDSCAPE.

uint8_t BSP_TS_InitEx | ( | uint16_t | ts_SizeX,
 |  | uint16_t | ts_SizeY,
 |  | uint8_t | orientation
 | ) |  |

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

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

Definition at line 150 of file stm32l496g_discovery_ts.c.

References I2C_Address, TS_DEVICE_NOT_FOUND, TS_I2C_ADDRESS, TS_OK, TS_orientation, TS_ORIENTATION_LANDSCAPE, TS_ORIENTATION_PORTRAIT, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, and tsOrientation.

Referenced by BSP_TS_Init().

uint8_t BSP_TS_ITConfig ( void )

Configures and enables the touch screen interrupts.

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

Definition at line 208 of file stm32l496g_discovery_ts.c.

References BSP_TS_INT_MspInit(), I2C_Address, TS_OK, and tsDriver.

uint8_t BSP_TS_ITDeConfig ( void )

deConfigures and enables the touch screen interrupts.

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

Definition at line 228 of file stm32l496g_discovery_ts.c.

References BSP_TS_INT_MspDeInit(), I2C_Address, TS_OK, and tsDriver.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Exported Constants

Defines
TS Exported Constants
STM32L496G-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 | TS_ORIENTATION_PORTRAIT ((uint8_t) 0)
#define | TS_ORIENTATION_LANDSCAPE ((uint8_t) 1)
#define | TS_ORIENTATION_UNDEFINED ((uint8_t) 2)

Define Documentation

#define TS_IRQ_PENDING ((uint8_t) 1)

Definition at line 56 of file stm32l496g_discovery_ts.h.

#define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)

With FT6206 : maximum 2 touches detected simultaneously.

Definition at line 53 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_GetState().

#define TS_NO_IRQ_PENDING ((uint8_t) 0)

Definition at line 55 of file stm32l496g_discovery_ts.h.

#define TS_ORIENTATION_LANDSCAPE ((uint8_t) 1)

Definition at line 64 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_Init(), and BSP_TS_InitEx().

#define TS_ORIENTATION_PORTRAIT ((uint8_t) 0)

Definition at line 63 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_InitEx().

#define TS_ORIENTATION_UNDEFINED ((uint8_t) 2)

Definition at line 65 of file stm32l496g_discovery_ts.h.

#define TS_SWAP_NONE ((uint8_t) 0x01)

Definition at line 58 of file stm32l496g_discovery_ts.h.

#define TS_SWAP_X ((uint8_t) 0x02)

Definition at line 59 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_InitEx().

#define TS_SWAP_XY ((uint8_t) 0x08)

Definition at line 61 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_InitEx().

#define TS_SWAP_Y ((uint8_t) 0x04)

Definition at line 60 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_GetState(), and BSP_TS_InitEx().

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Exported Types

Data Structures | Enumerations
TS Exported Types
STM32L496G-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 110 of file stm32l496g_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 97 of file stm32l496g_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 127 of file stm32l496g_discovery_ts.h.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS_StateTypeDef Struct Reference

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

TS_StateTypeDef Define TS State structure. More...

#include <stm32l496g_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 77 of file stm32l496g_discovery_ts.h.

Field Documentation

uint8_t TS_StateTypeDef::touchDetected

Total number of active touches detected at last scan

Definition at line 79 of file stm32l496g_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 80 of file stm32l496g_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 81 of file stm32l496g_discovery_ts.h.

Referenced by BSP_TS_GetState().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: TS Exported Functions

Functions
TS Exported Functions
STM32L496G-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_InitEx (uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..) with a given orientation.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_GetOrientation (void)
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITDeConfig (void)
deConfigures and enables the touch screen interrupts.
void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.
void | BSP_TS_INT_MspDeInit (void)
Initializes the TS_INT pin MSP.

Function Documentation

uint8_t BSP_TS_GetOrientation ( void )

Definition at line 436 of file stm32l496g_discovery_ts.c.

References TS_orientation.

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 250 of file stm32l496g_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_ERROR, TS_MAX_NB_TOUCH, TS_OK, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, and tsOrientation.

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 136 of file stm32l496g_discovery_ts.c.

References BSP_TS_InitEx(), and TS_ORIENTATION_LANDSCAPE.

uint8_t BSP_TS_InitEx | ( | uint16_t | ts_SizeX,
 |  | uint16_t | ts_SizeY,
 |  | uint8_t | orientation
 | ) |  |

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

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

Definition at line 150 of file stm32l496g_discovery_ts.c.

References I2C_Address, TS_DEVICE_NOT_FOUND, TS_I2C_ADDRESS, TS_OK, TS_orientation, TS_ORIENTATION_LANDSCAPE, TS_ORIENTATION_PORTRAIT, TS_SWAP_X, TS_SWAP_XY, TS_SWAP_Y, tsDriver, and tsOrientation.

Referenced by BSP_TS_Init().

void BSP_TS_INT_MspDeInit ( void )

Initializes the TS_INT pin MSP.

Parameters:
None
Return values:
None

Definition at line 476 of file stm32l496g_discovery_ts.c.

References TS_INT_EXTI_IRQn, TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITDeConfig().

void BSP_TS_INT_MspInit ( void )

Initializes the TS_INT pin MSP.

Parameters:
None
Return values:
None

Definition at line 446 of file stm32l496g_discovery_ts.c.

References TS_INT_EXTI_IRQn, TS_INT_GPIO_CLK_ENABLE, TS_INT_GPIO_PORT, and TS_INT_PIN.

Referenced by BSP_TS_ITConfig().

uint8_t BSP_TS_ITConfig ( void )

Configures and enables the touch screen interrupts.

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

Definition at line 208 of file stm32l496g_discovery_ts.c.

References BSP_TS_INT_MspInit(), I2C_Address, TS_OK, and tsDriver.

uint8_t BSP_TS_ITDeConfig ( void )

deConfigures and enables the touch screen interrupts.

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

Definition at line 228 of file stm32l496g_discovery_ts.c.

References BSP_TS_INT_MspDeInit(), I2C_Address, TS_OK, and tsDriver.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: dimming_config_s Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
dimming_config_s Struct Reference

Data Fields

uint8_t | ongoing
uint8_t | start
uint8_t | stop
uint8_t | step
uint8_t | delay

Detailed Description

Definition at line 61 of file stm32l496g_discovery_lcd.c.

Field Documentation

uint8_t dimming_config_s::delay

Definition at line 67 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingConfig(), and BSP_LCD_ScreenDimmingOn().

uint8_t dimming_config_s::ongoing

Definition at line 63 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingConfig(), BSP_LCD_ScreenDimmingOff(), and BSP_LCD_ScreenDimmingOn().

uint8_t dimming_config_s::start

Definition at line 64 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingConfig(), and BSP_LCD_ScreenDimmingOn().

uint8_t dimming_config_s::step

Definition at line 66 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingConfig(), and BSP_LCD_ScreenDimmingOn().

uint8_t dimming_config_s::stop

Definition at line 65 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingConfig(), and BSP_LCD_ScreenDimmingOn().

The documentation for this struct was generated from the following file:
  • stm32l496g_discovery_lcd.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • o
  • p
  • r
  • s
  • t
  • v
  • x
  • y
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • AudioDrv : AUDIO_OUT_TypeDef , AUDIO_IN_TypeDef

- b -

  • BackColor : LCD_DrawPropTypeDef
  • BitResolution : AUDIO_IN_TypeDef

- c -

  • CbError : AUDIO_OUT_TypeDef , AUDIO_IN_TypeDef
  • CbHalfTransfer : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef
  • CbTransferComplete : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef
  • ChannelNbr : AUDIO_IN_TypeDef

- d -

  • delay : dimming_config_s

- e -

  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info

- f -

  • FlashSize : QSPI_Info
  • Frequency : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef

- h -

  • hDfsdmLeftChannel : AUDIO_IN_TypeDef
  • hDfsdmRightChannel : AUDIO_IN_TypeDef
  • hDmaDfsdmLeft : AUDIO_IN_TypeDef
  • hDmaDfsdmRight : AUDIO_IN_TypeDef

- i -

  • InputDevice : AUDIO_IN_TypeDef

- l -

  • LeftRecBuff : AUDIO_IN_TypeDef

- o -

  • ongoing : dimming_config_s
  • OutputDevice : AUDIO_OUT_TypeDef

- p -

  • pFont : LCD_DrawPropTypeDef
  • pRecBuf : AUDIO_IN_TypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info

- r -

  • RAM : LCD_CONTROLLER_TypeDef
  • RecSize : AUDIO_IN_TypeDef
  • REG : LCD_CONTROLLER_TypeDef
  • RightRecBuff : AUDIO_IN_TypeDef

- s -

  • start : dimming_config_s
  • step : dimming_config_s
  • stop : dimming_config_s

- t -

  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef

- v -

  • Volume : AUDIO_OUT_TypeDef

- x -

  • X : Point

- y -

  • Y : Point
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • l
  • o
  • p
  • r
  • s
  • t
  • v
  • x
  • y

- a -

  • AudioDrv : AUDIO_OUT_TypeDef , AUDIO_IN_TypeDef

- b -

  • BackColor : LCD_DrawPropTypeDef
  • BitResolution : AUDIO_IN_TypeDef

- c -

  • CbError : AUDIO_OUT_TypeDef , AUDIO_IN_TypeDef
  • CbHalfTransfer : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef
  • CbTransferComplete : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef
  • ChannelNbr : AUDIO_IN_TypeDef

- d -

  • delay : dimming_config_s

- e -

  • EraseSectorSize : QSPI_Info
  • EraseSectorsNumber : QSPI_Info

- f -

  • FlashSize : QSPI_Info
  • Frequency : AUDIO_IN_TypeDef , AUDIO_OUT_TypeDef

- h -

  • hDfsdmLeftChannel : AUDIO_IN_TypeDef
  • hDfsdmRightChannel : AUDIO_IN_TypeDef
  • hDmaDfsdmLeft : AUDIO_IN_TypeDef
  • hDmaDfsdmRight : AUDIO_IN_TypeDef

- i -

  • InputDevice : AUDIO_IN_TypeDef

- l -

  • LeftRecBuff : AUDIO_IN_TypeDef

- o -

  • ongoing : dimming_config_s
  • OutputDevice : AUDIO_OUT_TypeDef

- p -

  • pFont : LCD_DrawPropTypeDef
  • pRecBuf : AUDIO_IN_TypeDef
  • ProgPageSize : QSPI_Info
  • ProgPagesNumber : QSPI_Info

- r -

  • RAM : LCD_CONTROLLER_TypeDef
  • RecSize : AUDIO_IN_TypeDef
  • REG : LCD_CONTROLLER_TypeDef
  • RightRecBuff : AUDIO_IN_TypeDef

- s -

  • start : dimming_config_s
  • step : dimming_config_s
  • stop : dimming_config_s

- t -

  • TextColor : LCD_DrawPropTypeDef
  • touchDetected : TS_StateTypeDef
  • touchX : TS_StateTypeDef
  • touchY : TS_StateTypeDef

- v -

  • Volume : AUDIO_OUT_TypeDef

- x -

  • X : Point

- y -

  • Y : Point
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_lcd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Data Structures | Defines | Typedefs | Functions | Variables
stm32l496g_discovery_lcd.c File Reference

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

#include "stm32l496g_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.

Data Structures

struct | dimming_config_s

Defines

#define | __DIMMING_CYCLE_VALUE(value) (uint32_t)((PERIOD_VALUE * value)/100)
#define | POLY_X(Z) ((int32_t)((Points + Z)->X))
#define | POLY_Y(Z) ((int32_t)((Points + Z)->Y))
#define | ABS(X) ((X) > 0 ? (X) : -(X))

Typedefs

typedef struct dimming_config_s | dimming_config_t

Functions

static void | DrawChar (uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
Draws a character on LCD.
static void | SetDisplayWindow (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Sets display window.
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).
uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t orientation)
Initializes the LCD with a given orientation.
void | BSP_LCD_Reset (void)
Reset the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
uint16_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
uint16_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetTextColor (uint16_t Color)
Sets the LCD text color.
void | BSP_LCD_SetBackColor (uint16_t Color)
Sets 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.
void | BSP_LCD_Clear (uint16_t Color)
Clears the hole LCD.
void | BSP_LCD_ClearStringLine (uint16_t Line)
Clears the selected line.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode)
Displays characters on the LCD.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a character on the LCD.
uint16_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawBitmap (uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
Draws a bitmap picture (16 bpp).
void | BSP_LCD_DrawRGBImage (uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
Draws RGB Image (16 bpp).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_DisplayOff (void)
Disables the display.
void | BSP_LCD_ScreenDimmingConfig (const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOn (void)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOff (void)
LCD screen dimming disable.
void | HAL_TIM_PWM_MspInit (TIM_HandleTypeDef *htim)
TIM MSP Initialization This function configures the hardware resources used for screen dimming:
uint8_t | BSP_LCD_GetOrientation (void)
__weak void | BSP_LCD_MspInit (void)
Initializes the LCD GPIO special pins MSP.
__weak void | BSP_LCD_MspDeInit (void)
DeInitializes LCD GPIO special pins MSP.

Variables

static uint32_t | bsp_lcd_initialized = 0
static uint8_t | LCD_orientation = LCD_ORIENTATION_UNDEFINED
uint32_t | dimming_on = 0
static dimming_config_t | dimming_config = { 0, 25, 5, 1, PULSE_DECREASE_DELAY }
TIM_HandleTypeDef | LCD_TimHandle
TIM_OC_InitTypeDef | LCD_sConfig
uint32_t | ts_io_init
FlagStatus | WakeUpFromStandby
FlagStatus | WakeUpFromShutdown
LCD_DrawPropTypeDef DrawProp
static LCD_DrvTypeDef * | LcdDrv

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_lcd.c.

Define Documentation

#define __DIMMING_CYCLE_VALUE ( value ) (uint32_t)((PERIOD_VALUE * value)/100)

Definition at line 70 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingOn().

Typedef Documentation

typedef struct dimming_config_s dimming_config_t

Variable Documentation

uint32_t bsp_lcd_initialized = 0 [static]

Definition at line 56 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_DeInit(), and BSP_LCD_InitEx().

dimming_config_t dimming_config = { 0, 25, 5, 1, PULSE_DECREASE_DELAY } [static]

Definition at line 71 of file stm32l496g_discovery_lcd.c.

uint32_t dimming_on = 0

Definition at line 59 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingOff(), and BSP_LCD_ScreenDimmingOn().

uint8_t LCD_orientation = LCD_ORIENTATION_UNDEFINED [static]

Definition at line 57 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_GetOrientation(), and BSP_LCD_InitEx().

TIM_OC_InitTypeDef LCD_sConfig

Definition at line 79 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingOn().

TIM_HandleTypeDef LCD_TimHandle

Definition at line 77 of file stm32l496g_discovery_lcd.c.

Referenced by BSP_LCD_ScreenDimmingOff(), and BSP_LCD_ScreenDimmingOn().


STM32L496G-Discovery BSP User Manual: Globals

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

- _ -

  • __DIMMING_CYCLE_VALUE : stm32l496g_discovery_lcd.c
  • __STM32L496G_DISCOVERY_BSP_VERSION : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_MAIN : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_RC : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_SUB1 : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_SUB2 : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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 : stm32l496g_discovery_lcd.c
  • AGPIO_PIN_0 : stm32l496g_discovery_io.h
  • AGPIO_PIN_1 : stm32l496g_discovery_io.h
  • Audio_CallbackTypeDef : stm32l496g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_LEFT_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_RIGHT_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_PIN : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DeInit() : stm32l496g_discovery_audio.c
  • AUDIO_DFSDMx_DMAx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_LEFT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_LEFT_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_RIGHT_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMIC_DATIN_PIN : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_Init() : stm32l496g_discovery_audio.c
  • AUDIO_DFSDMx_LEFT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_LEFT_FILTER : stm32l496g_discovery_audio.h
  • AUDIO_ERROR : stm32l496g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32l496g_discovery.h
  • AUDIO_IN_IRQ_PREPRIO : stm32l496g_discovery_audio.h
  • AUDIO_IO_DeInit() : stm32l496g_discovery.c
  • AUDIO_IO_Delay() : stm32l496g_discovery.c
  • AUDIO_IO_Init() : stm32l496g_discovery.c
  • AUDIO_IO_Read() : stm32l496g_discovery.c
  • AUDIO_IO_Write() : stm32l496g_discovery.c
  • AUDIO_OK : stm32l496g_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32l496g_discovery_audio.h
  • AUDIO_RESET_GPIO : stm32l496g_discovery.h
  • AUDIO_RESET_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • AUDIO_RESET_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • AUDIO_RESET_PIN : stm32l496g_discovery.h
  • AUDIO_SAIPLLConfig() : stm32l496g_discovery_audio.c
  • AUDIO_SAIx_DeInit() : stm32l496g_discovery_audio.c
  • AUDIO_SAIx_DMAx_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_Init() : stm32l496g_discovery_audio.c
  • AUDIO_SAIx_PLL_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_FS_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_GPIO_PORT : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_SCK_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_SD_PIN : stm32l496g_discovery_audio.h
  • AUDIO_TIMEOUT : stm32l496g_discovery_audio.h
  • AUDIODATA_SIZE : stm32l496g_discovery_audio.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_FREQUENCY_11K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_16K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_22K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_32K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_44K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_48K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_8K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_96K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_hDfsdmLeftFilter : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_hDfsdmRightFilter : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_hSai_Rx : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_hSai_Tx : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_IN_DeInit() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Init() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_InitEx() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Pause() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Record() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_RegisterCallbacks() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_SetFrequency() : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeAudioConfig() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_CIRCULARMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_DeInit() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_MONOMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_NORMALMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_Pause() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_RegisterCallbacks() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_STEREOMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_Stop() : stm32l496g_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_DMA_INSTANCE : stm32l496g_discovery_camera.h
  • BSP_CAMERA_DMA_IRQHandler : stm32l496g_discovery_camera.h
  • BSP_CAMERA_DMA_IRQn : stm32l496g_discovery_camera.h
  • BSP_CAMERA_ErrorCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Init() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_IRQHandler : stm32l496g_discovery_camera.h
  • BSP_CAMERA_LineEventCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32l496g_discovery_camera.c
  • BSP_COM_DeInit() : stm32l496g_discovery.c
  • BSP_COM_Init() : stm32l496g_discovery.c
  • BSP_ErrorHandler() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • BSP_GetVersion() : stm32l496g_discovery.c
  • BSP_IDD_ClearIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_Config() : stm32l496g_discovery_idd.c
  • BSP_IDD_DeInit() : stm32l496g_discovery_idd.c
  • BSP_IDD_DisableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_EnableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorClearIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorDisableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorEnableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorGetCode() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorGetITStatus() : stm32l496g_discovery_idd.c
  • BSP_IDD_GetITStatus() : stm32l496g_discovery_idd.c
  • BSP_IDD_GetValue() : stm32l496g_discovery_idd.c
  • BSP_IDD_Init() : stm32l496g_discovery_idd.c
  • BSP_IDD_LowPower() : stm32l496g_discovery_idd.c
  • BSP_IDD_Reset() : stm32l496g_discovery_idd.c
  • BSP_IDD_StartMeasure() : stm32l496g_discovery_idd.c
  • BSP_IDD_WakeUp() : stm32l496g_discovery_idd.c
  • BSP_IO_ConfigPin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_Init() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ITClear() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ITGetStatus() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ReadPin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_TogglePin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_WritePin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_JOY_DeInit() : stm32l496g_discovery.c
  • BSP_JOY_GetState() : stm32l496g_discovery.c
  • BSP_JOY_Init() : stm32l496g_discovery.c
  • BSP_LCD_Clear() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ClearStringLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DeInit() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayChar() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayOff() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayOn() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayStringAt() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayStringAtLine() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_DrawBitmap() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawCircle() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawEllipse() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawHLine() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_DrawLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawPixel() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_DrawPolygon() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawRect() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_DrawRGBImage() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawVLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillCircle() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillEllipse() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillRect() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_GetBackColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetFont() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_GetOrientation() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetTextColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetXSize() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetYSize() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_Init() : stm32l496g_discovery.c , stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_InitEx() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • bsp_lcd_initialized : stm32l496g_discovery_lcd.c
  • BSP_LCD_MspDeInit() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_MspInit() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_ReadPixel() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_Reset() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ScreenDimmingConfig() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_ScreenDimmingOff() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ScreenDimmingOn() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_SetFont() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LED_DeInit() : stm32l496g_discovery.c
  • BSP_LED_Init() : stm32l496g_discovery.c
  • BSP_LED_Off() : stm32l496g_discovery.c
  • BSP_LED_On() : stm32l496g_discovery.c
  • BSP_LED_Toggle() : stm32l496g_discovery.c
  • BSP_QSPI_DeInit() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_EnterDeepPowerDown() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Sector() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Init() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_LeaveDeepPowerDown() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Read() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_ResumeErase() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_SuspendErase() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Write() : stm32l496g_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32l496g_discovery_sd.c
  • BSP_SD_CardInfo : stm32l496g_discovery_sd.h
  • BSP_SD_DeInit() : stm32l496g_discovery_sd.c
  • BSP_SD_DMA_Rx_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_DMA_Tx_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_Erase() : stm32l496g_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32l496g_discovery_sd.c
  • BSP_SD_GetCardState() : stm32l496g_discovery_sd.c
  • BSP_SD_Init() : stm32l496g_discovery_sd.c
  • BSP_SD_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_IsDetected() : stm32l496g_discovery_sd.c
  • BSP_SD_ITConfig() : stm32l496g_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32l496g_discovery_sd.c
  • BSP_SD_MspInit() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32l496g_discovery_sd.c
  • BSP_SRAM_DMA_IRQHandler() : stm32l496g_discovery_sram.c
  • BSP_SRAM_Init() : stm32l496g_discovery_sram.c
  • BSP_SRAM_ReadData() : stm32l496g_discovery_sram.c
  • BSP_SRAM_ReadData_DMA() : stm32l496g_discovery_sram.c
  • BSP_SRAM_WriteData() : stm32l496g_discovery_sram.c
  • BSP_SRAM_WriteData_DMA() : stm32l496g_discovery_sram.c
  • BSP_TS_GetOrientation() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_GetState() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_Init() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_InitEx() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_INT_MspDeInit() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_ITConfig() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_ITDeConfig() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- c -

  • CAMERA_480x272_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_480x272_RES_Y : stm32l496g_discovery_camera.c
  • CAMERA_Delay() : stm32l496g_discovery.c
  • camera_drv : stm32l496g_discovery_camera.c
  • CAMERA_ERROR : stm32l496g_discovery_camera.h
  • CAMERA_I2C_ADDRESS : stm32l496g_discovery.h
  • CAMERA_IO_Init() : stm32l496g_discovery.c
  • CAMERA_IO_Read() : stm32l496g_discovery.c
  • CAMERA_IO_Write() : stm32l496g_discovery.c
  • CAMERA_NOT_DETECTED : stm32l496g_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32l496g_discovery_camera.h
  • CAMERA_OK : stm32l496g_discovery_camera.h
  • CAMERA_PWR_EN_PIN : stm32l496g_discovery_camera.h
  • CAMERA_QQVGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_QQVGA_RES_Y : stm32l496g_discovery_camera.c
  • CAMERA_QVGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_QVGA_RES_Y : stm32l496g_discovery_camera.c
  • Camera_StatusTypeDef : stm32l496g_discovery_camera.h
  • CAMERA_TIMEOUT : stm32l496g_discovery_camera.h
  • CAMERA_VGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_VGA_RES_Y : stm32l496g_discovery_camera.c
  • CameraCurrentResolution : stm32l496g_discovery_camera.c
  • CameraHwAddress : stm32l496g_discovery_camera.c
  • CENTER_MODE : stm32l496g_discovery_lcd.h
  • CODEC_AUDIO_POWER_OFF : stm32l496g_discovery.h
  • CODEC_AUDIO_POWER_ON : stm32l496g_discovery.h
  • CODEC_RESET_DELAY : stm32l496g_discovery_audio.h
  • COM1 : stm32l496g_discovery.h
  • COM_RX_AF : stm32l496g_discovery.c
  • COM_RX_PIN : stm32l496g_discovery.c
  • COM_RX_PORT : stm32l496g_discovery.c
  • COM_TX_AF : stm32l496g_discovery.c
  • COM_TX_PIN : stm32l496g_discovery.c
  • COM_TX_PORT : stm32l496g_discovery.c
  • COM_TypeDef : stm32l496g_discovery.h
  • COM_USART : stm32l496g_discovery.c
  • COMn : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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 : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_BIT_RESOLUTION : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_CHANNEL_NBR : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_FREQ : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_VOLUME : stm32l496g_discovery_audio.h
  • DFSDMClockDivider : stm32l496g_discovery_audio.c
  • DFSDMFilterOrder : stm32l496g_discovery_audio.c
  • DFSDMOverSampling : stm32l496g_discovery_audio.c
  • DFSDMRightBitShift : stm32l496g_discovery_audio.c
  • dimming_config : stm32l496g_discovery_lcd.c
  • dimming_config_t : stm32l496g_discovery_lcd.c
  • dimming_on : stm32l496g_discovery_lcd.c
  • DISCOVERY_AUDIO_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C : stm32l496g_discovery.h
  • DISCOVERY_COM1 : stm32l496g_discovery.h
  • DISCOVERY_COM1_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_IRQn : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_AF : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_PIN : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_AF : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_PIN : stm32l496g_discovery.h
  • DISCOVERY_COMx_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_AF : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1 : stm32l496g_discovery.h
  • DISCOVERY_I2C1_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_ER_IRQHandler : stm32l496g_discovery.h
  • DISCOVERY_I2C1_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C1_EV_IRQHandler : stm32l496g_discovery.h
  • DISCOVERY_I2C1_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C1_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C1_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1_TIMEOUT_MAX : stm32l496g_discovery.h
  • DISCOVERY_I2C2 : stm32l496g_discovery.h
  • DISCOVERY_I2C2_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C2_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C2_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C2_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C2_TIMEOUT_MAX : stm32l496g_discovery.h
  • DISCOVERY_IDD_AMPLI_GAIN : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT0_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT0_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT1_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT1_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT2_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT2_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT4_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT4_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_VDD_MIN : stm32l496g_discovery_idd.h
  • DISCOVERY_TS_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_TS_RCC_CLKSOURCE_I2C : stm32l496g_discovery.h
  • DISCOVERY_TS_RCC_PERIPHCLK_I2C : stm32l496g_discovery.h
  • DMA_MAX : stm32l496g_discovery_audio.h
  • DMA_MAX_SZE : stm32l496g_discovery_audio.h
  • DmaLeftRecBuffCplt : stm32l496g_discovery_audio.c
  • DmaLeftRecHalfBuffCplt : stm32l496g_discovery_audio.c
  • DmaRightRecBuffCplt : stm32l496g_discovery_audio.c
  • DmaRightRecHalfBuffCplt : stm32l496g_discovery_audio.c
  • DOWN_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_PORT : stm32l496g_discovery.h
  • DOWN_JOY_PIN : stm32l496g_discovery.h
  • DrawChar() : stm32l496g_discovery_lcd.c
  • DrawProp : stm32l496g_discovery_lcd.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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() : stm32l496g_discovery_lcd.c
  • FMC_BANK1_ADDR : stm32l496g_discovery.h
  • FMC_BANK1_BASE : stm32l496g_discovery.h
  • FMC_BANK1_Init() : stm32l496g_discovery.c
  • FMC_BANK1_MspDeInit() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • FMC_BANK1_MspInit() : stm32l496g_discovery.h , stm32l496g_discovery.c
  • FMC_BANK1_ReadData() : stm32l496g_discovery.c
  • FMC_BANK1_WriteData() : stm32l496g_discovery.c
  • FMC_BANK1_WriteReg() : stm32l496g_discovery.c
  • FMC_LCD_BASE : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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 : stm32l496g_discovery_ts.h
  • GEST_ID_MOVE_LEFT : stm32l496g_discovery_ts.h
  • GEST_ID_MOVE_RIGHT : stm32l496g_discovery_ts.h
  • GEST_ID_MOVE_UP : stm32l496g_discovery_ts.h
  • GEST_ID_NB_MAX : stm32l496g_discovery_ts.h
  • GEST_ID_NO_GESTURE : stm32l496g_discovery_ts.h
  • GEST_ID_ZOOM_IN : stm32l496g_discovery_ts.h
  • GEST_ID_ZOOM_OUT : stm32l496g_discovery_ts.h
  • GetSize() : stm32l496g_discovery_camera.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- h -

  • HAL_DCMI_ErrorCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DFSDM_ChannelMspDeInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_ChannelMspInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterErrorCallback() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterMspDeInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterMspInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_MspDeInit() : stm32l496g_discovery_audio.c
  • HAL_SAI_MspInit() : stm32l496g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32l496g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32l496g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32l496g_discovery_sd.c
  • HAL_TIM_PWM_MspInit() : stm32l496g_discovery_lcd.c
  • hAudioIn : stm32l496g_discovery_audio.c
  • hAudioOut : stm32l496g_discovery_audio.c
  • hDcmiHandler : stm32l496g_discovery_camera.c
  • hDmaSaiRx : stm32l496g_discovery_audio.c
  • hDmaSaiTx : stm32l496g_discovery_audio.c
  • hI2cAudioHandler : stm32l496g_discovery.c
  • hI2cCameraHandler : stm32l496g_discovery.c
  • hI2cTSHandler : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • I2c1Timeout : stm32l496g_discovery.c
  • I2C2_DeInit() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • I2C2_Error() : stm32l496g_discovery.c
  • I2C2_Init() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • I2C2_isDeviceReady() : stm32l496g_discovery.c
  • I2C2_MspDeInit() : stm32l496g_discovery.c
  • I2C2_MspInit() : stm32l496g_discovery.c
  • I2C2_ReadBuffer() : stm32l496g_discovery.c
  • I2C2_ReadData() : stm32l496g_discovery.c
  • I2C2_WriteBuffer() : stm32l496g_discovery.c
  • I2C2_WriteData() : stm32l496g_discovery.c
  • I2c2Handle : stm32l496g_discovery.c
  • I2c2Timeout : stm32l496g_discovery.c
  • I2C_Address : stm32l496g_discovery_ts.c
  • I2Cx_Error() : stm32l496g_discovery.c
  • I2Cx_Init() : stm32l496g_discovery.c
  • I2Cx_ReadMultiple() : stm32l496g_discovery.c
  • I2Cx_WriteMultiple() : stm32l496g_discovery.c
  • IDD_AMP_CONTROL_PIN : stm32l496g_discovery.h
  • IDD_ERROR : stm32l496g_discovery_idd.h
  • IDD_I2C_ADDRESS : stm32l496g_discovery.h
  • IDD_INT_EXTI_IRQn : stm32l496g_discovery.h
  • IDD_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • IDD_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • IDD_INT_GPIO_PORT : stm32l496g_discovery.h
  • IDD_INT_PIN : stm32l496g_discovery.h
  • IDD_OK : stm32l496g_discovery_idd.h
  • IDD_StatusTypeDef : stm32l496g_discovery_idd.h
  • IDD_TIMEOUT : stm32l496g_discovery_idd.h
  • IDD_WAKEUP_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • IDD_WAKEUP_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • IDD_WAKEUP_GPIO_PORT : stm32l496g_discovery.h
  • IDD_WAKEUP_PIN : stm32l496g_discovery.h
  • IDD_ZERO_VALUE : stm32l496g_discovery_idd.h
  • IddDrv : stm32l496g_discovery_idd.c
  • INPUT_DEVICE_ANALOG_MIC : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC1 : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC2 : stm32l496g_discovery_audio.h
  • io1_driver : stm32l496g_discovery_io.c
  • IO1_I2C_ADDRESS : stm32l496g_discovery.h
  • IO1_PIN_0 : stm32l496g_discovery_io.h
  • IO1_PIN_1 : stm32l496g_discovery_io.h
  • IO1_PIN_2 : stm32l496g_discovery_io.h
  • IO1_PIN_3 : stm32l496g_discovery_io.h
  • IO1_PIN_4 : stm32l496g_discovery_io.h
  • IO1_PIN_5 : stm32l496g_discovery_io.h
  • IO1_PIN_6 : stm32l496g_discovery_io.h
  • IO1_PIN_7 : stm32l496g_discovery_io.h
  • IO1_PIN_8 : stm32l496g_discovery_io.h
  • IO1_PIN_ALL : stm32l496g_discovery_io.h
  • IO1_PIN_OFFSET : stm32l496g_discovery_io.h
  • IO_ALREADY_INITIALIZED : stm32l496g_discovery_io.h
  • IO_ERROR : stm32l496g_discovery_io.h
  • IO_OK : stm32l496g_discovery_io.h
  • IO_StatusTypeDef : stm32l496g_discovery_io.h
  • IO_TIMEOUT : stm32l496g_discovery_io.h
  • IOE_Delay() : stm32l496g_discovery.c
  • IOE_Init() : stm32l496g_discovery.c
  • IOE_ITConfig() : stm32l496g_discovery.c
  • IOE_Read() : stm32l496g_discovery.c
  • IOE_ReadMultiple() : stm32l496g_discovery.c
  • IOE_Write() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- j -

  • JOY_ALL_PINS : stm32l496g_discovery.h
  • JOY_DOWN : stm32l496g_discovery.h
  • JOY_IRQn : stm32l496g_discovery.c
  • JOY_LEFT : stm32l496g_discovery.h
  • JOY_MODE_EXTI : stm32l496g_discovery.h
  • JOY_MODE_GPIO : stm32l496g_discovery.h
  • JOY_NONE : stm32l496g_discovery.h
  • JOY_PIN : stm32l496g_discovery.c
  • JOY_PORT : stm32l496g_discovery.c
  • JOY_RIGHT : stm32l496g_discovery.h
  • JOY_SEL : stm32l496g_discovery.h
  • JOY_UP : stm32l496g_discovery.h
  • JOYMode_TypeDef : stm32l496g_discovery.h
  • JOYn : stm32l496g_discovery.h
  • JOYState_TypeDef : stm32l496g_discovery.h
  • JOYx_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • JOYx_GPIO_CLK_ENABLE : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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_ADDR : stm32l496g_discovery.h
  • LCD_BL_CTRL_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BLACK : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32l496g_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32l496g_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_RED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32l496g_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32l496g_discovery_lcd.h
  • LCD_ERROR : stm32l496g_discovery_lcd.h
  • LCD_IO_Delay() : stm32l496g_discovery.c
  • LCD_IO_Init() : stm32l496g_discovery.c
  • LCD_IO_ReadData() : stm32l496g_discovery.c
  • LCD_IO_WriteData() : stm32l496g_discovery.c
  • LCD_IO_WriteMultipleData() : stm32l496g_discovery.c
  • LCD_IO_WriteReg() : stm32l496g_discovery.c
  • LCD_OK : stm32l496g_discovery_lcd.h
  • LCD_orientation : stm32l496g_discovery_lcd.c
  • LCD_ORIENTATION_LANDSCAPE : stm32l496g_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32l496g_discovery_lcd.h
  • LCD_ORIENTATION_UNDEFINED : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_PIN : stm32l496g_discovery_lcd.h
  • LCD_RST_PIN : stm32l496g_discovery_lcd.h
  • LCD_sConfig : stm32l496g_discovery_lcd.c
  • LCD_TE_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_TE_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_TE_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_TE_PIN : stm32l496g_discovery_lcd.h
  • LCD_TIMEOUT : stm32l496g_discovery_lcd.h
  • LCD_TimHandle : stm32l496g_discovery_lcd.c
  • LcdDrv : stm32l496g_discovery_lcd.c
  • LED1 : stm32l496g_discovery.h
  • LED1_PIN : stm32l496g_discovery.h
  • LED2 : stm32l496g_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • LED2_GPIO_PORT : stm32l496g_discovery.h
  • LED2_PIN : stm32l496g_discovery.h
  • LED_GREEN : stm32l496g_discovery.h
  • LED_ORANGE : stm32l496g_discovery.h
  • LED_PIN : stm32l496g_discovery.c
  • Led_TypeDef : stm32l496g_discovery.h
  • LEDn : stm32l496g_discovery.h
  • LEFT_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_PORT : stm32l496g_discovery.h
  • LEFT_JOY_PIN : stm32l496g_discovery.h
  • LEFT_MODE : stm32l496g_discovery_lcd.h
  • Line_ModeTypdef : stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • MFX_INT_EXTI_IRQn : stm32l496g_discovery.h
  • MFX_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • MFX_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • MFX_INT_GPIO_PORT : stm32l496g_discovery.h
  • MFX_INT_PIN : stm32l496g_discovery.h
  • MFX_IO_DeInit() : stm32l496g_discovery.c
  • MFX_IO_Delay() : stm32l496g_discovery.c
  • MFX_IO_EnableWakeupPin() : stm32l496g_discovery.c
  • MFX_IO_Init() : stm32l496g_discovery.c
  • MFX_IO_ITConfig() : stm32l496g_discovery.c
  • MFX_IO_Read() : stm32l496g_discovery.c
  • MFX_IO_ReadMultiple() : stm32l496g_discovery.c
  • MFX_IO_Wakeup() : stm32l496g_discovery.c
  • MFX_IO_Write() : stm32l496g_discovery.c
  • MFX_IO_WriteMultiple() : stm32l496g_discovery.c
  • MFX_WAKEUP_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • MFX_WAKEUP_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • MFX_WAKEUP_GPIO_PORT : stm32l496g_discovery.h
  • MFX_WAKEUP_PIN : stm32l496g_discovery.h
  • MSD_ERROR : stm32l496g_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32l496g_discovery_sd.h
  • MSD_OK : stm32l496g_discovery_sd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • PERIOD_VALUE : stm32l496g_discovery_lcd.h
  • POLY_X : stm32l496g_discovery_lcd.c
  • POLY_Y : stm32l496g_discovery_lcd.c
  • pPoint : stm32l496g_discovery_lcd.h
  • PULSE_DECREASE_DELAY : stm32l496g_discovery_lcd.h
  • PULSE_DECREASE_START : stm32l496g_discovery_lcd.h
  • PULSE_VALUE : stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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() : stm32l496g_discovery_qspi.c
  • QSPI_BUSY : stm32l496g_discovery_qspi.h
  • QSPI_ERROR : stm32l496g_discovery_qspi.h
  • QSPI_HIGH_PERF_DISABLE : stm32l496g_discovery_qspi.c
  • QSPI_HIGH_PERF_ENABLE : stm32l496g_discovery_qspi.c
  • QSPI_HighPerfMode() : stm32l496g_discovery_qspi.c
  • QSPI_MspDeInit() : stm32l496g_discovery_qspi.c
  • QSPI_MspInit() : stm32l496g_discovery_qspi.c
  • QSPI_NOT_SUPPORTED : stm32l496g_discovery_qspi.h
  • QSPI_OK : stm32l496g_discovery_qspi.h
  • QSPI_QUAD_DISABLE : stm32l496g_discovery_qspi.c
  • QSPI_QUAD_ENABLE : stm32l496g_discovery_qspi.c
  • QSPI_QuadMode() : stm32l496g_discovery_qspi.c
  • QSPI_ResetMemory() : stm32l496g_discovery_qspi.c
  • QSPI_SUSPENDED : stm32l496g_discovery_qspi.h
  • QSPI_WriteEnable() : stm32l496g_discovery_qspi.c
  • QSPIHandle : stm32l496g_discovery_qspi.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • RESOLUTION_R160x120 : stm32l496g_discovery_camera.h
  • RESOLUTION_R320x240 : stm32l496g_discovery_camera.h
  • RESOLUTION_R480x272 : stm32l496g_discovery_camera.h
  • RESOLUTION_R640x480 : stm32l496g_discovery_camera.h
  • RIGHT_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_PORT : stm32l496g_discovery.h
  • RIGHT_JOY_PIN : stm32l496g_discovery.h
  • RIGHT_MODE : stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • 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 : stm32l496g_discovery_audio.c
  • SaturaLH : stm32l496g_discovery_audio.c
  • SD_DATATIMEOUT : stm32l496g_discovery_sd.h
  • SD_Detect_MspDeInit() : stm32l496g_discovery_sd.c
  • SD_Detect_MspInit() : stm32l496g_discovery_sd.c
  • SD_DETECT_PIN : stm32l496g_discovery_sd.h
  • SD_DMAConfigRx() : stm32l496g_discovery_sd.c
  • SD_DMAConfigTx() : stm32l496g_discovery_sd.c
  • SD_DMAx_CLK_DISABLE : stm32l496g_discovery_sd.h
  • SD_DMAx_CLK_ENABLE : stm32l496g_discovery_sd.h
  • SD_DMAx_IRQHandler : stm32l496g_discovery_sd.h
  • SD_DMAx_IRQn : stm32l496g_discovery_sd.h
  • SD_DMAx_STREAM : stm32l496g_discovery_sd.h
  • SD_NOT_PRESENT : stm32l496g_discovery_sd.h
  • SD_PRESENT : stm32l496g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32l496g_discovery_sd.h
  • SD_TRANSFER_ERROR : stm32l496g_discovery_sd.h
  • SD_TRANSFER_OK : stm32l496g_discovery_sd.h
  • SDMMCx_IRQHandler : stm32l496g_discovery_sd.h
  • SDMMCx_IRQn : stm32l496g_discovery_sd.h
  • SEL_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • SEL_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • SEL_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • SEL_JOY_GPIO_PORT : stm32l496g_discovery.h
  • SEL_JOY_PIN : stm32l496g_discovery.h
  • SetDisplayWindow() : stm32l496g_discovery_lcd.c
  • SRAM_ADDR_SETUP_TIME : stm32l496g_discovery_sram.c
  • SRAM_BURSTACCESS : stm32l496g_discovery_sram.h
  • SRAM_DATA_SETUP_TIME : stm32l496g_discovery_sram.c
  • SRAM_DEVICE_ADDR : stm32l496g_discovery_sram.h
  • SRAM_DEVICE_SIZE : stm32l496g_discovery_sram.h
  • SRAM_DMAx_CHANNEL : stm32l496g_discovery_sram.h
  • SRAM_DMAx_CLK_ENABLE : stm32l496g_discovery_sram.h
  • SRAM_DMAx_IRQHandler : stm32l496g_discovery_sram.h
  • SRAM_DMAx_IRQn : stm32l496g_discovery_sram.h
  • SRAM_ERROR : stm32l496g_discovery_sram.h
  • SRAM_MEMORY_WIDTH : stm32l496g_discovery_sram.h
  • SRAM_MspInit() : stm32l496g_discovery_sram.c
  • SRAM_OK : stm32l496g_discovery_sram.h
  • SRAM_TURN_AROUND_TIME : stm32l496g_discovery_sram.c
  • SRAM_WRITEBURST : stm32l496g_discovery_sram.h
  • sramHandle : stm32l496g_discovery_sram.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • Timing : stm32l496g_discovery_sram.c
  • TIMx : stm32l496g_discovery_lcd.h
  • TIMx_CHANNEL : stm32l496g_discovery_lcd.h
  • TIMx_CHANNEl_AF : stm32l496g_discovery_lcd.h
  • TIMx_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • TIMx_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • TOUCH_EVENT_CONTACT : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32l496g_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32l496g_discovery_ts.h
  • TS_ERROR : stm32l496g_discovery_ts.h
  • ts_event_string_tab : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • ts_gesture_id_string_tab : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • TS_GestureIdTypeDef : stm32l496g_discovery_ts.h
  • TS_I2C_ADDRESS : stm32l496g_discovery.h
  • TS_INT_EXTI_IRQn : stm32l496g_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • TS_INT_GPIO_PORT : stm32l496g_discovery.h
  • TS_INT_PIN : stm32l496g_discovery.h
  • TS_IO_Delay() : stm32l496g_discovery.c
  • TS_IO_Init() : stm32l496g_discovery.c
  • ts_io_init : stm32l496g_discovery.c , stm32l496g_discovery_lcd.c
  • TS_IO_Read() : stm32l496g_discovery.c
  • TS_IO_ReadMultiple() : stm32l496g_discovery.c
  • TS_IO_Write() : stm32l496g_discovery.c
  • TS_IO_WriteMultiple() : stm32l496g_discovery.c
  • TS_IRQ_PENDING : stm32l496g_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32l496g_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32l496g_discovery_ts.h
  • TS_OK : stm32l496g_discovery_ts.h
  • TS_orientation : stm32l496g_discovery_ts.c
  • TS_ORIENTATION_LANDSCAPE : stm32l496g_discovery_ts.h
  • TS_ORIENTATION_PORTRAIT : stm32l496g_discovery_ts.h
  • TS_ORIENTATION_UNDEFINED : stm32l496g_discovery_ts.h
  • TS_RST_PIN : stm32l496g_discovery.h
  • TS_StatusTypeDef : stm32l496g_discovery_ts.h
  • TS_SWAP_NONE : stm32l496g_discovery_ts.h
  • TS_SWAP_X : stm32l496g_discovery_ts.h
  • TS_SWAP_XY : stm32l496g_discovery_ts.h
  • TS_SWAP_Y : stm32l496g_discovery_ts.h
  • TS_TIMEOUT : stm32l496g_discovery_ts.h
  • TS_TouchEventTypeDef : stm32l496g_discovery_ts.h
  • tsDriver : stm32l496g_discovery_ts.c
  • tsOrientation : stm32l496g_discovery_ts.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- u -

  • UP_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • UP_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • UP_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • UP_JOY_GPIO_PORT : stm32l496g_discovery.h
  • UP_JOY_PIN : stm32l496g_discovery.h
  • uSdHandle : stm32l496g_discovery_sd.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

  • WakeUpFromShutdown : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • WakeUpFromStandby : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- a -

  • AUDIO_DFSDMx_DeInit() : stm32l496g_discovery_audio.c
  • AUDIO_DFSDMx_Init() : stm32l496g_discovery_audio.c
  • AUDIO_IO_DeInit() : stm32l496g_discovery.c
  • AUDIO_IO_Delay() : stm32l496g_discovery.c
  • AUDIO_IO_Init() : stm32l496g_discovery.c
  • AUDIO_IO_Read() : stm32l496g_discovery.c
  • AUDIO_IO_Write() : stm32l496g_discovery.c
  • AUDIO_SAIPLLConfig() : stm32l496g_discovery_audio.c
  • AUDIO_SAIx_DeInit() : stm32l496g_discovery_audio.c
  • AUDIO_SAIx_Init() : stm32l496g_discovery_audio.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_IN_DeInit() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Init() : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_IN_InitEx() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Pause() : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_IN_Record() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_RegisterCallbacks() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_Resume() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_IN_SetFrequency() : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_IN_Stop() : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_ChangeAudioConfig() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_ChangeBuffer() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_DeInit() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Init() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Pause() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Play() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_RegisterCallbacks() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Resume() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetFrequency() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetMute() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetOutputMode() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_SetVolume() : stm32l496g_discovery_audio.c
  • BSP_AUDIO_OUT_Stop() : stm32l496g_discovery_audio.c
  • BSP_CAMERA_BlackWhiteConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ColorEffectConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ContinuousStart() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ContrastBrightnessConfig() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_DeInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_ErrorCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_FrameEventCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Init() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_LineEventCallback() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_MspDeInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_MspInit() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_PwrDown() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_PwrUp() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Resume() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_SnapshotStart() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Stop() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_Suspend() : stm32l496g_discovery_camera.c
  • BSP_CAMERA_VsyncEventCallback() : stm32l496g_discovery_camera.c
  • BSP_COM_DeInit() : stm32l496g_discovery.c
  • BSP_COM_Init() : stm32l496g_discovery.c
  • BSP_ErrorHandler() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • BSP_GetVersion() : stm32l496g_discovery.c
  • BSP_IDD_ClearIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_Config() : stm32l496g_discovery_idd.c
  • BSP_IDD_DeInit() : stm32l496g_discovery_idd.c
  • BSP_IDD_DisableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_EnableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorClearIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorDisableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorEnableIT() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorGetCode() : stm32l496g_discovery_idd.c
  • BSP_IDD_ErrorGetITStatus() : stm32l496g_discovery_idd.c
  • BSP_IDD_GetITStatus() : stm32l496g_discovery_idd.c
  • BSP_IDD_GetValue() : stm32l496g_discovery_idd.c
  • BSP_IDD_Init() : stm32l496g_discovery_idd.c
  • BSP_IDD_LowPower() : stm32l496g_discovery_idd.c
  • BSP_IDD_Reset() : stm32l496g_discovery_idd.c
  • BSP_IDD_StartMeasure() : stm32l496g_discovery_idd.c
  • BSP_IDD_WakeUp() : stm32l496g_discovery_idd.c
  • BSP_IO_ConfigPin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_Init() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ITClear() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ITGetStatus() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_ReadPin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_TogglePin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_IO_WritePin() : stm32l496g_discovery_io.c , stm32l496g_discovery_io.h
  • BSP_JOY_DeInit() : stm32l496g_discovery.c
  • BSP_JOY_GetState() : stm32l496g_discovery.c
  • BSP_JOY_Init() : stm32l496g_discovery.c
  • BSP_LCD_Clear() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ClearStringLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DeInit() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayChar() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayOff() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayOn() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayStringAt() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DisplayStringAtLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawBitmap() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawCircle() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawEllipse() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawHLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawPixel() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawPolygon() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawRect() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawRGBImage() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_DrawVLine() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillCircle() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillEllipse() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_FillPolygon() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_FillRect() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetBackColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetFont() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_GetOrientation() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetTextColor() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_GetXSize() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_GetYSize() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_Init() : stm32l496g_discovery.c , stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_InitEx() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_MspDeInit() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_MspInit() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ReadPixel() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_Reset() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_ScreenDimmingConfig() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ScreenDimmingOff() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_ScreenDimmingOn() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_SetBackColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LCD_SetFont() : stm32l496g_discovery_lcd.h , stm32l496g_discovery_lcd.c
  • BSP_LCD_SetTextColor() : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • BSP_LED_DeInit() : stm32l496g_discovery.c
  • BSP_LED_Init() : stm32l496g_discovery.c
  • BSP_LED_Off() : stm32l496g_discovery.c
  • BSP_LED_On() : stm32l496g_discovery.c
  • BSP_LED_Toggle() : stm32l496g_discovery.c
  • BSP_QSPI_DeInit() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_EnableMemoryMappedMode() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_EnterDeepPowerDown() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Block() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Chip() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Erase_Sector() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_GetInfo() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_GetStatus() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Init() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_LeaveDeepPowerDown() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Read() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_ResumeErase() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_SuspendErase() : stm32l496g_discovery_qspi.c
  • BSP_QSPI_Write() : stm32l496g_discovery_qspi.c
  • BSP_SD_AbortCallback() : stm32l496g_discovery_sd.c
  • BSP_SD_DeInit() : stm32l496g_discovery_sd.c
  • BSP_SD_DMA_Rx_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_DMA_Tx_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_Erase() : stm32l496g_discovery_sd.c
  • BSP_SD_GetCardInfo() : stm32l496g_discovery_sd.c
  • BSP_SD_GetCardState() : stm32l496g_discovery_sd.c
  • BSP_SD_Init() : stm32l496g_discovery_sd.c
  • BSP_SD_IRQHandler() : stm32l496g_discovery_sd.c
  • BSP_SD_IsDetected() : stm32l496g_discovery_sd.c
  • BSP_SD_ITConfig() : stm32l496g_discovery_sd.c
  • BSP_SD_MspDeInit() : stm32l496g_discovery_sd.c
  • BSP_SD_MspInit() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadBlocks() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadBlocks_DMA() : stm32l496g_discovery_sd.c
  • BSP_SD_ReadCpltCallback() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteBlocks() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteBlocks_DMA() : stm32l496g_discovery_sd.c
  • BSP_SD_WriteCpltCallback() : stm32l496g_discovery_sd.c
  • BSP_SRAM_DMA_IRQHandler() : stm32l496g_discovery_sram.c
  • BSP_SRAM_Init() : stm32l496g_discovery_sram.c
  • BSP_SRAM_ReadData() : stm32l496g_discovery_sram.c
  • BSP_SRAM_ReadData_DMA() : stm32l496g_discovery_sram.c
  • BSP_SRAM_WriteData() : stm32l496g_discovery_sram.c
  • BSP_SRAM_WriteData_DMA() : stm32l496g_discovery_sram.c
  • BSP_TS_GetOrientation() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_GetState() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_Init() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_InitEx() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_INT_MspDeInit() : stm32l496g_discovery_ts.h , stm32l496g_discovery_ts.c
  • BSP_TS_INT_MspInit() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_ITConfig() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • BSP_TS_ITDeConfig() : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- c -

  • CAMERA_Delay() : stm32l496g_discovery.c
  • CAMERA_IO_Init() : stm32l496g_discovery.c
  • CAMERA_IO_Read() : stm32l496g_discovery.c
  • CAMERA_IO_Write() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- d -

  • DrawChar() : stm32l496g_discovery_lcd.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- f -

  • FillTriangle() : stm32l496g_discovery_lcd.c
  • FMC_BANK1_Init() : stm32l496g_discovery.c
  • FMC_BANK1_MspDeInit() : stm32l496g_discovery.h , stm32l496g_discovery.c
  • FMC_BANK1_MspInit() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • FMC_BANK1_ReadData() : stm32l496g_discovery.c
  • FMC_BANK1_WriteData() : stm32l496g_discovery.c
  • FMC_BANK1_WriteReg() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- g -

  • GetSize() : stm32l496g_discovery_camera.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- h -

  • HAL_DCMI_ErrorCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_FrameEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_LineEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DCMI_VsyncEventCallback() : stm32l496g_discovery_camera.c
  • HAL_DFSDM_ChannelMspDeInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_ChannelMspInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterErrorCallback() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterMspDeInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterMspInit() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_DFSDM_FilterRegConvHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_ErrorCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_MspDeInit() : stm32l496g_discovery_audio.c
  • HAL_SAI_MspInit() : stm32l496g_discovery_audio.c
  • HAL_SAI_RxCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_RxHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_TxCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SAI_TxHalfCpltCallback() : stm32l496g_discovery_audio.c
  • HAL_SD_AbortCallback() : stm32l496g_discovery_sd.c
  • HAL_SD_RxCpltCallback() : stm32l496g_discovery_sd.c
  • HAL_SD_TxCpltCallback() : stm32l496g_discovery_sd.c
  • HAL_TIM_PWM_MspInit() : stm32l496g_discovery_lcd.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- i -

  • I2C2_DeInit() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • I2C2_Error() : stm32l496g_discovery.c
  • I2C2_Init() : stm32l496g_discovery.c , stm32l496g_discovery.h
  • I2C2_isDeviceReady() : stm32l496g_discovery.c
  • I2C2_MspDeInit() : stm32l496g_discovery.c
  • I2C2_MspInit() : stm32l496g_discovery.c
  • I2C2_ReadBuffer() : stm32l496g_discovery.c
  • I2C2_ReadData() : stm32l496g_discovery.c
  • I2C2_WriteBuffer() : stm32l496g_discovery.c
  • I2C2_WriteData() : stm32l496g_discovery.c
  • I2Cx_Error() : stm32l496g_discovery.c
  • I2Cx_Init() : stm32l496g_discovery.c
  • I2Cx_ReadMultiple() : stm32l496g_discovery.c
  • I2Cx_WriteMultiple() : stm32l496g_discovery.c
  • IOE_Delay() : stm32l496g_discovery.c
  • IOE_Init() : stm32l496g_discovery.c
  • IOE_ITConfig() : stm32l496g_discovery.c
  • IOE_Read() : stm32l496g_discovery.c
  • IOE_ReadMultiple() : stm32l496g_discovery.c
  • IOE_Write() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- l -

  • LCD_IO_Delay() : stm32l496g_discovery.c
  • LCD_IO_Init() : stm32l496g_discovery.c
  • LCD_IO_ReadData() : stm32l496g_discovery.c
  • LCD_IO_WriteData() : stm32l496g_discovery.c
  • LCD_IO_WriteMultipleData() : stm32l496g_discovery.c
  • LCD_IO_WriteReg() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- m -

  • MFX_IO_DeInit() : stm32l496g_discovery.c
  • MFX_IO_Delay() : stm32l496g_discovery.c
  • MFX_IO_EnableWakeupPin() : stm32l496g_discovery.c
  • MFX_IO_Init() : stm32l496g_discovery.c
  • MFX_IO_ITConfig() : stm32l496g_discovery.c
  • MFX_IO_Read() : stm32l496g_discovery.c
  • MFX_IO_ReadMultiple() : stm32l496g_discovery.c
  • MFX_IO_Wakeup() : stm32l496g_discovery.c
  • MFX_IO_Write() : stm32l496g_discovery.c
  • MFX_IO_WriteMultiple() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- q -

  • QSPI_AutoPollingMemReady() : stm32l496g_discovery_qspi.c
  • QSPI_HighPerfMode() : stm32l496g_discovery_qspi.c
  • QSPI_MspDeInit() : stm32l496g_discovery_qspi.c
  • QSPI_MspInit() : stm32l496g_discovery_qspi.c
  • QSPI_QuadMode() : stm32l496g_discovery_qspi.c
  • QSPI_ResetMemory() : stm32l496g_discovery_qspi.c
  • QSPI_WriteEnable() : stm32l496g_discovery_qspi.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- s -

  • SD_Detect_MspDeInit() : stm32l496g_discovery_sd.c
  • SD_Detect_MspInit() : stm32l496g_discovery_sd.c
  • SD_DMAConfigRx() : stm32l496g_discovery_sd.c
  • SD_DMAConfigTx() : stm32l496g_discovery_sd.c
  • SetDisplayWindow() : stm32l496g_discovery_lcd.c
  • SRAM_MspInit() : stm32l496g_discovery_sram.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- t -

  • TS_IO_Delay() : stm32l496g_discovery.c
  • TS_IO_Init() : stm32l496g_discovery.c
  • TS_IO_Read() : stm32l496g_discovery.c
  • TS_IO_ReadMultiple() : stm32l496g_discovery.c
  • TS_IO_Write() : stm32l496g_discovery.c
  • TS_IO_WriteMultiple() : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • c
  • d
  • h
  • i
  • j
  • l
  • q
  • s
  • t
  • u
  • w

- b -

  • BSP_AUDIO_hDfsdmLeftFilter : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_hDfsdmRightFilter : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • BSP_AUDIO_hSai_Rx : stm32l496g_discovery_audio.c , stm32l496g_discovery_audio.h
  • BSP_AUDIO_hSai_Tx : stm32l496g_discovery_audio.h , stm32l496g_discovery_audio.c
  • bsp_lcd_initialized : stm32l496g_discovery_lcd.c

- c -

  • camera_drv : stm32l496g_discovery_camera.c
  • CameraCurrentResolution : stm32l496g_discovery_camera.c
  • CameraHwAddress : stm32l496g_discovery_camera.c
  • COM_RX_AF : stm32l496g_discovery.c
  • COM_RX_PIN : stm32l496g_discovery.c
  • COM_RX_PORT : stm32l496g_discovery.c
  • COM_TX_AF : stm32l496g_discovery.c
  • COM_TX_PIN : stm32l496g_discovery.c
  • COM_TX_PORT : stm32l496g_discovery.c
  • COM_USART : stm32l496g_discovery.c

- d -

  • dimming_config : stm32l496g_discovery_lcd.c
  • dimming_on : stm32l496g_discovery_lcd.c
  • DmaLeftRecBuffCplt : stm32l496g_discovery_audio.c
  • DmaLeftRecHalfBuffCplt : stm32l496g_discovery_audio.c
  • DmaRightRecBuffCplt : stm32l496g_discovery_audio.c
  • DmaRightRecHalfBuffCplt : stm32l496g_discovery_audio.c
  • DrawProp : stm32l496g_discovery_lcd.c

- h -

  • hAudioIn : stm32l496g_discovery_audio.c
  • hAudioOut : stm32l496g_discovery_audio.c
  • hDcmiHandler : stm32l496g_discovery_camera.c
  • hDmaSaiRx : stm32l496g_discovery_audio.c
  • hDmaSaiTx : stm32l496g_discovery_audio.c
  • hI2cAudioHandler : stm32l496g_discovery.c
  • hI2cCameraHandler : stm32l496g_discovery.c
  • hI2cTSHandler : stm32l496g_discovery.c

- i -

  • I2c1Timeout : stm32l496g_discovery.c
  • I2c2Handle : stm32l496g_discovery.c
  • I2c2Timeout : stm32l496g_discovery.c
  • I2C_Address : stm32l496g_discovery_ts.c
  • IddDrv : stm32l496g_discovery_idd.c
  • io1_driver : stm32l496g_discovery_io.c

- j -

  • JOY_IRQn : stm32l496g_discovery.c
  • JOY_PIN : stm32l496g_discovery.c
  • JOY_PORT : stm32l496g_discovery.c

- l -

  • LCD_orientation : stm32l496g_discovery_lcd.c
  • LCD_sConfig : stm32l496g_discovery_lcd.c
  • LCD_TimHandle : stm32l496g_discovery_lcd.c
  • LcdDrv : stm32l496g_discovery_lcd.c
  • LED_PIN : stm32l496g_discovery.c

- q -

  • QSPIHandle : stm32l496g_discovery_qspi.c

- s -

  • sramHandle : stm32l496g_discovery_sram.c

- t -

  • Timing : stm32l496g_discovery_sram.c
  • ts_event_string_tab : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • ts_gesture_id_string_tab : stm32l496g_discovery_ts.c , stm32l496g_discovery_ts.h
  • ts_io_init : stm32l496g_discovery_lcd.c , stm32l496g_discovery.c
  • TS_orientation : stm32l496g_discovery_ts.c
  • tsDriver : stm32l496g_discovery_ts.c
  • tsOrientation : stm32l496g_discovery_ts.c

- u -

  • uSdHandle : stm32l496g_discovery_sd.c

- w -

  • WakeUpFromShutdown : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
  • WakeUpFromStandby : stm32l496g_discovery_lcd.c , stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Audio_CallbackTypeDef : stm32l496g_discovery_audio.h
  • dimming_config_t : stm32l496g_discovery_lcd.c
  • pPoint : stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • Camera_StatusTypeDef : stm32l496g_discovery_camera.h
  • COM_TypeDef : stm32l496g_discovery.h
  • IDD_StatusTypeDef : stm32l496g_discovery_idd.h
  • IO_StatusTypeDef : stm32l496g_discovery_io.h
  • JOYMode_TypeDef : stm32l496g_discovery.h
  • JOYState_TypeDef : stm32l496g_discovery.h
  • Led_TypeDef : stm32l496g_discovery.h
  • Line_ModeTypdef : stm32l496g_discovery_lcd.h
  • TS_GestureIdTypeDef : stm32l496g_discovery_ts.h
  • TS_StatusTypeDef : stm32l496g_discovery_ts.h
  • TS_TouchEventTypeDef : stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- c -

  • CAMERA_ERROR : stm32l496g_discovery_camera.h
  • CAMERA_NOT_DETECTED : stm32l496g_discovery_camera.h
  • CAMERA_NOT_SUPPORTED : stm32l496g_discovery_camera.h
  • CAMERA_OK : stm32l496g_discovery_camera.h
  • CAMERA_TIMEOUT : stm32l496g_discovery_camera.h
  • CENTER_MODE : stm32l496g_discovery_lcd.h
  • COM1 : stm32l496g_discovery.h

- g -

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

- i -

  • IDD_ERROR : stm32l496g_discovery_idd.h
  • IDD_OK : stm32l496g_discovery_idd.h
  • IDD_TIMEOUT : stm32l496g_discovery_idd.h
  • IDD_ZERO_VALUE : stm32l496g_discovery_idd.h
  • IO_ALREADY_INITIALIZED : stm32l496g_discovery_io.h
  • IO_ERROR : stm32l496g_discovery_io.h
  • IO_OK : stm32l496g_discovery_io.h
  • IO_TIMEOUT : stm32l496g_discovery_io.h

- j -

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

- l -

  • LED1 : stm32l496g_discovery.h
  • LED2 : stm32l496g_discovery.h
  • LED_GREEN : stm32l496g_discovery.h
  • LED_ORANGE : stm32l496g_discovery.h
  • LEFT_MODE : stm32l496g_discovery_lcd.h

- r -

  • RIGHT_MODE : stm32l496g_discovery_lcd.h

- t -

  • TOUCH_EVENT_CONTACT : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_LIFT_UP : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_NB_MAX : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_NO_EVT : stm32l496g_discovery_ts.h
  • TOUCH_EVENT_PRESS_DOWN : stm32l496g_discovery_ts.h
  • TS_DEVICE_NOT_FOUND : stm32l496g_discovery_ts.h
  • TS_ERROR : stm32l496g_discovery_ts.h
  • TS_OK : stm32l496g_discovery_ts.h
  • TS_TIMEOUT : stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- _ -

  • __DIMMING_CYCLE_VALUE : stm32l496g_discovery_lcd.c
  • __STM32L496G_DISCOVERY_BSP_VERSION : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_MAIN : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_RC : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_SUB1 : stm32l496g_discovery.c
  • __STM32L496G_DISCOVERY_BSP_VERSION_SUB2 : stm32l496g_discovery.c
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- a -

  • ABS : stm32l496g_discovery_lcd.c
  • AGPIO_PIN_0 : stm32l496g_discovery_io.h
  • AGPIO_PIN_1 : stm32l496g_discovery_io.h
  • AUDIO_DFSDM_DMAx_LEFT_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_DFSDM_DMAx_RIGHT_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CKOUT_PIN : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_LEFT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_LEFT_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMAx_RIGHT_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_DMIC_DATIN_PIN : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_LEFT_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_DFSDMx_LEFT_FILTER : stm32l496g_discovery_audio.h
  • AUDIO_ERROR : stm32l496g_discovery_audio.h
  • AUDIO_I2C_ADDRESS : stm32l496g_discovery.h
  • AUDIO_IN_IRQ_PREPRIO : stm32l496g_discovery_audio.h
  • AUDIO_OK : stm32l496g_discovery_audio.h
  • AUDIO_OUT_IRQ_PREPRIO : stm32l496g_discovery_audio.h
  • AUDIO_RESET_GPIO : stm32l496g_discovery.h
  • AUDIO_RESET_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • AUDIO_RESET_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • AUDIO_RESET_PIN : stm32l496g_discovery.h
  • AUDIO_SAIx_DMAx_CHANNEL : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQ : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_IRQHandler : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_MEM_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_PLL_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_CLK_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_CLK_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_FS_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_MCK_SCK_SD_FS_GPIO_PORT : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_SCK_PIN : stm32l496g_discovery_audio.h
  • AUDIO_SAIx_TX_SD_PIN : stm32l496g_discovery_audio.h
  • AUDIO_TIMEOUT : stm32l496g_discovery_audio.h
  • AUDIODATA_SIZE : stm32l496g_discovery_audio.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- b -

  • BSP_AUDIO_FREQUENCY_11K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_16K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_22K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_32K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_44K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_48K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_8K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_FREQUENCY_96K : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_CIRCULARMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_MONOMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_NORMALMODE : stm32l496g_discovery_audio.h
  • BSP_AUDIO_OUT_STEREOMODE : stm32l496g_discovery_audio.h
  • BSP_CAMERA_DMA_INSTANCE : stm32l496g_discovery_camera.h
  • BSP_CAMERA_DMA_IRQHandler : stm32l496g_discovery_camera.h
  • BSP_CAMERA_DMA_IRQn : stm32l496g_discovery_camera.h
  • BSP_CAMERA_IRQHandler : stm32l496g_discovery_camera.h
  • BSP_SD_CardInfo : stm32l496g_discovery_sd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- c -

  • CAMERA_480x272_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_480x272_RES_Y : stm32l496g_discovery_camera.c
  • CAMERA_I2C_ADDRESS : stm32l496g_discovery.h
  • CAMERA_PWR_EN_PIN : stm32l496g_discovery_camera.h
  • CAMERA_QQVGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_QQVGA_RES_Y : stm32l496g_discovery_camera.c
  • CAMERA_QVGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_QVGA_RES_Y : stm32l496g_discovery_camera.c
  • CAMERA_VGA_RES_X : stm32l496g_discovery_camera.c
  • CAMERA_VGA_RES_Y : stm32l496g_discovery_camera.c
  • CODEC_AUDIO_POWER_OFF : stm32l496g_discovery.h
  • CODEC_AUDIO_POWER_ON : stm32l496g_discovery.h
  • CODEC_RESET_DELAY : stm32l496g_discovery_audio.h
  • COMn : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- d -

  • DEFAULT_AUDIO_IN_BIT_RESOLUTION : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_CHANNEL_NBR : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_FREQ : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_IN_VOLUME : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_BIT_RESOLUTION : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_CHANNEL_NBR : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_FREQ : stm32l496g_discovery_audio.h
  • DEFAULT_AUDIO_OUT_VOLUME : stm32l496g_discovery_audio.h
  • DFSDMClockDivider : stm32l496g_discovery_audio.c
  • DFSDMFilterOrder : stm32l496g_discovery_audio.c
  • DFSDMOverSampling : stm32l496g_discovery_audio.c
  • DFSDMRightBitShift : stm32l496g_discovery_audio.c
  • DISCOVERY_AUDIO_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_AUDIO_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C : stm32l496g_discovery.h
  • DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C : stm32l496g_discovery.h
  • DISCOVERY_COM1 : stm32l496g_discovery.h
  • DISCOVERY_COM1_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_IRQn : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_AF : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_COM1_RX_PIN : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_AF : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_COM1_TX_PIN : stm32l496g_discovery.h
  • DISCOVERY_COMx_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_RX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_COMx_TX_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_AF : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_EXT_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1 : stm32l496g_discovery.h
  • DISCOVERY_I2C1_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_ER_IRQHandler : stm32l496g_discovery.h
  • DISCOVERY_I2C1_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C1_EV_IRQHandler : stm32l496g_discovery.h
  • DISCOVERY_I2C1_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C1_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C1_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C1_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C1_TIMEOUT_MAX : stm32l496g_discovery.h
  • DISCOVERY_I2C2 : stm32l496g_discovery.h
  • DISCOVERY_I2C2_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C2_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_I2C2_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C2_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_I2C2_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_I2C2_TIMEOUT_MAX : stm32l496g_discovery.h
  • DISCOVERY_IDD_AMPLI_GAIN : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT0_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT0_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT1_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT1_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT2_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT2_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT4_STABDELAY : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_SHUNT4_VALUE : stm32l496g_discovery_idd.h
  • DISCOVERY_IDD_VDD_MIN : stm32l496g_discovery_idd.h
  • DISCOVERY_TS_DMAx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_ER_IRQn : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_EV_IRQn : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_FORCE_RESET : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_RELEASE_RESET : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_PIN : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SCL_SDA_AF : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_GPIO_PORT : stm32l496g_discovery.h
  • DISCOVERY_TS_I2Cx_SDA_PIN : stm32l496g_discovery.h
  • DISCOVERY_TS_RCC_CLKSOURCE_I2C : stm32l496g_discovery.h
  • DISCOVERY_TS_RCC_PERIPHCLK_I2C : stm32l496g_discovery.h
  • DMA_MAX : stm32l496g_discovery_audio.h
  • DMA_MAX_SZE : stm32l496g_discovery_audio.h
  • DOWN_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • DOWN_JOY_GPIO_PORT : stm32l496g_discovery.h
  • DOWN_JOY_PIN : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- f -

  • FMC_BANK1_ADDR : stm32l496g_discovery.h
  • FMC_BANK1_BASE : stm32l496g_discovery.h
  • FMC_LCD_BASE : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- i -

  • IDD_AMP_CONTROL_PIN : stm32l496g_discovery.h
  • IDD_I2C_ADDRESS : stm32l496g_discovery.h
  • IDD_INT_EXTI_IRQn : stm32l496g_discovery.h
  • IDD_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • IDD_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • IDD_INT_GPIO_PORT : stm32l496g_discovery.h
  • IDD_INT_PIN : stm32l496g_discovery.h
  • IDD_WAKEUP_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • IDD_WAKEUP_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • IDD_WAKEUP_GPIO_PORT : stm32l496g_discovery.h
  • IDD_WAKEUP_PIN : stm32l496g_discovery.h
  • INPUT_DEVICE_ANALOG_MIC : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC1 : stm32l496g_discovery_audio.h
  • INPUT_DEVICE_DIGITAL_MIC2 : stm32l496g_discovery_audio.h
  • IO1_I2C_ADDRESS : stm32l496g_discovery.h
  • IO1_PIN_0 : stm32l496g_discovery_io.h
  • IO1_PIN_1 : stm32l496g_discovery_io.h
  • IO1_PIN_2 : stm32l496g_discovery_io.h
  • IO1_PIN_3 : stm32l496g_discovery_io.h
  • IO1_PIN_4 : stm32l496g_discovery_io.h
  • IO1_PIN_5 : stm32l496g_discovery_io.h
  • IO1_PIN_6 : stm32l496g_discovery_io.h
  • IO1_PIN_7 : stm32l496g_discovery_io.h
  • IO1_PIN_8 : stm32l496g_discovery_io.h
  • IO1_PIN_ALL : stm32l496g_discovery_io.h
  • IO1_PIN_OFFSET : stm32l496g_discovery_io.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- j -

  • JOY_ALL_PINS : stm32l496g_discovery.h
  • JOYn : stm32l496g_discovery.h
  • JOYx_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • JOYx_GPIO_CLK_ENABLE : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- l -

  • LCD_ADDR : stm32l496g_discovery.h
  • LCD_BL_CTRL_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_BL_CTRL_PIN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BLACK : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_BROWN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_CYAN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKBLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKCYAN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKGRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKGREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKMAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKRED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_DARKYELLOW : stm32l496g_discovery_lcd.h
  • LCD_COLOR_GRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_GREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTBLUE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTGRAY : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTGREEN : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTMAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTRED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_LIGHTYELLOW : stm32l496g_discovery_lcd.h
  • LCD_COLOR_MAGENTA : stm32l496g_discovery_lcd.h
  • LCD_COLOR_ORANGE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_RED : stm32l496g_discovery_lcd.h
  • LCD_COLOR_WHITE : stm32l496g_discovery_lcd.h
  • LCD_COLOR_YELLOW : stm32l496g_discovery_lcd.h
  • LCD_DEFAULT_FONT : stm32l496g_discovery_lcd.h
  • LCD_ERROR : stm32l496g_discovery_lcd.h
  • LCD_OK : stm32l496g_discovery_lcd.h
  • LCD_ORIENTATION_LANDSCAPE : stm32l496g_discovery_lcd.h
  • LCD_ORIENTATION_PORTRAIT : stm32l496g_discovery_lcd.h
  • LCD_ORIENTATION_UNDEFINED : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_PWR_CTRL_PIN : stm32l496g_discovery_lcd.h
  • LCD_RST_PIN : stm32l496g_discovery_lcd.h
  • LCD_TE_GPIO_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • LCD_TE_GPIO_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • LCD_TE_GPIO_PORT : stm32l496g_discovery_lcd.h
  • LCD_TE_PIN : stm32l496g_discovery_lcd.h
  • LCD_TIMEOUT : stm32l496g_discovery_lcd.h
  • LED1_PIN : stm32l496g_discovery.h
  • LED2_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • LED2_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • LED2_GPIO_PORT : stm32l496g_discovery.h
  • LED2_PIN : stm32l496g_discovery.h
  • LEDn : stm32l496g_discovery.h
  • LEFT_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • LEFT_JOY_GPIO_PORT : stm32l496g_discovery.h
  • LEFT_JOY_PIN : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- m -

  • MFX_INT_EXTI_IRQn : stm32l496g_discovery.h
  • MFX_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • MFX_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • MFX_INT_GPIO_PORT : stm32l496g_discovery.h
  • MFX_INT_PIN : stm32l496g_discovery.h
  • MFX_WAKEUP_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • MFX_WAKEUP_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • MFX_WAKEUP_GPIO_PORT : stm32l496g_discovery.h
  • MFX_WAKEUP_PIN : stm32l496g_discovery.h
  • MSD_ERROR : stm32l496g_discovery_sd.h
  • MSD_ERROR_SD_NOT_PRESENT : stm32l496g_discovery_sd.h
  • MSD_OK : stm32l496g_discovery_sd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- p -

  • PERIOD_VALUE : stm32l496g_discovery_lcd.h
  • POLY_X : stm32l496g_discovery_lcd.c
  • POLY_Y : stm32l496g_discovery_lcd.c
  • PULSE_DECREASE_DELAY : stm32l496g_discovery_lcd.h
  • PULSE_DECREASE_START : stm32l496g_discovery_lcd.h
  • PULSE_VALUE : stm32l496g_discovery_lcd.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- q -

  • QSPI_BUSY : stm32l496g_discovery_qspi.h
  • QSPI_ERROR : stm32l496g_discovery_qspi.h
  • QSPI_HIGH_PERF_DISABLE : stm32l496g_discovery_qspi.c
  • QSPI_HIGH_PERF_ENABLE : stm32l496g_discovery_qspi.c
  • QSPI_NOT_SUPPORTED : stm32l496g_discovery_qspi.h
  • QSPI_OK : stm32l496g_discovery_qspi.h
  • QSPI_QUAD_DISABLE : stm32l496g_discovery_qspi.c
  • QSPI_QUAD_ENABLE : stm32l496g_discovery_qspi.c
  • QSPI_SUSPENDED : stm32l496g_discovery_qspi.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- r -

  • RESOLUTION_R160x120 : stm32l496g_discovery_camera.h
  • RESOLUTION_R320x240 : stm32l496g_discovery_camera.h
  • RESOLUTION_R480x272 : stm32l496g_discovery_camera.h
  • RESOLUTION_R640x480 : stm32l496g_discovery_camera.h
  • RIGHT_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • RIGHT_JOY_GPIO_PORT : stm32l496g_discovery.h
  • RIGHT_JOY_PIN : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- s -

  • SAIClockDivider : stm32l496g_discovery_audio.c
  • SaturaLH : stm32l496g_discovery_audio.c
  • SD_DATATIMEOUT : stm32l496g_discovery_sd.h
  • SD_DETECT_PIN : stm32l496g_discovery_sd.h
  • SD_DMAx_CLK_DISABLE : stm32l496g_discovery_sd.h
  • SD_DMAx_CLK_ENABLE : stm32l496g_discovery_sd.h
  • SD_DMAx_IRQHandler : stm32l496g_discovery_sd.h
  • SD_DMAx_IRQn : stm32l496g_discovery_sd.h
  • SD_DMAx_STREAM : stm32l496g_discovery_sd.h
  • SD_NOT_PRESENT : stm32l496g_discovery_sd.h
  • SD_PRESENT : stm32l496g_discovery_sd.h
  • SD_TRANSFER_BUSY : stm32l496g_discovery_sd.h
  • SD_TRANSFER_ERROR : stm32l496g_discovery_sd.h
  • SD_TRANSFER_OK : stm32l496g_discovery_sd.h
  • SDMMCx_IRQHandler : stm32l496g_discovery_sd.h
  • SDMMCx_IRQn : stm32l496g_discovery_sd.h
  • SEL_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • SEL_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • SEL_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • SEL_JOY_GPIO_PORT : stm32l496g_discovery.h
  • SEL_JOY_PIN : stm32l496g_discovery.h
  • SRAM_ADDR_SETUP_TIME : stm32l496g_discovery_sram.c
  • SRAM_BURSTACCESS : stm32l496g_discovery_sram.h
  • SRAM_DATA_SETUP_TIME : stm32l496g_discovery_sram.c
  • SRAM_DEVICE_ADDR : stm32l496g_discovery_sram.h
  • SRAM_DEVICE_SIZE : stm32l496g_discovery_sram.h
  • SRAM_DMAx_CHANNEL : stm32l496g_discovery_sram.h
  • SRAM_DMAx_CLK_ENABLE : stm32l496g_discovery_sram.h
  • SRAM_DMAx_IRQHandler : stm32l496g_discovery_sram.h
  • SRAM_DMAx_IRQn : stm32l496g_discovery_sram.h
  • SRAM_ERROR : stm32l496g_discovery_sram.h
  • SRAM_MEMORY_WIDTH : stm32l496g_discovery_sram.h
  • SRAM_OK : stm32l496g_discovery_sram.h
  • SRAM_TURN_AROUND_TIME : stm32l496g_discovery_sram.c
  • SRAM_WRITEBURST : stm32l496g_discovery_sram.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- t -

  • TIMx : stm32l496g_discovery_lcd.h
  • TIMx_CHANNEL : stm32l496g_discovery_lcd.h
  • TIMx_CHANNEl_AF : stm32l496g_discovery_lcd.h
  • TIMx_CLK_DISABLE : stm32l496g_discovery_lcd.h
  • TIMx_CLK_ENABLE : stm32l496g_discovery_lcd.h
  • TS_I2C_ADDRESS : stm32l496g_discovery.h
  • TS_INT_EXTI_IRQn : stm32l496g_discovery.h
  • TS_INT_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • TS_INT_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • TS_INT_GPIO_PORT : stm32l496g_discovery.h
  • TS_INT_PIN : stm32l496g_discovery.h
  • TS_IRQ_PENDING : stm32l496g_discovery_ts.h
  • TS_MAX_NB_TOUCH : stm32l496g_discovery_ts.h
  • TS_NO_IRQ_PENDING : stm32l496g_discovery_ts.h
  • TS_ORIENTATION_LANDSCAPE : stm32l496g_discovery_ts.h
  • TS_ORIENTATION_PORTRAIT : stm32l496g_discovery_ts.h
  • TS_ORIENTATION_UNDEFINED : stm32l496g_discovery_ts.h
  • TS_RST_PIN : stm32l496g_discovery.h
  • TS_SWAP_NONE : stm32l496g_discovery_ts.h
  • TS_SWAP_X : stm32l496g_discovery_ts.h
  • TS_SWAP_XY : stm32l496g_discovery_ts.h
  • TS_SWAP_Y : stm32l496g_discovery_ts.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Globals

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

- u -

  • UP_JOY_EXTI_IRQn : stm32l496g_discovery.h
  • UP_JOY_GPIO_CLK_DISABLE : stm32l496g_discovery.h
  • UP_JOY_GPIO_CLK_ENABLE : stm32l496g_discovery.h
  • UP_JOY_GPIO_PORT : stm32l496g_discovery.h
  • UP_JOY_PIN : stm32l496g_discovery.h
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery.c File Reference

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

This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L496G-Discovery board (MB1261) More...

#include "stm32l496g_discovery.h"
#include "stm32l496g_discovery_io.h"
#include "stm32l496g_discovery_lcd.h"

Go to the source code of this file.

Defines

#define | __STM32L496G_DISCOVERY_BSP_VERSION_MAIN (0x01)
STM32L496G DISCOVERY BSP Driver version number.
#define | __STM32L496G_DISCOVERY_BSP_VERSION_SUB1 (0x01)
#define | __STM32L496G_DISCOVERY_BSP_VERSION_SUB2 (0x06)
#define | __STM32L496G_DISCOVERY_BSP_VERSION_RC (0x00)
#define | __STM32L496G_DISCOVERY_BSP_VERSION

Functions

static void | I2C2_MspInit (I2C_HandleTypeDef *hi2c)
Discovery I2C2 MSP Initialization.
static void | I2C2_MspDeInit (I2C_HandleTypeDef *hi2c)
Discovery I2C2 MSP DeInitialization.
static void | I2C2_WriteData (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t Value)
Write a value in a register of the device through BUS.
static HAL_StatusTypeDef | I2C2_WriteBuffer (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
Write a value in a register of the device through BUS.
static uint8_t | I2C2_ReadData (uint16_t Addr, uint16_t Reg, uint16_t RegSize)
Read a register of the device through BUS.
static HAL_StatusTypeDef | I2C2_ReadBuffer (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
Reads multiple data on the BUS.
static void | I2C2_Error (void)
Discovery I2C2 error treatment function.
static void | FMC_BANK1_WriteData (uint16_t Data)
Writes register value.
static void | FMC_BANK1_WriteReg (uint8_t Reg)
Writes register address.
static uint16_t | FMC_BANK1_ReadData (void)
Reads register value.
static void | FMC_BANK1_Init (void)
Initializes LCD IO.
void | LCD_IO_Init (void)
Initializes LCD low level.
void | LCD_IO_WriteData (uint16_t RegValue)
Writes data on LCD data register.
void | LCD_IO_WriteReg (uint8_t Reg)
Writes register on LCD register.
void | LCD_IO_WriteMultipleData (uint16_t *pData, uint32_t Size)
Writes several data on LCD data register.
uint16_t | LCD_IO_ReadData (void)
Reads data from LCD data register.
void | LCD_IO_Delay (uint32_t Delay)
LCD delay.
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 | TS_IO_Init (void)
Initializes Touchscreen low level.
void | TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
uint8_t | TS_IO_Read (uint8_t Addr, uint8_t Reg)
Reads a single data.
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 | CAMERA_IO_Init (void)
Initializes Camera low level.
void | CAMERA_Delay (uint32_t Delay)
Camera delay.
void | CAMERA_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
Camera writes single data.
uint8_t | CAMERA_IO_Read (uint8_t Addr, uint8_t Reg)
Camera reads single data.
void | IOE_Init (void)
void | IOE_ITConfig (void)
void | IOE_Delay (uint32_t Delay)
void | IOE_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
uint8_t | IOE_Read (uint8_t Addr, uint8_t Reg)
uint16_t | IOE_ReadMultiple (uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
void | MFX_IO_Init (void)
Initializes MFX low level.
void | MFX_IO_DeInit (void)
Deinitializes MFX low level.
void | MFX_IO_ITConfig (void)
Configures MFX low level interrupt.
void | MFX_IO_EnableWakeupPin (void)
Configures MFX wke up pin.
void | MFX_IO_Wakeup (void)
Wakeup MFX.
void | MFX_IO_Delay (uint32_t Delay)
MFX delay.
void | MFX_IO_Write (uint16_t Addr, uint8_t Reg, uint8_t Value)
MFX writes single data.
uint8_t | MFX_IO_Read (uint16_t Addr, uint8_t Reg)
MFX reads single data.
void | MFX_IO_WriteMultiple (uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
MFX writes multiple data.
uint16_t | MFX_IO_ReadMultiple (uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
MFX reads multiple data.
static void | I2Cx_Init (I2C_HandleTypeDef *i2c_handler)
Initializes I2C HAL.
static HAL_StatusTypeDef | I2Cx_ReadMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
static HAL_StatusTypeDef | I2Cx_WriteMultiple (I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
static void | I2Cx_Error (I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
Manages error callback by re-initializing I2C.
static uint8_t | I2C2_isDeviceReady (uint16_t Addr, uint32_t trial)
__weak void | BSP_ErrorHandler (void)
uint32_t | BSP_GetVersion (void)
This method returns the STM32L496 DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIOs.
void | BSP_LED_DeInit (Led_TypeDef Led)
Unconfigures LED GPIOs.
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.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all buttons of the joystick in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Unconfigures all GPIOs used as buttons of the joystick.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
void | I2C2_Init (void)
Discovery I2C2 Bus initialization.
void | I2C2_DeInit (void)
Discovery I2C2 Bus Deinitialization.
void | FMC_BANK1_MspInit (void)
Initializes FMC_BANK1_LCD_IO MSP.
void | FMC_BANK1_MspDeInit (void)
DeInitializes FMC_BANK1_LCD_IO MSP.
__weak uint8_t | BSP_LCD_Init (void)

Variables

const uint16_t | LED_PIN [LEDn]
LED variables.
GPIO_TypeDef * | JOY_PORT [JOYn]
JOYSTICK variables.
const uint16_t | JOY_PIN [JOYn]
const uint8_t | JOY_IRQn [JOYn]
USART_TypeDef * | COM_USART [COMn] = {DISCOVERY_COM1}
COM port variables.
GPIO_TypeDef * | COM_TX_PORT [COMn] = {DISCOVERY_COM1_TX_GPIO_PORT}
GPIO_TypeDef * | COM_RX_PORT [COMn] = {DISCOVERY_COM1_RX_GPIO_PORT}
const uint16_t | COM_TX_PIN [COMn] = {DISCOVERY_COM1_TX_PIN}
const uint16_t | COM_RX_PIN [COMn] = {DISCOVERY_COM1_RX_PIN}
const uint16_t | COM_TX_AF [COMn] = {DISCOVERY_COM1_TX_AF}
const uint16_t | COM_RX_AF [COMn] = {DISCOVERY_COM1_RX_AF}
uint32_t | I2c1Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
BUS variables.
uint32_t | I2c2Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
uint32_t | ts_io_init = 0
static I2C_HandleTypeDef | I2c2Handle = {0}
static I2C_HandleTypeDef | hI2cTSHandler = {0}
static I2C_HandleTypeDef | hI2cAudioHandler = {0}
static I2C_HandleTypeDef | hI2cCameraHandler = {0}

Detailed Description

This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L496G-Discovery board (MB1261)

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Data Structures | Defines | Enumerations | Functions
stm32l496g_discovery.h File Reference

This file contains definitions for STM32L496G_DISCOVERY's LEDs, push-buttons hardware resources (MB1261). More...

#include "stm32l4xx_hal.h"

Go to the source code of this file.

Data Structures

struct | LCD_CONTROLLER_TypeDef
LCD constroller Types Definition. More...

Defines

#define | FMC_BANK1_BASE ((uint32_t)(0x60000000 | 0x00000000))
#define | FMC_LCD_BASE ((uint32_t)(0x60000000 | 0x00080000)) /*using A18*/
#define | FMC_BANK1_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)
#define | LCD_ADDR ((LCD_CONTROLLER_TypeDef *) FMC_LCD_BASE)
#define | LEDn 2
#define | LED1_PIN IO1_PIN_4
#define | LED2_PIN GPIO_PIN_13
#define | LED2_GPIO_PORT GPIOB
#define | LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | JOYn 5
#define | RIGHT_JOY_PIN GPIO_PIN_11 /* PF.11 */
Joystick Right push-button.
#define | RIGHT_JOY_GPIO_PORT GPIOF
#define | RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
#define | RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
#define | RIGHT_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | LEFT_JOY_PIN GPIO_PIN_9 /* PI.09 */
Joystick Left push-button.
#define | LEFT_JOY_GPIO_PORT GPIOI
#define | LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LEFT_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | UP_JOY_PIN GPIO_PIN_8 /* PI.08 */
Joystick Up push-button.
#define | UP_JOY_GPIO_PORT GPIOI
#define | UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | UP_JOY_EXTI_IRQn EXTI9_5_IRQn
#define | DOWN_JOY_PIN GPIO_PIN_10 /* PI.10 */
Joystick Down push-button.
#define | DOWN_JOY_GPIO_PORT GPIOI
#define | DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | DOWN_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | SEL_JOY_PIN GPIO_PIN_13 /* PC.13 */
Joystick Sel push-button.
#define | SEL_JOY_GPIO_PORT GPIOC
#define | SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | SEL_JOY_EXTI_IRQn EXTI15_10_IRQn
#define | JOYx_GPIO_CLK_ENABLE(__JOY__)
#define | JOYx_GPIO_CLK_DISABLE(__JOY__)
#define | JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
#define | COMn 1
#define | DISCOVERY_COM1 USART2
Definition for COM port1, connected to USART2 (ST-Link USB Virtual Com Port)
#define | DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
#define | DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART2_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_PIN GPIO_PIN_2
#define | DISCOVERY_COM1_TX_GPIO_PORT GPIOA
#define | DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define | DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define | DISCOVERY_COM1_TX_AF GPIO_AF7_USART2
#define | DISCOVERY_COM1_RX_PIN GPIO_PIN_6
#define | DISCOVERY_COM1_RX_GPIO_PORT GPIOD
#define | DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
#define | DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
#define | DISCOVERY_COM1_RX_AF GPIO_AF7_USART2
#define | DISCOVERY_COM1_IRQn USART2_IRQn
#define | DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_DISABLE();}} while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_DISABLE();}} while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_ENABLE();}} while(0)
#define | DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_DISABLE();}} while(0)
#define | DISCOVERY_I2C1_SCL_GPIO_PORT GPIOG
#define | DISCOVERY_I2C1_SDA_GPIO_PORT GPIOG
#define | DISCOVERY_I2C1_SCL_PIN GPIO_PIN_14
#define | DISCOVERY_I2C1_SDA_PIN GPIO_PIN_13
#define | DISCOVERY_I2C1_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_I2C1 I2C1
#define | DISCOVERY_I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_I2C1_CLK_DISABLE() __HAL_RCC_I2C1_CLK_DISABLE()
#define | DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | DISCOVERY_I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_I2C1_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_I2C1_EV_IRQHandler I2C1_EV_IRQHandler
#define | DISCOVERY_I2C1_ER_IRQn I2C1_ER_IRQn
#define | DISCOVERY_I2C1_ER_IRQHandler I2C1_ER_IRQHandler
#define | DISCOVERY_I2C1_TIMEOUT_MAX 3000
#define | DISCOVERY_I2C2_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_I2C2_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_I2C2_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_I2C2_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_I2C2_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_I2C2 I2C2
#define | DISCOVERY_I2C2_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_I2C2_CLK_DISABLE() __HAL_RCC_I2C2_CLK_DISABLE()
#define | DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_I2C2_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_I2C2_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_I2C2_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_I2C2_ER_IRQn I2C2_ER_IRQn
#define | IDD_I2C_ADDRESS ((uint16_t) 0x84)
#define | IO1_I2C_ADDRESS ((uint16_t) 0x84)
#define | AUDIO_I2C_ADDRESS ((uint16_t) 0x94)
#define | TS_I2C_ADDRESS ((uint16_t) 0x70)
#define | CAMERA_I2C_ADDRESS ((uint16_t) 0x60)
#define | DISCOVERY_I2C2_TIMEOUT_MAX 3000
#define | DISCOVERY_AUDIO_I2Cx I2C1
#define | DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
#define | DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_6
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
#define | DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_7
#define | DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C1_EV_IRQn
#define | DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C1_ER_IRQn
#define | DISCOVERY_TS_I2Cx I2C2
#define | DISCOVERY_TS_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_TS_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_TS_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_TS_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_TS_I2Cx_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_TS_I2Cx_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_TS_I2Cx_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_TS_I2Cx_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_TS_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_TS_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_TS_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | DISCOVERY_TS_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2
#define | DISCOVERY_TS_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK
#define | DISCOVERY_CAMERA_I2Cx I2C2
#define | DISCOVERY_CAMERA_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_CAMERA_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | DISCOVERY_CAMERA_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_CAMERA_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_CAMERA_I2Cx_SCL_PIN GPIO_PIN_4
#define | DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT GPIOH
#define | DISCOVERY_CAMERA_I2Cx_SDA_PIN GPIO_PIN_14
#define | DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_CAMERA_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_CAMERA_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C RCC_PERIPHCLK_I2C2
#define | DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C RCC_I2C2CLKSOURCE_SYSCLK
#define | DISCOVERY_EXT_I2Cx I2C2
#define | DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
#define | DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define | DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
#define | DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
#define | DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_10
#define | DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
#define | DISCOVERY_EXT_I2Cx_SCL_AF GPIO_AF4_I2C2
#define | DISCOVERY_EXT_I2Cx_SDA_AF GPIO_AF4_I2C2
#define | DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9
#define | DISCOVERY_EXT_I2Cx_EV_IRQn I2C2_EV_IRQn
#define | DISCOVERY_EXT_I2Cx_ER_IRQn I2C2_ER_IRQn
#define | CODEC_AUDIO_POWER_OFF() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_RESET)
Audio codec chip reset definition.
#define | CODEC_AUDIO_POWER_ON() HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_SET)
#define | AUDIO_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | AUDIO_RESET_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | AUDIO_RESET_PIN GPIO_PIN_6
#define | AUDIO_RESET_GPIO GPIOC
#define | MFX_INT_GPIO_PORT GPIOC /* GPIOC */
MFX interface pins.
#define | MFX_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define | MFX_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
#define | MFX_INT_PIN GPIO_PIN_5 /* PC.05 */
#define | MFX_INT_EXTI_IRQn EXTI9_5_IRQn
#define | MFX_WAKEUP_GPIO_PORT GPIOH /* GPIOH */
#define | MFX_WAKEUP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | MFX_WAKEUP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | MFX_WAKEUP_PIN GPIO_PIN_6 /* PH.06 */
#define | IDD_INT_GPIO_PORT MFX_INT_GPIO_PORT
#define | IDD_INT_GPIO_CLK_ENABLE() MFX_INT_GPIO_CLK_ENABLE()
#define | IDD_INT_GPIO_CLK_DISABLE() MFX_INT_GPIO_CLK_DISABLE()
#define | IDD_INT_PIN MFX_INT_PIN
#define | IDD_INT_EXTI_IRQn MFX_INT_EXTI_IRQn
#define | IDD_WAKEUP_GPIO_PORT MFX_WAKEUP_GPIO_PORT
#define | IDD_WAKEUP_GPIO_CLK_ENABLE() MFX_WAKEUP_GPIO_CLK_ENABLE()
#define | IDD_WAKEUP_GPIO_CLK_DISABLE() MFX_WAKEUP_GPIO_CLK_DISABLE()
#define | IDD_WAKEUP_PIN MFX_WAKEUP_PIN
#define | IDD_AMP_CONTROL_PIN AGPIO_PIN_1
Idd current measurement interface pins on MFX.
#define | TS_INT_PIN GPIO_PIN_14
TS INT pin.
#define | TS_INT_GPIO_PORT GPIOG
#define | TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
#define | TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
#define | TS_INT_EXTI_IRQn EXTI15_10_IRQn
#define | TS_RST_PIN IO1_PIN_1
TS RST pin.

Enumerations

enum | Led_TypeDef { LED1 = 0, LED2 = 1, LED_ORANGE = LED1, LED_GREEN = LED2 }
LED Types Definition. More...
enum JOYState_TypeDef {
JOY_SEL = 0, JOY_LEFT = 1, JOY_RIGHT = 2, JOY_DOWN = 3,
JOY_UP = 4, JOY_NONE = 5
}
JOYSTICK Types Definition. More...
enum | JOYMode_TypeDef { JOY_MODE_GPIO = 0, JOY_MODE_EXTI = 1 }
enum | COM_TypeDef { COM1 = 0 }

Functions

uint32_t | BSP_GetVersion (void)
This method returns the STM32L496 DISCOVERY BSP Driver revision.
void | BSP_LED_Init (Led_TypeDef Led)
Configures LED GPIOs.
void | BSP_LED_DeInit (Led_TypeDef Led)
Unconfigures LED GPIOs.
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.
uint8_t | BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
Configures all buttons of the joystick in GPIO or EXTI modes.
void | BSP_JOY_DeInit (void)
Unconfigures all GPIOs used as buttons of the joystick.
JOYState_TypeDef | BSP_JOY_GetState (void)
Returns the current joystick status.
void | BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
Configures COM port.
void | BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
DeInit COM port.
void | BSP_ErrorHandler (void)
void | FMC_BANK1_MspInit (void)
Initializes FMC_BANK1_LCD_IO MSP.
void | FMC_BANK1_MspDeInit (void)
DeInitializes FMC_BANK1_LCD_IO MSP.
void | I2C2_Init (void)
Discovery I2C2 Bus initialization.
void | I2C2_DeInit (void)
Discovery I2C2 Bus Deinitialization.

Detailed Description

This file contains definitions for STM32L496G_DISCOVERY's LEDs, push-buttons hardware resources (MB1261).

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_audio.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Data Structures | Defines | Functions | Variables
stm32l496g_discovery_audio.c File Reference

This file provides a set of functions needed to manage the Audio driver for the STM32L496G-Discovery board. More...

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

Go to the source code of this file.

Data Structures

struct | AUDIO_OUT_TypeDef
struct | AUDIO_IN_TypeDef

Defines

#define | SAIClockDivider(__FREQUENCY__)
#define | DFSDMOverSampling(__FREQUENCY__)
#define | DFSDMClockDivider(__FREQUENCY__)
#define | DFSDMFilterOrder(__FREQUENCY__)
#define | DFSDMRightBitShift(__FREQUENCY__)
#define | SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))

Functions

static uint8_t | AUDIO_SAIx_Init (uint32_t AudioFreq)
Initializes the Audio Codec audio interface (SAI).
static uint8_t | AUDIO_SAIx_DeInit (void)
De-initializes the Audio Codec audio interface (SAI).
static uint8_t | AUDIO_DFSDMx_Init (uint32_t AudioFreq)
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
static uint8_t | AUDIO_DFSDMx_DeInit (void)
De-initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
static uint8_t | AUDIO_SAIPLLConfig (uint32_t Frequency)
Configures the SAI PLL clock according to the required audio frequency.
uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_DeInit (void)
De-Initializes audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pData, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
uint8_t | 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).
uint8_t | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption)
Changes the Audio Out Configuration.
void | BSP_AUDIO_OUT_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
SAI error callbacks.
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes micropone related peripherals.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_DeInit (void)
De-Initializes microphone related peripherals.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | HAL_DFSDM_FilterRegConvCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
void | HAL_DFSDM_FilterRegConvHalfCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
void | HAL_DFSDM_FilterErrorCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Error callback.
void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
SAI Rx Transfer completed callbacks.
void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
SAI Rx Half Transfer completed callbacks.
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.
void | BSP_AUDIO_IN_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions
void | HAL_SAI_MspInit (SAI_HandleTypeDef *hsai)
SAI MSP Init.
void | HAL_SAI_MspDeInit (SAI_HandleTypeDef *hsai)
SAI MSP De-init.
void | HAL_DFSDM_ChannelMspInit (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Initializes the DFSDM channel MSP.
void | HAL_DFSDM_ChannelMspDeInit (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
De-initializes the DFSDM channel MSP.
void | HAL_DFSDM_FilterMspInit (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Initializes the DFSDM filter MSP.
void | HAL_DFSDM_FilterMspDeInit (DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
De-initializes the DFSDM filter MSP.

Variables

static AUDIO_OUT_TypeDef | hAudioOut = {0}
static AUDIO_IN_TypeDef | hAudioIn = {0}
static DMA_HandleTypeDef | hDmaSaiTx
static DMA_HandleTypeDef | hDmaSaiRx
static uint32_t | DmaLeftRecHalfBuffCplt
static uint32_t | DmaLeftRecBuffCplt
static uint32_t | DmaRightRecHalfBuffCplt
static uint32_t | DmaRightRecBuffCplt
SAI_HandleTypeDef | BSP_AUDIO_hSai_Tx
SAI_HandleTypeDef | BSP_AUDIO_hSai_Rx
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmLeftFilter
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmRightFilter

Detailed Description

This file provides a set of functions needed to manage the Audio driver for the STM32L496G-Discovery board.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_audio.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_audio.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Defines | Typedefs | Functions | Variables
stm32l496g_discovery_audio.h File Reference

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

#include <stdlib.h>
#include "../Components/cs42l51/cs42l51.h"
#include "stm32l496g_discovery.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 | BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K
#define | BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K
#define | BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K
#define | BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K
#define | BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K
#define | BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K
#define | BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K
#define | BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K
#define | AUDIO_SAIx_TX_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
#define | AUDIO_SAIx_TX_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF GPIO_AF13_SAI1
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_SAIx_TX_FS_PIN GPIO_PIN_4
#define | AUDIO_SAIx_TX_SCK_PIN GPIO_PIN_5
#define | AUDIO_SAIx_TX_SD_PIN GPIO_PIN_6
#define | AUDIO_SAIx_TX_MCK_PIN GPIO_PIN_2
#define | AUDIO_SAIx_TX_MCK_SCK_SD_FS_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_CHANNEL DMA2_Channel1
#define | AUDIO_SAIx_DMAx_IRQ DMA2_Channel1_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 (uint32_t)0xFFFF
#define | AUDIO_SAIx_DMAx_IRQHandler DMA2_Channel1_IRQHandler
#define | AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */
#define | AUDIO_SAIx_PLL_DISABLE() HAL_RCCEx_DisablePLLSAI2()
#define | AUDIO_DFSDMx_LEFT_CHANNEL DFSDM1_Channel2
#define | AUDIO_DFSDMx_LEFT_FILTER DFSDM1_Filter0
#define | AUDIO_DFSDMx_CLK_ENABLE() __HAL_RCC_DFSDM1_CLK_ENABLE()
#define | AUDIO_DFSDMx_CLK_DISABLE() __HAL_RCC_DFSDM1_CLK_DISABLE()
#define | AUDIO_DFSDMx_CKOUT_PIN GPIO_PIN_9
#define | AUDIO_DFSDMx_DMIC_DATIN_PIN GPIO_PIN_7
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT GPIOE
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
#define | AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF GPIO_AF6_DFSDM1
#define | AUDIO_DFSDMx_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define | AUDIO_DFSDMx_DMAx_CLK_DISABLE() __HAL_RCC_DMA1_CLK_DISABLE()
#define | AUDIO_DFSDMx_DMAx_LEFT_CHANNEL DMA1_Channel4
#define | AUDIO_DFSDMx_DMAx_LEFT_IRQ DMA1_Channel4_IRQn
#define | AUDIO_DFSDM_DMAx_LEFT_IRQHandler DMA1_Channel4_IRQHandler
#define | AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL DMA1_Channel5
#define | AUDIO_DFSDMx_DMAx_RIGHT_IRQ DMA1_Channel5_IRQn
#define | AUDIO_DFSDM_DMAx_RIGHT_IRQHandler DMA1_Channel5_IRQHandler
#define | AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD
#define | AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD
#define | AUDIO_IN_IRQ_PREPRIO 6 /* Select the preemption priority level(0 is the highest) */
#define | AUDIODATA_SIZE 2 /* 16-bits audio data size */
#define | AUDIO_OK 0
#define | AUDIO_ERROR 1
#define | AUDIO_TIMEOUT 2
#define | DEFAULT_AUDIO_OUT_FREQ BSP_AUDIO_FREQUENCY_48K
#define | DEFAULT_AUDIO_OUT_BIT_RESOLUTION ((uint8_t)16)
#define | DEFAULT_AUDIO_OUT_CHANNEL_NBR ((uint8_t)2) /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_OUT_VOLUME ((uint16_t)80)
#define | DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K
#define | DEFAULT_AUDIO_IN_BIT_RESOLUTION 16
#define | DEFAULT_AUDIO_IN_CHANNEL_NBR 1 /* Mono = 1, Stereo = 2 */
#define | DEFAULT_AUDIO_IN_VOLUME 80
#define | CODEC_RESET_DELAY 5
#define | INPUT_DEVICE_DIGITAL_MIC1 0x20 /* Left microphone */
#define | INPUT_DEVICE_DIGITAL_MIC2 0x40 /* Right microphone */
#define | INPUT_DEVICE_DIGITAL_MIC (INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2)
#define | INPUT_DEVICE_ANALOG_MIC INPUT_DEVICE_MIC1
#define | DMA_MAX(_X_) (((_X_) <= DMA_MAX_SZE)? (_X_):DMA_MAX_SZE)

Typedefs

typedef void(* | Audio_CallbackTypeDef )(void)

Functions

uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_DeInit (void)
De-Initializes audio codec related peripherals.
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pData, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
uint8_t | 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_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption)
Changes the Audio Out 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_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initializes micropone related peripherals.
uint8_t | BSP_AUDIO_IN_InitEx (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
Initialize wave recording.
uint8_t | BSP_AUDIO_IN_DeInit (void)
De-Initializes microphone related peripherals.
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pData, uint32_t Size)
Starts audio recording.
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq)
Updates the audio frequency.
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.
void | BSP_AUDIO_IN_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback)
register user callback functions

Variables

SAI_HandleTypeDef | BSP_AUDIO_hSai_Tx
SAI_HandleTypeDef | BSP_AUDIO_hSai_Rx
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmLeftFilter
DFSDM_Filter_HandleTypeDef | BSP_AUDIO_hDfsdmRightFilter

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_audio.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_camera.c File Reference

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

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

#include "stm32l496g_discovery_camera.h"
#include "stm32l496g_discovery.h"
#include "stm32l496g_discovery_io.h"

Go to the source code of this file.

Defines

#define | CAMERA_VGA_RES_X 640
#define | CAMERA_VGA_RES_Y 480
#define | CAMERA_480x272_RES_X 480
#define | CAMERA_480x272_RES_Y 272
#define | CAMERA_QVGA_RES_X 320
#define | CAMERA_QVGA_RES_Y 240
#define | CAMERA_QQVGA_RES_X 160
#define | CAMERA_QQVGA_RES_Y 120

Functions

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

Variables

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

Detailed Description

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

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

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

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

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

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

Definition in file stm32l496g_discovery_camera.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_camera.h File Reference

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

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

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

Go to the source code of this file.

Defines

#define | RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
#define | RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
#define | RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
#define | RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
#define | BSP_CAMERA_IRQHandler DCMI_IRQHandler
#define | BSP_CAMERA_DMA_IRQHandler DMA2_Channel6_IRQHandler
#define | BSP_CAMERA_DMA_IRQn DMA2_Channel6_IRQn
#define | BSP_CAMERA_DMA_INSTANCE DMA2_Channel6
#define | CAMERA_PWR_EN_PIN IO1_PIN_6
Camera special pins.

Enumerations

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

Functions

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

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_camera.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_idd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Functions | Variables
stm32l496g_discovery_idd.c File Reference

This file provides a set of firmware functions to manage the Idd measurement driver for STM32L496G-Discovery board. More...

#include "stm32l496g_discovery_idd.h"
#include "stm32l496g_discovery_io.h"

Go to the source code of this file.

Functions

uint8_t | BSP_IDD_Init (void)
Configures IDD measurement component.
void | BSP_IDD_DeInit (void)
Unconfigures IDD measurement component.
void | BSP_IDD_Reset (void)
Reset Idd measurement component.
void | BSP_IDD_LowPower (void)
Turn Idd measurement component in low power (standby/sleep) mode.
void | BSP_IDD_StartMeasure (void)
Start Measurement campaign.
void | BSP_IDD_Config (IDD_ConfigTypeDef IddConfig)
Configure Idd component.
void | BSP_IDD_GetValue (uint32_t *IddValue)
Get Idd current value.
void | BSP_IDD_EnableIT (void)
Enable Idd interrupt that warn end of measurement.
void | BSP_IDD_ClearIT (void)
Clear Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_GetITStatus (void)
Get Idd interrupt status.
void | BSP_IDD_DisableIT (void)
Disable Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetCode (void)
Get Error Code .
void | BSP_IDD_ErrorEnableIT (void)
Enable error interrupt that warn end of measurement.
void | BSP_IDD_ErrorClearIT (void)
Clear Error interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetITStatus (void)
Get Error interrupt status.
void | BSP_IDD_ErrorDisableIT (void)
Disable Error interrupt.
void | BSP_IDD_WakeUp (void)
Wake up Idd measurement component.

Variables

static IDD_DrvTypeDef * | IddDrv

Detailed Description

This file provides a set of firmware functions to manage the Idd measurement driver for STM32L496G-Discovery board.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_idd.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_idd.h File Reference

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

Header file for stm32l496g_discovery_idd.c module. More...

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

Go to the source code of this file.

Defines

#define | DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000)
Shunt values on discovery in milli ohms.
#define | DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24)
#define | DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620)
#define | DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000)
#define | DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149)
Shunt stabilization delay on discovery in milli ohms.
#define | DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149)
#define | DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149)
#define | DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255)
#define | DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967)
IDD Ampli Gain on discovery.
#define | DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000)
IDD Vdd Min on discovery.

Enumerations

enum | IDD_StatusTypeDef { IDD_OK = 0, IDD_TIMEOUT = 1, IDD_ZERO_VALUE = 2, IDD_ERROR = 0xFF }

Functions

uint8_t | BSP_IDD_Init (void)
Configures IDD measurement component.
void | BSP_IDD_DeInit (void)
Unconfigures IDD measurement component.
void | BSP_IDD_Reset (void)
Reset Idd measurement component.
void | BSP_IDD_LowPower (void)
Turn Idd measurement component in low power (standby/sleep) mode.
void | BSP_IDD_WakeUp (void)
Wake up Idd measurement component.
void | BSP_IDD_StartMeasure (void)
Start Measurement campaign.
void | BSP_IDD_Config (IDD_ConfigTypeDef IddConfig)
Configure Idd component.
void | BSP_IDD_GetValue (uint32_t *IddValue)
Get Idd current value.
void | BSP_IDD_EnableIT (void)
Enable Idd interrupt that warn end of measurement.
void | BSP_IDD_ClearIT (void)
Clear Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_GetITStatus (void)
Get Idd interrupt status.
void | BSP_IDD_DisableIT (void)
Disable Idd interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetCode (void)
Get Error Code .
void | BSP_IDD_ErrorEnableIT (void)
Enable error interrupt that warn end of measurement.
void | BSP_IDD_ErrorClearIT (void)
Clear Error interrupt that warn end of measurement.
uint8_t | BSP_IDD_ErrorGetITStatus (void)
Get Error interrupt status.
void | BSP_IDD_ErrorDisableIT (void)
Disable Error interrupt.

Detailed Description

Header file for stm32l496g_discovery_idd.c module.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_idd.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_io.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Functions | Variables
stm32l496g_discovery_io.c File Reference

This file provides a set of functions needed to manage the IO pins on STM32L496G-DISCO evaluation board. More...

#include "stm32l496g_discovery_io.h"

Go to the source code of this file.

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (GPIOs, clocks..).
uint32_t | BSP_IO_ITGetStatus (uint32_t IO_Pin)
Gets the selected pins IT status.
void | BSP_IO_ITClear (uint32_t IO_Pin)
Clears the selected IO IT pending bit.
uint8_t | BSP_IO_ConfigPin (uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IO_Pin, uint8_t PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IO_Pin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IO_Pin)
Toggles the selected pins state.

Variables

static IO_DrvTypeDef * | io1_driver

Detailed Description

This file provides a set of functions needed to manage the IO pins on STM32L496G-DISCO evaluation board.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_io.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_io.h File Reference

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

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

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

Go to the source code of this file.

Defines

#define | IO1_PIN_OFFSET 0
#define | IO1_PIN_0 (uint32_t)(0x00000001 << IO1_PIN_OFFSET)
#define | IO1_PIN_1 (uint32_t)(0x00000002 << IO1_PIN_OFFSET)
#define | IO1_PIN_2 (uint32_t)(0x00000004 << IO1_PIN_OFFSET)
#define | IO1_PIN_3 (uint32_t)(0x00000008 << IO1_PIN_OFFSET)
#define | IO1_PIN_4 (uint32_t)(0x00000010 << IO1_PIN_OFFSET)
#define | IO1_PIN_5 (uint32_t)(0x00000020 << IO1_PIN_OFFSET)
#define | IO1_PIN_6 (uint32_t)(0x00000040 << IO1_PIN_OFFSET)
#define | IO1_PIN_7 (uint32_t)(0x00000080 << IO1_PIN_OFFSET)
#define | IO1_PIN_8 (uint32_t)(0x00000100 << IO1_PIN_OFFSET)
#define | AGPIO_PIN_0 (uint32_t)(0x00010000 << IO1_PIN_OFFSET)
#define | AGPIO_PIN_1 (uint32_t)(0x00020000 << IO1_PIN_OFFSET)
#define | IO1_PIN_ALL (uint32_t)(0x000301FF << IO1_PIN_OFFSET)

Enumerations

enum | IO_StatusTypeDef { IO_OK = 0x00, IO_ERROR = 0x01, IO_TIMEOUT = 0x02, IO_ALREADY_INITIALIZED = 0x03 }

Functions

uint8_t | BSP_IO_Init (void)
Initializes and configures the IO functionalities and configures all necessary hardware resources (GPIOs, clocks..).
void | BSP_IO_ITClear (uint32_t IO_Pin)
Clears the selected IO IT pending bit.
uint32_t | BSP_IO_ITGetStatus (uint32_t IO_Pin)
Gets the selected pins IT status.
uint8_t | BSP_IO_ConfigPin (uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
Configures the IO pin(s) according to IO mode structure value.
void | BSP_IO_WritePin (uint32_t IO_Pin, uint8_t PinState)
Sets the selected pins state.
uint32_t | BSP_IO_ReadPin (uint32_t IO_Pin)
Gets the selected pins current state.
void | BSP_IO_TogglePin (uint32_t IO_Pin)
Toggles the selected pins state.

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_io.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_lcd.h File Reference

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

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

#include "stm32l496g_discovery.h"
#include "stm32l496g_discovery_io.h"
#include "../Components/st7789h2/st7789h2.h"
#include "../../../Utilities/Fonts/fonts.h"

Go to the source code of this file.

Data Structures

struct | LCD_DrawPropTypeDef
struct | Point

Defines

#define | LCD_OK ((uint8_t)0x00)
LCD status structure definition.
#define | LCD_ERROR ((uint8_t)0x01)
#define | LCD_TIMEOUT ((uint8_t)0x02)
#define | LCD_ORIENTATION_PORTRAIT ((uint8_t)0x00)
#define | LCD_ORIENTATION_LANDSCAPE ((uint8_t)0x01)
#define | LCD_ORIENTATION_UNDEFINED ((uint8_t)0x02)
#define | LCD_COLOR_BLUE ((uint16_t)0x001F)
LCD color.
#define | LCD_COLOR_GREEN ((uint16_t)0x07E0)
#define | LCD_COLOR_RED ((uint16_t)0xF800)
#define | LCD_COLOR_CYAN ((uint16_t)0x07FF)
#define | LCD_COLOR_MAGENTA ((uint16_t)0xF81F)
#define | LCD_COLOR_YELLOW ((uint16_t)0xFFE0)
#define | LCD_COLOR_LIGHTBLUE ((uint16_t)0x841F)
#define | LCD_COLOR_LIGHTGREEN ((uint16_t)0x87F0)
#define | LCD_COLOR_LIGHTRED ((uint16_t)0xFC10)
#define | LCD_COLOR_LIGHTMAGENTA ((uint16_t)0xFC1F)
#define | LCD_COLOR_LIGHTYELLOW ((uint16_t)0xFFF0)
#define | LCD_COLOR_DARKBLUE ((uint16_t)0x0010)
#define | LCD_COLOR_DARKGREEN ((uint16_t)0x0400)
#define | LCD_COLOR_DARKRED ((uint16_t)0x8000)
#define | LCD_COLOR_DARKCYAN ((uint16_t)0x0410)
#define | LCD_COLOR_DARKMAGENTA ((uint16_t)0x8010)
#define | LCD_COLOR_DARKYELLOW ((uint16_t)0x8400)
#define | LCD_COLOR_WHITE ((uint16_t)0xFFFF)
#define | LCD_COLOR_LIGHTGRAY ((uint16_t)0xD69A)
#define | LCD_COLOR_GRAY ((uint16_t)0x8410)
#define | LCD_COLOR_DARKGRAY ((uint16_t)0x4208)
#define | LCD_COLOR_BLACK ((uint16_t)0x0000)
#define | LCD_COLOR_BROWN ((uint16_t)0xA145)
#define | LCD_COLOR_ORANGE ((uint16_t)0xFD20)
#define | LCD_DEFAULT_FONT Font12
LCD default font.
#define | LCD_RST_PIN IO1_PIN_2
LCD special pins.
#define | LCD_TE_PIN GPIO_PIN_7
#define | LCD_TE_GPIO_PORT GPIOH
#define | LCD_TE_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | LCD_TE_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | LCD_BL_CTRL_PIN GPIO_PIN_0
#define | LCD_BL_CTRL_GPIO_PORT GPIOI
#define | LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
#define | LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
#define | LCD_PWR_CTRL_PIN GPIO_PIN_0
#define | LCD_PWR_CTRL_GPIO_PORT GPIOH
#define | LCD_PWR_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
#define | LCD_PWR_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
#define | TIMx TIM5
#define | TIMx_CLK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE()
#define | TIMx_CLK_DISABLE() __HAL_RCC_TIM5_CLK_DISABLE()
#define | TIMx_CHANNEL TIM_CHANNEL_4
#define | TIMx_CHANNEl_AF GPIO_AF2_TIM5
#define | PERIOD_VALUE (uint32_t)(666 - 1) /* Period Value */
#define | PULSE_VALUE (uint32_t)((PERIOD_VALUE*5)/100) /* 5% cycle */
#define | PULSE_DECREASE_START (uint32_t)(PULSE_VALUE + 120) /* cycle start level when starting to dim the screen */
#define | PULSE_DECREASE_DELAY (uint32_t)(20) /* gradually decrease cycle level every 20 milliseconds */

Typedefs

typedef struct Point * | pPoint

Enumerations

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

Functions

uint8_t | BSP_LCD_Init (void)
Initializes the LCD.
uint8_t | BSP_LCD_InitEx (uint32_t orientation)
Initializes the LCD with a given orientation.
void | BSP_LCD_Reset (void)
Reset the LCD.
uint8_t | BSP_LCD_DeInit (void)
DeInitializes the LCD.
uint32_t | BSP_LCD_GetXSize (void)
Gets the LCD X size.
uint32_t | BSP_LCD_GetYSize (void)
Gets the LCD Y size.
uint16_t | BSP_LCD_GetTextColor (void)
Gets the LCD text color.
uint16_t | BSP_LCD_GetBackColor (void)
Gets the LCD background color.
void | BSP_LCD_SetTextColor (__IO uint16_t Color)
void | BSP_LCD_SetBackColor (__IO uint16_t Color)
void | BSP_LCD_SetFont (sFONT *fonts)
Sets the LCD text font.
sFONT * | BSP_LCD_GetFont (void)
Gets the LCD text font.
void | BSP_LCD_Clear (uint16_t Color)
Clears the hole LCD.
void | BSP_LCD_ClearStringLine (uint16_t Line)
Clears the selected line.
void | BSP_LCD_DisplayStringAtLine (uint16_t Line, uint8_t *ptr)
Displays a character on the LCD.
void | BSP_LCD_DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode)
Displays characters on the LCD.
void | BSP_LCD_DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
Displays one character.
uint16_t | BSP_LCD_ReadPixel (uint16_t Xpos, uint16_t Ypos)
Reads an LCD pixel.
void | BSP_LCD_DrawPixel (uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
Draws a pixel on LCD.
void | BSP_LCD_DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws an horizontal line.
void | BSP_LCD_DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
Draws a vertical line.
void | BSP_LCD_DrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Draws an uni-line (between two points).
void | BSP_LCD_DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a rectangle.
void | BSP_LCD_DrawCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a circle.
void | BSP_LCD_DrawPolygon (pPoint Points, uint16_t PointCount)
Draws an poly-line (between many points).
void | BSP_LCD_DrawEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws an ellipse on LCD.
void | BSP_LCD_DrawBitmap (uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
Draws a bitmap picture (16 bpp).
void | BSP_LCD_DrawRGBImage (uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp)
Draws RGB Image (16 bpp).
void | BSP_LCD_FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
Draws a full rectangle.
void | BSP_LCD_FillCircle (uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
Draws a full circle.
void | BSP_LCD_FillPolygon (pPoint Points, uint16_t PointCount)
Draws a full poly-line (between many points).
void | BSP_LCD_FillEllipse (int Xpos, int Ypos, int XRadius, int YRadius)
Draws a full ellipse.
void | BSP_LCD_DisplayOff (void)
Disables the display.
void | BSP_LCD_DisplayOn (void)
Enables the display.
void | BSP_LCD_ScreenDimmingOn (void)
LCD screen dimming enable.
void | BSP_LCD_ScreenDimmingOff (void)
LCD screen dimming disable.
void | BSP_LCD_ScreenDimmingConfig (const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay)
LCD screen dimming enable.
uint8_t | BSP_LCD_GetOrientation (void)
__weak void | BSP_LCD_MspInit (void)
Initializes the LCD GPIO special pins MSP.
__weak void | BSP_LCD_MspDeInit (void)
DeInitializes LCD GPIO special pins MSP.

Variables

FlagStatus | WakeUpFromStandby
FlagStatus | WakeUpFromShutdown

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_lcd.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_qspi.c File Reference

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

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

#include "stm32l496g_discovery_qspi.h"

Go to the source code of this file.

Defines

#define | QSPI_QUAD_DISABLE 0x0
#define | QSPI_QUAD_ENABLE 0x1
#define | QSPI_HIGH_PERF_DISABLE 0x0
#define | QSPI_HIGH_PERF_ENABLE 0x1

Functions

static void | QSPI_MspInit (void)
Initializes the QSPI MSP.
static void | QSPI_MspDeInit (void)
De-Initializes the QSPI MSP.
static uint8_t | QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
This function reset the QSPI memory.
static uint8_t | QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
This function send a Write Enable and wait it is effective.
static uint8_t | QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
static uint8_t | QSPI_QuadMode (QSPI_HandleTypeDef *hqspi, uint8_t Operation)
This function enables/disables the Quad mode of the memory.
static uint8_t | QSPI_HighPerfMode (QSPI_HandleTypeDef *hqspi, uint8_t Operation)
This function enables/disables the high performance mode of the memory.
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_Sector (uint32_t Sector)
Erases the specified sector of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
uint8_t | BSP_QSPI_SuspendErase (void)
This function suspends an ongoing erase command.
uint8_t | BSP_QSPI_ResumeErase (void)
This function resumes a paused erase command.
uint8_t | BSP_QSPI_EnterDeepPowerDown (void)
This function enter the QSPI memory in deep power down mode.
uint8_t | BSP_QSPI_LeaveDeepPowerDown (void)
This function leave the QSPI memory from deep power down mode.

Variables

QSPI_HandleTypeDef | QSPIHandle

Detailed Description

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

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

   (#) This driver need a specific component driver (MX25R6435F) 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. The BSP_QSPI_DeInit() can be used
            to deactivate the QSPI interface.

   (#) 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 to the QSPI memory in memory-mapped mode is possible after
            the call of the function BSP_QSPI_EnableMemoryMappedMode().
       (++) 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)
       (++) Perform erase sector operation using the function BSP_QSPI_Erase_Sector()
            which is not blocking. So the function BSP_QSPI_GetStatus() should be used
            to check if the memory is busy, and the functions BSP_QSPI_SuspendErase()/
            BSP_QSPI_ResumeErase() can be used to perform other operations during the
            sector erase.
       (++) Deep power down of the QSPI memory is managed with the call of the functions
            BSP_QSPI_EnterDeepPowerDown()/BSP_QSPI_LeaveDeepPowerDown()
Attention:

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

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

Definition in file stm32l496g_discovery_qspi.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_qspi.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Data Structures | Defines | Functions
stm32l496g_discovery_qspi.h File Reference

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

#include "stm32l4xx_hal.h"
#include "../Components/mx25r6435f/mx25r6435f.h"

Go to the source code of this file.

Data Structures

struct | QSPI_Info

Defines

#define | QSPI_OK ((uint8_t)0x00)
#define | QSPI_ERROR ((uint8_t)0x01)
#define | QSPI_BUSY ((uint8_t)0x02)
#define | QSPI_NOT_SUPPORTED ((uint8_t)0x04)
#define | QSPI_SUSPENDED ((uint8_t)0x08)

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_Sector (uint32_t Sector)
Erases the specified sector of the QSPI memory.
uint8_t | BSP_QSPI_Erase_Chip (void)
Erases the entire QSPI memory.
uint8_t | BSP_QSPI_GetStatus (void)
Reads current status of the QSPI memory.
uint8_t | BSP_QSPI_GetInfo (QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
uint8_t | BSP_QSPI_EnableMemoryMappedMode (void)
Configure the QSPI in memory-mapped mode.
uint8_t | BSP_QSPI_SuspendErase (void)
This function suspends an ongoing erase command.
uint8_t | BSP_QSPI_ResumeErase (void)
This function resumes a paused erase command.
uint8_t | BSP_QSPI_EnterDeepPowerDown (void)
This function enter the QSPI memory in deep power down mode.
uint8_t | BSP_QSPI_LeaveDeepPowerDown (void)
This function leave the QSPI memory from deep power down mode.

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_qspi.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sd.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Functions | Variables
stm32l496g_discovery_sd.c File Reference

This file includes the uSD card driver. More...

#include "stm32l496g_discovery_io.h"
#include "stm32l496g_discovery_sd.h"

Go to the source code of this file.

Functions

static void | SD_Detect_MspInit (void)
Initializes the SD Detect pin MSP.
static void | SD_Detect_MspDeInit (void)
Initializes the SD Detect pin MSP.
static HAL_StatusTypeDef | SD_DMAConfigRx (SD_HandleTypeDef *hsd)
Configure the DMA to receive data from the SD card.
static HAL_StatusTypeDef | SD_DMAConfigTx (SD_HandleTypeDef *hsd)
Configure the DMA to transmit data to the SD card.
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.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
void | BSP_SD_DMA_Tx_IRQHandler (void)
Handles SD DMA Tx transfer interrupt request.
void | BSP_SD_DMA_Rx_IRQHandler (void)
Handles SD DMA Rx transfer interrupt request.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
De-Initializes the SD MSP.
__weak void | BSP_SD_AbortCallback (void)
BSP SD Abort callback.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callback.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callback.
void | HAL_SD_AbortCallback (SD_HandleTypeDef *hsd)
SD Abort callback.
void | HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd)
Tx Transfer completed callback.
void | HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd)
Rx Transfer completed callback.

Variables

SD_HandleTypeDef | uSdHandle

Detailed Description

This file includes the uSD card driver.

Author:
MCD Application Team
  ==============================================================================
                     ##### How to use this driver #####
  ==============================================================================
  (#) This driver is used to drive the micro SD external card mounted on STM32L496G-DISCOVERY
     evaluation board.

  (#) This driver does not need a specific component driver for the micro SD device
     to be included with.

  (#) Initialization steps:
       (++) Initialize the micro SD card using the BSP_SD_Init() function. This
            function includes the MSP layer hardware resources initialization and the
            SDMMC1 interface configuration to interface with the external micro SD. It
            also includes the micro SD initialization sequence.
       (++) To check the SD card presence you can use the function BSP_SD_IsDetected() which
            returns the detection status.
       (++) The function BSP_SD_GetCardInfo() is used to get the micro SD card information
            which is stored in the structure "HAL_SD_CardInfoTypedef".

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

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

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

Definition in file stm32l496g_discovery_sd.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sd.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Defines | Functions
stm32l496g_discovery_sd.h File Reference

This file includes the uSD card driver. More...

#include "stm32l4xx_hal.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_TRANSFER_ERROR ((uint8_t)0x02)
#define | SD_DETECT_PIN IO1_PIN_8
#define | SD_DATATIMEOUT ((uint32_t)100000000)
#define | SD_PRESENT ((uint8_t)0x01)
#define | SD_NOT_PRESENT ((uint8_t)0x00)
#define | SDMMCx_IRQHandler SDMMC1_IRQHandler
#define | SDMMCx_IRQn SDMMC1_IRQn
#define | SD_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
#define | SD_DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
#define | SD_DMAx_STREAM DMA2_Channel5
#define | SD_DMAx_IRQn DMA2_Channel5_IRQn
#define | SD_DMAx_IRQHandler DMA2_Channel5_IRQHandler

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.
void | BSP_SD_IRQHandler (void)
Handles SD card interrupt request.
void | BSP_SD_DMA_Tx_IRQHandler (void)
Handles SD DMA Tx transfer interrupt request.
void | BSP_SD_DMA_Rx_IRQHandler (void)
Handles SD DMA Rx transfer interrupt request.
uint8_t | BSP_SD_GetCardState (void)
Gets the current SD card data status.
void | BSP_SD_GetCardInfo (BSP_SD_CardInfo *CardInfo)
Get SD information about specific SD card.
uint8_t | BSP_SD_IsDetected (void)
Detects if SD card is correctly plugged in the memory slot or not.
__weak void | BSP_SD_MspInit (SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
__weak void | BSP_SD_MspDeInit (SD_HandleTypeDef *hsd, void *Params)
De-Initializes the SD MSP.
__weak void | BSP_SD_AbortCallback (void)
BSP SD Abort callback.
__weak void | BSP_SD_WriteCpltCallback (void)
BSP Tx Transfer completed callback.
__weak void | BSP_SD_ReadCpltCallback (void)
BSP Rx Transfer completed callback.

Detailed Description

This file includes the uSD card driver.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_sd.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sram.c File Reference

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

This file provides a set of functions needed to drive the IS66WV51216EBLL SRAM memory mounted on STM32L496G-Discovery board. More...

#include "stm32l496g_discovery_sram.h"

Go to the source code of this file.

Defines

#define | SRAM_ADDR_SETUP_TIME 5 /* 60ns with a clock at 80 MHz (period of 12.5 ns) */
#define | SRAM_DATA_SETUP_TIME 3 /* 30ns with a clock at 80 MHz (period of 12.5 ns) */
#define | SRAM_TURN_AROUND_TIME 1 /* 5ns with a clock at 80 MHz (perido of 12.5 ns) */

Functions

static void | SRAM_MspInit (void)
Initializes SRAM MSP.
uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
void | BSP_SRAM_DMA_IRQHandler (void)
Handles SRAM DMA transfer interrupt request.

Variables

static SRAM_HandleTypeDef | sramHandle
static FMC_NORSRAM_TimingTypeDef | Timing

Detailed Description

This file provides a set of functions needed to drive the IS66WV51216EBLL SRAM memory mounted on STM32L496G-Discovery board.

Author:
MCD Application Team
  ==============================================================================
                     ##### How to use this driver #####
  ==============================================================================
  [..]
   (#) This driver is used to drive the IS66WV51216EBLL-70BLI SRAM external memory mounted
       on STM32L496G-Discovery evaluation board.

   (#) This driver does not need a specific component driver for the SRAM device
       to be included with.

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

   (#) SRAM read/write operations
       (++) SRAM external memory can be accessed with read/write operations once it is
            initialized.
            Read/write operation can be performed with AHB access using the functions
            BSP_SRAM_ReadData()/BSP_SRAM_WriteData(), or by DMA transfer using the functions
            BSP_SRAM_ReadData_DMA()/BSP_SRAM_WriteData_DMA().
       (++) The AHB access is performed with 16-bit width transaction, the DMA transfer
            configuration is fixed at single (no burst) halfword transfer
            (see the SRAM_MspInit() static function).
       (++) User can implement his own functions for read/write access with his desired
            configurations.
       (++) If interrupt mode is used for DMA transfer, the function BSP_SRAM_DMA_IRQHandler()
            is called in IRQ handler file, to serve the generated interrupt once the DMA
            transfer is complete.
Attention:

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

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

Definition in file stm32l496g_discovery_sram.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sram.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Defines | Functions
stm32l496g_discovery_sram.h File Reference

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

#include "stm32l4xx_hal.h"

Go to the source code of this file.

Defines

#define | SRAM_OK 0x00
SRAM status structure definition.
#define | SRAM_ERROR 0x01
#define | SRAM_DEVICE_ADDR ((uint32_t)0x64000000)
#define | SRAM_DEVICE_SIZE ((uint32_t)0x80000) /* SRAM device size in MBytes */
#define | SRAM_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define | SRAM_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
#define | SRAM_WRITEBURST FMC_WRITE_BURST_DISABLE
#define | SRAM_DMAx_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
#define | SRAM_DMAx_CHANNEL DMA1_Channel1
#define | SRAM_DMAx_IRQn DMA1_Channel1_IRQn
#define | SRAM_DMAx_IRQHandler DMA1_Channel1_IRQHandler

Functions

uint8_t | BSP_SRAM_Init (void)
Initializes the SRAM device.
uint8_t | BSP_SRAM_ReadData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_ReadData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Reads an amount of data from the SRAM device in DMA mode.
uint8_t | BSP_SRAM_WriteData (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in polling mode.
uint8_t | BSP_SRAM_WriteData_DMA (uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
Writes an amount of data from the SRAM device in DMA mode.
void | BSP_SRAM_DMA_IRQHandler (void)
Handles SRAM DMA transfer interrupt request.

Detailed Description

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

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_sram.h.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_ts.c File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Functions | Variables
stm32l496g_discovery_ts.c File Reference

This file provides a set of functions needed to manage the Touch Screen on STM32L496G-DISCOVERY evaluation board. More...

#include "stm32l496g_discovery.h"
#include "stm32l496g_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_InitEx (uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..) with a given orientation.
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITDeConfig (void)
deConfigures and enables the touch screen interrupts.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_GetOrientation (void)
__weak void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.
__weak void | BSP_TS_INT_MspDeInit (void)
Initializes the TS_INT pin MSP.

Variables

static TS_DrvTypeDef * | tsDriver
static uint8_t | I2C_Address = 0
static uint8_t | tsOrientation = TS_SWAP_NONE
static uint8_t | TS_orientation = TS_ORIENTATION_UNDEFINED
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 STM32L496G-DISCOVERY evaluation board.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_ts.c.


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_ts.h File Reference

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
Data Structures | Defines | Enumerations | Functions | Variables
stm32l496g_discovery_ts.h File Reference

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

#include "stm32l496g_discovery.h"
#include "stm32l496g_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)
#define | TS_ORIENTATION_PORTRAIT ((uint8_t) 0)
#define | TS_ORIENTATION_LANDSCAPE ((uint8_t) 1)
#define | TS_ORIENTATION_UNDEFINED ((uint8_t) 2)

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_InitEx (uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation)
Initializes and configures the touch screen functionalities and configures all necessary hardware resources (GPIOs, I2C, clocks..) with a given orientation.
uint8_t | BSP_TS_GetState (TS_StateTypeDef *TS_State)
Returns status and positions of the touch screen.
uint8_t | BSP_TS_GetOrientation (void)
uint8_t | BSP_TS_ITConfig (void)
Configures and enables the touch screen interrupts.
uint8_t | BSP_TS_ITDeConfig (void)
deConfigures and enables the touch screen interrupts.
void | BSP_TS_INT_MspInit (void)
Initializes the TS_INT pin MSP.
void | BSP_TS_INT_MspDeInit (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 stm32l496g_discovery_ts.c driver.

Author:
MCD Application Team
Attention:

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

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

Definition in file stm32l496g_discovery_ts.h.


STM32L496G-Discovery BSP User Manual: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
AUDIO_IN_TypeDef |
AUDIO_OUT_TypeDef |
dimming_config_s |
LCD_CONTROLLER_TypeDef | LCD constroller Types Definition
LCD_DrawPropTypeDef |
Point |
QSPI_Info |
TS_StateTypeDef | TS_StateTypeDef Define TS State structure
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
A | D | L | P | Q | T
A
D
LCD_DrawPropTypeDef
Q
P
AUDIO_IN_TypeDef dimming_config_s QSPI_Info
AUDIO_OUT_TypeDef
L
Point
T
LCD_CONTROLLER_TypeDef TS_StateTypeDef
A | D | L | P | Q | T
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: C:/git/l4_release_v1.17.0/Firmware/Drivers/ Directory Reference

  • Firmware
  • Drivers
Drivers Directory Reference

Directories

directory BSP
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: C:/git/l4_release_v1.17.0/Firmware/Drivers/BSP/ Directory Reference

  • Firmware
  • Drivers
  • BSP
BSP Directory Reference

Directories

directory STM32L496G-Discovery
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: C:/git/l4_release_v1.17.0/Firmware/Drivers/BSP/STM32L496G-Discovery/ Directory Reference

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

Files

file | stm32l496g_discovery.c [code]

This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L496G-Discovery board (MB1261)

file | stm32l496g_discovery.h [code]

This file contains definitions for STM32L496G_DISCOVERY's LEDs, push-buttons hardware resources (MB1261).

file | stm32l496g_discovery_audio.c [code]

This file provides a set of functions needed to manage the Audio driver for the STM32L496G-Discovery board.

file | stm32l496g_discovery_audio.h [code]

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

file | stm32l496g_discovery_camera.c [code]

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

file | stm32l496g_discovery_camera.h [code]

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

file | stm32l496g_discovery_idd.c [code]

This file provides a set of firmware functions to manage the Idd measurement driver for STM32L496G-Discovery board.

file | stm32l496g_discovery_idd.h [code]

Header file for stm32l496g_discovery_idd.c module.

file | stm32l496g_discovery_io.c [code]

This file provides a set of functions needed to manage the IO pins on STM32L496G-DISCO evaluation board.

file | stm32l496g_discovery_io.h [code]

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

file | stm32l496g_discovery_lcd.c [code]

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

file | stm32l496g_discovery_lcd.h [code]

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

file | stm32l496g_discovery_qspi.c [code]

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

file | stm32l496g_discovery_qspi.h [code]

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

file | stm32l496g_discovery_sd.c [code]

This file includes the uSD card driver.

file | stm32l496g_discovery_sd.h [code]

This file includes the uSD card driver.

file | stm32l496g_discovery_sram.c [code]

This file provides a set of functions needed to drive the IS66WV51216EBLL SRAM memory mounted on STM32L496G-Discovery board.

file | stm32l496g_discovery_sram.h [code]

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

file | stm32l496g_discovery_ts.c [code]

This file provides a set of functions needed to manage the Touch Screen on STM32L496G-DISCOVERY evaluation board.

file | stm32l496g_discovery_ts.h [code]

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

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: C:/git/l4_release_v1.17.0/Firmware/ Directory Reference

  • Firmware
Firmware Directory Reference

Directories

directory Drivers
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Directories

Directories
This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Firmware
    • Drivers
      • BSP
        • STM32L496G-Discovery
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: File List

  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
stm32l496g_discovery.c [code] | This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L496G-Discovery board (MB1261)
stm32l496g_discovery.h [code] | This file contains definitions for STM32L496G_DISCOVERY's LEDs, push-buttons hardware resources (MB1261)
stm32l496g_discovery_audio.c [code] | This file provides a set of functions needed to manage the Audio driver for the STM32L496G-Discovery board
stm32l496g_discovery_audio.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_audio.c driver
stm32l496g_discovery_camera.c [code] | This file includes the driver for Camera modules mounted on STM32L496G-Discovery board
stm32l496g_discovery_camera.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_camera.c driver
stm32l496g_discovery_idd.c [code] | This file provides a set of firmware functions to manage the Idd measurement driver for STM32L496G-Discovery board
stm32l496g_discovery_idd.h [code] | Header file for stm32l496g_discovery_idd.c module
stm32l496g_discovery_io.c [code] | This file provides a set of functions needed to manage the IO pins on STM32L496G-DISCO evaluation board
stm32l496g_discovery_io.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_eval_io.c driver
stm32l496g_discovery_lcd.c [code] | This file includes the driver for Liquid Crystal Display (LCD) module mounted on STM32L496G-DISCOVERY board
stm32l496g_discovery_lcd.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_lcd.c driver
stm32l496g_discovery_qspi.c [code] | This file includes a standard driver for the MX25R6435F QSPI memory mounted on STM32L496G-Discovery board
stm32l496g_discovery_qspi.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_qspi.c driver
stm32l496g_discovery_sd.c [code] | This file includes the uSD card driver
stm32l496g_discovery_sd.h [code] | This file includes the uSD card driver
stm32l496g_discovery_sram.c [code] | This file provides a set of functions needed to drive the IS66WV51216EBLL SRAM memory mounted on STM32L496G-Discovery board
stm32l496g_discovery_sram.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_sram.c driver
stm32l496g_discovery_ts.c [code] | This file provides a set of functions needed to manage the Touch Screen on STM32L496G-DISCOVERY evaluation board
stm32l496g_discovery_ts.h [code] | This file contains the common defines and functions prototypes for the stm32l496g_discovery_ts.c driver
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: BSP

Modules
BSP

Define for STM32L496G_DISCOVERY board. More...

Modules

STM32L496G-DISCOVERY
STM32L496G-DISCO
STM32L496G_DISCO

Detailed Description

Define for STM32L496G_DISCOVERY board.

Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCO

Modules
STM32L496G-DISCO
BSP

Modules

STM32L496G-DISCO IO
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCO IO

Modules
STM32L496G-DISCO IO
STM32L496G-DISCO

Modules

Private Constants
Private Macros
Private Variables
Private Functions
STM32L496G-DISCO_IO_Exported_Functions
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY

Modules
STM32L496G-DISCOVERY

Modules

STM32L496G-DISCOVERY TS
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY TS

Modules
STM32L496G-DISCOVERY TS
STM32L496G-DISCOVERY

Modules

TS Private Types Definitions
TS Private Types Defines
TS Private Macros
TS Imported Variables
TS Private Variables
TS Private Function Prototypes
TS Public Functions
TS Exported Constants
TS Exported Types
TS Exported Functions
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCO

Modules
STM32L496G_DISCO
BSP

Modules

STM32L496G_DISCO_IO
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G_DISCO_IO

Modules
STM32L496G_DISCO_IO
STM32L496G_DISCO

Modules

Exported Types
Exported Constants
Exported Functions
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY

Modules
STM32L496G-DISCOVERY
BSP

Modules

STM32L496G-DISCOVERY Common
STM32L496G-DISCOVERY AUDIO

This file includes the low layer driver for cs42l51 Audio Codec available on STM32L496G-Discovery board (MB1261).

STM32L496G-DISCOVERY IDD

This file includes the Idd driver for STM32L496G-DISCOVERY board.

STM32L496G-DISCOVERY LCD
STM32L496G-DISCOVERY QSPI
STM32L496G_DISCOVERY SD
STM32L496G-DISCOVERY SRAM
STM32L496G_DISCOVERY_CAMERA
STM32L496G_DISCOVERY_CAMERA Exported Functions


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY AUDIO

Modules
STM32L496G-DISCOVERY AUDIO
STM32L496G-DISCOVERY

This file includes the low layer driver for cs42l51 Audio Codec available on STM32L496G-Discovery board (MB1261). More...

Modules

Private Types
Private Constants
Private Macros
Private Variables
Exported Variables
Private Functions
Exported Types
Exported Constants
Exported Macros
Exported Functions
STM32L496G_EVAL_AUDIO_Exported_Functions

Detailed Description

This file includes the low layer driver for cs42l51 Audio Codec available on STM32L496G-Discovery board (MB1261).


STM32L496G-Discovery BSP User Manual: Private Types

Data Structures
Private Types
STM32L496G-DISCOVERY AUDIO

Data Structures

struct | AUDIO_OUT_TypeDef
struct | AUDIO_IN_TypeDef


STM32L496G-Discovery BSP User Manual: Exported Constants

Modules
Exported Constants
STM32L496G-DISCOVERY Common

Modules

FMC LCD Constants
LED Constants
BUTTON Constants
COM Constants
BUS Constants
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY IDD

Modules
STM32L496G-DISCOVERY IDD
STM32L496G-DISCOVERY

This file includes the Idd driver for STM32L496G-DISCOVERY board. More...

Modules

Private Defines
Private Variables
Private Functions
Exported Functions
Exported Types
Exported Defines

Detailed Description

This file includes the Idd driver for STM32L496G-DISCOVERY board.

It allows user to measure MCU Idd current on board, especially in different low power modes.


STM32L496G-Discovery BSP User Manual: Exported Types

Modules
Exported Types
STM32L496G-DISCOVERY IDD

Modules

IDD Config
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY LCD

Modules
STM32L496G-DISCOVERY LCD
STM32L496G-DISCOVERY

Modules

STM32L496G Discovery Lcd Private TypesDef
STM32L496G Discovery Lcd Private Defines
STM32L496G Discovery Lcd Private Macros
STM32L496G Discovery Lcd Private Variables
STM32L496G Discovery Lcd Private Prototypes
STM32L496G Discovery Lcd Private Functions
STM32L496G DISCOVERY LCD Exported Types
STM32L496G DISCOVERY LCD Exported Constants
STM32L496G DISCOVERY LCD Exported Functions


STM32L496G-Discovery BSP User Manual: STM32L496G DISCOVERY LCD Exported Types

Data Structures
STM32L496G DISCOVERY LCD Exported Types
STM32L496G-DISCOVERY LCD

Data Structures

struct LCD_DrawPropTypeDef


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY QSPI

Modules
STM32L496G-DISCOVERY QSPI
STM32L496G-DISCOVERY

Modules

Private Constants
Private Variables
Private Functions
Exported Constants
Exported Types
Exported Functions
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Exported Types

Data Structures
Exported Types
STM32L496G-DISCOVERY QSPI

Data Structures

struct QSPI_Info


STM32L496G-Discovery BSP User Manual: STM32L496G-DISCOVERY SRAM

Modules
STM32L496G-DISCOVERY SRAM
STM32L496G-DISCOVERY

Modules

Private Variables
Private Constants
Private Functions
Exported Functions
Exported Constants
Generated on Wed Feb 10 2021 16:33:04 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: Modules

Modules
Here is a list of all modules:
  • BSP
    • STM32L496G-DISCOVERY
      • STM32L496G-DISCOVERY Common
        • Private Types Definitions
        • Private Defines
        • Private Macros
        • Exported Variables
        • Private Functions
        • Exported Functions
        • Bus Operations Functions
        • Exported Types
        • Exported Constants
          • FMC LCD Constants
          • LED Constants
          • BUTTON Constants
          • COM Constants
          • BUS Constants
      • STM32L496G-DISCOVERY AUDIO
        • Private Types
        • Private Constants
        • Private Macros
        • Private Variables
        • Exported Variables
        • Private Functions
        • Exported Types
        • Exported Constants
          • BSP Audio Out Option
          • BSP Audio Sample Rate
        • Exported Macros
        • Exported Functions
        • STM32L496G_EVAL_AUDIO_Exported_Functions
      • STM32L496G-DISCOVERY IDD
        • Private Defines
        • Private Variables
        • Private Functions
        • Exported Functions
        • Exported Types
          • IDD Config
        • Exported Defines
      • STM32L496G-DISCOVERY LCD
        • STM32L496G Discovery Lcd Private TypesDef
        • STM32L496G Discovery Lcd Private Defines
        • STM32L496G Discovery Lcd Private Macros
        • STM32L496G Discovery Lcd Private Variables
        • STM32L496G Discovery Lcd Private Prototypes
        • STM32L496G Discovery Lcd Private Functions
        • STM32L496G DISCOVERY LCD Exported Types
        • STM32L496G DISCOVERY LCD Exported Constants
        • STM32L496G DISCOVERY LCD Exported Functions
      • STM32L496G-DISCOVERY QSPI
        • Private Constants
        • Private Variables
        • Private Functions
        • Exported Constants
        • Exported Types
        • Exported Functions
      • STM32L496G_DISCOVERY SD
        • Private Variables
        • Private Functions
        • Exported Types
        • Exported Constants
        • Exported Functions
      • STM32L496G-DISCOVERY SRAM
        • Private Variables
        • Private Constants
        • Private Functions
        • Exported Functions
          • STM32L476G_EVAL_SRAM_Private_Functions
        • Exported Constants
      • STM32L496G_DISCOVERY_CAMERA
        • STM32L496G_DISCOVERY_CAMERA Private Types Definitions
        • STM32L496G_DISCOVERY_CAMERA Private Defines
        • STM32L496G_DISCOVERY_CAMERA Private Macros
        • STM32L496G_DISCOVERY_CAMERA Private Variables
        • STM32L496G_DISCOVERY_CAMERA Private Function Prototypes
        • STM32L496G_DISCOVERY_CAMERA Exported Functions
        • STM32L496G_DISCOVERY_CAMERA Exported Types
        • STM32L496G_DISCOVERY_CAMERA Exported Constants
      • STM32L496G_DISCOVERY_CAMERA Exported Functions
    • STM32L496G-DISCO
      • STM32L496G-DISCO IO
        • Private Constants
        • Private Macros
        • Private Variables
        • Private Functions
        • STM32L496G-DISCO_IO_Exported_Functions
    • STM32L496G_DISCO
      • STM32L496G_DISCO_IO
        • Exported Types
        • Exported Constants
        • Exported Functions
  • STM32L496G-DISCOVERY
    • STM32L496G-DISCOVERY TS
      • TS Private Types Definitions
      • TS Private Types Defines
      • TS Private Macros
      • TS Imported Variables
      • TS Private Variables
      • TS Private Function Prototypes
      • TS Public Functions
        • TS Private Functions
      • TS Exported Constants
      • TS Exported Types
      • TS Exported Functions
Generated on Wed Feb 10 2021 16:33:05 for STM32L496G-Discovery BSP User Manual by doxygen 1.7.6.1


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to manage Leds,
00006   *          push-button and joystick of STM32L496G-Discovery board (MB1261)
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Includes ------------------------------------------------------------------*/
00022 #include "stm32l496g_discovery.h"
00023 #include "stm32l496g_discovery_io.h"
00024 #include "stm32l496g_discovery_lcd.h"
00025
00026 /** @addtogroup BSP
00027   * @{
00028   */
00029
00030 /** @defgroup STM32L496G_DISCOVERY STM32L496G-DISCOVERY
00031   * @{
00032   */
00033
00034 /** @defgroup STM32L496G_DISCOVERY_Common STM32L496G-DISCOVERY Common
00035   * @{
00036   */
00037
00038 /** @defgroup STM32L496G_DISCOVERY_Private_TypesDefinitions Private Types Definitions
00039   * @brief This file provides firmware functions to manage Leds, push-buttons,
00040   *        COM ports, SD card on SPI and temperature sensor (TS751) available on
00041   *        STM32L496G-DISCOVERY discoveryuation board from STMicroelectronics.
00042   * @{
00043   */
00044
00045 /**
00046   * @}
00047   */
00048
00049 /** @defgroup STM32L496G_DISCOVERY_Private_Defines Private Defines
00050   * @{
00051   */
00052
00053 /**
00054  * @brief STM32L496G DISCOVERY BSP Driver version number
00055    */
00056 #define __STM32L496G_DISCOVERY_BSP_VERSION_MAIN   (0x01) /*!< [31:24] main version */
00057 #define __STM32L496G_DISCOVERY_BSP_VERSION_SUB1   (0x01) /*!< [23:16] sub1 version */
00058 #define __STM32L496G_DISCOVERY_BSP_VERSION_SUB2   (0x06) /*!< [15:8]  sub2 version */
00059 #define __STM32L496G_DISCOVERY_BSP_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00060 #define __STM32L496G_DISCOVERY_BSP_VERSION            ((__STM32L496G_DISCOVERY_BSP_VERSION_MAIN << 24)\
00061                                                       |(__STM32L496G_DISCOVERY_BSP_VERSION_SUB1 << 16)\
00062                                                       |(__STM32L496G_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
00063                                                       |(__STM32L496G_DISCOVERY_BSP_VERSION_RC))
00064 /**
00065   * @}
00066   */
00067
00068
00069 /** @defgroup STM32L496G_DISCOVERY_Private_Macros Private Macros
00070   * @{
00071   */
00072
00073 /**
00074   * @}
00075   */
00076
00077
00078 /** @defgroup STM32L496G_DISCOVERY_Exported_Variables Exported Variables
00079   * @{
00080   */
00081
00082 /**
00083  * @brief LED variables
00084  */
00085 const uint16_t  LED_PIN[LEDn] =                 {LED1_PIN,
00086                                                  LED2_PIN
00087                                                 };
00088
00089 /**
00090  * @brief JOYSTICK variables
00091  */
00092 GPIO_TypeDef *JOY_PORT[JOYn] =  {SEL_JOY_GPIO_PORT,
00093                                  LEFT_JOY_GPIO_PORT,
00094                                  RIGHT_JOY_GPIO_PORT,
00095                                  DOWN_JOY_GPIO_PORT,
00096                                  UP_JOY_GPIO_PORT
00097                                 };
00098
00099 const uint16_t JOY_PIN[JOYn] =   {SEL_JOY_PIN,
00100                                   LEFT_JOY_PIN,
00101                                   RIGHT_JOY_PIN,
00102                                   DOWN_JOY_PIN,
00103                                   UP_JOY_PIN
00104                                  };
00105
00106 const uint8_t JOY_IRQn[JOYn] =   {SEL_JOY_EXTI_IRQn,
00107                                   LEFT_JOY_EXTI_IRQn,
00108                                   RIGHT_JOY_EXTI_IRQn,
00109                                   DOWN_JOY_EXTI_IRQn,
00110                                   UP_JOY_EXTI_IRQn
00111                                  };
00112
00113
00114 /**
00115  * @brief COM port variables
00116  */
00117 #if defined(HAL_UART_MODULE_ENABLED)
00118 USART_TypeDef* COM_USART[COMn] = {DISCOVERY_COM1};
00119 GPIO_TypeDef* COM_TX_PORT[COMn] = {DISCOVERY_COM1_TX_GPIO_PORT};
00120 GPIO_TypeDef* COM_RX_PORT[COMn] = {DISCOVERY_COM1_RX_GPIO_PORT};
00121 const uint16_t COM_TX_PIN[COMn] = {DISCOVERY_COM1_TX_PIN};
00122 const uint16_t COM_RX_PIN[COMn] = {DISCOVERY_COM1_RX_PIN};
00123 const uint16_t COM_TX_AF[COMn] = {DISCOVERY_COM1_TX_AF};
00124 const uint16_t COM_RX_AF[COMn] = {DISCOVERY_COM1_RX_AF};
00125 #endif /* HAL_UART_MODULE_ENABLED */
00126
00127
00128 /**
00129  * @brief BUS variables
00130  */
00131 #if defined(HAL_I2C_MODULE_ENABLED)
00132 uint32_t I2c1Timeout = DISCOVERY_I2C2_TIMEOUT_MAX;  /*<! Value of Timeout when I2C1 communication fails */
00133 uint32_t I2c2Timeout = DISCOVERY_I2C2_TIMEOUT_MAX;  /*<! Value of Timeout when I2C2 communication fails */
00134 uint32_t ts_io_init = 0;
00135 static I2C_HandleTypeDef I2c2Handle = {0};
00136 static I2C_HandleTypeDef hI2cTSHandler = {0}; /* Touch Screen (Capacitive Touch Panel) Handler */
00137 static I2C_HandleTypeDef hI2cAudioHandler = {0};
00138 static I2C_HandleTypeDef hI2cCameraHandler = {0} ;
00139 #endif /* HAL_I2C_MODULE_ENABLED */
00140
00141 /**
00142   * @}
00143   */
00144
00145 /** @defgroup STM32L496G_DISCOVERY_Private_FunctionPrototypes Private Functions
00146   * @{
00147   */
00148 /**************************** Bus functions ************************************/
00149 /* I2C2 bus function */
00150 #if defined(HAL_I2C_MODULE_ENABLED)
00151 static void               I2C2_MspInit(I2C_HandleTypeDef *hi2c);
00152 static void               I2C2_MspDeInit(I2C_HandleTypeDef *hi2c);
00153 static void               I2C2_WriteData(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t Value);
00154 static HAL_StatusTypeDef  I2C2_WriteBuffer(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length);
00155 static uint8_t            I2C2_ReadData(uint16_t Addr, uint16_t Reg, uint16_t RegSize);
00156 static HAL_StatusTypeDef  I2C2_ReadBuffer(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length);
00157 static void               I2C2_Error(void);
00158
00159 #endif/* HAL_I2C_MODULE_ENABLED */
00160
00161
00162 /**************************** Link functions ***********************************/
00163 #if defined(HAL_I2C_MODULE_ENABLED)
00164
00165 static void     FMC_BANK1_WriteData(uint16_t Data);
00166 static void     FMC_BANK1_WriteReg(uint8_t Reg);
00167 static uint16_t FMC_BANK1_ReadData(void);
00168 static void     FMC_BANK1_Init(void);
00169
00170
00171 /* LCD IO functions */
00172 void            LCD_IO_Init(void);
00173 void            LCD_IO_WriteData(uint16_t RegValue);
00174 void            LCD_IO_WriteReg(uint8_t Reg);
00175 void            LCD_IO_WriteMultipleData(uint16_t *pData, uint32_t Size);
00176 uint16_t        LCD_IO_ReadData(void);
00177 void            LCD_IO_Delay(uint32_t Delay);
00178
00179 /* Link functions for Audio Codec peripheral */
00180 void                      AUDIO_IO_Init(void);
00181 void                      AUDIO_IO_DeInit(void);
00182 void                      AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00183 uint8_t                   AUDIO_IO_Read(uint8_t Addr, uint8_t Reg);
00184 void                      AUDIO_IO_Delay(uint32_t delay);
00185
00186 /* TouchScreen (TS) IO functions */
00187 void     TS_IO_Init(void);
00188 void     TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00189 uint8_t  TS_IO_Read(uint8_t Addr, uint8_t Reg);
00190 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00191 void     TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00192 void     TS_IO_Delay(uint32_t Delay);
00193
00194 /* CAMERA IO functions */
00195 void            CAMERA_IO_Init(void);
00196 void            CAMERA_Delay(uint32_t Delay);
00197 void            CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00198 uint8_t         CAMERA_IO_Read(uint8_t Addr, uint8_t Reg);
00199
00200 #endif/* HAL_I2C_MODULE_ENABLED */
00201
00202
00203 #if defined(HAL_I2C_MODULE_ENABLED)
00204 /*  Link functions IOExpander */
00205 void                      IOE_Init(void);
00206 void                      IOE_ITConfig(void);
00207 void                      IOE_Delay(uint32_t Delay);
00208 void                      IOE_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
00209 uint8_t                   IOE_Read(uint8_t Addr, uint8_t Reg);
00210 uint16_t                  IOE_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00211
00212 /* Link functions for IDD measurement */
00213 void                      MFX_IO_Init(void);
00214 void                      MFX_IO_DeInit(void);
00215 void                      MFX_IO_ITConfig(void);
00216 void                      MFX_IO_EnableWakeupPin(void);
00217 void                      MFX_IO_Wakeup(void);
00218 void                      MFX_IO_Delay(uint32_t delay);
00219 void                      MFX_IO_Write(uint16_t addr, uint8_t reg, uint8_t value);
00220 uint8_t                   MFX_IO_Read(uint16_t addr, uint8_t reg);
00221 void                      MFX_IO_WriteMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
00222 uint16_t                  MFX_IO_ReadMultiple(uint16_t addr, uint8_t reg, uint8_t *buffer, uint16_t length);
00223
00224 static void     I2Cx_Init(I2C_HandleTypeDef *i2c_handler);
00225
00226 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00227 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
00228 static void              I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr);
00229
00230 static uint8_t I2C2_isDeviceReady(uint16_t Addr, uint32_t trial);
00231
00232 #endif/* HAL_I2C_MODULE_ENABLED */
00233 /**
00234   * @}
00235   */
00236
00237 __weak void BSP_ErrorHandler(void)
00238 {
00239   while (1);
00240 }
00241
00242 /** @defgroup STM32L496G_DISCOVERY_Exported_Functions Exported Functions
00243   * @{
00244   */
00245
00246 /**
00247   * @brief  This method returns the STM32L496 DISCOVERY BSP Driver revision
00248   * @retval version : 0xXYZR (8bits for each decimal, R for RC)
00249   */
00250 uint32_t BSP_GetVersion(void)
00251 {
00252   return __STM32L496G_DISCOVERY_BSP_VERSION;
00253 }
00254
00255
00256
00257 /**
00258   * @brief  Configures LED GPIOs.
00259   * @param  Led: Specifies the Led to be configured.
00260   *   This parameter can be one of following parameters:
00261   *     @arg LED1
00262   *     @arg LED2
00263   * @retval None
00264   */
00265 void BSP_LED_Init(Led_TypeDef Led)
00266 {
00267   GPIO_InitTypeDef  GPIO_InitStructure;
00268
00269   if (Led == LED2)
00270   {
00271     /* Enable the GPIO_LED clock */
00272     LED2_GPIO_CLK_ENABLE();
00273
00274     /* Configure the GPIO_LED pin */
00275     GPIO_InitStructure.Pin = LED_PIN[Led];
00276     GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
00277     GPIO_InitStructure.Pull = GPIO_NOPULL;
00278     GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
00279
00280     HAL_GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStructure);
00281     /* By default, turn off LED */
00282     HAL_GPIO_WritePin(LED2_GPIO_PORT, GPIO_InitStructure.Pin, GPIO_PIN_SET);
00283   }
00284   else
00285   {
00286     /* Initialize the IO functionalities */
00287     if (BSP_IO_Init() == IO_ERROR)
00288     {
00289       BSP_ErrorHandler();
00290     }
00291
00292     BSP_IO_ConfigPin(LED_PIN[Led], IO_MODE_OUTPUT);
00293
00294     /* By default, turn off LED */
00295     BSP_IO_WritePin(LED_PIN[Led], GPIO_PIN_SET);
00296   }
00297
00298 }
00299
00300
00301 /**
00302   * @brief  Unconfigures LED GPIOs.
00303   * @param  Led: Specifies the Led to be unconfigured.
00304   *   This parameter can be one of following parameters:
00305   *     @arg LED1
00306   *     @arg LED2
00307   * @retval None
00308   */
00309 void BSP_LED_DeInit(Led_TypeDef Led)
00310 {
00311   if (Led == LED2)
00312   {
00313     /* Enable the GPIO_LED clock */
00314     LED2_GPIO_CLK_ENABLE();
00315
00316     HAL_GPIO_DeInit(LED2_GPIO_PORT, LED_PIN[Led]);
00317   }
00318 }
00319
00320
00321 /**
00322   * @brief  Turns selected LED On.
00323   * @param  Led: Specifies the Led to be set on.
00324   *   This parameter can be one of following parameters:
00325   *     @arg LED1
00326   *     @arg LED2
00327   * @retval None
00328   */
00329 void BSP_LED_On(Led_TypeDef Led)
00330 {
00331   if (Led == LED2)
00332   {
00333     HAL_GPIO_WritePin(LED2_GPIO_PORT, LED_PIN[Led], GPIO_PIN_RESET);
00334   }
00335   else
00336   {
00337     BSP_IO_WritePin(LED_PIN[Led], GPIO_PIN_RESET);
00338   }
00339 }
00340
00341
00342 /**
00343   * @brief  Turns selected LED Off.
00344   * @param  Led: Specifies the Led to be set off.
00345   *   This parameter can be one of following parameters:
00346   *     @arg LED1
00347   *     @arg LED2
00348   * @retval None
00349   */
00350 void BSP_LED_Off(Led_TypeDef Led)
00351 {
00352   if (Led == LED2)
00353   {
00354     HAL_GPIO_WritePin(LED2_GPIO_PORT, LED_PIN[Led], GPIO_PIN_SET);
00355   }
00356   else
00357   {
00358     BSP_IO_WritePin(LED_PIN[Led], GPIO_PIN_SET);
00359   }
00360 }
00361
00362
00363 /**
00364   * @brief  Toggles the selected LED.
00365   * @param  Led: Specifies the Led to be toggled.
00366   *   This parameter can be one of following parameters:
00367   *     @arg LED1
00368   *     @arg LED2
00369   * @retval None
00370   */
00371 void BSP_LED_Toggle(Led_TypeDef Led)
00372 {
00373   if (Led == LED2)
00374   {
00375     HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED_PIN[Led]);
00376   }
00377   else
00378   {
00379     BSP_IO_TogglePin(LED_PIN[Led]);
00380   }
00381 }
00382
00383 /**
00384   * @brief  Configures all buttons of the joystick in GPIO or EXTI modes.
00385   * @param  Joy_Mode: Joystick mode.
00386   *    This parameter can be one of the following values:
00387   *     @arg  JOY_MODE_GPIO: Joystick pins will be used as simple IOs
00388   *     @arg  JOY_MODE_EXTI: Joystick pins will be connected to EXTI line
00389   *                                 with interrupt generation capability
00390   * @retval HAL_OK: if all initializations are OK. Other value if error.
00391   */
00392 uint8_t BSP_JOY_Init(JOYMode_TypeDef Joy_Mode)
00393 {
00394   JOYState_TypeDef joykey;
00395   GPIO_InitTypeDef GPIO_InitStruct;
00396
00397   /* Initialized the Joystick. */
00398   for (joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00399   {
00400     /* Enable the JOY clock */
00401     JOYx_GPIO_CLK_ENABLE(joykey);
00402
00403     GPIO_InitStruct.Pin = JOY_PIN[joykey];
00404     GPIO_InitStruct.Pull = GPIO_PULLDOWN;
00405     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
00406
00407     if (Joy_Mode == JOY_MODE_GPIO)
00408     {
00409       /* Configure Joy pin as input */
00410       GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
00411       HAL_GPIO_Init(JOY_PORT[joykey], &GPIO_InitStruct);
00412     }
00413     else if (Joy_Mode == JOY_MODE_EXTI)
00414     {
00415       /* Configure Joy pin as input with External interrupt */
00416       GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
00417       HAL_GPIO_Init(JOY_PORT[joykey], &GPIO_InitStruct);
00418       /* Enable and set Joy EXTI Interrupt to the lowest priority */
00419       HAL_NVIC_SetPriority((IRQn_Type)(JOY_IRQn[joykey]), 0x0F, 0x00);
00420       HAL_NVIC_EnableIRQ((IRQn_Type)(JOY_IRQn[joykey]));
00421     }
00422   }
00423
00424   return HAL_OK;
00425 }
00426
00427 /**
00428   * @brief  Unconfigures all GPIOs used as buttons of the joystick.
00429   * @retval None.
00430   */
00431 void BSP_JOY_DeInit(void)
00432 {
00433   JOYState_TypeDef joykey;
00434
00435   /* Initialized the Joystick. */
00436   for (joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00437   {
00438     /* Enable the JOY clock */
00439     JOYx_GPIO_CLK_ENABLE(joykey);
00440
00441     HAL_GPIO_DeInit(JOY_PORT[joykey], JOY_PIN[joykey]);
00442   }
00443 }
00444
00445 /**
00446 * @brief  Returns the current joystick status.
00447 * @retval Code of the joystick key pressed
00448 *          This code can be one of the following values:
00449 *            @arg  JOY_NONE
00450 *            @arg  JOY_SEL
00451 *            @arg  JOY_DOWN
00452 *            @arg  JOY_LEFT
00453 *            @arg  JOY_RIGHT
00454 *            @arg  JOY_UP
00455 */
00456 JOYState_TypeDef BSP_JOY_GetState(void)
00457 {
00458   JOYState_TypeDef joykey;
00459
00460   for (joykey = JOY_SEL; joykey < (JOY_SEL + JOYn) ; joykey++)
00461   {
00462     if (HAL_GPIO_ReadPin(JOY_PORT[joykey], JOY_PIN[joykey]) == GPIO_PIN_SET)
00463     {
00464       /* Return Code Joystick key pressed */
00465       return joykey;
00466     }
00467   }
00468
00469   /* No Joystick key pressed */
00470   return JOY_NONE;
00471 }
00472
00473 #if defined(HAL_UART_MODULE_ENABLED)
00474 /**
00475   * @brief  Configures COM port.
00476   * @param  COM: COM port to be configured.
00477   *          This parameter can be one of the following values:
00478   *            @arg  COM1
00479   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00480   *                configuration information for the specified USART peripheral.
00481   */
00482 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart)
00483 {
00484   GPIO_InitTypeDef gpio_init_structure;
00485
00486   /* Enable GPIO clock */
00487   DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(COM);
00488   DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(COM);
00489
00490   /* Enable USART clock */
00491   DISCOVERY_COMx_CLK_ENABLE(COM);
00492
00493   /* Configure USART Tx as alternate function */
00494   gpio_init_structure.Pin = COM_TX_PIN[COM];
00495   gpio_init_structure.Mode = GPIO_MODE_AF_PP;
00496   gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
00497   gpio_init_structure.Pull = GPIO_NOPULL;
00498   gpio_init_structure.Alternate = COM_TX_AF[COM];
00499   HAL_GPIO_Init(COM_TX_PORT[COM], &gpio_init_structure);
00500
00501   /* Configure USART Rx as alternate function */
00502   gpio_init_structure.Pin = COM_RX_PIN[COM];
00503   gpio_init_structure.Alternate = COM_RX_AF[COM];
00504   HAL_GPIO_Init(COM_RX_PORT[COM], &gpio_init_structure);
00505
00506   /* USART configuration */
00507   huart->Instance = COM_USART[COM];
00508   HAL_UART_Init(huart);
00509 }
00510
00511 /**
00512   * @brief  DeInit COM port.
00513   * @param  COM: COM port to be configured.
00514   *          This parameter can be one of the following values:
00515   *            @arg  COM1
00516   * @param  huart: Pointer to a UART_HandleTypeDef structure that contains the
00517   *                configuration information for the specified USART peripheral.
00518   */
00519 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart)
00520 {
00521   /* USART deinitialization */
00522   huart->Instance = COM_USART[COM];
00523   HAL_UART_DeInit(huart);
00524
00525   /* Disable USART clock */
00526   DISCOVERY_COMx_CLK_DISABLE(COM);
00527
00528   /* USART TX/RX pins deinitializations */
00529   HAL_GPIO_DeInit(COM_TX_PORT[COM], COM_TX_PIN[COM]);
00530   HAL_GPIO_DeInit(COM_RX_PORT[COM], COM_RX_PIN[COM]);
00531
00532   /* Disable GPIOs clock is left for application */
00533 }
00534 #endif /* HAL_UART_MODULE_ENABLED */
00535
00536 /**
00537   * @}
00538   */
00539
00540 /** @defgroup STM32L496G_DISCOVERY_BusOperations_Functions Bus Operations Functions
00541   * @{
00542   */
00543
00544 /*******************************************************************************
00545                             BUS OPERATIONS
00546 *******************************************************************************/
00547
00548 #if defined(HAL_I2C_MODULE_ENABLED)
00549 /******************************* I2C Routines**********************************/
00550 /**
00551   * @brief Discovery I2C2 Bus initialization
00552   * @retval None
00553   */
00554 void I2C2_Init(void)
00555 {
00556   if (HAL_I2C_GetState(&I2c2Handle) == HAL_I2C_STATE_RESET)
00557   {
00558     I2c2Handle.Instance              = DISCOVERY_I2C2;
00559     I2c2Handle.Init.Timing           = DISCOVERY_I2C2_TIMING;
00560     I2c2Handle.Init.OwnAddress1      = 0x70;
00561     I2c2Handle.Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00562     I2c2Handle.Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00563     I2c2Handle.Init.OwnAddress2      = 0xFF;
00564     I2c2Handle.Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00565     I2c2Handle.Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00566
00567     /* Init the I2C */
00568     I2C2_MspInit(&I2c2Handle);
00569     HAL_I2C_Init(&I2c2Handle);
00570   }
00571 }
00572
00573 /**
00574   * @brief Discovery I2C2 MSP Initialization
00575   * @param hi2c: I2C2 handle
00576   * @retval None
00577   */
00578 static void I2C2_MspInit(I2C_HandleTypeDef *hi2c)
00579 {
00580   GPIO_InitTypeDef  GPIO_InitStructure;
00581   RCC_PeriphCLKInitTypeDef  RCC_PeriphCLKInitStruct;
00582
00583   if (hi2c->Instance == DISCOVERY_I2C2)
00584   {
00585     /*##-1- Configure the Discovery I2C2 clock source. The clock is derived from the SYSCLK #*/
00586     RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C2;
00587     RCC_PeriphCLKInitStruct.I2c2ClockSelection = RCC_I2C2CLKSOURCE_SYSCLK;
00588     HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct);
00589
00590     /*##-2- Configure the GPIOs ################################################*/
00591     /* Enable GPIO clock */
00592     DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE();
00593     DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE();
00594
00595     /* Configure I2C Rx/Tx as alternate function  */
00596     GPIO_InitStructure.Pin       = DISCOVERY_I2C2_SCL_PIN;
00597     GPIO_InitStructure.Mode      = GPIO_MODE_AF_OD;
00598     GPIO_InitStructure.Pull      = /*GPIO_NOPULL*/ GPIO_PULLUP;
00599     GPIO_InitStructure.Speed     = /*GPIO_SPEED_MEDIUM*/ GPIO_SPEED_FREQ_VERY_HIGH;
00600     GPIO_InitStructure.Alternate = DISCOVERY_I2C2_SCL_SDA_AF;
00601     HAL_GPIO_Init(DISCOVERY_I2C2_SCL_GPIO_PORT, &GPIO_InitStructure);
00602     GPIO_InitStructure.Pin       = DISCOVERY_I2C2_SDA_PIN;
00603     HAL_GPIO_Init(DISCOVERY_I2C2_SDA_GPIO_PORT, &GPIO_InitStructure);
00604
00605     /*##-3- Configure the Discovery I2C2 peripheral #############################*/
00606     /* Enable Discovery_I2C2 clock */
00607     DISCOVERY_I2C2_CLK_ENABLE();
00608
00609     /* Force and release the I2C Peripheral Clock Reset */
00610     DISCOVERY_I2C2_FORCE_RESET();
00611     DISCOVERY_I2C2_RELEASE_RESET();
00612
00613     /* Enable and set Discovery I2C2 Interrupt to the highest priority */
00614     HAL_NVIC_SetPriority(DISCOVERY_I2C2_EV_IRQn, 0x00, 0);
00615     HAL_NVIC_EnableIRQ(DISCOVERY_I2C2_EV_IRQn);
00616
00617     /* Enable and set Discovery I2C2 Interrupt to the highest priority */
00618     HAL_NVIC_SetPriority(DISCOVERY_I2C2_ER_IRQn, 0x00, 0);
00619     HAL_NVIC_EnableIRQ(DISCOVERY_I2C2_ER_IRQn);
00620   }
00621 }
00622
00623 /**
00624   * @brief Discovery I2C2 Bus Deinitialization
00625   * @retval None
00626   */
00627 void I2C2_DeInit(void)
00628 {
00629   if (HAL_I2C_GetState(&I2c2Handle) != HAL_I2C_STATE_RESET)
00630   {
00631     /* DeInit the I2C */
00632     HAL_I2C_DeInit(&I2c2Handle);
00633     I2C2_MspDeInit(&I2c2Handle);
00634   }
00635 }
00636
00637 /**
00638   * @brief Discovery I2C2 MSP DeInitialization
00639   * @param hi2c: I2C2 handle
00640   * @retval None
00641   */
00642 static void I2C2_MspDeInit(I2C_HandleTypeDef *hi2c)
00643 {
00644   if (hi2c->Instance == DISCOVERY_I2C2)
00645   {
00646     /*##-1- Unconfigure the GPIOs ################################################*/
00647     /* Enable GPIO clock */
00648     DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE();
00649     DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE();
00650
00651     /* Configure I2C Rx/Tx as alternate function  */
00652     HAL_GPIO_DeInit(DISCOVERY_I2C2_SCL_GPIO_PORT, DISCOVERY_I2C2_SCL_PIN);
00653     HAL_GPIO_DeInit(DISCOVERY_I2C2_SDA_GPIO_PORT,  DISCOVERY_I2C2_SDA_PIN);
00654
00655     /*##-2- Unconfigure the Discovery I2C2 peripheral ############################*/
00656     /* Force and release I2C Peripheral */
00657     DISCOVERY_I2C2_FORCE_RESET();
00658     DISCOVERY_I2C2_RELEASE_RESET();
00659
00660     /* Disable Discovery I2C2 clock */
00661     DISCOVERY_I2C2_CLK_DISABLE();
00662
00663     /* Disable Discovery I2C2 interrupts */
00664     HAL_NVIC_DisableIRQ(DISCOVERY_I2C2_EV_IRQn);
00665     HAL_NVIC_DisableIRQ(DISCOVERY_I2C2_ER_IRQn);
00666   }
00667 }
00668
00669 /**
00670   * @brief  Write a value in a register of the device through BUS.
00671   * @param  Addr: Device address on BUS Bus.
00672   * @param  Reg: The target register address to write
00673   * @param  RegSize: The target register size (can be 8BIT or 16BIT)
00674   * @param  Value: The target register value to be written
00675   * @retval None
00676   */
00677 static void I2C2_WriteData(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t Value)
00678 {
00679   HAL_StatusTypeDef status = HAL_OK;
00680
00681   __disable_irq();
00682
00683   status = HAL_I2C_Mem_Write(&I2c2Handle, Addr, (uint16_t)Reg, RegSize, &Value, 1, I2c2Timeout);
00684
00685   __enable_irq();
00686
00687
00688   /* Check the communication status */
00689   if (status != HAL_OK)
00690   {
00691     /* Re-Initiaize the BUS */
00692     I2C2_Error();
00693   }
00694 }
00695
00696 /**
00697   * @brief  Write a value in a register of the device through BUS.
00698   * @param  Addr: Device address on BUS Bus.
00699   * @param  Reg: The target register address to write
00700   * @param  RegSize: The target register size (can be 8BIT or 16BIT)
00701   * @param  pBuffer: The target register value to be written
00702   * @param  Length: buffer size to be written
00703   * @retval None
00704   */
00705 static HAL_StatusTypeDef I2C2_WriteBuffer(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
00706 {
00707   HAL_StatusTypeDef status = HAL_OK;
00708
00709   __disable_irq();
00710
00711   status = HAL_I2C_Mem_Write(&I2c2Handle, Addr, (uint16_t)Reg, RegSize, pBuffer, Length, I2c2Timeout);
00712
00713   __enable_irq();
00714
00715
00716   /* Check the communication status */
00717   if (status != HAL_OK)
00718   {
00719     /* Re-Initiaize the BUS */
00720     I2C2_Error();
00721   }
00722
00723   return status;
00724 }
00725
00726 /**
00727   * @brief  Read a register of the device through BUS
00728   * @param  Addr: Device address on BUS
00729   * @param  Reg: The target register address to read
00730   * @param  RegSize: The target register size (can be 8BIT or 16BIT)
00731   * @retval read register value
00732   */
00733 static uint8_t I2C2_ReadData(uint16_t Addr, uint16_t Reg, uint16_t RegSize)
00734 {
00735   HAL_StatusTypeDef status = HAL_OK;
00736   uint8_t value = 0x0;
00737
00738   __disable_irq();
00739
00740   status = HAL_I2C_Mem_Read(&I2c2Handle, Addr, Reg, RegSize, &value, 1, I2c2Timeout);
00741
00742   __enable_irq();
00743
00744   /* Check the communication status */
00745   if (status != HAL_OK)
00746   {
00747     /* Re-Initiaize the BUS */
00748     I2C2_Error();
00749     HAL_Delay(200);
00750   }
00751
00752   return value;
00753 }
00754
00755 static uint8_t I2C2_isDeviceReady(uint16_t Addr, uint32_t trial)
00756 {
00757   HAL_StatusTypeDef status = HAL_OK;
00758   uint8_t value = 0x0;
00759
00760   __disable_irq();
00761
00762   status = HAL_I2C_IsDeviceReady(&I2c2Handle, Addr, trial, 50);
00763
00764   __enable_irq();
00765
00766   /* Check the communication status */
00767   if (status != HAL_OK)
00768   {
00769     /* Re-Initiaize the BUS */
00770     I2C2_Error();
00771     HAL_Delay(200);
00772   }
00773
00774   return value;
00775 }
00776
00777 /**
00778   * @brief  Reads multiple data on the BUS.
00779   * @param  Addr: I2C Address
00780   * @param  Reg: Reg Address
00781   * @param  RegSize : The target register size (can be 8BIT or 16BIT)
00782   * @param  pBuffer: pointer to read data buffer
00783   * @param  Length: length of the data
00784   * @retval 0 if no problems to read multiple data
00785   */
00786 static HAL_StatusTypeDef I2C2_ReadBuffer(uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
00787 {
00788   HAL_StatusTypeDef status = HAL_OK;
00789
00790   __disable_irq();
00791
00792   status = HAL_I2C_Mem_Read(&I2c2Handle, Addr, (uint16_t)Reg, RegSize, pBuffer, Length, I2c2Timeout);
00793
00794   __enable_irq();
00795
00796   /* Check the communication status */
00797   if (status != HAL_OK)
00798   {
00799     /* Re-Initiaize the BUS */
00800     I2C2_Error();
00801   }
00802
00803   return status;
00804 }
00805
00806 /**
00807   * @brief Discovery I2C2 error treatment function
00808   * @retval None
00809   */
00810 static void I2C2_Error(void)
00811 {
00812   BSP_ErrorHandler();
00813
00814   /* De-initialize the I2C communication BUS */
00815   HAL_I2C_DeInit(&I2c2Handle);
00816
00817   /* Re- Initiaize the I2C communication BUS */
00818   I2C2_Init();
00819 }
00820
00821
00822
00823 /******************************* I2C Routines *********************************/
00824 /**
00825   * @brief  Initializes I2C HAL.
00826   * @param  i2c_handler : I2C handler
00827   * @retval None
00828   */
00829 static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler)
00830 {
00831
00832   if (HAL_I2C_GetState(i2c_handler) == HAL_I2C_STATE_RESET)
00833   {
00834     if (i2c_handler == (I2C_HandleTypeDef *)(&hI2cTSHandler))
00835     {
00836       /* TS (Capacitive Touch Panel) and LCD I2C configuration */
00837       i2c_handler->Instance = DISCOVERY_TS_I2Cx;
00838
00839       /* Need to enable MFX, and in doing so, initialize I2C at the same time */
00840       /* MFX_IO_Init();*/
00841
00842     }
00843     else if (i2c_handler == (I2C_HandleTypeDef *)(&hI2cAudioHandler))
00844     {
00845       /* Audio and LCD I2C configuration */
00846       i2c_handler->Instance = DISCOVERY_AUDIO_I2Cx;
00847     }
00848     else if (i2c_handler == (I2C_HandleTypeDef *)(&hI2cCameraHandler))
00849     {
00850       i2c_handler->Instance = DISCOVERY_CAMERA_I2Cx;
00851     }
00852     else
00853     {
00854       /* External, EEPROM and Arduino connector I2C configuration */
00855       i2c_handler->Instance = DISCOVERY_EXT_I2Cx;
00856     }
00857
00858     i2c_handler->Init.Timing           = DISCOVERY_I2C_TIMING;
00859     i2c_handler->Init.OwnAddress1      = 0x70;
00860     i2c_handler->Init.AddressingMode   = I2C_ADDRESSINGMODE_7BIT;
00861     i2c_handler->Init.DualAddressMode  = I2C_DUALADDRESS_DISABLE;
00862     i2c_handler->Init.OwnAddress2      = 0xFF;
00863     i2c_handler->Init.GeneralCallMode  = I2C_GENERALCALL_DISABLE;
00864     i2c_handler->Init.NoStretchMode    = I2C_NOSTRETCH_DISABLE;
00865
00866
00867     /* Init the I2C */
00868     HAL_I2C_Init(i2c_handler);
00869
00870   }
00871
00872 }
00873
00874 /**
00875   * @brief  Reads multiple data.
00876   * @param  i2c_handler : I2C handler
00877   * @param  Addr: I2C address
00878   * @param  Reg: Reg address
00879   * @param  MemAddress: Memory address
00880   * @param  Buffer: Pointer to data buffer
00881   * @param  Length: Length of the data
00882   * @retval Number of read data
00883   */
00884 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler,
00885                                            uint8_t Addr,
00886                                            uint16_t Reg,
00887                                            uint16_t MemAddress,
00888                                            uint8_t *Buffer,
00889                                            uint16_t Length)
00890 {
00891   HAL_StatusTypeDef status = HAL_OK;
00892
00893   status = HAL_I2C_Mem_Read(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00894
00895   /* Check the communication status */
00896   if (status != HAL_OK)
00897   {
00898     /* I2C error occurred */
00899     I2Cx_Error(i2c_handler, Addr);
00900   }
00901   return status;
00902 }
00903
00904 /**
00905   * @brief  Writes a value in a register of the device through BUS in using DMA mode.
00906   * @param  i2c_handler : I2C handler
00907   * @param  Addr: Device address on BUS Bus.
00908   * @param  Reg: The target register address to write
00909   * @param  MemAddress: Memory address
00910   * @param  Buffer: The target register value to be written
00911   * @param  Length: buffer size to be written
00912   * @retval HAL status
00913   */
00914 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler,
00915                                             uint8_t Addr,
00916                                             uint16_t Reg,
00917                                             uint16_t MemAddress,
00918                                             uint8_t *Buffer,
00919                                             uint16_t Length)
00920 {
00921   HAL_StatusTypeDef status = HAL_OK;
00922
00923   status = HAL_I2C_Mem_Write(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
00924
00925   /* Check the communication status */
00926   if (status != HAL_OK)
00927   {
00928     /* Re-Initialize the I2C Bus */
00929     I2Cx_Error(i2c_handler, Addr);
00930   }
00931   return status;
00932 }
00933
00934 /**
00935   * @brief  Manages error callback by re-initializing I2C.
00936   * @param  i2c_handler : I2C handler
00937   * @param  Addr: I2C Address
00938   * @retval None
00939   */
00940 static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
00941 {
00942   BSP_ErrorHandler();
00943
00944   /* De-initialize the I2C communication bus */
00945   if (i2c_handler == (I2C_HandleTypeDef *)(&hI2cTSHandler))
00946   {
00947     I2C2_DeInit();
00948   }
00949   else
00950   {
00951     HAL_I2C_DeInit(i2c_handler);
00952   }
00953
00954   /* Re-Initialize the I2C communication bus */
00955   I2Cx_Init(i2c_handler);
00956 }
00957 #endif /*HAL_I2C_MODULE_ENABLED*/
00958
00959
00960 /*******************************************************************************
00961                             LINK OPERATIONS
00962 *******************************************************************************/
00963
00964 #if defined(HAL_I2C_MODULE_ENABLED)
00965 /********************************* LINK MFX ***********************************/
00966 /**
00967   * @brief  Initializes MFX low level.
00968   * @retval None
00969   */
00970 void MFX_IO_Init(void)
00971 {
00972   /* I2C2 init */
00973   I2C2_Init();
00974
00975   /* Wait for device ready */
00976   if (I2C2_isDeviceReady(IO1_I2C_ADDRESS, 4) != HAL_OK)
00977   {
00978     BSP_ErrorHandler();
00979   }
00980 }
00981 /**
00982   * @brief  Deinitializes MFX low level.
00983   * @retval None
00984   */
00985 void MFX_IO_DeInit(void)
00986 {
00987   GPIO_InitTypeDef  GPIO_InitStruct;
00988
00989   /* Enable wakeup gpio clock */
00990   MFX_WAKEUP_GPIO_CLK_ENABLE();
00991
00992   /* MFX wakeup pin configuration */
00993   GPIO_InitStruct.Pin   = MFX_WAKEUP_PIN;
00994   GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
00995   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
00996   GPIO_InitStruct.Pull  = GPIO_PULLDOWN;
00997   HAL_GPIO_Init(MFX_WAKEUP_GPIO_PORT, &GPIO_InitStruct);
00998
00999   /* DeInit interrupt pin : disable IRQ before to avoid spurious interrupt */
01000   HAL_NVIC_DisableIRQ((IRQn_Type)(MFX_INT_EXTI_IRQn));
01001   MFX_INT_GPIO_CLK_ENABLE();
01002   HAL_GPIO_DeInit(MFX_INT_GPIO_PORT, MFX_INT_PIN);
01003
01004   /* I2C2 Deinit */
01005   I2C2_DeInit();
01006 }
01007
01008 /**
01009   * @brief  Configures MFX low level interrupt.
01010   * @retval None
01011   */
01012 void MFX_IO_ITConfig(void)
01013 {
01014   GPIO_InitTypeDef  GPIO_InitStruct;
01015
01016   /* Enable the GPIO clock */
01017   MFX_INT_GPIO_CLK_ENABLE();
01018
01019   /* MFX_OUT_IRQ (normally used for EXTI_WKUP) */
01020   GPIO_InitStruct.Pin   = MFX_INT_PIN;
01021   GPIO_InitStruct.Pull  = GPIO_NOPULL;
01022   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
01023   GPIO_InitStruct.Mode  = GPIO_MODE_IT_RISING;
01024   HAL_GPIO_Init(MFX_INT_GPIO_PORT, &GPIO_InitStruct);
01025
01026   /* Enable and set GPIO EXTI Interrupt to the lowest priority */
01027   HAL_NVIC_SetPriority((IRQn_Type)(MFX_INT_EXTI_IRQn), 0x0F, 0x0F);
01028   HAL_NVIC_EnableIRQ((IRQn_Type)(MFX_INT_EXTI_IRQn));
01029 }
01030
01031 /**
01032   * @brief  Configures MFX wke up  pin.
01033   * @retval None
01034   */
01035 void MFX_IO_EnableWakeupPin(void)
01036 {
01037   GPIO_InitTypeDef  GPIO_InitStruct;
01038
01039   /* Enable wakeup gpio clock */
01040   MFX_WAKEUP_GPIO_CLK_ENABLE();
01041
01042   /* MFX wakeup pin configuration */
01043   GPIO_InitStruct.Pin   = MFX_WAKEUP_PIN;
01044   GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
01045   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
01046   GPIO_InitStruct.Pull  = GPIO_NOPULL;
01047   HAL_GPIO_Init(MFX_WAKEUP_GPIO_PORT, &GPIO_InitStruct);
01048 }
01049
01050 /**
01051   * @brief  Wakeup MFX.
01052   * @retval None
01053   */
01054 void MFX_IO_Wakeup(void)
01055 {
01056   /* Set Wakeup pin to high to wakeup Idd measurement component from standby mode */
01057   HAL_GPIO_WritePin(MFX_WAKEUP_GPIO_PORT, MFX_WAKEUP_PIN, GPIO_PIN_SET);
01058
01059   /* Wait */
01060   HAL_Delay(1);
01061
01062   /* Set gpio pin basck to low */
01063   HAL_GPIO_WritePin(MFX_WAKEUP_GPIO_PORT, MFX_WAKEUP_PIN, GPIO_PIN_RESET);
01064 }
01065
01066 /**
01067   * @brief  MFX writes single data.
01068   * @param  Addr: I2C address
01069   * @param  Reg: Register address
01070   * @param  Value: Data to be written
01071   * @retval None
01072   */
01073 void MFX_IO_Write(uint16_t Addr, uint8_t Reg, uint8_t Value)
01074 {
01075   I2C2_WriteData(Addr, Reg, I2C_MEMADD_SIZE_8BIT, Value);
01076 }
01077
01078 /**
01079   * @brief  MFX reads single data.
01080   * @param  Addr: I2C address
01081   * @param  Reg: Register address
01082   * @retval Read data
01083   */
01084 uint8_t MFX_IO_Read(uint16_t Addr, uint8_t Reg)
01085 {
01086   return I2C2_ReadData(Addr, Reg, I2C_MEMADD_SIZE_8BIT);
01087 }
01088
01089 /**
01090   * @brief  MFX reads multiple data.
01091   * @param  Addr: I2C address
01092   * @param  Reg: Register address
01093   * @param  Buffer: Pointer to data buffer
01094   * @param  Length: Length of the data
01095   * @retval Number of read data
01096   */
01097 uint16_t MFX_IO_ReadMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01098 {
01099   return I2C2_ReadBuffer(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01100 }
01101
01102 /**
01103   * @brief  MFX writes multiple data.
01104   * @param  Addr: I2C address
01105   * @param  Reg: Register address
01106   * @param  Buffer: Pointer to data buffer
01107   * @param  Length: Length of the data
01108   * @retval None
01109   */
01110 void MFX_IO_WriteMultiple(uint16_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01111 {
01112   I2C2_WriteBuffer(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01113 }
01114
01115 /**
01116   * @brief  MFX delay
01117   * @param  Delay: Delay in ms
01118   * @retval None
01119   */
01120 void MFX_IO_Delay(uint32_t Delay)
01121 {
01122   HAL_Delay(Delay);
01123 }
01124
01125
01126 /********************************* LINK AUDIO *********************************/
01127 /**
01128   * @brief  Initializes Audio low level.
01129   * @retval None
01130   */
01131 void AUDIO_IO_Init(void)
01132 {
01133   GPIO_InitTypeDef  GPIO_InitStruct;
01134   uint8_t Value;
01135
01136   /* Enable Reset GPIO Clock */
01137   AUDIO_RESET_GPIO_CLK_ENABLE();
01138
01139   /* Audio reset pin configuration */
01140   GPIO_InitStruct.Pin   = AUDIO_RESET_PIN;
01141   GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
01142   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
01143   GPIO_InitStruct.Pull  = GPIO_NOPULL;
01144   HAL_GPIO_Init(AUDIO_RESET_GPIO, &GPIO_InitStruct);
01145
01146   /* I2C bus init */
01147   I2C2_Init();
01148
01149   /* Power off the codec */
01150   CODEC_AUDIO_POWER_OFF();
01151
01152   /* wait until power supplies are stable */
01153   HAL_Delay(10);
01154
01155   /* Power on the codec */
01156   CODEC_AUDIO_POWER_ON();
01157
01158   /* Set the device in standby mode */
01159   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x02);
01160   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x02, (Value | 0x01));
01161
01162   /* Set all power down bits to 1 */
01163   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x02, 0x7F);
01164   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x03);
01165   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x03, (Value | 0x0E));
01166 }
01167
01168 /**
01169   * @brief  Deinitializes Audio low level.
01170   * @retval None
01171   */
01172 void AUDIO_IO_DeInit(void)
01173 {
01174   uint8_t Value;
01175
01176   /* Mute DAC and ADC */
01177   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x08);
01178   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x08, (Value | 0x03));
01179   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x07);
01180   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x07, (Value | 0x03));
01181
01182   /* Disable soft ramp and zero cross */
01183   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x06);
01184   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x06, (Value & 0xF0));
01185
01186   /* Set PDN to 1 */
01187   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x02);
01188   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x02, (Value | 0x01));
01189
01190   /* Set all power down bits to 1 */
01191   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x02, 0x7F);
01192   Value = AUDIO_IO_Read(AUDIO_I2C_ADDRESS, 0x03);
01193   AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x03, (Value | 0x0E));
01194
01195   /* Power off the codec */
01196   CODEC_AUDIO_POWER_OFF();
01197
01198 }
01199
01200 /**
01201   * @brief  Writes a single data.
01202   * @param  Addr: I2C address
01203   * @param  Reg: Reg address
01204   * @param  Value: Data to be written
01205   * @retval None
01206   */
01207 void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
01208 {
01209   I2C2_WriteBuffer(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1);
01210 }
01211
01212 /**
01213   * @brief  Reads a single data.
01214   * @param  Addr: I2C address
01215   * @param  Reg: Reg address
01216   * @retval Data to be read
01217   */
01218 uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
01219 {
01220   uint8_t Read_Value = 0;
01221
01222   I2C2_ReadBuffer((uint16_t) Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, &Read_Value, 1);
01223
01224   return Read_Value;
01225 }
01226
01227 /**
01228   * @brief  AUDIO Codec delay
01229   * @param  Delay: Delay in ms
01230   * @retval None
01231   */
01232 void AUDIO_IO_Delay(uint32_t Delay)
01233 {
01234   HAL_Delay(Delay);
01235 }
01236
01237
01238
01239
01240 /*************************** FMC Routines ************************************/
01241 /**
01242   * @brief  Initializes FMC_BANK1_LCD_IO MSP.
01243   * @param  None
01244   * @retval None
01245   */
01246 void FMC_BANK1_MspInit(void)
01247 {
01248
01249   GPIO_InitTypeDef GPIO_Init_Structure;
01250
01251   /* Enable FMC clock */
01252   __HAL_RCC_FMC_CLK_ENABLE();
01253
01254   /* Enable GPIOs clock */
01255   __HAL_RCC_GPIOD_CLK_ENABLE();
01256   __HAL_RCC_GPIOE_CLK_ENABLE();
01257   __HAL_RCC_GPIOF_CLK_ENABLE();
01258   __HAL_RCC_GPIOG_CLK_ENABLE();
01259   __HAL_RCC_PWR_CLK_ENABLE();
01260   HAL_PWREx_EnableVddIO2();
01261
01262   GPIO_Init_Structure.Mode      = GPIO_MODE_AF_PP;
01263   GPIO_Init_Structure.Pull      = GPIO_PULLUP;
01264   GPIO_Init_Structure.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01265   GPIO_Init_Structure.Alternate = GPIO_AF12_FMC;
01266   /* GPIOD configuration */ /* GPIO_PIN_7 is  FMC_NE1 */
01267   GPIO_Init_Structure.Pin   = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | \
01268                               GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15 | GPIO_PIN_7;
01269
01270   HAL_GPIO_Init(GPIOD, &GPIO_Init_Structure);
01271
01272
01273
01274
01275   /* GPIOE configuration */
01276   GPIO_Init_Structure.Pin   = GPIO_PIN_7     | \
01277                               GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | \
01278                               GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
01279   HAL_GPIO_Init(GPIOE, &GPIO_Init_Structure);
01280
01281   /* GPIOD configuration */
01282   GPIO_Init_Structure.Pin   = GPIO_PIN_13 ;
01283   HAL_GPIO_Init(GPIOD, &GPIO_Init_Structure);
01284
01285 }
01286
01287
01288 /**
01289   * @brief  Initializes LCD IO.
01290   * @param  None
01291   * @retval None
01292   */
01293 void FMC_BANK1_Init(void)
01294 {
01295   SRAM_HandleTypeDef hsram;
01296   FMC_NORSRAM_TimingTypeDef sram_timing;
01297   FMC_NORSRAM_TimingTypeDef sram_timing_write;
01298
01299   /*** Configure the SRAM Bank 1 ***/
01300   /* Configure IPs */
01301   hsram.Instance  = FMC_NORSRAM_DEVICE;
01302   hsram.Extended  = FMC_NORSRAM_EXTENDED_DEVICE;
01303
01304
01305   /* Timing for READING */
01306
01307   sram_timing.AddressSetupTime       = 1;
01308   sram_timing.AddressHoldTime        = 1;
01309   sram_timing.DataSetupTime          = 1;
01310   sram_timing.BusTurnAroundDuration  = 0;
01311   sram_timing.CLKDivision            = 2;
01312   sram_timing.DataLatency            = 2;
01313   sram_timing.AccessMode             = FMC_ACCESS_MODE_A;
01314   /* Timing for WRITING */
01315   sram_timing_write.AddressSetupTime      = 5;
01316   sram_timing_write.AddressHoldTime       = 1;
01317   sram_timing_write.DataSetupTime         = 3;
01318   sram_timing_write.BusTurnAroundDuration = 2;
01319   sram_timing_write.CLKDivision           = 2;
01320   sram_timing_write.DataLatency           = 2;
01321   sram_timing_write.AccessMode            = FMC_ACCESS_MODE_A;
01322
01323
01324   hsram.Init.NSBank             = FMC_NORSRAM_BANK1;
01325   hsram.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
01326   hsram.Init.MemoryType         = FMC_MEMORY_TYPE_SRAM;
01327   hsram.Init.MemoryDataWidth    = FMC_NORSRAM_MEM_BUS_WIDTH_16;
01328   hsram.Init.BurstAccessMode    = FMC_BURST_ACCESS_MODE_DISABLE;
01329   hsram.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
01330   hsram.Init.WaitSignalActive   = FMC_WAIT_TIMING_BEFORE_WS;
01331   hsram.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
01332   hsram.Init.WaitSignal         = FMC_WAIT_SIGNAL_DISABLE;
01333   hsram.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
01334   hsram.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_DISABLE;
01335   hsram.Init.WriteBurst         = FMC_WRITE_BURST_DISABLE;
01336   hsram.Init.PageSize           = FMC_PAGE_SIZE_NONE;
01337   hsram.Init.WriteFifo          = FMC_WRITE_FIFO_DISABLE;
01338   hsram.Init.ContinuousClock    = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
01339   /* Initialize the SRAM controller */
01340   FMC_BANK1_MspInit();
01341   HAL_SRAM_Init(&hsram, &sram_timing, &sram_timing_write);
01342
01343 }
01344
01345
01346 /**
01347   * @brief  DeInitializes FMC_BANK1_LCD_IO MSP.
01348   * @param  None
01349   * @retval None
01350   */
01351 void FMC_BANK1_MspDeInit(void)
01352 {
01353
01354   /* Enable FMC clock */
01355   __HAL_RCC_FMC_CLK_ENABLE();
01356
01357   /* Enable GPIOs clock */
01358   __HAL_RCC_GPIOD_CLK_ENABLE();
01359   __HAL_RCC_GPIOE_CLK_ENABLE();
01360   __HAL_RCC_GPIOF_CLK_ENABLE();
01361   __HAL_RCC_GPIOG_CLK_ENABLE();
01362   __HAL_RCC_PWR_CLK_ENABLE();
01363
01364
01365   HAL_GPIO_DeInit(GPIOD, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | \
01366                   GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15 | GPIO_PIN_7 | GPIO_PIN_13);
01367
01368
01369
01370   HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7 | \
01371                   GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | \
01372                   GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);
01373
01374 }
01375
01376
01377 /**
01378   * @brief  Writes register value.
01379   * @param  Data: Data to be written
01380   * @retval None
01381   */
01382 static void FMC_BANK1_WriteData(uint16_t Data)
01383 {
01384   /* Write 16-bit Reg */
01385   LCD_ADDR->REG = Data;
01386 }
01387
01388 /**
01389   * @brief  Writes register address.
01390   * @param  Reg: Register to be written
01391   * @retval None
01392   */
01393 static void FMC_BANK1_WriteReg(uint8_t Reg)
01394 {
01395   /* Write 16-bit Index, then write register */
01396   FMC_BANK1_ADDR->REG = Reg;
01397 }
01398
01399 /**
01400   * @brief  Reads register value.
01401   * @param  None
01402   * @retval Read value
01403   */
01404 static uint16_t FMC_BANK1_ReadData(void)
01405 {
01406   return LCD_ADDR->REG;
01407 }
01408
01409 /*******************************************************************************
01410                             LINK OPERATIONS
01411 *******************************************************************************/
01412
01413 /********************************* LINK LCD ***********************************/
01414
01415 /**
01416   * @brief  Initializes LCD low level.
01417   * @param  None
01418   * @retval None
01419   */
01420 void LCD_IO_Init(void)
01421 {
01422   FMC_BANK1_Init();
01423 }
01424
01425 /**
01426   * @brief  Writes data on LCD data register.
01427   * @param  Data: Data to be written
01428   * @retval None
01429   */
01430 void LCD_IO_WriteData(uint16_t RegValue)
01431 {
01432   /* Write 16-bit Reg */
01433   FMC_BANK1_WriteData(RegValue);
01434 }
01435
01436 /**
01437   * @brief  Writes several data on LCD data register.
01438   * @param  Data: pointer on data to be written
01439   * @param  Size: data amount in 16bits short unit
01440   * @retval None
01441   */
01442 void LCD_IO_WriteMultipleData(uint16_t *pData, uint32_t Size)
01443 {
01444   uint32_t  i;
01445
01446   for (i = 0; i < Size; i++)
01447   {
01448     FMC_BANK1_WriteData(pData[i]);
01449   }
01450 }
01451
01452 /**
01453   * @brief  Writes register on LCD register.
01454   * @param  Reg: Register to be written
01455   * @retval None
01456   */
01457 void LCD_IO_WriteReg(uint8_t Reg)
01458 {
01459   /* Write 16-bit Index, then Write Reg */
01460   FMC_BANK1_WriteReg(Reg);
01461 }
01462
01463 /**
01464   * @brief  Reads data from LCD data register.
01465   * @param  None
01466   * @retval Read data.
01467   */
01468 uint16_t LCD_IO_ReadData(void)
01469 {
01470   return FMC_BANK1_ReadData();
01471 }
01472
01473 /**
01474   * @brief  LCD delay
01475   * @param  Delay: Delay in ms
01476   * @retval None
01477   */
01478 void LCD_IO_Delay(uint32_t Delay)
01479 {
01480   HAL_Delay(Delay);
01481 }
01482
01483
01484 /************************** LINK TS (TouchScreen) *****************************/
01485 /**
01486   * @brief  Initializes Touchscreen low level.
01487   * @retval None
01488   */
01489 void TS_IO_Init(void)
01490 {
01491   I2Cx_Init(&hI2cTSHandler);
01492
01493   if (ts_io_init == 0)
01494   {
01495     if (BSP_LCD_Init() == LCD_ERROR)
01496     {
01497       BSP_ErrorHandler();
01498     }
01499
01500     BSP_IO_ConfigPin(TS_RST_PIN, IO_MODE_OUTPUT);
01501
01502     BSP_IO_WritePin(TS_RST_PIN, GPIO_PIN_RESET);
01503     HAL_Delay(10);
01504     BSP_IO_WritePin(TS_RST_PIN, GPIO_PIN_SET);
01505     HAL_Delay(200);
01506
01507     ts_io_init = 1;
01508   }
01509 }
01510
01511 /**
01512   * @brief  Writes a single data.
01513   * @param  Addr: I2C address
01514   * @param  Reg: Reg address
01515   * @param  Value: Data to be written
01516   * @retval None
01517   */
01518 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
01519 {
01520   I2Cx_WriteMultiple(&hI2cTSHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t *)&Value, 1);
01521 }
01522
01523 /**
01524   * @brief  Reads a single data.
01525   * @param  Addr: I2C address
01526   * @param  Reg: Reg address
01527   * @retval Data to be read
01528   */
01529 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
01530 {
01531   return I2C2_ReadData(Addr, Reg, I2C_MEMADD_SIZE_8BIT);
01532 }
01533
01534 /**
01535   * @brief  Reads multiple data with I2C communication
01536   *         channel from TouchScreen.
01537   * @param  Addr: I2C address
01538   * @param  Reg: Register address
01539   * @param  Buffer: Pointer to data buffer
01540   * @param  Length: Length of the data
01541   * @retval Number of read data
01542   */
01543 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01544 {
01545   return I2Cx_ReadMultiple(&hI2cTSHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01546 }
01547
01548 /**
01549   * @brief  Writes multiple data with I2C communication
01550   *         channel from MCU to TouchScreen.
01551   * @param  Addr: I2C address
01552   * @param  Reg: Register address
01553   * @param  Buffer: Pointer to data buffer
01554   * @param  Length: Length of the data
01555   * @retval None
01556   */
01557 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
01558 {
01559   I2Cx_WriteMultiple(&hI2cTSHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
01560 }
01561
01562 /**
01563   * @brief  Delay function used in TouchScreen low level driver.
01564   * @param  Delay: Delay in ms
01565   * @retval None
01566   */
01567 void TS_IO_Delay(uint32_t Delay)
01568 {
01569   HAL_Delay(Delay);
01570 }
01571
01572
01573 /************************** Camera  *****************************/
01574 /**
01575   * @brief  Initializes Camera low level.
01576   * @retval None
01577   */
01578 void CAMERA_IO_Init(void)
01579 {
01580   I2Cx_Init(&hI2cCameraHandler);
01581 }
01582
01583 /**
01584   * @brief  Camera writes single data.
01585   * @param  Addr: I2C address
01586   * @param  Reg: Register address
01587   * @param  Value: Data to be written
01588   * @retval None
01589   */
01590 void CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
01591 {
01592   I2Cx_WriteMultiple(&hI2cCameraHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t *)&Value, 1);
01593 }
01594
01595 /**
01596   * @brief  Camera reads single data.
01597   * @param  Addr: I2C address
01598   * @param  Reg: Register address
01599   * @retval Read data
01600   */
01601 uint8_t CAMERA_IO_Read(uint8_t Addr, uint8_t Reg)
01602 {
01603   uint8_t read_value = 0;
01604
01605   I2Cx_ReadMultiple(&hI2cCameraHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t *)&read_value, 1);
01606
01607   return read_value;
01608 }
01609
01610 /**
01611   * @brief  Camera delay
01612   * @param  Delay: Delay in ms
01613   * @retval None
01614   */
01615 void CAMERA_Delay(uint32_t Delay)
01616 {
01617   HAL_Delay(Delay);
01618 }
01619
01620 #endif /* HAL_I2C_MODULE_ENABLED */
01621
01622
01623 __weak uint8_t BSP_LCD_Init(void)
01624 {
01625   uint8_t ret = 0;
01626   return ret;
01627 }
01628
01629 /**
01630   * @}
01631   */
01632
01633 /**
01634   * @}
01635   */
01636
01637 /**
01638   * @}
01639   */
01640
01641 /**
01642   * @}
01643   */
01644
01645 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32L496G_DISCOVERY's LEDs,
00006   *          push-buttons hardware resources (MB1261).
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_H
00023 #define __STM32L496G_DISCOVERY_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /**
00030   * @brief  Define for STM32L496G_DISCOVERY board
00031   */
00032
00033
00034
00035 /* Includes ------------------------------------------------------------------*/
00036 #include "stm32l4xx_hal.h"
00037
00038 /** @addtogroup BSP
00039   * @{
00040   */
00041
00042 /** @addtogroup STM32L496G_DISCOVERY
00043   * @{
00044   */
00045
00046 /** @addtogroup STM32L496G_DISCOVERY_Common
00047   * @{
00048   */
00049
00050 /** @defgroup STM32L496G_DISCOVERY_Exported_Types Exported Types
00051   * @{
00052   */
00053
00054 /**
00055  * @brief LED Types Definition
00056  */
00057 typedef enum
00058 {
00059   LED1 = 0,
00060   LED2 = 1,
00061   LED_ORANGE = LED1,
00062   LED_GREEN  = LED2
00063 }
00064 Led_TypeDef;
00065
00066
00067 /**
00068  * @brief JOYSTICK Types Definition
00069  */
00070 typedef enum
00071 {
00072   JOY_SEL   = 0,
00073   JOY_LEFT  = 1,
00074   JOY_RIGHT = 2,
00075   JOY_DOWN  = 3,
00076   JOY_UP    = 4,
00077   JOY_NONE  = 5
00078 } JOYState_TypeDef;
00079
00080 typedef enum
00081 {
00082   JOY_MODE_GPIO = 0,
00083   JOY_MODE_EXTI = 1
00084 } JOYMode_TypeDef;
00085
00086 typedef enum
00087 {
00088   COM1 = 0
00089 } COM_TypeDef;
00090
00091 /**
00092  * @brief LCD constroller Types Definition
00093  */
00094 typedef struct
00095 {
00096   __IO uint16_t REG;
00097   __IO uint16_t RAM;
00098 } LCD_CONTROLLER_TypeDef;
00099
00100 /**
00101   * @}
00102   */
00103
00104 /** @defgroup STM32L496G_DISCOVERY_Exported_Constants Exported Constants
00105   * @{
00106   */
00107
00108 /** @defgroup STM32L496G_DISCOVERY_FMC FMC LCD Constants
00109   * @{
00110   */
00111 /* We use BANK1 as we use FMC_NE1 signal */
00112 #define FMC_BANK1_BASE  ((uint32_t)(0x60000000 | 0x00000000))
00113 #define FMC_LCD_BASE    ((uint32_t)(0x60000000 | 0x00080000))  /*using A18*/
00114 #define FMC_BANK1_ADDR  ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)
00115 #define LCD_ADDR        ((LCD_CONTROLLER_TypeDef *) FMC_LCD_BASE)
00116
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32L496G_DISCOVERY_LED LED Constants
00122   * @{
00123   */
00124 /* To do: invert LED1 and LED2 */
00125 #define LEDn                              2
00126
00127 /* LED1 is accessed thru the MFX */
00128 #define LED1_PIN                          IO1_PIN_4
00129
00130 #define LED2_PIN                          GPIO_PIN_13
00131 #define LED2_GPIO_PORT                    GPIOB
00132 #define LED2_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOB_CLK_ENABLE()
00133 #define LED2_GPIO_CLK_DISABLE()           __HAL_RCC_GPIOB_CLK_DISABLE()
00134
00135
00136 /**
00137   * @}
00138   */
00139
00140 /** @defgroup STM32L496G_DISCOVERY_BUTTON  BUTTON Constants
00141   * @{
00142   */
00143 #define JOYn                              5
00144
00145 /**
00146 * @brief Joystick Right push-button
00147 */
00148 #define RIGHT_JOY_PIN                     GPIO_PIN_11  /* PF.11 */
00149 #define RIGHT_JOY_GPIO_PORT               GPIOF
00150 #define RIGHT_JOY_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOF_CLK_ENABLE()
00151 #define RIGHT_JOY_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOF_CLK_DISABLE()
00152 #define RIGHT_JOY_EXTI_IRQn               EXTI15_10_IRQn
00153
00154 /**
00155 * @brief Joystick Left push-button
00156 */
00157 #define LEFT_JOY_PIN                      GPIO_PIN_9  /* PI.09 */
00158 #define LEFT_JOY_GPIO_PORT                GPIOI
00159 #define LEFT_JOY_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOI_CLK_ENABLE()
00160 #define LEFT_JOY_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOI_CLK_DISABLE()
00161 #define LEFT_JOY_EXTI_IRQn                EXTI9_5_IRQn
00162
00163 /**
00164 * @brief Joystick Up push-button
00165 */
00166 #define UP_JOY_PIN                        GPIO_PIN_8  /* PI.08 */
00167 #define UP_JOY_GPIO_PORT                  GPIOI
00168 #define UP_JOY_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOI_CLK_ENABLE()
00169 #define UP_JOY_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOI_CLK_DISABLE()
00170 #define UP_JOY_EXTI_IRQn                  EXTI9_5_IRQn
00171
00172 /**
00173  * @brief Joystick Down push-button
00174  */
00175 #define DOWN_JOY_PIN                      GPIO_PIN_10   /* PI.10 */
00176 #define DOWN_JOY_GPIO_PORT                GPIOI
00177 #define DOWN_JOY_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOI_CLK_ENABLE()
00178 #define DOWN_JOY_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOI_CLK_DISABLE()
00179 #define DOWN_JOY_EXTI_IRQn                EXTI15_10_IRQn
00180
00181 /**
00182  * @brief Joystick Sel push-button
00183  */
00184 #define SEL_JOY_PIN                       GPIO_PIN_13   /* PC.13 */
00185 #define SEL_JOY_GPIO_PORT                 GPIOC
00186 #define SEL_JOY_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00187 #define SEL_JOY_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00188 #define SEL_JOY_EXTI_IRQn                 EXTI15_10_IRQn
00189
00190 #define JOYx_GPIO_CLK_ENABLE(__JOY__)     do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_ENABLE();   } else \
00191                                                if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_ENABLE();  } else \
00192                                                if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_ENABLE();  } else \
00193                                                if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_ENABLE(); } else \
00194                                                if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_ENABLE(); }  } while(0)
00195
00196 #define JOYx_GPIO_CLK_DISABLE(__JOY__)    do { if((__JOY__) == JOY_SEL)   { SEL_JOY_GPIO_CLK_DISABLE();   } else \
00197                                                if((__JOY__) == JOY_DOWN)  { DOWN_JOY_GPIO_CLK_DISABLE();  } else \
00198                                                if((__JOY__) == JOY_LEFT)  { LEFT_JOY_GPIO_CLK_DISABLE();  } else \
00199                                                if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_DISABLE(); } else \
00200                                                if((__JOY__) == JOY_UP)    { UP_JOY_GPIO_CLK_DISABLE(); }  } while(0)
00201
00202 #define JOY_ALL_PINS                      (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
00203
00204 /**
00205   * @}
00206   */
00207
00208 /** @defgroup STM32L4R9I_DISCOVERY_COM COM Constants
00209   * @{
00210   */
00211 #define COMn                                    1
00212
00213 /**
00214  * @brief Definition for COM port1, connected to USART2 (ST-Link USB Virtual Com Port)
00215  */
00216 #define DISCOVERY_COM1                          USART2
00217 #define DISCOVERY_COM1_CLK_ENABLE()             __HAL_RCC_USART2_CLK_ENABLE()
00218 #define DISCOVERY_COM1_CLK_DISABLE()            __HAL_RCC_USART2_CLK_DISABLE()
00219
00220 #define DISCOVERY_COM1_TX_PIN                   GPIO_PIN_2
00221 #define DISCOVERY_COM1_TX_GPIO_PORT             GPIOA
00222 #define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00223 #define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00224 #define DISCOVERY_COM1_TX_AF                    GPIO_AF7_USART2
00225
00226 #define DISCOVERY_COM1_RX_PIN                   GPIO_PIN_6
00227 #define DISCOVERY_COM1_RX_GPIO_PORT             GPIOD
00228 #define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOD_CLK_ENABLE()
00229 #define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOD_CLK_DISABLE()
00230 #define DISCOVERY_COM1_RX_AF                    GPIO_AF7_USART2
00231
00232 #define DISCOVERY_COM1_IRQn                     USART2_IRQn
00233
00234
00235 #define DISCOVERY_COMx_CLK_ENABLE(__INDEX__)            do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_ENABLE();}} while(0)
00236 #define DISCOVERY_COMx_CLK_DISABLE(__INDEX__)           do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_DISABLE();}} while(0)
00237
00238 #define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_ENABLE();}} while(0)
00239 #define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__)   do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_DISABLE();}} while(0)
00240
00241 #define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__)    do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_ENABLE();}} while(0)
00242 #define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__)   do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_DISABLE();}} while(0)
00243
00244 /**
00245   * @}
00246   */
00247
00248 /** @defgroup STM32L496G_DISCOVERY_BUS  BUS Constants
00249   * @{
00250   */
00251
00252 #if defined(HAL_I2C_MODULE_ENABLED)
00253 /*##################### I2C1 ###################################*/
00254 /* User can use this section to tailor I2C1 instance used and associated
00255    resources */
00256 /* Definition for I2C1 Pins */
00257 #define DISCOVERY_I2C1_SCL_GPIO_PORT            GPIOG
00258 #define DISCOVERY_I2C1_SDA_GPIO_PORT            GPIOG
00259 #define DISCOVERY_I2C1_SCL_PIN                  GPIO_PIN_14
00260 #define DISCOVERY_I2C1_SDA_PIN                  GPIO_PIN_13
00261
00262 #define DISCOVERY_I2C1_SCL_SDA_AF               GPIO_AF4_I2C1
00263
00264 /* Definition for I2C1 clock resources */
00265 #define DISCOVERY_I2C1                          I2C1
00266 #define DISCOVERY_I2C1_CLK_ENABLE()             __HAL_RCC_I2C1_CLK_ENABLE()
00267 #define DISCOVERY_I2C1_CLK_DISABLE()            __HAL_RCC_I2C1_CLK_DISABLE()
00268 #define DISCOVERY_I2C1_SDA_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOG_CLK_ENABLE()
00269 #define DISCOVERY_I2C1_SCL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOG_CLK_ENABLE()
00270 #define DISCOVERY_I2C1_SDA_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
00271 #define DISCOVERY_I2C1_SCL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
00272 #define DISCOVERY_I2C1_FORCE_RESET()            __HAL_RCC_I2C1_FORCE_RESET()
00273 #define DISCOVERY_I2C1_RELEASE_RESET()          __HAL_RCC_I2C1_RELEASE_RESET()
00274
00275 /* Definition for I2C1's NVIC */
00276 #define DISCOVERY_I2C1_EV_IRQn                  I2C1_EV_IRQn
00277 #define DISCOVERY_I2C1_EV_IRQHandler            I2C1_EV_IRQHandler
00278 #define DISCOVERY_I2C1_ER_IRQn                  I2C1_ER_IRQn
00279 #define DISCOVERY_I2C1_ER_IRQHandler            I2C1_ER_IRQHandler
00280
00281 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00282 /* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 80 MHz */
00283 /* Set 0x90112626 value to reach 100 KHz speed (Rise time = 640ns, Fall time = 20ns) */
00284 #ifndef DISCOVERY_I2C1_TIMING
00285 #define DISCOVERY_I2C1_TIMING                  0x90D00e28/* 0x90112626*/
00286 #endif /* DISCOVERY_I2C1_TIMING */
00287
00288 /* I2C clock speed configuration (in Hz)
00289    WARNING:
00290    Make sure that this define is not already declared in other files (ie.
00291    stm324xg_discovery.h file). It can be used in parallel by other modules. */
00292 #ifndef BSP_I2C_SPEED
00293 #define BSP_I2C_SPEED                              100000
00294 #endif /* BSP_I2C_SPEED */
00295
00296 /* Maximum Timeout values for flags waiting loops. These timeouts are not based
00297    on accurate values, they just guarantee that the application will not remain
00298    stuck if the I2C communication is corrupted.
00299    You may modify these timeout values depending on CPU frequency and application
00300    conditions (interrupts routines ...). */
00301 #define DISCOVERY_I2C1_TIMEOUT_MAX              3000
00302
00303
00304 /*##################### I2C2 ###################################*/
00305 /* User can use this section to tailor I2C2 instance used and associated
00306    resources */
00307 /* Definition for I2C2 Pins */
00308 #define DISCOVERY_I2C2_SCL_PIN                  GPIO_PIN_4
00309 #define DISCOVERY_I2C2_SCL_GPIO_PORT            GPIOH
00310 #define DISCOVERY_I2C2_SDA_PIN                  GPIO_PIN_14
00311 #define DISCOVERY_I2C2_SDA_GPIO_PORT            GPIOB
00312 #define DISCOVERY_I2C2_SCL_SDA_AF               GPIO_AF4_I2C2
00313 /* Definition for I2C2 clock resources */
00314 #define DISCOVERY_I2C2                          I2C2
00315 #define DISCOVERY_I2C2_CLK_ENABLE()             __HAL_RCC_I2C2_CLK_ENABLE()
00316 #define DISCOVERY_I2C2_CLK_DISABLE()            __HAL_RCC_I2C2_CLK_DISABLE()
00317 #define DISCOVERY_I2C2_SDA_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOB_CLK_ENABLE()
00318 #define DISCOVERY_I2C2_SCL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOH_CLK_ENABLE()
00319 #define DISCOVERY_I2C2_SDA_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
00320 #define DISCOVERY_I2C2_SCL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
00321 #define DISCOVERY_I2C2_FORCE_RESET()            __HAL_RCC_I2C2_FORCE_RESET()
00322 #define DISCOVERY_I2C2_RELEASE_RESET()          __HAL_RCC_I2C2_RELEASE_RESET()
00323
00324 /* Definition for I2C2's NVIC */
00325 #define DISCOVERY_I2C2_EV_IRQn                  I2C2_EV_IRQn
00326 #define DISCOVERY_I2C2_ER_IRQn                  I2C2_ER_IRQn
00327
00328 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00329 /* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 80 MHz */
00330 /* Set 0x90112626 value to reach 100 KHz speed (Rise time = 25ns, Fall time = 10ns) */
00331 #ifndef DISCOVERY_I2C2_TIMING
00332 #define DISCOVERY_I2C2_TIMING         0x40403E5D
00333 #endif /* DISCOVERY_I2C2_TIMING */
00334
00335 #define IDD_I2C_ADDRESS                  ((uint16_t) 0x84)
00336 #define IO1_I2C_ADDRESS                  ((uint16_t) 0x84)
00337 #define AUDIO_I2C_ADDRESS                ((uint16_t) 0x94)
00338 #define TS_I2C_ADDRESS                   ((uint16_t) 0x70)
00339 #define CAMERA_I2C_ADDRESS               ((uint16_t) 0x60)
00340
00341 /* Maximum Timeout values for flags waiting loops. These timeouts are not based
00342    on accurate values, they just guarantee that the application will not remain
00343    stuck if the I2C communication is corrupted.
00344    You may modify these timeout values depending on CPU frequency and application
00345    conditions (interrupts routines ...). */
00346 #define DISCOVERY_I2C2_TIMEOUT_MAX              3000
00347
00348
00349 #ifndef DISCOVERY_I2C_TIMING
00350 #define DISCOVERY_I2C_TIMING                 /*0x90D00e28*/ 0x90112626
00351 #endif /* DISCOVERY_I2C2_TIMING */
00352
00353 /* Written here after to enable compilation only, to be thoroughly reviewed */
00354
00355 /* Definition for AUDIO I2Cx resources */
00356 #define DISCOVERY_AUDIO_I2Cx                             I2C1
00357 #define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C1_CLK_ENABLE()
00358 #define DISCOVERY_AUDIO_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00359 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
00360
00361 #define DISCOVERY_AUDIO_I2Cx_FORCE_RESET()               __HAL_RCC_I2C1_FORCE_RESET()
00362 #define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C1_RELEASE_RESET()
00363
00364 /* Definition for I2Cx Pins */
00365 #define DISCOVERY_AUDIO_I2Cx_SCL_PIN                     GPIO_PIN_6
00366 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT           GPIOB
00367 #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C1
00368 #define DISCOVERY_AUDIO_I2Cx_SDA_PIN                     GPIO_PIN_7
00369
00370 /* I2C interrupt requests */
00371 #define DISCOVERY_AUDIO_I2Cx_EV_IRQn                     I2C1_EV_IRQn
00372 #define DISCOVERY_AUDIO_I2Cx_ER_IRQn                     I2C1_ER_IRQn
00373
00374
00375 /* Definition for TS (Capacitive Touch Panel) I2Cx resources */
00376 #define DISCOVERY_TS_I2Cx                             I2C2
00377 #define DISCOVERY_TS_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C2_CLK_ENABLE()
00378 #define DISCOVERY_TS_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00379 #define DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOB_CLK_ENABLE()
00380 #define DISCOVERY_TS_I2Cx_SDA_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOB_CLK_DISABLE()
00381 #define DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOH_CLK_ENABLE()
00382 #define DISCOVERY_TS_I2Cx_SCL_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOH_CLK_DISABLE()
00383
00384 #define DISCOVERY_TS_I2Cx_FORCE_RESET()               __HAL_RCC_I2C2_FORCE_RESET()
00385 #define DISCOVERY_TS_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C2_RELEASE_RESET()
00386
00387 /* Definition for I2Cx Pins */
00388 #define DISCOVERY_TS_I2Cx_SCL_PIN                     GPIO_PIN_4
00389 #define DISCOVERY_TS_I2Cx_SCL_GPIO_PORT               GPIOH
00390 #define DISCOVERY_TS_I2Cx_SDA_PIN                     GPIO_PIN_14
00391 #define DISCOVERY_TS_I2Cx_SDA_GPIO_PORT               GPIOB
00392 #define DISCOVERY_TS_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C2
00393
00394 /* I2C interrupt requests */
00395 #define DISCOVERY_TS_I2Cx_EV_IRQn                     I2C2_EV_IRQn
00396 #define DISCOVERY_TS_I2Cx_ER_IRQn                     I2C2_ER_IRQn
00397
00398 /* I2C clock setting */
00399 #define DISCOVERY_TS_RCC_PERIPHCLK_I2C               RCC_PERIPHCLK_I2C2
00400 #define DISCOVERY_TS_RCC_CLKSOURCE_I2C               RCC_I2C2CLKSOURCE_SYSCLK
00401
00402
00403
00404 /* Definition for Camera I2Cx resources */
00405 #define DISCOVERY_CAMERA_I2Cx                             I2C2
00406 #define DISCOVERY_CAMERA_I2Cx_CLK_ENABLE()                __HAL_RCC_I2C2_CLK_ENABLE()
00407 #define DISCOVERY_CAMERA_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00408 #define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOB_CLK_ENABLE()
00409 #define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOB_CLK_DISABLE()
00410 #define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOH_CLK_ENABLE()
00411 #define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOH_CLK_DISABLE()
00412
00413 #define DISCOVERY_CAMERA_I2Cx_FORCE_RESET()               __HAL_RCC_I2C2_FORCE_RESET()
00414 #define DISCOVERY_CAMERA_I2Cx_RELEASE_RESET()             __HAL_RCC_I2C2_RELEASE_RESET()
00415
00416 /* Definition for I2Cx Pins */
00417 #define DISCOVERY_CAMERA_I2Cx_SCL_PIN                     GPIO_PIN_4
00418 #define DISCOVERY_CAMERA_I2Cx_SCL_GPIO_PORT               GPIOH
00419 #define DISCOVERY_CAMERA_I2Cx_SDA_PIN                     GPIO_PIN_14
00420 #define DISCOVERY_CAMERA_I2Cx_SDA_GPIO_PORT               GPIOB
00421 #define DISCOVERY_CAMERA_I2Cx_SCL_SDA_AF                  GPIO_AF4_I2C2
00422
00423 /* I2C interrupt requests */
00424 #define DISCOVERY_CAMERA_I2Cx_EV_IRQn                     I2C2_EV_IRQn
00425 #define DISCOVERY_CAMERA_I2Cx_ER_IRQn                     I2C2_ER_IRQn
00426
00427 /* I2C clock setting */
00428 #define DISCOVERY_CAMERA_RCC_PERIPHCLK_I2C               RCC_PERIPHCLK_I2C2
00429 #define DISCOVERY_CAMERA_RCC_CLKSOURCE_I2C               RCC_I2C2CLKSOURCE_SYSCLK
00430
00431
00432
00433
00434
00435 /* Definition for external, camera and Arduino connector I2Cx resources */  /* to be reviewed */
00436 #define DISCOVERY_EXT_I2Cx                               I2C2
00437 #define DISCOVERY_EXT_I2Cx_CLK_ENABLE()                  __HAL_RCC_I2C2_CLK_ENABLE()
00438 #define DISCOVERY_EXT_DMAx_CLK_ENABLE()                  __HAL_RCC_DMA1_CLK_ENABLE()
00439 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00440
00441 #define DISCOVERY_EXT_I2Cx_FORCE_RESET()                 __HAL_RCC_I2C2_FORCE_RESET()
00442 #define DISCOVERY_EXT_I2Cx_RELEASE_RESET()               __HAL_RCC_I2C2_RELEASE_RESET()
00443
00444 /* Definition for I2Cx Pins */
00445 #define DISCOVERY_EXT_I2Cx_SCL_PIN                       GPIO_PIN_10
00446 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT             GPIOB
00447 #define DISCOVERY_EXT_I2Cx_SCL_AF                        GPIO_AF4_I2C2
00448 #define DISCOVERY_EXT_I2Cx_SDA_AF                        GPIO_AF4_I2C2
00449 #define DISCOVERY_EXT_I2Cx_SDA_PIN                       GPIO_PIN_9
00450
00451 /* I2C interrupt requests */
00452 #define DISCOVERY_EXT_I2Cx_EV_IRQn                       I2C2_EV_IRQn
00453 #define DISCOVERY_EXT_I2Cx_ER_IRQn                       I2C2_ER_IRQn
00454
00455 #ifndef DISCOVERY_I2C_SPEED
00456 #define DISCOVERY_I2C_SPEED                             100000
00457 #endif /* DISCOVERY_I2C_SPEED */
00458
00459
00460 #endif /* HAL_I2C_MODULE_ENABLED */
00461
00462
00463
00464 /*##################### Audio Codec ##########################*/
00465 /**
00466   * @brief  Audio codec chip reset definition
00467   */
00468 /* Audio codec power on/off macro definition */
00469 #define CODEC_AUDIO_POWER_OFF()      HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_RESET)
00470 #define CODEC_AUDIO_POWER_ON()       HAL_GPIO_WritePin(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, GPIO_PIN_SET)
00471
00472 /* Audio Reset Pin definition */
00473 #define AUDIO_RESET_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOC_CLK_ENABLE()
00474 #define AUDIO_RESET_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOC_CLK_DISABLE()
00475 #define AUDIO_RESET_PIN                         GPIO_PIN_6
00476 #define AUDIO_RESET_GPIO                        GPIOC
00477
00478
00479
00480
00481 /*##################### MFX ##########################*/
00482 /**
00483   * @brief  MFX interface pins
00484   */
00485
00486 #define MFX_INT_GPIO_PORT                 GPIOC                       /* GPIOC */
00487 #define MFX_INT_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00488 #define MFX_INT_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00489 #define MFX_INT_PIN                       GPIO_PIN_5                  /* PC.05 */
00490 #define MFX_INT_EXTI_IRQn                 EXTI9_5_IRQn
00491
00492 #define MFX_WAKEUP_GPIO_PORT              GPIOH                       /* GPIOH */
00493 #define MFX_WAKEUP_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOH_CLK_ENABLE()
00494 #define MFX_WAKEUP_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOH_CLK_DISABLE()
00495 #define MFX_WAKEUP_PIN                    GPIO_PIN_6                  /* PH.06 */
00496
00497
00498
00499 /* Legacy  */
00500 #define IDD_INT_GPIO_PORT                 MFX_INT_GPIO_PORT
00501 #define IDD_INT_GPIO_CLK_ENABLE()         MFX_INT_GPIO_CLK_ENABLE()
00502 #define IDD_INT_GPIO_CLK_DISABLE()        MFX_INT_GPIO_CLK_DISABLE()
00503 #define IDD_INT_PIN                       MFX_INT_PIN
00504 #define IDD_INT_EXTI_IRQn                 MFX_INT_EXTI_IRQn
00505 #define IDD_WAKEUP_GPIO_PORT              MFX_WAKEUP_GPIO_PORT
00506 #define IDD_WAKEUP_GPIO_CLK_ENABLE()      MFX_WAKEUP_GPIO_CLK_ENABLE()
00507 #define IDD_WAKEUP_GPIO_CLK_DISABLE()     MFX_WAKEUP_GPIO_CLK_DISABLE()
00508 #define IDD_WAKEUP_PIN                    MFX_WAKEUP_PIN
00509
00510
00511 /**
00512   * @brief  Idd current measurement interface pins on MFX
00513   */
00514 #define IDD_AMP_CONTROL_PIN               AGPIO_PIN_1
00515
00516 /**
00517   * @brief TS INT pin
00518   */
00519 #define TS_INT_PIN                        GPIO_PIN_14
00520 #define TS_INT_GPIO_PORT                  GPIOG
00521 #define TS_INT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOG_CLK_ENABLE()
00522 #define TS_INT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOG_CLK_DISABLE()
00523 #define TS_INT_EXTI_IRQn                  EXTI15_10_IRQn
00524
00525 /**
00526   * @brief TS RST pin
00527   */
00528 /* TS RST is accessed thru the MFX */
00529 #define TS_RST_PIN                        IO1_PIN_1
00530
00531 /**
00532   * @}
00533   */
00534
00535 /**
00536   * @}
00537   */
00538
00539
00540 /** @defgroup STM32L496G_DISCOVERY_Exported_Functions Exported Functions
00541   * @{
00542   */
00543 uint32_t                BSP_GetVersion(void);
00544 void                    BSP_LED_Init(Led_TypeDef Led);
00545 void                    BSP_LED_DeInit(Led_TypeDef Led);
00546 void                    BSP_LED_On(Led_TypeDef Led);
00547 void                    BSP_LED_Off(Led_TypeDef Led);
00548 void                    BSP_LED_Toggle(Led_TypeDef Led);
00549 uint8_t                 BSP_JOY_Init(JOYMode_TypeDef Joy_Mode);
00550 void                    BSP_JOY_DeInit(void);
00551 JOYState_TypeDef        BSP_JOY_GetState(void);
00552 #if defined(HAL_UART_MODULE_ENABLED)
00553 void                    BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart);
00554 void                    BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
00555 #endif /* HAL_UART_MODULE_ENABLED */
00556
00557 /* These __weak functions can be surcharged by application code for specific application needs */
00558 void                    BSP_ErrorHandler(void);
00559
00560
00561 void FMC_BANK1_MspInit(void);
00562 void FMC_BANK1_MspDeInit(void);
00563 #if defined(HAL_I2C_MODULE_ENABLED)
00564 void I2C2_Init(void);
00565 void I2C2_DeInit(void);
00566 #endif /* HAL_I2C_MODULE_ENABLED */
00567
00568 /**
00569   * @}
00570   */
00571
00572 /**
00573   * @}
00574   */
00575
00576 /**
00577   * @}
00578   */
00579
00580 /**
00581   * @}
00582   */
00583
00584 #ifdef __cplusplus
00585 }
00586 #endif
00587
00588 #endif /* __STM32L496G_DISCOVERY_H */
00589
00590 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_audio.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_audio.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_audio.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the
00006   *          Audio driver for the STM32L496G-Discovery board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /*==============================================================================
00022                                  User NOTES
00023
00024 1. How To use this driver:
00025 --------------------------
00026    + This driver supports STM32L4xx devices on STM32L496G-Discovery (MB1261) Discovery boards.
00027         a) to play an audio file through headset. All functions names start by BSP_AUDIO_OUT_xxx.
00028         b) to record an audio file through digital microphones (MP34DT01TR ST mems)
00029            or analog microphone (headset microphone). All functions names start by BSP_AUDIO_IN_xxx.
00030
00031 a) PLAY A FILE:
00032 ==============
00033    + Call the function BSP_AUDIO_OUT_Init(
00034                                     OutputDevice: physical output mode (only OUTPUT_DEVICE_HEADPHONE).
00035                                     Volume      : Initial volume to be set (0 is min (mute), 100 is max (100%)
00036                                     AudioFreq   : Audio frequency in Hz (8000, 16000, 22500, 32000...)
00037                                                   this parameter is relative to the audio file/stream type.
00038                                    )
00039       This function configures all the hardware required for the audio application (codec, I2C, SAI,
00040       GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if configuration is OK.
00041       If the returned value is different from AUDIO_OK or the function is stuck then the communication with
00042       the audio codec has failed.
00043       - OUTPUT_DEVICE_HEADPHONE: only Headphone output is available on this board.
00044
00045    + Call the function BSP_AUDIO_OUT_RegisterCallbacks to register user callbacks
00046      required to manage audio data streaming towards the audio codec (ErrorCallback(),
00047      HalfTransfer_CallBack() and TransferComplete_CallBack()).
00048
00049    + Call the function BSP_AUDIO_OUT_Play() to start audio playback (for the first time).
00050    + Call the function BSP_AUDIO_OUT_Pause() to pause audio playback.
00051    + Call the function BSP_AUDIO_OUT_Resume() to resume audio playback.
00052        Note. After calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() should be called
00053           for resume (it is not allowed to call BSP_AUDIO_OUT_Play() in this case).
00054        Note. This function should be called only when the audio file is played or paused (not stopped).
00055    + Call the function BSP_AUDIO_OUT_Stop() to stop audio playback.
00056    + To modify the volume level, the sampling frequency, the device output mode,
00057       the mute status or the audio configuration or the stop, use the functions: BSP_AUDIO_OUT_SetVolume(),
00058       AUDIO_OUT_SetFrequency(), BSP_AUDIO_OUT_SetOutputMode(), BSP_AUDIO_OUT_SetMute()and
00059       BSP_AUDIO_OUT_ChangeAudioConfig().
00060
00061 Driver architecture:
00062 --------------------
00063    + This driver provides the audio layer high level API: it consists in functions
00064      exported in the stm32l496g_discovery_audio.h file (e.g. BSP_AUDIO_OUT_Init(),
00065      BSP_AUDIO_OUT_Play(), ...).
00066    + This driver also includes the Media Access Layer (MAL): it consists in
00067      functions allowing to access setup the audio devices. These functions
00068      are  included as local functions into the stm32l496g_discovery_audio.c file
00069      (e.g. AUDIO_SAIx_Init()).
00070
00071 Known Limitations:
00072 ------------------
00073    1- Communication with the audio codec (through I2C) may be corrupted if it is interrupted by some
00074       user interrupt routines (in this case, interrupts could be disabled just before the start of
00075       communication then re-enabled when it is over). Note that this communication is only done at
00076       the configuration phase (BSP_AUDIO_OUT_Init() or BSP_AUDIO_OUT_Stop()) and when Volume control modification is
00077       performed (BSP_AUDIO_OUT_SetVolume() or BSP_AUDIO_OUT_SetMute()or BSP_AUDIO_OUT_SetOutputMode()).
00078       When the audio data is played, no communication is required with the audio codec.
00079    2- Parsing of audio file is not implemented (in order to determine audio file properties: Mono/Stereo, Data size,
00080       File size, Audio Frequency, Audio Data header size ...). The configuration is fixed for the given audio file.
00081    3- Supports only 16-bits audio data size.
00082
00083 b) RECORD A FILE:
00084 ================
00085    + Call the function BSP_AUDIO_IN_InitEx(
00086                                     InputDevice: physical input mode (INPUT_DEVICE_DIGITAL_MIC
00087                                                   INPUT_DEVICE_DIGITAL_MIC1, INPUT_DEVICE_DIGITAL_MIC2
00088                                                   or INPUT_DEVICE_ANALOG_MIC)
00089                                     AudioFreq: Audio frequency in Hz (8000, 16000, 22500, 32000 ...)
00090                                     )
00091       This function configures all the hardware required for the audio application (DFSDM or SAI,
00092       GPIOs, DMA and interrupt if needed). This function returns AUDIO_OK if the
00093       configuration completes successfully.
00094       - INPUT_DEVICE_DIGITAL_MIC: Record from digital microphones mounted on board.
00095       - INPUT_DEVICE_DIGITAL_MIC1: Record from digital microphone 1 mounted on board (left microphone).
00096       - INPUT_DEVICE_DIGITAL_MIC2: Record from digital microphone 2 mounted on board (right microphone).
00097       - INPUT_DEVICE_ANALOG_MIC: Record from headset microphone.
00098
00099    + Call the function BSP_AUDIO_IN_RegisterCallbacks to register user callbacks
00100      used to stream audio data toward the record buffer (ErrorCallback(),
00101      HalfTransfer_CallBack() and TransferComplete_CallBack()).
00102
00103    + Call the function BSP_AUDIO_IN_Record(
00104                             pbuf Main buffer pointer for the recorded data storing
00105                             size Current size of the recorded buffer
00106                             )
00107       to start recording from the microphone.
00108
00109    + Call the function BSP_AUDIO_IN_STOP() to stop recording.
00110 ==============================================================================*/
00111
00112 /* Includes ------------------------------------------------------------------*/
00113 #include <string.h>
00114 #include "stm32l496g_discovery_audio.h"
00115
00116 /** @addtogroup BSP
00117   * @{
00118   */
00119
00120 /** @addtogroup STM32L496G_DISCOVERY
00121   * @{
00122   */
00123
00124 /** @defgroup STM32L496G_DISCOVERY_AUDIO STM32L496G-DISCOVERY AUDIO
00125   * @brief This file includes the low layer driver for cs42l51 Audio Codec
00126   *        available on STM32L496G-Discovery board (MB1261).
00127   * @{
00128   */
00129
00130 /* Private typedef -----------------------------------------------------------*/
00131 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Private_Types Private Types
00132   * @{
00133   */
00134 typedef struct
00135 {
00136   AUDIO_DrvTypeDef     *AudioDrv;           /* Audio codec driver */
00137   uint32_t              OutputDevice;       /* Output device */
00138   uint32_t              Frequency;          /* Playback frequency */
00139   uint32_t              Volume;             /* Playback volume */
00140   Audio_CallbackTypeDef CbError;            /* pointer to the callback function invoked when error occurs */
00141   Audio_CallbackTypeDef CbHalfTransfer;     /* pointer to the callback function invoked when half transfer occurs */
00142   Audio_CallbackTypeDef CbTransferComplete; /* pointer to the callback function invoked when transfer complete occurs */
00143 } AUDIO_OUT_TypeDef;
00144
00145 typedef struct
00146 {
00147   AUDIO_DrvTypeDef           *AudioDrv;           /* Audio codec driver */
00148   DFSDM_Channel_HandleTypeDef hDfsdmLeftChannel;  /* DFSDM channel handle used for left channel */
00149   DFSDM_Channel_HandleTypeDef hDfsdmRightChannel; /* DFSDM channel handle used for right channel */
00150   DMA_HandleTypeDef           hDmaDfsdmLeft;      /* DMA handle used for DFSDM regular conversions on left channel */
00151   DMA_HandleTypeDef           hDmaDfsdmRight;     /* DMA handle used for DFSDM regular conversions on right channel */
00152   int32_t                    *LeftRecBuff;        /* Buffers for left samples */
00153   int32_t                    *RightRecBuff;       /* Buffers for right samples */
00154   uint32_t                    InputDevice;        /* Input device */
00155   uint32_t                    Frequency;          /* Record Frequency */
00156   uint32_t                    BitResolution;      /* Record bit resolution */
00157   uint32_t                    ChannelNbr;         /* Record Channel Number */
00158   uint16_t                   *pRecBuf;            /* Pointer to record user buffer */
00159   uint32_t                    RecSize;            /* Size to record in mono, double size to record in stereo */
00160   Audio_CallbackTypeDef       CbError;            /* pointer to the callback function invoked when a DMA transfer fails */
00161   Audio_CallbackTypeDef       CbHalfTransfer;     /* pointer to the callback function invoked when half of the DMA transfer is completed */
00162   Audio_CallbackTypeDef       CbTransferComplete; /* pointer to the callback function invoked when the DMA transfer is completed */
00163 } AUDIO_IN_TypeDef;
00164
00165 /**
00166   * @}
00167   */
00168
00169 /* Private defines ------------------------------------------------------------*/
00170 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Private_Constants Private Constants
00171   * @{
00172   */
00173 /**
00174   * @}
00175   */
00176
00177 /* Private macros ------------------------------------------------------------*/
00178 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Private_Macros Private Macros
00179   * @{
00180   */
00181 /*### PLAY ###*/
00182 /* SCK(kHz) = SAI_CK_x/(SAIClockDivider*2*256) */
00183 #define SAIClockDivider(__FREQUENCY__) \
00184         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 12 \
00185       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 2 \
00186       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 6 \
00187       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 1 \
00188       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 3 \
00189       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 0 \
00190       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 2 : 1  \
00191
00192 /*### RECORD ###*/
00193 #define DFSDMOverSampling(__FREQUENCY__) \
00194         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 256 \
00195       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 256 \
00196       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 128 \
00197       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 128 \
00198       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 64 \
00199       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 64  \
00200       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 32 : 16  \
00201
00202 #define DFSDMClockDivider(__FREQUENCY__) \
00203         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 24 \
00204       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 4 \
00205       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 24 \
00206       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 4 \
00207       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 24 \
00208       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 4  \
00209       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 32 : 32  \
00210
00211 #define DFSDMFilterOrder(__FREQUENCY__) \
00212         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? DFSDM_FILTER_SINC3_ORDER \
00213       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? DFSDM_FILTER_SINC3_ORDER \
00214       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? DFSDM_FILTER_SINC3_ORDER \
00215       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? DFSDM_FILTER_SINC3_ORDER \
00216       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? DFSDM_FILTER_SINC4_ORDER \
00217       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? DFSDM_FILTER_SINC3_ORDER  \
00218       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? DFSDM_FILTER_SINC4_ORDER : DFSDM_FILTER_SINC5_ORDER  \
00219
00220 #define DFSDMRightBitShift(__FREQUENCY__) \
00221         (__FREQUENCY__ == AUDIO_FREQUENCY_8K)  ? 8 \
00222       : (__FREQUENCY__ == AUDIO_FREQUENCY_11K) ? 8 \
00223       : (__FREQUENCY__ == AUDIO_FREQUENCY_16K) ? 6 \
00224       : (__FREQUENCY__ == AUDIO_FREQUENCY_22K) ? 6 \
00225       : (__FREQUENCY__ == AUDIO_FREQUENCY_32K) ? 8 \
00226       : (__FREQUENCY__ == AUDIO_FREQUENCY_44K) ? 2 \
00227       : (__FREQUENCY__ == AUDIO_FREQUENCY_48K) ? 4 : 4  \
00228
00229 /* Saturate the record PCM sample */
00230 #define SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N)))
00231
00232 /**
00233   * @}
00234   */
00235
00236 /* Private variables ---------------------------------------------------------*/
00237 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Private_Variables Private Variables
00238   * @{
00239   */
00240 /* Audio output context information */
00241 static AUDIO_OUT_TypeDef hAudioOut = {0};
00242
00243 /* Audio input context information */
00244 static AUDIO_IN_TypeDef hAudioIn = {0};
00245
00246 /* SAI DMA handle */
00247 static DMA_HandleTypeDef hDmaSaiTx;
00248 static DMA_HandleTypeDef hDmaSaiRx;
00249
00250 static uint32_t DmaLeftRecHalfBuffCplt;
00251 static uint32_t DmaLeftRecBuffCplt;
00252 static uint32_t DmaRightRecHalfBuffCplt;
00253 static uint32_t DmaRightRecBuffCplt;
00254
00255
00256 /**
00257   * @}
00258   */
00259
00260 /* Exported variables ---------------------------------------------------------*/
00261 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Variables Exported Variables
00262   * @{
00263   */
00264 /* SAIx handle */
00265 SAI_HandleTypeDef               BSP_AUDIO_hSai_Tx;
00266 SAI_HandleTypeDef               BSP_AUDIO_hSai_Rx;
00267
00268 /* DFSDM filter handle */
00269 DFSDM_Filter_HandleTypeDef      BSP_AUDIO_hDfsdmLeftFilter;
00270 DFSDM_Filter_HandleTypeDef      BSP_AUDIO_hDfsdmRightFilter;
00271 /**
00272   * @}
00273   */
00274
00275 /* Private function prototypes -----------------------------------------------*/
00276 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Private_Functions Private Functions
00277   * @{
00278   */
00279 static uint8_t AUDIO_SAIx_Init(uint32_t AudioFreq);
00280 static uint8_t AUDIO_SAIx_DeInit(void);
00281 static uint8_t AUDIO_DFSDMx_Init(uint32_t AudioFreq);
00282 static uint8_t AUDIO_DFSDMx_DeInit(void);
00283 static uint8_t AUDIO_SAIPLLConfig(uint32_t AudioFreq);
00284 /**
00285   * @}
00286   */
00287
00288 /* Exported functions --------------------------------------------------------*/
00289 /** @addtogroup STM32L496G_DISCOVERY_AUDIO_Exported_Functions
00290   * @{
00291   */
00292
00293 /**
00294   * @brief  Configures the audio codec related peripherals.
00295   * @param  OutputDevice: OUTPUT_DEVICE_HEADPHONE.
00296   * @param  Volume: Initial volume level (from 0 (Mute) to 100 (Max))
00297   * @param  AudioFreq: Audio frequency used to play the audio stream.
00298   * @retval BSP AUDIO status
00299   * @note   The SAI PLL input clock must be configure in the user application.
00300   *         The SAI PLL configuration done within this function assumes that
00301   *         the SAI PLL input clock runs at 8 MHz.
00302   */
00303 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice,
00304                            uint8_t  Volume,
00305                            uint32_t AudioFreq)
00306 {
00307   /* Initialize the audio output context */
00308   hAudioOut.AudioDrv           = &cs42l51_drv;
00309   hAudioOut.OutputDevice       = OutputDevice;
00310   hAudioOut.Frequency          = AudioFreq;
00311   hAudioOut.Volume             = Volume;
00312   hAudioOut.CbError            = (Audio_CallbackTypeDef)NULL;
00313   hAudioOut.CbHalfTransfer     = (Audio_CallbackTypeDef)NULL;
00314   hAudioOut.CbTransferComplete = (Audio_CallbackTypeDef)NULL;
00315
00316   /* Check if input device is currently used */
00317   if (hAudioIn.InputDevice != 0)
00318   {
00319     /* If input device is currently used, SAI PLL is already initialized */
00320     /* Check that AudioFreq for record and playback is the same */
00321     if (hAudioIn.Frequency != hAudioOut.Frequency)
00322     {
00323       return AUDIO_ERROR;
00324     }
00325   }
00326   else
00327   {
00328     /* Configure the SAI PLL according to the requested audio frequency */
00329     if (AUDIO_SAIPLLConfig(AudioFreq) != AUDIO_OK)
00330     {
00331       return AUDIO_ERROR;
00332     }
00333   }
00334
00335   /* If input device is analogic mic, SAI is already initialized */
00336   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
00337   {
00338     /* SAI data transfer preparation: prepare the Media to be used for the audio
00339     transfer from memory to SAI peripheral. */
00340     if (AUDIO_SAIx_Init(AudioFreq) != AUDIO_OK)
00341     {
00342       return AUDIO_ERROR;
00343     }
00344   }
00345
00346   /* Initialize the audio codec internal registers */
00347   if (hAudioOut.AudioDrv->Init(AUDIO_I2C_ADDRESS,
00348                                (hAudioOut.OutputDevice | hAudioIn.InputDevice),
00349                                Volume,
00350                                AudioFreq) != 0)
00351   {
00352     return AUDIO_ERROR;
00353   }
00354
00355   return AUDIO_OK;
00356 }
00357
00358 /**
00359   * @brief  De-Initializes audio codec related peripherals
00360   * @retval BSP AUDIO status
00361
00362   */
00363 uint8_t BSP_AUDIO_OUT_DeInit(void)
00364 {
00365   if (hAudioIn.InputDevice == INPUT_DEVICE_ANALOG_MIC)
00366   {
00367     /* Reset playback path on audio codec */
00368     if (hAudioIn.AudioDrv->Init(AUDIO_I2C_ADDRESS,
00369                                 hAudioIn.InputDevice,
00370                                 (uint8_t) hAudioOut.Volume,
00371                                 hAudioIn.Frequency) != 0)
00372     {
00373       return AUDIO_ERROR;
00374     }
00375   }
00376   else
00377   {
00378     /* De-initializes SAI interface */
00379     if (AUDIO_SAIx_DeInit() != AUDIO_OK)
00380     {
00381       return AUDIO_ERROR;
00382     }
00383
00384     /* DeInit audio codec */
00385     hAudioOut.AudioDrv->DeInit();
00386   }
00387
00388   /* Disable SAI PLL if no more device is used */
00389   if (hAudioIn.InputDevice == 0)
00390   {
00391     if (AUDIO_SAIx_PLL_DISABLE() != AUDIO_OK)
00392     {
00393       return AUDIO_ERROR;
00394     }
00395   }
00396
00397   /* Reset the audio output context */
00398   memset(&hAudioOut, 0, sizeof(hAudioOut));
00399
00400   return AUDIO_OK;
00401 }
00402
00403 /**
00404   * @brief  Starts playing audio stream from a data buffer for a determined size.
00405   * @param  pData: pointer on PCM samples buffer
00406   * @param  Size: Number of audio data HALF WORD.
00407   * @retval BSP AUDIO status
00408   */
00409 uint8_t BSP_AUDIO_OUT_Play(uint16_t *pData, uint32_t Size)
00410 {
00411   /* Initiate a DMA transfer of PCM samples towards the serial audio interface */
00412   if (HAL_SAI_Transmit_DMA(&BSP_AUDIO_hSai_Tx, (uint8_t *)pData, DMA_MAX(Size)) != HAL_OK)
00413   {
00414     return AUDIO_ERROR;
00415   }
00416
00417   /* Call the audio Codec Play function */
00418   if (hAudioOut.AudioDrv->Play(AUDIO_I2C_ADDRESS, pData, Size) != 0)
00419   {
00420     return AUDIO_ERROR;
00421   }
00422
00423   return AUDIO_OK;
00424 }
00425
00426 /**
00427   * @brief  Sends n-Bytes on the SAI interface.
00428   * @param  pData: pointer on PCM samples buffer
00429   * @param  Size: number of data to be written
00430   * @retval BSP AUDIO status
00431   */
00432 uint8_t BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
00433 {
00434   /* Initiate a DMA transfer of PCM samples towards the serial audio interface */
00435   if (HAL_SAI_Transmit_DMA(&BSP_AUDIO_hSai_Tx, (uint8_t *)pData, Size) != HAL_OK)
00436   {
00437     return AUDIO_ERROR;
00438   }
00439
00440   return AUDIO_OK;
00441 }
00442
00443 /**
00444   * @brief  This function Pauses the audio file stream. In case
00445   *         of using DMA, the DMA Pause feature is used.
00446   * @note When calling BSP_AUDIO_OUT_Pause() function for pause, only
00447   *       BSP_AUDIO_OUT_Resume() function should be called for resume
00448   *       (use of BSP_AUDIO_OUT_Play() function for resume could lead
00449   *       to unexpected behavior).
00450   * @retval BSP AUDIO status
00451   */
00452 uint8_t BSP_AUDIO_OUT_Pause(void)
00453 {
00454   /* Call the Audio Codec Pause function */
00455   if (hAudioOut.AudioDrv->Pause(AUDIO_I2C_ADDRESS) != 0)
00456   {
00457     return AUDIO_ERROR;
00458   }
00459
00460   /* Pause DMA transfer of PCM samples towards the serial audio interface */
00461   if (HAL_SAI_DMAPause(&BSP_AUDIO_hSai_Tx) != HAL_OK)
00462   {
00463     return AUDIO_ERROR;
00464   }
00465
00466   return AUDIO_OK;
00467 }
00468
00469 /**
00470   * @brief  This function  Resumes the audio file stream.
00471   * @note When calling BSP_AUDIO_OUT_Pause() function for pause, only
00472   *       BSP_AUDIO_OUT_Resume() function should be called for resume
00473   *       (use of BSP_AUDIO_OUT_Play() function for resume could lead to
00474   *       unexpected behavior).
00475   * @retval BSP AUDIO status
00476   */
00477 uint8_t BSP_AUDIO_OUT_Resume(void)
00478 {
00479   /* Call the Audio Codec Resume function */
00480   if (hAudioOut.AudioDrv->Resume(AUDIO_I2C_ADDRESS) != 0)
00481   {
00482     return AUDIO_ERROR;
00483   }
00484
00485   /* Resume DMA transfer of PCM samples towards the serial audio interface */
00486   if (HAL_SAI_DMAResume(&BSP_AUDIO_hSai_Tx) != HAL_OK)
00487   {
00488     return AUDIO_ERROR;
00489   }
00490
00491   return AUDIO_OK;
00492 }
00493
00494 /**
00495   * @brief  Stops audio playing and Power down the Audio Codec.
00496   * @param  Option: could be one of the following parameters
00497   *           - CODEC_PDWN_SW: for software power off (by writing registers).
00498   *                            Then no need to reconfigure the Codec after power on.
00499   *           - CODEC_PDWN_HW: completely shut down the codec (physically).
00500   *                            Then need to reconfigure the Codec after power on.
00501   * @retval BSP AUDIO status
00502   */
00503 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
00504 {
00505   /* Prevent unused argument(s) compilation warning */
00506   UNUSED(Option);
00507
00508   /* Call Audio Codec Stop function */
00509   if (hAudioOut.AudioDrv->Stop(AUDIO_I2C_ADDRESS, Option) != 0)
00510   {
00511     return AUDIO_ERROR;
00512   }
00513
00514   /* Wait at least 100ms */
00515   HAL_Delay(100);
00516
00517   /* Stop DMA transfer of PCM samples towards the serial audio interface */
00518   if (HAL_SAI_DMAStop(&BSP_AUDIO_hSai_Tx) != HAL_OK)
00519   {
00520     return AUDIO_ERROR;
00521   }
00522
00523   return AUDIO_OK;
00524 }
00525
00526 /**
00527   * @brief  Controls the current audio volume level.
00528   * @param  Volume: Volume level to be set in percentage from 0% to 100% (0 for
00529   *         Mute and 100 for Max volume level).
00530   * @retval BSP AUDIO status
00531   */
00532 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
00533 {
00534   /* Call the codec volume control function with converted volume value */
00535   if (hAudioOut.AudioDrv->SetVolume(AUDIO_I2C_ADDRESS, Volume) != 0)
00536   {
00537     return AUDIO_ERROR;
00538   }
00539
00540   hAudioOut.Volume = Volume;
00541
00542   return AUDIO_OK;
00543 }
00544
00545 /**
00546   * @brief  Enables or disables the MUTE mode by software
00547   * @param  Cmd: Could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to
00548   *         unmute the codec and restore previous volume level.
00549   * @retval BSP AUDIO status
00550   */
00551 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
00552 {
00553   /* Call the Codec Mute function */
00554   if (hAudioOut.AudioDrv->SetMute(AUDIO_I2C_ADDRESS, Cmd) != 0)
00555   {
00556     return AUDIO_ERROR;
00557   }
00558
00559   return AUDIO_OK;
00560 }
00561
00562 /**
00563   * @brief  Switch dynamically (while audio file is being played) the output
00564   *          target (speaker or headphone).
00565   * @param  Output: The audio output target: OUTPUT_DEVICE_SPEAKER,
00566   *         OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
00567   * @retval BSP AUDIO status
00568   */
00569 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output)
00570 {
00571   /* Call the Codec output device function */
00572   if (hAudioOut.AudioDrv->SetOutputMode(AUDIO_I2C_ADDRESS, Output) != 0)
00573   {
00574     return AUDIO_ERROR;
00575   }
00576
00577   return AUDIO_OK;
00578 }
00579
00580 /**
00581   * @brief  Updates the audio frequency.
00582   * @param  AudioFreq: Audio frequency used to play the audio stream.
00583   * @note   The SAI PLL input clock must be configure in the user application.
00584   *         The SAI PLL configuration done within this function assumes that
00585   *         the SAI PLL input clock runs at 8 MHz.
00586   * @retval BSP AUDIO status
00587   */
00588 uint8_t BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq)
00589 {
00590   uint8_t TxData[2] = {0x00, 0x00};
00591
00592   /* Configure the SAI PLL according to the requested audio frequency */
00593   if (AUDIO_SAIPLLConfig(AudioFreq) != AUDIO_OK)
00594   {
00595     return AUDIO_ERROR;
00596   }
00597
00598   /* Disable SAI peripheral to allow access to SAI internal registers */
00599   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
00600   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Rx);
00601
00602   /* Update the SAI audio frequency configuration */
00603   BSP_AUDIO_hSai_Tx.Init.Mckdiv = SAIClockDivider(AudioFreq);
00604   HAL_SAI_Init(&BSP_AUDIO_hSai_Tx);
00605   BSP_AUDIO_hSai_Rx.Init.Mckdiv = SAIClockDivider(AudioFreq);
00606   HAL_SAI_Init(&BSP_AUDIO_hSai_Rx);
00607
00608   /* Enable SAI peripheral to generate MCLK */
00609   __HAL_SAI_ENABLE(&BSP_AUDIO_hSai_Tx);
00610   /* Transmit one byte to start FS generation */
00611   if (HAL_SAI_Transmit(&BSP_AUDIO_hSai_Tx, TxData, 2, 1000) != HAL_OK)
00612   {
00613     return AUDIO_ERROR;
00614   }
00615
00616   hAudioOut.Frequency = AudioFreq;
00617
00618   return AUDIO_OK;
00619 }
00620
00621 /**
00622   * @brief  Changes the Audio Out Configuration.
00623   * @param  AudioOutOption: specifies the audio out new configuration
00624   *         This parameter can be any value of @ref BSP_Audio_Out_Option
00625   * @note   This API should be called after the BSP_AUDIO_OUT_Init() to adjust the
00626   *         audio out configuration.
00627   * @retval None
00628   */
00629 void BSP_AUDIO_OUT_ChangeAudioConfig(uint32_t AudioOutOption)
00630 {
00631   uint8_t TxData[2] = {0x00, 0x00};
00632
00633   /********** Playback Buffer circular/normal mode **********/
00634   if (AudioOutOption & BSP_AUDIO_OUT_CIRCULARMODE)
00635   {
00636     /* Deinitialize the Stream to update DMA mode */
00637     HAL_DMA_DeInit(BSP_AUDIO_hSai_Tx.hdmatx);
00638
00639     /* Update the SAI audio Transfer DMA mode */
00640     BSP_AUDIO_hSai_Tx.hdmatx->Init.Mode = DMA_CIRCULAR;
00641
00642     /* Configure the DMA Stream with new Transfer DMA mode */
00643     HAL_DMA_Init(BSP_AUDIO_hSai_Tx.hdmatx);
00644   }
00645   else /* BSP_AUDIO_OUT_NORMALMODE */
00646   {
00647     /* Deinitialize the Stream to update DMA mode */
00648     HAL_DMA_DeInit(BSP_AUDIO_hSai_Tx.hdmatx);
00649
00650     /* Update the SAI audio Transfer DMA mode */
00651     BSP_AUDIO_hSai_Tx.hdmatx->Init.Mode = DMA_NORMAL;
00652
00653     /* Configure the DMA Stream with new Transfer DMA mode */
00654     HAL_DMA_Init(BSP_AUDIO_hSai_Tx.hdmatx);
00655   }
00656
00657   /********** Playback Buffer stereo/mono mode **********/
00658   if (AudioOutOption & BSP_AUDIO_OUT_STEREOMODE)
00659   {
00660     /* Disable SAI peripheral to allow access to SAI internal registers */
00661     __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
00662
00663     /* Update the SAI audio frame slot configuration */
00664     BSP_AUDIO_hSai_Tx.Init.MonoStereoMode = SAI_STEREOMODE;
00665     HAL_SAI_Init(&BSP_AUDIO_hSai_Tx);
00666
00667     /* Enable SAI peripheral to generate MCLK */
00668     __HAL_SAI_ENABLE(&BSP_AUDIO_hSai_Tx);
00669     /* Transmit one byte to start FS generation */
00670     HAL_SAI_Transmit(&BSP_AUDIO_hSai_Tx, TxData, 2, 1000);
00671   }
00672   else /* BSP_AUDIO_OUT_MONOMODE */
00673   {
00674     /* Disable SAI peripheral to allow access to SAI internal registers */
00675     __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
00676
00677     /* Update the SAI audio frame slot configuration */
00678     BSP_AUDIO_hSai_Tx.Init.MonoStereoMode = SAI_MONOMODE;
00679     HAL_SAI_Init(&BSP_AUDIO_hSai_Tx);
00680
00681     /* Enable SAI peripheral to generate MCLK */
00682     __HAL_SAI_ENABLE(&BSP_AUDIO_hSai_Tx);
00683     /* Transmit one byte to start FS generation */
00684     HAL_SAI_Transmit(&BSP_AUDIO_hSai_Tx, TxData, 2, 1000);
00685   }
00686 }
00687
00688 /**
00689   * @brief  register user callback functions
00690   * @param  ErrorCallback: pointer to the error callback function
00691   * @param  HalfTransferCallback: pointer to the half transfer callback function
00692   * @param  TransferCompleteCallback: pointer to the transfer complete callback function
00693   * @retval None
00694   */
00695 void BSP_AUDIO_OUT_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
00696                                      Audio_CallbackTypeDef HalfTransferCallback,
00697                                      Audio_CallbackTypeDef TransferCompleteCallback)
00698 {
00699   hAudioOut.CbError            = ErrorCallback;
00700   hAudioOut.CbHalfTransfer     = HalfTransferCallback;
00701   hAudioOut.CbTransferComplete = TransferCompleteCallback;
00702 }
00703
00704 /**
00705   * @brief  Tx Transfer completed callbacks.
00706   * @param  hsai: SAI handle
00707   * @retval None
00708   */
00709 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
00710 {
00711   /* Invoke the registered 'TransferComplete' function (if any) */
00712   if (hAudioOut.CbTransferComplete != (Audio_CallbackTypeDef)NULL)
00713   {
00714     hAudioOut.CbTransferComplete();
00715   }
00716 }
00717
00718 /**
00719   * @brief  Tx Half Transfer completed callbacks.
00720   * @param  hsai: SAI handle
00721   * @retval None
00722   */
00723 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
00724 {
00725   /* Invoke the registered 'HalfTransfer' callback function (if any) */
00726   if (hAudioOut.CbHalfTransfer != (Audio_CallbackTypeDef)NULL)
00727   {
00728     hAudioOut.CbHalfTransfer();
00729   }
00730 }
00731
00732 /**
00733   * @brief  SAI error callbacks.
00734   * @param  hsai: SAI handle
00735   * @retval None
00736   */
00737 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
00738 {
00739   /* Invoke the registered 'ErrorCallback' callback function (if any) */
00740   if (hAudioOut.CbError != (Audio_CallbackTypeDef)NULL)
00741   {
00742     hAudioOut.CbError();
00743   }
00744   /* Invoke the registered 'ErrorCallback' callback function (if any) */
00745   if (hAudioIn.CbError != (Audio_CallbackTypeDef)NULL)
00746   {
00747     hAudioIn.CbError();
00748   }
00749 }
00750
00751 /**
00752   * @}
00753   */
00754
00755 /** @addtogroup STM32L496G_EVAL_AUDIO_Exported_Functions
00756   * @{
00757   */
00758
00759 /**
00760   * @brief  Initializes micropone related peripherals.
00761   * @note   This function assumes that the SAI input clock (through PLL_M)
00762   *         is already configured and ready to be used.
00763   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
00764   * @param  BitRes: Audio frequency to be configured for the SAI peripheral.
00765   * @param  ChnlNbr: Audio frequency to be configured for the SAI peripheral.
00766   * @retval BSP AUDIO status
00767   */
00768 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00769 {
00770   return BSP_AUDIO_IN_InitEx(INPUT_DEVICE_DIGITAL_MIC, AudioFreq, BitRes, ChnlNbr);
00771 }
00772
00773 /**
00774   * @brief  Initialize wave recording.
00775   * @param  InputDevice: INPUT_DEVICE_DIGITAL_MIC, INPUT_DEVICE_DIGITAL_MIC1,
00776   *                      INPUT_DEVICE_DIGITAL_MIC2 or INPUT_DEVICE_ANALOG_MIC.
00777   * @param  AudioFreq: Audio frequency to be configured.
00778   * @param  BitRes: Audio bit resolution to be configured..
00779   * @param  ChnlNbr: Number of channel to be configured.
00780   * @retval AUDIO_OK if correct communication, else wrong communication
00781   */
00782 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
00783 {
00784   /* Update the audio input context */
00785   hAudioIn.AudioDrv           = &cs42l51_drv;
00786   hAudioIn.InputDevice        = InputDevice;
00787   hAudioIn.Frequency          = AudioFreq;
00788   hAudioIn.BitResolution      = BitRes;
00789   hAudioIn.ChannelNbr         = ChnlNbr;
00790   hAudioIn.CbError            = (Audio_CallbackTypeDef)NULL;
00791   hAudioIn.CbHalfTransfer     = (Audio_CallbackTypeDef)NULL;
00792   hAudioIn.CbTransferComplete = (Audio_CallbackTypeDef)NULL;
00793
00794   /* Check channel number according device : only record mono with analog mic and stereo with digital mic are allowed */
00795   if (((InputDevice == INPUT_DEVICE_DIGITAL_MIC) && (ChnlNbr == 1)) ||
00796       ((InputDevice == INPUT_DEVICE_DIGITAL_MIC1) && (ChnlNbr == 2)) ||
00797       ((InputDevice == INPUT_DEVICE_DIGITAL_MIC2) && (ChnlNbr == 2)) ||
00798       ((InputDevice == INPUT_DEVICE_ANALOG_MIC) && (ChnlNbr == 2)))
00799   {
00800     return AUDIO_ERROR;
00801   }
00802
00803   /* Check if output device is currently used */
00804   if (hAudioOut.OutputDevice != 0)
00805   {
00806     /* If output device is currently used, SAI PLL is already initialized */
00807     /* Check that AudioFreq for record and playback is the same */
00808     if (hAudioIn.Frequency != hAudioOut.Frequency)
00809     {
00810       return AUDIO_ERROR;
00811     }
00812   }
00813   else
00814   {
00815     /* Configure the SAI PLL according to the requested audio frequency */
00816     if (AUDIO_SAIPLLConfig(AudioFreq) != AUDIO_OK)
00817     {
00818       return AUDIO_ERROR;
00819     }
00820   }
00821
00822   if (InputDevice != INPUT_DEVICE_ANALOG_MIC)
00823   {
00824     /* Initializes the Digital Filter for Sigma-Delta Modulators interface */
00825     if (AUDIO_DFSDMx_Init(AudioFreq) != AUDIO_OK)
00826     {
00827       return AUDIO_ERROR;
00828     }
00829   }
00830   else
00831   {
00832     /* INPUT_DEVICE_ANALOG_MIC */
00833     /* If output device is currently used, SAI is already initialized */
00834     if (hAudioOut.OutputDevice == 0)
00835     {
00836       /* SAI data transfer preparation: prepare the Media to be used for the audio
00837       transfer from SAI peripheral to memory. */
00838       if (AUDIO_SAIx_Init(AudioFreq) != AUDIO_OK)
00839       {
00840         return AUDIO_ERROR;
00841       }
00842     }
00843
00844     /* Initialize the audio codec internal registers */
00845     if (hAudioIn.AudioDrv->Init(AUDIO_I2C_ADDRESS,
00846                                 (hAudioOut.OutputDevice | hAudioIn.InputDevice),
00847                                 hAudioOut.Volume,
00848                                 AudioFreq) != 0)
00849     {
00850       return AUDIO_ERROR;
00851     }
00852   }
00853
00854   /* Initialise transfer control flag */
00855   DmaLeftRecHalfBuffCplt  = 0;
00856   DmaLeftRecBuffCplt      = 0;
00857   DmaRightRecHalfBuffCplt = 0;
00858   DmaRightRecBuffCplt     = 0;
00859
00860   return AUDIO_OK;
00861 }
00862
00863 /**
00864   * @brief  De-Initializes microphone related peripherals.
00865   * @retval BSP AUDIO status
00866
00867   */
00868 uint8_t BSP_AUDIO_IN_DeInit(void)
00869 {
00870   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
00871   {
00872     /* De-initializes the Digital Filter for Sigma-Delta Modulators interface */
00873     if (AUDIO_DFSDMx_DeInit() != AUDIO_OK)
00874     {
00875       return AUDIO_ERROR;
00876     }
00877   }
00878   else
00879   {
00880     /* INPUT_DEVICE_ANALOG_MIC */
00881     /* Check if output device is currently used */
00882     if (hAudioOut.OutputDevice != 0)
00883     {
00884       /* Reset record path on audio codec */
00885       if (hAudioOut.AudioDrv->Init(AUDIO_I2C_ADDRESS,
00886                                    hAudioOut.OutputDevice,
00887                                    (uint8_t) hAudioOut.Volume,
00888                                    hAudioOut.Frequency) != 0)
00889       {
00890         return AUDIO_ERROR;
00891       }
00892     }
00893     else
00894     {
00895       /* De-initializes SAI interface */
00896       if (AUDIO_SAIx_DeInit() != AUDIO_OK)
00897       {
00898         return AUDIO_ERROR;
00899       }
00900
00901       /* DeInit audio codec */
00902       hAudioIn.AudioDrv->DeInit();
00903     }
00904   }
00905
00906   /* Disable SAI PLL if no more device is used */
00907   if (hAudioOut.OutputDevice == 0)
00908   {
00909     if (AUDIO_SAIx_PLL_DISABLE() != AUDIO_OK)
00910     {
00911       return AUDIO_ERROR;
00912     }
00913   }
00914
00915   /* Reset the audio input context */
00916   memset(&hAudioIn, 0, sizeof(hAudioIn));
00917
00918   return AUDIO_OK;
00919 }
00920
00921 /**
00922   * @brief  Starts audio recording.
00923   * @param  pbuf: Main buffer pointer for the recorded data storing
00924   * @param  size: Current size of the recorded buffer
00925   * @note   The Right channel is start at first with synchro on start of Left channel
00926   * @retval BSP AUDIO status
00927   */
00928 uint8_t BSP_AUDIO_IN_Record(uint16_t *pbuf, uint32_t size)
00929 {
00930   hAudioIn.pRecBuf = pbuf;
00931   hAudioIn.RecSize = size;
00932
00933
00934   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
00935   {
00936     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
00937     {
00938       /* Allocate hAudioIn.LeftRecBuff buffer */
00939 #if defined(BSP_AUDIO_USE_RTOS)
00940       hAudioIn.LeftRecBuff  = (int32_t *)k_malloc((size / hAudioIn.ChannelNbr) * sizeof(int32_t));
00941 #else
00942       hAudioIn.LeftRecBuff  = (int32_t *)malloc((size / hAudioIn.ChannelNbr) * sizeof(int32_t));
00943 #endif
00944       if (hAudioIn.LeftRecBuff == NULL)
00945       {
00946         return AUDIO_ERROR;
00947       }
00948     }
00949
00950     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
00951     {
00952       /* Allocate hAudioIn.RightRecBuff buffer */
00953 #if defined(BSP_AUDIO_USE_RTOS)
00954       hAudioIn.RightRecBuff  = (int32_t *)k_malloc((size / hAudioIn.ChannelNbr) * sizeof(int32_t));
00955 #else
00956       hAudioIn.RightRecBuff  = (int32_t *)malloc((size / hAudioIn.ChannelNbr) * sizeof(int32_t));
00957 #endif
00958       if (hAudioIn.RightRecBuff == NULL)
00959       {
00960         return AUDIO_ERROR;
00961       }
00962     }
00963
00964     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
00965     {
00966       /* Call the Media layer start function for right channel */
00967       if (HAL_DFSDM_FilterRegularStart_DMA(&BSP_AUDIO_hDfsdmRightFilter,
00968                                            (int32_t *)hAudioIn.RightRecBuff,
00969                                            (hAudioIn.RecSize / hAudioIn.ChannelNbr)) != HAL_OK)
00970       {
00971         return AUDIO_ERROR;
00972       }
00973     }
00974
00975     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
00976     {
00977       /* Call the Media layer start function for left channel */
00978       if (HAL_DFSDM_FilterRegularStart_DMA(&BSP_AUDIO_hDfsdmLeftFilter,
00979                                            (int32_t *)hAudioIn.LeftRecBuff,
00980                                            (hAudioIn.RecSize / hAudioIn.ChannelNbr)) != HAL_OK)
00981       {
00982         return AUDIO_ERROR;
00983       }
00984     }
00985   }
00986   else
00987   {
00988     /* INPUT_DEVICE_ANALOG_MIC */
00989     /* Call the audio Codec Play function */
00990     if (hAudioIn.AudioDrv->Play(AUDIO_I2C_ADDRESS, pbuf, size) != 0)
00991     {
00992       return AUDIO_ERROR;
00993     }
00994
00995     /* Start the process receive DMA */
00996     if (HAL_OK != HAL_SAI_Receive_DMA(&BSP_AUDIO_hSai_Rx, (uint8_t *)pbuf, size))
00997     {
00998       return AUDIO_ERROR;
00999     }
01000   }
01001
01002   return AUDIO_OK;
01003 }
01004
01005 /**
01006   * @brief  Updates the audio frequency.
01007   * @param  AudioFreq: Audio frequency used to record the audio stream.
01008   * @note   This API should be called after the BSP_AUDIO_IN_Init() to adjust the
01009   *         audio frequency.
01010   * @retval BSP AUDIO status
01011   */
01012 uint8_t BSP_AUDIO_IN_SetFrequency(uint32_t AudioFreq)
01013 {
01014   uint8_t TxData[2] = {0x00, 0x00};
01015
01016   /* Configure the SAI PLL according to the requested audio frequency */
01017   if (AUDIO_SAIPLLConfig(AudioFreq) != AUDIO_OK)
01018   {
01019     return AUDIO_ERROR;
01020   }
01021
01022   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
01023   {
01024     /* De-initializes the Digital Filter for Sigma-Delta Modulators interface */
01025     if (AUDIO_DFSDMx_DeInit() != AUDIO_OK)
01026     {
01027       return AUDIO_ERROR;
01028     }
01029
01030     /* Initializes the Digital Filter for Sigma-Delta Modulators interface */
01031     if (AUDIO_DFSDMx_Init(AudioFreq) != AUDIO_OK)
01032     {
01033       return AUDIO_ERROR;
01034     }
01035   }
01036   else
01037   {
01038     /* INPUT_DEVICE_ANALOG_MIC */
01039     /* Disable SAI peripheral to allow access to SAI internal registers */
01040     __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
01041     __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Rx);
01042
01043     /* Update the SAI audio frequency configuration */
01044     BSP_AUDIO_hSai_Tx.Init.Mckdiv = SAIClockDivider(AudioFreq);
01045     HAL_SAI_Init(&BSP_AUDIO_hSai_Tx);
01046     BSP_AUDIO_hSai_Rx.Init.Mckdiv = SAIClockDivider(AudioFreq);
01047     HAL_SAI_Init(&BSP_AUDIO_hSai_Rx);
01048
01049     /* Enable SAI peripheral to generate MCLK */
01050     __HAL_SAI_ENABLE(&BSP_AUDIO_hSai_Tx);
01051     /* Transmit one byte to start FS generation */
01052     if (HAL_SAI_Transmit(&BSP_AUDIO_hSai_Tx, TxData, 2, 1000) != HAL_OK)
01053     {
01054       return AUDIO_ERROR;
01055     }
01056   }
01057
01058   hAudioIn.Frequency = AudioFreq;
01059
01060   return AUDIO_OK;
01061 }
01062
01063 /**
01064   * @brief  Regular conversion complete callback.
01065   * @note   In interrupt mode, user has to read conversion value in this function
01066             using HAL_DFSDM_FilterGetRegularValue.
01067   * @param  hdfsdm_filter : DFSDM filter handle.
01068   * @retval None
01069   */
01070 void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
01071 {
01072   uint32_t index;
01073   uint32_t recbufsize = (hAudioIn.RecSize / hAudioIn.ChannelNbr);
01074
01075   if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC)
01076   {
01077     for (index = (recbufsize / 2); index < recbufsize; index++)
01078     {
01079       hAudioIn.pRecBuf[2 * index]       = (uint16_t)(SaturaLH((hAudioIn.LeftRecBuff[index] >> 8), -32768, 32767));
01080       hAudioIn.pRecBuf[(2 * index) + 1] = (uint16_t)(SaturaLH((hAudioIn.RightRecBuff[index] >> 8), -32768, 32767));
01081     }
01082   }
01083   else if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC1)
01084   {
01085     for (index = (recbufsize / 2); index < recbufsize; index++)
01086     {
01087       hAudioIn.pRecBuf[index] = (uint16_t)(SaturaLH((hAudioIn.LeftRecBuff[index] >> 8), -32768, 32767));
01088     }
01089   }
01090   else if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)
01091   {
01092     for (index = (recbufsize / 2); index < recbufsize; index++)
01093     {
01094       hAudioIn.pRecBuf[index] = (uint16_t)(SaturaLH((hAudioIn.RightRecBuff[index] >> 8), -32768, 32767));
01095     }
01096   }
01097
01098   /* Invoke the registered 'TransferCompete' callback function (if any) */
01099   if (hAudioIn.CbTransferComplete != (Audio_CallbackTypeDef)NULL)
01100   {
01101     if (hdfsdm_filter == &BSP_AUDIO_hDfsdmLeftFilter)
01102     {
01103       if (DmaLeftRecBuffCplt)
01104       {
01105         BSP_ErrorHandler();
01106       }
01107
01108       DmaLeftRecBuffCplt = 1;
01109     }
01110     else
01111     {
01112       if (DmaRightRecBuffCplt)
01113       {
01114         BSP_ErrorHandler();
01115       }
01116
01117       DmaRightRecBuffCplt = 1;
01118     }
01119
01120     if (((DmaLeftRecBuffCplt != 0) && (DmaRightRecBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC)) ||
01121         ((DmaLeftRecBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC1)) ||
01122         ((DmaRightRecBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)))
01123     {
01124       hAudioIn.CbTransferComplete();
01125       DmaLeftRecBuffCplt = 0;
01126       DmaRightRecBuffCplt = 0;
01127     }
01128   }
01129 }
01130
01131 /**
01132   * @brief  Half regular conversion complete callback.
01133   * @param  hdfsdm_filter : DFSDM filter handle.
01134   * @retval None
01135   */
01136 void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
01137 {
01138   uint32_t index;
01139   uint32_t recbufsize = (hAudioIn.RecSize / hAudioIn.ChannelNbr);
01140
01141   if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC)
01142   {
01143     for (index = 0; index < (recbufsize / 2); index++)
01144     {
01145       hAudioIn.pRecBuf[2 * index]       = (uint16_t)(SaturaLH((hAudioIn.LeftRecBuff[index] >> 8), -32768, 32767));
01146       hAudioIn.pRecBuf[(2 * index) + 1] = (uint16_t)(SaturaLH((hAudioIn.RightRecBuff[index] >> 8), -32768, 32767));
01147     }
01148   }
01149   else if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC1)
01150   {
01151     for (index = 0; index < (recbufsize / 2); index++)
01152     {
01153       hAudioIn.pRecBuf[index] = (uint16_t)(SaturaLH((hAudioIn.LeftRecBuff[index] >> 8), -32768, 32767));
01154     }
01155   }
01156   else if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)
01157   {
01158     for (index = 0; index < (recbufsize / 2); index++)
01159     {
01160       hAudioIn.pRecBuf[index] = (uint16_t)(SaturaLH((hAudioIn.RightRecBuff[index] >> 8), -32768, 32767));
01161     }
01162   }
01163
01164   /* Invoke the registered 'HalfTransfer' callback function (if any) */
01165   if (hAudioIn.CbHalfTransfer != (Audio_CallbackTypeDef)NULL)
01166   {
01167     if (hdfsdm_filter == &BSP_AUDIO_hDfsdmLeftFilter)
01168     {
01169       if (DmaLeftRecHalfBuffCplt)
01170       {
01171         BSP_ErrorHandler();
01172       }
01173
01174       DmaLeftRecHalfBuffCplt = 1;
01175     }
01176     else
01177     {
01178       if (DmaRightRecHalfBuffCplt)
01179       {
01180         BSP_ErrorHandler();
01181       }
01182
01183       DmaRightRecHalfBuffCplt = 1;
01184     }
01185
01186     if (((DmaLeftRecHalfBuffCplt != 0) && (DmaRightRecHalfBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC)) ||
01187         ((DmaLeftRecHalfBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC1)) ||
01188         ((DmaRightRecHalfBuffCplt != 0) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)))
01189     {
01190       hAudioIn.CbHalfTransfer();
01191       DmaLeftRecHalfBuffCplt = 0;
01192       DmaRightRecHalfBuffCplt = 0;
01193     }
01194   }
01195 }
01196
01197 /**
01198   * @brief  Error callback.
01199   * @param  hdfsdm_filter : DFSDM filter handle.
01200   * @retval None
01201   */
01202 void HAL_DFSDM_FilterErrorCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
01203 {
01204   /* Invoke the registered 'ErrorCallback' callback function (if any) */
01205   if (hAudioIn.CbError != (Audio_CallbackTypeDef)NULL)
01206   {
01207     hAudioIn.CbError();
01208   }
01209 }
01210
01211 /**
01212   * @brief  SAI Rx Transfer completed callbacks.
01213   * @param  hsai: SAI handle
01214   * @retval None
01215   */
01216 void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
01217 {
01218   /* Invoke the registered 'TransferComplete' function (if any) */
01219   if (hAudioIn.CbTransferComplete != (Audio_CallbackTypeDef)NULL)
01220   {
01221     hAudioIn.CbTransferComplete();
01222   }
01223 }
01224
01225 /**
01226   * @brief  SAI Rx Half Transfer completed callbacks.
01227   * @param  hsai: SAI handle
01228   * @retval None
01229   */
01230 void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
01231 {
01232   /* Invoke the registered 'HalfTransfer' callback function (if any) */
01233   if (hAudioIn.CbHalfTransfer != (Audio_CallbackTypeDef)NULL)
01234   {
01235     hAudioIn.CbHalfTransfer();
01236   }
01237 }
01238
01239 /**
01240   * @brief  Stops audio recording.
01241   * @retval BSP AUDIO status
01242   */
01243 uint8_t BSP_AUDIO_IN_Stop(void)
01244 {
01245   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
01246   {
01247     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01248     {
01249       /* Call the Media layer stop function for right channel */
01250       if (HAL_DFSDM_FilterRegularStop_DMA(&BSP_AUDIO_hDfsdmRightFilter) != HAL_OK)
01251       {
01252         return AUDIO_ERROR;
01253       }
01254     }
01255     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01256     {
01257       /* Call the Media layer stop function for left channel */
01258       if (HAL_DFSDM_FilterRegularStop_DMA(&BSP_AUDIO_hDfsdmLeftFilter) != HAL_OK)
01259       {
01260         return AUDIO_ERROR;
01261       }
01262     }
01263
01264     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01265     {
01266       /* Free hAudioIn.LeftRecBuff buffer */
01267 #if defined(BSP_AUDIO_USE_RTOS)
01268       k_free((void *)hAudioIn.LeftRecBuff);
01269 #else
01270       free((void *)hAudioIn.LeftRecBuff);
01271 #endif
01272     }
01273     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01274     {
01275       /* Free hAudioIn.RightRecBuff buffer */
01276 #if defined(BSP_AUDIO_USE_RTOS)
01277       k_free((void *)hAudioIn.RightRecBuff);
01278 #else
01279       free((void *)hAudioIn.RightRecBuff);
01280 #endif
01281     }
01282   }
01283   else
01284   {
01285     /* INPUT_DEVICE_ANALOG_MIC */
01286     /* Call Audio Codec Stop function */
01287     if (hAudioIn.AudioDrv->Stop(AUDIO_I2C_ADDRESS, CODEC_PDWN_HW) != 0)
01288     {
01289       return AUDIO_ERROR;
01290     }
01291
01292     /* Wait at least 100ms */
01293     HAL_Delay(100);
01294
01295     /* Stop DMA transfer of PCM samples towards the serial audio interface */
01296     if (HAL_SAI_DMAStop(&BSP_AUDIO_hSai_Rx) != HAL_OK)
01297     {
01298       return AUDIO_ERROR;
01299     }
01300   }
01301
01302   return AUDIO_OK;
01303 }
01304
01305 /**
01306   * @brief  Pauses the audio file stream.
01307   * @retval BSP AUDIO status
01308   */
01309 uint8_t BSP_AUDIO_IN_Pause(void)
01310 {
01311   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
01312   {
01313     /* Call the Media layer stop function */
01314     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01315     {
01316       if (HAL_DFSDM_FilterRegularStop_DMA(&BSP_AUDIO_hDfsdmRightFilter) != HAL_OK)
01317       {
01318         return AUDIO_ERROR;
01319       }
01320     }
01321
01322     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01323     {
01324       if (HAL_DFSDM_FilterRegularStop_DMA(&BSP_AUDIO_hDfsdmLeftFilter) != HAL_OK)
01325       {
01326         return AUDIO_ERROR;
01327       }
01328     }
01329   }
01330   else
01331   {
01332     /* INPUT_DEVICE_ANALOG_MIC */
01333     /* Pause DMA transfer of PCM samples towards the serial audio interface */
01334     if (HAL_SAI_DMAPause(&BSP_AUDIO_hSai_Rx) != HAL_OK)
01335     {
01336       return AUDIO_ERROR;
01337     }
01338   }
01339
01340   return AUDIO_OK;
01341 }
01342
01343 /**
01344   * @brief  Resumes the audio file stream.
01345   * @retval BSP AUDIO status
01346   */
01347 uint8_t BSP_AUDIO_IN_Resume(void)
01348 {
01349   if (hAudioIn.InputDevice != INPUT_DEVICE_ANALOG_MIC)
01350   {
01351     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01352     {
01353       /* Call the Media layer start function for right channel */
01354       if (HAL_DFSDM_FilterRegularStart_DMA(&BSP_AUDIO_hDfsdmRightFilter,
01355                                            (int32_t *)hAudioIn.RightRecBuff,
01356                                            (hAudioIn.RecSize / hAudioIn.ChannelNbr)) != HAL_OK)
01357       {
01358         return AUDIO_ERROR;
01359       }
01360     }
01361
01362     if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01363     {
01364       /* Call the Media layer start function for left channel */
01365       if (HAL_DFSDM_FilterRegularStart_DMA(&BSP_AUDIO_hDfsdmLeftFilter,
01366                                            (int32_t *)hAudioIn.LeftRecBuff,
01367                                            (hAudioIn.RecSize / hAudioIn.ChannelNbr)) != HAL_OK)
01368       {
01369         return AUDIO_ERROR;
01370       }
01371     }
01372   }
01373   else
01374   {
01375     /* INPUT_DEVICE_ANALOG_MIC */
01376     /* Resume DMA transfer of PCM samples towards the serial audio interface */
01377     if (HAL_SAI_DMAResume(&BSP_AUDIO_hSai_Rx) != HAL_OK)
01378     {
01379       return AUDIO_ERROR;
01380     }
01381   }
01382
01383   return AUDIO_OK;
01384 }
01385
01386 /**
01387   * @brief  register user callback functions
01388   * @param  ErrorCallback: pointer to the error callback function
01389   * @param  HalfTransferCallback: pointer to the half transfer callback function
01390   * @param  TransferCompleteCallback: pointer to the transfer complete callback function
01391   * @retval None
01392   */
01393 void BSP_AUDIO_IN_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
01394                                     Audio_CallbackTypeDef HalfTransferCallback,
01395                                     Audio_CallbackTypeDef TransferCompleteCallback)
01396 {
01397   hAudioIn.CbError            = ErrorCallback;
01398   hAudioIn.CbHalfTransfer     = HalfTransferCallback;
01399   hAudioIn.CbTransferComplete = TransferCompleteCallback;
01400 }
01401 /**
01402   * @}
01403   */
01404
01405 /* private functions --------------------------------------------------------*/
01406 /** @addtogroup STM32L496G_DISCOVERY_AUDIO_Private_Functions
01407   * @{
01408   */
01409 /**
01410   * @brief  Initializes the Audio Codec audio interface (SAI).
01411   * @param  AudioFreq: Audio frequency to be configured for the SAI peripheral.
01412   * @retval BSP AUDIO status
01413   */
01414 static uint8_t AUDIO_SAIx_Init(uint32_t AudioFreq)
01415 {
01416   uint8_t TxData[2] = {0x00, 0x00};
01417
01418   /* Initialize the BSP_AUDIO_hSai_Xx instances parameter */
01419   BSP_AUDIO_hSai_Tx.Instance = SAI1_Block_A;
01420   BSP_AUDIO_hSai_Rx.Instance = SAI1_Block_B;
01421
01422   /* Disable SAI peripheral to allow access to SAI internal registers */
01423   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
01424   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Rx);
01425
01426   /*******************************/
01427   /* SAI block used for playback */
01428   /*******************************/
01429   /* Configure SAI_Block_x used for transmit
01430   LSBFirst: Disabled
01431   DataSize: 16 */
01432   BSP_AUDIO_hSai_Tx.Init.AudioMode      = SAI_MODEMASTER_TX;
01433   BSP_AUDIO_hSai_Tx.Init.Synchro        = SAI_ASYNCHRONOUS;
01434   BSP_AUDIO_hSai_Tx.Init.SynchroExt     = SAI_SYNCEXT_DISABLE;
01435   BSP_AUDIO_hSai_Tx.Init.OutputDrive    = SAI_OUTPUTDRIVE_ENABLE;
01436   BSP_AUDIO_hSai_Tx.Init.NoDivider      = SAI_MASTERDIVIDER_ENABLE;
01437   BSP_AUDIO_hSai_Tx.Init.FIFOThreshold  = SAI_FIFOTHRESHOLD_1QF;
01438   BSP_AUDIO_hSai_Tx.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_MCKDIV;
01439   BSP_AUDIO_hSai_Tx.Init.Mckdiv         = SAIClockDivider(AudioFreq);
01440   BSP_AUDIO_hSai_Tx.Init.MonoStereoMode = SAI_STEREOMODE;
01441   BSP_AUDIO_hSai_Tx.Init.CompandingMode = SAI_NOCOMPANDING;
01442   BSP_AUDIO_hSai_Tx.Init.TriState       = SAI_OUTPUT_NOTRELEASED;
01443   BSP_AUDIO_hSai_Tx.Init.Protocol       = SAI_FREE_PROTOCOL;
01444   BSP_AUDIO_hSai_Tx.Init.DataSize       = SAI_DATASIZE_16;
01445   BSP_AUDIO_hSai_Tx.Init.FirstBit       = SAI_FIRSTBIT_MSB;
01446   BSP_AUDIO_hSai_Tx.Init.ClockStrobing  = SAI_CLOCKSTROBING_FALLINGEDGE;
01447
01448   /* Configure SAI_Block_x Frame
01449   Frame Length: 32
01450   Frame active Length: 16
01451   FS Definition: Start frame + Channel Side identification
01452   FS Polarity: FS active Low
01453   FS Offset: FS asserted one bit before the first bit of slot 0 */
01454   BSP_AUDIO_hSai_Tx.FrameInit.FrameLength = 32;
01455   BSP_AUDIO_hSai_Tx.FrameInit.ActiveFrameLength = 16;
01456   BSP_AUDIO_hSai_Tx.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
01457   BSP_AUDIO_hSai_Tx.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
01458   BSP_AUDIO_hSai_Tx.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
01459
01460   /* Configure SAI Block_x Slot
01461   Slot First Bit Offset: 0
01462   Slot Size  : 16
01463   Slot Number: 2
01464   Slot Active: Slots 0 and 1 actives */
01465   BSP_AUDIO_hSai_Tx.SlotInit.FirstBitOffset = 0;
01466   BSP_AUDIO_hSai_Tx.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
01467   BSP_AUDIO_hSai_Tx.SlotInit.SlotNumber = 2;
01468   BSP_AUDIO_hSai_Tx.SlotInit.SlotActive = SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1;
01469
01470   /*****************************/
01471   /* SAI block used for record */
01472   /*****************************/
01473   /* Configure SAI_Block_x used for receive
01474   LSBFirst: Disabled
01475   DataSize: 16 */
01476   BSP_AUDIO_hSai_Rx.Init.AudioMode      = SAI_MODESLAVE_RX;
01477   BSP_AUDIO_hSai_Rx.Init.Synchro        = SAI_SYNCHRONOUS;
01478   BSP_AUDIO_hSai_Rx.Init.SynchroExt     = SAI_SYNCEXT_DISABLE;
01479   BSP_AUDIO_hSai_Rx.Init.OutputDrive    = SAI_OUTPUTDRIVE_ENABLE;
01480   BSP_AUDIO_hSai_Rx.Init.NoDivider      = SAI_MASTERDIVIDER_ENABLE;
01481   BSP_AUDIO_hSai_Rx.Init.FIFOThreshold  = SAI_FIFOTHRESHOLD_1QF;
01482   BSP_AUDIO_hSai_Rx.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_MCKDIV;
01483   BSP_AUDIO_hSai_Rx.Init.Mckdiv         = SAIClockDivider(AudioFreq);
01484   BSP_AUDIO_hSai_Rx.Init.MonoStereoMode = SAI_MONOMODE;
01485   BSP_AUDIO_hSai_Rx.Init.CompandingMode = SAI_NOCOMPANDING;
01486   BSP_AUDIO_hSai_Rx.Init.TriState       = SAI_OUTPUT_NOTRELEASED;
01487   BSP_AUDIO_hSai_Rx.Init.Protocol       = SAI_FREE_PROTOCOL;
01488   BSP_AUDIO_hSai_Rx.Init.DataSize       = SAI_DATASIZE_16;
01489   BSP_AUDIO_hSai_Rx.Init.FirstBit       = SAI_FIRSTBIT_MSB;
01490   BSP_AUDIO_hSai_Rx.Init.ClockStrobing  = SAI_CLOCKSTROBING_FALLINGEDGE;
01491
01492   /* Configure SAI_Block_x Frame
01493   Frame Length: 32
01494   Frame active Length: 16
01495   FS Definition: Start frame + Channel Side identification
01496   FS Polarity: FS active Low
01497   FS Offset: FS asserted one bit before the first bit of slot 0 */
01498   BSP_AUDIO_hSai_Rx.FrameInit.FrameLength = 32;
01499   BSP_AUDIO_hSai_Rx.FrameInit.ActiveFrameLength = 16;
01500   BSP_AUDIO_hSai_Rx.FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION;
01501   BSP_AUDIO_hSai_Rx.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
01502   BSP_AUDIO_hSai_Rx.FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT;
01503
01504   /* Configure SAI Block_x Slot
01505   Slot First Bit Offset: 0
01506   Slot Size  : 16
01507   Slot Number: 2
01508   Slot Active: Slots 0 and 1 actives */
01509   BSP_AUDIO_hSai_Rx.SlotInit.FirstBitOffset = 0;
01510   BSP_AUDIO_hSai_Rx.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE;
01511   BSP_AUDIO_hSai_Rx.SlotInit.SlotNumber = 2;
01512   BSP_AUDIO_hSai_Rx.SlotInit.SlotActive = SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1;
01513
01514   /*********************************/
01515   /* Initializes the SAI peripheral*/
01516   /*********************************/
01517   if (HAL_SAI_Init(&BSP_AUDIO_hSai_Tx) != HAL_OK)
01518   {
01519     return AUDIO_ERROR;
01520   }
01521   if (HAL_SAI_Init(&BSP_AUDIO_hSai_Rx) != HAL_OK)
01522   {
01523     return AUDIO_ERROR;
01524   }
01525
01526   /******************************************/
01527   /* Enable SAI peripheral to generate MCLK */
01528   /******************************************/
01529   __HAL_SAI_ENABLE(&BSP_AUDIO_hSai_Tx);
01530   /* Transmit one byte to start FS generation */
01531   if (HAL_SAI_Transmit(&BSP_AUDIO_hSai_Tx, TxData, 2, 1000) != HAL_OK)
01532   {
01533     return AUDIO_ERROR;
01534   }
01535
01536   return AUDIO_OK;
01537 }
01538
01539 /**
01540   * @brief  De-initializes the Audio Codec audio interface (SAI).
01541   * @retval BSP AUDIO status
01542   */
01543 static uint8_t AUDIO_SAIx_DeInit(void)
01544 {
01545   /* Disable the SAI audio block */
01546   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Tx);
01547   __HAL_SAI_DISABLE(&BSP_AUDIO_hSai_Rx);
01548
01549   /* De-initializes the SAI peripheral */
01550   if (HAL_SAI_DeInit(&BSP_AUDIO_hSai_Tx) != HAL_OK)
01551   {
01552     return AUDIO_ERROR;
01553   }
01554   if (HAL_SAI_DeInit(&BSP_AUDIO_hSai_Rx) != HAL_OK)
01555   {
01556     return AUDIO_ERROR;
01557   }
01558
01559   return AUDIO_OK;
01560 }
01561
01562 /**
01563   * @brief  SAI MSP Init
01564   * @param  hsai : pointer to a SAI_HandleTypeDef structure
01565   * @retval None
01566   */
01567 void HAL_SAI_MspInit(SAI_HandleTypeDef *hsai)
01568 {
01569   GPIO_InitTypeDef  GPIO_InitStruct;
01570
01571   /* Enable SAI clock */
01572   __HAL_RCC_SAI1_CLK_ENABLE();
01573
01574   if (hsai->Instance == SAI1_Block_A)
01575   {
01576     /* SAI pins configuration: FS, SCK, MCLK and SD pins */
01577     __HAL_RCC_GPIOB_CLK_ENABLE();
01578     __HAL_RCC_GPIOE_CLK_ENABLE();
01579     GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
01580     GPIO_InitStruct.Pull      = GPIO_NOPULL;
01581     GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01582     GPIO_InitStruct.Alternate = GPIO_AF13_SAI1;
01583     GPIO_InitStruct.Pin       = GPIO_PIN_2;
01584     HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* SAI1_MCLK_A */
01585     GPIO_InitStruct.Pin       = GPIO_PIN_4;
01586     HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* SAI1_FS_A */
01587     GPIO_InitStruct.Pin       = GPIO_PIN_10;
01588     HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /* SAI1_SCK_A */
01589     GPIO_InitStruct.Pin       = GPIO_PIN_6;
01590     HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* SAI1_SD_A */
01591
01592     /* Configure the hDmaSaiTx handle parameters */
01593     __HAL_RCC_DMA2_CLK_ENABLE();
01594     hDmaSaiTx.Init.Request             = DMA_REQUEST_1;
01595     hDmaSaiTx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
01596     hDmaSaiTx.Init.PeriphInc           = DMA_PINC_DISABLE;
01597     hDmaSaiTx.Init.MemInc              = DMA_MINC_ENABLE;
01598     hDmaSaiTx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
01599     hDmaSaiTx.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
01600     hDmaSaiTx.Init.Mode                = DMA_CIRCULAR;
01601     hDmaSaiTx.Init.Priority            = DMA_PRIORITY_HIGH;
01602     hDmaSaiTx.Instance                 = DMA2_Channel1;
01603     /* Associate the DMA handle */
01604     __HAL_LINKDMA(hsai, hdmatx, hDmaSaiTx);
01605     /* Deinitialize the Stream for new transfer */
01606     HAL_DMA_DeInit(&hDmaSaiTx);
01607     /* Configure the DMA Stream */
01608     HAL_DMA_Init(&hDmaSaiTx);
01609     /* SAI DMA IRQ Channel configuration */
01610     HAL_NVIC_SetPriority(DMA2_Channel1_IRQn, 5, 0);
01611     HAL_NVIC_EnableIRQ(DMA2_Channel1_IRQn);
01612   }
01613   else /* SAI1_BlockB */
01614   {
01615     /* SAI pins configuration: SD pin */
01616     __HAL_RCC_GPIOE_CLK_ENABLE();
01617     GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
01618     GPIO_InitStruct.Pull      = GPIO_NOPULL;
01619     GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01620     GPIO_InitStruct.Alternate = GPIO_AF13_SAI1;
01621     GPIO_InitStruct.Pin       = GPIO_PIN_3;
01622     HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* SAI1_SD_B */
01623
01624     /* Configure the hDmaSaiRx handle parameters */
01625     __HAL_RCC_DMA2_CLK_ENABLE();
01626     hDmaSaiRx.Init.Request             = DMA_REQUEST_1;
01627     hDmaSaiRx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01628     hDmaSaiRx.Init.PeriphInc           = DMA_PINC_DISABLE;
01629     hDmaSaiRx.Init.MemInc              = DMA_MINC_ENABLE;
01630     hDmaSaiRx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
01631     hDmaSaiRx.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
01632     hDmaSaiRx.Init.Mode                = DMA_CIRCULAR;
01633     hDmaSaiRx.Init.Priority            = DMA_PRIORITY_HIGH;
01634     hDmaSaiRx.Instance                 = DMA2_Channel2;
01635     /* Associate the DMA handle */
01636     __HAL_LINKDMA(hsai, hdmarx, hDmaSaiRx);
01637     /* Deinitialize the Stream for new transfer */
01638     HAL_DMA_DeInit(&hDmaSaiRx);
01639     /* Configure the DMA Stream */
01640     HAL_DMA_Init(&hDmaSaiRx);
01641     /* SAI DMA IRQ Channel configuration */
01642     HAL_NVIC_SetPriority(DMA2_Channel2_IRQn, 5, 0);
01643     HAL_NVIC_EnableIRQ(DMA2_Channel2_IRQn);
01644   }
01645 }
01646
01647 /**
01648   * @brief  SAI MSP De-init
01649   * @param  hsai : pointer to a SAI_HandleTypeDef structure
01650   * @retval None
01651   */
01652 void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai)
01653 {
01654   if (hsai->Instance == SAI1_Block_A)
01655   {
01656     /* Disable SAI DMA Channel IRQ  */
01657     HAL_NVIC_DisableIRQ(DMA2_Channel1_IRQn);
01658
01659     /* Reset the DMA Stream configuration*/
01660     HAL_DMA_DeInit(&hDmaSaiTx);
01661
01662     /* De-initialize FS, SCK, MCK and SD pins*/
01663     HAL_GPIO_DeInit(GPIOE, GPIO_PIN_2);  /* SAI1_MCLK_A */
01664     HAL_GPIO_DeInit(GPIOE, GPIO_PIN_4);  /* SAI1_FS_A */
01665     HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10); /* SAI1_SCK_A */
01666     HAL_GPIO_DeInit(GPIOE, GPIO_PIN_6);  /* SAI1_SD_A */
01667
01668     /* Don't disable SAI clock used for other SAI block */
01669     /*__HAL_RCC_SAI1_CLK_DISABLE(); */
01670   }
01671   else /* SAI1_BlockB */
01672   {
01673     /* Disable SAI DMA Channel IRQ  */
01674     HAL_NVIC_DisableIRQ(DMA2_Channel2_IRQn);
01675
01676     /* Reset the DMA Stream configuration*/
01677     HAL_DMA_DeInit(&hDmaSaiRx);
01678
01679     /* De-initialize SD pin */
01680     HAL_GPIO_DeInit(GPIOE, GPIO_PIN_3);  /* SAI1_SD_B */
01681
01682     /* Disable SAI clock */
01683     __HAL_RCC_SAI1_CLK_DISABLE();
01684   }
01685 }
01686
01687 /**
01688   * @}
01689   */
01690
01691 /** @addtogroup STM32L496G_DISCOVERY_AUDIO_Private_Functions
01692   * @{
01693   */
01694
01695 /**
01696   * @brief  Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
01697   * @param  AudioFreq: Audio frequency to be used to set correctly the DFSDM peripheral.
01698   * @retval BSP AUDIO status
01699   */
01700 static uint8_t AUDIO_DFSDMx_Init(uint32_t AudioFreq)
01701 {
01702   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01703   {
01704     /*####CHANNEL 3####*/
01705     hAudioIn.hDfsdmLeftChannel.Init.OutputClock.Activation   = ENABLE;
01706     hAudioIn.hDfsdmLeftChannel.Init.OutputClock.Selection    = DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO;
01707     /* Set the DFSDM clock OUT audio frequency configuration */
01708     hAudioIn.hDfsdmLeftChannel.Init.OutputClock.Divider      = DFSDMClockDivider(AudioFreq);
01709     hAudioIn.hDfsdmLeftChannel.Init.Input.Multiplexer        = DFSDM_CHANNEL_EXTERNAL_INPUTS;
01710     hAudioIn.hDfsdmLeftChannel.Init.Input.DataPacking        = DFSDM_CHANNEL_STANDARD_MODE;
01711     hAudioIn.hDfsdmLeftChannel.Init.Input.Pins               = DFSDM_CHANNEL_SAME_CHANNEL_PINS;
01712     /* Request to sample stable data for LEFT micro on Rising edge */
01713     hAudioIn.hDfsdmLeftChannel.Init.SerialInterface.Type     = DFSDM_CHANNEL_SPI_RISING;
01714     hAudioIn.hDfsdmLeftChannel.Init.SerialInterface.SpiClock = DFSDM_CHANNEL_SPI_CLOCK_INTERNAL;
01715     hAudioIn.hDfsdmLeftChannel.Init.Awd.FilterOrder          = DFSDM_CHANNEL_SINC1_ORDER;
01716     hAudioIn.hDfsdmLeftChannel.Init.Awd.Oversampling         = 10;
01717     hAudioIn.hDfsdmLeftChannel.Init.Offset                   = 0;
01718     hAudioIn.hDfsdmLeftChannel.Init.RightBitShift            = DFSDMRightBitShift(AudioFreq);
01719     hAudioIn.hDfsdmLeftChannel.Instance                      = DFSDM1_Channel3;
01720
01721     /* Init the DFSDM Channel */
01722     if (HAL_DFSDM_ChannelInit(&hAudioIn.hDfsdmLeftChannel) != HAL_OK)
01723     {
01724       return AUDIO_ERROR;
01725     }
01726   }
01727
01728   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01729   {
01730     /*####CHANNEL 2####*/
01731     hAudioIn.hDfsdmRightChannel.Init.OutputClock.Activation   = ENABLE;
01732     hAudioIn.hDfsdmRightChannel.Init.OutputClock.Selection    = DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO;
01733     /* Set the DFSDM clock OUT audio frequency configuration */
01734     hAudioIn.hDfsdmRightChannel.Init.OutputClock.Divider      = DFSDMClockDivider(AudioFreq);
01735     hAudioIn.hDfsdmRightChannel.Init.Input.Multiplexer        = DFSDM_CHANNEL_EXTERNAL_INPUTS;
01736     hAudioIn.hDfsdmRightChannel.Init.Input.DataPacking        = DFSDM_CHANNEL_STANDARD_MODE;
01737     hAudioIn.hDfsdmRightChannel.Init.Input.Pins               = DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS;
01738     /* Request to sample stable data for LEFT micro on Rising edge */
01739     hAudioIn.hDfsdmRightChannel.Init.SerialInterface.Type     = DFSDM_CHANNEL_SPI_FALLING;
01740     hAudioIn.hDfsdmRightChannel.Init.SerialInterface.SpiClock = DFSDM_CHANNEL_SPI_CLOCK_INTERNAL;
01741     hAudioIn.hDfsdmRightChannel.Init.Awd.FilterOrder          = DFSDM_CHANNEL_SINC1_ORDER;
01742     hAudioIn.hDfsdmRightChannel.Init.Awd.Oversampling         = 10;
01743     hAudioIn.hDfsdmRightChannel.Init.Offset                   = 0;
01744     hAudioIn.hDfsdmRightChannel.Init.RightBitShift            = DFSDMRightBitShift(AudioFreq);
01745     hAudioIn.hDfsdmRightChannel.Instance                      = DFSDM1_Channel2;
01746
01747     /* Init the DFSDM Channel */
01748     if (HAL_DFSDM_ChannelInit(&hAudioIn.hDfsdmRightChannel) != HAL_OK)
01749     {
01750       return AUDIO_ERROR;
01751     }
01752   }
01753
01754   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01755   {
01756     /*####FILTER 0####*/
01757     BSP_AUDIO_hDfsdmLeftFilter.Init.RegularParam.Trigger         = DFSDM_FILTER_SW_TRIGGER;
01758     BSP_AUDIO_hDfsdmLeftFilter.Init.RegularParam.FastMode        = ENABLE;
01759     BSP_AUDIO_hDfsdmLeftFilter.Init.RegularParam.DmaMode         = ENABLE;
01760     BSP_AUDIO_hDfsdmLeftFilter.Init.InjectedParam.Trigger        = DFSDM_FILTER_SW_TRIGGER;
01761     BSP_AUDIO_hDfsdmLeftFilter.Init.InjectedParam.ScanMode       = DISABLE;
01762     BSP_AUDIO_hDfsdmLeftFilter.Init.InjectedParam.DmaMode        = DISABLE;
01763     BSP_AUDIO_hDfsdmLeftFilter.Init.InjectedParam.ExtTrigger     = DFSDM_FILTER_EXT_TRIG_TIM8_TRGO;
01764     BSP_AUDIO_hDfsdmLeftFilter.Init.InjectedParam.ExtTriggerEdge = DFSDM_FILTER_EXT_TRIG_BOTH_EDGES;
01765     BSP_AUDIO_hDfsdmLeftFilter.Init.FilterParam.SincOrder        = DFSDMFilterOrder(AudioFreq);
01766     /* Set the DFSDM Filters Oversampling to have correct sample rate */
01767     BSP_AUDIO_hDfsdmLeftFilter.Init.FilterParam.Oversampling     = DFSDMOverSampling(AudioFreq);
01768     BSP_AUDIO_hDfsdmLeftFilter.Init.FilterParam.IntOversampling  = 1;
01769     BSP_AUDIO_hDfsdmLeftFilter.Instance                          = DFSDM1_Filter0;
01770
01771     /* Init the DFSDM Filter */
01772     if (HAL_DFSDM_FilterInit(&BSP_AUDIO_hDfsdmLeftFilter) != HAL_OK)
01773     {
01774       return AUDIO_ERROR;
01775     }
01776
01777     /* Configure regular channel */
01778     if (HAL_DFSDM_FilterConfigRegChannel(&BSP_AUDIO_hDfsdmLeftFilter,
01779                                          DFSDM_CHANNEL_3,
01780                                          DFSDM_CONTINUOUS_CONV_ON) != HAL_OK)
01781     {
01782       return AUDIO_ERROR;
01783     }
01784   }
01785
01786   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01787   {
01788     /*####FILTER 1####*/
01789     if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)
01790     {
01791       BSP_AUDIO_hDfsdmRightFilter.Init.RegularParam.Trigger       = DFSDM_FILTER_SW_TRIGGER;
01792     }
01793     else
01794     {
01795       BSP_AUDIO_hDfsdmRightFilter.Init.RegularParam.Trigger       = DFSDM_FILTER_SYNC_TRIGGER;
01796     }
01797     BSP_AUDIO_hDfsdmRightFilter.Init.RegularParam.FastMode        = ENABLE;
01798     BSP_AUDIO_hDfsdmRightFilter.Init.RegularParam.DmaMode         = ENABLE;
01799     BSP_AUDIO_hDfsdmRightFilter.Init.InjectedParam.Trigger        = DFSDM_FILTER_SW_TRIGGER;
01800     BSP_AUDIO_hDfsdmRightFilter.Init.InjectedParam.ScanMode       = DISABLE;
01801     BSP_AUDIO_hDfsdmRightFilter.Init.InjectedParam.DmaMode        = DISABLE;
01802     BSP_AUDIO_hDfsdmRightFilter.Init.InjectedParam.ExtTrigger     = DFSDM_FILTER_EXT_TRIG_TIM8_TRGO;
01803     BSP_AUDIO_hDfsdmRightFilter.Init.InjectedParam.ExtTriggerEdge = DFSDM_FILTER_EXT_TRIG_BOTH_EDGES;
01804     BSP_AUDIO_hDfsdmRightFilter.Init.FilterParam.SincOrder        = DFSDMFilterOrder(AudioFreq);
01805     /* Set the DFSDM Filters Oversampling to have correct sample rate */
01806     BSP_AUDIO_hDfsdmRightFilter.Init.FilterParam.Oversampling     = DFSDMOverSampling(AudioFreq);
01807     BSP_AUDIO_hDfsdmRightFilter.Init.FilterParam.IntOversampling  = 1;
01808     BSP_AUDIO_hDfsdmRightFilter.Instance                          = DFSDM1_Filter1;
01809
01810     /* Init the DFSDM Filter */
01811     if (HAL_DFSDM_FilterInit(&BSP_AUDIO_hDfsdmRightFilter) != HAL_OK)
01812     {
01813       return AUDIO_ERROR;
01814     }
01815
01816     /* Configure regular channel */
01817     if (HAL_DFSDM_FilterConfigRegChannel(&BSP_AUDIO_hDfsdmRightFilter,
01818                                          DFSDM_CHANNEL_2,
01819                                          DFSDM_CONTINUOUS_CONV_ON) != HAL_OK)
01820     {
01821       return AUDIO_ERROR;
01822     }
01823   }
01824
01825   return AUDIO_OK;
01826 }
01827
01828 /**
01829   * @brief  De-initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
01830   * @retval BSP AUDIO status
01831   */
01832 static uint8_t AUDIO_DFSDMx_DeInit(void)
01833 {
01834   /* De-initializes the DFSDM filters to allow access to DFSDM internal registers */
01835   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01836   {
01837     if (HAL_DFSDM_FilterDeInit(&BSP_AUDIO_hDfsdmRightFilter) != HAL_OK)
01838     {
01839       return AUDIO_ERROR;
01840     }
01841   }
01842   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01843   {
01844     if (HAL_DFSDM_FilterDeInit(&BSP_AUDIO_hDfsdmLeftFilter) != HAL_OK)
01845     {
01846       return AUDIO_ERROR;
01847     }
01848   }
01849
01850   /* De-initializes the DFSDM channels to allow access to DFSDM internal registers */
01851   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC2) == INPUT_DEVICE_DIGITAL_MIC2)
01852   {
01853     if (HAL_DFSDM_ChannelDeInit(&hAudioIn.hDfsdmRightChannel) != HAL_OK)
01854     {
01855       return AUDIO_ERROR;
01856     }
01857   }
01858   if ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) == INPUT_DEVICE_DIGITAL_MIC1)
01859   {
01860     if (HAL_DFSDM_ChannelDeInit(&hAudioIn.hDfsdmLeftChannel) != HAL_OK)
01861     {
01862       return AUDIO_ERROR;
01863     }
01864   }
01865
01866   /* DFSDM reset */
01867   __HAL_RCC_DFSDM1_FORCE_RESET();
01868   __HAL_RCC_DFSDM1_RELEASE_RESET();
01869
01870   return AUDIO_OK;
01871 }
01872
01873 /**
01874   * @brief  Initializes the DFSDM channel MSP.
01875   * @param  hdfsdm_channel : DFSDM channel handle.
01876   * @retval None
01877   */
01878 void HAL_DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
01879 {
01880   if (((hdfsdm_channel->Instance == DFSDM1_Channel3) && ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) != 0)) || \
01881       ((hdfsdm_channel->Instance == DFSDM1_Channel2) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)))
01882   {
01883     GPIO_InitTypeDef  GPIO_InitStruct;
01884
01885     /* Enable DFSDM clock */
01886     __HAL_RCC_DFSDM1_CLK_ENABLE();
01887
01888     /* DFSDM pins configuration: DFSDM1_CKOUT, DFSDM1_DATIN3 pins */
01889     __HAL_RCC_GPIOC_CLK_ENABLE();
01890     GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
01891     GPIO_InitStruct.Pull      = GPIO_NOPULL;
01892     GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01893     GPIO_InitStruct.Alternate = GPIO_AF6_DFSDM1;
01894     GPIO_InitStruct.Pin       = GPIO_PIN_2;
01895     HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* DFSDM1_CKOUT */
01896     GPIO_InitStruct.Pin       = GPIO_PIN_7;
01897     HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* DFSDM1_DATIN3 */
01898
01899     /* Enable MIC_VDD (PH1) */
01900     __HAL_RCC_GPIOH_CLK_ENABLE();
01901     GPIO_InitStruct.Mode      = GPIO_MODE_OUTPUT_PP;
01902     GPIO_InitStruct.Pull      = GPIO_NOPULL;
01903     GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
01904     GPIO_InitStruct.Pin       = GPIO_PIN_1;
01905     HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
01906     HAL_GPIO_WritePin(GPIOH, GPIO_PIN_1, GPIO_PIN_SET);
01907   }
01908 }
01909
01910 /**
01911   * @brief  De-initializes the DFSDM channel MSP.
01912   * @param  hdfsdm_channel : DFSDM channel handle.
01913   * @retval None
01914   */
01915 void HAL_DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
01916 {
01917   if (((hdfsdm_channel->Instance == DFSDM1_Channel3) && ((hAudioIn.InputDevice & INPUT_DEVICE_DIGITAL_MIC1) != 0)) || \
01918       ((hdfsdm_channel->Instance == DFSDM1_Channel2) && (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)))
01919   {
01920     /* Disable MIC_VDD (PH1) */
01921     HAL_GPIO_WritePin(GPIOH, GPIO_PIN_1, GPIO_PIN_RESET);
01922     HAL_GPIO_DeInit(GPIOH, GPIO_PIN_1);
01923
01924     /* De-initialize DFSDM1_CKOUT, DFSDM1_DATIN3 pins */
01925     HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2);  /* DFSDM1_CKOUT */
01926     HAL_GPIO_DeInit(GPIOC, GPIO_PIN_7);  /* DFSDM1_DATIN3 */
01927
01928     /* Disable DFSDM1 */
01929     __HAL_RCC_DFSDM1_CLK_DISABLE();
01930   }
01931 }
01932
01933 /**
01934   * @brief  Initializes the DFSDM filter MSP.
01935   * @param  hdfsdm_filter : DFSDM filter handle.
01936   * @retval None
01937   */
01938 void HAL_DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
01939 {
01940   if (hdfsdm_filter->Instance == DFSDM1_Filter0)
01941   {
01942     /* Enable the DMA clock */
01943     __HAL_RCC_DMA1_CLK_ENABLE();
01944
01945     /* Configure the hAudioIn.hDmaDfsdmLeft handle parameters */
01946     hAudioIn.hDmaDfsdmLeft.Init.Request             = DMA_REQUEST_0;
01947     hAudioIn.hDmaDfsdmLeft.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01948     hAudioIn.hDmaDfsdmLeft.Init.PeriphInc           = DMA_PINC_DISABLE;
01949     hAudioIn.hDmaDfsdmLeft.Init.MemInc              = DMA_MINC_ENABLE;
01950     hAudioIn.hDmaDfsdmLeft.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
01951     hAudioIn.hDmaDfsdmLeft.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
01952     hAudioIn.hDmaDfsdmLeft.Init.Mode                = DMA_CIRCULAR;
01953     hAudioIn.hDmaDfsdmLeft.Init.Priority            = DMA_PRIORITY_HIGH;
01954     hAudioIn.hDmaDfsdmLeft.Instance                 = DMA1_Channel4;
01955
01956     /* Associate the DMA handle */
01957     __HAL_LINKDMA(hdfsdm_filter, hdmaReg, hAudioIn.hDmaDfsdmLeft);
01958
01959     /* Reset DMA handle state */
01960     __HAL_DMA_RESET_HANDLE_STATE(&hAudioIn.hDmaDfsdmLeft);
01961
01962     /* Configure the DMA Channel */
01963     HAL_DMA_Init(&hAudioIn.hDmaDfsdmLeft);
01964
01965     /* DMA IRQ Channel configuration */
01966     HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 5, 0);
01967     HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
01968   }
01969   else /* DFSDM1_Filter1 */
01970   {
01971     if (hAudioIn.InputDevice == INPUT_DEVICE_DIGITAL_MIC2)
01972     {
01973       /* Enable the DMA clock needed if only MIC2 is used */
01974       __HAL_RCC_DMA1_CLK_ENABLE();
01975     }
01976
01977     /* Configure the hAudioIn.hDmaDfsdmRight handle parameters */
01978     hAudioIn.hDmaDfsdmRight.Init.Request             = DMA_REQUEST_0;
01979     hAudioIn.hDmaDfsdmRight.Init.Direction           = DMA_PERIPH_TO_MEMORY;
01980     hAudioIn.hDmaDfsdmRight.Init.PeriphInc           = DMA_PINC_DISABLE;
01981     hAudioIn.hDmaDfsdmRight.Init.MemInc              = DMA_MINC_ENABLE;
01982     hAudioIn.hDmaDfsdmRight.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
01983     hAudioIn.hDmaDfsdmRight.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
01984     hAudioIn.hDmaDfsdmRight.Init.Mode                = DMA_CIRCULAR;
01985     hAudioIn.hDmaDfsdmRight.Init.Priority            = DMA_PRIORITY_HIGH;
01986     hAudioIn.hDmaDfsdmRight.Instance                 = DMA1_Channel5;
01987
01988     /* Associate the DMA handle */
01989     __HAL_LINKDMA(hdfsdm_filter, hdmaReg, hAudioIn.hDmaDfsdmRight);
01990
01991     /* Reset DMA handle state */
01992     __HAL_DMA_RESET_HANDLE_STATE(&hAudioIn.hDmaDfsdmRight);
01993
01994     /* Configure the DMA Channel */
01995     HAL_DMA_Init(&hAudioIn.hDmaDfsdmRight);
01996
01997     /* DMA IRQ Channel configuration */
01998     HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 5, 0);
01999     HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
02000   }
02001 }
02002
02003 /**
02004  * @brief  De-initializes the DFSDM filter MSP.
02005  * @param  hdfsdm_filter : DFSDM filter handle.
02006  * @retval None
02007  */
02008 void HAL_DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
02009 {
02010   if (hdfsdm_filter->Instance == DFSDM1_Filter0)
02011   {
02012     /* Disable DMA  Channel IRQ */
02013     HAL_NVIC_DisableIRQ(DMA1_Channel4_IRQn);
02014
02015     /* De-initialize the DMA Channel */
02016     HAL_DMA_DeInit(&hAudioIn.hDmaDfsdmLeft);
02017   }
02018   else /* DFSDM1_Filter1 */
02019   {
02020     /* Disable DMA  Channel IRQ */
02021     HAL_NVIC_DisableIRQ(DMA1_Channel5_IRQn);
02022
02023     /* De-initialize the DMA Channel */
02024     HAL_DMA_DeInit(&hAudioIn.hDmaDfsdmRight);
02025   }
02026 }
02027
02028 /**
02029   * @brief  Configures the SAI PLL clock according to the required audio frequency.
02030   * @param  Frequency: Audio frequency.
02031   * @retval BSP AUDIO status
02032   * @note   The SAI PLL input clock must be configured in the user application.
02033   *         The SAI PLL configuration done within this function assumes that
02034   *         the SAI PLL input clock runs at 8 MHz.
02035   */
02036 static uint8_t AUDIO_SAIPLLConfig(uint32_t Frequency)
02037 {
02038   RCC_PeriphCLKInitTypeDef RCC_ExCLKInitStruct;
02039
02040   /* Retrieve actual RCC configuration */
02041   HAL_RCCEx_GetPeriphCLKConfig(&RCC_ExCLKInitStruct);
02042
02043   if ((Frequency == AUDIO_FREQUENCY_11K)
02044       || (Frequency == AUDIO_FREQUENCY_22K)
02045       || (Frequency == AUDIO_FREQUENCY_44K))
02046   {
02047     /* Configure PLLSAI prescalers */
02048     /* SAI clock config
02049     PLLSAI2_VCO= 8 Mhz * PLLSAI1N = 8 * 24 = VCO_192M
02050     SAI_CK_x = PLLSAI2_VCO/PLLSAI1P = 192/17 = 11.294 Mhz */
02051     RCC_ExCLKInitStruct.PeriphClockSelection    = RCC_PERIPHCLK_SAI1;
02052     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2N        = 24;
02053     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2P        = 17;
02054     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2ClockOut = RCC_PLLSAI2_SAI2CLK;
02055     RCC_ExCLKInitStruct.Sai1ClockSelection      = RCC_SAI1CLKSOURCE_PLLSAI2;
02056   }
02057   else /* AUDIO_FREQUENCY_8K, AUDIO_FREQUENCY_16K, AUDIO_FREQUENCY_48K, AUDIO_FREQUENCY_96K */
02058   {
02059     /* SAI clock config
02060     PLLSAI2_VCO= 8 Mhz * PLLSAI1N = 8 * 43 = VCO_344M
02061     SAI_CK_x = PLLSAI1_VCO/PLLSAI2P = 344/7 = 49.142 Mhz */
02062     RCC_ExCLKInitStruct.PeriphClockSelection    = RCC_PERIPHCLK_SAI1;
02063     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2N        = 43;
02064     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2P        = 7;
02065     RCC_ExCLKInitStruct.PLLSAI2.PLLSAI2ClockOut = RCC_PLLSAI2_SAI2CLK;
02066     RCC_ExCLKInitStruct.Sai1ClockSelection      = RCC_SAI1CLKSOURCE_PLLSAI2;
02067   }
02068
02069   if (HAL_RCCEx_PeriphCLKConfig(&RCC_ExCLKInitStruct) != HAL_OK)
02070   {
02071     return AUDIO_ERROR;
02072   }
02073
02074   return AUDIO_OK;
02075 }
02076
02077 /**
02078   * @}
02079   */
02080
02081 /**
02082   * @}
02083   */
02084
02085 /**
02086   * @}
02087   */
02088
02089 /**
02090   * @}
02091   */
02092
02093 /**
02094   * @}
02095   */
02096
02097 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_audio.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_audio.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_audio.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_audio.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_AUDIO_H
00023 #define __STM32L496G_DISCOVERY_AUDIO_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #if defined(BSP_AUDIO_USE_RTOS)
00031 #include "k_mem.h"
00032 #else
00033 #include <stdlib.h>
00034 #endif
00035 /* Include audio component Driver */
00036 #include "../Components/cs42l51/cs42l51.h"
00037 #include "stm32l496g_discovery.h"
00038
00039 /** @addtogroup BSP
00040   * @{
00041   */
00042
00043 /** @addtogroup STM32L496G_DISCOVERY
00044   * @{
00045   */
00046
00047 /** @addtogroup STM32L496G_DISCOVERY_AUDIO
00048   * @{
00049   */
00050
00051 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Types Exported Types
00052   * @{
00053   */
00054 typedef void (*Audio_CallbackTypeDef)(void);
00055
00056 /**
00057   * @}
00058   */
00059
00060 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Constants Exported Constants
00061   * @{
00062   */
00063 /** @defgroup BSP_Audio_Out_Option BSP Audio Out Option
00064   * @{
00065   */
00066 #define BSP_AUDIO_OUT_CIRCULARMODE      ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */
00067 #define BSP_AUDIO_OUT_NORMALMODE        ((uint32_t)0x00000002) /* BUFFER NORMAL MODE   */
00068 #define BSP_AUDIO_OUT_STEREOMODE        ((uint32_t)0x00000004) /* STEREO MODE          */
00069 #define BSP_AUDIO_OUT_MONOMODE          ((uint32_t)0x00000008) /* MONO MODE            */
00070 /**
00071   * @}
00072   */
00073
00074 /** @defgroup BSP_Audio_Sample_Rate BSP Audio Sample Rate
00075   * @{
00076   */
00077 #define BSP_AUDIO_FREQUENCY_96K         SAI_AUDIO_FREQUENCY_96K
00078 #define BSP_AUDIO_FREQUENCY_48K         SAI_AUDIO_FREQUENCY_48K
00079 #define BSP_AUDIO_FREQUENCY_44K         SAI_AUDIO_FREQUENCY_44K
00080 #define BSP_AUDIO_FREQUENCY_32K         SAI_AUDIO_FREQUENCY_32K
00081 #define BSP_AUDIO_FREQUENCY_22K         SAI_AUDIO_FREQUENCY_22K
00082 #define BSP_AUDIO_FREQUENCY_16K         SAI_AUDIO_FREQUENCY_16K
00083 #define BSP_AUDIO_FREQUENCY_11K         SAI_AUDIO_FREQUENCY_11K
00084 #define BSP_AUDIO_FREQUENCY_8K          SAI_AUDIO_FREQUENCY_8K
00085 /**
00086   * @}
00087   */
00088 /*------------------------------------------------------------------------------
00089                           USER SAI defines parameters
00090  -----------------------------------------------------------------------------*/
00091 /* SAI peripheral configuration defines */
00092 #define AUDIO_SAIx_TX_CLK_ENABLE()             __HAL_RCC_SAI1_CLK_ENABLE()
00093 #define AUDIO_SAIx_TX_CLK_DISABLE()            __HAL_RCC_SAI1_CLK_DISABLE()
00094 #define AUDIO_SAIx_TX_MCK_SCK_SD_FS_AF         GPIO_AF13_SAI1
00095
00096 #define AUDIO_SAIx_TX_MCK_SCK_SD_FS_ENABLE()   __HAL_RCC_GPIOE_CLK_ENABLE()
00097 #define AUDIO_SAIx_TX_MCK_SCK_SD_FS_DISABLE()  __HAL_RCC_GPIOE_CLK_DISABLE()
00098 #define AUDIO_SAIx_TX_FS_PIN                   GPIO_PIN_4
00099 #define AUDIO_SAIx_TX_SCK_PIN                  GPIO_PIN_5
00100 #define AUDIO_SAIx_TX_SD_PIN                   GPIO_PIN_6
00101 #define AUDIO_SAIx_TX_MCK_PIN                  GPIO_PIN_2
00102 #define AUDIO_SAIx_TX_MCK_SCK_SD_FS_GPIO_PORT  GPIOE
00103
00104 /* SAI DMA Channel definitions */
00105 #define AUDIO_SAIx_DMAx_CLK_ENABLE()         __HAL_RCC_DMA2_CLK_ENABLE()
00106 #define AUDIO_SAIx_DMAx_CLK_DISABLE()        __HAL_RCC_DMA2_CLK_DISABLE()
00107 #define AUDIO_SAIx_DMAx_CHANNEL              DMA2_Channel1
00108 #define AUDIO_SAIx_DMAx_IRQ                  DMA2_Channel1_IRQn
00109 #define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE     DMA_PDATAALIGN_HALFWORD
00110 #define AUDIO_SAIx_DMAx_MEM_DATA_SIZE        DMA_MDATAALIGN_HALFWORD
00111 #define DMA_MAX_SZE                          (uint32_t)0xFFFF
00112
00113 #define AUDIO_SAIx_DMAx_IRQHandler           DMA2_Channel1_IRQHandler
00114
00115 /* Select the interrupt preemption priority for the DMA interrupt */
00116 #define AUDIO_OUT_IRQ_PREPRIO           5   /* Select the preemption priority level(0 is the highest) */
00117
00118 /* Disable SAIx PLL */
00119 #define AUDIO_SAIx_PLL_DISABLE()             HAL_RCCEx_DisablePLLSAI2()
00120
00121 /*------------------------------------------------------------------------------
00122                         AUDIO IN CONFIGURATION
00123 ------------------------------------------------------------------------------*/
00124 /* DFSDM Configuration defines */
00125 #define AUDIO_DFSDMx_LEFT_CHANNEL                       DFSDM1_Channel2
00126 #define AUDIO_DFSDMx_LEFT_FILTER                        DFSDM1_Filter0
00127 #define AUDIO_DFSDMx_CLK_ENABLE()                       __HAL_RCC_DFSDM1_CLK_ENABLE()
00128 #define AUDIO_DFSDMx_CLK_DISABLE()                      __HAL_RCC_DFSDM1_CLK_DISABLE()
00129 #define AUDIO_DFSDMx_CKOUT_PIN                          GPIO_PIN_9
00130 #define AUDIO_DFSDMx_DMIC_DATIN_PIN                     GPIO_PIN_7
00131 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT         GPIOE
00132 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
00133 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
00134 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF                GPIO_AF6_DFSDM1
00135
00136 /* DFSDM DMA Right and Left channels definitions */
00137 #define AUDIO_DFSDMx_DMAx_CLK_ENABLE()                  __HAL_RCC_DMA1_CLK_ENABLE()
00138 #define AUDIO_DFSDMx_DMAx_CLK_DISABLE()                 __HAL_RCC_DMA1_CLK_DISABLE()
00139 #define AUDIO_DFSDMx_DMAx_LEFT_CHANNEL                  DMA1_Channel4
00140 #define AUDIO_DFSDMx_DMAx_LEFT_IRQ                      DMA1_Channel4_IRQn
00141 #define AUDIO_DFSDM_DMAx_LEFT_IRQHandler                DMA1_Channel4_IRQHandler
00142 #define AUDIO_DFSDMx_DMAx_RIGHT_CHANNEL                 DMA1_Channel5
00143 #define AUDIO_DFSDMx_DMAx_RIGHT_IRQ                     DMA1_Channel5_IRQn
00144 #define AUDIO_DFSDM_DMAx_RIGHT_IRQHandler               DMA1_Channel5_IRQHandler
00145 #define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE              DMA_PDATAALIGN_WORD
00146 #define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE                 DMA_MDATAALIGN_WORD
00147
00148
00149 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
00150 #define AUDIO_IN_IRQ_PREPRIO                6   /* Select the preemption priority level(0 is the highest) */
00151
00152 /*------------------------------------------------------------------------------
00153              CONFIGURATION: Audio Driver Configuration parameters
00154 ------------------------------------------------------------------------------*/
00155
00156 #define AUDIODATA_SIZE                      2   /* 16-bits audio data size */
00157
00158 /* Audio status definition */
00159 #define AUDIO_OK                            0
00160 #define AUDIO_ERROR                         1
00161 #define AUDIO_TIMEOUT                       2
00162
00163 /* Audio out parameters */
00164 #define DEFAULT_AUDIO_OUT_FREQ              BSP_AUDIO_FREQUENCY_48K
00165 #define DEFAULT_AUDIO_OUT_BIT_RESOLUTION    ((uint8_t)16)
00166 #define DEFAULT_AUDIO_OUT_CHANNEL_NBR       ((uint8_t)2) /* Mono = 1, Stereo = 2 */
00167 #define DEFAULT_AUDIO_OUT_VOLUME            ((uint16_t)80)
00168
00169 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
00170 #define DEFAULT_AUDIO_IN_FREQ               BSP_AUDIO_FREQUENCY_16K
00171 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION     16
00172 #define DEFAULT_AUDIO_IN_CHANNEL_NBR        1 /* Mono = 1, Stereo = 2 */
00173 #define DEFAULT_AUDIO_IN_VOLUME             80
00174
00175 /*------------------------------------------------------------------------------
00176                     OPTIONAL Configuration defines parameters
00177 ------------------------------------------------------------------------------*/
00178
00179 /* Delay for the Codec to be correctly reset */
00180 #define CODEC_RESET_DELAY           5
00181
00182 /*------------------------------------------------------------------------------
00183                            INPUT DEVICES definition
00184 ------------------------------------------------------------------------------*/
00185 /* MP34DT01TR digital microphone on PCB top side */
00186 #define INPUT_DEVICE_DIGITAL_MIC1      0x20    /* Left microphone  */
00187 #define INPUT_DEVICE_DIGITAL_MIC2      0x40    /* Right microphone */
00188 #define INPUT_DEVICE_DIGITAL_MIC       (INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2)
00189 /* Analog microphone input from 3.5 audio jack connector */
00190 #define INPUT_DEVICE_ANALOG_MIC        INPUT_DEVICE_MIC1
00191
00192 /**
00193   * @}
00194   */
00195
00196 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Variables Exported Variables
00197   * @{
00198   */
00199 extern SAI_HandleTypeDef          BSP_AUDIO_hSai_Tx;
00200 extern SAI_HandleTypeDef          BSP_AUDIO_hSai_Rx;
00201 extern DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmLeftFilter;
00202 extern DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmRightFilter;
00203
00204 /**
00205  * @}
00206  */
00207
00208 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Macros Exported Macros
00209   * @{
00210   */
00211 #define DMA_MAX(_X_)                (((_X_) <= DMA_MAX_SZE)? (_X_):DMA_MAX_SZE)
00212
00213 /**
00214   * @}
00215   */
00216
00217 /* Exported functions --------------------------------------------------------*/
00218 /** @defgroup STM32L496G_DISCOVERY_AUDIO_Exported_Functions Exported Functions
00219   * @{
00220   */
00221 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
00222 uint8_t BSP_AUDIO_OUT_DeInit(void);
00223 uint8_t BSP_AUDIO_OUT_Play(uint16_t *pData, uint32_t Size);
00224 uint8_t BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
00225 uint8_t BSP_AUDIO_OUT_Pause(void);
00226 uint8_t BSP_AUDIO_OUT_Resume(void);
00227 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
00228 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
00229 uint8_t BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
00230 void    BSP_AUDIO_OUT_ChangeAudioConfig(uint32_t AudioOutOption);
00231 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
00232 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
00233 void    BSP_AUDIO_OUT_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
00234                                         Audio_CallbackTypeDef HalfTransferCallback,
00235                                         Audio_CallbackTypeDef TransferCompleteCallback);
00236
00237 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00238 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
00239 uint8_t BSP_AUDIO_IN_DeInit(void);
00240 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
00241 uint8_t BSP_AUDIO_IN_SetFrequency(uint32_t AudioFreq);
00242 uint8_t BSP_AUDIO_IN_Stop(void);
00243 uint8_t BSP_AUDIO_IN_Pause(void);
00244 uint8_t BSP_AUDIO_IN_Resume(void);
00245 void    BSP_AUDIO_IN_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
00246                                        Audio_CallbackTypeDef HalfTransferCallback,
00247                                        Audio_CallbackTypeDef TransferCompleteCallback);
00248 /**
00249   * @}
00250   */
00251
00252 /**
00253   * @}
00254   */
00255
00256 /**
00257   * @}
00258   */
00259
00260 /**
00261   * @}
00262   */
00263
00264 #ifdef __cplusplus
00265 }
00266 #endif
00267
00268 #endif /* __STM32L496G_DISCOVERY_AUDIO_H */
00269
00270 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_camera.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_camera.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_camera.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Camera modules mounted on
00006   *          STM32L496G-Discovery board.
00007   @verbatim
00008     How to use this driver:
00009     ------------------------
00010      - This driver is used to drive the camera.
00011      - The OV9655 component driver MUST be included with this driver.
00012
00013     Driver description:
00014     -------------------
00015     + Initialization steps:
00016        o Initialize the camera using the BSP_CAMERA_Init() function.
00017        o Start the camera capture/snapshot using the CAMERA_Start() function.
00018        o Suspend, resume or stop the camera capture using the following functions:
00019         - BSP_CAMERA_Suspend()
00020         - BSP_CAMERA_Resume()
00021         - BSP_CAMERA_Stop()
00022
00023     + Options
00024        o Increase or decrease on the fly the brightness and/or contrast
00025          using the following function:
00026          - BSP_CAMERA_ContrastBrightnessConfig
00027        o Add a special effect on the fly using the following functions:
00028          - BSP_CAMERA_BlackWhiteConfig()
00029          - BSP_CAMERA_ColorEffectConfig()
00030   @endverbatim
00031   ******************************************************************************
00032   * @attention
00033   *
00034   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00035   * All rights reserved.</center></h2>
00036   *
00037   * This software component is licensed by ST under BSD 3-Clause license,
00038   * the "License"; You may not use this file except in compliance with the
00039   * License. You may obtain a copy of the License at:
00040   *                        opensource.org/licenses/BSD-3-Clause
00041   *
00042   ******************************************************************************
00043   */
00044
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "stm32l496g_discovery_camera.h"
00047 #include "stm32l496g_discovery.h"
00048 #include "stm32l496g_discovery_io.h"
00049
00050 /** @addtogroup BSP
00051   * @{
00052   */
00053
00054 /** @addtogroup STM32L496G_DISCOVERY
00055   * @{
00056   */
00057
00058 /** @addtogroup STM32L496G_DISCOVERY_CAMERA
00059   * @{
00060   */
00061
00062 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Private_TypesDefinitions STM32L496G_DISCOVERY_CAMERA Private Types Definitions
00063   * @{
00064   */
00065 /**
00066   * @}
00067   */
00068
00069 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Private_Defines STM32L496G_DISCOVERY_CAMERA Private Defines
00070   * @{
00071   */
00072 #define CAMERA_VGA_RES_X          640
00073 #define CAMERA_VGA_RES_Y          480
00074 #define CAMERA_480x272_RES_X      480
00075 #define CAMERA_480x272_RES_Y      272
00076 #define CAMERA_QVGA_RES_X         320
00077 #define CAMERA_QVGA_RES_Y         240
00078 #define CAMERA_QQVGA_RES_X        160
00079 #define CAMERA_QQVGA_RES_Y        120
00080 /**
00081   * @}
00082   */
00083
00084 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Private_Macros STM32L496G_DISCOVERY_CAMERA Private Macros
00085   * @{
00086   */
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Private_Variables STM32L496G_DISCOVERY_CAMERA Private Variables
00092   * @{
00093   */
00094 DCMI_HandleTypeDef  hDcmiHandler;
00095 CAMERA_DrvTypeDef   *camera_drv;
00096 /* Camera current resolution naming (QQVGA, VGA, ...) */
00097 static uint32_t CameraCurrentResolution;
00098
00099 /* Camera module I2C HW address */
00100 static uint32_t CameraHwAddress;
00101
00102 /**
00103   * @}
00104   */
00105
00106 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Private_FunctionPrototypes STM32L496G_DISCOVERY_CAMERA Private Function Prototypes
00107   * @{
00108   */
00109 static uint32_t GetSize(uint32_t resolution);
00110 /**
00111   * @}
00112   */
00113
00114 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Exported_Functions STM32L496G_DISCOVERY_CAMERA Exported Functions
00115   * @{
00116   */
00117
00118 /**
00119   * @brief  Initializes the camera.
00120   * @param  Resolution : camera sensor requested resolution (x, y) : standard resolution
00121   *         naming QQVGA, QVGA, VGA ...
00122   * @retval Camera status
00123   */
00124 uint8_t BSP_CAMERA_Init(uint32_t Resolution)
00125 {
00126   DCMI_HandleTypeDef *phdcmi;
00127   uint8_t status = CAMERA_ERROR;
00128
00129   /* Get the DCMI handle structure */
00130   phdcmi = &hDcmiHandler;
00131
00132
00133   /* Initialize the IO functionalities */
00134   BSP_IO_Init();
00135
00136
00137   /*** Configures the DCMI to interface with the camera module ***/
00138   /* DCMI configuration */
00139   phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
00140   phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;
00141   phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
00142   phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
00143   phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
00144   phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
00145   phdcmi->Init.ByteSelectMode   = DCMI_BSM_ALL;
00146   phdcmi->Init.LineSelectMode   = DCMI_LSM_ALL;
00147   phdcmi->Instance              = DCMI;
00148
00149   /* Camera initialization */
00150   BSP_CAMERA_MspInit(&hDcmiHandler, NULL);
00151
00152   /* Read ID of Camera module via I2C */
00153   if (ov9655_ReadID(CAMERA_I2C_ADDRESS) == OV9655_ID)
00154   {
00155     /* Initialize the camera driver structure */
00156     camera_drv = &ov9655_drv;
00157     CameraHwAddress = CAMERA_I2C_ADDRESS;
00158
00159     /* DCMI Initialization */
00160     HAL_DCMI_Init(phdcmi);
00161
00162     /* Camera Module Initialization via I2C to the wanted 'Resolution' */
00163     if (Resolution == CAMERA_R320x240)
00164     {
00165       /* For 240x240 resolution, the OV9655 sensor is set to QVGA resolution
00166        * as OV9655 doesn't supports 240x240  resolution,
00167        * then DCMI is configured to output a 240x240 cropped window */
00168       camera_drv->Init(CameraHwAddress, CAMERA_R320x240);
00169
00170
00171       HAL_DCMI_ConfigCROP(phdcmi,
00172                           40,                 /* Crop in the middle of the VGA picture */
00173                           0,                 /* Same height (same number of lines: no need to crop vertically) */
00174                           (240 * 2) - 1,     /* 2 pixels clock needed to capture one pixel */
00175                           (240 * 1) - 1);    /* All 240 lines are captured */
00176       HAL_DCMI_EnableCROP(phdcmi);
00177
00178
00179       /* Set the RGB565 mode */
00180       MFX_IO_Write(CameraHwAddress, 0x12 /*OV9655_COM7*/, 0x63);
00181       MFX_IO_Write(CameraHwAddress, 0x40 /*OV9655_COM15*/, 0x10);
00182       /* Invert the HRef signal */
00183       MFX_IO_Write(CameraHwAddress, 0x15 /*OV9655_COM10*/, 0x08);
00184       HAL_Delay(500);
00185     }
00186     else
00187     {
00188       camera_drv->Init(CameraHwAddress, Resolution);
00189       HAL_DCMI_DisableCROP(phdcmi);
00190     }
00191
00192     CameraCurrentResolution = Resolution;
00193
00194     /* Return CAMERA_OK status */
00195     status = CAMERA_OK;
00196   }
00197   else
00198   {
00199     /* Return CAMERA_NOT_SUPPORTED status */
00200     status = CAMERA_NOT_SUPPORTED;
00201   }
00202
00203   return status;
00204 }
00205
00206 /**
00207   * @brief  DeInitializes the camera.
00208   * @retval Camera status
00209   */
00210 uint8_t BSP_CAMERA_DeInit(void)
00211 {
00212   hDcmiHandler.Instance              = DCMI;
00213
00214   HAL_DCMI_DeInit(&hDcmiHandler);
00215   BSP_CAMERA_MspDeInit(&hDcmiHandler, NULL);
00216   return CAMERA_OK;
00217 }
00218
00219 /**
00220   * @brief  Starts the camera capture in continuous mode.
00221   * @param  buff: pointer to the camera output buffer
00222   * @retval None
00223   */
00224 void BSP_CAMERA_ContinuousStart(uint8_t *buff)
00225 {
00226   /* Start the camera capture */
00227   HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_CONTINUOUS, (uint32_t)buff, GetSize(CameraCurrentResolution));
00228 }
00229
00230 /**
00231   * @brief  Starts the camera capture in snapshot mode.
00232   * @param  buff: pointer to the camera output buffer
00233   * @retval None
00234   */
00235 void BSP_CAMERA_SnapshotStart(uint8_t *buff)
00236 {
00237   /* Start the camera capture */
00238   HAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_SNAPSHOT, (uint32_t)buff, GetSize(CameraCurrentResolution));
00239 }
00240
00241 /**
00242   * @brief Suspend the CAMERA capture
00243   * @retval None
00244   */
00245 void BSP_CAMERA_Suspend(void)
00246 {
00247   /* Suspend the Camera Capture */
00248   HAL_DCMI_Suspend(&hDcmiHandler);
00249 }
00250
00251 /**
00252   * @brief Resume the CAMERA capture
00253   * @retval None
00254   */
00255 void BSP_CAMERA_Resume(void)
00256 {
00257   /* Start the Camera Capture */
00258   HAL_DCMI_Resume(&hDcmiHandler);
00259 }
00260
00261 /**
00262   * @brief  Stop the CAMERA capture
00263   * @retval Camera status
00264   */
00265 uint8_t BSP_CAMERA_Stop(void)
00266 {
00267   uint8_t status = CAMERA_ERROR;
00268
00269   if (HAL_DCMI_Stop(&hDcmiHandler) == HAL_OK)
00270   {
00271     status = CAMERA_OK;
00272   }
00273
00274   /* Set Camera in Power Down */
00275   BSP_CAMERA_PwrDown();
00276
00277   return status;
00278 }
00279
00280 /**
00281   * @brief  CANERA power up
00282   * @retval None
00283   */
00284 void BSP_CAMERA_PwrUp(void)
00285 {
00286   /* De-assert the camera POWER_DOWN pin (active high) */
00287   BSP_IO_WritePin(CAMERA_PWR_EN_PIN, GPIO_PIN_RESET);
00288
00289   HAL_Delay(3);     /* POWER_DOWN de-asserted during 3ms */
00290 }
00291
00292 /**
00293   * @brief  CAMERA power down
00294   * @retval None
00295   */
00296 void BSP_CAMERA_PwrDown(void)
00297 {
00298   /* Assert the camera POWER_DOWN pin (active high) */
00299   BSP_IO_WritePin(CAMERA_PWR_EN_PIN, GPIO_PIN_SET);
00300 }
00301
00302 /**
00303   * @brief  Configures the camera contrast and brightness.
00304   * @param  contrast_level: Contrast level
00305   *          This parameter can be one of the following values:
00306   *            @arg  CAMERA_CONTRAST_LEVEL4: for contrast +2
00307   *            @arg  CAMERA_CONTRAST_LEVEL3: for contrast +1
00308   *            @arg  CAMERA_CONTRAST_LEVEL2: for contrast  0
00309   *            @arg  CAMERA_CONTRAST_LEVEL1: for contrast -1
00310   *            @arg  CAMERA_CONTRAST_LEVEL0: for contrast -2
00311   * @param  brightness_level: Contrast level
00312   *          This parameter can be one of the following values:
00313   *            @arg  CAMERA_BRIGHTNESS_LEVEL4: for brightness +2
00314   *            @arg  CAMERA_BRIGHTNESS_LEVEL3: for brightness +1
00315   *            @arg  CAMERA_BRIGHTNESS_LEVEL2: for brightness  0
00316   *            @arg  CAMERA_BRIGHTNESS_LEVEL1: for brightness -1
00317   *            @arg  CAMERA_BRIGHTNESS_LEVEL0: for brightness -2
00318   * @retval None
00319   */
00320 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level)
00321 {
00322   if (camera_drv->Config != NULL)
00323   {
00324     camera_drv->Config(CameraHwAddress, CAMERA_CONTRAST_BRIGHTNESS, contrast_level, brightness_level);
00325   }
00326 }
00327
00328 /**
00329   * @brief  Configures the camera white balance.
00330   * @param  Mode: black_white mode
00331   *          This parameter can be one of the following values:
00332   *            @arg  CAMERA_BLACK_WHITE_BW
00333   *            @arg  CAMERA_BLACK_WHITE_NEGATIVE
00334   *            @arg  CAMERA_BLACK_WHITE_BW_NEGATIVE
00335   *            @arg  CAMERA_BLACK_WHITE_NORMAL
00336   * @retval None
00337   */
00338 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode)
00339 {
00340   if (camera_drv->Config != NULL)
00341   {
00342     camera_drv->Config(CameraHwAddress, CAMERA_BLACK_WHITE, Mode, 0);
00343   }
00344 }
00345
00346 /**
00347   * @brief  Configures the camera color effect.
00348   * @param  Effect: Color effect
00349   *          This parameter can be one of the following values:
00350   *            @arg  CAMERA_COLOR_EFFECT_ANTIQUE
00351   *            @arg  CAMERA_COLOR_EFFECT_BLUE
00352   *            @arg  CAMERA_COLOR_EFFECT_GREEN
00353   *            @arg  CAMERA_COLOR_EFFECT_RED
00354   * @retval None
00355   */
00356 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect)
00357 {
00358   if (camera_drv->Config != NULL)
00359   {
00360     camera_drv->Config(CameraHwAddress, CAMERA_COLOR_EFFECT, Effect, 0);
00361   }
00362 }
00363
00364 /**
00365   * @brief  Get the capture size in pixels unit.
00366   * @param  resolution: the current resolution.
00367   * @retval capture size in pixels unit.
00368   */
00369 static uint32_t GetSize(uint32_t resolution)
00370 {
00371   uint32_t size = 0;
00372
00373   /* Get capture size */
00374   switch (resolution)
00375   {
00376     case CAMERA_R160x120:
00377     {
00378       size =  0x2580;
00379     }
00380     break;
00381     case CAMERA_R320x240:
00382     {
00383       size =  0x9600;
00384     }
00385     break;
00386     case CAMERA_R480x272:
00387     {
00388       size =  0xFF00;
00389     }
00390     break;
00391     case CAMERA_R640x480:
00392     {
00393       size =  0x25800;
00394     }
00395     break;
00396     default:
00397     {
00398       break;
00399     }
00400   }
00401
00402   return size;
00403 }
00404
00405 /**
00406   * @brief  Initializes the DCMI MSP.
00407   * @param  hdcmi: HDMI handle
00408   * @param  Params
00409   * @retval None
00410   */
00411 __weak void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00412 {
00413   static DMA_HandleTypeDef hdma_handler;
00414   GPIO_InitTypeDef gpio_init_structure;
00415
00416   /*** Enable peripherals and GPIO clocks ***/
00417   /* Enable DCMI clock */
00418   __HAL_RCC_DCMI_CLK_ENABLE();
00419
00420   /* Enable DMA2 clock */
00421   __HAL_RCC_DMA2_CLK_ENABLE();
00422
00423   /* Enable GPIO clocks */
00424   __HAL_RCC_GPIOA_CLK_ENABLE();
00425   __HAL_RCC_GPIOE_CLK_ENABLE();
00426   __HAL_RCC_GPIOH_CLK_ENABLE();
00427   __HAL_RCC_GPIOI_CLK_ENABLE();
00428
00429   HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_4);
00430   __HAL_RCC_HSI48_ENABLE();
00431   HAL_Delay(10); // HSI48 should start in 10ms
00432
00433
00434   /*** Configure the GPIO ***/
00435   /* Configure DCMI GPIO as alternate function */
00436   gpio_init_structure.Pin       = GPIO_PIN_5;
00437   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00438   gpio_init_structure.Pull      = GPIO_NOPULL;
00439   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00440   gpio_init_structure.Alternate = GPIO_AF10_DCMI;
00441   HAL_GPIO_Init(GPIOE, &gpio_init_structure);
00442
00443
00444   gpio_init_structure.Pin       = GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_9 | \
00445                                   GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_14;
00446   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00447   gpio_init_structure.Pull      = GPIO_NOPULL;
00448   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00449   gpio_init_structure.Alternate = GPIO_AF10_DCMI;
00450   HAL_GPIO_Init(GPIOH, &gpio_init_structure);
00451
00452   gpio_init_structure.Pin       = GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_7;
00453   gpio_init_structure.Mode      = GPIO_MODE_AF_PP;
00454   gpio_init_structure.Pull      = GPIO_NOPULL;
00455   gpio_init_structure.Speed     = GPIO_SPEED_HIGH;
00456   gpio_init_structure.Alternate = GPIO_AF10_DCMI;
00457   HAL_GPIO_Init(GPIOI, &gpio_init_structure);
00458
00459   /*** Configure the DMA ***/
00460   /* Set the parameters to be configured */
00461   hdma_handler.Instance                 = BSP_CAMERA_DMA_INSTANCE;
00462
00463   hdma_handler.Init.Request             = DMA_REQUEST_0;
00464   hdma_handler.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00465   hdma_handler.Init.PeriphInc           = DMA_PINC_DISABLE;
00466   hdma_handler.Init.MemInc              = DMA_MINC_ENABLE;      /* Image captured by the DCMI is stored in memory */
00467   hdma_handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00468   hdma_handler.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00469   hdma_handler.Init.Mode                = DMA_CIRCULAR;
00470   hdma_handler.Init.Priority            = DMA_PRIORITY_HIGH;
00471
00472   /* Associate the initialized DMA handle to the DCMI handle */
00473   __HAL_LINKDMA(hdcmi, DMA_Handle, hdma_handler);
00474
00475   /*** Configure the NVIC for DCMI and DMA ***/
00476   /* NVIC configuration for DCMI transfer complete interrupt */
00477   HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0);
00478   HAL_NVIC_EnableIRQ(DCMI_IRQn);
00479
00480   /* NVIC configuration for DMA2D transfer complete interrupt */
00481   HAL_NVIC_SetPriority(DMA2_Channel6_IRQn, 0x0F, 0);
00482   HAL_NVIC_EnableIRQ(DMA2_Channel6_IRQn);
00483
00484   /* Configure the DMA stream */
00485   HAL_DMA_Init(hdcmi->DMA_Handle);
00486 }
00487
00488
00489 /**
00490   * @brief  DeInitializes the DCMI MSP.
00491   * @param  hdcmi: HDMI handle
00492   * @param  Params
00493   * @retval None
00494   */
00495 __weak void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params)
00496 {
00497   /* Disable NVIC  for DCMI transfer complete interrupt */
00498   HAL_NVIC_DisableIRQ(DCMI_IRQn);
00499
00500   /* Disable NVIC for DMA2 transfer complete interrupt */
00501   HAL_NVIC_DisableIRQ(DMA2_Channel6_IRQn);
00502
00503   /* Configure the DMA stream */
00504   HAL_DMA_DeInit(hdcmi->DMA_Handle);
00505
00506   /* Disable DCMI clock */
00507   __HAL_RCC_DCMI_CLK_DISABLE();
00508
00509   /* GPIO pins clock and DMA clock can be shut down in the application
00510      by surcharging this __weak function */
00511 }
00512
00513 /**
00514   * @brief  Line event callback
00515   * @param  hdcmi: pointer to the DCMI handle
00516   * @retval None
00517   */
00518 void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi)
00519 {
00520   BSP_CAMERA_LineEventCallback();
00521 }
00522
00523 /**
00524   * @brief  Line Event callback.
00525   * @retval None
00526   */
00527 __weak void BSP_CAMERA_LineEventCallback(void)
00528 {
00529   /* NOTE : This function should not be modified; when the callback is needed,
00530             the BSP_CAMERA_LineEventCallback can be implemented in the user file
00531    */
00532 }
00533
00534 /**
00535   * @brief  VSYNC event callback
00536   * @param  hdcmi: pointer to the DCMI handle
00537   * @retval None
00538   */
00539 void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi)
00540 {
00541   BSP_CAMERA_VsyncEventCallback();
00542 }
00543
00544 /**
00545   * @brief  VSYNC Event callback.
00546   * @retval None
00547   */
00548 __weak void BSP_CAMERA_VsyncEventCallback(void)
00549 {
00550   /* NOTE : This function should not be modified; when the callback is needed,
00551             the BSP_CAMERA_VsyncEventCallback can be implemented in the user file
00552    */
00553 }
00554
00555 /**
00556   * @brief  Frame event callback
00557   * @param  hdcmi: pointer to the DCMI handle
00558   * @retval None
00559   */
00560 void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi)
00561 {
00562   BSP_CAMERA_FrameEventCallback();
00563 }
00564
00565 /**
00566   * @brief  Frame Event callback.
00567   * @retval None
00568   */
00569 __weak void BSP_CAMERA_FrameEventCallback(void)
00570 {
00571   /* NOTE : This function should not be modified; when the callback is needed,
00572             the BSP_CAMERA_FrameEventCallback can be implemented in the user file
00573    */
00574 }
00575
00576 /**
00577   * @brief  Error callback
00578   * @param  hdcmi: pointer to the DCMI handle
00579   * @retval None
00580   */
00581 void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi)
00582 {
00583   BSP_CAMERA_ErrorCallback();
00584 }
00585
00586 /**
00587   * @brief  Error callback.
00588   * @retval None
00589   */
00590 __weak void BSP_CAMERA_ErrorCallback(void)
00591 {
00592   /* NOTE : This function should not be modified; when the callback is needed,
00593             the BSP_CAMERA_ErrorCallback can be implemented in the user file
00594    */
00595 }
00596
00597
00598 /**
00599   * @}
00600   */
00601
00602 /**
00603   * @}
00604   */
00605
00606 /**
00607   * @}
00608   */
00609
00610 /**
00611   * @}
00612   */
00613
00614 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_camera.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_camera.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_camera.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_camera.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_CAMERA_H
00023 #define __STM32L496G_DISCOVERY_CAMERA_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 /* Include Camera component Driver */
00031 #include "../Components/ov9655/ov9655.h"
00032 #include "stm32l496g_discovery.h"
00033
00034 /** @addtogroup BSP
00035   * @{
00036   */
00037
00038 /** @addtogroup STM32L496G_DISCOVERY
00039   * @{
00040   */
00041
00042 /** @addtogroup STM32L496G_DISCOVERY_CAMERA
00043   * @{
00044   */
00045
00046 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Exported_Types STM32L496G_DISCOVERY_CAMERA Exported Types
00047   * @{
00048   */
00049
00050 /**
00051   * @brief  Camera State structures definition
00052   */
00053 typedef enum
00054 {
00055   CAMERA_OK            = 0x00,
00056   CAMERA_ERROR         = 0x01,
00057   CAMERA_TIMEOUT       = 0x02,
00058   CAMERA_NOT_DETECTED  = 0x03,
00059   CAMERA_NOT_SUPPORTED = 0x04
00060
00061 }
00062 Camera_StatusTypeDef;
00063
00064 #define RESOLUTION_R160x120      CAMERA_R160x120      /* QQVGA Resolution     */
00065 #define RESOLUTION_R320x240      CAMERA_R320x240      /* QVGA Resolution      */
00066 #define RESOLUTION_R480x272      CAMERA_R480x272      /* 480x272 Resolution   */
00067 #define RESOLUTION_R640x480      CAMERA_R640x480      /* VGA Resolution       */
00068 /**
00069   * @}
00070   */
00071
00072 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Exported_Constants STM32L496G_DISCOVERY_CAMERA Exported Constants
00073   * @{
00074   */
00075 #define BSP_CAMERA_IRQHandler      DCMI_IRQHandler
00076 #define BSP_CAMERA_DMA_IRQHandler  DMA2_Channel6_IRQHandler
00077 #define BSP_CAMERA_DMA_IRQn        DMA2_Channel6_IRQn
00078 #define BSP_CAMERA_DMA_INSTANCE    DMA2_Channel6
00079
00080 /**
00081   * @}
00082   */
00083
00084 /**
00085   * @brief Camera special pins
00086   */
00087 /* Camera power up pin */
00088 #define CAMERA_PWR_EN_PIN                  IO1_PIN_6
00089
00090
00091 /**
00092   * @}
00093   */
00094
00095 /** @addtogroup STM32L496G_DISCOVERY_CAMERA_Exported_Functions
00096   * @{
00097   */
00098 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
00099 uint8_t BSP_CAMERA_DeInit(void);
00100 void    BSP_CAMERA_ContinuousStart(uint8_t *buff);
00101 void    BSP_CAMERA_SnapshotStart(uint8_t *buff);
00102 void    BSP_CAMERA_Suspend(void);
00103 void    BSP_CAMERA_Resume(void);
00104 uint8_t BSP_CAMERA_Stop(void);
00105 void    BSP_CAMERA_PwrUp(void);
00106 void    BSP_CAMERA_PwrDown(void);
00107 void    BSP_CAMERA_LineEventCallback(void);
00108 void    BSP_CAMERA_VsyncEventCallback(void);
00109 void    BSP_CAMERA_FrameEventCallback(void);
00110 void    BSP_CAMERA_ErrorCallback(void);
00111
00112 /* Camera features functions prototype */
00113 void    BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
00114 void    BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
00115 void    BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
00116
00117 /* These functions can be modified in case the current settings (e.g. DMA stream)
00118    need to be changed for specific application needs */
00119 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00120 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
00121
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 /* __STM32L496G_DISCOVERY_CAMERA_H */
00144
00145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_idd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_idd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_idd.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of firmware functions to manage the
00006   *          Idd measurement driver for STM32L496G-Discovery board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Includes ------------------------------------------------------------------*/
00022 #include "stm32l496g_discovery_idd.h"
00023 #include "stm32l496g_discovery_io.h"
00024
00025 /** @addtogroup BSP
00026   * @{
00027   */
00028
00029 /** @addtogroup STM32L496G_DISCOVERY
00030   * @{
00031   */
00032
00033 /** @defgroup STM32L496G_DISCOVERY_IDD STM32L496G-DISCOVERY IDD
00034   * @brief This file includes the Idd driver for STM32L496G-DISCOVERY board.
00035   *        It allows user to measure MCU Idd current on board, especially in
00036   *        different low power modes.
00037   * @{
00038   */
00039
00040 /** @defgroup STM32L496G_DISCOVERY_IDD_Private_Defines Private Defines
00041   * @{
00042   */
00043
00044 /**
00045   * @}
00046   */
00047
00048
00049 /** @defgroup STM32L496G_DISCOVERY_IDD_Private_Variables Private Variables
00050   * @{
00051   */
00052 static IDD_DrvTypeDef *IddDrv;
00053
00054 /**
00055   * @}
00056   */
00057
00058 /** @defgroup STM32L496G_DISCOVERY_IDD_Private_Functions Private Functions
00059   * @{
00060   */
00061
00062 /**
00063   * @}
00064   */
00065
00066 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Functions Exported Functions
00067   * @{
00068   */
00069
00070 /**
00071   * @brief  Configures IDD measurement component.
00072   * @retval IDD_OK if no problem during initialization
00073   */
00074 uint8_t BSP_IDD_Init(void)
00075 {
00076   IDD_ConfigTypeDef iddconfig = {0};
00077   uint8_t mfxstm32l152_id = 0;
00078   uint8_t ret = 0;
00079
00080   /* wake up mfx component in case it went to standby mode */
00081   mfxstm32l152_idd_drv.WakeUp(IDD_I2C_ADDRESS);
00082   HAL_Delay(5);
00083
00084   /* Read ID and verify if the MFX is ready */
00085   mfxstm32l152_id = mfxstm32l152_idd_drv.ReadID(IDD_I2C_ADDRESS);
00086
00087   if ((mfxstm32l152_id == MFXSTM32L152_ID_1) || (mfxstm32l152_id == MFXSTM32L152_ID_2))
00088   {
00089     /* Initialize the Idd driver structure */
00090     IddDrv = &mfxstm32l152_idd_drv;
00091
00092     /* Initialize the Idd driver */
00093     if (IddDrv->Init != NULL)
00094     {
00095       IddDrv->Init(IDD_I2C_ADDRESS);
00096     }
00097
00098     /* Configure Idd component with default values */
00099     iddconfig.AmpliGain = DISCOVERY_IDD_AMPLI_GAIN;
00100     iddconfig.VddMin = DISCOVERY_IDD_VDD_MIN;
00101     iddconfig.Shunt0Value = DISCOVERY_IDD_SHUNT0_VALUE;
00102     iddconfig.Shunt1Value = DISCOVERY_IDD_SHUNT1_VALUE;
00103     iddconfig.Shunt2Value = DISCOVERY_IDD_SHUNT2_VALUE;
00104     iddconfig.Shunt3Value = 0;
00105     iddconfig.Shunt4Value = DISCOVERY_IDD_SHUNT4_VALUE;
00106     iddconfig.Shunt0StabDelay = DISCOVERY_IDD_SHUNT0_STABDELAY;
00107     iddconfig.Shunt1StabDelay = DISCOVERY_IDD_SHUNT1_STABDELAY;
00108     iddconfig.Shunt2StabDelay = DISCOVERY_IDD_SHUNT2_STABDELAY;
00109     iddconfig.Shunt3StabDelay = 0;
00110     iddconfig.Shunt4StabDelay = DISCOVERY_IDD_SHUNT4_STABDELAY;
00111     iddconfig.ShuntNbOnBoard = MFXSTM32L152_IDD_SHUNT_NB_4;
00112     iddconfig.ShuntNbUsed = MFXSTM32L152_IDD_SHUNT_NB_4;
00113     iddconfig.VrefMeasurement = MFXSTM32L152_IDD_VREF_AUTO_MEASUREMENT_ENABLE;
00114     iddconfig.Calibration = MFXSTM32L152_IDD_AUTO_CALIBRATION_ENABLE;
00115     iddconfig.PreDelayUnit = MFXSTM32L152_IDD_PREDELAY_20_MS;
00116     iddconfig.PreDelayValue = 0x7F;
00117     iddconfig.MeasureNb = 100;
00118     iddconfig.DeltaDelayUnit = MFXSTM32L152_IDD_DELTADELAY_0_5_MS;
00119     iddconfig.DeltaDelayValue = 10;
00120     BSP_IDD_Config(iddconfig);
00121
00122     ret = IDD_OK;
00123   }
00124   else
00125   {
00126     ret = IDD_ERROR;
00127   }
00128
00129   return ret;
00130 }
00131
00132 /**
00133   * @brief  Unconfigures IDD measurement component.
00134   * @retval IDD_OK if no problem during deinitialization
00135   */
00136 void BSP_IDD_DeInit(void)
00137 {
00138   if (IddDrv->DeInit != NULL)
00139   {
00140     IddDrv->DeInit(IDD_I2C_ADDRESS);
00141   }
00142 }
00143
00144 /**
00145   * @brief  Reset Idd measurement component.
00146   * @retval None
00147   */
00148 void BSP_IDD_Reset(void)
00149 {
00150   if (IddDrv->Reset != NULL)
00151   {
00152     IddDrv->Reset(IDD_I2C_ADDRESS);
00153   }
00154 }
00155
00156 /**
00157   * @brief  Turn Idd measurement component in low power (standby/sleep) mode
00158   * @retval None
00159   */
00160 void BSP_IDD_LowPower(void)
00161 {
00162   if (IddDrv->LowPower != NULL)
00163   {
00164     IddDrv->LowPower(IDD_I2C_ADDRESS);
00165   }
00166 }
00167
00168 /**
00169   * @brief  Start Measurement campaign
00170   * @retval None
00171   */
00172 void BSP_IDD_StartMeasure(void)
00173 {
00174
00175   /* Activate the OPAMP used ny the MFX to measure the current consumption */
00176   BSP_IO_ConfigPin(IDD_AMP_CONTROL_PIN, IO_MODE_OUTPUT);
00177   BSP_IO_WritePin(IDD_AMP_CONTROL_PIN, GPIO_PIN_RESET);
00178
00179   if (IddDrv->Start != NULL)
00180   {
00181     IddDrv->Start(IDD_I2C_ADDRESS);
00182   }
00183 }
00184
00185 /**
00186   * @brief  Configure Idd component
00187   * @param  IddConfig: structure of idd parameters
00188   * @retval None
00189   */
00190 void BSP_IDD_Config(IDD_ConfigTypeDef IddConfig)
00191 {
00192   if (IddDrv->Config != NULL)
00193   {
00194     IddDrv->Config(IDD_I2C_ADDRESS, IddConfig);
00195   }
00196 }
00197
00198 /**
00199   * @brief  Get Idd current value.
00200   * @param  IddValue: Pointer on u32 to store Idd. Value unit is 10 nA.
00201   * @retval None
00202   */
00203 void BSP_IDD_GetValue(uint32_t *IddValue)
00204 {
00205   /* De-activate the OPAMP used ny the MFX to measure the current consumption */
00206   BSP_IO_ConfigPin(IDD_AMP_CONTROL_PIN, IO_MODE_OUTPUT);
00207   BSP_IO_WritePin(IDD_AMP_CONTROL_PIN, GPIO_PIN_RESET);
00208
00209   if (IddDrv->GetValue != NULL)
00210   {
00211     IddDrv->GetValue(IDD_I2C_ADDRESS, IddValue);
00212   }
00213 }
00214
00215 /**
00216   * @brief  Enable Idd interrupt that warn end of measurement
00217   * @retval None
00218   */
00219 void BSP_IDD_EnableIT(void)
00220 {
00221   if (IddDrv->EnableIT != NULL)
00222   {
00223     IddDrv->EnableIT(IDD_I2C_ADDRESS);
00224   }
00225 }
00226
00227 /**
00228   * @brief  Clear Idd interrupt that warn end of measurement
00229   * @retval None
00230   */
00231 void BSP_IDD_ClearIT(void)
00232 {
00233   if (IddDrv->ClearIT != NULL)
00234   {
00235     IddDrv->ClearIT(IDD_I2C_ADDRESS);
00236   }
00237 }
00238
00239 /**
00240   * @brief  Get Idd interrupt status
00241   * @retval status
00242   */
00243 uint8_t BSP_IDD_GetITStatus(void)
00244 {
00245   if (IddDrv->GetITStatus != NULL)
00246   {
00247     return (IddDrv->GetITStatus(IDD_I2C_ADDRESS));
00248   }
00249   else
00250   {
00251     return IDD_ERROR;
00252   }
00253 }
00254
00255 /**
00256   * @brief  Disable Idd interrupt that warn end of measurement
00257   * @retval None
00258   */
00259 void BSP_IDD_DisableIT(void)
00260 {
00261   if (IddDrv->DisableIT != NULL)
00262   {
00263     IddDrv->DisableIT(IDD_I2C_ADDRESS);
00264   }
00265 }
00266
00267 /**
00268   * @brief  Get Error Code .
00269   * @retval Error code or error status
00270   */
00271 uint8_t BSP_IDD_ErrorGetCode(void)
00272 {
00273   if (IddDrv->ErrorGetSrc != NULL)
00274   {
00275     if ((IddDrv->ErrorGetSrc(IDD_I2C_ADDRESS) & MFXSTM32L152_IDD_ERROR_SRC) != RESET)
00276     {
00277       if (IddDrv->ErrorGetCode != NULL)
00278       {
00279         return IddDrv->ErrorGetCode(IDD_I2C_ADDRESS);
00280       }
00281       else
00282       {
00283         return IDD_ERROR;
00284       }
00285     }
00286     else
00287     {
00288       return IDD_ERROR;
00289     }
00290   }
00291   else
00292   {
00293     return IDD_ERROR;
00294   }
00295 }
00296
00297
00298 /**
00299   * @brief  Enable error interrupt that warn end of measurement
00300   * @retval None
00301   */
00302 void BSP_IDD_ErrorEnableIT(void)
00303 {
00304   if (IddDrv->ErrorEnableIT != NULL)
00305   {
00306     IddDrv->ErrorEnableIT(IDD_I2C_ADDRESS);
00307   }
00308 }
00309
00310 /**
00311   * @brief  Clear Error interrupt that warn end of measurement
00312   * @retval None
00313   */
00314 void BSP_IDD_ErrorClearIT(void)
00315 {
00316   if (IddDrv->ErrorClearIT != NULL)
00317   {
00318     IddDrv->ErrorClearIT(IDD_I2C_ADDRESS);
00319   }
00320 }
00321
00322 /**
00323   * @brief  Get Error interrupt status
00324   * @retval Status
00325   */
00326 uint8_t BSP_IDD_ErrorGetITStatus(void)
00327 {
00328   if (IddDrv->ErrorGetITStatus != NULL)
00329   {
00330     return (IddDrv->ErrorGetITStatus(IDD_I2C_ADDRESS));
00331   }
00332   else
00333   {
00334     return 0;
00335   }
00336 }
00337
00338 /**
00339   * @brief  Disable Error interrupt
00340   * @retval None
00341   */
00342 void BSP_IDD_ErrorDisableIT(void)
00343 {
00344   if (IddDrv->ErrorDisableIT != NULL)
00345   {
00346     IddDrv->ErrorDisableIT(IDD_I2C_ADDRESS);
00347   }
00348 }
00349
00350 /**
00351   * @brief  Wake up Idd measurement component.
00352   * @retval None
00353   */
00354 void BSP_IDD_WakeUp(void)
00355 {
00356   if (IddDrv->WakeUp != NULL)
00357   {
00358     IddDrv->WakeUp(IDD_I2C_ADDRESS);
00359   }
00360 }
00361
00362 /**
00363   * @}
00364   */
00365
00366 /**
00367   * @}
00368   */
00369
00370 /**
00371   * @}
00372   */
00373
00374 /**
00375   * @}
00376   */
00377
00378 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00379


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_idd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_idd.h
Go to the documentation of this file.
00001 /**
00002  ******************************************************************************
00003  * @file    stm32l496g_discovery_idd.h
00004  * @author  MCD Application Team
00005  * @brief   Header file for stm32l496g_discovery_idd.c module.
00006  ******************************************************************************
00007  * @attention
00008  *
00009  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00010  * All rights reserved.</center></h2>
00011  *
00012  * This software component is licensed by ST under BSD 3-Clause license,
00013  * the "License"; You may not use this file except in compliance with the
00014  * License. You may obtain a copy of the License at:
00015  *                        opensource.org/licenses/BSD-3-Clause
00016  *
00017  ******************************************************************************
00018  */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32L496G_DISCOVERY_IDD_H
00022 #define __STM32L496G_DISCOVERY_IDD_H
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32l496g_discovery.h"
00030 /* Include Idd measurement component driver */
00031 #include "../Components/mfxstm32l152/mfxstm32l152.h"
00032
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036
00037 /** @addtogroup STM32L496G_DISCOVERY
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32L496G_DISCOVERY_IDD
00042   * @{
00043   */
00044
00045 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Types  Exported Types
00046   * @{
00047   */
00048
00049 /** @defgroup IDD_Config  IDD Config
00050   * @{
00051   */
00052 typedef enum
00053 {
00054   IDD_OK = 0,
00055   IDD_TIMEOUT = 1,
00056   IDD_ZERO_VALUE = 2,
00057   IDD_ERROR = 0xFF
00058 }
00059 IDD_StatusTypeDef;
00060 /**
00061   * @}
00062   */
00063
00064 /**
00065   * @}
00066   */
00067
00068 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Defines  Exported Defines
00069   * @{
00070   */
00071 /**
00072   * @brief  Shunt values on discovery in milli ohms
00073   */
00074 #define DISCOVERY_IDD_SHUNT0_VALUE                  ((uint16_t) 1000)     /*!< value in milliohm */
00075 #define DISCOVERY_IDD_SHUNT1_VALUE                  ((uint16_t) 24)       /*!< value in ohm */
00076 #define DISCOVERY_IDD_SHUNT2_VALUE                  ((uint16_t) 620)      /*!< value in ohm */
00077 #define DISCOVERY_IDD_SHUNT4_VALUE                  ((uint16_t) 10000)    /*!< value in ohm */
00078
00079 /**
00080   * @brief  Shunt stabilization delay on discovery in milli ohms
00081   */
00082 #define DISCOVERY_IDD_SHUNT0_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00083 #define DISCOVERY_IDD_SHUNT1_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00084 #define DISCOVERY_IDD_SHUNT2_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00085 #define DISCOVERY_IDD_SHUNT4_STABDELAY              ((uint8_t) 255)       /*!< value in millisec */
00086
00087 /**
00088   * @brief  IDD Ampli Gain on discovery
00089   */
00090 #define DISCOVERY_IDD_AMPLI_GAIN                    ((uint16_t) 4967)     /*!< value is gain * 100 */
00091
00092 /**
00093   * @brief  IDD Vdd Min on discovery
00094   */
00095 #define DISCOVERY_IDD_VDD_MIN                       ((uint16_t) 2000)     /*!< value in millivolt */
00096
00097 /**
00098   * @}
00099   */
00100
00101 /* Exported functions --------------------------------------------------------*/
00102 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Functions  Exported Functions
00103   * @{
00104   */
00105 uint8_t   BSP_IDD_Init(void);
00106 void      BSP_IDD_DeInit(void);
00107 void      BSP_IDD_Reset(void);
00108 void      BSP_IDD_LowPower(void);
00109 void      BSP_IDD_WakeUp(void);
00110 void      BSP_IDD_StartMeasure(void);
00111 void      BSP_IDD_Config(IDD_ConfigTypeDef IddConfig);
00112 void      BSP_IDD_GetValue(uint32_t *IddValue);
00113 void      BSP_IDD_EnableIT(void);
00114 void      BSP_IDD_ClearIT(void);
00115 uint8_t   BSP_IDD_GetITStatus(void);
00116 void      BSP_IDD_DisableIT(void);
00117 uint8_t   BSP_IDD_ErrorGetCode(void);
00118 void      BSP_IDD_ErrorEnableIT(void);
00119 void      BSP_IDD_ErrorClearIT(void);
00120 uint8_t   BSP_IDD_ErrorGetITStatus(void);
00121 void      BSP_IDD_ErrorDisableIT(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 /* __STM32L496G_DISCOVERY_IDD_H */
00144
00145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_io.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_io.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_io.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to manage the IO pins
00006   *          on STM32L496G-DISCO evaluation board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info : -----------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive the IO module of the STM32L496G-DISCO evaluation
00026      board.
00027    - The STMPE811 and STMPE1600 IO expander device component driver must be included with this
00028      driver in order to run the IO functionalities commanded by the IO expander
00029      device mounted on the evaluation board.
00030
00031 2. Driver description:
00032 ---------------------
00033   + Initialization steps:
00034      o Initialize the IO module using the BSP_IO_Init() function. This
00035        function includes the MSP layer hardware resources initialization and the
00036        communication layer configuration to start the IO functionalities use.
00037
00038   + IO functionalities use
00039      o The IO pin mode is configured when calling the function BSP_IO_ConfigPin(), you
00040        must specify the desired IO mode by choosing the "IO_ModeTypedef" parameter
00041        predefined value.
00042      o If an IO pin is used in interrupt mode, the function BSP_IO_ITGetStatus() is
00043        needed to get the interrupt status. To clear the IT pending bits, you should
00044        call the function BSP_IO_ITClear() with specifying the IO pending bit to clear.
00045      o The IT is handled using the corresponding external interrupt IRQ handler,
00046        the user IT callback treatment is implemented on the same external interrupt
00047        callback.
00048      o To get/set an IO pin combination state you can use the functions
00049        BSP_IO_ReadPin()/BSP_IO_WritePin() or the function BSP_IO_TogglePin() to toggle the pin
00050        state.
00051
00052 ------------------------------------------------------------------------------*/
00053
00054 /* Includes ------------------------------------------------------------------*/
00055 #include "stm32l496g_discovery_io.h"
00056
00057 /** @addtogroup BSP
00058   * @{
00059   */
00060
00061 /** @addtogroup STM32L496G-DISCO
00062   * @{
00063   */
00064
00065 /** @defgroup STM32L496G-DISCO_IO STM32L496G-DISCO IO
00066   * @{
00067   */
00068
00069 /* Private constants ---------------------------------------------------------*/
00070
00071 /** @defgroup STM32L496G-DISCO_IO_Private_Constants Private Constants
00072   * @{
00073   */
00074
00075 /**
00076   * @}
00077   */
00078
00079 /* Private macros -------------------------------------------------------------*/
00080
00081 /** @defgroup STM32L496G-DISCO_IO_Private_Macros Private Macros
00082   * @{
00083   */
00084
00085 /**
00086   * @}
00087   */
00088
00089 /* Private variables ---------------------------------------------------------*/
00090
00091 /** @defgroup STM32L496G-DISCO_IO_Private_Variables Private Variables
00092   * @{
00093   */
00094 static IO_DrvTypeDef *io1_driver;
00095
00096 /**
00097   * @}
00098   */
00099
00100 /* Private function prototypes -----------------------------------------------*/
00101
00102 /** @defgroup STM32L496G-DISCO_IO_Private_Functions Private Functions
00103   * @{
00104   */
00105
00106 /**
00107   * @}
00108   */
00109
00110 /* Private functions ---------------------------------------------------------*/
00111
00112 /** @addtogroup STM32L496G-DISCO_IO_Exported_Functions
00113   * @{
00114   */
00115
00116 /**
00117   * @brief  Initializes and configures the IO functionalities and configures all
00118   *         necessary hardware resources (GPIOs, clocks..).
00119   * @note   BSP_IO_Init() is using HAL_Delay() function to ensure that stmpe811
00120   *         IO Expander is correctly reset. HAL_Delay() function provides accurate
00121   *         delay (in milliseconds) based on variable incremented in SysTick ISR.
00122   *         This implies that if BSP_IO_Init() is called from a peripheral ISR process,
00123   *         then the SysTick interrupt must have higher priority (numerically lower)
00124   *         than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
00125   * @retval IO_OK: if all initializations are OK. Other value if error.
00126   */
00127 uint8_t BSP_IO_Init(void)
00128 {
00129   uint8_t ret = IO_ERROR;
00130   uint8_t mfxstm32l152_id = 0;
00131
00132   if (io1_driver == NULL) /* Checks if MFX initialization has been already done */
00133   {
00134     mfxstm32l152_idd_drv.WakeUp(IO1_I2C_ADDRESS);
00135
00136     HAL_Delay(10);
00137
00138     /* Read ID and verify the IO expander is ready */
00139     mfxstm32l152_id = mfxstm32l152_io_drv.ReadID(IO1_I2C_ADDRESS);
00140
00141     if ((mfxstm32l152_id == MFXSTM32L152_ID_1) || (mfxstm32l152_id == MFXSTM32L152_ID_2))
00142     {
00143       /* Initialize the MFX */
00144       io1_driver = &mfxstm32l152_io_drv;
00145
00146       /* Initialize the MFX IO driver structure  */
00147       if (io1_driver->Init != NULL)
00148       {
00149         io1_driver->Init(IO1_I2C_ADDRESS);
00150         io1_driver->Start(IO1_I2C_ADDRESS, IO1_PIN_ALL >> IO1_PIN_OFFSET);
00151
00152         ret = IO_OK;
00153       }
00154     }
00155   }
00156   else
00157   {
00158     ret = IO_ALREADY_INITIALIZED;
00159   }
00160
00161   return ret;
00162 }
00163
00164 /**
00165   * @brief  Gets the selected pins IT status.
00166   * @param  IO_Pin: Selected pins to check the status.
00167   *          This parameter can be any combination of the IO pins.
00168   * @retval Status of the checked IO pin(s).
00169   */
00170 uint32_t BSP_IO_ITGetStatus(uint32_t IO_Pin)
00171 {
00172   uint32_t status = 0;
00173   uint32_t io1_pin = 0;
00174
00175   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00176
00177   /* Return the MFX  Pin IT status */
00178   status |= (io1_driver->ITStatus(IO1_I2C_ADDRESS, io1_pin)) << IO1_PIN_OFFSET;
00179
00180   return status;
00181 }
00182
00183 /**
00184   * @brief  Clears the selected IO IT pending bit.
00185   * @param  IO_Pin: Selected pins to check the status.
00186   *          This parameter can be any combination of the IO pins.
00187   * @retval None
00188   */
00189 void BSP_IO_ITClear(uint32_t IO_Pin)
00190 {
00191   uint32_t io1_pin = 0;
00192
00193   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00194
00195   /* Clears the selected IO Expander 1 pin(s) mode */
00196   io1_driver->ClearIT(IO1_I2C_ADDRESS, io1_pin);
00197
00198 }
00199
00200 /**
00201   * @brief  Configures the IO pin(s) according to IO mode structure value.
00202   * @param  IO_Pin: Output pin to be set or reset.
00203   *          This parameter can be any combination of the IO pins.
00204   * @param  IO_Mode: IO pin mode to configure
00205   *          This parameter can be one of the following values:
00206   *            @arg  IO_MODE_INPUT
00207   *            @arg  IO_MODE_OUTPUT
00208   *            @arg  IO_MODE_IT_RISING_EDGE
00209   *            @arg  IO_MODE_IT_FALLING_EDGE
00210   *            @arg  IO_MODE_IT_LOW_LEVEL
00211   *            @arg  IO_MODE_IT_HIGH_LEVEL
00212   * @retval IO_OK: if all initializations are OK. Other value if error.
00213   */
00214 uint8_t BSP_IO_ConfigPin(uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
00215 {
00216   uint32_t io1_pin = 0;
00217
00218   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00219
00220
00221   /* Configure the selected IO Expander 1 pin(s) mode */
00222   io1_driver->Config(IO1_I2C_ADDRESS, io1_pin, IO_Mode);
00223
00224   return IO_OK;
00225 }
00226
00227 /**
00228   * @brief  Sets the selected pins state.
00229   * @param  IO_Pin: Selected pins to write.
00230   *          This parameter can be any combination of the IO pins.
00231   * @param  PinState: New pins state to write
00232   * @retval None
00233   */
00234 void BSP_IO_WritePin(uint32_t IO_Pin, uint8_t PinState)
00235 {
00236   uint32_t io1_pin = 0;
00237
00238   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00239
00240   /* Sets the IO Expander 1 selected pins state */
00241   io1_driver->WritePin(IO1_I2C_ADDRESS, io1_pin, PinState);
00242
00243 }
00244
00245 /**
00246   * @brief  Gets the selected pins current state.
00247   * @param  IO_Pin: Selected pins to read.
00248   *          This parameter can be any combination of the IO pins.
00249   * @retval The current pins state
00250   */
00251 uint32_t BSP_IO_ReadPin(uint32_t IO_Pin)
00252 {
00253   uint32_t pin_state = 0;
00254   uint32_t io1_pin = 0;
00255
00256   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00257
00258   /* Gets the IO Expander 1 selected pins current state */
00259   pin_state |= (io1_driver->ReadPin(IO1_I2C_ADDRESS, io1_pin)) << IO1_PIN_OFFSET;
00260
00261
00262   return pin_state;
00263 }
00264
00265 /**
00266   * @brief  Toggles the selected pins state
00267   * @param  IO_Pin: Selected pins to toggle.
00268   *          This parameter can be any combination of the IO pins.
00269   * @retval None
00270   */
00271 void BSP_IO_TogglePin(uint32_t IO_Pin)
00272 {
00273   uint32_t io1_pin = 0;
00274
00275   io1_pin = (IO_Pin & IO1_PIN_ALL) >> IO1_PIN_OFFSET;
00276
00277   /* Toggles the IO Expander 1 selected pins state */
00278   if (io1_driver->ReadPin(IO1_I2C_ADDRESS, io1_pin) == RESET) /* Set */
00279   {
00280     BSP_IO_WritePin(io1_pin, GPIO_PIN_SET); /* Reset */
00281   }
00282   else
00283   {
00284     BSP_IO_WritePin(io1_pin, GPIO_PIN_RESET);  /* Set */
00285   }
00286
00287 }
00288
00289 /**
00290   * @}
00291   */
00292
00293 /**
00294   * @}
00295   */
00296
00297 /**
00298   * @}
00299   */
00300
00301 /**
00302   * @}
00303   */
00304
00305 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_io.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_io.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_io.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_eval_io.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCO_IO_H
00023 #define __STM32L496G_DISCO_IO_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l496g_discovery.h"
00031 #include "../Components/mfxstm32l152/mfxstm32l152.h"
00032
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036
00037 /** @addtogroup STM32L496G_DISCO
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32L496G_DISCO_IO
00042   * @{
00043   */
00044
00045 /* Exported types ------------------------------------------------------------*/
00046
00047 /** @defgroup STM32L496G_DISCO_IO_Exported_Types Exported Types
00048   * @{
00049   */
00050 typedef enum
00051 {
00052   IO_OK       = 0x00,
00053   IO_ERROR    = 0x01,
00054   IO_TIMEOUT  = 0x02,
00055   IO_ALREADY_INITIALIZED  = 0x03
00056 }
00057 IO_StatusTypeDef;
00058
00059 /**
00060   * @}
00061   */
00062
00063 /** @defgroup STM32L496G_DISCO_IO_Exported_Constants Exported Constants
00064   * @{
00065   */
00066 /* Virtual pin offset IOExpander1 */
00067 #define IO1_PIN_OFFSET               0
00068
00069
00070 /* Pins definition IOExpander */
00071 #define IO1_PIN_0                     (uint32_t)(0x00000001 << IO1_PIN_OFFSET)
00072 #define IO1_PIN_1                     (uint32_t)(0x00000002 << IO1_PIN_OFFSET)
00073 #define IO1_PIN_2                     (uint32_t)(0x00000004 << IO1_PIN_OFFSET)
00074 #define IO1_PIN_3                     (uint32_t)(0x00000008 << IO1_PIN_OFFSET)
00075 #define IO1_PIN_4                     (uint32_t)(0x00000010 << IO1_PIN_OFFSET)
00076 #define IO1_PIN_5                     (uint32_t)(0x00000020 << IO1_PIN_OFFSET)
00077 #define IO1_PIN_6                     (uint32_t)(0x00000040 << IO1_PIN_OFFSET)
00078 #define IO1_PIN_7                     (uint32_t)(0x00000080 << IO1_PIN_OFFSET)
00079 #define IO1_PIN_8                     (uint32_t)(0x00000100 << IO1_PIN_OFFSET)
00080 #define AGPIO_PIN_0                   (uint32_t)(0x00010000 << IO1_PIN_OFFSET)
00081 #define AGPIO_PIN_1                   (uint32_t)(0x00020000 << IO1_PIN_OFFSET)
00082
00083 #define IO1_PIN_ALL                   (uint32_t)(0x000301FF << IO1_PIN_OFFSET)
00084
00085
00086
00087
00088 /**
00089   * @}
00090   */
00091
00092 /* Exported functions --------------------------------------------------------*/
00093
00094 /** @defgroup STM32L496G_DISCO_IO_Exported_Functions Exported Functions
00095   * @{
00096   */
00097
00098 uint8_t  BSP_IO_Init(void);
00099 void     BSP_IO_ITClear(uint32_t IO_Pin);
00100 uint32_t BSP_IO_ITGetStatus(uint32_t IO_Pin);
00101 uint8_t  BSP_IO_ConfigPin(uint32_t IO_Pin, IO_ModeTypedef IO_Mode);
00102 void     BSP_IO_WritePin(uint32_t IO_Pin, uint8_t PinState);
00103 uint32_t BSP_IO_ReadPin(uint32_t IO_Pin);
00104 void     BSP_IO_TogglePin(uint32_t IO_Pin);
00105
00106 /**
00107   * @}
00108   */
00109
00110 /**
00111   * @}
00112   */
00113
00114 /**
00115   * @}
00116   */
00117
00118 /**
00119   * @}
00120   */
00121
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125
00126 #endif /* __STM32L496G_DISCO_IO_H */
00127
00128 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_lcd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_lcd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_lcd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the driver for Liquid Crystal Display (LCD) module
00006   *          mounted on STM32L496G-DISCOVERY board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info : -----------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive indirectly an LCD TFT.
00026    - This driver supports the LS016B8UY LCD.
00027    - The LS016B8UY and ST7789H2 components driver MUST be included with this driver.
00028
00029 2. Driver description:
00030 ---------------------
00031   + Initialization steps:
00032      o Initialize the LCD using the BSP_LCD_Init() function.
00033
00034   + Display on LCD
00035      o Clear the hole LCD using BSP_LCD_Clear() function or only one specified string
00036        line using the BSP_LCD_ClearStringLine() function.
00037      o Display a character on the specified line and column using the BSP_LCD_DisplayChar()
00038        function or a complete string line using the BSP_LCD_DisplayStringAtLine() function.
00039      o Display a string line on the specified position (x,y in pixel) and align mode
00040        using the BSP_LCD_DisplayStringAtLine() function.
00041      o Draw and fill a basic shapes (dot, line, rectangle, circle, ellipse, .. bitmap)
00042        on LCD using the available set of functions.
00043
00044 ------------------------------------------------------------------------------*/
00045
00046 /* Includes ------------------------------------------------------------------*/
00047 #include "stm32l496g_discovery_lcd.h"
00048 #include "../../../Utilities/Fonts/fonts.h"
00049 #include "../../../Utilities/Fonts/font24.c"
00050 #include "../../../Utilities/Fonts/font20.c"
00051 #include "../../../Utilities/Fonts/font16.c"
00052 #include "../../../Utilities/Fonts/font12.c"
00053 #include "../../../Utilities/Fonts/font8.c"
00054
00055
00056 static uint32_t bsp_lcd_initialized = 0;
00057 static uint8_t LCD_orientation = LCD_ORIENTATION_UNDEFINED;
00058
00059 uint32_t dimming_on = 0;
00060
00061 typedef struct dimming_config_s
00062 {
00063   uint8_t   ongoing;
00064   uint8_t   start;
00065   uint8_t   stop;
00066   uint8_t   step;
00067   uint8_t   delay;
00068 } dimming_config_t;
00069
00070 #define __DIMMING_CYCLE_VALUE(value)  (uint32_t)((PERIOD_VALUE * value)/100)
00071 static dimming_config_t dimming_config = { 0, 25, 5, 1, PULSE_DECREASE_DELAY };
00072
00073 #if defined(LPTIMER_DIMMING)
00074 LPTIM_HandleTypeDef         LCD_LpTimHandle;
00075 #endif
00076 /* Timer handler declaration */
00077 TIM_HandleTypeDef    LCD_TimHandle;
00078 /* Timer Output Compare Configuration Structure declaration */
00079 TIM_OC_InitTypeDef LCD_sConfig;
00080
00081 #if defined(LPTIMER_DIMMING)
00082 extern uint32_t dimming_enable;
00083 #endif
00084
00085
00086 extern uint32_t ts_io_init;
00087
00088 /* Use by application to not use backlight */
00089 FlagStatus WakeUpFromStandby;
00090 FlagStatus WakeUpFromShutdown;
00091
00092
00093 /** @addtogroup BSP
00094   * @{
00095   */
00096
00097 /** @addtogroup STM32L496G_DISCOVERY
00098   * @{
00099   */
00100
00101 /** @defgroup STM32L496G_DISCOVERY_LCD STM32L496G-DISCOVERY LCD
00102   * @{
00103   */
00104
00105 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_TypesDefinitions STM32L496G Discovery Lcd Private TypesDef
00106   * @{
00107   */
00108 /**
00109   * @}
00110   */
00111
00112 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_Defines STM32L496G Discovery Lcd Private Defines
00113   * @{
00114   */
00115 #define POLY_X(Z)              ((int32_t)((Points + Z)->X))
00116 #define POLY_Y(Z)              ((int32_t)((Points + Z)->Y))
00117 /**
00118   * @}
00119   */
00120
00121 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_Macros STM32L496G Discovery Lcd Private Macros
00122   * @{
00123   */
00124 #define ABS(X)  ((X) > 0 ? (X) : -(X))
00125 /**
00126   * @}
00127   */
00128
00129 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_Variables STM32L496G Discovery Lcd Private Variables
00130   * @{
00131   */
00132 LCD_DrawPropTypeDef DrawProp;
00133 static LCD_DrvTypeDef  *LcdDrv;
00134
00135
00136 /**
00137   * @}
00138   */
00139
00140 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_FunctionPrototypes STM32L496G Discovery Lcd Private Prototypes
00141   * @{
00142   */
00143 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c);
00144 static void SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00145 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3);
00146 /**
00147   * @}
00148   */
00149
00150 /** @defgroup STM32L496G_DISCOVERY_LCD_Private_Functions STM32L496G Discovery Lcd Private Functions
00151   * @{
00152   */
00153 /**
00154   * @brief  Initializes the LCD.
00155   * @param  None
00156   * @retval LCD state
00157   */
00158 uint8_t BSP_LCD_Init(void)
00159 {
00160   return (BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE));
00161 }
00162
00163 /**
00164   * @brief  Initializes the LCD with a given orientation.
00165   * @param  orientation: LCD_ORIENTATION_PORTRAIT or LCD_ORIENTATION_LANDSCAPE
00166   * @retval LCD state
00167   */
00168 uint8_t BSP_LCD_InitEx(uint32_t orientation)
00169 {
00170   uint8_t ret = LCD_ERROR;
00171   uint32_t i = 0;
00172
00173   if (bsp_lcd_initialized == 1)
00174   {
00175     ret = LCD_OK;
00176   }
00177   else
00178   {
00179     /* Initialize the IO functionalities */
00180     if (BSP_IO_Init() == IO_ERROR)
00181     {
00182       BSP_ErrorHandler();
00183     }
00184
00185     /* Initialize LCD special pins GPIOs */
00186     BSP_LCD_MspInit();
00187
00188     /* LCD Power On */
00189     HAL_GPIO_WritePin(LCD_PWR_CTRL_GPIO_PORT, LCD_PWR_CTRL_PIN, GPIO_PIN_RESET);
00190
00191     /* Default value for draw propriety */
00192     DrawProp.BackColor = 0xFFFF;
00193     DrawProp.pFont     = &Font24;
00194     DrawProp.TextColor = 0x0000;
00195
00196     if ((WakeUpFromStandby == RESET) && (WakeUpFromShutdown == RESET))
00197     {
00198       /* Backlight control signal assertion */
00199       HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);
00200     }
00201
00202     /* Reset the LCD */
00203     BSP_LCD_Reset();
00204
00205     if (ST7789H2_drv.ReadID() == ST7789H2_ID)
00206     {
00207       LcdDrv = &ST7789H2_drv;
00208
00209       /* LCD Init */
00210       LcdDrv->Init();
00211
00212       /* Fill LCD frame memory with white pixels (or black pixels if INIT_BLACK_LCD is enabled) */
00213       ST7789H2_WriteReg(ST7789H2_WRITE_RAM, (uint8_t *)NULL, 0);  /* RAM Write Data */
00214       for (i = 0; i < (ST7789H2_LCD_PIXEL_WIDTH * ST7789H2_LCD_PIXEL_HEIGHT); i++)
00215       {
00216 #if defined(INIT_BLACK_LCD)
00217         LCD_IO_WriteData(0x0);
00218 #else
00219         LCD_IO_WriteData(0xFFFF);
00220 #endif
00221       }
00222
00223       if (orientation == LCD_ORIENTATION_PORTRAIT)
00224       {
00225         ST7789H2_SetOrientation(ST7789H2_ORIENTATION_PORTRAIT);
00226         LCD_orientation = LCD_ORIENTATION_PORTRAIT;
00227       }
00228       else
00229       {
00230         LCD_orientation = LCD_ORIENTATION_LANDSCAPE;
00231       }
00232       /* Initialize the font */
00233       BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00234
00235       bsp_lcd_initialized = 1;
00236       ret = LCD_OK;
00237     }
00238   }
00239
00240   return ret;
00241 }
00242
00243 /**
00244   * @brief  Reset the LCD.
00245   * @param  None
00246   * @retval LCD state
00247   */
00248 void BSP_LCD_Reset(void)
00249 {
00250   /* Apply hardware reset according to procedure indicated in FRD154BP2901 documentation */
00251   BSP_IO_WritePin(LCD_RST_PIN, GPIO_PIN_RESET);
00252   HAL_Delay(5);   /* Reset signal asserted during 5ms  */
00253   BSP_IO_WritePin(LCD_RST_PIN, GPIO_PIN_SET);
00254   HAL_Delay(10);  /* Reset signal released during 10ms */
00255   BSP_IO_WritePin(LCD_RST_PIN, GPIO_PIN_RESET);
00256   HAL_Delay(20);  /* Reset signal asserted during 20ms */
00257   BSP_IO_WritePin(LCD_RST_PIN, GPIO_PIN_SET);
00258   HAL_Delay(10);  /* Reset signal released during 10ms */
00259 }
00260
00261 /**
00262   * @brief  DeInitializes the LCD.
00263   * @param  None
00264   * @retval LCD state
00265   */
00266 uint8_t BSP_LCD_DeInit(void)
00267 {
00268   BSP_LCD_MspDeInit();
00269
00270   bsp_lcd_initialized = 0;
00271   ts_io_init = 0;
00272
00273   return LCD_OK;
00274 }
00275
00276 /**
00277   * @brief  Gets the LCD X size.
00278   * @param  None
00279   * @retval Used LCD X size
00280   */
00281 uint32_t BSP_LCD_GetXSize(void)
00282 {
00283   return (LcdDrv->GetLcdPixelWidth());
00284 }
00285
00286 /**
00287   * @brief  Gets the LCD Y size.
00288   * @param  None
00289   * @retval Used LCD Y size
00290   */
00291 uint32_t BSP_LCD_GetYSize(void)
00292 {
00293   return (LcdDrv->GetLcdPixelHeight());
00294 }
00295
00296 /**
00297   * @brief  Gets the LCD text color.
00298   * @param  None
00299   * @retval Used text color.
00300   */
00301 uint16_t BSP_LCD_GetTextColor(void)
00302 {
00303   return DrawProp.TextColor;
00304 }
00305
00306 /**
00307   * @brief  Gets the LCD background color.
00308   * @param  None
00309   * @retval Used background color
00310   */
00311 uint16_t BSP_LCD_GetBackColor(void)
00312 {
00313   return DrawProp.BackColor;
00314 }
00315
00316 /**
00317   * @brief  Sets the LCD text color.
00318   * @param  Color: Text color code RGB(5-6-5)
00319   * @retval None
00320   */
00321 void BSP_LCD_SetTextColor(uint16_t Color)
00322 {
00323   DrawProp.TextColor = Color;
00324 }
00325
00326 /**
00327   * @brief  Sets the LCD background color.
00328   * @param  Color: Background color code RGB(5-6-5)
00329   * @retval None
00330   */
00331 void BSP_LCD_SetBackColor(uint16_t Color)
00332 {
00333   DrawProp.BackColor = Color;
00334 }
00335
00336 /**
00337   * @brief  Sets the LCD text font.
00338   * @param  fonts: Font to be used
00339   * @retval None
00340   */
00341 void BSP_LCD_SetFont(sFONT *fonts)
00342 {
00343   DrawProp.pFont = fonts;
00344 }
00345
00346 /**
00347   * @brief  Gets the LCD text font.
00348   * @param  None
00349   * @retval Used font
00350   */
00351 sFONT *BSP_LCD_GetFont(void)
00352 {
00353   return DrawProp.pFont;
00354 }
00355
00356 /**
00357   * @brief  Clears the hole LCD.
00358   * @param  Color: Color of the background
00359   * @retval None
00360   */
00361 void BSP_LCD_Clear(uint16_t Color)
00362 {
00363   uint32_t counter = 0;
00364   uint32_t y_size = 0;
00365   uint32_t color_backup = DrawProp.TextColor;
00366
00367   DrawProp.TextColor = Color;
00368   y_size =  BSP_LCD_GetYSize();
00369
00370   for (counter = 0; counter < y_size; counter++)
00371   {
00372     BSP_LCD_DrawHLine(0, counter, BSP_LCD_GetXSize());
00373   }
00374   DrawProp.TextColor = color_backup;
00375   BSP_LCD_SetTextColor(DrawProp.TextColor);
00376 }
00377
00378 /**
00379   * @brief  Clears the selected line.
00380   * @param  Line: Line to be cleared
00381   *          This parameter can be one of the following values:
00382   *            @arg  0..9: if the Current fonts is Font16x24
00383   *            @arg  0..19: if the Current fonts is Font12x12 or Font8x12
00384   *            @arg  0..29: if the Current fonts is Font8x8
00385   * @retval None
00386   */
00387 void BSP_LCD_ClearStringLine(uint16_t Line)
00388 {
00389   uint32_t color_backup = DrawProp.TextColor;
00390
00391   DrawProp.TextColor = DrawProp.BackColor;;
00392
00393   /* Draw a rectangle with background color */
00394   BSP_LCD_FillRect(0, (Line * DrawProp.pFont->Height), BSP_LCD_GetXSize(), DrawProp.pFont->Height);
00395
00396   DrawProp.TextColor = color_backup;
00397   BSP_LCD_SetTextColor(DrawProp.TextColor);
00398 }
00399
00400 /**
00401   * @brief  Displays one character.
00402   * @param  Xpos: Start column address
00403   * @param  Ypos: Line where to display the character shape.
00404   * @param  Ascii: Character ascii code
00405   *           This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E
00406   * @retval None
00407   */
00408 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
00409 {
00410   DrawChar(Xpos, Ypos, &DrawProp.pFont->table[(Ascii - ' ') *\
00411                                               DrawProp.pFont->Height * ((DrawProp.pFont->Width + 7) / 8)]);
00412 }
00413
00414 /**
00415   * @brief  Displays characters on the LCD.
00416   * @param  Xpos: X position (in pixel)
00417   * @param  Ypos: Y position (in pixel)
00418   * @param  Text: Pointer to string to display on LCD
00419   * @param  Mode: Display mode
00420   *          This parameter can be one of the following values:
00421   *            @arg  CENTER_MODE
00422   *            @arg  RIGHT_MODE
00423   *            @arg  LEFT_MODE
00424   * @retval None
00425   */
00426 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode)
00427 {
00428   uint16_t refcolumn = 1, i = 0;
00429   uint32_t size = 0, xsize = 0;
00430   uint8_t  *ptr = Text;
00431
00432   /* Get the text size */
00433   while (*ptr++)
00434   {
00435     size ++ ;
00436   }
00437
00438   /* Characters number per line */
00439   xsize = (BSP_LCD_GetXSize() / DrawProp.pFont->Width);
00440
00441   switch (Mode)
00442   {
00443     case CENTER_MODE:
00444     {
00445       refcolumn = Xpos + ((xsize - size) * DrawProp.pFont->Width) / 2;
00446       break;
00447     }
00448     case LEFT_MODE:
00449     {
00450       refcolumn = Xpos;
00451       break;
00452     }
00453     case RIGHT_MODE:
00454     {
00455       refcolumn =  - Xpos + ((xsize - size) * DrawProp.pFont->Width);
00456       break;
00457     }
00458     default:
00459     {
00460       refcolumn = Xpos;
00461       break;
00462     }
00463   }
00464
00465   /* Check that the Start column is located in the screen */
00466   if ((refcolumn < 1) || (refcolumn >= 0x8000))
00467   {
00468     refcolumn = 1;
00469   }
00470
00471   /* Send the string character by character on lCD */
00472   while ((*Text != 0) && (((BSP_LCD_GetXSize() - (i * DrawProp.pFont->Width)) & 0xFFFF) >= DrawProp.pFont->Width))
00473   {
00474     /* Display one character on LCD */
00475     BSP_LCD_DisplayChar(refcolumn, Ypos, *Text);
00476     /* Decrement the column position by 16 */
00477     refcolumn += DrawProp.pFont->Width;
00478     /* Point on the next character */
00479     Text++;
00480     i++;
00481   }
00482 }
00483
00484 /**
00485   * @brief  Displays a character on the LCD.
00486   * @param  Line: Line where to display the character shape
00487   *          This parameter can be one of the following values:
00488   *            @arg  0..9: if the Current fonts is Font16x24
00489   *            @arg  0..19: if the Current fonts is Font12x12 or Font8x12
00490   *            @arg  0..29: if the Current fonts is Font8x8
00491   * @param  ptr: Pointer to string to display on LCD
00492   * @retval None
00493   */
00494 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr)
00495 {
00496   BSP_LCD_DisplayStringAt(0, LINE(Line), ptr, LEFT_MODE);
00497 }
00498
00499 /**
00500   * @brief  Reads an LCD pixel.
00501   * @param  Xpos: X position
00502   * @param  Ypos: Y position
00503   * @retval RGB pixel color
00504   */
00505 uint16_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
00506 {
00507   uint16_t ret = 0;
00508
00509   if (LcdDrv->ReadPixel != NULL)
00510   {
00511     ret = LcdDrv->ReadPixel(Xpos, Ypos);
00512   }
00513
00514   return ret;
00515 }
00516
00517 /**
00518   * @brief  Draws a pixel on LCD.
00519   * @param  Xpos: X position
00520   * @param  Ypos: Y position
00521   * @param  RGB_Code: Pixel color in RGB mode (5-6-5)
00522   * @retval None
00523   */
00524 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
00525 {
00526   if (LcdDrv->WritePixel != NULL)
00527   {
00528     LcdDrv->WritePixel(Xpos, Ypos, RGB_Code);
00529   }
00530 }
00531
00532 /**
00533   * @brief  Draws an horizontal line.
00534   * @param  Xpos: X position
00535   * @param  Ypos: Y position
00536   * @param  Length: Line length
00537   * @retval None
00538   */
00539 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00540 {
00541   uint32_t index = 0;
00542
00543   if (LcdDrv->DrawHLine != NULL)
00544   {
00545     LcdDrv->DrawHLine(DrawProp.TextColor, Xpos, Ypos, Length);
00546   }
00547   else
00548   {
00549     for (index = 0; index < Length; index++)
00550     {
00551       BSP_LCD_DrawPixel((Xpos + index), Ypos, DrawProp.TextColor);
00552     }
00553   }
00554 }
00555
00556 /**
00557   * @brief  Draws a vertical line.
00558   * @param  Xpos: X position
00559   * @param  Ypos: Y position
00560   * @param  Length: Line length
00561   * @retval None
00562   */
00563 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length)
00564 {
00565   uint32_t index = 0;
00566
00567   if (LcdDrv->DrawVLine != NULL)
00568   {
00569     LcdDrv->DrawVLine(DrawProp.TextColor, Xpos, Ypos, Length);
00570   }
00571   else
00572   {
00573     for (index = 0; index < Length; index++)
00574     {
00575       BSP_LCD_DrawPixel(Xpos, Ypos + index, DrawProp.TextColor);
00576     }
00577   }
00578 }
00579
00580 /**
00581   * @brief  Draws an uni-line (between two points).
00582   * @param  x1: Point 1 X position
00583   * @param  y1: Point 1 Y position
00584   * @param  x2: Point 2 X position
00585   * @param  y2: Point 2 Y position
00586   * @retval None
00587   */
00588 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
00589 {
00590   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
00591           yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
00592           curpixel = 0;
00593
00594   deltax = ABS(x2 - x1);        /* The difference between the x's */
00595   deltay = ABS(y2 - y1);        /* The difference between the y's */
00596   x = x1;                       /* Start x off at the first pixel */
00597   y = y1;                       /* Start y off at the first pixel */
00598
00599   if (x2 >= x1)                 /* The x-values are increasing */
00600   {
00601     xinc1 = 1;
00602     xinc2 = 1;
00603   }
00604   else                          /* The x-values are decreasing */
00605   {
00606     xinc1 = -1;
00607     xinc2 = -1;
00608   }
00609
00610   if (y2 >= y1)                 /* The y-values are increasing */
00611   {
00612     yinc1 = 1;
00613     yinc2 = 1;
00614   }
00615   else                          /* The y-values are decreasing */
00616   {
00617     yinc1 = -1;
00618     yinc2 = -1;
00619   }
00620
00621   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
00622   {
00623     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
00624     yinc2 = 0;                  /* Don't change the y for every iteration */
00625     den = deltax;
00626     num = deltax / 2;
00627     numadd = deltay;
00628     numpixels = deltax;         /* There are more x-values than y-values */
00629   }
00630   else                          /* There is at least one y-value for every x-value */
00631   {
00632     xinc2 = 0;                  /* Don't change the x for every iteration */
00633     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
00634     den = deltay;
00635     num = deltay / 2;
00636     numadd = deltax;
00637     numpixels = deltay;         /* There are more y-values than x-values */
00638   }
00639
00640   for (curpixel = 0; curpixel <= numpixels; curpixel++)
00641   {
00642     BSP_LCD_DrawPixel(x, y, DrawProp.TextColor);  /* Draw the current pixel */
00643     num += numadd;                            /* Increase the numerator by the top of the fraction */
00644     if (num >= den)                           /* Check if numerator >= denominator */
00645     {
00646       num -= den;                             /* Calculate the new numerator value */
00647       x += xinc1;                             /* Change the x as appropriate */
00648       y += yinc1;                             /* Change the y as appropriate */
00649     }
00650     x += xinc2;                               /* Change the x as appropriate */
00651     y += yinc2;                               /* Change the y as appropriate */
00652   }
00653 }
00654
00655 /**
00656   * @brief  Draws a rectangle.
00657   * @param  Xpos: X position
00658   * @param  Ypos: Y position
00659   * @param  Width: Rectangle width
00660   * @param  Height: Rectangle height
00661   * @retval None
00662   */
00663 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00664 {
00665   /* Draw horizontal lines */
00666   BSP_LCD_DrawHLine(Xpos, Ypos, Width);
00667   BSP_LCD_DrawHLine(Xpos, (Ypos + Height), Width);
00668
00669   /* Draw vertical lines */
00670   BSP_LCD_DrawVLine(Xpos, Ypos, Height);
00671   BSP_LCD_DrawVLine((Xpos + Width), Ypos, Height);
00672 }
00673
00674 /**
00675   * @brief  Draws a circle.
00676   * @param  Xpos: X position
00677   * @param  Ypos: Y position
00678   * @param  Radius: Circle radius
00679   * @retval None
00680   */
00681 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00682 {
00683   int32_t  decision;       /* Decision Variable */
00684   uint32_t  current_x;   /* Current X Value */
00685   uint32_t  current_y;   /* Current Y Value */
00686
00687   decision = 3 - (Radius << 1);
00688   current_x = 0;
00689   current_y = Radius;
00690
00691   while (current_x <= current_y)
00692   {
00693     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos - current_y), DrawProp.TextColor);
00694
00695     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos - current_y), DrawProp.TextColor);
00696
00697     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos - current_x), DrawProp.TextColor);
00698
00699     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos - current_x), DrawProp.TextColor);
00700
00701     BSP_LCD_DrawPixel((Xpos + current_x), (Ypos + current_y), DrawProp.TextColor);
00702
00703     BSP_LCD_DrawPixel((Xpos - current_x), (Ypos + current_y), DrawProp.TextColor);
00704
00705     BSP_LCD_DrawPixel((Xpos + current_y), (Ypos + current_x), DrawProp.TextColor);
00706
00707     BSP_LCD_DrawPixel((Xpos - current_y), (Ypos + current_x), DrawProp.TextColor);
00708
00709     /* Initialize the font */
00710     BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
00711
00712     if (decision < 0)
00713     {
00714       decision += (current_x << 2) + 6;
00715     }
00716     else
00717     {
00718       decision += ((current_x - current_y) << 2) + 10;
00719       current_y--;
00720     }
00721     current_x++;
00722   }
00723 }
00724
00725 /**
00726   * @brief  Draws an poly-line (between many points).
00727   * @param  Points: Pointer to the points array
00728   * @param  PointCount: Number of points
00729   * @retval None
00730   */
00731 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount)
00732 {
00733   int16_t x = 0, y = 0;
00734
00735   if (PointCount < 2)
00736   {
00737     return;
00738   }
00739
00740   BSP_LCD_DrawLine(Points->X, Points->Y, (Points + PointCount - 1)->X, (Points + PointCount - 1)->Y);
00741
00742   while (--PointCount)
00743   {
00744     x = Points->X;
00745     y = Points->Y;
00746     Points++;
00747     BSP_LCD_DrawLine(x, y, Points->X, Points->Y);
00748   }
00749 }
00750
00751 /**
00752   * @brief  Draws an ellipse on LCD.
00753   * @param  Xpos: X position
00754   * @param  Ypos: Y position
00755   * @param  XRadius: Ellipse X radius
00756   * @param  YRadius: Ellipse Y radius
00757   * @retval None
00758   */
00759 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00760 {
00761   int x = 0, y = -YRadius, err = 2 - 2 * XRadius, e2;
00762   float k = 0, rad1 = 0, rad2 = 0;
00763
00764   rad1 = XRadius;
00765   rad2 = YRadius;
00766
00767   k = (float)(rad2 / rad1);
00768
00769   do
00770   {
00771     BSP_LCD_DrawPixel((Xpos - (uint16_t)(x / k)), (Ypos + y), DrawProp.TextColor);
00772     BSP_LCD_DrawPixel((Xpos + (uint16_t)(x / k)), (Ypos + y), DrawProp.TextColor);
00773     BSP_LCD_DrawPixel((Xpos + (uint16_t)(x / k)), (Ypos - y), DrawProp.TextColor);
00774     BSP_LCD_DrawPixel((Xpos - (uint16_t)(x / k)), (Ypos - y), DrawProp.TextColor);
00775
00776     e2 = err;
00777     if (e2 <= x)
00778     {
00779       err += ++x * 2 + 1;
00780       if (-y == x && e2 <= y)
00781       {
00782         e2 = 0;
00783       }
00784     }
00785     if (e2 > y)
00786     {
00787       err += ++y * 2 + 1;
00788     }
00789   }
00790   while (y <= 0);
00791 }
00792
00793 /**
00794   * @brief  Draws a bitmap picture (16 bpp).
00795   * @param  Xpos: Bmp X position in the LCD
00796   * @param  Ypos: Bmp Y position in the LCD
00797   * @param  pbmp: Pointer to Bmp picture address.
00798   * @retval None
00799   */
00800 void BSP_LCD_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
00801 {
00802   uint32_t height = 0;
00803   uint32_t width  = 0;
00804
00805
00806   /* Read bitmap width */
00807   width = *(uint16_t *)(pbmp + 18);
00808   width |= (*(uint16_t *)(pbmp + 20)) << 16;
00809
00810   /* Read bitmap height */
00811   height = *(uint16_t *)(pbmp + 22);
00812   height |= (*(uint16_t *)(pbmp + 24)) << 16;
00813
00814   SetDisplayWindow(Xpos, Ypos, width, height);
00815
00816   if (LcdDrv->DrawBitmap != NULL)
00817   {
00818     LcdDrv->DrawBitmap(Xpos, Ypos, pbmp);
00819   }
00820   SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
00821 }
00822
00823 /**
00824   * @brief  Draws RGB Image (16 bpp).
00825   * @param  Xpos:  X position in the LCD
00826   * @param  Ypos:  Y position in the LCD
00827   * @param  Xsize: X size in the LCD
00828   * @param  Ysize: Y size in the LCD
00829   * @param  pdata: Pointer to the RGB Image address.
00830   * @retval None
00831   */
00832 void BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
00833 {
00834
00835   SetDisplayWindow(Xpos, Ypos, Xsize, Ysize);
00836
00837   if (LcdDrv->DrawRGBImage != NULL)
00838   {
00839     LcdDrv->DrawRGBImage(Xpos, Ypos, Xsize, Ysize, pdata);
00840   }
00841   SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
00842 }
00843
00844 /**
00845   * @brief  Draws a full rectangle.
00846   * @param  Xpos: X position
00847   * @param  Ypos: Y position
00848   * @param  Width: Rectangle width
00849   * @param  Height: Rectangle height
00850   * @retval None
00851   */
00852 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
00853 {
00854   BSP_LCD_SetTextColor(DrawProp.TextColor);
00855   do
00856   {
00857     BSP_LCD_DrawHLine(Xpos, Ypos++, Width);
00858   }
00859   while (Height--);
00860 }
00861
00862 /**
00863   * @brief  Draws a full circle.
00864   * @param  Xpos: X position
00865   * @param  Ypos: Y position
00866   * @param  Radius: Circle radius
00867   * @retval None
00868   */
00869 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
00870 {
00871   int32_t  decision;        /* Decision Variable */
00872   uint32_t  current_x;    /* Current X Value */
00873   uint32_t  current_y;    /* Current Y Value */
00874
00875   decision = 3 - (Radius << 1);
00876
00877   current_x = 0;
00878   current_y = Radius;
00879
00880   BSP_LCD_SetTextColor(DrawProp.TextColor);
00881
00882   while (current_x <= current_y)
00883   {
00884     if (current_y > 0)
00885     {
00886       BSP_LCD_DrawHLine(Xpos - current_y, Ypos + current_x, 2 * current_y);
00887       BSP_LCD_DrawHLine(Xpos - current_y, Ypos - current_x, 2 * current_y);
00888     }
00889
00890     if (current_x > 0)
00891     {
00892       BSP_LCD_DrawHLine(Xpos - current_x, Ypos - current_y, 2 * current_x);
00893       BSP_LCD_DrawHLine(Xpos - current_x, Ypos + current_y, 2 * current_x);
00894     }
00895     if (decision < 0)
00896     {
00897       decision += (current_x << 2) + 6;
00898     }
00899     else
00900     {
00901       decision += ((current_x - current_y) << 2) + 10;
00902       current_y--;
00903     }
00904     current_x++;
00905   }
00906
00907   BSP_LCD_SetTextColor(DrawProp.TextColor);
00908   BSP_LCD_DrawCircle(Xpos, Ypos, Radius);
00909 }
00910
00911 /**
00912   * @brief  Draws a full poly-line (between many points).
00913   * @param  Points: Pointer to the points array
00914   * @param  PointCount: Number of points
00915   * @retval None
00916   */
00917 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount)
00918 {
00919   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;
00920   uint16_t  IMAGE_LEFT = 0, IMAGE_RIGHT = 0, IMAGE_TOP = 0, IMAGE_BOTTOM = 0;
00921
00922   IMAGE_LEFT = IMAGE_RIGHT = Points->X;
00923   IMAGE_TOP = IMAGE_BOTTOM = Points->Y;
00924
00925   for (counter = 1; counter < PointCount; counter++)
00926   {
00927     pixelX = POLY_X(counter);
00928     if (pixelX < IMAGE_LEFT)
00929     {
00930       IMAGE_LEFT = pixelX;
00931     }
00932     if (pixelX > IMAGE_RIGHT)
00933     {
00934       IMAGE_RIGHT = pixelX;
00935     }
00936
00937     pixelY = POLY_Y(counter);
00938     if (pixelY < IMAGE_TOP)
00939     {
00940       IMAGE_TOP = pixelY;
00941     }
00942     if (pixelY > IMAGE_BOTTOM)
00943     {
00944       IMAGE_BOTTOM = pixelY;
00945     }
00946   }
00947
00948   if (PointCount < 2)
00949   {
00950     return;
00951   }
00952
00953   X_center = (IMAGE_LEFT + IMAGE_RIGHT) / 2;
00954   Y_center = (IMAGE_BOTTOM + IMAGE_TOP) / 2;
00955
00956   X_first = Points->X;
00957   Y_first = Points->Y;
00958
00959   while (--PointCount)
00960   {
00961     X = Points->X;
00962     Y = Points->Y;
00963     Points++;
00964     X2 = Points->X;
00965     Y2 = Points->Y;
00966
00967     FillTriangle(X, X2, X_center, Y, Y2, Y_center);
00968     FillTriangle(X, X_center, X2, Y, Y_center, Y2);
00969     FillTriangle(X_center, X2, X, Y_center, Y2, Y);
00970   }
00971
00972   FillTriangle(X_first, X2, X_center, Y_first, Y2, Y_center);
00973   FillTriangle(X_first, X_center, X2, Y_first, Y_center, Y2);
00974   FillTriangle(X_center, X2, X_first, Y_center, Y2, Y_first);
00975 }
00976
00977 /**
00978   * @brief  Draws a full ellipse.
00979   * @param  Xpos: X position
00980   * @param  Ypos: Y position
00981   * @param  XRadius: Ellipse X radius
00982   * @param  YRadius: Ellipse Y radius
00983   * @retval None
00984   */
00985 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius)
00986 {
00987   int x = 0, y = -YRadius, err = 2 - 2 * XRadius, e2;
00988   float k = 0, rad1 = 0, rad2 = 0;
00989
00990   rad1 = XRadius;
00991   rad2 = YRadius;
00992
00993   k = (float)(rad2 / rad1);
00994
00995   do
00996   {
00997     BSP_LCD_DrawHLine((Xpos - (uint16_t)(x / k)), (Ypos + y), (2 * (uint16_t)(x / k) + 1));
00998     BSP_LCD_DrawHLine((Xpos - (uint16_t)(x / k)), (Ypos - y), (2 * (uint16_t)(x / k) + 1));
00999
01000     e2 = err;
01001     if (e2 <= x)
01002     {
01003       err += ++x * 2 + 1;
01004       if (-y == x && e2 <= y)
01005       {
01006         e2 = 0;
01007       }
01008     }
01009     if (e2 > y)
01010     {
01011       err += ++y * 2 + 1;
01012     }
01013   }
01014   while (y <= 0);
01015 }
01016
01017 /**
01018   * @brief  Enables the display.
01019   * @param  None
01020   * @retval None
01021   */
01022 void BSP_LCD_DisplayOn(void)
01023 {
01024   LcdDrv->DisplayOn();
01025 }
01026
01027 /**
01028   * @brief  Disables the display.
01029   * @param  None
01030   * @retval None
01031   */
01032 void BSP_LCD_DisplayOff(void)
01033 {
01034   LcdDrv->DisplayOff();
01035 }
01036
01037
01038 /**
01039   * @brief  LCD screen dimming enable
01040   * @note   Screen brightness is gradually decreased
01041   * @param  start   : value in percent to start from
01042   * @param  stop    : value in percent to stop to
01043   * @param  step    : step value in percent
01044   * @param  delay   : delay in milliseconds between each step
01045   * @retval None
01046   */
01047 void BSP_LCD_ScreenDimmingConfig(const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay)
01048 {
01049   if ((dimming_config.ongoing == 0)
01050       && (start <= 100) && (stop <= 100)
01051       && (step > 0) && (step < 100))
01052   {
01053     dimming_config.start = start;
01054     dimming_config.stop  = stop;
01055     dimming_config.step  = step;
01056     dimming_config.delay = delay;
01057   }
01058 }
01059
01060
01061 /**
01062   * @brief  LCD screen dimming enable
01063   * @note   Screen brightness is gradually decreased
01064   * @param  None
01065   * @retval None
01066   */
01067 void BSP_LCD_ScreenDimmingOn(void)
01068 {
01069   static uint32_t i = 0;
01070
01071 #if defined(LPTIMER_DIMMING)
01072   /* Set that dim feature is active */
01073   if (dimming_on == 0)
01074   {
01075     dimming_on = 1;
01076     i = PULSE_DECREASE_START;
01077     /* Always redo the full initialization as there is no apriori knowledge
01078       of IO or timer settings at this point (may have been modified by application) */
01079
01080     __HAL_RCC_LSI_ENABLE();
01081     /* Select LSI as LPTIM1 clock source */
01082     __HAL_RCC_LPTIM1_CONFIG(RCC_LPTIM1CLKSOURCE_LSI);
01083
01084
01085     LCD_LpTimHandle.Instance = LPTIM1;
01086     __HAL_LPTIM_RESET_HANDLE_STATE(&LCD_LpTimHandle); /* to force MSP call */
01087
01088     LCD_LpTimHandle.Init.Clock.Source    = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC;
01089     LCD_LpTimHandle.Init.Clock.Prescaler = LPTIM_PRESCALER_DIV1;
01090     LCD_LpTimHandle.Init.CounterSource   = LPTIM_COUNTERSOURCE_INTERNAL;
01091     LCD_LpTimHandle.Init.Trigger.Source  = LPTIM_TRIGSOURCE_SOFTWARE;
01092     LCD_LpTimHandle.Init.OutputPolarity  = LPTIM_OUTPUTPOLARITY_HIGH;
01093     LCD_LpTimHandle.Init.UpdateMode      = LPTIM_UPDATE_IMMEDIATE;
01094     LCD_LpTimHandle.Init.Input1Source    = LPTIM_INPUT1SOURCE_COMP1;
01095
01096     /* Initialize LPTIM peripheral according to the passed parameters */
01097     if (HAL_LPTIM_Init(&LCD_LpTimHandle) != HAL_OK)
01098     {
01099       /* Initialization Error */
01100       BSP_ErrorHandler();
01101     }
01102
01103     if (HAL_LPTIM_PWM_Start(&LCD_LpTimHandle, PERIOD_VALUE, i) != HAL_OK)
01104     {
01105       BSP_ErrorHandler();
01106     }
01107
01108
01109   }
01110   else
01111   {
01112     i++;
01113   }
01114
01115   /* Optional delay to slow down the dimming transition. */
01116   HAL_Delay(PULSE_DECREASE_DELAY);
01117   if (HAL_LPTIM_PWM_Start(&LCD_LpTimHandle, PERIOD_VALUE, i) != HAL_OK)
01118   {
01119     BSP_ErrorHandler();
01120   }
01121   if (i == PULSE_VALUE)
01122   {
01123     dimming_enable = 0;
01124   }
01125
01126
01127 #else
01128   /* Counter Prescaler value */
01129   uint32_t uhPrescalerValue = 0;
01130   int32_t   step;
01131
01132   /* Reject this while ongoing dimming */
01133   if (dimming_config.ongoing)
01134   {
01135     return;
01136   }
01137
01138   /* Set that dim feature is active */
01139   dimming_on = 1;
01140   dimming_config.ongoing = 1;
01141
01142   if (dimming_config.stop > dimming_config.start)
01143   {
01144     step      = dimming_config.step;
01145   }
01146   else
01147   {
01148     step      = -dimming_config.step;
01149   }
01150
01151   /* Always redo the full initialization as there is no apriori knowledge
01152     of IO or timer settings at this point (may have been modified by application) */
01153
01154   /* Compute the prescaler value to have TIM1 counter clock equal to 16000000 Hz */
01155   uhPrescalerValue = (uint32_t)(SystemCoreClock / 16000000) - 1;
01156
01157   LCD_TimHandle.Instance = TIMx;
01158
01159   __HAL_TIM_RESET_HANDLE_STATE(&LCD_TimHandle); /* to force MSP call */
01160   LCD_TimHandle.Init.Prescaler         = uhPrescalerValue;
01161   LCD_TimHandle.Init.Period            = PERIOD_VALUE;
01162   LCD_TimHandle.Init.ClockDivision     = 0;
01163   LCD_TimHandle.Init.CounterMode       = (step > 0 ? TIM_COUNTERMODE_DOWN : TIM_COUNTERMODE_UP);
01164   LCD_TimHandle.Init.RepetitionCounter = 0;
01165   if (HAL_TIM_PWM_Init(&LCD_TimHandle) != HAL_OK)
01166   {
01167     /* Initialization Error */
01168     BSP_ErrorHandler();
01169   }
01170
01171   /* Common configuration for all channels */
01172   LCD_sConfig.OCMode       = TIM_OCMODE_PWM1;
01173   LCD_sConfig.OCPolarity   = TIM_OCPOLARITY_HIGH;
01174   LCD_sConfig.OCFastMode   = TIM_OCFAST_DISABLE;
01175   LCD_sConfig.OCNPolarity  = TIM_OCNPOLARITY_HIGH;
01176   LCD_sConfig.OCNIdleState = TIM_OCNIDLESTATE_RESET;
01177
01178   LCD_sConfig.OCIdleState  = TIM_OCIDLESTATE_RESET;
01179
01180   /* Set the pulse value for channel */
01181   LCD_sConfig.Pulse = __DIMMING_CYCLE_VALUE(dimming_config.start);
01182   if (HAL_TIM_PWM_ConfigChannel(&LCD_TimHandle, &LCD_sConfig, TIMx_CHANNEL) != HAL_OK)
01183   {
01184     /* Configuration Error */
01185     BSP_ErrorHandler();
01186   }
01187
01188   /* Start Timer channel */
01189   if (HAL_TIM_PWM_Start(&LCD_TimHandle, TIMx_CHANNEL) != HAL_OK)
01190   {
01191     /* PWM Generation Error */
01192     BSP_ErrorHandler();
01193   }
01194
01195   /* Set the pulse value for the timer channel */
01196   i = dimming_config.start;
01197   while (dimming_config.ongoing)
01198   {
01199     __HAL_TIM_SET_COMPARE(&LCD_TimHandle, TIMx_CHANNEL, __DIMMING_CYCLE_VALUE(i));
01200
01201     /* Exit if stop is reached */
01202     if (((step > 0) && (i >= dimming_config.stop))
01203         || ((step < 0) && (i <= dimming_config.stop)))
01204     {
01205       dimming_config.ongoing = 0;
01206     }
01207     else
01208     {
01209       HAL_Delay(dimming_config.delay);
01210       i += step;
01211     }
01212   }
01213 #endif
01214 }
01215
01216 /**
01217   * @brief  LCD screen dimming disable
01218   * @note   Screen brightness is immediately set to its highest level
01219   * @param  None
01220   * @retval None
01221   */
01222 void BSP_LCD_ScreenDimmingOff(void)
01223 {
01224 #if defined(LPTIMER_DIMMING)
01225   GPIO_InitTypeDef GPIO_InitStructure;
01226 #endif
01227
01228   if (dimming_on == 1)
01229   {
01230     /* Stop ongoing dimming */
01231     dimming_config.ongoing = 0;
01232
01233 #if defined(LPTIMER_DIMMING)
01234
01235     /* Restore LCD BL GPIO setting */
01236     GPIO_InitStructure.Pin       = LCD_BL_CTRL_PIN;
01237     GPIO_InitStructure.Mode      = GPIO_MODE_OUTPUT_PP;
01238     GPIO_InitStructure.Pull      = GPIO_NOPULL;
01239     GPIO_InitStructure.Alternate = 0;
01240     GPIO_InitStructure.Speed   = GPIO_SPEED_LOW;
01241     HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &GPIO_InitStructure);
01242
01243     /* Stop LP Timer channel */
01244     if (HAL_LPTIM_PWM_Stop(&LCD_LpTimHandle) != HAL_OK)
01245     {
01246       /* PWM Generation Error */
01247       BSP_ErrorHandler();
01248     }
01249
01250     /* Disable timer clock for power consumption reasons */
01251     __HAL_RCC_LPTIM1_CLK_DISABLE();
01252 #else
01253     /* Stop Timer channel */
01254     if (HAL_TIM_PWM_Stop(&LCD_TimHandle, TIMx_CHANNEL) != HAL_OK)
01255     {
01256       /* PWM Generation Error */
01257       BSP_ErrorHandler();
01258     }
01259
01260     /* Disable timer clock for power consumption reasons */
01261     TIMx_CLK_DISABLE();
01262 #endif
01263
01264     dimming_on = 0;
01265   }
01266 }
01267
01268
01269
01270 /**
01271   * @brief TIM MSP Initialization
01272   *        This function configures the hardware resources used for screen dimming:
01273   *           - Peripheral's clock enable
01274   *           - Peripheral's GPIO Configuration
01275   * @param htim: TIM handle pointer
01276   * @retval None
01277   */
01278 void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim)
01279 {
01280   GPIO_InitTypeDef   GPIO_InitStruct;
01281
01282   /* TIMx Peripheral clock enable */
01283   TIMx_CLK_ENABLE();
01284
01285   /* Timer channel configuration */
01286
01287   GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
01288   GPIO_InitStruct.Pull = GPIO_PULLUP;
01289   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
01290
01291   GPIO_InitStruct.Alternate = TIMx_CHANNEl_AF;
01292   GPIO_InitStruct.Pin = GPIO_PIN_0;
01293   HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
01294 }
01295
01296
01297 #if defined(LPTIMER_DIMMING)
01298 /**
01299 * @brief  LPTIM MSP Init
01300 * @param  hlptim : LPTIM handle
01301 * @retval None
01302 */
01303 void HAL_LPTIM_MspInit(LPTIM_HandleTypeDef *hlptim)
01304 {
01305   GPIO_InitTypeDef     GPIO_InitStruct;
01306
01307   /* ## - 1 - Enable LPTIM clock ############################################ */
01308   __HAL_RCC_LPTIM1_CLK_ENABLE();
01309
01310   /* ## - 2 - Force & Release the LPTIM Periheral Clock Reset ############### */
01311   /* Force the LPTIM Periheral Clock Reset */
01312   __HAL_RCC_LPTIM1_FORCE_RESET();
01313
01314   /* Release the LPTIM Periheral Clock Reset */
01315   __HAL_RCC_LPTIM1_RELEASE_RESET();
01316
01317   /* ## - 3 - Enable & Configure LPTIM Ultra Low Power Input ################# */
01318   /* Configure PG.15 (LPTIM1_OUT) in alternate function,
01319   Low speed push-pull mode and pull-up enabled. */
01320
01321   /* Enable GPIO PORT(s)*/
01322   LCD_BL_CTRL_GPIO_CLK_ENABLE();
01323
01324   /* Configure Backlight control pin GPIO  */
01325   GPIO_InitStruct.Pin = LCD_BL_CTRL_PIN;
01326   GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
01327   GPIO_InitStruct.Pull = GPIO_PULLUP;
01328   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
01329   GPIO_InitStruct.Alternate = GPIO_AF1_LPTIM1;
01330   HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &GPIO_InitStruct);
01331 }
01332 #endif /* defined(LPTIMER_DIMMING) */
01333
01334 uint8_t BSP_LCD_GetOrientation(void)
01335 {
01336   return LCD_orientation;
01337 }
01338
01339 /**
01340   * @brief  Initializes the LCD GPIO special pins MSP.
01341   * @param  None
01342   * @retval None
01343   */
01344 __weak void BSP_LCD_MspInit(void)
01345 {
01346   GPIO_InitTypeDef GPIO_InitStructure;
01347
01348   /* Enable GPIOs clock */
01349   LCD_TE_GPIO_CLK_ENABLE();
01350   LCD_BL_CTRL_GPIO_CLK_ENABLE();
01351   LCD_PWR_CTRL_GPIO_CLK_ENABLE();
01352
01353   /* LCD_RESET GPIO configuration */
01354   if (BSP_IO_Init() == IO_ERROR)
01355   {
01356     BSP_ErrorHandler();
01357   }
01358   BSP_IO_ConfigPin(LCD_RST_PIN, IO_MODE_OUTPUT);
01359
01360   /* LCD_BL_CTRL GPIO configuration */
01361   GPIO_InitStructure.Pin       = LCD_BL_CTRL_PIN;   /* LCD_BL_CTRL pin has to be manually controlled */
01362   GPIO_InitStructure.Mode      = GPIO_MODE_OUTPUT_PP;
01363   GPIO_InitStructure.Pull      = GPIO_NOPULL;
01364   GPIO_InitStructure.Alternate = 0;
01365   GPIO_InitStructure.Speed   = GPIO_SPEED_FREQ_LOW;
01366   HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &GPIO_InitStructure);
01367
01368   /* Power on the screen (also done in Touch Screen driver ... */
01369   GPIO_InitStructure.Pin = LCD_PWR_CTRL_PIN;
01370   GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP /*GPIO_MODE_OUTPUT_PP*/;
01371   GPIO_InitStructure.Pull =   GPIO_NOPULL;
01372   GPIO_InitStructure.Alternate = 0;
01373   GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
01374   HAL_GPIO_Init(LCD_PWR_CTRL_GPIO_PORT, &GPIO_InitStructure);
01375 }
01376
01377 /**
01378   * @brief  DeInitializes LCD GPIO special pins MSP.
01379   * @param  None
01380   * @retval None
01381   */
01382 __weak void BSP_LCD_MspDeInit(void)
01383 {
01384   GPIO_InitTypeDef  GPIO_InitStructure;
01385
01386   /* LCD_BL_CTRL GPIO deactivation */
01387   GPIO_InitStructure.Pin = LCD_BL_CTRL_PIN;
01388   HAL_GPIO_DeInit(LCD_BL_CTRL_GPIO_PORT, GPIO_InitStructure.Pin);
01389
01390   /* LCD_BL_CTRL GPIO deactivation */
01391   GPIO_InitStructure.Pin = LCD_PWR_CTRL_PIN;
01392   HAL_GPIO_DeInit(LCD_PWR_CTRL_GPIO_PORT, GPIO_InitStructure.Pin);
01393
01394   /* GPIO pins clock can be shut down in the application
01395      by surcharging this __weak function */
01396 }
01397
01398 /******************************************************************************
01399                             Static Functions
01400 *******************************************************************************/
01401
01402 /**
01403   * @brief  Draws a character on LCD.
01404   * @param  Xpos: Line where to display the character shape
01405   * @param  Ypos: Start column address
01406   * @param  c: Pointer to the character data
01407   * @retval None
01408   */
01409 static void DrawChar(uint16_t Xpos, uint16_t Ypos, const uint8_t *c)
01410 {
01411   uint32_t i = 0, j = 0;
01412   uint16_t height, width;
01413   uint8_t offset;
01414   uint8_t *pchar;
01415   uint32_t line;
01416
01417   height = DrawProp.pFont->Height;
01418   width  = DrawProp.pFont->Width;
01419
01420   offset =  8 * ((width + 7) / 8) -  width ;
01421
01422   for (i = 0; i < height; i++)
01423   {
01424     pchar = ((uint8_t *)c + (width + 7) / 8 * i);
01425
01426     switch (((width + 7) / 8))
01427     {
01428       case 1:
01429         line =  pchar[0];
01430         break;
01431
01432       case 2:
01433         line = (pchar[0] << 8) | pchar[1];
01434         break;
01435
01436       case 3:
01437       default:
01438         line = (pchar[0] << 16) | (pchar[1] << 8) | pchar[2];
01439         break;
01440     }
01441
01442     for (j = 0; j < width; j++)
01443     {
01444       if ((line & (1 << (width - j + offset - 1))) != 0)
01445       {
01446         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp.TextColor);
01447       }
01448       else
01449       {
01450         BSP_LCD_DrawPixel((Xpos + j), Ypos, DrawProp.BackColor);
01451       }
01452     }
01453     Ypos++;
01454   }
01455 }
01456
01457 /**
01458   * @brief  Sets display window.
01459   * @param  LayerIndex: layer index
01460   * @param  Xpos: LCD X position
01461   * @param  Ypos: LCD Y position
01462   * @param  Width: LCD window width
01463   * @param  Height: LCD window height
01464   * @retval None
01465   */
01466 static void SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
01467 {
01468   if (LcdDrv->SetDisplayWindow != NULL)
01469   {
01470     LcdDrv->SetDisplayWindow(Xpos, Ypos, Width, Height);
01471   }
01472 }
01473
01474 /**
01475   * @brief  Fills a triangle (between 3 points).
01476   * @param  Points: Pointer to the points array
01477   * @param  x1: Point 1 X position
01478   * @param  y1: Point 1 Y position
01479   * @param  x2: Point 2 X position
01480   * @param  y2: Point 2 Y position
01481   * @param  x3: Point 3 X position
01482   * @param  y3: Point 3 Y position
01483   * @retval None
01484   */
01485 static void FillTriangle(uint16_t x1, uint16_t x2, uint16_t x3, uint16_t y1, uint16_t y2, uint16_t y3)
01486 {
01487   int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0,
01488           yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0,
01489           curpixel = 0;
01490
01491   deltax = ABS(x2 - x1);        /* The difference between the x's */
01492   deltay = ABS(y2 - y1);        /* The difference between the y's */
01493   x = x1;                       /* Start x off at the first pixel */
01494   y = y1;                       /* Start y off at the first pixel */
01495
01496   if (x2 >= x1)                 /* The x-values are increasing */
01497   {
01498     xinc1 = 1;
01499     xinc2 = 1;
01500   }
01501   else                          /* The x-values are decreasing */
01502   {
01503     xinc1 = -1;
01504     xinc2 = -1;
01505   }
01506
01507   if (y2 >= y1)                 /* The y-values are increasing */
01508   {
01509     yinc1 = 1;
01510     yinc2 = 1;
01511   }
01512   else                          /* The y-values are decreasing */
01513   {
01514     yinc1 = -1;
01515     yinc2 = -1;
01516   }
01517
01518   if (deltax >= deltay)         /* There is at least one x-value for every y-value */
01519   {
01520     xinc1 = 0;                  /* Don't change the x when numerator >= denominator */
01521     yinc2 = 0;                  /* Don't change the y for every iteration */
01522     den = deltax;
01523     num = deltax / 2;
01524     numadd = deltay;
01525     numpixels = deltax;         /* There are more x-values than y-values */
01526   }
01527   else                          /* There is at least one y-value for every x-value */
01528   {
01529     xinc2 = 0;                  /* Don't change the x for every iteration */
01530     yinc1 = 0;                  /* Don't change the y when numerator >= denominator */
01531     den = deltay;
01532     num = deltay / 2;
01533     numadd = deltax;
01534     numpixels = deltay;         /* There are more y-values than x-values */
01535   }
01536
01537   for (curpixel = 0; curpixel <= numpixels; curpixel++)
01538   {
01539     BSP_LCD_DrawLine(x, y, x3, y3);
01540
01541     num += numadd;              /* Increase the numerator by the top of the fraction */
01542     if (num >= den)             /* Check if numerator >= denominator */
01543     {
01544       num -= den;               /* Calculate the new numerator value */
01545       x += xinc1;               /* Change the x as appropriate */
01546       y += yinc1;               /* Change the y as appropriate */
01547     }
01548     x += xinc2;                 /* Change the x as appropriate */
01549     y += yinc2;                 /* Change the y as appropriate */
01550   }
01551 }
01552
01553 /**
01554   * @}
01555   */
01556
01557 /**
01558   * @}
01559   */
01560
01561 /**
01562   * @}
01563   */
01564
01565 /**
01566   * @}
01567   */
01568
01569 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_lcd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_LCD_H
00023 #define __STM32L496G_DISCOVERY_LCD_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l496g_discovery.h"
00031 #include "stm32l496g_discovery_io.h"
00032 /*#include "../Components/ls016b8uy/ls016b8uy.h"*/
00033 #include "../Components/st7789h2/st7789h2.h"
00034 #include "../../../Utilities/Fonts/fonts.h"
00035
00036 /** @addtogroup BSP
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32L496G_DISCOVERY
00041   * @{
00042   */
00043
00044 /** @defgroup STM32L496G_DISCOVERY_LCD STM32L496G-DISCOVERY LCD
00045   * @{
00046   */
00047
00048 /** @defgroup STM32L496G_DISCOVERY_LCD_Exported_Types STM32L496G DISCOVERY LCD Exported Types
00049   * @{
00050   */
00051 typedef struct
00052 {
00053   uint32_t TextColor;
00054   uint32_t BackColor;
00055   sFONT    *pFont;
00056 } LCD_DrawPropTypeDef;
00057 /**
00058   * @}
00059   */
00060
00061 /** @defgroup STM32L496G_DISCOVERY_LCD_Exported_Constants STM32L496G DISCOVERY LCD Exported Constants
00062   * @{
00063   */
00064 /**
00065   * @brief  LCD status structure definition
00066   */
00067 #define LCD_OK         ((uint8_t)0x00)
00068 #define LCD_ERROR      ((uint8_t)0x01)
00069 #define LCD_TIMEOUT    ((uint8_t)0x02)
00070
00071 typedef struct
00072 {
00073   int16_t X;
00074   int16_t Y;
00075 } Point, * pPoint;
00076
00077 /**
00078   * @brief  Line mode structures definition
00079   */
00080 typedef enum
00081 {
00082   CENTER_MODE          = 0x01,    /* Center mode */
00083   RIGHT_MODE           = 0x02,    /* Right mode  */
00084   LEFT_MODE            = 0x03     /* Left mode   */
00085 } Line_ModeTypdef;
00086
00087
00088 #define  LCD_ORIENTATION_PORTRAIT   ((uint8_t)0x00) /*!< Portrait orientation choice of LCD screen  */
00089 #define  LCD_ORIENTATION_LANDSCAPE  ((uint8_t)0x01) /*!< Landscape orientation choice of LCD screen */
00090 #define  LCD_ORIENTATION_UNDEFINED  ((uint8_t)0x02) /*!< Undefined  LCD screen orientation          */
00091
00092
00093 /**
00094   * @brief  LCD color
00095   */
00096 #define LCD_COLOR_BLUE          ((uint16_t)0x001F)
00097 #define LCD_COLOR_GREEN         ((uint16_t)0x07E0)
00098 #define LCD_COLOR_RED           ((uint16_t)0xF800)
00099 #define LCD_COLOR_CYAN          ((uint16_t)0x07FF)
00100 #define LCD_COLOR_MAGENTA       ((uint16_t)0xF81F)
00101 #define LCD_COLOR_YELLOW        ((uint16_t)0xFFE0)
00102 #define LCD_COLOR_LIGHTBLUE     ((uint16_t)0x841F)
00103 #define LCD_COLOR_LIGHTGREEN    ((uint16_t)0x87F0)
00104 #define LCD_COLOR_LIGHTRED      ((uint16_t)0xFC10)
00105 #define LCD_COLOR_LIGHTMAGENTA  ((uint16_t)0xFC1F)
00106 #define LCD_COLOR_LIGHTYELLOW   ((uint16_t)0xFFF0)
00107 #define LCD_COLOR_DARKBLUE      ((uint16_t)0x0010)
00108 #define LCD_COLOR_DARKGREEN     ((uint16_t)0x0400)
00109 #define LCD_COLOR_DARKRED       ((uint16_t)0x8000)
00110 #define LCD_COLOR_DARKCYAN      ((uint16_t)0x0410)
00111 #define LCD_COLOR_DARKMAGENTA   ((uint16_t)0x8010)
00112 #define LCD_COLOR_DARKYELLOW    ((uint16_t)0x8400)
00113 #define LCD_COLOR_WHITE         ((uint16_t)0xFFFF)
00114 #define LCD_COLOR_LIGHTGRAY     ((uint16_t)0xD69A)
00115 #define LCD_COLOR_GRAY          ((uint16_t)0x8410)
00116 #define LCD_COLOR_DARKGRAY      ((uint16_t)0x4208)
00117 #define LCD_COLOR_BLACK         ((uint16_t)0x0000)
00118 #define LCD_COLOR_BROWN         ((uint16_t)0xA145)
00119 #define LCD_COLOR_ORANGE        ((uint16_t)0xFD20)
00120
00121 /**
00122   * @brief LCD default font
00123   */
00124 #define LCD_DEFAULT_FONT         Font12
00125
00126 /**
00127   * @brief LCD special pins
00128   */
00129 /* LCD reset pin */
00130 /* LCD reset is accessed thru the MFX */
00131 #define LCD_RST_PIN                       IO1_PIN_2
00132
00133 /* LCD tearing effect pin */
00134 #define LCD_TE_PIN                       GPIO_PIN_7
00135 #define LCD_TE_GPIO_PORT                 GPIOH
00136 #define LCD_TE_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOH_CLK_ENABLE()
00137 #define LCD_TE_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOH_CLK_DISABLE()
00138
00139 /* Backlight control pin */
00140 #if defined(LPTIMER_DIMMING)
00141 #define LCD_BL_CTRL_PIN                  GPIO_PIN_15
00142 #define LCD_BL_CTRL_GPIO_PORT            GPIOG
00143 #define LCD_BL_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOG_CLK_ENABLE()
00144 #define LCD_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
00145 #else
00146 #define LCD_BL_CTRL_PIN                  GPIO_PIN_0
00147 #define LCD_BL_CTRL_GPIO_PORT            GPIOI
00148 #define LCD_BL_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOI_CLK_ENABLE()
00149 #define LCD_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOI_CLK_DISABLE()
00150 #endif
00151
00152
00153 /* Power on control pin */
00154 #define LCD_PWR_CTRL_PIN                  GPIO_PIN_0
00155 #define LCD_PWR_CTRL_GPIO_PORT            GPIOH
00156 #define LCD_PWR_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOH_CLK_ENABLE()
00157 #define LCD_PWR_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
00158
00159 /* Use by application to not use backlight */
00160 extern FlagStatus WakeUpFromStandby;
00161 extern FlagStatus WakeUpFromShutdown;
00162
00163
00164 /* Screen dimming parameters */
00165 /* Definition for TIMx clock resources */
00166 #define TIMx                           TIM5
00167 #define TIMx_CLK_ENABLE()              __HAL_RCC_TIM5_CLK_ENABLE()
00168 #define TIMx_CLK_DISABLE()             __HAL_RCC_TIM5_CLK_DISABLE()
00169 #define TIMx_CHANNEL                    TIM_CHANNEL_4
00170 #define TIMx_CHANNEl_AF                GPIO_AF2_TIM5
00171 #if defined(LPTIMER_DIMMING)
00172 #define PERIOD_VALUE                   (uint32_t)(99)     /* Period Value  */
00173 #define PULSE_VALUE                    (uint32_t)(95)     /* 5% cycle */
00174 #define PULSE_DECREASE_START           (uint32_t)(45)     /* cycle start level when starting to dim the screen */
00175 #define PULSE_DECREASE_DELAY           (uint32_t)(40)     /* gradually decrease cycle level every 40 milliseconds */
00176 #else
00177 #define PERIOD_VALUE                   (uint32_t)(666 - 1)  /* Period Value  */
00178 #define PULSE_VALUE                    (uint32_t)((PERIOD_VALUE*5)/100)     /* 5% cycle */
00179 #define PULSE_DECREASE_START           (uint32_t)(PULSE_VALUE + 120)        /* cycle start level when starting to dim the screen */
00180 #define PULSE_DECREASE_DELAY           (uint32_t)(20)        /* gradually decrease cycle level every 20 milliseconds */
00181 #endif
00182
00183 /**
00184   * @}
00185   */
00186
00187 /** @defgroup STM32L496G_DISCOVERY_LCD_Exported_Functions STM32L496G DISCOVERY LCD Exported Functions
00188   * @{
00189   */
00190 uint8_t  BSP_LCD_Init(void);
00191 uint8_t  BSP_LCD_InitEx(uint32_t orientation);
00192 void     BSP_LCD_Reset(void);
00193 uint8_t  BSP_LCD_DeInit(void);
00194 uint32_t BSP_LCD_GetXSize(void);
00195 uint32_t BSP_LCD_GetYSize(void);
00196
00197 uint16_t BSP_LCD_GetTextColor(void);
00198 uint16_t BSP_LCD_GetBackColor(void);
00199 void     BSP_LCD_SetTextColor(__IO uint16_t Color);
00200 void     BSP_LCD_SetBackColor(__IO uint16_t Color);
00201 void     BSP_LCD_SetFont(sFONT *fonts);
00202 sFONT    *BSP_LCD_GetFont(void);
00203
00204 void     BSP_LCD_Clear(uint16_t Color);
00205 void     BSP_LCD_ClearStringLine(uint16_t Line);
00206 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00207 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode);
00208 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00209
00210 uint16_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00211 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code);
00212 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00213 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00214 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00215 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00216 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00217 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00218 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00219 void     BSP_LCD_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp);
00220 void     BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp);
00221 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00222 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00223 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00224 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00225
00226 void     BSP_LCD_DisplayOff(void);
00227 void     BSP_LCD_DisplayOn(void);
00228
00229 void     BSP_LCD_ScreenDimmingOn(void);
00230 void     BSP_LCD_ScreenDimmingOff(void);
00231 void     BSP_LCD_ScreenDimmingConfig(const uint8_t start, const uint8_t stop, const uint8_t step, const uint8_t delay);
00232
00233 uint8_t BSP_LCD_GetOrientation(void);
00234
00235 /* These functions can be modified in case the current settings
00236    need to be changed for specific application needs */
00237 __weak void BSP_LCD_MspInit(void);
00238 __weak void BSP_LCD_MspDeInit(void);
00239
00240 /**
00241   * @}
00242   */
00243
00244 /**
00245   * @}
00246   */
00247
00248 /**
00249   * @}
00250   */
00251
00252 /**
00253   * @}
00254   */
00255
00256 #ifdef __cplusplus
00257 }
00258 #endif
00259
00260 #endif /* __STM32L496G_DISCOVERY_LCD_H */
00261
00262 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_qspi.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_qspi.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_qspi.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes a standard driver for the MX25R6435F QSPI
00006   *          memory mounted on STM32L496G-Discovery board.
00007   @verbatim
00008   ==============================================================================
00009                      ##### How to use this driver #####
00010   ==============================================================================
00011   [..]
00012    (#) This driver is used to drive the MX25R6435F QSPI external
00013        memory mounted on STM32L496G-DISCO evaluation board.
00014
00015    (#) This driver need a specific component driver (MX25R6435F) to be included with.
00016
00017    (#) Initialization steps:
00018        (++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
00019             function includes the MSP layer hardware resources initialization and the
00020             QSPI interface with the external memory. The BSP_QSPI_DeInit() can be used
00021             to deactivate the QSPI interface.
00022
00023    (#) QSPI memory operations
00024        (++) QSPI memory can be accessed with read/write operations once it is
00025             initialized.
00026             Read/write operation can be performed with AHB access using the functions
00027             BSP_QSPI_Read()/BSP_QSPI_Write().
00028        (++) The function to the QSPI memory in memory-mapped mode is possible after
00029             the call of the function BSP_QSPI_EnableMemoryMappedMode().
00030        (++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
00031             (see the QSPI memory data sheet)
00032        (++) Perform erase block operation using the function BSP_QSPI_Erase_Block() and by
00033             specifying the block address. You can perform an erase operation of the whole
00034             chip by calling the function BSP_QSPI_Erase_Chip().
00035        (++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
00036             (see the QSPI memory data sheet)
00037        (++) Perform erase sector operation using the function BSP_QSPI_Erase_Sector()
00038             which is not blocking. So the function BSP_QSPI_GetStatus() should be used
00039             to check if the memory is busy, and the functions BSP_QSPI_SuspendErase()/
00040             BSP_QSPI_ResumeErase() can be used to perform other operations during the
00041             sector erase.
00042        (++) Deep power down of the QSPI memory is managed with the call of the functions
00043             BSP_QSPI_EnterDeepPowerDown()/BSP_QSPI_LeaveDeepPowerDown()
00044   @endverbatim
00045   ******************************************************************************
00046   * @attention
00047   *
00048   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00049   * All rights reserved.</center></h2>
00050   *
00051   * This software component is licensed by ST under BSD 3-Clause license,
00052   * the "License"; You may not use this file except in compliance with the
00053   * License. You may obtain a copy of the License at:
00054   *                        opensource.org/licenses/BSD-3-Clause
00055   *
00056   ******************************************************************************
00057   */
00058
00059 /* Includes ------------------------------------------------------------------*/
00060 #include "stm32l496g_discovery_qspi.h"
00061
00062 /** @addtogroup BSP
00063   * @{
00064   */
00065
00066 /** @addtogroup STM32L496G_DISCOVERY
00067   * @{
00068   */
00069
00070 /** @defgroup STM32L496G_DISCOVERY_QSPI STM32L496G-DISCOVERY QSPI
00071   * @{
00072   */
00073
00074 /* Private constants --------------------------------------------------------*/
00075 /** @defgroup STM32L496G_DISCOVERY_QSPI_Private_Constants Private Constants
00076   * @{
00077   */
00078 #define QSPI_QUAD_DISABLE       0x0
00079 #define QSPI_QUAD_ENABLE        0x1
00080
00081 #define QSPI_HIGH_PERF_DISABLE  0x0
00082 #define QSPI_HIGH_PERF_ENABLE   0x1
00083 /**
00084   * @}
00085   */
00086 /* Private variables ---------------------------------------------------------*/
00087
00088 /** @defgroup STM32L496G_DISCOVERY_QSPI_Private_Variables Private Variables
00089   * @{
00090   */
00091 QSPI_HandleTypeDef QSPIHandle;
00092
00093 /**
00094   * @}
00095   */
00096
00097
00098 /* Private functions ---------------------------------------------------------*/
00099
00100 /** @defgroup STM32L496G_DISCOVERY_QSPI_Private_Functions Private Functions
00101   * @{
00102   */
00103 static void    QSPI_MspInit(void);
00104 static void    QSPI_MspDeInit(void);
00105 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi);
00106 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi);
00107 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
00108 static uint8_t QSPI_QuadMode(QSPI_HandleTypeDef *hqspi, uint8_t Operation);
00109 static uint8_t QSPI_HighPerfMode(QSPI_HandleTypeDef *hqspi, uint8_t Operation);
00110
00111 /**
00112   * @}
00113   */
00114
00115 /* Exported functions ---------------------------------------------------------*/
00116
00117 /** @addtogroup STM32L496G_DISCOVERY_QSPI_Exported_Functions
00118   * @{
00119   */
00120
00121 /**
00122   * @brief  Initializes the QSPI interface.
00123   * @retval QSPI memory status
00124   */
00125 uint8_t BSP_QSPI_Init(void)
00126 {
00127   QSPIHandle.Instance = QUADSPI;
00128
00129   /* Call the DeInit function to reset the driver */
00130   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00131   {
00132     return QSPI_ERROR;
00133   }
00134
00135   /* System level initialization */
00136   QSPI_MspInit();
00137
00138   /* QSPI initialization */
00139   QSPIHandle.Init.ClockPrescaler     = 2; /* QSPI clock = 80MHz / (ClockPrescaler+1) = 26.67MHz */
00140   QSPIHandle.Init.FifoThreshold      = 4;
00141   QSPIHandle.Init.SampleShifting     = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
00142   QSPIHandle.Init.FlashSize          = POSITION_VAL(MX25R6435F_FLASH_SIZE) - 1;
00143   QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
00144   QSPIHandle.Init.ClockMode          = QSPI_CLOCK_MODE_0;
00145
00146   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00147   {
00148     return QSPI_ERROR;
00149   }
00150
00151   /* QSPI memory reset */
00152   if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
00153   {
00154     return QSPI_NOT_SUPPORTED;
00155   }
00156
00157   /* QSPI quad enable */
00158   if (QSPI_QuadMode(&QSPIHandle, QSPI_QUAD_ENABLE) != QSPI_OK)
00159   {
00160     return QSPI_ERROR;
00161   }
00162
00163   /* High performance mode enable */
00164   if (QSPI_HighPerfMode(&QSPIHandle, QSPI_HIGH_PERF_ENABLE) != QSPI_OK)
00165   {
00166     return QSPI_ERROR;
00167   }
00168
00169   /* Re-configure the clock for the high performance mode */
00170   QSPIHandle.Init.ClockPrescaler = 1; /* QSPI clock = 80MHz / (ClockPrescaler+1) = 40MHz */
00171
00172   if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
00173   {
00174     return QSPI_ERROR;
00175   }
00176
00177   return QSPI_OK;
00178 }
00179
00180 /**
00181   * @brief  De-Initializes the QSPI interface.
00182   * @retval QSPI memory status
00183   */
00184 uint8_t BSP_QSPI_DeInit(void)
00185 {
00186   QSPIHandle.Instance = QUADSPI;
00187
00188   /* Call the DeInit function to reset the driver */
00189   if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
00190   {
00191     return QSPI_ERROR;
00192   }
00193
00194   /* System level De-initialization */
00195   QSPI_MspDeInit();
00196
00197   return QSPI_OK;
00198 }
00199
00200 /**
00201   * @brief  Reads an amount of data from the QSPI memory.
00202   * @param  pData    : Pointer to data to be read
00203   * @param  ReadAddr : Read start address
00204   * @param  Size     : Size of data to read
00205   * @retval QSPI memory status
00206   */
00207 uint8_t BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
00208 {
00209   QSPI_CommandTypeDef sCommand;
00210
00211   /* Initialize the read command */
00212   sCommand.InstructionMode    = QSPI_INSTRUCTION_1_LINE;
00213   sCommand.Instruction        = QUAD_INOUT_READ_CMD;
00214   sCommand.AddressMode        = QSPI_ADDRESS_4_LINES;
00215   sCommand.AddressSize        = QSPI_ADDRESS_24_BITS;
00216   sCommand.Address            = ReadAddr;
00217   sCommand.AlternateByteMode  = QSPI_ALTERNATE_BYTES_4_LINES;
00218   sCommand.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
00219   sCommand.AlternateBytes     = MX25R6435F_ALT_BYTES_NO_PE_MODE;
00220   sCommand.DataMode           = QSPI_DATA_4_LINES;
00221   sCommand.DummyCycles        = MX25R6435F_DUMMY_CYCLES_READ_QUAD;
00222   sCommand.NbData             = Size;
00223   sCommand.DdrMode            = QSPI_DDR_MODE_DISABLE;
00224   sCommand.DdrHoldHalfCycle   = QSPI_DDR_HHC_ANALOG_DELAY;
00225   sCommand.SIOOMode           = QSPI_SIOO_INST_EVERY_CMD;
00226
00227   /* Configure the command */
00228   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00229   {
00230     return QSPI_ERROR;
00231   }
00232
00233   /* Reception of the data */
00234   if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00235   {
00236     return QSPI_ERROR;
00237   }
00238
00239   return QSPI_OK;
00240 }
00241
00242 /**
00243   * @brief  Writes an amount of data to the QSPI memory.
00244   * @param  pData     : Pointer to data to be written
00245   * @param  WriteAddr : Write start address
00246   * @param  Size      : Size of data to write
00247   * @retval QSPI memory status
00248   */
00249 uint8_t BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
00250 {
00251   QSPI_CommandTypeDef sCommand;
00252   uint32_t end_addr, current_size, current_addr;
00253
00254   /* Calculation of the size between the write address and the end of the page */
00255   current_size = MX25R6435F_PAGE_SIZE - (WriteAddr % MX25R6435F_PAGE_SIZE);
00256
00257   /* Check if the size of the data is less than the remaining place in the page */
00258   if (current_size > Size)
00259   {
00260     current_size = Size;
00261   }
00262
00263   /* Initialize the address variables */
00264   current_addr = WriteAddr;
00265   end_addr = WriteAddr + Size;
00266
00267   /* Initialize the program command */
00268   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00269   sCommand.Instruction       = QUAD_PAGE_PROG_CMD;
00270   sCommand.AddressMode       = QSPI_ADDRESS_4_LINES;
00271   sCommand.AddressSize       = QSPI_ADDRESS_24_BITS;
00272   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00273   sCommand.DataMode          = QSPI_DATA_4_LINES;
00274   sCommand.DummyCycles       = 0;
00275   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00276   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00277   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00278
00279   /* Perform the write page by page */
00280   do
00281   {
00282     sCommand.Address = current_addr;
00283     sCommand.NbData  = current_size;
00284
00285     /* Enable write operations */
00286     if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00287     {
00288       return QSPI_ERROR;
00289     }
00290
00291     /* Configure the command */
00292     if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00293     {
00294       return QSPI_ERROR;
00295     }
00296
00297     /* Transmission of the data */
00298     if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00299     {
00300       return QSPI_ERROR;
00301     }
00302
00303     /* Configure automatic polling mode to wait for end of program */
00304     if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00305     {
00306       return QSPI_ERROR;
00307     }
00308
00309     /* Update the address and size variables for next page programming */
00310     current_addr += current_size;
00311     pData += current_size;
00312     current_size = ((current_addr + MX25R6435F_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : MX25R6435F_PAGE_SIZE;
00313   }
00314   while (current_addr < end_addr);
00315
00316   return QSPI_OK;
00317 }
00318
00319 /**
00320   * @brief  Erases the specified block of the QSPI memory.
00321   * @param  BlockAddress : Block address to erase
00322   * @retval QSPI memory status
00323   */
00324 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
00325 {
00326   QSPI_CommandTypeDef sCommand;
00327
00328   /* Initialize the erase command */
00329   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00330   sCommand.Instruction       = BLOCK_ERASE_CMD;
00331   sCommand.AddressMode       = QSPI_ADDRESS_1_LINE;
00332   sCommand.AddressSize       = QSPI_ADDRESS_24_BITS;
00333   sCommand.Address           = BlockAddress;
00334   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00335   sCommand.DataMode          = QSPI_DATA_NONE;
00336   sCommand.DummyCycles       = 0;
00337   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00338   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00339   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00340
00341   /* Enable write operations */
00342   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00343   {
00344     return QSPI_ERROR;
00345   }
00346
00347   /* Send the command */
00348   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00349   {
00350     return QSPI_ERROR;
00351   }
00352
00353   /* Configure automatic polling mode to wait for end of erase */
00354   if (QSPI_AutoPollingMemReady(&QSPIHandle, MX25R6435F_BLOCK_ERASE_MAX_TIME) != QSPI_OK)
00355   {
00356     return QSPI_ERROR;
00357   }
00358
00359   return QSPI_OK;
00360 }
00361
00362 /**
00363   * @brief  Erases the specified sector of the QSPI memory.
00364   * @param  Sector : Sector address to erase (0 to 255)
00365   * @retval QSPI memory status
00366   * @note This function is non blocking meaning that sector erase
00367   *       operation is started but not completed when the function
00368   *       returns. Application has to call BSP_QSPI_GetStatus()
00369   *       to know when the device is available again (i.e. erase operation
00370   *       completed).
00371   */
00372 uint8_t BSP_QSPI_Erase_Sector(uint32_t Sector)
00373 {
00374   QSPI_CommandTypeDef sCommand;
00375
00376   if (Sector >= (uint32_t)(MX25R6435F_FLASH_SIZE / MX25R6435F_SECTOR_SIZE))
00377   {
00378     return QSPI_ERROR;
00379   }
00380
00381   /* Initialize the erase command */
00382   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00383   sCommand.Instruction       = SECTOR_ERASE_CMD;
00384   sCommand.AddressMode       = QSPI_ADDRESS_1_LINE;
00385   sCommand.AddressSize       = QSPI_ADDRESS_24_BITS;
00386   sCommand.Address           = (Sector * MX25R6435F_SECTOR_SIZE);
00387   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00388   sCommand.DataMode          = QSPI_DATA_NONE;
00389   sCommand.DummyCycles       = 0;
00390   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00391   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00392   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00393
00394   /* Enable write operations */
00395   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00396   {
00397     return QSPI_ERROR;
00398   }
00399
00400   /* Send the command */
00401   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00402   {
00403     return QSPI_ERROR;
00404   }
00405
00406   return QSPI_OK;
00407 }
00408
00409 /**
00410   * @brief  Erases the entire QSPI memory.
00411   * @retval QSPI memory status
00412   */
00413 uint8_t BSP_QSPI_Erase_Chip(void)
00414 {
00415   QSPI_CommandTypeDef sCommand;
00416
00417   /* Initialize the erase command */
00418   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00419   sCommand.Instruction       = CHIP_ERASE_CMD;
00420   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00421   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00422   sCommand.DataMode          = QSPI_DATA_NONE;
00423   sCommand.DummyCycles       = 0;
00424   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00425   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00426   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00427
00428   /* Enable write operations */
00429   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00430   {
00431     return QSPI_ERROR;
00432   }
00433
00434   /* Send the command */
00435   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00436   {
00437     return QSPI_ERROR;
00438   }
00439
00440   /* Configure automatic polling mode to wait for end of erase */
00441   if (QSPI_AutoPollingMemReady(&QSPIHandle, MX25R6435F_CHIP_ERASE_MAX_TIME) != QSPI_OK)
00442   {
00443     return QSPI_ERROR;
00444   }
00445
00446   return QSPI_OK;
00447 }
00448
00449 /**
00450   * @brief  Reads current status of the QSPI memory.
00451   * @retval QSPI memory status
00452   */
00453 uint8_t BSP_QSPI_GetStatus(void)
00454 {
00455   QSPI_CommandTypeDef sCommand;
00456   uint8_t reg;
00457
00458   /* Initialize the read security register command */
00459   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00460   sCommand.Instruction       = READ_SEC_REG_CMD;
00461   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00462   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00463   sCommand.DataMode          = QSPI_DATA_1_LINE;
00464   sCommand.DummyCycles       = 0;
00465   sCommand.NbData            = 1;
00466   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00467   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00468   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00469
00470   /* Configure the command */
00471   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00472   {
00473     return QSPI_ERROR;
00474   }
00475
00476   /* Reception of the data */
00477   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00478   {
00479     return QSPI_ERROR;
00480   }
00481
00482   /* Check the value of the register */
00483   if ((reg & (MX25R6435F_SECR_P_FAIL | MX25R6435F_SECR_E_FAIL)) != 0)
00484   {
00485     return QSPI_ERROR;
00486   }
00487   else if ((reg & (MX25R6435F_SECR_PSB | MX25R6435F_SECR_ESB)) != 0)
00488   {
00489     return QSPI_SUSPENDED;
00490   }
00491
00492   /* Initialize the read status register command */
00493   sCommand.Instruction       = READ_STATUS_REG_CMD;
00494
00495   /* Configure the command */
00496   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00497   {
00498     return QSPI_ERROR;
00499   }
00500
00501   /* Reception of the data */
00502   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00503   {
00504     return QSPI_ERROR;
00505   }
00506
00507   /* Check the value of the register */
00508   if ((reg & MX25R6435F_SR_WIP) != 0)
00509   {
00510     return QSPI_BUSY;
00511   }
00512   else
00513   {
00514     return QSPI_OK;
00515   }
00516 }
00517
00518 /**
00519   * @brief  Return the configuration of the QSPI memory.
00520   * @param  pInfo : pointer on the configuration structure
00521   * @retval QSPI memory status
00522   */
00523 uint8_t BSP_QSPI_GetInfo(QSPI_Info *pInfo)
00524 {
00525   /* Configure the structure with the memory configuration */
00526   pInfo->FlashSize          = MX25R6435F_FLASH_SIZE;
00527   pInfo->EraseSectorSize    = MX25R6435F_SECTOR_SIZE;
00528   pInfo->EraseSectorsNumber = (MX25R6435F_FLASH_SIZE / MX25R6435F_SECTOR_SIZE);
00529   pInfo->ProgPageSize       = MX25R6435F_PAGE_SIZE;
00530   pInfo->ProgPagesNumber    = (MX25R6435F_FLASH_SIZE / MX25R6435F_PAGE_SIZE);
00531
00532   return QSPI_OK;
00533 }
00534
00535 /**
00536   * @brief  Configure the QSPI in memory-mapped mode
00537   * @retval QSPI memory status
00538   */
00539 uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
00540 {
00541   QSPI_CommandTypeDef      sCommand;
00542   QSPI_MemoryMappedTypeDef sMemMappedCfg;
00543
00544   /* Configure the command for the read instruction */
00545   sCommand.InstructionMode    = QSPI_INSTRUCTION_1_LINE;
00546   sCommand.Instruction        = QUAD_INOUT_READ_CMD;
00547   sCommand.AddressMode        = QSPI_ADDRESS_4_LINES;
00548   sCommand.AddressSize        = QSPI_ADDRESS_24_BITS;
00549   sCommand.AlternateByteMode  = QSPI_ALTERNATE_BYTES_4_LINES;
00550   sCommand.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
00551   sCommand.AlternateBytes     = MX25R6435F_ALT_BYTES_NO_PE_MODE;
00552   sCommand.DataMode           = QSPI_DATA_4_LINES;
00553   sCommand.DummyCycles        = MX25R6435F_DUMMY_CYCLES_READ_QUAD;
00554   sCommand.DdrMode            = QSPI_DDR_MODE_DISABLE;
00555   sCommand.DdrHoldHalfCycle   = QSPI_DDR_HHC_ANALOG_DELAY;
00556   sCommand.SIOOMode           = QSPI_SIOO_INST_EVERY_CMD;
00557
00558   /* Configure the memory mapped mode */
00559   sMemMappedCfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
00560
00561   if (HAL_QSPI_MemoryMapped(&QSPIHandle, &sCommand, &sMemMappedCfg) != HAL_OK)
00562   {
00563     return QSPI_ERROR;
00564   }
00565
00566   return QSPI_OK;
00567 }
00568
00569 /**
00570   * @brief  This function suspends an ongoing erase command.
00571   * @retval QSPI memory status
00572   */
00573 uint8_t BSP_QSPI_SuspendErase(void)
00574 {
00575   QSPI_CommandTypeDef sCommand;
00576
00577   /* Check whether the device is busy (erase operation is
00578   in progress).
00579   */
00580   if (BSP_QSPI_GetStatus() == QSPI_BUSY)
00581   {
00582     /* Initialize the erase command */
00583     sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00584     sCommand.Instruction       = PROG_ERASE_SUSPEND_CMD;
00585     sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00586     sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00587     sCommand.DataMode          = QSPI_DATA_NONE;
00588     sCommand.DummyCycles       = 0;
00589     sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00590     sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00591     sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00592
00593     /* Send the command */
00594     if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00595     {
00596       return QSPI_ERROR;
00597     }
00598
00599     if (BSP_QSPI_GetStatus() == QSPI_SUSPENDED)
00600     {
00601       return QSPI_OK;
00602     }
00603
00604     return QSPI_ERROR;
00605   }
00606
00607   return QSPI_OK;
00608 }
00609
00610 /**
00611   * @brief  This function resumes a paused erase command.
00612   * @retval QSPI memory status
00613   */
00614 uint8_t BSP_QSPI_ResumeErase(void)
00615 {
00616   QSPI_CommandTypeDef sCommand;
00617
00618   /* Check whether the device is in suspended state */
00619   if (BSP_QSPI_GetStatus() == QSPI_SUSPENDED)
00620   {
00621     /* Initialize the erase command */
00622     sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00623     sCommand.Instruction       = PROG_ERASE_RESUME_CMD;
00624     sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00625     sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00626     sCommand.DataMode          = QSPI_DATA_NONE;
00627     sCommand.DummyCycles       = 0;
00628     sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00629     sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00630     sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00631
00632     /* Send the command */
00633     if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00634     {
00635       return QSPI_ERROR;
00636     }
00637
00638     /*
00639     When this command is executed, the status register write in progress bit is set to 1, and
00640     the flag status register program erase controller bit is set to 0. This command is ignored
00641     if the device is not in a suspended state.
00642     */
00643
00644     if (BSP_QSPI_GetStatus() == QSPI_BUSY)
00645     {
00646       return QSPI_OK;
00647     }
00648
00649     return QSPI_ERROR;
00650   }
00651
00652   return QSPI_OK;
00653 }
00654
00655 /**
00656   * @brief  This function enter the QSPI memory in deep power down mode.
00657   * @retval QSPI memory status
00658   */
00659 uint8_t BSP_QSPI_EnterDeepPowerDown(void)
00660 {
00661   QSPI_CommandTypeDef sCommand;
00662
00663   /* Initialize the deep power down command */
00664   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00665   sCommand.Instruction       = DEEP_POWER_DOWN_CMD;
00666   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00667   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00668   sCommand.DataMode          = QSPI_DATA_NONE;
00669   sCommand.DummyCycles       = 0;
00670   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00671   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00672   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00673
00674   /* Send the command */
00675   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00676   {
00677     return QSPI_ERROR;
00678   }
00679
00680   /* ---          Memory takes 10us max to enter deep power down          --- */
00681   /* --- At least 30us should be respected before leaving deep power down --- */
00682
00683   return QSPI_OK;
00684 }
00685
00686 /**
00687   * @brief  This function leave the QSPI memory from deep power down mode.
00688   * @retval QSPI memory status
00689   */
00690 uint8_t BSP_QSPI_LeaveDeepPowerDown(void)
00691 {
00692   QSPI_CommandTypeDef sCommand;
00693
00694   /* Initialize the erase command */
00695   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00696   sCommand.Instruction       = NO_OPERATION_CMD;
00697   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00698   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00699   sCommand.DataMode          = QSPI_DATA_NONE;
00700   sCommand.DummyCycles       = 0;
00701   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00702   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00703   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00704
00705   /* Send the command */
00706   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00707   {
00708     return QSPI_ERROR;
00709   }
00710
00711   /* --- A NOP command is sent to the memory, as the nCS should be low for at least 20 ns --- */
00712   /* ---                  Memory takes 35us min to leave deep power down                  --- */
00713
00714   return QSPI_OK;
00715 }
00716 /**
00717   * @}
00718   */
00719
00720 /** @addtogroup STM32L496G_DISCOVERY_QSPI_Private_Functions
00721   * @{
00722   */
00723
00724 /**
00725   * @brief  Initializes the QSPI MSP.
00726   * @retval None
00727   */
00728 static void QSPI_MspInit(void)
00729 {
00730   GPIO_InitTypeDef GPIO_InitStruct;
00731
00732   /* Enable the QuadSPI memory interface clock */
00733   __HAL_RCC_QSPI_CLK_ENABLE();
00734
00735   /* Reset the QuadSPI memory interface */
00736   __HAL_RCC_QSPI_FORCE_RESET();
00737   __HAL_RCC_QSPI_RELEASE_RESET();
00738
00739   /* Enable GPIO clocks */
00740   __HAL_RCC_GPIOA_CLK_ENABLE();
00741   __HAL_RCC_GPIOB_CLK_ENABLE();
00742
00743   /* QSPI CS GPIO pin configuration  */
00744   GPIO_InitStruct.Pin       = GPIO_PIN_11;
00745   GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
00746   GPIO_InitStruct.Pull      = GPIO_PULLUP;
00747   GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00748   GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI;
00749   HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
00750
00751   /* QSPI CLK, D0, D1, D2 and D3 GPIO pins configuration  */
00752   GPIO_InitStruct.Pin       = (GPIO_PIN_3 | GPIO_PIN_6 | GPIO_PIN_7);
00753   GPIO_InitStruct.Pull      = GPIO_NOPULL;
00754   HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
00755
00756   GPIO_InitStruct.Pin       = (GPIO_PIN_0 | GPIO_PIN_1);
00757   HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
00758 }
00759
00760 /**
00761   * @brief  De-Initializes the QSPI MSP.
00762   * @retval None
00763   */
00764 static void QSPI_MspDeInit(void)
00765 {
00766   GPIO_InitTypeDef GPIO_InitStruct;
00767
00768   /* QSPI CLK, CS, D0-D3 GPIO pins de-configuration  */
00769
00770   __HAL_RCC_GPIOA_CLK_ENABLE();
00771   __HAL_RCC_GPIOB_CLK_ENABLE();
00772
00773   HAL_GPIO_DeInit(GPIOA, (GPIO_PIN_6 | GPIO_PIN_7));
00774   HAL_GPIO_DeInit(GPIOB, (GPIO_PIN_0 | GPIO_PIN_1));
00775
00776   /* Set GPIOB pin 11 in pull up mode (optimum default setting) */
00777   GPIO_InitStruct.Mode      = GPIO_MODE_INPUT;
00778   GPIO_InitStruct.Pin       = GPIO_PIN_11;
00779   GPIO_InitStruct.Pull      = GPIO_NOPULL;
00780   GPIO_InitStruct.Speed     = GPIO_SPEED_FREQ_LOW;
00781   HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
00782
00783   /* Set GPIOA pin 3 in no pull, low state (optimum default setting) */
00784   GPIO_InitStruct.Mode      = GPIO_MODE_OUTPUT_PP  ;
00785   GPIO_InitStruct.Pull      = GPIO_NOPULL;
00786   GPIO_InitStruct.Pin       = GPIO_PIN_3;
00787   HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
00788   HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET);
00789
00790   /* Reset the QuadSPI memory interface */
00791   __HAL_RCC_QSPI_FORCE_RESET();
00792   __HAL_RCC_QSPI_RELEASE_RESET();
00793
00794   /* Disable the QuadSPI memory interface clock */
00795   __HAL_RCC_QSPI_CLK_DISABLE();
00796 }
00797
00798 /**
00799   * @brief  This function reset the QSPI memory.
00800   * @param  hqspi : QSPI handle
00801   * @retval None
00802   */
00803 static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
00804 {
00805   QSPI_CommandTypeDef sCommand;
00806
00807   /* Initialize the reset enable command */
00808   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00809   sCommand.Instruction       = RESET_ENABLE_CMD;
00810   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00811   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00812   sCommand.DataMode          = QSPI_DATA_NONE;
00813   sCommand.DummyCycles       = 0;
00814   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00815   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00816   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00817
00818   /* Send the command */
00819   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00820   {
00821     return QSPI_ERROR;
00822   }
00823
00824   /* Send the reset memory command */
00825   sCommand.Instruction = RESET_MEMORY_CMD;
00826   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00827   {
00828     return QSPI_ERROR;
00829   }
00830
00831   /* Configure automatic polling mode to wait the memory is ready */
00832   if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00833   {
00834     return QSPI_ERROR;
00835   }
00836
00837   return QSPI_OK;
00838 }
00839
00840 /**
00841   * @brief  This function send a Write Enable and wait it is effective.
00842   * @param  hqspi : QSPI handle
00843   * @retval None
00844   */
00845 static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
00846 {
00847   QSPI_CommandTypeDef     sCommand;
00848   QSPI_AutoPollingTypeDef sConfig;
00849
00850   /* Enable write operations */
00851   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00852   sCommand.Instruction       = WRITE_ENABLE_CMD;
00853   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00854   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00855   sCommand.DataMode          = QSPI_DATA_NONE;
00856   sCommand.DummyCycles       = 0;
00857   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00858   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00859   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00860
00861   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00862   {
00863     return QSPI_ERROR;
00864   }
00865
00866   /* Configure automatic polling mode to wait for write enabling */
00867   sConfig.Match           = MX25R6435F_SR_WEL;
00868   sConfig.Mask            = MX25R6435F_SR_WEL;
00869   sConfig.MatchMode       = QSPI_MATCH_MODE_AND;
00870   sConfig.StatusBytesSize = 1;
00871   sConfig.Interval        = 0x10;
00872   sConfig.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00873
00874   sCommand.Instruction    = READ_STATUS_REG_CMD;
00875   sCommand.DataMode       = QSPI_DATA_1_LINE;
00876
00877   if (HAL_QSPI_AutoPolling(&QSPIHandle, &sCommand, &sConfig, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00878   {
00879     return QSPI_ERROR;
00880   }
00881
00882   return QSPI_OK;
00883 }
00884
00885 /**
00886   * @brief  This function read the SR of the memory and wait the EOP.
00887   * @param  hqspi   : QSPI handle
00888   * @param  Timeout : Timeout for auto-polling
00889   * @retval None
00890   */
00891 static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
00892 {
00893   QSPI_CommandTypeDef     sCommand;
00894   QSPI_AutoPollingTypeDef sConfig;
00895
00896   /* Configure automatic polling mode to wait for memory ready */
00897   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00898   sCommand.Instruction       = READ_STATUS_REG_CMD;
00899   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00900   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00901   sCommand.DataMode          = QSPI_DATA_1_LINE;
00902   sCommand.DummyCycles       = 0;
00903   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00904   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00905   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00906
00907   sConfig.Match           = 0;
00908   sConfig.Mask            = MX25R6435F_SR_WIP;
00909   sConfig.MatchMode       = QSPI_MATCH_MODE_AND;
00910   sConfig.StatusBytesSize = 1;
00911   sConfig.Interval        = 0x10;
00912   sConfig.AutomaticStop   = QSPI_AUTOMATIC_STOP_ENABLE;
00913
00914   if (HAL_QSPI_AutoPolling(&QSPIHandle, &sCommand, &sConfig, Timeout) != HAL_OK)
00915   {
00916     return QSPI_ERROR;
00917   }
00918
00919   return QSPI_OK;
00920 }
00921
00922 /**
00923   * @brief  This function enables/disables the Quad mode of the memory.
00924   * @param  hqspi     : QSPI handle
00925   * @param  Operation : QSPI_QUAD_ENABLE or QSPI_QUAD_DISABLE mode
00926   * @retval None
00927   */
00928 static uint8_t QSPI_QuadMode(QSPI_HandleTypeDef *hqspi, uint8_t Operation)
00929 {
00930   QSPI_CommandTypeDef sCommand;
00931   uint8_t reg;
00932
00933   /* Read status register */
00934   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
00935   sCommand.Instruction       = READ_STATUS_REG_CMD;
00936   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
00937   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
00938   sCommand.DataMode          = QSPI_DATA_1_LINE;
00939   sCommand.DummyCycles       = 0;
00940   sCommand.NbData            = 1;
00941   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
00942   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
00943   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
00944
00945   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00946   {
00947     return QSPI_ERROR;
00948   }
00949
00950   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00951   {
00952     return QSPI_ERROR;
00953   }
00954
00955   /* Enable write operations */
00956   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
00957   {
00958     return QSPI_ERROR;
00959   }
00960
00961   /* Activate/deactivate the Quad mode */
00962   if (Operation == QSPI_QUAD_ENABLE)
00963   {
00964     SET_BIT(reg, MX25R6435F_SR_QE);
00965   }
00966   else
00967   {
00968     CLEAR_BIT(reg, MX25R6435F_SR_QE);
00969   }
00970
00971   sCommand.Instruction = WRITE_STATUS_CFG_REG_CMD;
00972
00973   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00974   {
00975     return QSPI_ERROR;
00976   }
00977
00978   if (HAL_QSPI_Transmit(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00979   {
00980     return QSPI_ERROR;
00981   }
00982
00983   /* Wait that memory is ready */
00984   if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
00985   {
00986     return QSPI_ERROR;
00987   }
00988
00989   /* Check the configuration has been correctly done */
00990   sCommand.Instruction = READ_STATUS_REG_CMD;
00991
00992   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00993   {
00994     return QSPI_ERROR;
00995   }
00996
00997   if (HAL_QSPI_Receive(&QSPIHandle, &reg, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
00998   {
00999     return QSPI_ERROR;
01000   }
01001
01002   if ((((reg & MX25R6435F_SR_QE) == 0) && (Operation == QSPI_QUAD_ENABLE)) ||
01003       (((reg & MX25R6435F_SR_QE) != 0) && (Operation == QSPI_QUAD_DISABLE)))
01004   {
01005     return QSPI_ERROR;
01006   }
01007
01008   return QSPI_OK;
01009 }
01010
01011 /**
01012   * @brief  This function enables/disables the high performance mode of the memory.
01013   * @param  hqspi     : QSPI handle
01014   * @param  Operation : QSPI_HIGH_PERF_ENABLE or QSPI_HIGH_PERF_DISABLE high performance mode
01015   * @retval None
01016   */
01017 static uint8_t QSPI_HighPerfMode(QSPI_HandleTypeDef *hqspi, uint8_t Operation)
01018 {
01019   QSPI_CommandTypeDef sCommand;
01020   uint8_t reg[3];
01021
01022   /* Read status register */
01023   sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
01024   sCommand.Instruction       = READ_STATUS_REG_CMD;
01025   sCommand.AddressMode       = QSPI_ADDRESS_NONE;
01026   sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
01027   sCommand.DataMode          = QSPI_DATA_1_LINE;
01028   sCommand.DummyCycles       = 0;
01029   sCommand.NbData            = 1;
01030   sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
01031   sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
01032   sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
01033
01034   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01035   {
01036     return QSPI_ERROR;
01037   }
01038
01039   if (HAL_QSPI_Receive(&QSPIHandle, &(reg[0]), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01040   {
01041     return QSPI_ERROR;
01042   }
01043
01044   /* Read configuration registers */
01045   sCommand.Instruction = READ_CFG_REG_CMD;
01046   sCommand.NbData      = 2;
01047
01048   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01049   {
01050     return QSPI_ERROR;
01051   }
01052
01053   if (HAL_QSPI_Receive(&QSPIHandle, &(reg[1]), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01054   {
01055     return QSPI_ERROR;
01056   }
01057
01058   /* Enable write operations */
01059   if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
01060   {
01061     return QSPI_ERROR;
01062   }
01063
01064   /* Activate/deactivate the Quad mode */
01065   if (Operation == QSPI_HIGH_PERF_ENABLE)
01066   {
01067     SET_BIT(reg[2], MX25R6435F_CR2_LH_SWITCH);
01068   }
01069   else
01070   {
01071     CLEAR_BIT(reg[2], MX25R6435F_CR2_LH_SWITCH);
01072   }
01073
01074   sCommand.Instruction = WRITE_STATUS_CFG_REG_CMD;
01075   sCommand.NbData      = 3;
01076
01077   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01078   {
01079     return QSPI_ERROR;
01080   }
01081
01082   if (HAL_QSPI_Transmit(&QSPIHandle, &(reg[0]), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01083   {
01084     return QSPI_ERROR;
01085   }
01086
01087   /* Wait that memory is ready */
01088   if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
01089   {
01090     return QSPI_ERROR;
01091   }
01092
01093   /* Check the configuration has been correctly done */
01094   sCommand.Instruction = READ_CFG_REG_CMD;
01095   sCommand.NbData      = 2;
01096
01097   if (HAL_QSPI_Command(&QSPIHandle, &sCommand, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01098   {
01099     return QSPI_ERROR;
01100   }
01101
01102   if (HAL_QSPI_Receive(&QSPIHandle, &(reg[0]), HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
01103   {
01104     return QSPI_ERROR;
01105   }
01106
01107   if ((((reg[1] & MX25R6435F_CR2_LH_SWITCH) == 0) && (Operation == QSPI_HIGH_PERF_ENABLE)) ||
01108       (((reg[1] & MX25R6435F_CR2_LH_SWITCH) != 0) && (Operation == QSPI_HIGH_PERF_DISABLE)))
01109   {
01110     return QSPI_ERROR;
01111   }
01112
01113   return QSPI_OK;
01114 }
01115
01116 /**
01117   * @}
01118   */
01119
01120 /**
01121   * @}
01122   */
01123
01124 /**
01125   * @}
01126   */
01127
01128 /**
01129   * @}
01130   */
01131
01132 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
01133


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_qspi.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_qspi.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_qspi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_QSPI_H
00023 #define __STM32L496G_DISCOVERY_QSPI_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l4xx_hal.h"
00031 #include "../Components/mx25r6435f/mx25r6435f.h"
00032
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036
00037 /** @addtogroup STM32L496G_DISCOVERY
00038   * @{
00039   */
00040
00041 /** @addtogroup STM32L496G_DISCOVERY_QSPI
00042   * @{
00043   */
00044
00045 /* Exported constants --------------------------------------------------------*/
00046 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Constants Exported Constants
00047   * @{
00048   */
00049 /* QSPI Error codes */
00050 #define QSPI_OK            ((uint8_t)0x00)
00051 #define QSPI_ERROR         ((uint8_t)0x01)
00052 #define QSPI_BUSY          ((uint8_t)0x02)
00053 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00054 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00055
00056 /**
00057   * @}
00058   */
00059
00060 /* Exported types ------------------------------------------------------------*/
00061 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Types Exported Types
00062   * @{
00063   */
00064 /* QSPI Info */
00065 typedef struct
00066 {
00067   uint32_t FlashSize;          /*!< Size of the flash */
00068   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation */
00069   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00070   uint32_t ProgPageSize;       /*!< Size of pages for the program operation */
00071   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00072 } QSPI_Info;
00073
00074 /**
00075   * @}
00076   */
00077
00078 /* Exported functions --------------------------------------------------------*/
00079 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Functions Exported Functions
00080   * @{
00081   */
00082 uint8_t BSP_QSPI_Init(void);
00083 uint8_t BSP_QSPI_DeInit(void);
00084 uint8_t BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size);
00085 uint8_t BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size);
00086 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00087 uint8_t BSP_QSPI_Erase_Sector(uint32_t Sector);
00088 uint8_t BSP_QSPI_Erase_Chip(void);
00089 uint8_t BSP_QSPI_GetStatus(void);
00090 uint8_t BSP_QSPI_GetInfo(QSPI_Info *pInfo);
00091 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00092 uint8_t BSP_QSPI_SuspendErase(void);
00093 uint8_t BSP_QSPI_ResumeErase(void);
00094 uint8_t BSP_QSPI_EnterDeepPowerDown(void);
00095 uint8_t BSP_QSPI_LeaveDeepPowerDown(void);
00096
00097 /**
00098   * @}
00099   */
00100
00101 /**
00102   * @}
00103   */
00104
00105 /**
00106   * @}
00107   */
00108
00109 /**
00110   * @}
00111   */
00112
00113 #ifdef __cplusplus
00114 }
00115 #endif
00116
00117 #endif /* __STM32L496G_DISCOVERY_QSPI_H */
00118
00119 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sd.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_sd.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_sd.c
00004   * @author  MCD Application Team
00005   * @brief   This file includes the uSD card driver.
00006   @verbatim
00007   ==============================================================================
00008                      ##### How to use this driver #####
00009   ==============================================================================
00010   (#) This driver is used to drive the micro SD external card mounted on STM32L496G-DISCOVERY
00011      evaluation board.
00012
00013   (#) This driver does not need a specific component driver for the micro SD device
00014      to be included with.
00015
00016   (#) Initialization steps:
00017        (++) Initialize the micro SD card using the BSP_SD_Init() function. This
00018             function includes the MSP layer hardware resources initialization and the
00019             SDMMC1 interface configuration to interface with the external micro SD. It
00020             also includes the micro SD initialization sequence.
00021        (++) To check the SD card presence you can use the function BSP_SD_IsDetected() which
00022             returns the detection status.
00023        (++) The function BSP_SD_GetCardInfo() is used to get the micro SD card information
00024             which is stored in the structure "HAL_SD_CardInfoTypedef".
00025
00026   (#) Micro SD card operations
00027        (++) The micro SD card can be accessed with read/write block(s) operations once
00028             it is reay for access. The access cand be performed whether using the polling
00029             mode by calling the functions BSP_SD_ReadBlocks()/BSP_SD_WriteBlocks(), or by DMA
00030             transfer using the functions BSP_SD_ReadBlocks_DMA()/BSP_SD_WriteBlocks_DMA()
00031        (++) The DMA transfer complete is used with interrupt mode. Once the SD transfer
00032             is complete, the SD interrupt is handled using the function BSP_SD_IRQHandler(),
00033             the DMA Tx/Rx transfer complete are handled using the functions
00034             BSP_SD_DMA_Tx_IRQHandler()/BSP_SD_DMA_Rx_IRQHandler(). The corresponding user callbacks
00035             are implemented by the user at application level.
00036        (++) The SD erase block(s) is performed using the function BSP_SD_Erase() with specifying
00037             the number of blocks to erase.
00038        (++) The SD runtime status is returned when calling the function BSP_SD_GetStatus().
00039    [..]
00040   @endverbatim
00041   ******************************************************************************
00042   * @attention
00043   *
00044   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00045   * All rights reserved.</center></h2>
00046   *
00047   * This software component is licensed by ST under BSD 3-Clause license,
00048   * the "License"; You may not use this file except in compliance with the
00049   * License. You may obtain a copy of the License at:
00050   *                        opensource.org/licenses/BSD-3-Clause
00051   *
00052   ******************************************************************************
00053   */
00054
00055 /* Includes ------------------------------------------------------------------*/
00056 #include "stm32l496g_discovery_io.h"
00057 #include "stm32l496g_discovery_sd.h"
00058
00059 /** @addtogroup BSP
00060   * @{
00061   */
00062
00063 /** @addtogroup STM32L496G_DISCOVERY
00064   * @{
00065   */
00066
00067 /** @defgroup STM32L496G_DISCOVERY_SD STM32L496G_DISCOVERY SD
00068   * @{
00069   */
00070
00071 /* Private variables ---------------------------------------------------------*/
00072
00073 /** @defgroup STM32L496G_SD_Private_Variables Private Variables
00074   * @{
00075   */
00076 SD_HandleTypeDef uSdHandle;
00077 /**
00078   * @}
00079   */
00080
00081 /* Private function prototypes -----------------------------------------------*/
00082
00083 /** @defgroup STM32L496G_DISCOVERY_SD_Private_Functions Private Functions
00084   * @{
00085   */
00086 static void SD_Detect_MspInit(void);
00087 static void SD_Detect_MspDeInit(void);
00088 static HAL_StatusTypeDef SD_DMAConfigRx(SD_HandleTypeDef *hsd);
00089 static HAL_StatusTypeDef SD_DMAConfigTx(SD_HandleTypeDef *hsd);
00090
00091 /**
00092   * @}
00093   */
00094
00095 /* Exported functions ---------------------------------------------------------*/
00096
00097 /** @addtogroup STM32L496G_DISCOVERY_SD_Exported_Functions
00098   * @{
00099   */
00100
00101 /**
00102   * @brief  Initializes the SD card device.
00103   * @param  None
00104   * @retval SD status
00105   */
00106 uint8_t BSP_SD_Init(void)
00107 {
00108   uint8_t sd_state = MSD_OK;
00109
00110   /* uSD device interface configuration */
00111   uSdHandle.Instance = SDMMC1;
00112   uSdHandle.Init.ClockEdge           = SDMMC_CLOCK_EDGE_RISING;
00113   uSdHandle.Init.ClockBypass         = SDMMC_CLOCK_BYPASS_DISABLE;
00114   uSdHandle.Init.ClockPowerSave      = SDMMC_CLOCK_POWER_SAVE_DISABLE;
00115   uSdHandle.Init.BusWide             = SDMMC_BUS_WIDE_1B;
00116   uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_ENABLE;
00117   uSdHandle.Init.ClockDiv            = SDMMC_TRANSFER_CLK_DIV;
00118
00119   /* Msp SD Detect pin initialization */
00120   SD_Detect_MspInit();
00121
00122   /* Check if the SD card is plugged in the slot */
00123   if (BSP_SD_IsDetected() != SD_PRESENT)
00124   {
00125     return MSD_ERROR_SD_NOT_PRESENT;
00126   }
00127
00128   /* Msp SD initialization */
00129   BSP_SD_MspInit(&uSdHandle, NULL);
00130
00131   /* HAL SD initialization */
00132   if (HAL_SD_Init(&uSdHandle) != HAL_OK)
00133   {
00134     sd_state = MSD_ERROR;
00135   }
00136
00137   /* Configure SD Bus width */
00138   if (sd_state == MSD_OK)
00139   {
00140     /* Enable wide operation */
00141     if (HAL_SD_ConfigWideBusOperation(&uSdHandle, SDMMC_BUS_WIDE_4B) != HAL_OK)
00142     {
00143       sd_state = MSD_ERROR;
00144     }
00145     else
00146     {
00147       sd_state = MSD_OK;
00148     }
00149   }
00150
00151   return  sd_state;
00152 }
00153
00154 /**
00155   * @brief  DeInitializes the SD card device.
00156   * @param  None
00157   * @retval SD status
00158   */
00159 uint8_t BSP_SD_DeInit(void)
00160 {
00161   uint8_t sd_state = MSD_OK;
00162
00163   uSdHandle.Instance = SDMMC1;
00164   /* HAL SD deinitialization */
00165   if (HAL_SD_DeInit(&uSdHandle) != HAL_OK)
00166   {
00167     sd_state = MSD_ERROR;
00168   }
00169
00170   /* Msp SD deinitialization */
00171   BSP_SD_MspDeInit(&uSdHandle, NULL);
00172
00173   SD_Detect_MspDeInit();
00174
00175   return  sd_state;
00176 }
00177
00178 /**
00179   * @brief  Configures Interrupt mode for SD detection pin.
00180   * @param  None
00181   * @retval IO_OK: if all initializations are OK. Other value if error.
00182   */
00183 uint8_t BSP_SD_ITConfig(void)
00184 {
00185   /* Check SD card detect pin */
00186   if (BSP_IO_ReadPin(SD_DETECT_PIN) != SD_DETECT_PIN)
00187   {
00188     return BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_RISING_EDGE_PU);
00189   }
00190   else
00191   {
00192     return BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_IT_FALLING_EDGE_PU);
00193   }
00194 }
00195
00196
00197
00198 /**
00199  * @brief  Detects if SD card is correctly plugged in the memory slot or not.
00200  * @param  None
00201  * @retval Returns if SD is detected or not
00202  */
00203 uint8_t BSP_SD_IsDetected(void)
00204 {
00205   __IO uint8_t status = SD_PRESENT;
00206
00207   /* Check SD card detect pin */
00208   if (BSP_IO_ReadPin(SD_DETECT_PIN) != GPIO_PIN_RESET)
00209   {
00210     status = SD_NOT_PRESENT;
00211   }
00212
00213   return status;
00214 }
00215
00216 /**
00217   * @brief  Reads block(s) from a specified address in an SD card, in polling mode.
00218   * @param  pData: Pointer to the buffer that will contain the data to transmit
00219   * @param  ReadAddr: Address from where data is to be read
00220   * @param  NumOfBlocks: Number of SD blocks to read
00221   * @param  Timeout: Timeout for read operation
00222   * @retval SD status
00223   */
00224 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00225 {
00226   HAL_StatusTypeDef  sd_state = HAL_OK;
00227
00228   sd_state =  HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout);
00229
00230   if (sd_state == HAL_OK)
00231   {
00232     return MSD_OK;
00233   }
00234   else
00235   {
00236     return MSD_ERROR;
00237   }
00238 }
00239
00240 /**
00241   * @brief  Writes block(s) to a specified address in an SD card, in polling mode.
00242   * @param  pData: Pointer to the buffer that will contain the data to transmit
00243   * @param  WriteAddr: Address from where data is to be written
00244   * @param  NumOfBlocks: Number of SD blocks to write
00245   * @param  Timeout: Timeout for write operation
00246   * @retval SD status
00247   */
00248 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
00249 {
00250   HAL_StatusTypeDef  sd_state = HAL_OK;
00251
00252   sd_state = HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout);
00253
00254   if (sd_state == HAL_OK)
00255   {
00256     return MSD_OK;
00257   }
00258   else
00259   {
00260     return MSD_ERROR;
00261   }
00262 }
00263
00264 /**
00265   * @brief  Reads block(s) from a specified address in an SD card, in DMA mode.
00266   * @param  pData: Pointer to the buffer that will contain the data to transmit
00267   * @param  ReadAddr: Address from where data is to be read
00268   * @param  NumOfBlocks: Number of SD blocks to read
00269   * @retval SD status
00270   */
00271 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
00272 {
00273   HAL_StatusTypeDef  sd_state = HAL_OK;
00274
00275   /* Invalidate the dma tx handle*/
00276   uSdHandle.hdmatx = NULL;
00277
00278   /* Prepare the dma channel for a read operation */
00279   sd_state = SD_DMAConfigRx(&uSdHandle);
00280
00281   if (sd_state == HAL_OK)
00282   {
00283     /* Read block(s) in DMA transfer mode */
00284     sd_state = HAL_SD_ReadBlocks_DMA(&uSdHandle, (uint8_t *)pData, ReadAddr, NumOfBlocks);
00285   }
00286
00287   if (sd_state == HAL_OK)
00288   {
00289     return MSD_OK;
00290   }
00291   else
00292   {
00293     return MSD_ERROR;
00294   }
00295 }
00296
00297 /**
00298   * @brief  Writes block(s) to a specified address in an SD card, in DMA mode.
00299   * @param  pData: Pointer to the buffer that will contain the data to transmit
00300   * @param  WriteAddr: Address from where data is to be written
00301   * @param  NumOfBlocks: Number of SD blocks to write
00302   * @retval SD status
00303   */
00304 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
00305 {
00306   HAL_StatusTypeDef  sd_state = HAL_OK;
00307
00308   /* Invalidate the dma rx handle*/
00309   uSdHandle.hdmarx = NULL;
00310
00311   /* Prepare the dma channel for a read operation */
00312   sd_state = SD_DMAConfigTx(&uSdHandle);
00313
00314   if (sd_state == HAL_OK)
00315   {
00316     /* Write block(s) in DMA transfer mode */
00317     sd_state = HAL_SD_WriteBlocks_DMA(&uSdHandle, (uint8_t *)pData, WriteAddr, NumOfBlocks);
00318   }
00319
00320   if (sd_state == HAL_OK)
00321   {
00322     return MSD_OK;
00323   }
00324   else
00325   {
00326     return MSD_ERROR;
00327   }
00328 }
00329
00330 /**
00331   * @brief  Erases the specified memory area of the given SD card.
00332   * @param  StartAddr: Start byte address
00333   * @param  EndAddr: End byte address
00334   * @retval SD status
00335   */
00336 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
00337 {
00338   HAL_StatusTypeDef  sd_state = HAL_OK;
00339
00340   sd_state = HAL_SD_Erase(&uSdHandle, StartAddr, EndAddr);
00341
00342   if (sd_state == HAL_OK)
00343   {
00344     return MSD_OK;
00345   }
00346   else
00347   {
00348     return MSD_ERROR;
00349   }
00350 }
00351
00352 /**
00353   * @brief  Handles SD card interrupt request.
00354   * @retval None
00355   */
00356 void BSP_SD_IRQHandler(void)
00357 {
00358   HAL_SD_IRQHandler(&uSdHandle);
00359 }
00360
00361 /**
00362   * @brief  Handles SD DMA Tx transfer interrupt request.
00363   * @retval None
00364   */
00365 void BSP_SD_DMA_Tx_IRQHandler(void)
00366 {
00367   HAL_DMA_IRQHandler(uSdHandle.hdmatx);
00368 }
00369
00370 /**
00371   * @brief  Handles SD DMA Rx transfer interrupt request.
00372   * @retval None
00373   */
00374 void BSP_SD_DMA_Rx_IRQHandler(void)
00375 {
00376   HAL_DMA_IRQHandler(uSdHandle.hdmarx);
00377 }
00378
00379 /**
00380   * @brief  Gets the current SD card data status.
00381   * @param  None
00382   * @retval Data transfer state.
00383   */
00384 uint8_t BSP_SD_GetCardState(void)
00385 {
00386   HAL_SD_CardStateTypedef card_state;
00387   card_state = HAL_SD_GetCardState(&uSdHandle);
00388
00389   if (card_state == HAL_SD_CARD_TRANSFER)
00390   {
00391     return (SD_TRANSFER_OK);
00392   }
00393   else if ((card_state == HAL_SD_CARD_SENDING) ||
00394            (card_state == HAL_SD_CARD_RECEIVING) ||
00395            (card_state == HAL_SD_CARD_PROGRAMMING))
00396   {
00397     return (SD_TRANSFER_BUSY);
00398   }
00399   else
00400   {
00401     return (SD_TRANSFER_ERROR);
00402   }
00403 }
00404
00405 /**
00406   * @brief  Get SD information about specific SD card.
00407   * @param  CardInfo: Pointer to HAL_SD_CardInfoTypedef structure
00408   * @retval None
00409   */
00410 void BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo)
00411 {
00412   /* Get SD card Information */
00413   HAL_SD_GetCardInfo(&uSdHandle, CardInfo);
00414 }
00415
00416 /**
00417   * @brief  Initializes the SD MSP.
00418   * @note   The SDMMC clock configuration done within this function assumes that
00419   *         the PLLSAI1 input clock runs at 8 MHz.
00420   * @param hsd: SD handle
00421   * @param Params: Additional parameters
00422   * @retval None
00423   */
00424 __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
00425 {
00426   GPIO_InitTypeDef gpioinitstruct = {0};
00427   RCC_PeriphCLKInitTypeDef  RCC_PeriphClkInit;
00428
00429   /* Prevent unused argument(s) compilation warning */
00430   UNUSED(Params);
00431
00432   HAL_RCCEx_GetPeriphCLKConfig(&RCC_PeriphClkInit);
00433
00434   /* Configure the SDMMC1 clock source. The clock is derived from the PLLSAI1 */
00435   /* Hypothesis is that PLLSAI1 VCO input is 8Mhz */
00436   RCC_PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SDMMC1;
00437   RCC_PeriphClkInit.PLLSAI1.PLLSAI1N = 24;
00438   RCC_PeriphClkInit.PLLSAI1.PLLSAI1Q = 4;
00439   RCC_PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_48M2CLK;
00440   RCC_PeriphClkInit.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_PLLSAI1;
00441   if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit) != HAL_OK)
00442   {
00443     while (1) {}
00444   }
00445
00446   /* Enable SDMMC1 clock */
00447   __HAL_RCC_SDMMC1_CLK_ENABLE();
00448
00449   /* Enable DMA2 clocks */
00450   SD_DMAx_CLK_ENABLE();
00451
00452   /* Enable GPIOs clock */
00453   __HAL_RCC_GPIOC_CLK_ENABLE();
00454   __HAL_RCC_GPIOD_CLK_ENABLE();
00455
00456   /* Common GPIO configuration */
00457   gpioinitstruct.Mode      = GPIO_MODE_AF_PP;
00458   gpioinitstruct.Pull      = GPIO_NOPULL;
00459   gpioinitstruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00460   gpioinitstruct.Alternate = GPIO_AF12_SDMMC1;
00461
00462   /* GPIOC configuration */
00463   gpioinitstruct.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00464
00465   HAL_GPIO_Init(GPIOC, &gpioinitstruct);
00466
00467   /* GPIOD configuration */
00468   gpioinitstruct.Pin = GPIO_PIN_2;
00469   HAL_GPIO_Init(GPIOD, &gpioinitstruct);
00470
00471   /* NVIC configuration for SDMMC1 interrupts */
00472   HAL_NVIC_SetPriority(SDMMCx_IRQn, 5, 0);
00473   HAL_NVIC_EnableIRQ(SDMMCx_IRQn);
00474
00475   /* DMA initialization should be done here but , as there is only one channel for RX and TX it is configured and done directly when required*/
00476 }
00477
00478 /**
00479   * @brief  De-Initializes the SD MSP.
00480   * @param hsd: SD handle
00481   * @param Params: Additional parameters
00482   * @retval None
00483   */
00484 __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
00485 {
00486   GPIO_InitTypeDef gpioinitstruct = {0};
00487
00488   /* Prevent unused argument(s) compilation warning */
00489   UNUSED(Params);
00490
00491   /* Enable SDMMC1 clock */
00492   __HAL_RCC_SDMMC1_CLK_DISABLE();
00493
00494   /* Enable DMA2 clocks */
00495   SD_DMAx_CLK_DISABLE();
00496
00497   /* Enable GPIOs clock */
00498   __HAL_RCC_GPIOC_CLK_ENABLE();
00499   __HAL_RCC_GPIOD_CLK_ENABLE();
00500
00501   /* Common GPIO configuration */
00502   gpioinitstruct.Mode      = GPIO_MODE_ANALOG;
00503   gpioinitstruct.Pull      = GPIO_NOPULL;
00504   gpioinitstruct.Speed     = GPIO_SPEED_FREQ_LOW;
00505   gpioinitstruct.Alternate = 0;
00506
00507   /* GPIOC configuration */
00508   gpioinitstruct.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
00509
00510   HAL_GPIO_Init(GPIOC, &gpioinitstruct);
00511
00512   /* GPIOD configuration */
00513   gpioinitstruct.Pin = GPIO_PIN_2;
00514   HAL_GPIO_Init(GPIOD, &gpioinitstruct);
00515
00516   /* NVIC configuration for SDMMC1 interrupts */
00517   HAL_NVIC_DisableIRQ(SDMMCx_IRQn);
00518
00519 }
00520
00521 /**
00522   * @brief BSP SD Abort callback
00523   * @retval None
00524   */
00525 __weak void BSP_SD_AbortCallback(void)
00526 {
00527
00528 }
00529
00530 /**
00531   * @brief BSP Tx Transfer completed callback
00532   * @retval None
00533   */
00534 __weak void BSP_SD_WriteCpltCallback(void)
00535 {
00536
00537 }
00538
00539 /**
00540   * @brief BSP Rx Transfer completed callback
00541   * @retval None
00542   */
00543 __weak void BSP_SD_ReadCpltCallback(void)
00544 {
00545
00546 }
00547
00548 /**
00549   * @brief SD Abort callback
00550   * @param hsd: SD handle
00551   * @retval None
00552   */
00553 void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
00554 {
00555   BSP_SD_AbortCallback();
00556 }
00557
00558 /**
00559   * @brief Tx Transfer completed callback
00560   * @param hsd: SD handle
00561   * @retval None
00562   */
00563 void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
00564 {
00565   BSP_SD_WriteCpltCallback();
00566 }
00567
00568 /**
00569   * @brief Rx Transfer completed callback
00570   * @param hsd: SD handle
00571   * @retval None
00572   */
00573 void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
00574 {
00575   BSP_SD_ReadCpltCallback();
00576 }
00577
00578 /**
00579   * @}
00580   */
00581
00582
00583 /** @addtogroup STM32L496G_DISCOVERY_SD_Private_Functions
00584   * @{
00585   */
00586
00587 /**
00588   * @brief  Initializes the SD Detect pin MSP.
00589   * @param  hsd: SD handle
00590   * @param  Params
00591   * @retval None
00592   */
00593 static void SD_Detect_MspInit(void)
00594 {
00595   if (BSP_IO_Init() == IO_ERROR)
00596   {
00597     BSP_ErrorHandler();
00598   }
00599   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
00600 }
00601
00602 /**
00603   * @brief  Initializes the SD Detect pin MSP.
00604   * @param  hsd: SD handle
00605   * @param  Params
00606   * @retval None
00607   */
00608 static void SD_Detect_MspDeInit(void)
00609 {
00610   /* Disable all interrupts */
00611   /*HAL_NVIC_DisableIRQ(MFX_INT_EXTI_IRQn);*/
00612
00613   if (BSP_IO_Init() == IO_ERROR)
00614   {
00615     BSP_ErrorHandler();
00616   }
00617   BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_ANALOG);
00618 }
00619
00620 /**
00621   * @brief Configure the DMA to receive data from the SD card
00622   * @retval
00623   *  HAL_ERROR or HAL_OK
00624   */
00625 static HAL_StatusTypeDef SD_DMAConfigRx(SD_HandleTypeDef *hsd)
00626 {
00627   static DMA_HandleTypeDef hdma_rx;
00628   HAL_StatusTypeDef status = HAL_ERROR;
00629
00630   /* Configure DMA Rx parameters */
00631   hdma_rx.Init.Request             = DMA_REQUEST_7;
00632   hdma_rx.Init.Direction           = DMA_PERIPH_TO_MEMORY;
00633   hdma_rx.Init.PeriphInc           = DMA_PINC_DISABLE;
00634   hdma_rx.Init.MemInc              = DMA_MINC_ENABLE;
00635   hdma_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00636   hdma_rx.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00637   hdma_rx.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00638
00639   hdma_rx.Instance = SD_DMAx_STREAM;
00640
00641   /* Associate the DMA handle */
00642   __HAL_LINKDMA(hsd, hdmarx, hdma_rx);
00643
00644   /* Stop any ongoing transfer and reset the state*/
00645   HAL_DMA_Abort(&hdma_rx);
00646
00647   /* Deinitialize the Channel for new transfer */
00648   HAL_DMA_DeInit(&hdma_rx);
00649
00650   /* Configure the DMA Channel */
00651   status = HAL_DMA_Init(&hdma_rx);
00652
00653   /* NVIC configuration for DMA transfer complete interrupt */
00654   HAL_NVIC_SetPriority(SD_DMAx_IRQn, 6, 0);
00655   HAL_NVIC_EnableIRQ(SD_DMAx_IRQn);
00656
00657   return (status);
00658 }
00659
00660 /**
00661   * @brief Configure the DMA to transmit data to the SD card
00662   * @retval
00663   *  HAL_ERROR or HAL_OK
00664   */
00665 static HAL_StatusTypeDef SD_DMAConfigTx(SD_HandleTypeDef *hsd)
00666 {
00667   static DMA_HandleTypeDef hdma_tx;
00668   HAL_StatusTypeDef status;
00669
00670   /* Configure DMA Tx parameters */
00671   hdma_tx.Init.Request             = DMA_REQUEST_7;
00672   hdma_tx.Init.Direction           = DMA_MEMORY_TO_PERIPH;
00673   hdma_tx.Init.PeriphInc           = DMA_PINC_DISABLE;
00674   hdma_tx.Init.MemInc              = DMA_MINC_ENABLE;
00675   hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
00676   hdma_tx.Init.MemDataAlignment    = DMA_MDATAALIGN_WORD;
00677   hdma_tx.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
00678
00679   hdma_tx.Instance = SD_DMAx_STREAM;
00680
00681   /* Associate the DMA handle */
00682   __HAL_LINKDMA(hsd, hdmatx, hdma_tx);
00683
00684   /* Stop any ongoing transfer and reset the state*/
00685   HAL_DMA_Abort(&hdma_tx);
00686
00687   /* Deinitialize the Channel for new transfer */
00688   HAL_DMA_DeInit(&hdma_tx);
00689
00690   /* Configure the DMA Channel */
00691   status = HAL_DMA_Init(&hdma_tx);
00692
00693   /* NVIC configuration for DMA transfer complete interrupt */
00694   HAL_NVIC_SetPriority(SD_DMAx_IRQn, 6, 0);
00695   HAL_NVIC_EnableIRQ(SD_DMAx_IRQn);
00696
00697   return (status);
00698 }
00699
00700 /**
00701   * @}
00702   */
00703
00704 /**
00705   * @}
00706   */
00707
00708 /**
00709   * @}
00710   */
00711
00712 /**
00713   * @}
00714   */
00715
00716 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sd.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_sd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_sd.h
00004   * @author  MCD Application Team
00005   * @brief   This file includes the uSD card driver.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016   *
00017   ******************************************************************************
00018   */
00019
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32L496G_DISCOVERY_SD_H
00022 #define __STM32L496G_DISCOVERY_SD_H
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32l4xx_hal.h"
00030
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034
00035 /** @addtogroup STM32L496G_DISCOVERY
00036   * @{
00037   */
00038
00039 /** @addtogroup STM32L496G_DISCOVERY_SD
00040   * @{
00041   */
00042
00043 /* Exported types ------------------------------------------------------------*/
00044
00045 /** @defgroup STM32L496G_DISCOVERY_SD_Exported_Types Exported Types
00046   * @{
00047   */
00048
00049 /**
00050   * @brief SD Card information structure
00051   */
00052 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
00053 /**
00054   * @}
00055   */
00056
00057 /**
00058   * @brief  SD status structure definition
00059   */
00060 #define   MSD_OK                        ((uint8_t)0x00)
00061 #define   MSD_ERROR                     ((uint8_t)0x01)
00062 #define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)
00063
00064 /**
00065   * @brief  SD transfer state definition
00066   */
00067 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
00068 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)
00069 #define   SD_TRANSFER_ERROR             ((uint8_t)0x02)
00070
00071 /* Exported constants --------------------------------------------------------*/
00072
00073 /** @defgroup STM32L496G_DISCOVERY_SD_Exported_Constants  Exported Constants
00074   * @{
00075   */
00076 #define SD_DETECT_PIN            IO1_PIN_8
00077
00078 #define SD_DATATIMEOUT           ((uint32_t)100000000)
00079
00080 #define SD_PRESENT               ((uint8_t)0x01)
00081 #define SD_NOT_PRESENT           ((uint8_t)0x00)
00082
00083 /* SD IRQ handler */
00084 #define SDMMCx_IRQHandler        SDMMC1_IRQHandler
00085 #define SDMMCx_IRQn              SDMMC1_IRQn
00086
00087
00088 /* DMA definitions for SD DMA transfer */
00089 #define SD_DMAx_CLK_ENABLE       __HAL_RCC_DMA2_CLK_ENABLE
00090 #define SD_DMAx_CLK_DISABLE      __HAL_RCC_DMA2_CLK_DISABLE
00091 #define SD_DMAx_STREAM           DMA2_Channel5
00092 #define SD_DMAx_IRQn             DMA2_Channel5_IRQn
00093 #define SD_DMAx_IRQHandler       DMA2_Channel5_IRQHandler
00094
00095 /**
00096   * @}
00097   */
00098
00099 /* Exported functions --------------------------------------------------------*/
00100
00101 /** @defgroup STM32L496G_DISCOVERY_SD_Exported_Functions Exported Functions
00102   * @{
00103   */
00104 uint8_t BSP_SD_Init(void);
00105 uint8_t BSP_SD_DeInit(void);
00106 uint8_t BSP_SD_ITConfig(void);
00107 uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00108 uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
00109 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
00110 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
00111 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
00112 void    BSP_SD_IRQHandler(void);
00113 void    BSP_SD_DMA_Tx_IRQHandler(void);
00114 void    BSP_SD_DMA_Rx_IRQHandler(void);
00115 uint8_t BSP_SD_GetCardState(void);
00116 void    BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo);
00117 uint8_t BSP_SD_IsDetected(void);
00118
00119 /* These __weak functions can be surcharged by application code in case the current settings
00120    (eg. interrupt priority, callbacks implementation) need to be changed for specific application needs */
00121 void    BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
00122 void    BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
00123 void    BSP_SD_AbortCallback(void);
00124 void    BSP_SD_WriteCpltCallback(void);
00125 void    BSP_SD_ReadCpltCallback(void);
00126
00127 /**
00128   * @}
00129   */
00130
00131 /**
00132   * @}
00133   */
00134
00135 /**
00136   * @}
00137   */
00138
00139 /**
00140   * @}
00141   */
00142
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146
00147 #endif /* __STM32L496G_DISCOVERY_SD_H */
00148
00149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sram.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_sram.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_sram.c
00004   * @author  MCD Application Team
00005   * @brief   This file provides a set of functions needed to drive the
00006   *          IS66WV51216EBLL SRAM memory mounted on STM32L496G-Discovery board.
00007   @verbatim
00008   ==============================================================================
00009                      ##### How to use this driver #####
00010   ==============================================================================
00011   [..]
00012    (#) This driver is used to drive the IS66WV51216EBLL-70BLI SRAM external memory mounted
00013        on STM32L496G-Discovery evaluation board.
00014
00015    (#) This driver does not need a specific component driver for the SRAM device
00016        to be included with.
00017
00018    (#) Initialization steps:
00019        (++) Initialize the SRAM external memory using the BSP_SRAM_Init() function. This
00020             function includes the MSP layer hardware resources initialization and the
00021             FMC controller configuration to interface with the external SRAM memory.
00022
00023    (#) SRAM read/write operations
00024        (++) SRAM external memory can be accessed with read/write operations once it is
00025             initialized.
00026             Read/write operation can be performed with AHB access using the functions
00027             BSP_SRAM_ReadData()/BSP_SRAM_WriteData(), or by DMA transfer using the functions
00028             BSP_SRAM_ReadData_DMA()/BSP_SRAM_WriteData_DMA().
00029        (++) The AHB access is performed with 16-bit width transaction, the DMA transfer
00030             configuration is fixed at single (no burst) halfword transfer
00031             (see the SRAM_MspInit() static function).
00032        (++) User can implement his own functions for read/write access with his desired
00033             configurations.
00034        (++) If interrupt mode is used for DMA transfer, the function BSP_SRAM_DMA_IRQHandler()
00035             is called in IRQ handler file, to serve the generated interrupt once the DMA
00036             transfer is complete.
00037   @endverbatim
00038   ******************************************************************************
00039   * @attention
00040   *
00041   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00042   * All rights reserved.</center></h2>
00043   *
00044   * This software component is licensed by ST under BSD 3-Clause license,
00045   * the "License"; You may not use this file except in compliance with the
00046   * License. You may obtain a copy of the License at:
00047   *                        opensource.org/licenses/BSD-3-Clause
00048   *
00049   ******************************************************************************
00050   */
00051
00052 /* Includes ------------------------------------------------------------------*/
00053 #include "stm32l496g_discovery_sram.h"
00054
00055 /** @addtogroup BSP
00056   * @{
00057   */
00058
00059 /** @addtogroup STM32L496G_DISCOVERY
00060   * @{
00061   */
00062
00063 /** @defgroup STM32L496G_DISCOVERY_SRAM STM32L496G-DISCOVERY SRAM
00064   * @{
00065   */
00066
00067
00068 /* Private variables ---------------------------------------------------------*/
00069
00070 /** @defgroup STM32L496G_DISCOVERY_SRAM_Private_Variables Private Variables
00071   * @{
00072   */
00073 static SRAM_HandleTypeDef sramHandle;
00074 static FMC_NORSRAM_TimingTypeDef Timing;
00075
00076 /**
00077   * @}
00078   */
00079
00080 /* Private macros ------------------------------------------------------------*/
00081 /* Private constants ---------------------------------------------------------*/
00082
00083 /** @defgroup STM32L496G_DISCOVERY_SRAM_Private_Constants Private Constants
00084   * @{
00085   */
00086 /* Timings for SRAM IS66WV51216EBLL-70BLI */
00087 #define SRAM_ADDR_SETUP_TIME  5 /* 60ns with a clock at 80 MHz (period of 12.5 ns) */
00088 #define SRAM_DATA_SETUP_TIME  3 /* 30ns with a clock at 80 MHz (period of 12.5 ns) */
00089 #define SRAM_TURN_AROUND_TIME 1 /* 5ns with a clock at 80 MHz (perido of 12.5 ns) */
00090
00091 /**
00092   * @}
00093   */
00094
00095 /* Private function prototypes -----------------------------------------------*/
00096
00097 /** @defgroup STM32L496G_DISCOVERY_SRAM_Private_Functions Private Functions
00098   * @{
00099   */
00100 static void SRAM_MspInit(void);
00101
00102 /**
00103   * @}
00104   */
00105
00106 /* Private functions ---------------------------------------------------------*/
00107
00108 /** @defgroup STM32L496G_DISCOVERY_SRAM_Exported_Functions Exported Functions
00109   * @{
00110   */
00111
00112 /**
00113   * @brief  Initializes the SRAM device.
00114   * @retval SRAM status
00115   */
00116 uint8_t BSP_SRAM_Init(void)
00117 {
00118   sramHandle.Instance  = FMC_NORSRAM_DEVICE;
00119   sramHandle.Extended  = FMC_NORSRAM_EXTENDED_DEVICE;
00120
00121   /* SRAM device configuration */
00122   Timing.AddressSetupTime      = SRAM_ADDR_SETUP_TIME;
00123   Timing.DataSetupTime         = SRAM_DATA_SETUP_TIME;
00124   Timing.BusTurnAroundDuration = SRAM_TURN_AROUND_TIME;
00125   Timing.AccessMode            = FMC_ACCESS_MODE_A;
00126
00127   sramHandle.Init.NSBank             = FMC_NORSRAM_BANK2;
00128   sramHandle.Init.DataAddressMux     = FMC_DATA_ADDRESS_MUX_DISABLE;
00129   sramHandle.Init.MemoryType         = FMC_MEMORY_TYPE_SRAM;
00130   sramHandle.Init.MemoryDataWidth    = FMC_NORSRAM_MEM_BUS_WIDTH_16;
00131   sramHandle.Init.BurstAccessMode    = FMC_BURST_ACCESS_MODE_DISABLE;
00132   sramHandle.Init.WriteOperation     = FMC_WRITE_OPERATION_ENABLE;
00133   sramHandle.Init.ExtendedMode       = FMC_EXTENDED_MODE_DISABLE;
00134   sramHandle.Init.AsynchronousWait   = FMC_ASYNCHRONOUS_WAIT_DISABLE;
00135   sramHandle.Init.WriteBurst         = FMC_WRITE_BURST_DISABLE;
00136   sramHandle.Init.ContinuousClock    = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
00137   sramHandle.Init.WriteFifo          = FMC_WRITE_FIFO_DISABLE;
00138   sramHandle.Init.PageSize           = FMC_PAGE_SIZE_NONE;
00139
00140   /* SRAM controller initialization */
00141   SRAM_MspInit();
00142   if (HAL_SRAM_Init(&sramHandle, &Timing, &Timing) != HAL_OK)
00143   {
00144     return SRAM_ERROR;
00145   }
00146   else
00147   {
00148     return SRAM_OK;
00149   }
00150 }
00151
00152 /**
00153   * @brief  Reads an amount of data from the SRAM device in polling mode.
00154   * @param  uwStartAddress: Read start address
00155   * @param  pData: Pointer to data to be read
00156   * @param  uwDataSize: Size of read data from the memory
00157   * @retval SRAM status
00158   */
00159 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00160 {
00161   if (HAL_SRAM_Read_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00162   {
00163     return SRAM_ERROR;
00164   }
00165   else
00166   {
00167     return SRAM_OK;
00168   }
00169 }
00170
00171 /**
00172   * @brief  Reads an amount of data from the SRAM device in DMA mode.
00173   * @param  uwStartAddress: Read start address
00174   * @param  pData: Pointer to data to be read
00175   * @param  uwDataSize: Size of read data from the memory
00176   * @retval SRAM status
00177   */
00178 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00179 {
00180   if (HAL_SRAM_Read_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00181   {
00182     return SRAM_ERROR;
00183   }
00184   else
00185   {
00186     return SRAM_OK;
00187   }
00188 }
00189
00190 /**
00191   * @brief  Writes an amount of data from the SRAM device in polling mode.
00192   * @param  uwStartAddress: Write start address
00193   * @param  pData: Pointer to data to be written
00194   * @param  uwDataSize: Size of written data from the memory
00195   * @retval SRAM status
00196   */
00197 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00198 {
00199   if (HAL_SRAM_Write_16b(&sramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
00200   {
00201     return SRAM_ERROR;
00202   }
00203   else
00204   {
00205     return SRAM_OK;
00206   }
00207 }
00208
00209 /**
00210   * @brief  Writes an amount of data from the SRAM device in DMA mode.
00211   * @param  uwStartAddress: Write start address
00212   * @param  pData: Pointer to data to be written
00213   * @param  uwDataSize: Size of written data from the memory
00214   * @retval SRAM status
00215   */
00216 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
00217 {
00218   if (HAL_SRAM_Write_DMA(&sramHandle, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
00219   {
00220     return SRAM_ERROR;
00221   }
00222   else
00223   {
00224     return SRAM_OK;
00225   }
00226 }
00227
00228 /**
00229   * @brief  Handles SRAM DMA transfer interrupt request.
00230   * @retval None
00231   */
00232 void BSP_SRAM_DMA_IRQHandler(void)
00233 {
00234   HAL_DMA_IRQHandler(sramHandle.hdma);
00235 }
00236
00237 /** @addtogroup STM32L476G_EVAL_SRAM_Private_Functions
00238   * @{
00239   */
00240
00241 /**
00242   * @brief  Initializes SRAM MSP.
00243   * @retval None
00244   */
00245 static void SRAM_MspInit(void)
00246 {
00247   static DMA_HandleTypeDef dmaHandle;
00248   GPIO_InitTypeDef gpioinitstruct;
00249   SRAM_HandleTypeDef *hsram = &sramHandle;
00250
00251   /* Enable FMC clock */
00252   __HAL_RCC_FMC_CLK_ENABLE();
00253
00254   /* Enable chosen DMAx clock */
00255   SRAM_DMAx_CLK_ENABLE();
00256
00257   /* Enable GPIOs clock */
00258   __HAL_RCC_GPIOD_CLK_ENABLE();
00259   __HAL_RCC_GPIOE_CLK_ENABLE();
00260   __HAL_RCC_GPIOF_CLK_ENABLE();
00261   __HAL_RCC_GPIOG_CLK_ENABLE();
00262   __HAL_RCC_PWR_CLK_ENABLE();
00263   HAL_PWREx_EnableVddIO2();
00264
00265   /* Common GPIO configuration */
00266   gpioinitstruct.Mode      = GPIO_MODE_AF_PP;
00267   gpioinitstruct.Pull      = GPIO_NOPULL;
00268   gpioinitstruct.Speed     = GPIO_SPEED_FREQ_VERY_HIGH;
00269   gpioinitstruct.Alternate = GPIO_AF12_FMC;
00270
00271   /*## Data Bus #######*/
00272   /* GPIOD configuration */
00273   gpioinitstruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9 |
00274                        GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15;
00275   HAL_GPIO_Init(GPIOD, &gpioinitstruct);
00276
00277   /* GPIOE configuration */
00278   gpioinitstruct.Pin = GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 |
00279                        GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 |
00280                        GPIO_PIN_14 | GPIO_PIN_15;
00281   HAL_GPIO_Init(GPIOE, &gpioinitstruct);
00282
00283   /*## Address Bus #######*/
00284   /* GPIOD configuration */
00285   gpioinitstruct.Pin = GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13;
00286   HAL_GPIO_Init(GPIOD, &gpioinitstruct);
00287
00288   /* GPIOF configuration */
00289   gpioinitstruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
00290                        GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 |
00291                        GPIO_PIN_14 | GPIO_PIN_15;
00292   HAL_GPIO_Init(GPIOF, &gpioinitstruct);
00293
00294   /* GPIOG configuration */
00295   gpioinitstruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 |
00296                        GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5;
00297   HAL_GPIO_Init(GPIOG, &gpioinitstruct);
00298
00299   /*## NOE and NWE configuration #######*/
00300   gpioinitstruct.Pull = GPIO_PULLUP;
00301   gpioinitstruct.Pin  = GPIO_PIN_4 | GPIO_PIN_5;
00302   HAL_GPIO_Init(GPIOD, &gpioinitstruct);
00303   HAL_Delay(1);
00304
00305   /*## NBL0, NBL1 configuration #######*/
00306   gpioinitstruct.Pin = GPIO_PIN_0 | GPIO_PIN_1;
00307   HAL_GPIO_Init(GPIOE, &gpioinitstruct);
00308
00309   /*## NE configuration #######*/
00310   gpioinitstruct.Pin = GPIO_PIN_9;
00311   HAL_GPIO_Init(GPIOG, &gpioinitstruct);
00312
00313   /* Configure common DMA parameters */
00314   dmaHandle.Init.Direction           = DMA_MEMORY_TO_MEMORY;
00315   dmaHandle.Init.PeriphInc           = DMA_PINC_ENABLE;
00316   dmaHandle.Init.MemInc              = DMA_MINC_ENABLE;
00317   dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
00318   dmaHandle.Init.MemDataAlignment    = DMA_MDATAALIGN_HALFWORD;
00319   dmaHandle.Init.Mode                = DMA_NORMAL;
00320   dmaHandle.Init.Priority            = DMA_PRIORITY_HIGH;
00321
00322   dmaHandle.Instance = SRAM_DMAx_CHANNEL;
00323
00324   /* Associate the DMA handle */
00325   __HAL_LINKDMA(hsram, hdma, dmaHandle);
00326
00327   /* Deinitialize the Stream for new transfer */
00328   HAL_DMA_DeInit(&dmaHandle);
00329
00330   /* Configure the DMA Stream */
00331   HAL_DMA_Init(&dmaHandle);
00332
00333   /* NVIC configuration for DMA transfer complete interrupt */
00334   HAL_NVIC_SetPriority(SRAM_DMAx_IRQn, 5, 0);
00335   HAL_NVIC_EnableIRQ(SRAM_DMAx_IRQn);
00336 }
00337
00338 /**
00339   * @}
00340   */
00341
00342 /**
00343   * @}
00344   */
00345
00346 /**
00347   * @}
00348   */
00349
00350 /**
00351   * @}
00352   */
00353
00354 /**
00355   * @}
00356   */
00357
00358 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_sram.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_sram.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_sram.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_sram.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /** @addtogroup BSP
00022   * @{
00023   */
00024
00025 /** @addtogroup STM32L496G_DISCOVERY
00026   * @{
00027   */
00028
00029 /* Define to prevent recursive inclusion -------------------------------------*/
00030 #ifndef __STM32L496G_DISCOVERY_SRAM_H
00031 #define __STM32L496G_DISCOVERY_SRAM_H
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 /* Includes ------------------------------------------------------------------*/
00038 #include "stm32l4xx_hal.h"
00039
00040 /** @addtogroup STM32L496G_DISCOVERY_SRAM
00041   * @{
00042   */
00043
00044
00045 /* Exported constants --------------------------------------------------------*/
00046
00047 /** @defgroup STM32L496G_DISCOVERY_SRAM_Exported_Constants Exported Constants
00048   * @{
00049   */
00050
00051 /**
00052   * @brief  SRAM status structure definition
00053   */
00054 #define SRAM_OK         0x00
00055 #define SRAM_ERROR      0x01
00056
00057 #define SRAM_DEVICE_ADDR  ((uint32_t)0x64000000)
00058 #define SRAM_DEVICE_SIZE  ((uint32_t)0x80000)  /* SRAM device size in MBytes */
00059
00060 /* #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_8  */
00061 #define SRAM_MEMORY_WIDTH    FMC_NORSRAM_MEM_BUS_WIDTH_16
00062
00063 #define SRAM_BURSTACCESS    FMC_BURST_ACCESS_MODE_DISABLE
00064 /* #define SRAM_BURSTACCESS    FMC_BURST_ACCESS_MODE_ENABLE*/
00065
00066 #define SRAM_WRITEBURST    FMC_WRITE_BURST_DISABLE
00067 /* #define SRAM_WRITEBURST   FMC_WRITE_BURST_ENABLE */
00068
00069 /* DMA definitions for SRAM DMA transfer */
00070 #define SRAM_DMAx_CLK_ENABLE              __HAL_RCC_DMA1_CLK_ENABLE
00071 #define SRAM_DMAx_CHANNEL                 DMA1_Channel1
00072 #define SRAM_DMAx_IRQn                    DMA1_Channel1_IRQn
00073 #define SRAM_DMAx_IRQHandler              DMA1_Channel1_IRQHandler
00074
00075 /**
00076   * @}
00077   */
00078
00079
00080 /* Exported functions --------------------------------------------------------*/
00081
00082 /** @addtogroup STM32L496G_DISCOVERY_SRAM_Exported_Functions
00083   * @{
00084   */
00085 uint8_t BSP_SRAM_Init(void);
00086 uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00087 uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00088 uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00089 uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize);
00090 void BSP_SRAM_DMA_IRQHandler(void);
00091
00092 /**
00093   * @}
00094   */
00095
00096 /**
00097   * @}
00098   */
00099
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103
00104 #endif /* __STM32L496G_DISCOVERY_SRAM_H */
00105
00106 /**
00107   * @}
00108   */
00109
00110 /**
00111   * @}
00112   */
00113
00114 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_ts.c Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_ts.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_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 STM32L496G-DISCOVERY evaluation board.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* File Info : -----------------------------------------------------------------
00022                                    User NOTES
00023 1. How To use this driver:
00024 --------------------------
00025    - This driver is used to drive the touch screen module of the STM32L496G-DISCOVERY
00026      evaluation board on the FRIDA LCD mounted on MB1261 daughter board.
00027      The touch screen driver IC is a FT6x36 type which share the same register naming
00028      with FT6206 type.
00029
00030 2. Driver description:
00031 ---------------------
00032   + Initialization steps:
00033      o Initialize the TS module using the BSP_TS_Init() function. This
00034        function includes the MSP layer hardware resources initialization and the
00035        communication layer configuration to start the TS use. The LCD size properties
00036        (x and y) are passed as parameters.
00037      o If TS interrupt mode is desired, you must configure the TS interrupt mode
00038        by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
00039        as an external interrupt whenever a touch is detected.
00040
00041   + Touch screen use
00042      o The touch screen state is captured whenever the function BSP_TS_GetState() is
00043        used. This function returns information about the last LCD touch occurred
00044        in the TS_StateTypeDef structure.
00045 ------------------------------------------------------------------------------*/
00046
00047 /* Includes ------------------------------------------------------------------*/
00048 #include "stm32l496g_discovery.h"
00049 #include "stm32l496g_discovery_ts.h"
00050
00051 /** @addtogroup BSP
00052   * @{
00053   */
00054
00055 /** @addtogroup STM32L496G-DISCOVERY
00056   * @{
00057   */
00058
00059 /** @defgroup STM32L496G-DISCOVERY_TS STM32L496G-DISCOVERY TS
00060   * @{
00061   */
00062
00063 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Types_Definitions TS Private Types Definitions
00064   * @{
00065   */
00066 /**
00067   * @}
00068   */
00069
00070 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Defines TS Private Types Defines
00071   * @{
00072   */
00073 /**
00074   * @}
00075   */
00076
00077 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Macros TS Private Macros
00078   * @{
00079   */
00080 /**
00081   * @}
00082   */
00083
00084 /** @defgroup STM32L496G-DISCOVERY_TS_Imported_Variables TS Imported Variables
00085   * @{
00086   */
00087 /**
00088   * @}
00089   */
00090
00091 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Variables TS Private Variables
00092   * @{
00093   */
00094 static TS_DrvTypeDef *tsDriver;
00095 static uint8_t  I2C_Address = 0;
00096 static uint8_t  tsOrientation = TS_SWAP_NONE;
00097 static uint8_t  TS_orientation = TS_ORIENTATION_UNDEFINED;
00098
00099 /* Table for touchscreen event information display on LCD : table indexed on enum @ref TS_TouchEventTypeDef information */
00100 char *ts_event_string_tab[TOUCH_EVENT_NB_MAX] = { "None",
00101                                                   "Press down",
00102                                                   "Lift up",
00103                                                   "Contact"
00104                                                 };
00105
00106 /* Table for touchscreen gesture Id information display on LCD : table indexed on enum @ref TS_GestureIdTypeDef information */
00107 char *ts_gesture_id_string_tab[GEST_ID_NB_MAX] = { "None",
00108                                                    "Move Up",
00109                                                    "Move Right",
00110                                                    "Move Down",
00111                                                    "Move Left",
00112                                                    "Zoom In",
00113                                                    "Zoom Out"
00114                                                  };
00115 /**
00116   * @}
00117   */
00118
00119 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Function_Prototypes TS Private Function Prototypes
00120   * @{
00121   */
00122 /**
00123   * @}
00124   */
00125
00126 /** @defgroup STM32L496G-DISCOVERY_TS_Public_Functions TS Public Functions
00127   * @{
00128   */
00129 /**
00130   * @brief  Initializes and configures the touch screen functionalities and
00131   *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00132   * @param  ts_SizeX : Maximum X size of the TS area on LCD
00133   * @param  ts_SizeY : Maximum Y size of the TS area on LCD
00134   * @retval TS_OK if all initializations are OK. Other value if error.
00135   */
00136 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
00137 {
00138   return (BSP_TS_InitEx(ts_SizeX, ts_SizeY, TS_ORIENTATION_LANDSCAPE));
00139 }
00140
00141 /**
00142   * @brief  Initializes and configures the touch screen functionalities and
00143   *         configures all necessary hardware resources (GPIOs, I2C, clocks..)
00144   *         with a given orientation
00145   * @param  ts_SizeX : Maximum X size of the TS area on LCD
00146   * @param  ts_SizeY : Maximum Y size of the TS area on LCD
00147   * @param  orientation : TS_ORIENTATION_LANDSCAPE or TS_ORIENTATION_PORTRAIT
00148   * @retval TS_OK if all initializations are OK. Other value if error.
00149   */
00150 uint8_t BSP_TS_InitEx(uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t  orientation)
00151 {
00152   uint8_t ts_status = TS_OK;
00153   uint16_t read_id = 0;
00154
00155   /* Note : I2C_Address is un-initialized here, but is not used at all in init function */
00156   /* but the prototype of Init() is like that in template and should be respected       */
00157
00158   /* Initialize the communication channel to sensor (I2C) if necessary */
00159   /* that is initialization is done only once after a power up         */
00160   ft6x06_ts_drv.Init(I2C_Address);
00161
00162   /* Scan FT6x36 TouchScreen IC controller ID register by I2C Read */
00163   /* Verify this is a FT6x36, otherwise this is an error case      */
00164
00165   read_id = ft6x06_ts_drv.ReadID(TS_I2C_ADDRESS);
00166
00167   if (read_id == FT6x36_ID_VALUE)
00168   {
00169     /* Found FT6x36 : Initialize the TS driver structure */
00170     tsDriver = &ft6x06_ts_drv;
00171
00172     I2C_Address    = TS_I2C_ADDRESS;
00173
00174     /* Get LCD chosen orientation */
00175     if (orientation == TS_ORIENTATION_PORTRAIT)
00176     {
00177       tsOrientation = TS_SWAP_X | TS_SWAP_Y;
00178       TS_orientation = TS_ORIENTATION_PORTRAIT;
00179     }
00180     else
00181     {
00182       tsOrientation = TS_SWAP_XY | TS_SWAP_Y;
00183       TS_orientation = TS_ORIENTATION_LANDSCAPE;
00184     }
00185
00186     if (ts_status == TS_OK)
00187     {
00188       /* Software reset the TouchScreen */
00189       tsDriver->Reset(I2C_Address);
00190
00191       /* Calibrate, Configure and Start the TouchScreen driver */
00192       tsDriver->Start(I2C_Address);
00193
00194       return TS_OK;
00195
00196     } /* of if(ts_status == TS_OK) */
00197   }
00198
00199   return TS_DEVICE_NOT_FOUND;
00200
00201
00202 }
00203
00204 /**
00205   * @brief  Configures and enables the touch screen interrupts.
00206   * @retval TS_OK if all initializations are OK. Other value if error.
00207   */
00208 uint8_t BSP_TS_ITConfig(void)
00209 {
00210   uint8_t ts_status = TS_OK;
00211
00212   /* Msp Init of GPIO used for TS_INT pin coming from TouchScreen driver IC FT6x36 */
00213   /* When touchscreen is operated in interrupt mode */
00214   BSP_TS_INT_MspInit();
00215
00216   /* Enable the TS in interrupt mode */
00217   /* In that case the INT output of FT6206 when new touch is available */
00218   /* is active on low level and directed on EXTI */
00219   tsDriver->EnableIT(I2C_Address);
00220
00221   return (ts_status);
00222 }
00223
00224 /**
00225   * @brief  deConfigures and enables the touch screen interrupts.
00226   * @retval TS_OK if all initializations are OK. Other value if error.
00227   */
00228 uint8_t BSP_TS_ITDeConfig(void)
00229 {
00230   uint8_t ts_status = TS_OK;
00231
00232   /* Msp Init of GPIO used for TS_INT pin coming from TouchScreen driver IC FT6x36 */
00233   /* When touchscreen is operated in interrupt mode */
00234   BSP_TS_INT_MspDeInit();
00235
00236   /* Enable the TS in interrupt mode */
00237   /* In that case the INT output of FT6206 when new touch is available */
00238   /* is active on low level and directed on EXTI */
00239   tsDriver->DisableIT(I2C_Address);
00240
00241   return (ts_status);
00242 }
00243
00244
00245 /**
00246   * @brief  Returns status and positions of the touch screen.
00247   * @param  TS_State: Pointer to touch screen current state structure
00248   * @retval TS_OK if all initializations are OK. Other value if error.
00249   */
00250 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
00251 {
00252   static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0};
00253   static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0};
00254   uint8_t ts_status = TS_OK;
00255   uint16_t tmp;
00256   uint16_t Raw_x[TS_MAX_NB_TOUCH];
00257   uint16_t Raw_y[TS_MAX_NB_TOUCH];
00258   uint16_t xDiff;
00259   uint16_t yDiff;
00260   uint32_t index;
00261 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00262   uint32_t weight = 0;
00263   uint32_t area = 0;
00264   uint32_t event = 0;
00265 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00266
00267   /* Check and update the number of touches active detected */
00268   TS_State->touchDetected = tsDriver->DetectTouch(I2C_Address);
00269   if (TS_State->touchDetected)
00270   {
00271     for (index = 0; index < TS_State->touchDetected; index++)
00272     {
00273       /* Get each touch coordinates */
00274       tsDriver->GetXY(I2C_Address, &(Raw_x[index]), &(Raw_y[index]));
00275
00276       if (tsOrientation & TS_SWAP_XY)
00277       {
00278         tmp = Raw_x[index];
00279         Raw_x[index] = Raw_y[index];
00280         Raw_y[index] = tmp;
00281       }
00282
00283       if (tsOrientation & TS_SWAP_X)
00284       {
00285         Raw_x[index] = FT_6206_MAX_WIDTH_HEIGHT - 1 - Raw_x[index];
00286       }
00287
00288       if (tsOrientation & TS_SWAP_Y)
00289       {
00290         Raw_y[index] = FT_6206_MAX_WIDTH_HEIGHT - 1 - Raw_y[index];
00291       }
00292
00293       xDiff = Raw_x[index] > _x[index] ? (Raw_x[index] - _x[index]) : (_x[index] - Raw_x[index]);
00294       yDiff = Raw_y[index] > _y[index] ? (Raw_y[index] - _y[index]) : (_y[index] - Raw_y[index]);
00295
00296       if ((xDiff + yDiff) > 5)
00297       {
00298         _x[index] = Raw_x[index];
00299         _y[index] = Raw_y[index];
00300       }
00301
00302
00303       TS_State->touchX[index] = _x[index];
00304       TS_State->touchY[index] = _y[index];
00305
00306 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00307
00308       /* Get touch info related to the current touch */
00309       ft6x06_TS_GetTouchInfo(I2C_Address, index, &weight, &area, &event);
00310
00311       /* Update TS_State structure */
00312       TS_State->touchWeight[index] = weight;
00313       TS_State->touchArea[index]   = area;
00314
00315       /* Remap touch event */
00316       switch (event)
00317       {
00318         case FT6206_TOUCH_EVT_FLAG_PRESS_DOWN  :
00319           TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN;
00320           break;
00321         case FT6206_TOUCH_EVT_FLAG_LIFT_UP :
00322           TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP;
00323           break;
00324         case FT6206_TOUCH_EVT_FLAG_CONTACT :
00325           TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT;
00326           break;
00327         case FT6206_TOUCH_EVT_FLAG_NO_EVENT :
00328           TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00329           break;
00330         default :
00331           ts_status = TS_ERROR;
00332           break;
00333       } /* of switch(event) */
00334
00335 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00336
00337     } /* of for(index=0; index < TS_State->touchDetected; index++) */
00338
00339 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00340     /* Get gesture Id */
00341     ts_status = BSP_TS_Get_GestureId(TS_State);
00342 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00343
00344   } /* end of if(TS_State->touchDetected != 0) */
00345
00346   return (ts_status);
00347 }
00348
00349 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00350 /**
00351   * @brief  Update gesture Id following a touch detected.
00352   * @param  TS_State: Pointer to touch screen current state structure
00353   * @retval TS_OK if all initializations are OK. Other value if error.
00354   */
00355 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State)
00356 {
00357   uint32_t gestureId = 0;
00358   uint8_t  ts_status = TS_OK;
00359
00360   /* Get gesture Id */
00361   ft6x06_TS_GetGestureID(I2C_Address, &gestureId);
00362
00363   /* Remap gesture Id to a TS_GestureIdTypeDef value */
00364   switch (gestureId)
00365   {
00366     case FT6206_GEST_ID_NO_GESTURE :
00367       TS_State->gestureId = GEST_ID_NO_GESTURE;
00368       break;
00369     case FT6206_GEST_ID_MOVE_UP :
00370       TS_State->gestureId = GEST_ID_MOVE_UP;
00371       break;
00372     case FT6206_GEST_ID_MOVE_RIGHT :
00373       TS_State->gestureId = GEST_ID_MOVE_RIGHT;
00374       break;
00375     case FT6206_GEST_ID_MOVE_DOWN :
00376       TS_State->gestureId = GEST_ID_MOVE_DOWN;
00377       break;
00378     case FT6206_GEST_ID_MOVE_LEFT :
00379       TS_State->gestureId = GEST_ID_MOVE_LEFT;
00380       break;
00381     case FT6206_GEST_ID_ZOOM_IN :
00382       TS_State->gestureId = GEST_ID_ZOOM_IN;
00383       break;
00384     case FT6206_GEST_ID_ZOOM_OUT :
00385       TS_State->gestureId = GEST_ID_ZOOM_OUT;
00386       break;
00387     default :
00388       ts_status = TS_ERROR;
00389       break;
00390   } /* of switch(gestureId) */
00391
00392   return (ts_status);
00393 }
00394 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00395
00396
00397 /** @defgroup STM32L496G-DISCOVERY_TS_Private_Functions TS Private Functions
00398   * @{
00399   */
00400
00401 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00402 /**
00403   * @brief  Function used to reset all touch data before a new acquisition
00404   *         of touch information.
00405   * @param  TS_State: Pointer to touch screen current state structure
00406   * @retval TS_OK if OK, TE_ERROR if problem found.
00407   */
00408 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State)
00409 {
00410   uint8_t ts_status = TS_ERROR;
00411   uint32_t index;
00412
00413   if (TS_State != (TS_StateTypeDef *)NULL)
00414   {
00415     TS_State->gestureId = GEST_ID_NO_GESTURE;
00416     TS_State->touchDetected = 0;
00417
00418     for (index = 0; index < TS_MAX_NB_TOUCH; index++)
00419     {
00420       TS_State->touchX[index]       = 0;
00421       TS_State->touchY[index]       = 0;
00422       TS_State->touchArea[index]    = 0;
00423       TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
00424       TS_State->touchWeight[index]  = 0;
00425     }
00426
00427     ts_status = TS_OK;
00428
00429   } /* of if (TS_State != (TS_StateTypeDef *)NULL) */
00430
00431   return (ts_status);
00432 }
00433 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00434
00435
00436 uint8_t BSP_TS_GetOrientation(void)
00437 {
00438   return TS_orientation;
00439 }
00440
00441 /**
00442   * @brief  Initializes the TS_INT pin MSP.
00443   * @param  None
00444   * @retval None
00445   */
00446 __weak void BSP_TS_INT_MspInit(void)
00447 {
00448   GPIO_InitTypeDef  gpio_init_structure;
00449
00450   __HAL_RCC_PWR_CLK_ENABLE();
00451   SET_BIT(PWR->CR2, PWR_CR2_IOSV);
00452
00453   TS_INT_GPIO_CLK_ENABLE();
00454
00455   /* GPIO configuration in input for TouchScreen interrupt signal on TS_INT pin */
00456   gpio_init_structure.Pin       = TS_INT_PIN;
00457
00458   /* Configure Interrupt mode for TS_INT pin falling edge : when a new touch is available */
00459   /* TS_INT pin is active on low level on new touch available */
00460   gpio_init_structure.Pin = TS_INT_PIN;
00461   gpio_init_structure.Pull = GPIO_PULLUP;
00462   gpio_init_structure.Speed = GPIO_SPEED_FAST;
00463   gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
00464   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00465
00466   /* Enable and set the TS_INT EXTI Interrupt to an intermediate priority */
00467   HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x08, 0x00);
00468   HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00469 }
00470
00471 /**
00472   * @brief  Initializes the TS_INT pin MSP.
00473   * @param  None
00474   * @retval None
00475   */
00476 __weak void BSP_TS_INT_MspDeInit(void)
00477 {
00478   GPIO_InitTypeDef  gpio_init_structure;
00479
00480   __HAL_RCC_PWR_CLK_ENABLE();
00481   SET_BIT(PWR->CR2, PWR_CR2_IOSV);
00482
00483   TS_INT_GPIO_CLK_ENABLE();
00484
00485   /* GPIO configuration in input for TouchScreen interrupt signal on TS_INT pin */
00486   gpio_init_structure.Pin       = TS_INT_PIN;
00487
00488   gpio_init_structure.Pin = GPIO_PIN_All;
00489   gpio_init_structure.Mode = GPIO_MODE_ANALOG;
00490   gpio_init_structure.Pull = GPIO_NOPULL;
00491   HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
00492
00493   HAL_NVIC_DisableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
00494 }
00495
00496
00497 /**
00498   * @}
00499   */
00500
00501 /**
00502   * @}
00503   */
00504
00505 /**
00506   * @}
00507   */
00508
00509 /**
00510   * @}
00511   */
00512
00513 /**
00514   * @}
00515   */
00516
00517 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


STM32L496G-Discovery BSP User Manual: stm32l496g_discovery_ts.h Source File

  • File List
  • Globals
  • Firmware
  • Drivers
  • BSP
  • STM32L496G-Discovery
stm32l496g_discovery_ts.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l496g_discovery_ts.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l496g_discovery_ts.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L496G_DISCOVERY_TS_H
00023 #define __STM32L496G_DISCOVERY_TS_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l496g_discovery.h"
00031 #include "stm32l496g_discovery_lcd.h"
00032
00033 /* Include TouchScreen component driver */
00034 #include "../Components/ft6x06/ft6x06.h"
00035
00036 /** @addtogroup BSP
00037   * @{
00038   */
00039
00040 /** @addtogroup STM32L496G-DISCOVERY
00041   * @{
00042   */
00043
00044 /** @defgroup STM32L496G-DISCOVERY_TS STM32L496G-DISCOVERY TS
00045   * @{
00046   */
00047
00048 /** @defgroup STM32L496G-DISCOVERY_TS_Exported_Constants TS Exported Constants
00049   * @{
00050   */
00051 /** @brief With FT6206 : maximum 2 touches detected simultaneously
00052   */
00053 #define TS_MAX_NB_TOUCH                 ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
00054
00055 #define TS_NO_IRQ_PENDING               ((uint8_t) 0)
00056 #define TS_IRQ_PENDING                  ((uint8_t) 1)
00057
00058 #define TS_SWAP_NONE                    ((uint8_t) 0x01)
00059 #define TS_SWAP_X                       ((uint8_t) 0x02)
00060 #define TS_SWAP_Y                       ((uint8_t) 0x04)
00061 #define TS_SWAP_XY                      ((uint8_t) 0x08)
00062
00063 #define TS_ORIENTATION_PORTRAIT         ((uint8_t) 0)
00064 #define TS_ORIENTATION_LANDSCAPE        ((uint8_t) 1)
00065 #define TS_ORIENTATION_UNDEFINED        ((uint8_t) 2)
00066 /**
00067   * @}
00068   */
00069
00070 /** @defgroup STM32L496G-DISCOVERY_TS_Exported_Types  TS Exported Types
00071   * @{
00072   */
00073 /**
00074 *  @brief TS_StateTypeDef
00075 *  Define TS State structure
00076 */
00077 typedef struct
00078 {
00079   uint8_t  touchDetected;                /*!< Total number of active touches detected at last scan */
00080   uint16_t touchX[TS_MAX_NB_TOUCH];      /*!< Touch X[0], X[1] coordinates on 12 bits */
00081   uint16_t touchY[TS_MAX_NB_TOUCH];      /*!< Touch Y[0], Y[1] coordinates on 12 bits */
00082
00083 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00084   uint8_t  touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */
00085   uint8_t  touchEventId[TS_MAX_NB_TOUCH];     /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
00086   uint8_t  touchArea[TS_MAX_NB_TOUCH];   /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */
00087   uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
00088 #endif  /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00089
00090 } TS_StateTypeDef;
00091
00092 /**
00093  *  @brief TS_StatusTypeDef
00094  *  Define BSP_TS_xxx() functions possible return value,
00095  *  when status is returned by those functions.
00096  */
00097 typedef enum
00098 {
00099   TS_OK                = 0x00, /*!< Touch Ok */
00100   TS_ERROR             = 0x01, /*!< Touch Error */
00101   TS_TIMEOUT           = 0x02, /*!< Touch Timeout */
00102   TS_DEVICE_NOT_FOUND  = 0x03  /*!< Touchscreen device not found */
00103 } TS_StatusTypeDef;
00104
00105 /**
00106  *  @brief TS_GestureIdTypeDef
00107  *  Define Possible managed gesture identification values returned by touch screen
00108  *  driver.
00109  */
00110 typedef enum
00111 {
00112   GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
00113   GEST_ID_MOVE_UP    = 0x01, /*!< Gesture Move Up */
00114   GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
00115   GEST_ID_MOVE_DOWN  = 0x03, /*!< Gesture Move Down */
00116   GEST_ID_MOVE_LEFT  = 0x04, /*!< Gesture Move Left */
00117   GEST_ID_ZOOM_IN    = 0x05, /*!< Gesture Zoom In */
00118   GEST_ID_ZOOM_OUT   = 0x06, /*!< Gesture Zoom Out */
00119   GEST_ID_NB_MAX     = 0x07 /*!< max number of gesture id */
00120 } TS_GestureIdTypeDef;
00121
00122 /**
00123  *  @brief TS_TouchEventTypeDef
00124  *  Define Possible touch events kind as returned values
00125  *  by touch screen IC Driver.
00126  */
00127 typedef enum
00128 {
00129   TOUCH_EVENT_NO_EVT        = 0x00, /*!< Touch Event : undetermined */
00130   TOUCH_EVENT_PRESS_DOWN    = 0x01, /*!< Touch Event Press Down */
00131   TOUCH_EVENT_LIFT_UP       = 0x02, /*!< Touch Event Lift Up */
00132   TOUCH_EVENT_CONTACT       = 0x03, /*!< Touch Event Contact */
00133   TOUCH_EVENT_NB_MAX        = 0x04  /*!< max number of touch events kind */
00134 } TS_TouchEventTypeDef;
00135
00136 /**
00137   * @}
00138   */
00139
00140 /** @defgroup STM32L496G-DISCOVERY_TS_Imported_Variables STM32L496G DISCOVERY TS Imported Variables
00141   * @{
00142   */
00143 /**
00144  *  @brief Table for touchscreen event information display on LCD :
00145  *  table indexed on enum @ref TS_TouchEventTypeDef information
00146  */
00147 extern char *ts_event_string_tab[TOUCH_EVENT_NB_MAX];
00148
00149 /**
00150  *  @brief Table for touchscreen gesture Id information display on LCD : table indexed
00151  *  on enum @ref TS_GestureIdTypeDef information
00152  */
00153 extern char *ts_gesture_id_string_tab[GEST_ID_NB_MAX];
00154 /**
00155   * @}
00156   */
00157
00158 /** @defgroup STM32L496G-DISCOVERY_TS_Exported_Functions TS Exported Functions
00159   * @{
00160   */
00161 uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
00162 uint8_t BSP_TS_InitEx(uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t  orientation);
00163 uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
00164 uint8_t BSP_TS_GetOrientation(void);
00165
00166 #if (TS_MULTI_TOUCH_SUPPORTED == 1)
00167 uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
00168 uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);
00169 #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
00170
00171 uint8_t BSP_TS_ITConfig(void);
00172 uint8_t BSP_TS_ITDeConfig(void);
00173
00174 /* These __weak function can be surcharged by application code in case the current settings
00175    need to be changed for specific (example GPIO allocation) */
00176 void BSP_TS_INT_MspInit(void);
00177 void BSP_TS_INT_MspDeInit(void);
00178
00179
00180 /**
00181   * @}
00182   */
00183
00184 /**
00185   * @}
00186   */
00187
00188 /**
00189   * @}
00190   */
00191
00192 /**
00193   * @}
00194   */
00195
00196
00197 #ifdef __cplusplus
00198 }
00199 #endif
00200
00201 #endif /* __STM32L496G_DISCOVERY_TS_H */
00202
00203 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


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

  • File List
  • Globals
userManualMainpage.txt File Reference