Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s
140 lines
4.1 KiB
C
140 lines
4.1 KiB
C
/**
|
|
******************************************************************************
|
|
* @file stm32h743i_eval_bus.h
|
|
* @author MCD Application Team
|
|
* @brief This file is the header of stm32h743i_eval_bus.c file
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2019 STMicroelectronics.
|
|
* All rights reserved.
|
|
*
|
|
* This software is licensed under terms that can be found in the LICENSE file
|
|
* in the root directory of this software component.
|
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef STM32H743I_EVAL_BUS_H
|
|
#define STM32H743I_EVAL_BUS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "stm32h743i_eval_conf.h"
|
|
#include "stm32h743i_eval_errno.h"
|
|
#if defined(BSP_USE_CMSIS_OS)
|
|
#include "cmsis_os.h"
|
|
#endif
|
|
/** @addtogroup BSP
|
|
* @{
|
|
*/
|
|
|
|
/** @addtogroup STM32H743I_EVAL
|
|
* @{
|
|
*/
|
|
|
|
/** @addtogroup STM32H743I_EVAL_BUS
|
|
* @{
|
|
*/
|
|
/** @defgroup STM32H743I_EVAL_BUS_Exported_Types BUS Exported Types
|
|
* @{
|
|
*/
|
|
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
|
typedef struct
|
|
{
|
|
void (* pMspInitCb)(I2C_HandleTypeDef *);
|
|
void (* pMspDeInitCb)(I2C_HandleTypeDef *);
|
|
}BSP_I2C_Cb_t;
|
|
#endif /* (USE_HAL_I2C_REGISTER_CALLBACKS == 1) */
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
/** @defgroup STM32H743I_EVAL_BUS_Exported_Constants BUS Exported Constants
|
|
* @{
|
|
*/
|
|
/* Definition for I2C1 clock resources */
|
|
#define BUS_I2C1 I2C1
|
|
#define BUS_I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
|
|
#define BUS_I2C1_CLK_DISABLE() __HAL_RCC_I2C1_CLK_DISABLE()
|
|
#define BUS_I2C1_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
|
#define BUS_I2C1_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
|
#define BUS_I2C1_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
|
#define BUS_I2C1_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
|
|
|
#define BUS_I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
|
|
#define BUS_I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
|
|
|
|
/* Definition for I2C1 Pins */
|
|
#define BUS_I2C1_SCL_PIN GPIO_PIN_6
|
|
#define BUS_I2C1_SDA_PIN GPIO_PIN_7
|
|
#define BUS_I2C1_SCL_GPIO_PORT GPIOB
|
|
#define BUS_I2C1_SDA_GPIO_PORT GPIOB
|
|
#define BUS_I2C1_SCL_AF GPIO_AF4_I2C1
|
|
#define BUS_I2C1_SDA_AF GPIO_AF4_I2C1
|
|
|
|
#ifndef BUS_I2C1_FREQUENCY
|
|
#define BUS_I2C1_FREQUENCY 100000U /* Frequency of I2Cn = 100 KHz*/
|
|
#endif
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/** @addtogroup STM32H743I_EVAL_BUS_Exported_Variables
|
|
* @{
|
|
*/
|
|
extern I2C_HandleTypeDef hbus_i2c1;
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/** @addtogroup STM32H743I_EVAL_BUS_Exported_Functions
|
|
* @{
|
|
*/
|
|
int32_t BSP_I2C1_Init(void);
|
|
int32_t BSP_I2C1_DeInit(void);
|
|
int32_t BSP_I2C1_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_Recv(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_Send(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length);
|
|
int32_t BSP_I2C1_IsReady(uint16_t DevAddr, uint32_t Trials);
|
|
int32_t BSP_GetTick(void);
|
|
|
|
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
|
|
int32_t BSP_I2C1_RegisterDefaultMspCallbacks (void);
|
|
int32_t BSP_I2C1_RegisterMspCallbacks (BSP_I2C_Cb_t *Callback);
|
|
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
|
|
__weak HAL_StatusTypeDef MX_I2C1_Init(I2C_HandleTypeDef *hI2c, uint32_t timing);
|
|
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* STM32H743I_EVAL_BUS_H */
|