| BlueNRG-1 Peripherals drivers APIs

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

Classes | Macros | Enumerations | Functions
BlueNRG1_i2c.h File Reference

This file contains all the functions prototypes for the I2C firmware library. More...

`#include "BlueNRG1.h"`

Go to the source code of this file.

## Classes

struct | I2C_InitType
| Structure definition of I2C initialization. More...
struct | I2C_TransactionType
| Structure definition of I2C transaction initialization. More...

## Macros

#define | IS_I2C_ALL_PERIPH(I2CX)
#define | IS_I2C_TX_THRESHOLD(TXTHR) ((TXTHR) <= 8)
#define | IS_I2C_RX_THRESHOLD(RXTHR) ((RXTHR) <= 8)
#define | I2C_Filtering_Off ((uint8_t)0x00)
#define | I2C_Filtering_1Ck_Spike ((uint8_t)0x01)
#define | I2C_Filtering_2Ck_Spikes ((uint8_t)0x02)
#define | I2C_Filtering_4Ck_Spikes ((uint8_t)0x03)
#define | IS_I2C_FILTERING(FILTER)
#define | I2C_OperatingMode_Slave (0x00)
#define | I2C_OperatingMode_Master (0x01)
#define | I2C_OperatingMode_MasterSlave (0x02)
#define | IS_I2C_OPERATING_MODE(MODE)
#define | I2C_Operation_Write ((uint8_t)0)
#define | I2C_Operation_Read ((uint8_t)1)
#define | IS_I2C_OPERATION(OP)
#define | I2C_StartByte_Disable ((uint16_t)0x0000)
#define | I2C_StartByte_Enable ((uint16_t)0x0800)
#define | IS_I2C_STARTBYTE(SB)
#define | I2C_AddressType_GeneralCall ((uint16_t)0x0000)
#define | I2C_AddressType_7Bit ((uint16_t)0x1000)
#define | I2C_AddressType_10Bit ((uint16_t)0x2000)
#define | IS_I2C_ADDRESSTYPE(AT)
#define | I2C_StopCondition_Disable ((uint16_t)0x0000)
#define | I2C_StopCondition_Enable ((uint16_t)0x4000)
#define | IS_I2C_STOPCONDITION(P)
#define | IS_I2C_LENGTH(P) ((P) <= 0x7FF)
#define | I2C_IT_TXFE (0x00000001)
#define | I2C_IT_TXFNE (0x00000002)
#define | I2C_IT_TXFF (0x00000004)
#define | I2C_IT_TXFOVR (0x00000008)
#define | I2C_IT_RXFE (0x00000010)
#define | I2C_IT_RXFNF (0x00000020)
#define | I2C_IT_RXFF (0x00000040)
#define | I2C_IT_LBR (0x00008000)
#define | I2C_IT_RFSR (0x00010000)
#define | I2C_IT_RFSE (0x00020000)
#define | I2C_IT_WTSR (0x00040000)
#define | I2C_IT_MTD (0x00080000)
#define | I2C_IT_STD (0x00100000)
#define | I2C_IT_SAL (0x00800000)
#define | I2C_IT_MAL (0x01000000)
#define | I2C_IT_BERR (0x02000000)
#define | I2C_IT_MTDWS (0x10000000)
#define | I2C_IT_TIMEOUT (0x40000000)
#define | I2C_IT_MSK (0x739F807F)
#define | IS_I2C_IT(IT) ((((IT) & ~I2C_IT_MSK) == 0x00000000) && ((IT) != 0x00000000))
#define | IS_I2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x3FF)
#define | IS_I2C_OWN_ADDRESS(ADDRESS2) ((ADDRESS2) <= 0x7F)
#define | IS_I2C_CLOCK_SPEED_I2C(SPEED) (((SPEED) >= 1) && ((SPEED) <= 400000))
#define | I2C_DMAReq_Tx ((uint16_t)0x0200)
#define | I2C_DMAReq_Rx ((uint16_t)0x0400)
#define | IS_I2C_DMAREQ(DMAREQ) ((DMAREQ & 0x0600) != 0)
#define | IS_I2C_BURSTSIZE(SIZE) (((SIZE) >= 1) && ((SIZE) <= 7))
#define | IS_I2C_HOLDTIME(TIME) ((TIME) <= 0x1FF)

## Enumerations

