Go to the documentation of this file.
67 #define __STM32F4_DISCO_BSP_VERSION_MAIN (0x02)
68 #define __STM32F4_DISCO_BSP_VERSION_SUB1 (0x01)
69 #define __STM32F4_DISCO_BSP_VERSION_SUB2 (0x03)
70 #define __STM32F4_DISCO_BSP_VERSION_RC (0x00)
71 #define __STM32F4_DISCO_BSP_VERSION ((__STM32F4_DISCO_BSP_VERSION_MAIN << 24)\
72 |(__STM32F4_DISCO_BSP_VERSION_SUB1 << 16)\
73 |(__STM32F4_DISCO_BSP_VERSION_SUB2 << 8 )\
74 |(__STM32F4_DISCO_BSP_VERSION_RC))
123 static void I2Cx_WriteData(uint8_t Addr, uint8_t Reg, uint8_t Value);
136 void ACCELERO_IO_Write(uint8_t *pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite);
137 void ACCELERO_IO_Read(uint8_t *pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead);
181 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
261 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
271 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
340 uint8_t receivedbyte = 0;
381 GPIO_InitStructure.
Speed = GPIO_SPEED_MEDIUM;
476 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
520 GPIO_InitStructure.
Speed = GPIO_SPEED_MEDIUM;
543 GPIO_InitStructure.
Speed = GPIO_SPEED_FAST;
564 if(NumByteToWrite > 0x01)
575 while(NumByteToWrite >= 0x01)
594 if(NumByteToRead > 0x01)
609 while(NumByteToRead > 0x00)
636 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
static void SPIx_Init(void)
SPIx Bus initialization.
HAL_StatusTypeDef
HAL Status structures definition
uint32_t BaudRatePrescaler
void AUDIO_IO_DeInit(void)
DeInitializes Audio low level.
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c)
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
const uint16_t BUTTON_PIN[BUTTONn]
GPIO Init structure definition
GPIO_TypeDef * GPIO_PORT[LEDn]
#define ACCELERO_CS_HIGH()
#define DISCOVERY_I2Cx_SDA_PIN
const uint8_t BUTTON_IRQn[BUTTONn]
This file contains definitions for STM32F4-Discovery Kit's Leds and push-button hardware resources.
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)
SPI handle Structure definition.
#define DISCOVERY_I2Cx_EV_IRQn
#define I2C_ADDRESSINGMODE_7BIT
static uint8_t I2Cx_ReadData(uint8_t Addr, uint8_t Reg)
Read a register of the device through BUS.
#define DISCOVERY_I2Cx_SCL_SDA_AF
static void I2Cx_Init(void)
Configures I2C interface.
void BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
#define DISCOVERY_SPIx_SCK_PIN
#define SPI_TIMODE_DISABLED
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
static void I2Cx_Error(uint8_t Addr)
Manages error callback by re-initializing I2C.
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
const uint16_t GPIO_PIN[LEDn]
uint32_t BSP_GetVersion(void)
This method returns the STM32F4 DISCO BSP Driver revision.
#define ACCELERO_CS_LOW()
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
#define DISCOVERY_SPIx_CLK_ENABLE()
void ACCELERO_IO_Write(uint8_t *pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite)
Writes one byte to the Accelerometer.
static void I2Cx_MspInit(void)
I2C MSP Initialization.
#define SPI_DIRECTION_2LINES
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
static void SPIx_MspInit(void)
SPI MSP Init.
static uint8_t SPIx_WriteRead(uint8_t Byte)
Sends a Byte through the SPI interface and return the Byte received from the SPI bus.
#define AUDIO_RESET_GPIO_CLK_ENABLE()
static void SPIx_Error(void)
SPIx error treatment function.
#define ACCELERO_CS_PIN
ACCELEROMETER Interface pins.
static I2C_HandleTypeDef I2cHandle
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
#define ACCELERO_INT2_EXTI_IRQn
#define ACCELERO_INT_GPIO_PORT
#define DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT
void AUDIO_IO_Init(void)
Initializes Audio low level.
#define DISCOVERY_I2Cx_FORCE_RESET()
#define I2C_MEMADD_SIZE_8BIT
#define DISCOVERY_I2Cx_ER_IRQn
void ACCELERO_IO_Read(uint8_t *pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead)
Reads a block of data from the Accelerometer.
GPIO_TypeDef * BUTTON_PORT[BUTTONn]
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
#define __STM32F4_DISCO_BSP_VERSION
#define SPI_CRCCALCULATION_DISABLED
HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi)
void ACCELERO_IO_ITConfig(void)
Configures the Accelerometer INT2. EXTI0 is already used by user button so INT1 is not configured her...
#define DISCOVERY_I2Cx_SCL_PIN
#define DISCOVERY_I2Cx_CLK_ENABLE()
#define DISCOVERY_I2Cx_RELEASE_RESET()
#define DISCOVERY_SPIx_GPIO_PORT
static SPI_HandleTypeDef SpiHandle
#define DISCOVERY_SPIx_GPIO_CLK_ENABLE()
#define SPI_BAUDRATEPRESCALER_16
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
Reads a single data.
#define GPIO_MODE_IT_RISING
static void I2Cx_WriteData(uint8_t Addr, uint8_t Reg, uint8_t Value)
Write a value in a register of the device through BUS.
#define ACCELERO_CS_GPIO_CLK_ENABLE()
#define SPI_DATASIZE_8BIT
#define ACCELERO_INT2_PIN
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
#define GPIO_MODE_OUTPUT_PP
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
#define DISCOVERY_SPIx_AF
#define DISCOVERY_SPIx_MOSI_PIN
#define ACCELERO_INT_GPIO_CLK_ENABLE()
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi)
HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
#define DISCOVERY_SPIx_MISO_PIN
#define ACCELERO_CS_GPIO_PORT
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
void ACCELERO_IO_Init(void)
Configures the Accelerometer SPI interface.
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
#define DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)