STM32L476G-Discovery BSP User Manual: stm32l476g_discovery.c File Reference

STM32L476G-Discovery BSP

stm32l476g_discovery.c File Reference

This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L476G-Discovery board (MB1184) More...

Go to the source code of this file.

Defines

#define __STM32L476G_DISCOVERY_BSP_VERSION_MAIN   (0x00)
 STM32L476G DISCOVERY BSP Driver version number $VERSION$.
#define __STM32L476G_DISCOVERY_BSP_VERSION_SUB1   (0x00)
#define __STM32L476G_DISCOVERY_BSP_VERSION_SUB2   (0x00)
#define __STM32L476G_DISCOVERY_BSP_VERSION_RC   (0x01)
#define __STM32L476G_DISCOVERY_BSP_VERSION
#define __SPI_DIRECTION_2LINES(__HANDLE__)
#define __SPI_DIRECTION_2LINES_RXONLY(__HANDLE__)
#define __SPI_DIRECTION_1LINE_TX(__HANDLE__)
#define __SPI_DIRECTION_1LINE_RX(__HANDLE__)

Functions

static void I2C2_Init (void)
 Discovery I2C2 Bus initialization.
static void I2C2_MspInit (I2C_HandleTypeDef *hi2c)
 Discovery I2C2 MSP Initialization.
static void I2C2_DeInit (void)
 Discovery I2C2 Bus Deinitialization.
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 I2C1_Init (void)
 Discovery I2C1 Bus initialization.
static void I2C1_MspInit (I2C_HandleTypeDef *hi2c)
 Discovery I2C1 MSP Initialization.
static void I2C1_DeInit (void)
 Discovery I2C1 Bus Deitialization.
static void I2C1_MspDeInit (I2C_HandleTypeDef *hi2c)
 Discovery I2C1 MSP Deinitialization.
static HAL_StatusTypeDef I2C1_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 HAL_StatusTypeDef I2C1_ReadBuffer (uint16_t Addr, uint16_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
 Reads multiple data on the BUS.
static void I2C1_Error (void)
 Discovery I2C1 error treatment function.
static void SPIx_Init (void)
 SPIx Bus initialization.
static void SPIx_MspInit (SPI_HandleTypeDef *hspi)
 SPI MSP Init.
static void SPIx_DeInit (void)
 SPIx Bus Deinitialization.
static void SPIx_MspDeInit (void)
 SPI MSP DeInit.
static uint8_t SPIx_WriteRead (uint8_t Byte)
 Sends a Byte through the SPI interface and return the Byte received from the SPI bus.
static void SPIx_Write (uint8_t Byte)
 Sends a Byte through the SPI interface.
static uint8_t SPIx_Read (void)
 Receives a Byte from the SPI bus.
void EEPROM_I2C_IO_Init (void)
HAL_StatusTypeDef EEPROM_I2C_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
HAL_StatusTypeDef EEPROM_I2C_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
HAL_StatusTypeDef EEPROM_I2C_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
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 ACCELERO_IO_Init (void)
 Configures COMPASS/ACCELEROMETER io interface.
void ACCELERO_IO_DeInit (void)
 De-Configures COMPASS/ACCELEROMETER io interface.
void ACCELERO_IO_ITConfig (void)
 Configures COMPASS / ACCELERO click IT.
void ACCELERO_IO_Write (uint8_t RegisterAddr, uint8_t Value)
 Writes one byte to the COMPASS / ACCELEROMETER.
uint8_t ACCELERO_IO_Read (uint8_t RegisterAddr)
 Reads a block of data from the COMPASS / ACCELEROMETER.
void MAGNETO_IO_Init (void)
 Configures COMPASS/MAGNETO SPI interface.
void MAGNETO_IO_DeInit (void)
 de-Configures COMPASS/MAGNETO SPI interface.
void MAGNETO_IO_ITConfig (void)
void MAGNETO_IO_Write (uint8_t RegisterAddr, uint8_t Value)
 Writes one byte to the COMPASS/MAGNETO.
uint8_t MAGNETO_IO_Read (uint8_t RegisterAddr)
 Reads a block of data from the COMPASS/MAGNETO.
void GYRO_IO_Init (void)
 Configures the GYRO SPI interface.
void GYRO_IO_DeInit (void)
 de-Configures GYRO SPI interface.
void GYRO_IO_Write (uint8_t *pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite)
 Writes one byte to the GYRO.
void GYRO_IO_Read (uint8_t *pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead)
 Reads a block of data from the GYROSCOPE.
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.
uint32_t BSP_GetVersion (void)
 This method returns the STM32L476 DISCOVERY BSP Driver revision.
SupplyMode_TypeDef BSP_SupplyModeDetection (void)
 This method returns the STM32L476 DISCOVERY supply mode.
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)
 Unonfigures all GPIOs used as buttons of the joystick.
JOYState_TypeDef BSP_JOY_GetState (void)
 Returns the current joystick status.

Variables

GPIO_TypeDef * LED_PORT [LEDn]
 LED variables.
const uint16_t LED_PIN [LEDn]
GPIO_TypeDef * JOY_PORT [JOYn]
 JOYSTICK variables.
const uint16_t JOY_PIN [JOYn]
const uint8_t JOY_IRQn [JOYn]
uint32_t I2c1Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
 BUS variables.
uint32_t I2c2Timeout = DISCOVERY_I2C2_TIMEOUT_MAX
static I2C_HandleTypeDef I2c1Handle
static I2C_HandleTypeDef I2c2Handle
uint32_t SpixTimeout = SPIx_TIMEOUT_MAX
static SPI_HandleTypeDef SpiHandle

Detailed Description

This file provides a set of firmware functions to manage Leds, push-button and joystick of STM32L476G-Discovery board (MB1184)

Author:
MCD Application Team
Version:
$VERSION$
Date:
$DATE$
Attention:

© COPYRIGHT(c) 2015 STMicroelectronics

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

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

Definition in file stm32l476g_discovery.c.

Generated on Tue Jun 23 2015 17:15:45 for STM32L476G-Discovery BSP User Manual by   doxygen 1.7.6.1