Go to the documentation of this file.
68 #define __STM32F411E_DISCO_BSP_VERSION_MAIN (0x01)
69 #define __STM32F411E_DISCO_BSP_VERSION_SUB1 (0x00)
70 #define __STM32F411E_DISCO_BSP_VERSION_SUB2 (0x03)
71 #define __STM32F411E_DISCO_BSP_VERSION_RC (0x00)
72 #define __STM32F411E_DISCO_BSP_VERSION ((__STM32F411E_DISCO_BSP_VERSION_MAIN << 24)\
73 |(__STM32F411E_DISCO_BSP_VERSION_SUB1 << 16)\
74 |(__STM32F411E_DISCO_BSP_VERSION_SUB2 << 8 )\
75 |(__STM32F411E_DISCO_BSP_VERSION_RC))
118 static void I2Cx_WriteData(uint16_t Addr, uint8_t Reg, uint8_t Value);
131 void GYRO_IO_Write(uint8_t* pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite);
132 void GYRO_IO_Read(uint8_t* pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead);
182 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
254 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
384 GPIO_InitStructure.
Speed = GPIO_SPEED_FAST;
446 uint8_t receivedbyte = 0;
488 GPIO_InitStructure.
Speed = GPIO_SPEED_MEDIUM;
511 GPIO_InitStructure.
Speed = GPIO_SPEED_MEDIUM;
521 GPIO_InitStructure.
Speed = GPIO_SPEED_FAST;
534 void GYRO_IO_Write(uint8_t* pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite)
540 if(NumByteToWrite > 0x01)
551 while(NumByteToWrite >= 0x01)
568 void GYRO_IO_Read(uint8_t* pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead)
570 if(NumByteToRead > 0x01)
586 while(NumByteToRead > 0x00)
613 GPIO_InitStruct.
Speed = GPIO_SPEED_FAST;
678 GPIO_InitStructure.
Speed = GPIO_SPEED_FAST;
697 GPIO_InitStructure.
Speed = GPIO_SPEED_FAST;
#define CODEC_AUDIO_POWER_OFF()
static void I2Cx_MspInit(I2C_HandleTypeDef *hi2c)
I2Cx MSP Init.
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
HAL_StatusTypeDef
HAL Status structures definition
uint32_t BaudRatePrescaler
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c)
static void SPIx_MspInit(SPI_HandleTypeDef *hspi)
SPI MSP Init.
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
static void SPIx_Error(void)
SPIx error treatment function.
#define SPI_BAUDRATEPRESCALER_8
#define DISCOVERY_I2Cx_GPIO_PORT
GPIO Init structure definition
#define DISCOVERY_I2Cx_AF
void GYRO_IO_Init(void)
Configures the GYRO SPI interface.
#define I2Cx_MAX_COMMUNICATION_FREQ
#define DISCOVERY_I2Cx_SDA_PIN
void COMPASSACCELERO_IO_ITConfig(void)
Configures COMPASS / ACCELERO click IT.
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)
uint8_t COMPASSACCELERO_IO_Read(uint16_t DeviceAddr, uint8_t RegisterAddr)
Reads a block of data from the COMPASS / ACCELERO.
SPI handle Structure definition.
#define DISCOVERY_I2Cx_EV_IRQn
#define I2C_ADDRESSINGMODE_7BIT
#define __STM32F411E_DISCO_BSP_VERSION
uint32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected Button state.
#define I2C_NOSTRETCH_DISABLED
#define GYRO_CS_GPIO_PORT
GYRO SPI Interface pins.
#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 BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
void GYRO_IO_Read(uint8_t *pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead)
Reads a block of data from the GYRO.
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
uint32_t BSP_GetVersion(void)
This method returns the STM32F411 DISCO BSP Driver revision.
const uint16_t BUTTON_PIN[BUTTONn]
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
#define DISCOVERY_SPIx_CLOCK_ENABLE()
GPIO_TypeDef * BUTTON_PORT[BUTTONn]
void COMPASSACCELERO_IO_Write(uint16_t DeviceAddr, uint8_t RegisterAddr, uint8_t Value)
Writes one byte to the COMPASS / ACCELERO.
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
#define SPI_DIRECTION_2LINES
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
#define AUDIO_RESET_GPIO_CLK_ENABLE()
void COMPASSACCELERO_IO_Init(void)
Configures COMPASS / ACCELERO I2C interface.
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
#define ACCELERO_INT_GPIO_PORT
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
void GYRO_IO_Write(uint8_t *pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite)
Writes one byte to the GYRO.
#define DISCOVERY_I2Cx_FORCE_RESET()
#define DISCOVERY_I2Cx_GPIO_CLK_ENABLE()
#define I2C_MEMADD_SIZE_8BIT
#define DISCOVERY_I2Cx_ER_IRQn
#define SPI_CRCCALCULATION_DISABLED
HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi)
#define DISCOVERY_I2Cx_SCL_PIN
static uint8_t I2Cx_ReadData(uint16_t Addr, uint8_t Reg)
Reads a register of the device through BUS.
void AUDIO_IO_DeInit(void)
DeInitializes Audio low level.
#define DISCOVERY_I2Cx_RELEASE_RESET()
static void I2Cx_WriteData(uint16_t Addr, uint8_t Reg, uint8_t Value)
Writes a value in a register of the device through BUS.
#define DISCOVERY_SPIx_GPIO_PORT
#define GYRO_INT_GPIO_CLK_ENABLE()
#define DISCOVERY_I2Cx_CLOCK_ENABLE()
#define DISCOVERY_SPIx_GPIO_CLK_ENABLE()
#define I2C_GENERALCALL_DISABLED
#define CODEC_AUDIO_POWER_ON()
const uint8_t BUTTON_IRQn[BUTTONn]
#define GPIO_MODE_IT_RISING
static SPI_HandleTypeDef SpiHandle
const uint16_t GPIO_PIN[LEDn]
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
#define ACCELERO_DRDY_GPIO_PORT
ACCELERO I2C1 Interface pins.
#define SPI_DATASIZE_8BIT
#define ACCELERO_INT2_PIN
GPIO_TypeDef * GPIO_PORT[LEDn]
#define ACCELERO_INT1_EXTI_IRQn
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
static void I2Cx_Error(void)
I2Cx error treatment function.
#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)
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
Configures Button GPIO and EXTI Line.
This file contains definitions for STM32F401-Discovery Kit's Leds and push-button hardware resources.
#define GYRO_INT_GPIO_PORT
#define DISCOVERY_SPIx_AF
#define GYRO_CS_GPIO_CLK_ENABLE()
#define DISCOVERY_SPIx_MOSI_PIN
#define ACCELERO_DRDY_PIN
#define I2C_DUALADDRESS_DISABLED
#define ACCELERO_INT_GPIO_CLK_ENABLE()
HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi)
#define ACCELERO_DRDY_GPIO_CLK_ENABLE()
void AUDIO_IO_Init(void)
Initializes Audio low level.
HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
Reads a single data.
#define DISCOVERY_SPIx_MISO_PIN
static I2C_HandleTypeDef I2cHandle
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 ACCELERO_INT1_PIN
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
static void I2Cx_Init(void)
I2Cx Bus initialization.
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
static void SPIx_Init(void)
SPIx Bus initialization.
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)