62 lines
13 KiB
TeX
62 lines
13 KiB
TeX
\hypertarget{bsp___a_t24_c00_8h_source}{}\doxysection{bsp\+\_\+\+AT24\+C00.\+h}
|
|
\label{bsp___a_t24_c00_8h_source}\index{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_IIC/bsp\_AT24C00.h@{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_IIC/bsp\_AT24C00.h}}
|
|
\mbox{\hyperlink{bsp___a_t24_c00_8h}{浏览该文件的文档.}}
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00001}00001 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00002}00002 \textcolor{comment}{ \#}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00003}00003 \textcolor{comment}{ \# Copyright (c) 2022 Yuankang Liang(XerolySkinner)}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00004}00004 \textcolor{comment}{ \#}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00005}00005 \textcolor{comment}{ \# 本软件按原样提供,无任何明示或暗示}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00006}00006 \textcolor{comment}{ \# 在任何情况下,作者都不承担任何损害赔偿责任}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00007}00007 \textcolor{comment}{ \#}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00008}00008 \textcolor{comment}{ \# 使用的许可声明:}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00009}00009 \textcolor{comment}{ \# 1. 不得歪曲本软件的来源,你不能声称你编写了原始软件.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00010}00010 \textcolor{comment}{ \# 2. 免费授予以任何目的,前提是版权声明出现在所有副本中.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00011}00011 \textcolor{comment}{ \# 并且版权声明和许可声明同时出现.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00012}00012 \textcolor{comment}{ \# 3. 你有使用,复制,修改,分发,和销售本软件的许可.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00013}00013 \textcolor{comment}{ \# 4. 如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00014}00014 \textcolor{comment}{ \# 5. 本通知不得从任何来源删除或更改.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00015}00015 \textcolor{comment}{ \#}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00016}00016 \textcolor{comment}{ \# Yuankang Liang(XerolySkinner)}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00017}00017 \textcolor{comment}{ \# E-\/mail:zabbcccbbaz@163.com}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00018}00018 \textcolor{comment}{ \# QQ:2715099320}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00019}00019 \textcolor{comment}{ \# Mobile Phone:13005636215}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00020}00020 \textcolor{comment}{ \#}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00021}00021 \textcolor{comment}{ \# All rights reserved.}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00022}00022 \textcolor{comment}{ */}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00023}00023 }
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00034}00034 \textcolor{preprocessor}{\#ifdef \_\_cplusplus}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00035}00035 \textcolor{preprocessor}{\#pragma once}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{varint_8h}{varint.h}}"{}}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bsp___i_i_c___s_t_m32_8h}{bsp\_IIC\_STM32.h}}"{}}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00039}00039 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00040}00040 \textcolor{comment}{// 类目}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00044}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00}{00044}} \textcolor{comment}{}\textcolor{keyword}{class }\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00}{bsp\_STM32\_AT24C00}}:\textcolor{keyword}{public} \mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}\{}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00045}00045 \textcolor{keyword}{public}:}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00046}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5509d16dc81dcc75acb287f802e5740a}{00046}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5509d16dc81dcc75acb287f802e5740a}{bsp\_STM32\_AT24C00}}(\mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}\& \_bsp\_IIC\_STM32) :}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00047}00047 \mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}(\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a6258aaa53e12f5502333f4440cdba352}{GPIOx\_SCK}}, \_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a7a5b57552741573a65114014a146bd5e}{GPIO\_Pin\_SCK}},\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_aae22b18b9aa61649c4abd31f79fa7a82}{GPIOx\_SDA}},\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a73c8aa1aef1ed9e4ff8d46e5c7755272}{GPIO\_Pin\_SDA}}) \{}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00048}00048 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{bsp\_STM32\_AT24C00::Address}} = 0x50;}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00049}00049 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{bsp\_STM32\_AT24C00::Page}} = 8;\};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00050}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a6501d9fa92d1ae5f9c43a125f0e106a0}{00050}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a6501d9fa92d1ae5f9c43a125f0e106a0}{bsp\_STM32\_AT24C00}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{Address}}, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{Page}}, \mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}\& \_bsp\_IIC\_STM32) :}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00051}00051 \mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}(\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a6258aaa53e12f5502333f4440cdba352}{GPIOx\_SCK}}, \_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a7a5b57552741573a65114014a146bd5e}{GPIO\_Pin\_SCK}},\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_aae22b18b9aa61649c4abd31f79fa7a82}{GPIOx\_SDA}},\_bsp\_IIC\_STM32.\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a73c8aa1aef1ed9e4ff8d46e5c7755272}{GPIO\_Pin\_SDA}}) \{}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00052}00052 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{bsp\_STM32\_AT24C00::Address}} = \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{Address}};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00053}00053 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{bsp\_STM32\_AT24C00::Page}} = \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{Page}};\};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00054}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_add0323d62cef144dbd1e1b7b548a09f9}{00054}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_add0323d62cef144dbd1e1b7b548a09f9}{bsp\_STM32\_AT24C00}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{Address}}, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{Page}},GPIO\_TypeDef *\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a6258aaa53e12f5502333f4440cdba352}{GPIOx\_SCK}},uint16\_t \mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a7a5b57552741573a65114014a146bd5e}{GPIO\_Pin\_SCK}},GPIO\_TypeDef *\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_aae22b18b9aa61649c4abd31f79fa7a82}{GPIOx\_SDA}},uint16\_t \mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a73c8aa1aef1ed9e4ff8d46e5c7755272}{GPIO\_Pin\_SDA}}) :}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00055}00055 \mbox{\hyperlink{classbsp___i_i_c___s_t_m32}{bsp\_IIC\_STM32}}(\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a6258aaa53e12f5502333f4440cdba352}{GPIOx\_SCK}},\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a7a5b57552741573a65114014a146bd5e}{GPIO\_Pin\_SCK}},\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_aae22b18b9aa61649c4abd31f79fa7a82}{GPIOx\_SDA}},\mbox{\hyperlink{classbsp___i_i_c___s_t_m32_a73c8aa1aef1ed9e4ff8d46e5c7755272}{GPIO\_Pin\_SDA}}) \{}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00056}00056 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{bsp\_STM32\_AT24C00::Address}} = \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{Address}};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00057}00057 \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{bsp\_STM32\_AT24C00::Page}} = \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{Page}};\};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00058}00058 \textcolor{keyword}{public}:}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00059}00059 \textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a43f5fb06621d92865d9289d996b3211a}{WriteOneByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat);}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00060}00060 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a950e3a80ff49c538294bfedf8e893ff7}{ReadOneByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr);}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00061}00061 \textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a2c0bcf4f2ffd4ef242c8d4423dca1ad0}{WriteByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} *dat,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} len);}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00062}00062 \textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_ad5b68ee911f6e46ab877049eaadc5b1c}{AT\_ReadByte}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} addr,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} *dat,\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} len);}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00063}00063 \textcolor{keyword}{private}:}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00064}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{00064}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7b81cd0d8fea1bb0ce4e4b0143612bde}{Address}} = 0x50;}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00065}\mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{00065}} \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a5c1a52c22b16f15bf07358a4b181e2ff}{Page}} = 8;}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00066}00066 \textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___s_t_m32___a_t24_c00_a7ba3cbef5e2eea37f514948f12f2119d}{IIC\_Delay}}(\textcolor{keywordtype}{void});}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00067}00067 \};}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00069}00069 \textcolor{preprocessor}{\#endif}}
|
|
\DoxyCodeLine{\Hypertarget{bsp___a_t24_c00_8h_source_l00070}00070 }
|
|
|
|
\end{DoxyCode}
|