STM32F0xx_Nucleo BSP User Manual: Private Functions

STM32F0xx Nucleo

STM32F0xx_Nucleo BSP User Manual
Private Functions

Functions

static void SPIx_Init (void)
 Initialize SPI HAL.
static void SPIx_Write (uint8_t Value)
 SPI Write a byte to device.
static void SPIx_WriteData (uint8_t *DataIn, uint16_t DataLength)
 SPI Write an amount of data to device.
static void SPIx_WriteReadData (const uint8_t *DataIn, uint8_t *DataOut, uint16_t DataLength)
 SPI Write a byte to device.
static void SPIx_FlushFifo (void)
 SPIx_FlushFifo.
static void SPIx_Error (void)
 SPI error treatment function.
static void SPIx_MspInit (void)
 Initialize SPI MSP.
void SD_IO_Init (void)
 Initialize the SD Card and put it into StandBy State (Ready for data transfer).
void SD_IO_CSState (uint8_t val)
 Set the SD_CS pin.
void SD_IO_WriteReadData (const uint8_t *DataIn, uint8_t *DataOut, uint16_t DataLength)
 Write byte(s) on the SD.
void SD_IO_ReadData (uint8_t *DataOut, uint16_t DataLength)
 Write an amount of data on the SD.
void SD_IO_WriteData (const uint8_t *Data, uint16_t DataLength)
 Write an amount of data on the SD.
uint8_t SD_IO_WriteByte (uint8_t Data)
 Write a byte on the SD.
uint8_t SD_IO_ReadByte (void)
void LCD_IO_Init (void)
 Initialize the LCD.
void LCD_IO_WriteData (uint8_t Data)
void LCD_IO_WriteMultipleData (uint8_t *pData, uint32_t Size)
 Write register value.
void LCD_IO_WriteReg (uint8_t LCDReg)
 Write command to select the LCD register.
void LCD_Delay (uint32_t Delay)
 Wait for loop in ms.
static HAL_StatusTypeDef ADCx_Init (void)
 Initializes ADC HAL.
static void ADCx_DeInit (void)
 Initializes ADC HAL.
static void ADCx_MspInit (ADC_HandleTypeDef *hadc)
 Initialize ADC MSP.
static void ADCx_MspDeInit (ADC_HandleTypeDef *hadc)
 DeInitializes ADC MSP.
uint8_t BSP_JOY_Init (void)
 Configures joystick available on adafruit 1.8" TFT shield managed through ADC to detect motion.
void BSP_JOY_DeInit (void)
 DeInit joystick GPIOs.
JOYState_TypeDef BSP_JOY_GetState (void)
 Returns the Joystick key pressed.

Function Documentation

static void ADCx_DeInit ( void  ) [static]

Initializes ADC HAL.

Return values:
None

Definition at line 821 of file stm32f0xx_nucleo.c.

References ADCx_MspDeInit(), hnucleo_Adc, and NUCLEO_ADCx.

Referenced by BSP_JOY_DeInit().

static HAL_StatusTypeDef ADCx_Init ( void  ) [static]

Initializes ADC HAL.

Return values:
None

Definition at line 775 of file stm32f0xx_nucleo.c.

References ADCx_MspInit(), hnucleo_Adc, and NUCLEO_ADCx.

Referenced by BSP_JOY_Init().

static void ADCx_MspDeInit ( ADC_HandleTypeDef *  hadc) [static]

DeInitializes ADC MSP.

Note:
ADC DeInit does not disable the GPIO clock
Return values:
None

Definition at line 755 of file stm32f0xx_nucleo.c.

References NUCLEO_ADCx_CLK_DISABLE, NUCLEO_ADCx_GPIO_PIN, and NUCLEO_ADCx_GPIO_PORT.

Referenced by ADCx_DeInit().

static void ADCx_MspInit ( ADC_HandleTypeDef *  hadc) [static]

Initialize ADC MSP.

Return values:
None

Definition at line 732 of file stm32f0xx_nucleo.c.

References NUCLEO_ADCx_CLK_ENABLE, NUCLEO_ADCx_GPIO_CLK_ENABLE, NUCLEO_ADCx_GPIO_PIN, and NUCLEO_ADCx_GPIO_PORT.

Referenced by ADCx_Init().

void BSP_JOY_DeInit ( void  )

DeInit joystick GPIOs.

Note:
JOY DeInit does not disable the Mfx, just set the Mfx pins in Off mode
Return values:
None.

Definition at line 856 of file stm32f0xx_nucleo.c.

References ADCx_DeInit().

Returns the Joystick key pressed.

Note:
To know which Joystick key is pressed we need to detect the voltage level on each key output
  • None : 3.3 V / 4095
  • SEL : 1.055 V / 1308
  • DOWN : 0.71 V / 88
  • LEFT : 3.0 V / 3720
  • RIGHT : 0.595 V / 737
  • UP : 1.65 V / 2046
Return values:
JOYState_TypeDef,:Code of the Joystick key pressed.

Definition at line 873 of file stm32f0xx_nucleo.c.

References hnucleo_Adc, JOY_DOWN, JOY_LEFT, JOY_NONE, JOY_RIGHT, JOY_SEL, and JOY_UP.

uint8_t BSP_JOY_Init ( void  )

Configures joystick available on adafruit 1.8" TFT shield managed through ADC to detect motion.

Return values:
Joystickstatus(0=> success, 1=> fail)

Definition at line 836 of file stm32f0xx_nucleo.c.

References ADCx_Init(), hnucleo_Adc, and sConfig.

void LCD_Delay ( uint32_t  Delay)

Wait for loop in ms.

Parameters:
Delayin ms.
Return values:
None

