亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? i2c.txt

?? picc_18v 8.35pl35 PIC18系列單片機開發C編譯器
?? TXT
字號:
The i2c functions and macros to implement the i squared c,
7-bit, standard-mode, master-mode protcol.

For a description of i squared c, see "The i2c bus -
and how to use it" by Philips Semiconductors.

CONTENTS
########

1 Setting Up
2 High-level Function and Macro Definitions
3 Lower-level Function and Macro Definitions
4 Examples


1) Setting Up
#############

The file i2c.h should be #included into your source
files. This file contains several macros which specify
which port bits are to be used for the clock (SCL) and
the data line (SDA). These should be adjusted to suit
your application. The bus time-out macro I2C_TM_SCL_TMO
in i2c.h may need adjusting to suit the devices used.
Some devices require relatively long time to process
data. A delay may be required in your code before
attempting further access to these devices. If your
PIC crystal frequency is not 4MHz, you will have to
make the appropriate adjustments as detailed in delay.h
for the delays to be accurate.


2) High-level Function and Macro Definitions
############################################

unsigned char
i2c_WriteTo(unsigned char address)
~~~~~~~~~~~

This function is used to commence writing to a device
on the bus. Specify the 7-bit address to which data is
to be sent. The least significant bit of the argument
is ignored. The function generates a (re)start condition
and reads an acknowledge from the slave. The function
returns TRUE if the slave did not acknowledge the address
transfer or FALSE otherwise.

unsigned char
i2c_ReadFrom(unsigned char address)
~~~~~~~~~~~~

This function is used to commence reading from a
device on the bus. Specify the 7-bit address from which
data is to be read. The least significant bit of the
argument is ignored. The function generates a (re)start
condition and reads an acknowledge from the slave. The
function returns TRUE if the slave did not acknowledge
the address transfer or FALSE otherwise.

signed char
i2c_PutByte(unsigned char byte)
~~~~~~~~~~~~

This function is used to send a byte of data to the
device which has been activated by i2c_WriteTo().
The function checks the acknowledge bit returned
by the slave. The function returns I2C_ERROR if during
the transfer a bus error occured, TRUE if the data
was not acknowledged, or FALSE if the transfer took
place without error and was acknowledged.

int
i2c_GetByte(unsigned char more)
~~~~~~~~~~~

This function is used to read a byte of data from
the device which has been activated by i2c_ReadFrom().
The argument to this function is used to determine if
more data is to be read from the activated device. If
more is I2C_LAST, or false, no acknowledge is sent, and
no more data can be read from the activated device
unless another i2c_ReadFrom() command is issued.
If more is I2C_MORE, or any true value, an acknowledge is
sent and more data can be read from the activated
device. The function returns the unsigned byte read
from the activated device or I2C_ERROR if a bus error
occured during the read operation.


signed int
i2c_PutString(const unsigned char *string,
~~~~~~~~~~~~~       unsigned char str_len)

This function is used to send a sequence of bytes to
the device which has been activated by i2c_WriteTo().
The function attempts to send str_len bytes which
are read from string. If a bus error occures during
the transfer, the function returns a negative int.
The magnitude of this number is the number of bytes
which were not successfully transmitted. If the
slaves fails to acknowledge a transfer, the
transmission is terminated and the function
returns a positive number. The magnitude of this
number is the number of bytes which were not
successfully transmitted. The function returns FALSE
if the all the bytes were transmitted without error
and they were all acknowledged by the slave.

unsigned char
i2c_GetString(unsigned char *string,
~~~~~~~~~~~~~ unsigned char str_len)

This function is used to obtain a sequence of bytes
from the device which has been activated by
i2c_ReadFrom(). The function attempts to read str_len
bytes which will be stored at string. If a bus error
occurs during the transfer, the function terminates
and returns the number of bytes not successfully read.
The function returns FALSE if all the data requested
was read without error. This function indicates to
the slave that no more data is to be read after
successfully reading the last byte. To read more data
after using this function, activate the source device
by using i2c_ReadFrom().


I2C_MORE and I2C_LAST
~~~~~~~~     ~~~~~~~~

These macros may be used with i2c_GetByte() to
indicate that more data is to be read or that this
is the last byte to be read, respectively.

I2C_ERROR
~~~~~~~~~

This macro may be used with i2c_GetByte() and
i2c_PutByte() to check for a bus error.


3) Lower-level Function and Macro Definitions
#############################################

void
i2c_Stop(void)
~~~~~~~~

Sends a stop condition.

void
i2c_Restart(void)
~~~~~~~~~~~

Sends a start condition.

void
i2c_Start(void)
~~~~~~~~~~~

