STM32L0xx_Nucleo_32 BSP User Manual: stm32l0xx_nucleo_32.h File Reference

STM32L0xx Nucleo 32 BSP Drivers

stm32l0xx_nucleo_32.h File Reference

This file contains definitions for: More...

#include "stm32l0xx_hal.h"

Go to the source code of this file.

Defines

#define LEDn   1
#define LED3_PIN   GPIO_PIN_3
#define LED3_GPIO_PORT   GPIOB
#define LED3_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED3_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)   do {LED3_GPIO_CLK_ENABLE(); } while(0)
#define LEDx_GPIO_CLK_DISABLE(__INDEX__)   LED3_GPIO_CLK_DISABLE())
#define BSP_I2C1   I2C1
#define BSP_I2C1_CLK_ENABLE()   __HAL_RCC_I2C1_CLK_ENABLE()
#define BSP_I2C1_CLK_DISABLE()   __HAL_RCC_I2C1_CLK_DISABLE()
#define BSP_I2C1_FORCE_RESET()   __HAL_RCC_I2C1_FORCE_RESET()
#define BSP_I2C1_RELEASE_RESET()   __HAL_RCC_I2C1_RELEASE_RESET()
#define BSP_I2C1_SCL_PIN   GPIO_PIN_6 /* PB.6 add wire between D5 and A5 */
#define BSP_I2C1_SDA_PIN   GPIO_PIN_7 /* PB.7 add wire between D4 and A4 */
#define BSP_I2C1_GPIO_PORT   GPIOB /* GPIOB */
#define BSP_I2C1_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define BSP_I2C1_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define BSP_I2C1_SCL_SDA_AF   GPIO_AF1_I2C1
#define BSP_I2C1_TIMEOUT_MAX   1000
#define I2C1_TIMING   0x009080B5
#define NUCLEO_SPIx   SPI1
#define NUCLEO_SPIx_CLK_ENABLE()   __HAL_RCC_SPI1_CLK_ENABLE()
#define NUCLEO_SPIx_SCK_AF   GPIO_AF0_SPI1
#define NUCLEO_SPIx_SCK_GPIO_PORT   GPIOA
#define NUCLEO_SPIx_SCK_PIN   GPIO_PIN_11
#define NUCLEO_SPIx_SCK_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define NUCLEO_SPIx_SCK_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define NUCLEO_SPIx_MISO_MOSI_AF   GPIO_AF0_SPI1
#define NUCLEO_SPIx_MISO_MOSI_GPIO_PORT   GPIOB
#define NUCLEO_SPIx_MISO_MOSI_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define NUCLEO_SPIx_MISO_MOSI_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define NUCLEO_SPIx_MISO_PIN   GPIO_PIN_4
#define NUCLEO_SPIx_MOSI_PIN   GPIO_PIN_5
#define NUCLEO_SPIx_TIMEOUT_MAX   1000
#define SD_CS_LOW()   HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_RESET)
 SD Control Lines management.
#define SD_CS_HIGH()   HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_SET)
#define LCD_CS_LOW()   HAL_GPIO_WritePin(LCD_CS_GPIO_PORT, LCD_CS_PIN, GPIO_PIN_RESET)
 LCD Control Lines management.
#define LCD_CS_HIGH()   HAL_GPIO_WritePin(LCD_CS_GPIO_PORT, LCD_CS_PIN, GPIO_PIN_SET)
#define LCD_DC_LOW()   HAL_GPIO_WritePin(LCD_DC_GPIO_PORT, LCD_DC_PIN, GPIO_PIN_RESET)
#define LCD_DC_HIGH()   HAL_GPIO_WritePin(LCD_DC_GPIO_PORT, LCD_DC_PIN, GPIO_PIN_SET)
#define SD_CS_PIN   GPIO_PIN_5
 SD Control Interface pins.
#define SD_CS_GPIO_PORT   GPIOB
#define SD_CS_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define SD_CS_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define LCD_CS_PIN   GPIO_PIN_6
 LCD Control Interface pins.
#define LCD_CS_GPIO_PORT   GPIOB
#define LCD_CS_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define LCD_CS_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define LCD_DC_PIN   GPIO_PIN_9
 LCD Data/Command Interface pins.
#define LCD_DC_GPIO_PORT   GPIOA
#define LCD_DC_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define LCD_DC_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define NUCLEO_ADCx   ADC1
 ADC Interface pins used to detect motion of Joystick available on Adafruit 1.8" TFT shield.
#define NUCLEO_ADCx_CLK_ENABLE()   __HAL_RCC_ADC1_CLK_ENABLE()
#define NUCLEO_ADCx_GPIO_PORT   GPIOB
#define NUCLEO_ADCx_GPIO_PIN   GPIO_PIN_0
#define NUCLEO_ADCx_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define NUCLEO_ADCx_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()

Enumerations

enum  Led_TypeDef { LED3 = 0, LED_GREEN = LED3 }
enum  JOYState_TypeDef {
  JOY_NONE = 0, JOY_SEL = 1, JOY_DOWN = 2, JOY_LEFT = 3,
  JOY_RIGHT = 4, JOY_UP = 5
}

Functions

void I2C1_Init (void)
 I2C Bus initialization.
void I2C1_Error (void)
 Manages error callback by re-initializing I2C.
void I2C1_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization.
void I2C1_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
 Writes a single data.
uint8_t I2C1_Read (uint8_t Addr, uint8_t Reg)
 Reads a single data.
HAL_StatusTypeDef I2C1_WriteBuffer (uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
 Write a value in a register of the device through BUS.
HAL_StatusTypeDef I2C1_ReadBuffer (uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
 Reads multiple data on the BUS.
HAL_StatusTypeDef I2C1_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
 Checks if target device is ready for communication.
uint32_t BSP_GetVersion (void)
 This method returns the STM32L0XX NUCLEO BSP Driver revision.
void BSP_LED_Init (Led_TypeDef Led)
 Configures LED GPIO.
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 (void)
 Configures joystick available on adafruit 1.8" TFT shield managed through ADC to detect motion.
JOYState_TypeDef BSP_JOY_GetState (void)
 Returns the Joystick key pressed.

Detailed Description

This file contains definitions for:

Author:
MCD Application Team
  • LEDs and push-button available on STM32L0XX-Nucleo Kit from STMicroelectronics
  • LCD, joystick and microSD available on Adafruit 1.8" TFT LCD shield (reference ID 802)
Attention:

© COPYRIGHT(c) 2016 STMicroelectronics

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

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

Definition in file stm32l0xx_nucleo_32.h.

Generated on Mon Aug 28 2017 14:48:51 for STM32L0xx_Nucleo_32 BSP User Manual by   doxygen 1.7.6.1