Classes | Macros | Functions | Variables
stm32h747i_discovery_bus.c File Reference

This file provides a set of firmware functions to communicate with external devices available on STM32H747I-DISCO board (MB1248) from STMicroelectronics. More...

#include "stm32h747i_discovery_bus.h"
#include "stm32h747i_discovery_errno.h"
Include dependency graph for stm32h747i_discovery_bus.c:

Go to the source code of this file.

Classes

struct  I2C_Charac_t
 
struct  I2C_Timings_t
 

Macros

#define I2C_ANALOG_FILTER_DELAY_MAX   260U /* ns */
 
#define I2C_ANALOG_FILTER_DELAY_MIN   50U /* ns */
 
#define I2C_DIGITAL_FILTER_COEF   0U
 
#define I2C_PRESC_MAX   16U
 
#define I2C_SCLDEL_MAX   16U
 
#define I2C_SCLH_MAX   256U
 
#define I2C_SCLL_MAX   256U
 
#define I2C_SDADEL_MAX   16U
 
#define I2C_SPEED_FREQ_FAST   1U /* 400 kHz */
 
#define I2C_SPEED_FREQ_FAST_PLUS   2U /* 1 MHz */
 
#define I2C_SPEED_FREQ_STANDARD   0U /* 100 kHz */
 
#define I2C_USE_ANALOG_FILTER   1U
 
#define I2C_VALID_TIMING_NBR   128U
 
#define SEC2NSEC   1000000000UL
 

Functions

int32_t BSP_GetTick (void)
 Delay function. More...
 
int32_t BSP_I2C4_DeInit (void)
 DeInitializes I2C HAL. More...
 
int32_t BSP_I2C4_Init (void)
 Initializes I2C HAL. More...
 
int32_t BSP_I2C4_IsReady (uint16_t DevAddr, uint32_t Trials)
 Checks if target device is ready for communication. More...
 
int32_t BSP_I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
 Read a 8bit register of the device through BUS. More...
 
int32_t BSP_I2C4_ReadReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
 Read a 16bit register of the device through BUS. More...
 
int32_t BSP_I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
 Write a 8bit value in a register of the device through BUS. More...
 
int32_t BSP_I2C4_WriteReg16 (uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
 Write a 16bit value in a register of the device through BUS. More...
 
static void I2C4_MspDeInit (I2C_HandleTypeDef *phi2c)
 DeInitializes I2C MSP. More...
 
static void I2C4_MspInit (I2C_HandleTypeDef *phi2c)
 Initializes I2C MSP. More...
 
static int32_t I2C4_ReadReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
 Read a register of the device through BUS. More...
 
static int32_t I2C4_WriteReg (uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
 Write a value in a register of the device through BUS. More...
 
static void I2C_Compute_PRESC_SCLDEL_SDADEL (uint32_t clock_src_freq, uint32_t I2C_speed)
 Compute PRESC, SCLDEL and SDADEL. More...
 
static uint32_t I2C_Compute_SCLL_SCLH (uint32_t clock_src_freq, uint32_t I2C_speed)
 Calculate SCLL and SCLH and find best configuration. More...
 
static uint32_t I2C_GetTiming (uint32_t clock_src_freq, uint32_t i2c_freq)
 Compute I2C timing according current I2C clock source and required I2C clock. More...
 
__weak HAL_StatusTypeDef MX_I2C4_Init (I2C_HandleTypeDef *hI2c, uint32_t timing)
 MX I2C4 initialization. More...
 

Variables

I2C_HandleTypeDef hbus_i2c4
 
static uint32_t I2c4InitCounter = 0
 
static const I2C_Charac_t I2C_Charac []
 
static I2C_Timings_t I2c_valid_timing [I2C_VALID_TIMING_NBR]
 
static uint32_t I2c_valid_timing_nbr = 0
 

Detailed Description

This file provides a set of firmware functions to communicate with external devices available on STM32H747I-DISCO board (MB1248) from STMicroelectronics.

Author
MCD Application Team
Attention

© Copyright (c) 2019 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32h747i_discovery_bus.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:02