Sends a start condition. Functionally the same
as i2c_Restart().

unsigned char
i2c_SendByte(unsigned char byte)
~~~~~~~~~~~~

Sends an 8-bit number to the active device. The
acknowledge bit is not checked. Returns TRUE if
a bus error occured; FALSE otherwise.

usigned char
i2c_SendAddress(unsigned char address,
~~~~~~~~~~~~~~~      unsigned char rw)

Sends an 8-bit quantity representing a 7-bit
address and a 1-bit read/write mode bit. Returns
TRUE if a bus error occurred; FALSE otherwise.

signed char
i2c_ReadAcknowledge(void)
~~~~~~~~~~~~~~~~~~~

Reads the acknowledge bit from the slave.
Returns I2C_ERROR if a bus error occurs, TRUE if
the device did not acknowledge, or FALSE
otherwise.

int
i2c_ReadByte(void)
~~~~~~~~~~~~

Reads an 8-bit quantity from the slave. The
acknowledge is not generated. Returns the byte or
I2C_ERROR if a bus error occurred.

void
i2c_SendAcknowledge(unsigned char status)
~~~~~~~~~~~~~~~~~~~

Sends an acknowledge if status is TRUE; sends
a ~acknowledge otherwise. A ~acknowledge is used
to indicate to the slave that no more data is to
be read and that it should release the bus so that
the master can issue the next command.

unsigned char
i2c_Open(unsigned char address, unsigned char mode)
~~~~~~~~

Sends a 7-bit address and 1-bit read/write mode bit.
Returns TRUE if the device did not acknowledge.

unsigned char
i2c_WaitForSCL(void)
~~~~~~~~~~~~~~

Waits for the clock line to be released by the slave.
If the line is not released after I2C_TM_SCL_TMO micro
seconds, the function times out and a bus error is
assumed. In this case, the function returns TRUE;
FALSE otherwise.


4) Examples
###########

i2c_WriteTo(0xAE);	/* talk to device 1010111w */
i2c_PutByte(0x00);	/* send data 0x00 */

i2c_ReadFrom(0xAE);	/* talk to device 1010111r */
data1 = i2c_GetByte(I2C_MORE);	/* read one byte */
data2 = i2c_GetByte(I2C_MORE);	/* read another */
i2c_GetString(my_string, 10);	/* read 10 bytes */

/* i2c_GetString() terminates reading, if more data
 * is required, re-address the device
 */

i2c_ReadFrom(0xAE);
data3 = i2c_GetByte(I2C_LAST);	/* last byte read */