enum | I2C_OpStatus { I2C_NOP = 0, I2C_OP_ONGOING, I2C_OP_OK, I2C_OP_ABORTED }
| I2C operation status enumeration. More...

## Functions

void | I2C_DeInit (I2C_Type *I2Cx)
| Deinitializes the I2C peripheral registers to their default reset values. More...
void | I2C_Init (I2C_Type *I2Cx, I2C_InitType *I2C_InitStruct)
| Initializes the I2Cx peripheral according to the specified parameters in the I2C_InitStruct. More...
void | I2C_StructInit (I2C_InitType *I2C_InitStruct)
| Fills the I2C_InitStruct with default values. More...
void | I2C_Cmd (I2C_Type *I2Cx, FunctionalState NewState)
| Enables or disables the specified I2C peripheral. More...
void | I2C_BeginTransaction (I2C_Type *I2Cx, I2C_TransactionType *tr)
| Start an I2C transaction sending the frame specified. More...
void | I2C_GeneralCallCmd (I2C_Type *I2Cx, FunctionalState NewState)
| Enables or disables the general call feature. More...
void | I2C_FillTxFIFO (I2C_Type *I2Cx, uint8_t Data)
| Fills the Tx FIFO with the specified data byte. More...
uint8_t | I2C_ReceiveData (I2C_Type *I2Cx)
| Returns the most recent received data by the I2Cx peripheral. More...
void | I2C_FlushTx (I2C_Type *I2Cx)
| Returns the most recent received data by the I2Cx peripheral. More...
void | I2C_FlushRx (I2C_Type *I2Cx)
| Returns the most recent received data by the I2Cx peripheral. More...
void | I2C_SetTxThreshold (I2C_Type *I2Cx, uint16_t TxThres)
| Sets the transmit FIFO threshold by the I2Cx peripheral. More...
void | I2C_SetRxThreshold (I2C_Type *I2Cx, uint16_t RxThres)
| Sets the receive FIFO threshold by the I2Cx peripheral. More...
void | I2C_GenerateStopCondition (I2C_Type *I2Cx)
| Generate a stop condition. More...
void | I2C_SetHoldTime (I2C_Type *I2Cx, uint16_t I2C_HoldTime)
| Set the hold time value for data transfer. More...
void | I2C_SetHoldTimeStartCondition (I2C_Type *I2Cx, uint16_t I2C_HoldTime)
| Set the hold time value for start condition. More...
I2C_OpStatus | I2C_WaitFlushRx (I2C_Type *I2Cx)
| Return the status of the RX FIFO flush operation. More...
I2C_OpStatus | I2C_WaitFlushTx (I2C_Type *I2Cx)
| Return the status of the TX FIFO flush operation. More...
void | I2C_ITConfig (I2C_Type *I2Cx, uint32_t I2C_IT, FunctionalState NewState)
| Enables or disables the specified I2C interrupts. More...
ITStatus | I2C_GetITStatus (I2C_Type *I2Cx, uint32_t I2C_IT)
| Checks whether the specified I2C interrupt has occurred or not. More...
void | I2C_ClearITPendingBit (I2C_Type *I2Cx, uint32_t I2C_IT)
| Clears the I2Cx interrupt pending bits. More...
ITStatus | I2C_GetITPendingBit (I2C_Type *I2Cx, uint32_t I2C_IT)
| Checks whether the specified I2C interrupt has occurred or not. More...
I2C_OpStatus | I2C_GetStatus (I2C_Type *I2Cx)
| Get the present state of the operation executed by I2C block. More...
void | I2C_DMACmd (I2C_Type *I2Cx, uint16_t I2C_DMAReq, FunctionalState NewState)
| Enables or disables the I2C DMA interface. More...
void | I2C_DMATxBurstMode (I2C_Type *I2Cx, FunctionalState NewState)
| Enables or disables the I2C TX DMA burst mode. More...
void | I2C_DMATxBurstSize (I2C_Type *I2Cx, uint8_t I2C_BurstSize)
| Set the number of burst of data. If this number is smaller than the transaction length, only one single request are generated. More...

## Detailed Description

This file contains all the functions prototypes for the I2C firmware library.

Author
  VMA Application Team

Version
  V2.0.0

Date
  21-March-2016

Attention

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

##
© COPYRIGHT 2016 STMicroelectronics

Definition in file BlueNRG1_i2c.h.