61 lines
14 KiB
XML
61 lines
14 KiB
XML
|
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||
|
|
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_bsp___a_t24_c00_8h_source" xml:lang="zh">
|
||
|
|
<title>bsp_AT24C00.h</title>
|
||
|
|
<indexterm><primary>D:/gitt/MicrochipFor32/bsp_Device/bsp_AT24C00.h</primary></indexterm>
|
||
|
|
浏览该文件的文档.<programlisting linenumbering="unnumbered"><anchor xml:id="_bsp___a_t24_c00_8h_source_1l00001"/>00001 <emphasis role="comment">/*----------------------------------------------------------------------------------------------------</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00002"/>00002 <emphasis role="comment"> #</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00003"/>00003 <emphasis role="comment"> #  Copyright (c) 2022 Yuankang Liang(XerolySkinner)</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00004"/>00004 <emphasis role="comment"> #</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00005"/>00005 <emphasis role="comment"> #  本软件按原样提供,无任何明示或暗示</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00006"/>00006 <emphasis role="comment"> #  在任何情况下,作者都不承担任何损害赔偿责任</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00007"/>00007 <emphasis role="comment"> #</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00008"/>00008 <emphasis role="comment"> #  使用的许可声明:</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00009"/>00009 <emphasis role="comment"> #  1.  不得歪曲本软件的来源,你不能声称你编写了原始软件.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00010"/>00010 <emphasis role="comment"> #  2.  免费授予以任何目的,前提是版权声明出现在所有副本中.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00011"/>00011 <emphasis role="comment"> #      并且版权声明和许可声明同时出现.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00012"/>00012 <emphasis role="comment"> #  3.  你有使用,复制,修改,分发,和销售本软件的许可.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00013"/>00013 <emphasis role="comment"> #  4.  如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00014"/>00014 <emphasis role="comment"> #  5.  本通知不得从任何来源删除或更改.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00015"/>00015 <emphasis role="comment"> #</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00016"/>00016 <emphasis role="comment"> #  Yuankang Liang(XerolySkinner)</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00017"/>00017 <emphasis role="comment"> #      E-mail:zabbcccbbaz@163.com</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00018"/>00018 <emphasis role="comment"> #      QQ:2715099320</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00019"/>00019 <emphasis role="comment"> #      Mobile Phone:13005636215</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00020"/>00020 <emphasis role="comment"> #</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00021"/>00021 <emphasis role="comment"> #  All rights reserved.</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00022"/>00022 <emphasis role="comment"> */</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00023"/>00023
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00034"/>00034 <emphasis role="preprocessor">#ifdef __cplusplus</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00035"/>00035 <emphasis role="preprocessor">#pragma once</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00036"/>00036 <emphasis role="preprocessor">#include "<link linkend="_varint_8h">varint.h</link>"</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00037"/>00037 <emphasis role="preprocessor">#include "<link linkend="_bsp___i_i_c___s_t_m32_8h">bsp_IIC_STM32.h</link>"</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00039"/>00039 <emphasis role="comment">//----------------------------------------------------------------------------------------------------</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00040"/>00040 <emphasis role="comment">//  类目</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00044"/><link linkend="_classbsp___s_t_m32___a_t24_c00">00044</link> <emphasis role="comment"></emphasis><emphasis role="keyword">class </emphasis><link linkend="_classbsp___s_t_m32___a_t24_c00">bsp_STM32_AT24C00</link>:<emphasis role="keyword">public</emphasis> <link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>{
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00045"/>00045     <emphasis role="keyword">public</emphasis>:
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00046"/><link linkend="_classbsp___s_t_m32___a_t24_c00_1a5509d16dc81dcc75acb287f802e5740a">00046</link>         <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5509d16dc81dcc75acb287f802e5740a">bsp_STM32_AT24C00</link>(<link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>& _bsp_IIC_STM32) :
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00047"/>00047             <link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>(_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a6258aaa53e12f5502333f4440cdba352">GPIOx_SCK</link>, _bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a7a5b57552741573a65114014a146bd5e">GPIO_Pin_SCK</link>,_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1aae22b18b9aa61649c4abd31f79fa7a82">GPIOx_SDA</link>,_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a73c8aa1aef1ed9e4ff8d46e5c7755272">GPIO_Pin_SDA</link>) {
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00048"/>00048                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">bsp_STM32_AT24C00::Address</link>  = 0x50;
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00049"/>00049                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">bsp_STM32_AT24C00::Page</link>     = 8;};
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00050"/><link linkend="_classbsp___s_t_m32___a_t24_c00_1a6501d9fa92d1ae5f9c43a125f0e106a0">00050</link>         <link linkend="_classbsp___s_t_m32___a_t24_c00_1a6501d9fa92d1ae5f9c43a125f0e106a0">bsp_STM32_AT24C00</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">Address</link>, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">Page</link>, <link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>& _bsp_IIC_STM32) :
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00051"/>00051             <link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>(_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a6258aaa53e12f5502333f4440cdba352">GPIOx_SCK</link>, _bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a7a5b57552741573a65114014a146bd5e">GPIO_Pin_SCK</link>,_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1aae22b18b9aa61649c4abd31f79fa7a82">GPIOx_SDA</link>,_bsp_IIC_STM32.<link linkend="_classbsp___i_i_c___s_t_m32_1a73c8aa1aef1ed9e4ff8d46e5c7755272">GPIO_Pin_SDA</link>) {
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00052"/>00052                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">bsp_STM32_AT24C00::Address</link> = <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">Address</link>;
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00053"/>00053                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">bsp_STM32_AT24C00::Page</link> = <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">Page</link>;};
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00054"/><link linkend="_classbsp___s_t_m32___a_t24_c00_1add0323d62cef144dbd1e1b7b548a09f9">00054</link>         <link linkend="_classbsp___s_t_m32___a_t24_c00_1add0323d62cef144dbd1e1b7b548a09f9">bsp_STM32_AT24C00</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">Address</link>, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">Page</link>,GPIO_TypeDef *<link linkend="_classbsp___i_i_c___s_t_m32_1a6258aaa53e12f5502333f4440cdba352">GPIOx_SCK</link>,uint16_t <link linkend="_classbsp___i_i_c___s_t_m32_1a7a5b57552741573a65114014a146bd5e">GPIO_Pin_SCK</link>,GPIO_TypeDef *<link linkend="_classbsp___i_i_c___s_t_m32_1aae22b18b9aa61649c4abd31f79fa7a82">GPIOx_SDA</link>,uint16_t <link linkend="_classbsp___i_i_c___s_t_m32_1a73c8aa1aef1ed9e4ff8d46e5c7755272">GPIO_Pin_SDA</link>) :
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00055"/>00055             <link linkend="_classbsp___i_i_c___s_t_m32">bsp_IIC_STM32</link>(<link linkend="_classbsp___i_i_c___s_t_m32_1a6258aaa53e12f5502333f4440cdba352">GPIOx_SCK</link>,<link linkend="_classbsp___i_i_c___s_t_m32_1a7a5b57552741573a65114014a146bd5e">GPIO_Pin_SCK</link>,<link linkend="_classbsp___i_i_c___s_t_m32_1aae22b18b9aa61649c4abd31f79fa7a82">GPIOx_SDA</link>,<link linkend="_classbsp___i_i_c___s_t_m32_1a73c8aa1aef1ed9e4ff8d46e5c7755272">GPIO_Pin_SDA</link>) {
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00056"/>00056                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">bsp_STM32_AT24C00::Address</link> = <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">Address</link>;
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00057"/>00057                 <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">bsp_STM32_AT24C00::Page</link> = <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">Page</link>;};
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00058"/>00058     <emphasis role="keyword">public</emphasis>:
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00059"/>00059         <emphasis role="keywordtype">void</emphasis> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a43f5fb06621d92865d9289d996b3211a">WriteOneByte</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr,<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> dat);
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00060"/>00060         <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a950e3a80ff49c538294bfedf8e893ff7">ReadOneByte</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr);
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00061"/>00061         <emphasis role="keywordtype">void</emphasis> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a2c0bcf4f2ffd4ef242c8d4423dca1ad0">WriteByte</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr,<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> *dat,<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len);
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00062"/>00062         <emphasis role="keywordtype">void</emphasis> <link linkend="_classbsp___s_t_m32___a_t24_c00_1ad5b68ee911f6e46ab877049eaadc5b1c">AT_ReadByte</link>(<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr,<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> *dat,<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len);
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00063"/>00063     <emphasis role="keyword">private</emphasis>:
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00064"/><link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">00064</link>         <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link>      <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7b81cd0d8fea1bb0ce4e4b0143612bde">Address</link> = 0x50;
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00065"/><link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">00065</link>         <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link>      <link linkend="_classbsp___s_t_m32___a_t24_c00_1a5c1a52c22b16f15bf07358a4b181e2ff">Page</link>    = 8;
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00066"/>00066         <emphasis role="keywordtype">void</emphasis> <link linkend="_classbsp___s_t_m32___a_t24_c00_1a7ba3cbef5e2eea37f514948f12f2119d">IIC_Delay</link>(<emphasis role="keywordtype">void</emphasis>);
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00067"/>00067     };
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00069"/>00069 <emphasis role="preprocessor">#endif</emphasis>
|
||
|
|
<anchor xml:id="_bsp___a_t24_c00_8h_source_1l00070"/>00070
|
||
|
|
</programlisting></section>
|