/* check for errors */
if(i2c_PutByte(0xff))
  my_error_routine();	/* bus error or ~ack */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频精品全部免费在线| 91精品国产综合久久精品| 欧美午夜精品一区二区蜜桃| 欧美大白屁股肥臀xxxxxx| 国产视频不卡一区| 免费成人性网站| 欧美日韩国产bt| 中文字幕欧美一| 国产一区二区在线观看视频| 欧美夫妻性生活| 亚洲国产视频a| 91视视频在线直接观看在线看网页在线看 | 天堂久久一区二区三区| 成人av在线播放网站| 欧美不卡一区二区三区四区| 视频一区二区国产| av男人天堂一区| 中文字幕在线观看一区二区| 国产精品66部| 国产亚洲1区2区3区| 国产一区二区美女| 欧美zozozo| 裸体歌舞表演一区二区| 欧美一区二区三区视频在线观看| 亚洲综合色婷婷| 欧美综合久久久| 亚洲一区二区在线观看视频| 99re热视频精品| 亚洲伦在线观看| 91精品办公室少妇高潮对白| 亚洲毛片av在线| 99久久精品国产毛片| 亚洲天堂精品视频| 91国偷自产一区二区开放时间| 亚洲欧美日韩一区二区| 成人一二三区视频| 亚洲欧洲成人自拍| 色诱视频网站一区| 亚洲精品免费在线| 欧美性大战久久久久久久蜜臀 | 亚洲国产精品一区二区www | 亚洲欧美日韩国产另类专区| 色综合天天综合网天天狠天天| 亚洲黄一区二区三区| 欧美性感一区二区三区| 日韩国产欧美在线播放| 精品剧情v国产在线观看在线| 精品在线播放免费| 国产日韩影视精品| 色呦呦日韩精品| 日本在线播放一区二区三区| 欧美mv日韩mv国产网站app| 国产精品资源在线观看| 亚洲人精品午夜| 欧美区一区二区三区| 国产精品自在欧美一区| 最新国产精品久久精品| 欧美丰满嫩嫩电影| 国产乱人伦精品一区二区在线观看| 中文字幕精品—区二区四季| 欧美色视频在线观看| 国产在线视频一区二区三区| 中文字幕一区二区三区视频| 欧美久久一二三四区| 国产毛片一区二区| 亚洲影视在线播放| 久久久噜噜噜久久中文字幕色伊伊| 国产sm精品调教视频网站| 亚洲韩国精品一区| 久久久久久久久久电影| 欧美写真视频网站| 国产成人免费高清| 日韩一区精品字幕| 中文字幕一区二区三区av| 日韩午夜三级在线| 日本丶国产丶欧美色综合| 久久久久国产精品厨房| 一本到不卡精品视频在线观看| 国产偷国产偷亚洲高清人白洁| 韩国成人精品a∨在线观看| 精品国产凹凸成av人网站| 久久99国产精品免费网站| 精品日韩欧美一区二区| 久久精品72免费观看| 精品久久久久久综合日本欧美 | 日韩三级在线观看| 美女精品一区二区| 久久精品视频网| bt欧美亚洲午夜电影天堂| 亚洲女人的天堂| 欧美日韩日本视频| 日本午夜精品视频在线观看| 久久综合九色综合久久久精品综合 | 午夜久久久影院| 欧美一级理论片| 豆国产96在线|亚洲| 亚洲男人的天堂在线观看| 国产激情视频一区二区三区欧美 | 国产乱码一区二区三区| 日韩二区三区在线观看| 亚洲成人7777| 亚洲精选一二三| 亚洲色图视频免费播放| 欧美激情中文字幕一区二区| 亚洲精品在线观看视频| 日韩免费一区二区| 91麻豆精品国产自产在线| 在线观看国产91| 91麻豆文化传媒在线观看| www.欧美亚洲| av一区二区三区在线| 粉嫩嫩av羞羞动漫久久久| 国产成人av电影在线播放| 国产精品一二三四| 国产91对白在线观看九色| 国产成人精品三级| 成人网在线免费视频| 成人综合在线视频| 99精品国产99久久久久久白柏| 成人黄色av电影| 色综合久久久久| 欧美色欧美亚洲另类二区| 欧美日韩一二区| 91麻豆精品久久久久蜜臀| 日韩欧美国产一二三区| 亚洲精品一区二区精华| 国产午夜精品一区二区三区四区| 中文无字幕一区二区三区| 亚洲欧美综合在线精品| 一区二区三区视频在线观看| 婷婷开心久久网| 久久超碰97中文字幕| 国产成人综合亚洲网站| 99综合影院在线| 欧美视频在线观看一区二区| 91精品婷婷国产综合久久竹菊| 日韩免费在线观看| 国产精品污www在线观看| 亚洲精品伦理在线| 麻豆精品蜜桃视频网站| 处破女av一区二区| 欧美午夜理伦三级在线观看| 欧美va天堂va视频va在线| 欧美激情一区三区| 午夜精品福利一区二区三区av| 国产在线精品视频| 91福利视频久久久久| 日韩欧美区一区二| 亚洲精品伦理在线| 老司机免费视频一区二区| 不卡一区二区三区四区| 欧美丰满一区二区免费视频| 国产欧美一区二区精品性色| 亚洲精品免费看| 国产在线一区观看| 色天使色偷偷av一区二区| 精品国产免费一区二区三区香蕉| 亚洲人精品午夜| 国产在线不卡一区| 久久久一区二区三区捆绑**| 精品免费国产一区二区三区四区| 欧美大片一区二区| 国产视频一区在线观看 | 91在线观看美女| 色综合咪咪久久| 欧美日韩电影一区| 日韩手机在线导航| 久久精品在这里| 亚洲色图第一区| 污片在线观看一区二区| 精品在线一区二区| 成人91在线观看| 欧美精品123区| 精品电影一区二区| 亚洲欧洲日产国码二区| 亚洲一区二区精品视频| 美国av一区二区| 成人h动漫精品| 欧美日韩精品一二三区| 久久这里只精品最新地址| 亚洲色欲色欲www在线观看| 日韩综合一区二区| 国产一区二区成人久久免费影院 | 91国偷自产一区二区三区观看| 欧美日韩一级视频| 中文字幕欧美三区| 性久久久久久久| 国产成人免费在线| 欧美精选一区二区| 国产清纯美女被跳蛋高潮一区二区久久w| 国产精品入口麻豆原神| 亚洲bt欧美bt精品| 国产精品99久久久久久有的能看| 色美美综合视频| 久久精品亚洲乱码伦伦中文| 亚洲精品国产一区二区精华液 | 国产精品99久| 欧美精品久久一区| 亚洲视频一二三区| 国产一区二区在线看|