12.07.2015 Views

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

硬 件 外 设 函 数ReadTimer0ReadTimer1ReadTimer2ReadTimer3ReadTimer4功 能 : 读 取 指 定 定 时 器 的 值 。包 含 头 文 件 : timers.h原 型 : unsigned int ReadTimer0( void );unsigned int ReadTimer1( void );unsigned char ReadTimer2( void );unsigned int ReadTimer3( void );unsigned char ReadTimer4( void );说 明 : 这 些 函 数 读 取 各 个 定 时 器 寄 存 器 的 值 。Timer0: TMR0L,TMR0HTimer1: TMR1L,TMR1HTimer2: TMR2Timer3: TMR3L,TMR3HTimer4: TMR4注 : 当 使 用 可 配 置 为 16 位 模 式 、 但 工 作 在 8 位 模 式 的 定 时 器 ( 如timer0) 时 , 高 字 节 并 不 保 证 为 0。 用 户 可 能 希 望 将 结 果 强 制 转 换 为 字符 型 , 以 得 到 正 确 的 结 果 。 例 如 :// Example of reading a 16-bit result// from a 16-bit timer operating in// 8-bit mode:unsigned int result;result = (unsigned char) ReadTimer0();返 回 值 : 定 时 器 的 当 前 值 。文 件 名 :t0read.ct1read.ct2read.ct3read.ct4read.c© 2004 Microchip Technology Inc. DS51297C_CN 第 53 页

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

Saved successfully!

Ooh no, something went wrong!