/**
******************************************************************************
* @file stm32f0xx_i2c_cpal.h
* @author MCD Application Team
* @version V1.2.0
* @date 24-July-2014
* @brief This file contains all the functions prototypes for the I2C firmware
* layer.
******************************************************************************
* @attention
*
*
© COPYRIGHT 2014 STMicroelectronics
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
/*========= CPAL library files includes =========*/
#include "stm32f0xx_i2c_cpal_hal.h"
#include "stm32f0xx_i2c_cpal_conf.h"
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F0XX_I2C_CPAL_H
#define __STM32F0XX_I2C_CPAL_H
#ifdef __cplusplus
extern "C" {
#endif
/* Exported types ------------------------------------------------------------*/
/*========= CPAL_Dev_TypeDef =========*/
/* CPAL devices enumeration contains the device instances */
typedef enum
{
CPAL_I2C1 = 0x00, /*!< Use I2C1 device */
CPAL_I2C2 = 0x01 /*!< Use I2C2 device */
}CPAL_DevTypeDef;
/*========= CPAL_Direction_TypeDef =========*/
/* CPAL transfer directions enumeration is used to configure DMA channels
(TX and RX) if CPAL_PROGMODEL_DMA is selected or TX/RX interrupts
if CPAL_PROGMODEL_INTERRUPT is selected:
- If CPAL_DIRECTION_TX is selected only TX DMA Channel or TX Interrupt is configured
- If CPAL_DIRECTION_RX is selected only RX DMA Channel or RX Interrupt is configured
- If CPAL_DIRECTION_TXRX is selected both TX and Rx DMA Channels or Interrupts are configured.*/
typedef enum
{
CPAL_DIRECTION_TX = 0x01, /*!pI2C_Struct->I2C_Speed = 100000;
CPAL_I2C_Init(&I2C1_DevStructure); */
}CPAL_InitTypeDef;
/*========= Table containing all I2C device structures =========*/
extern CPAL_InitTypeDef* I2C_DevStructures[];
/*========= CPAL_Global_Device_Structures =========*/
/* CPAL Global Device Structures are the Global default structures which
are used to handle devices configuration and status.*/
#ifdef CPAL_USE_I2C1
extern CPAL_InitTypeDef I2C1_DevStructure;
#endif /* CPAL_USE_I2C1 */
#ifdef CPAL_USE_I2C2
extern CPAL_InitTypeDef I2C2_DevStructure;
#endif /* CPAL_USE_I2C2 */
/* Exported constants --------------------------------------------------------*/
/*========= CPAL_Options_TypeDef =========*/
/* CPAL Options defines contains configuration options which can be affected
to wCPAL_Options which is a bit-field argument so any combination of these
parameters can be selected. If one option is not selected then the relative
feature is disabled.
There are common options and device specific options.*/
#define CPAL_OPT_I2C_DUALADDR ((uint32_t)0x00000001) /*!