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.

• src\peripheral– source code for library functions and a batch file to rebuild<br />

the library<br />

• support\h– header files for libraries<br />

3.1.3 Chapter Organization<br />

This chapter is organized as follows:<br />

• Using the dsPIC Peripheral Libraries<br />

Software Functions<br />

• External LCD Functions<br />

Hardware Functions<br />

• CAN Functions<br />

• ADC12 Functions<br />

• ADC10 Functions<br />

• Timer Functions<br />

• Reset/Control Functions<br />

• I/O Port Functions<br />

• Input Capture Functions<br />

• Output Compare Functions<br />

• UART Functions<br />

• DCI Functions<br />

• SPI Functions<br />

• QEI Functions<br />

• PWM Functions<br />

• I2C Functions<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 74<br />

2004 Microchip Technology Inc.<br />

3.2 USING THE dsPIC PERIPHERAL LIBRARIES<br />

Building an application which utilizes the dsPIC Peripheral Libraries requires a<br />

processor-specific library file and a header file for each peripheral module.<br />

For each peripheral, the corresponding header file provides all the function<br />

prototypes,<br />

#definesand typedefsused by the library. The archived library file contains all<br />

the<br />

individual object files for each library function.<br />

The header files are of the form peripheral.h, where peripheral= name of the<br />

particular peripheral being used (e.g., can.hfor CAN.)<br />

The library files are of the form libpDevice-omf.a, where Device= dsPIC device<br />

number (e.g., libp30F6014-coff.afor the dsPIC30F6014 device.) See<br />

Section 1.2 “OMF-Specific Libraries/StarTup Modules”for more on OMFđây:<br />

• dsPIC30F5011<br />

• dsPIC30F5013<br />

• dsPIC30F6010<br />

• dsPIC30F6011<br />

• dsPIC30F6012<br />

• dsPIC30F6013<br />

• dsPIC30F6014<br />

dsPIC Thư viện ngoại vi<br />

2004 Microchip Technology Inc DS51456B trang 75<br />

3.3.1 Chức năng cá nhân<br />

BusyXLCD<br />

Kiểm tra chức năng này cho cờ bận rộn của P-tec PCOG1602B LCD: Mô tả<br />

điều khiển.<br />

Bao gồm: xlcd.h<br />

Prototype: char BusyXLCD (void);<br />

Lập luận: Không<br />

Quay trở lại giá trị: Nếu "1" được trả lại, nó cho thấy rằng bộ điều khiển màn<br />

hình LCD là bận rộn và không thể<br />

thực hiện bất kỳ lệnh.<br />

Nếu "0" được trả lại, nó chỉ ra rằng màn hình LCD đã sẵn sàng cho lệnh tiếp<br />

theo.<br />

Ghi chú: Chức năng này trả về trạng thái của cờ bận rộn của P-tec<br />

PCOG1602B LCD điều khiển.<br />

Source File: BusyXLCD.c<br />

Mã số Ví dụ: trong khi (BusyXLCD ());<br />

OpenXLCD<br />

Mô tả: Chức năng này cấu hình I / O pins và khởi tạo các P-tec<br />

PCOG1602B LCD điều khiển.<br />

Bao gồm: xlcd.h<br />

Prototype: void OpenXLCD (unsigned char lcdtype);<br />

Đối số: lcdtype này chứa các thông số điều khiển LCD được<br />

cấu hình như dưới đây:<br />

Loại giao diện<br />

FOUR_BIT<br />

EIGHT_BIT<br />

Số dòng<br />

SINGLE_LINE<br />

TWO_LINE<br />

Phân khúc hướng truyền dữ liệu

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

Saved successfully!

Ooh no, something went wrong!