\hypertarget{bsp___i_i_c_8cpp_source}{}\doxysection{bsp\+\_\+\+IIC.\+cpp} \label{bsp___i_i_c_8cpp_source}\index{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_IIC/bsp\_IIC.cpp@{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_IIC/bsp\_IIC.cpp}} \mbox{\hyperlink{bsp___i_i_c_8cpp}{浏览该文件的文档.}} \begin{DoxyCode}{0} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00001}00001 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00002}00002 \textcolor{comment}{ \#}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00003}00003 \textcolor{comment}{ \# Copyright (c) 2022 Yuankang Liang(XerolySkinner)}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00004}00004 \textcolor{comment}{ \#}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00005}00005 \textcolor{comment}{ \# 本软件按原样提供,无任何明示或暗示}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00006}00006 \textcolor{comment}{ \# 在任何情况下,作者都不承担任何损害赔偿责任}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00007}00007 \textcolor{comment}{ \#}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00008}00008 \textcolor{comment}{ \# 使用的许可声明:}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00009}00009 \textcolor{comment}{ \# 1. 不得歪曲本软件的来源,你不能声称你编写了原始软件.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00010}00010 \textcolor{comment}{ \# 2. 免费授予以任何目的,前提是版权声明出现在所有副本中.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00011}00011 \textcolor{comment}{ \# 并且版权声明和许可声明同时出现.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00012}00012 \textcolor{comment}{ \# 3. 你有使用,复制,修改,分发,和销售本软件的许可.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00013}00013 \textcolor{comment}{ \# 4. 如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00014}00014 \textcolor{comment}{ \# 5. 本通知不得从任何来源删除或更改.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00015}00015 \textcolor{comment}{ \#}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00016}00016 \textcolor{comment}{ \# Yuankang Liang(XerolySkinner)}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00017}00017 \textcolor{comment}{ \# E-\/mail:zabbcccbbaz@163.com}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00018}00018 \textcolor{comment}{ \# QQ:2715099320}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00019}00019 \textcolor{comment}{ \# Mobile Phone:13005636215}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00020}00020 \textcolor{comment}{ \#}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00021}00021 \textcolor{comment}{ \# All rights reserved.}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00022}00022 \textcolor{comment}{ */}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00023}00023 } \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00037}00037 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00038}00038 \textcolor{comment}{// 头文件}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00039}00039 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bsp___i_i_c_8h}{bsp\_IIC.h}}"{}}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00041}00041 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00042}00042 \textcolor{comment}{// 底层程序}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00043}00043 \textcolor{comment}{// }} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00047}\mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{00047}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{bsp\_IIC::IIC\_Start}}(\textcolor{keywordtype}{void}) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00048}00048 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00049}00049 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00050}00050 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00051}00051 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00052}00052 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00053}00053 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00054}00054 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00055}00055 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00059}\mbox{\hyperlink{classbsp___i_i_c_ae513e1a05cbbae2a6f37e6cbb3bb63e2}{00059}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_ae513e1a05cbbae2a6f37e6cbb3bb63e2}{bsp\_IIC::IIC\_Stop}}(\textcolor{keywordtype}{void}) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00060}00060 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00061}00061 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00062}00062 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00063}00063 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00064}00064 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00065}00065 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00066}00066 \textcolor{comment}{//发送应答或非应答信号}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00071}\mbox{\hyperlink{classbsp___i_i_c_a684793afa5c26e6d123ff6ad083342c8}{00071}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_a684793afa5c26e6d123ff6ad083342c8}{bsp\_IIC::IIC\_SendAck}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} ackbit) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00072}00072 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00073}00073 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(ackbit);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00074}00074 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00075}00075 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00076}00076 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00077}00077 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00078}00078 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00079}00079 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00080}00080 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00085}\mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{00085}} \textcolor{comment}{}\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{bsp\_IIC::IIC\_WaitAck}}(\textcolor{keywordtype}{void}) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00086}00086 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} ackbit;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00087}00087 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00088}00088 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00089}00089 ackbit = \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7ae4ead84d2c3bbc3f2403d9a5157a3f94}{IIC\_READ}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00090}00090 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00091}00091 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00092}00092 \textcolor{keywordflow}{return} ackbit;\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00093}00093 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00098}\mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{00098}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{bsp\_IIC::IIC\_SendByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} byt) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00099}00099 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00100}00100 \textcolor{keywordflow}{for} (i = 0; i < 8; i++) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00101}00101 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00102}00102 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00103}00103 \mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}((byt \& 0x80) != 0);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00104}00104 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00105}00105 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00106}00106 byt <<= 1;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00107}00107 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00108}00108 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00109}00109 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00114}\mbox{\hyperlink{classbsp___i_i_c_a15201c6a6bd1affde8da0fc642f62272}{00114}} \textcolor{comment}{}\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___i_i_c_a15201c6a6bd1affde8da0fc642f62272}{bsp\_IIC::IIC\_RecByte}}(\textcolor{keywordtype}{void}) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00115}00115 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i=0, da=0;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00116}00116 \textcolor{keywordflow}{for} (i = 0; i < 8; i++) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00117}00117 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a9e128b73c7beb33be6b4e953a7fddc66}{IIC\_SET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00118}00118 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00119}00119 da <<= 1;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00120}00120 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___i_i_c_adf1ba1196ef163ab1958747744dd8a14}{IIC\_SDA}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7ae4ead84d2c3bbc3f2403d9a5157a3f94}{IIC\_READ}}))da |= 1;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00121}00121 \mbox{\hyperlink{classbsp___i_i_c_a9c71db14d666983ab15621f119bdc171}{IIC\_SCK}}(\mbox{\hyperlink{bsp___i_i_c_8h_adf764cbdea00d65edcd07bb9953ad2b7a048bbf954430bbc34fa11280165ed534}{IIC\_RESET}});} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00122}00122 \mbox{\hyperlink{classbsp___i_i_c_ad3d17035a8d19842ccabbf743a4405f4}{IIC\_Delay}}();\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00123}00123 \textcolor{keywordflow}{return} da;\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00125}00125 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00126}00126 \textcolor{comment}{// 封装程序}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00127}00127 \textcolor{comment}{// }} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00136}\mbox{\hyperlink{classbsp___i_i_c_a9f4cdf777e69f407b155ffdba5b9e7c8}{00136}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_a9f4cdf777e69f407b155ffdba5b9e7c8}{bsp\_IIC::IIC\_WriteOneByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \textcolor{keywordtype}{id}, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00137}00137 \mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{IIC\_Start}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00138}00138 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(\textcolor{keywordtype}{id} << 1);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00139}00139 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00140}00140 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(addr);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00141}00141 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00142}00142 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(dat);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00143}00143 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00144}00144 \mbox{\hyperlink{classbsp___i_i_c_ae513e1a05cbbae2a6f37e6cbb3bb63e2}{IIC\_Stop}}();\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00145}00145 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00153}\mbox{\hyperlink{classbsp___i_i_c_a9effd40b26cbf6f321d0f0db3e2f09c3}{00153}} \textcolor{comment}{}\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___i_i_c_a9effd40b26cbf6f321d0f0db3e2f09c3}{bsp\_IIC::IIC\_ReadOneByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \textcolor{keywordtype}{id}, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr) \{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00154}00154 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} temp = 0;} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00155}00155 \mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{IIC\_Start}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00156}00156 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(\textcolor{keywordtype}{id} << 1);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00157}00157 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00158}00158 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(addr);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00159}00159 \mbox{\hyperlink{classbsp___i_i_c_a684793afa5c26e6d123ff6ad083342c8}{IIC\_SendAck}}(0);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00160}00160 \mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{IIC\_Start}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00161}00161 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}((\textcolor{keywordtype}{id} << 1) | 0x01);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00162}00162 \mbox{\hyperlink{classbsp___i_i_c_a684793afa5c26e6d123ff6ad083342c8}{IIC\_SendAck}}(0);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00163}00163 temp = \mbox{\hyperlink{classbsp___i_i_c_a15201c6a6bd1affde8da0fc642f62272}{IIC\_RecByte}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00164}00164 \mbox{\hyperlink{classbsp___i_i_c_a684793afa5c26e6d123ff6ad083342c8}{IIC\_SendAck}}(1);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00165}00165 \mbox{\hyperlink{classbsp___i_i_c_ae513e1a05cbbae2a6f37e6cbb3bb63e2}{IIC\_Stop}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00166}00166 \textcolor{keywordflow}{return} temp;\}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00167}00167 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00177}\mbox{\hyperlink{classbsp___i_i_c_a9d5d55340f9c43998763ecd0fb67b88c}{00177}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___i_i_c_a9d5d55340f9c43998763ecd0fb67b88c}{bsp\_IIC::IIC\_Write}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \textcolor{keywordtype}{id},\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat,\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}} len)\{} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00178}00178 \mbox{\hyperlink{classbsp___i_i_c_a97ad38a37ad0140987ba79d878f0d9e9}{IIC\_Start}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00179}00179 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(\textcolor{keywordtype}{id}<<1);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00180}00180 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00181}00181 \mbox{\hyperlink{classbsp___i_i_c_ae2e78aae0c89a4d6063d8ba60752acd5}{IIC\_SendByte}}(addr);} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00182}00182 \mbox{\hyperlink{classbsp___i_i_c_a3f14f230b5876c529380d4f51a9c9c12}{IIC\_WaitAck}}();} \DoxyCodeLine{\Hypertarget{bsp___i_i_c_8cpp_source_l00183}00183 \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int} i=0;i