30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

i2c_data_wait This is the timeout count for which the module has<br />

to wait before return.<br />

If the timeout count is ‘N’, the actual timeout would<br />

be about (20*N - 1) instruction cycles.<br />

Return Value This function returns ‘0’ if all bytes have been sent or number of<br />

bytes<br />

read from I<br />

2<br />

Cbus if its not able to read the data with in the specified<br />

i2c_data_waittime out value<br />

Remarks: This routine reads a predefined data string from the I<br />

2<br />

Cbus.<br />

Source File: MastergetsI2C.c<br />

Code Example: unsigned char string[10];<br />

unsigned char *rdptr;<br />

unsigned int length,i2c_data_wait;<br />

length = 9;<br />

rdptr = string;<br />

i2c_data_wait = 152;<br />

MastergetsI2C(length, rdptr, i2c_data_wait);<br />

MasterputsI2C<br />

Description: This function is used to write out a data string to the I<br />

2<br />

Cbus.<br />

Include: i2c.h<br />

Prototype: unsigned int MasterputsI2C(unsigned char *wrptr);<br />

Arguments: wrptr Character type pointer to data objects in dsPIC Ram. The<br />

data objects are written to the I<br />

2<br />

Cdevice.<br />

Return Value This function returns -3 if a write collision occurred.This function<br />

returns<br />

‘0’ if the null character was reached in data string.<br />

Remarks: This function writes a string to the I<br />

2<br />

Cbus until a null character is<br />

reached. Each byte is written via a call to the MasterputcI2C<br />

function. The actual calledfunction body is termed MasterWriteI2C.<br />

MasterWriteI2Cand MasterputcI2Crefer to the same function via<br />

I2C_CLK_HLD<br />

Giao diện quản lý thông minh ngoại vi Enable bit<br />

I2C_IPMI_EN<br />

I2C_IPMI_DIS<br />

10-bit Slave Địa chỉ bit<br />

I2C_10BIT_ADD<br />

I2C_7BIT_ADD<br />

Vô hiệu hóa xoay Tỷ lệ kiểm soát bit<br />

I2C_SLW_DIS<br />

I2C_SLW_EN<br />

SMBus bit Cấp độ đầu vào<br />

I2C_SM_EN<br />

I2C_SM_DIS<br />

Gọi chung Enable bit<br />

I2C_GCALL_EN<br />

I2C_GCALL_DIS<br />

SCL đồng hồ căng Enable bit<br />

I2C_STR_EN<br />

I2C_STR_DIS<br />

Thừa nhận bit dữ liệu<br />

I2C_ACK<br />

I2C_NACK<br />

Thừa nhận trình tự Enable bit<br />

I2C_ACK_EN<br />

I2C_ACK_DIS<br />

Nhận Kích hoạt bit<br />

I2C_RCV_EN<br />

I2C_RCV_DIS<br />

Dừng Điều kiện Enable bit<br />

I2C_STOP_EN<br />

I2C_STOP_DIS<br />

Bắt đầu lặp đi lặp lại Điều kiện Enable bit<br />

I2C_RESTART_EN<br />

I2C_RESTART_DIS<br />

Điều kiện bắt đầu Enable bit<br />

I2C_START_EN<br />

I2C_START_DIS<br />

config2 trị giá tính toán cho máy phát điện tốc độ truyền<br />

dsPIC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!