STM32F072B-Discovery BSP User Manual: Bus Operations functions

STM32F072B Discovery BSP Drivers

STM32F072B-Discovery BSP User Manual
Bus Operations functions

Functions

static void I2Cx_Init (void)
 Discovery I2Cx Bus initialization.
static uint32_t I2Cx_WriteData (uint8_t Addr, uint16_t Reg, uint8_t Value)
 Write a value in a register of the device through BUS.
static uint32_t I2Cx_WriteBuffer (uint8_t Addr, uint16_t Reg, uint8_t *pBuffer, uint16_t Length)
 Write a value in a register of the device through BUS.
static uint32_t I2Cx_ReadData (uint8_t Addr, uint16_t Reg, uint8_t *Value)
 Read a register of the device through BUS.
static uint32_t I2Cx_ReadBuffer (uint8_t Addr, uint16_t Reg, uint8_t *pBuffer, uint16_t Length)
 Reads multiple data on the BUS.
static void I2Cx_Error (uint8_t Addr)
 Discovery I2Cx error treatment function.
static void SPIx_Init (void)
 SPI1 Bus initialization.
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_Error (void)
 SPI1 error treatment function.
static void SPIx_MspInit (SPI_HandleTypeDef *hspi)
 SPI MSP Init.
static void I2Cx_MspInit (I2C_HandleTypeDef *hi2c)
 Discovery I2Cx MSP Initialization.

Function Documentation

static void I2Cx_Error ( uint8_t  Addr) [static]

Discovery I2Cx error treatment function.

Return values:
None

Definition at line 503 of file stm32f072b_discovery.c.

References I2cHandle, and I2Cx_Init().

Referenced by I2Cx_ReadBuffer(), I2Cx_ReadData(), I2Cx_WriteBuffer(), and I2Cx_WriteData().

static void I2Cx_Init ( void  ) [static]

Discovery I2Cx Bus initialization.

Return values:
None

Definition at line 386 of file stm32f072b_discovery.c.

References DISCOVERY_I2Cx, DISCOVERY_I2Cx_TIMING, I2cHandle, and I2Cx_MspInit().

Referenced by EEPROM_IO_Init(), and I2Cx_Error().

static uint32_t I2Cx_ReadBuffer ( uint8_t  Addr,
uint16_t  Reg,
uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Reads multiple data on the BUS.

Parameters:
AddrI2C Address
RegReg Address
pBufferpointer to read data buffer
Lengthlength of the data
Return values:
0if no problems to read multiple data

Definition at line 483 of file stm32f072b_discovery.c.

References I2cHandle, and I2Cx_Error().

Referenced by EEPROM_IO_ReadData().

static uint32_t I2Cx_ReadData ( uint8_t  Addr,
uint16_t  Reg,
uint8_t *  Value 
) [static]

Read a register of the device through BUS.

Parameters:
AddrDevice address on BUS
RegThe target register address to read
Return values:
Value,:read register value

Definition at line 459 of file stm32f072b_discovery.c.

References I2cHandle, I2Cx_Error(), and I2Cx_TIMEOUT_MAX.

Referenced by EEPROM_IO_ReadData().

static uint32_t I2Cx_WriteBuffer ( uint8_t  Addr,
uint16_t  Reg,
uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Write a value in a register of the device through BUS.

Parameters:
AddrDevice address on BUS Bus.
RegThe target register address to write
pBufferThe target register value to be written
Lengthbuffer size to be written
Return values:
None

Definition at line 437 of file stm32f072b_discovery.c.

References I2cHandle, and I2Cx_Error().

Referenced by EEPROM_IO_WriteData().

static uint32_t I2Cx_WriteData ( uint8_t  Addr,
uint16_t  Reg,
uint8_t  Value 
) [static]

Write a value in a register of the device through BUS.

Parameters:
AddrDevice address on BUS Bus.
RegThe target register address to write
ValueThe target register value to be written
Return values:
None

Definition at line 413 of file stm32f072b_discovery.c.

References I2cHandle, I2Cx_Error(), and I2Cx_TIMEOUT_MAX.

Referenced by EEPROM_IO_WriteData().

static void SPIx_Error ( void  ) [static]

SPI1 error treatment function.

Return values:
None

Definition at line 573 of file stm32f072b_discovery.c.

References SpiHandle, and SPIx_Init().

Referenced by SPIx_WriteRead().

static void SPIx_Init ( void  ) [static]

SPI1 Bus initialization.

Return values:
None

Definition at line 519 of file stm32f072b_discovery.c.

References DISCOVERY_SPIx, SpiHandle, and SPIx_MspInit().

Referenced by GYRO_IO_Init(), and SPIx_Error().

static void SPIx_MspInit ( SPI_HandleTypeDef *  hspi) [static]

SPI MSP Init.

Parameters:
hspiSPI handle
Return values:
None

Definition at line 588 of file stm32f072b_discovery.c.

References DISCOVERY_SPIx_AF, DISCOVERY_SPIx_CLOCK_ENABLE, DISCOVERY_SPIx_GPIO_CLK_ENABLE, DISCOVERY_SPIx_GPIO_PORT, DISCOVERY_SPIx_MISO_PIN, DISCOVERY_SPIx_MOSI_PIN, and DISCOVERY_SPIx_SCK_PIN.

Referenced by SPIx_Init().

static uint8_t SPIx_WriteRead ( uint8_t  Byte) [static]

Sends a Byte through the SPI interface and return the Byte received from the SPI bus.

Parameters:
ByteByte send.
Return values:
Thereceived byte value

Definition at line 553 of file stm32f072b_discovery.c.

References SpiHandle, SPIx_Error(), and SpixTimeout.

Referenced by GYRO_IO_Read(), and GYRO_IO_Write().

Generated on Wed Jul 5 2017 09:43:19 for STM32F072B-Discovery BSP User Manual by   doxygen 1.7.6.1