Rev 28 | Rev 30 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 28 | Rev 29 | ||
|---|---|---|---|
| Line 103... | Line 103... | ||
| 103 | 103 | ||
| 104 | return st != HAL_OK ? BMP280_E_COMM_FAIL : BMP280_OK; |
104 | return st != HAL_OK ? BMP280_E_COMM_FAIL : BMP280_OK; |
| 105 | 105 | ||
| 106 | } |
106 | } |
| 107 | 107 | ||
| 108 | static void reset_i2c2(void) |
- | |
| 109 | { |
- | |
| 110 | - | ||
| 111 | - | ||
| 112 | - | ||
| 113 | - | ||
| 114 | - | ||
| 115 | } |
- | |
| 116 | 108 | ||
| 117 | static void |
109 | static void |
| 118 | user_delay_ms (uint32_t ms, void *handle) |
110 | user_delay_ms (uint32_t ms, void *handle) |
| 119 | { |
111 | { |
| 120 | HAL_Delay (ms); |
112 | HAL_Delay (ms); |
| Line 220... | Line 212... | ||
| 220 | } |
212 | } |
| 221 | __HAL_AFIO_REMAP_I2C1_ENABLE(); |
213 | __HAL_AFIO_REMAP_I2C1_ENABLE(); |
| 222 | 214 | ||
| 223 | } |
215 | } |
| 224 | 216 | ||
| - | 217 | void resetBmp2(void) |
|
| - | 218 | { |
|
| - | 219 | HAL_GPIO_WritePin (I2C1_BusPower_GPIO_Port, I2C1_BusPower_Pin, GPIO_PIN_RESET); |
|
| - | 220 | HAL_Delay (200); |
|
| - | 221 | HAL_GPIO_WritePin (I2C1_BusPower_GPIO_Port, I2C1_BusPower_Pin, GPIO_PIN_SET); |
|
| - | 222 | HAL_Delay (200); |
|
| - | 223 | init_bmp(&conf2,&bmp2); |
|
| 225 | 224 | ||
| - | 225 | } |
|
| 226 | 226 | ||
| 227 | 227 | ||
| 228 | /* USER CODE END 0 */ |
228 | /* USER CODE END 0 */ |
| 229 | 229 | ||
| 230 | /** |
230 | /** |
| Line 705... | Line 705... | ||
| 705 | 705 | ||
| 706 | /*Configure GPIO pin Output Level */ |
706 | /*Configure GPIO pin Output Level */ |
| 707 | HAL_GPIO_WritePin(GPIOA, SPI_CD_Pin|SPI_RESET_Pin|SPI_NSS1_Pin, GPIO_PIN_RESET); |
707 | HAL_GPIO_WritePin(GPIOA, SPI_CD_Pin|SPI_RESET_Pin|SPI_NSS1_Pin, GPIO_PIN_RESET); |
| 708 | 708 | ||
| 709 | /*Configure GPIO pin Output Level */ |
709 | /*Configure GPIO pin Output Level */ |
| - | 710 | HAL_GPIO_WritePin(I2C1_BusPower_GPIO_Port, I2C1_BusPower_Pin, GPIO_PIN_SET); |
|
| - | 711 | ||
| - | 712 | /*Configure GPIO pin Output Level */ |
|
| 710 | HAL_GPIO_WritePin(USB_PULLUP_GPIO_Port, USB_PULLUP_Pin, GPIO_PIN_RESET); |
713 | HAL_GPIO_WritePin(USB_PULLUP_GPIO_Port, USB_PULLUP_Pin, GPIO_PIN_RESET); |
| 711 | 714 | ||
| 712 | /*Configure GPIO pin : Green_LED_Pin */ |
715 | /*Configure GPIO pin : Green_LED_Pin */ |
| 713 | GPIO_InitStruct.Pin = Green_LED_Pin; |
716 | GPIO_InitStruct.Pin = Green_LED_Pin; |
| 714 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
717 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
| Line 721... | Line 724... | ||
| 721 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
724 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
| 722 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
725 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
| 723 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
726 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
| 724 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
727 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
| 725 | 728 | ||
| - | 729 | /*Configure GPIO pin : I2C1_BusPower_Pin */ |
|
| - | 730 | GPIO_InitStruct.Pin = I2C1_BusPower_Pin; |
|
| - | 731 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
|
| - | 732 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
|
| - | 733 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; |
|
| - | 734 | HAL_GPIO_Init(I2C1_BusPower_GPIO_Port, &GPIO_InitStruct); |
|
| - | 735 | ||
| 726 | /*Configure GPIO pin : USB_PULLUP_Pin */ |
736 | /*Configure GPIO pin : USB_PULLUP_Pin */ |
| 727 | GPIO_InitStruct.Pin = USB_PULLUP_Pin; |
737 | GPIO_InitStruct.Pin = USB_PULLUP_Pin; |
| 728 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
738 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
| 729 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
739 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
| 730 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
740 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |