Mercurial > public > ostc4
comparison Small_CPU/Src/stm32f4xx_hal_msp_v3.c @ 332:39f146ccdb1b
Merged in Ideenmodellierer/ostc4/I2C_Improvment (pull request #30)
I2C Improvment
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Thu, 18 Jul 2019 14:26:56 +0000 |
parents | abec171c2c4b |
children | 1b995079c045 |
comparison
equal
deleted
inserted
replaced
326:2559a3f0f1f2 | 332:39f146ccdb1b |
---|---|
108 | 108 |
109 /*##-2- Configure peripheral GPIO ##########################################*/ | 109 /*##-2- Configure peripheral GPIO ##########################################*/ |
110 /* I2C TX GPIO pin configuration */ | 110 /* I2C TX GPIO pin configuration */ |
111 GPIO_InitStruct.Pin = I2Cx_SCL_PIN; | 111 GPIO_InitStruct.Pin = I2Cx_SCL_PIN; |
112 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; | 112 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; |
113 GPIO_InitStruct.Pull = GPIO_PULLUP; | 113 GPIO_InitStruct.Pull = GPIO_NOPULL; |
114 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; | 114 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; |
115 GPIO_InitStruct.Alternate = I2Cx_SCL_AF; | 115 GPIO_InitStruct.Alternate = I2Cx_SCL_AF; |
116 | 116 |
117 HAL_GPIO_Init(I2Cx_SCL_GPIO_PORT, &GPIO_InitStruct); | 117 HAL_GPIO_Init(I2Cx_SCL_GPIO_PORT, &GPIO_InitStruct); |
118 | 118 |
122 | 122 |
123 HAL_GPIO_Init(I2Cx_SDA_GPIO_PORT, &GPIO_InitStruct); | 123 HAL_GPIO_Init(I2Cx_SDA_GPIO_PORT, &GPIO_InitStruct); |
124 | 124 |
125 /*##-3- Configure the NVIC for I2C #########################################*/ | 125 /*##-3- Configure the NVIC for I2C #########################################*/ |
126 /* NVIC for I2C1 */ | 126 /* NVIC for I2C1 */ |
127 | |
128 /* The callbacks are not used => no need to activate the interrupts */ | |
129 /* | |
127 HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 1, 2); | 130 HAL_NVIC_SetPriority(I2Cx_ER_IRQn, 1, 2); |
128 HAL_NVIC_EnableIRQ(I2Cx_ER_IRQn); | 131 HAL_NVIC_EnableIRQ(I2Cx_ER_IRQn); |
129 HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 1, 3); | 132 HAL_NVIC_SetPriority(I2Cx_EV_IRQn, 1, 3); |
130 HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn); | 133 HAL_NVIC_EnableIRQ(I2Cx_EV_IRQn); |
134 */ | |
131 } | 135 } |
132 | 136 |
133 /** | 137 /** |
134 * @brief I2C MSP De-Initialization | 138 * @brief I2C MSP De-Initialization |
135 * This function frees the hardware resources used in this example: | 139 * This function frees the hardware resources used in this example: |