Definition at line 719 of file stm32f0xx_nucleo.c.

void LCD_IO_Init ( void  )

Initialize the LCD.

Return values:
None

Definition at line 613 of file stm32f0xx_nucleo.c.

References LCD_CS_GPIO_CLK_ENABLE, LCD_CS_HIGH, LCD_CS_PIN, LCD_DC_GPIO_CLK_ENABLE, LCD_DC_GPIO_PORT, LCD_DC_PIN, SD_CS_GPIO_PORT, and SPIx_Init().

void LCD_IO_WriteData ( uint8_t  Data)
void LCD_IO_WriteMultipleData ( uint8_t *  pData,
uint32_t  Size 
)

Write register value.

Parameters:
pDataPointer on the register value
SizeSize of byte to transmit to the register
Return values:
None

Definition at line 665 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, LCD_CS_HIGH, LCD_CS_LOW, LCD_DC_HIGH, SPIx_FlushFifo(), and SPIx_Write().

void LCD_IO_WriteReg ( uint8_t  LCDReg)

Write command to select the LCD register.

Parameters:
LCDReg,:Address of the selected register.
Return values:
None

Definition at line 644 of file stm32f0xx_nucleo.c.

References LCD_CS_HIGH, LCD_CS_LOW, LCD_DC_LOW, and SPIx_Write().

void SD_IO_CSState ( uint8_t  val)

Set the SD_CS pin.

Parameters:
val,:pin value.
Return values:
None

Definition at line 544 of file stm32f0xx_nucleo.c.

References SD_CS_HIGH, and SD_CS_LOW.

void SD_IO_Init ( void  )

Initialize the SD Card and put it into StandBy State (Ready for data transfer).

Return values:
None

Definition at line 500 of file stm32f0xx_nucleo.c.

References LCD_CS_HIGH, LCD_CS_PIN, SD_CS_GPIO_CLK_ENABLE, SD_CS_GPIO_PORT, SD_CS_HIGH, SD_CS_PIN, SD_DUMMY_BYTE, SD_IO_WriteByte(), and SPIx_Init().

uint8_t SD_IO_ReadByte ( void  )
void SD_IO_ReadData ( uint8_t *  DataOut,
uint16_t  DataLength 
)

Write an amount of data on the SD.

Parameters:
DataOut,:byte to send.
DataLength,:number of bytes to write
Return values:
none

Definition at line 589 of file stm32f0xx_nucleo.c.

References SD_IO_WriteReadData().

uint8_t SD_IO_WriteByte ( uint8_t  Data)

Write a byte on the SD.

Parameters:
Data,:byte to send.
Return values:
Datawritten

Definition at line 574 of file stm32f0xx_nucleo.c.

References SPIx_WriteReadData().

Referenced by SD_IO_Init().

void SD_IO_WriteData ( const uint8_t *  Data,
uint16_t  DataLength 
)

Write an amount of data on the SD.

Parameters:
Data,:byte to send.
DataLength,:number of bytes to write
Return values:
none

Definition at line 601 of file stm32f0xx_nucleo.c.

References SPIx_FlushFifo(), and SPIx_WriteData().

void SD_IO_WriteReadData ( const uint8_t *  DataIn,
uint8_t *  DataOut,
uint16_t  DataLength 
)

Write byte(s) on the SD.

Parameters:
DataIn,:Pointer to data buffer to write
DataOut,:Pointer to data buffer for read data
DataLength,:number of bytes to write
Return values:
None

Definition at line 563 of file stm32f0xx_nucleo.c.

References SPIx_WriteReadData().

Referenced by SD_IO_ReadData().

static void SPIx_Error ( void  ) [static]

SPI error treatment function.

Return values:
None

Definition at line 481 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, and SPIx_Init().

Referenced by SPIx_Write(), SPIx_WriteData(), and SPIx_WriteReadData().

static void SPIx_FlushFifo ( void  ) [static]

SPIx_FlushFifo.

Return values:
None

Definition at line 471 of file stm32f0xx_nucleo.c.

References hnucleo_Spi.

Referenced by LCD_IO_WriteMultipleData(), and SD_IO_WriteData().

static void SPIx_Init ( void  ) [static]

Initialize SPI HAL.

Return values:
None

Definition at line 373 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, NUCLEO_SPIx, and SPIx_MspInit().

Referenced by LCD_IO_Init(), SD_IO_Init(), and SPIx_Error().

static void SPIx_Write ( uint8_t  Value) [static]

SPI Write a byte to device.

Parameters:
Value,:value to be written
Return values:
None

Definition at line 452 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, SPIx_Error(), and SpixTimeout.

Referenced by LCD_IO_WriteMultipleData(), and LCD_IO_WriteReg().

static void SPIx_WriteData ( uint8_t *  DataIn,
uint16_t  DataLength 
) [static]

SPI Write an amount of data to device.

Parameters:
DataIn,:value to be written
DataLength,:number of bytes to write
Return values:
None

Definition at line 433 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, SPIx_Error(), and SpixTimeout.

Referenced by SD_IO_WriteData().

static void SPIx_WriteReadData ( const uint8_t *  DataIn,
uint8_t *  DataOut,
uint16_t  DataLength 
) [static]

SPI Write a byte to device.

Parameters:
DataIn,:value to be written
DataOut,:read value
DataLength,:value data length
Return values:
None

Definition at line 413 of file stm32f0xx_nucleo.c.

References hnucleo_Spi, SPIx_Error(), and SpixTimeout.

Referenced by SD_IO_WriteByte(), and SD_IO_WriteReadData().

Generated on Tue Oct 25 2016 18:35:27 for STM32F0xx_Nucleo BSP User Manual by   doxygen 1.7.6.1