83 lines
2.3 KiB
C
83 lines
2.3 KiB
C
/**
|
|
******************************************************************************
|
|
* @file i2c.h
|
|
* @brief This file contains all the function prototypes for
|
|
* the i2c.c file
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* <h2><center>© Copyright (c) 2021 STMicroelectronics.
|
|
* All rights reserved.</center></h2>
|
|
*
|
|
* 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
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __I2C_H__
|
|
#define __I2C_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "main.h"
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
/**I2C1 GPIO Configuration for STM32WL55xx
|
|
PB6 ------> I2C1_SCL
|
|
PB7 ------> I2C1_SDA
|
|
*/
|
|
|
|
#if defined(STM32WL55xx)
|
|
#define MEMS_ENABLE_Pin GPIO_PIN_5
|
|
#define MEMS_ENABLE_GPIO_Port GPIOB
|
|
#define MEMS_SENSOR_INTERRUPT_Pin GPIO_PIN_8
|
|
#define MEMS_SENSOR_INTERRUPT_GPIO_Port GPIOA
|
|
#define MEMS_SENSOR_INTERRUPT_EXTI_IRQn EXTI9_5_IRQn
|
|
#endif
|
|
|
|
/**I2C2 GPIO Configuration STM32WLE5xx
|
|
PA12 ------> I2C2_SCL
|
|
PA11 ------> I2C2_SDA
|
|
*/
|
|
#if defined(STM32WLE5xx)|| defined(STM32WL55xx)
|
|
extern I2C_HandleTypeDef hi2c2;
|
|
#define MEMS_I2C_HANDLE hi2c2
|
|
#define MEMS_I2C_SCL_Pin GPIO_PIN_12
|
|
#define MEMS_I2C_SCL_GPIO_Port GPIOA
|
|
#define MEMS_I2C_SDA_Pin GPIO_PIN_11
|
|
#define MEMS_I2C_SDA_GPIO_Port GPIOA
|
|
|
|
#define MEMS_SENSOR_INTERRUPT_Pin GPIO_PIN_8
|
|
#define MEMS_SENSOR_INTERRUPT_GPIO_Port GPIOA
|
|
#define MEMS_SENSOR_INTERRUPT_EXTI_IRQn EXTI9_5_IRQn
|
|
#define MEMS_ENABLE_Pin GPIO_PIN_5
|
|
#define MEMS_ENABLE_GPIO_Port GPIOB
|
|
#endif
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
void MX_I2C_Init(void);
|
|
|
|
/* USER CODE BEGIN Prototypes */
|
|
|
|
/* USER CODE END Prototypes */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __I2C_H__ */
|
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|