stm32f407+cubemax+iic主从通信


本文件含有两个程序,采用硬件IIC,一个是IIC主机发送程序,一个是IIC从机接收发送程序,实验现象是,在两块开发板上,连接上IIC线序(不用交叉),主机发送三个字节数据,从机接收到三个字节数据后,将数据发送回主机,完成主从机的通信,在IIC初试化中可以看到主机的地址设为了0x0A(主机地址没有用到,只是为了和从机进行区分),从机的地址设为了0x0B
资源截图
代码片段和文件信息
/**
  ******************************************************************************
  * @file    system_stm32f4xx.c
  * @author  MCD Application Team
  * @brief   CMSIS Cortex-M4 Device Peripheral Access layer System Source File.
  *
  *   This file provides two functions and one global variable to be called from 
  *   user application:
  *      - SystemInit(): This function is called at startup just after reset and 
  *                      before branch to main program. This call is made inside
  *                      the “startup_stm32f4xx.s“ file.
  *
  *      - SystemCoreClock variable: Contains the core clock (HCLK) it can be used
  *                                  by the user application to setup the SysTick 
  *                                  timer or configure other parameters.
  *                                     
  *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
  *                                 be called whenever the core clock is changed
  *                                 during program execution.
  *
  *
  ******************************************************************************
  * @attention
  *
  * 

© COPYRIGHT 2017 STMicroelectronics


  *
  * Redistribution and use in source and binary forms with or without modification
  * are permitted provided that the following conditions are met:
  *   1. Redistributions of source code must retain the above copyright notice
  *      this list of conditions and the following disclaimer.
  *   2. Redistributions in binary form must reproduce the above copyright notice
  *      this list of conditions and the following disclaimer in the documentation
  *      and/or other materials provided with the distribution.
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
  *      may be used to endorse or promote products derived from this software
  *      without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“
  * AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL
  * DAMAGES (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR
  * SERVICES; LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  * CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  ******************************************************************************
  */

/** @addtogroup CMSIS
  * @{
  */

/** @addtogroup stm32f4xx_s

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-25 16:16  IIC - 主
     文件        4373  2018-09-25 16:16  IIC - 主.mxproject
     目录           0  2018-09-25 16:16  IIC - 主Drivers
     目录           0  2018-09-25 16:16  IIC - 主DriversCMSIS
     目录           0  2018-09-25 16:16  IIC - 主DriversCMSISDSP_Lib
     目录           0  2018-09-25 16:16  IIC - 主DriversCMSISDSP_LibSource
     目录           0  2018-09-25 16:16  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctions
     文件        5114  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_abs_f32.c
     文件        5458  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_abs_q15.c
     文件        4431  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_abs_q31.c
     文件        5090  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_abs_q7.c
     文件        4891  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_add_f32.c
     文件        4423  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_add_q15.c
     文件        4553  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_add_q31.c
     文件        4226  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_add_q7.c
     文件        4613  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_dot_prod_f32.c
     文件        4912  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_dot_prod_q15.c
     文件        5000  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_dot_prod_q31.c
     文件        5408  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_dot_prod_q7.c
     文件        5582  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_mult_f32.c
     文件        5306  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_mult_q15.c
     文件        5201  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_mult_q31.c
     文件        4530  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_mult_q7.c
     文件        4574  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_negate_f32.c
     文件        4621  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_negate_q15.c
     文件        4178  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_negate_q31.c
     文件        4104  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_negate_q7.c
     文件        5095  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_offset_f32.c
     文件        4534  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_offset_q15.c
     文件        4425  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_offset_q31.c
     文件        4462  2018-08-20 21:45  IIC - 主DriversCMSISDSP_LibSourceBasicMathFunctionsarm_offset_q7.c
............此处省略1493个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)