Hal Drivers for L4

Dependents:   BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo

Fork of STM32L4xx_HAL_Driver by Senior Design: Sound Monitor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l4xx_hal_i2c_ex.h Source File

stm32l4xx_hal_i2c_ex.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4xx_hal_i2c_ex.h
00004   * @author  MCD Application Team
00005   * @version V1.1.0
00006   * @date    16-September-2015
00007   * @brief   Header file of I2C HAL Extended module.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without modification,
00014   * are permitted provided that the following conditions are met:
00015   *   1. Redistributions of source code must retain the above copyright notice,
00016   *      this list of conditions and the following disclaimer.
00017   *   2. Redistributions in binary form must reproduce the above copyright notice,
00018   *      this list of conditions and the following disclaimer in the documentation
00019   *      and/or other materials provided with the distribution.
00020   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00021   *      may be used to endorse or promote products derived from this software
00022   *      without specific prior written permission.
00023   *
00024   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00028   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00030   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034   *
00035   ******************************************************************************
00036   */ 
00037 
00038 /* Define to prevent recursive inclusion -------------------------------------*/
00039 #ifndef __STM32L4xx_HAL_I2C_EX_H
00040 #define __STM32L4xx_HAL_I2C_EX_H
00041 
00042 #ifdef __cplusplus
00043  extern "C" {
00044 #endif
00045 
00046 /* Includes ------------------------------------------------------------------*/
00047 #include "stm32l4xx_hal_def.h"  
00048 
00049 /** @addtogroup STM32L4xx_HAL_Driver
00050   * @{
00051   */
00052 
00053 /** @addtogroup I2CEx
00054   * @{
00055   */ 
00056 
00057 /* Exported types ------------------------------------------------------------*/ 
00058 /* Exported constants --------------------------------------------------------*/
00059 
00060 /** @defgroup I2CEx_Exported_Constants I2CEx Exported Constants
00061   * @{
00062   */
00063 
00064 /** @defgroup I2CEx_Analog_Filter I2CEx Analog Filter
00065   * @{
00066   */
00067 #define I2C_ANALOGFILTER_ENABLE         ((uint32_t)0x00000000)
00068 #define I2C_ANALOGFILTER_DISABLE        I2C_CR1_ANFOFF
00069 /**
00070   * @}
00071   */
00072 
00073 /** @defgroup I2CEx_FastModePlus I2CEx FastModePlus
00074   * @{
00075   */
00076 #define I2C_FASTMODEPLUS_PB6            SYSCFG_CFGR1_I2C_PB6_FMP  /*!< Enable Fast Mode Plus on PB6       */
00077 #define I2C_FASTMODEPLUS_PB7            SYSCFG_CFGR1_I2C_PB7_FMP  /*!< Enable Fast Mode Plus on PB7       */
00078 #define I2C_FASTMODEPLUS_PB8            SYSCFG_CFGR1_I2C_PB8_FMP  /*!< Enable Fast Mode Plus on PB8       */
00079 #define I2C_FASTMODEPLUS_PB9            SYSCFG_CFGR1_I2C_PB9_FMP  /*!< Enable Fast Mode Plus on PB9       */
00080 #define I2C_FASTMODEPLUS_I2C1           SYSCFG_CFGR1_I2C1_FMP     /*!< Enable Fast Mode Plus on I2C1 pins */
00081 #define I2C_FASTMODEPLUS_I2C2           SYSCFG_CFGR1_I2C2_FMP     /*!< Enable Fast Mode Plus on I2C2 pins */
00082 #define I2C_FASTMODEPLUS_I2C3           SYSCFG_CFGR1_I2C3_FMP     /*!< Enable Fast Mode Plus on I2C3 pins */
00083 /**
00084   * @}
00085   */
00086     
00087 /**
00088   * @}
00089   */ 
00090   
00091 /* Exported macro ------------------------------------------------------------*/
00092 /* Exported functions --------------------------------------------------------*/
00093 
00094 /* Peripheral Control methods  ************************************************/
00095 HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter);
00096 HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter);
00097 HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c);
00098 HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c);
00099 void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
00100 void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
00101 
00102 /* Private constants ---------------------------------------------------------*/
00103 /** @defgroup I2C_Private_Constants I2C Private Constants
00104   * @{
00105   */
00106 
00107 /**
00108   * @}
00109   */ 
00110 
00111 /* Private macros ------------------------------------------------------------*/
00112 /** @defgroup I2C_Private_Macro I2C Private Macros
00113   * @{
00114   */
00115 #define IS_I2C_ANALOG_FILTER(FILTER)    (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \
00116                                           ((FILTER) == I2C_ANALOGFILTER_DISABLE))
00117 
00118 #define IS_I2C_DIGITAL_FILTER(FILTER)   ((FILTER) <= 0x0000000F)
00119 
00120 #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6)    || \
00121                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7)   || \
00122                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8)   || \
00123                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9)   || \
00124                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \
00125                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \
00126                                           (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3))
00127 /**
00128   * @}
00129   */ 
00130 
00131 /* Private Functions ---------------------------------------------------------*/
00132 /** @defgroup I2C_Private_Functions I2C Private Functions
00133   * @{
00134   */
00135 /* Private functions are defined in stm32l4xx_hal_i2c_ex.c file */
00136 /**
00137   * @}
00138   */ 
00139 
00140 /**
00141   * @}
00142   */ 
00143 
00144 /**
00145   * @}
00146   */
00147   
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151 
00152 #endif /* __STM32L4xx_HAL_I2C_EX_H */
00153 
00154 
00155 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00156