STM8L例程库函数帮助.zip

  • 11111111890
    了解作者
  • C/C++
    开发工具
  • 4.4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-04-14 02:03
    上传日期
STM8L例程库函数帮助 STM8L10x_StdPeriph_Lib
STM8L例程库函数帮助.zip
内容介绍
/** @page I2C_DataExchange I2C1 Master and Slave data exchange @verbatim ******************** (C)COPYRIGHT 2012 STMicroelectronics ******************* * @file I2C/I2C_TwoBoards/I2C_DataExchange/readme.txt * @author MCD Application Team * @version V1.2.0 * @date 01-June-2012 * @brief Description of the Comparator in interrupt mode example ****************************************************************************** * 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. * ****************************************************************************** @endverbatim @par Example description This is a typical example of how to use the I2C software library to ensure the steps of an I2C communication between slave and master. This is a two phase example that requires two boards(Master an Slave) - Phase 1: In master board I2C peripheral is configured in Master Transmitter with Interrupt, where in Slave board I2C peripheral is configured in Slave Receiver with Interrupt. The master will send Data to Slave according to the defined buffer size. - Phase 2: In master board I2C peripheral is configured in Master Receiver with Polling, where in Slave board I2C peripheral is configured in Slave Transmitter with Interrupt. Once the master has initiated the communication (Start condition), the slave will send back the previously received data to the master At the end of the data transfer, a data consistency check will be performed in master side and in case of mismatch between sent and received data, LED4 will toggle infinitely. Otherwise LED1 will toggle. Communication error are handled in Slave side, their occurrence will be signaled by puting On LED2. The "main.h" file allows different possibilities of configuration of this example: - Addressing mode : 7-bit or 10-bit - Safe procedure for master receiver - I2C speed: Fast mode or Standard mode - Buffer size also can be configured and though by choosing the desired configuration within main.h file. @par Directory contents - I2C/I2C_TwoBoards/I2C_DataExchange/X/main.c Main file - I2C/I2C_TwoBoards/I2C_DataExchange/X/main.h Header for Main file - I2C/I2C_TwoBoards/I2C_DataExchange/X/stm8l10x_conf.h Library Configuration file - I2C/I2C_TwoBoards/I2C_DataExchange/X/stm8l10x_it.c Interrupt routines source - I2C/I2C_TwoBoards/I2C_DataExchange/X/stm8l10x_it.h Interrupt routines declaration where X stands for Master or Slave directories. @par Hardware and Software environment - This example runs on STM8L10x devices. - This example has been tested with STMicroelectronics STM8L101-EVAL evaluation board and can be easily tailored to any other development board. - STM8L1x-EVAL Set-up - Connect I2C1 Master SCL pin (PC.01) to I2C1 Slave SCL (PC.01) - Connect I2C1 Master SDA pin (PC.00) to I2C1 Slave SDA (PC.00) - Connect the two-boards grounds together - Other platform Set-up - Connect I2C1 Master SCL pin (PC.01) to I2C1 Slave SCL (PC.01) - Connect I2C1 Master SDA pin (PC.00) to I2C1 Slave SDA (PC.00) - Check that a pull-up resistor (4.7K) is connected on one I2C SDA pin - Check that a pull-up resistor (4.7K) is connected on one I2C SCL pin - Connect the two-boards grounds together @note The pull-up resitors are already implemented on the STM8L1x-EVAL evaluation boards. @par How to use it ? In order to make the program work, you must do the following : - Copy all source files from this example folder to the template folder under Project\STM8L10x_StdPeriph_Templates - Open your preferred toolchain - Rebuild all files and load your image into target memory - Run the example @note - STM8L10x devices are STM8L microcontrollers with a Flash memory density up to 8 Kbytes. * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3> */
评论
    相关推荐
    • STM8L_1602.rar
      stm8l discovery 开发板+lcd1602字符液晶
    • STM8L051_REFERENCE.rar
      stm8l051_referrent for beginer
    • STM8L.zip
      stm8l相关说明及手册,英文版 2018-12-13日上传.
    • STM8L库函数
      STM8L库函数,使用库函数方便开发单片机
    • stm8l系列单片机教程与源码
      STM8L系列单片机教程已经更新完毕 做成PDF版本 欢迎参考 本系列教程为原创,转载请说明出处 目录: 【连载】STM8L051F3_0b_开发环境搭建 【连载】STM8L051F3_0c_新建工程 【连载】STM8L051F3_0d_基础介绍 【连载】...
    • STM8L101库函数
      STM8L101库函数 适用于STM8低功耗单片机
    • QMC5883L_compass_STM8L.rar
      testing code for Qmc5883l
    • stm8l051f3.zip
      芯片英文资料,供初学者使用,来自官方的正式文件
    • STM8L-UltraLowPower.rar
      An excel file including all features for STM8 microcontroller series
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路