Prusa MINI Firmware overview
I2C_Exported_Functions_Group1
Collaboration diagram for I2C_Exported_Functions_Group1:

Functions

HAL_StatusTypeDef HAL_I2C_Init (I2C_HandleTypeDef *hi2c)
 
HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c)
 
void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)
 I2C MSP De-Initialization This function freeze the hardware resources used in this example. More...
 

Detailed Description

Function Documentation

◆ HAL_I2C_Init()

HAL_StatusTypeDef HAL_I2C_Init ( I2C_HandleTypeDef hi2c)
Here is the caller graph for this function:

◆ HAL_I2C_DeInit()

HAL_StatusTypeDef HAL_I2C_DeInit ( I2C_HandleTypeDef hi2c)

◆ HAL_I2C_MspInit()

void HAL_I2C_MspInit ( I2C_HandleTypeDef hi2c)

I2C MSP Initialization This function configures the hardware resources used in this example.

Parameters
hi2cI2C handle pointer
Return values
None

I2C1 GPIO Configuration PB8 ---—> I2C1_SCL PB9 ---—> I2C1_SDA

190  {
191 
192  GPIO_InitTypeDef GPIO_InitStruct = { 0 };
193  if (hi2c->Instance == I2C1) {
194  /* USER CODE BEGIN I2C1_MspInit 0 */
195 
196  /* USER CODE END I2C1_MspInit 0 */
197 
199  /**I2C1 GPIO Configuration
200  PB8 ------> I2C1_SCL
201  PB9 ------> I2C1_SDA
202  */
203  GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
204  GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
205  GPIO_InitStruct.Pull = GPIO_PULLUP;
206  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
207  GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
208  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
209 
210  /* Peripheral clock enable */
212  /* USER CODE BEGIN I2C1_MspInit 1 */
213 
214  /* USER CODE END I2C1_MspInit 1 */
215  }
216 }
Here is the call graph for this function:

◆ HAL_I2C_MspDeInit()

void HAL_I2C_MspDeInit ( I2C_HandleTypeDef hi2c)

I2C MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
hi2cI2C handle pointer
Return values
None

I2C1 GPIO Configuration PB8 ---—> I2C1_SCL PB9 ---—> I2C1_SDA

225  {
226 
227  if (hi2c->Instance == I2C1) {
228  /* USER CODE BEGIN I2C1_MspDeInit 0 */
229 
230  /* USER CODE END I2C1_MspDeInit 0 */
231  /* Peripheral clock disable */
233 
234  /**I2C1 GPIO Configuration
235  PB8 ------> I2C1_SCL
236  PB9 ------> I2C1_SDA
237  */
239 
240  /* USER CODE BEGIN I2C1_MspDeInit 1 */
241 
242  /* USER CODE END I2C1_MspDeInit 1 */
243  }
244 }
Here is the call graph for this function:
GPIO_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f4xx_hal_gpio.h:68
__HAL_RCC_GPIOB_CLK_ENABLE
#define __HAL_RCC_GPIOB_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:409
GPIO_InitTypeDef::Alternate
uint32_t Alternate
Definition: stm32f4xx_hal_gpio.h:77
GPIO_InitTypeDef::Pull
uint32_t Pull
Definition: stm32f4xx_hal_gpio.h:71
HAL_GPIO_DeInit
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
GPIO_MODE_AF_OD
#define GPIO_MODE_AF_OD
Definition: stm32f4xx_hal_gpio.h:139
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
GPIO_PIN_8
#define GPIO_PIN_8
Definition: stm32f4xx_hal_gpio.h:110
HAL_GPIO_Init
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
GPIO_SPEED_FREQ_VERY_HIGH
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f4xx_hal_gpio.h:161
__HAL_RCC_I2C1_CLK_ENABLE
#define __HAL_RCC_I2C1_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:514
I2C_HandleTypeDef::Instance
I2C_TypeDef * Instance
Definition: stm32f4xx_hal_i2c.h:166
__HAL_RCC_I2C1_CLK_DISABLE
#define __HAL_RCC_I2C1_CLK_DISABLE()
Definition: stm32f4xx_hal_rcc.h:540
GPIO_InitTypeDef::Pin
uint32_t Pin
Definition: stm32f4xx_hal_gpio.h:65
GPIO_InitTypeDef::Speed
uint32_t Speed
Definition: stm32f4xx_hal_gpio.h:74
GPIO_PIN_9
#define GPIO_PIN_9
Definition: stm32f4xx_hal_gpio.h:111
GPIO_InitTypeDef
GPIO Init structure definition.
Definition: stm32f4xx_hal_gpio.h:63