STM8S/A Standard Peripherals Firmware Library: stm8s_i2c.c File Reference

STM8S/A

stm8s_i2c.c File Reference

This file contains all the functions for the I2C peripheral. More...

#include "stm8s_i2c.h"

Go to the source code of this file.

Defines

#define FLAG_Mask   ((uint16_t)0x00FF)
#define ITEN_Mask   ((uint16_t)0x0700)
#define REGISTER_Mask   ((uint16_t)0x3000)
#define REGISTER_SR1_Index   ((uint16_t)0x0100)
#define REGISTER_SR2_Index   ((uint16_t)0x0200)

Functions

void I2C_AcknowledgeConfig (I2C_Ack_TypeDef Ack)
 Enable or Disable the I2C acknowledge and position acknowledge feature.
ErrorStatus I2C_CheckEvent (I2C_Event_TypeDef I2C_Event)
 I2C State Monitoring Functions.
void I2C_ClearFlag (I2C_Flag_TypeDef I2C_FLAG)
 Clear flags.
void I2C_ClearITPendingBit (I2C_ITPendingBit_TypeDef I2C_ITPendingBit)
 Clear IT pending bit.
void I2C_Cmd (FunctionalState NewState)
 Enables or disables the I2C peripheral.
void I2C_DeInit (void)
 Deinitializes the I2C peripheral registers to their default reset values.
void I2C_FastModeDutyCycleConfig (I2C_DutyCycle_TypeDef I2C_DutyCycle)
 Selects the specified I2C fast mode duty cycle.
void I2C_GeneralCallCmd (FunctionalState NewState)
 Enables or disables the I2C General Call feature.
void I2C_GenerateSTART (FunctionalState NewState)
 Generates I2C communication START condition.
void I2C_GenerateSTOP (FunctionalState NewState)
 Generates I2C communication STOP condition.
FlagStatus I2C_GetFlagStatus (I2C_Flag_TypeDef I2C_Flag)
 3) Flag-based state monitoring
ITStatus I2C_GetITStatus (I2C_ITPendingBit_TypeDef I2C_ITPendingBit)
 Checks whether the specified I2C interrupt has occurred or not.
I2C_Event_TypeDef I2C_GetLastEvent (void)
 2) Advanced state monitoring
void I2C_Init (uint32_t OutputClockFrequencyHz, uint16_t OwnAddress, I2C_DutyCycle_TypeDef I2C_DutyCycle, I2C_Ack_TypeDef Ack, I2C_AddMode_TypeDef AddMode, uint8_t InputClockFrequencyMHz)
 Initializes the I2C according to the specified parameters in standard or fast mode.
void I2C_ITConfig (I2C_IT_TypeDef I2C_IT, FunctionalState NewState)
 Enables or disables the specified I2C interrupt.
uint8_t I2C_ReceiveData (void)
 Returns the most recent received data.
void I2C_Send7bitAddress (uint8_t Address, I2C_Direction_TypeDef Direction)
 Transmits the 7-bit address (to select the) slave device.
void I2C_SendData (uint8_t Data)
 Send a byte by writing in the DR register.
void I2C_SoftwareResetCmd (FunctionalState NewState)
 Enables or disables I2C software reset.
void I2C_StretchClockCmd (FunctionalState NewState)
 Enables or disables the I2C clock stretching.

Detailed Description

This file contains all the functions for the I2C peripheral.

Author:
MCD Application Team
Version:
V2.2.0
Date:
30-September-2014
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.

Definition in file stm8s_i2c.c.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com