hdq.h
上传用户:xs588588
上传日期:2021-03-30
资源大小:242k
文件大小:1k
- // Timer clock frequency (Hz)
- #define ClkFreq 2000000u
- //------------------------------------------------------------------------------
- // Define HDQ Protocol Related Timing Constants
- //------------------------------------------------------------------------------
- #define tBreak (190 * ClkFreq / 1000000) // HDQ Break Time (190us)
- #define tBR (40 * ClkFreq / 1000000) // HDQ Break Recovery Time (40us)
- #define tHW1 (40 * ClkFreq / 1000000) // Host sends 1 time (40us)
- #define tHW0 (123 * ClkFreq / 1000000) // Host sends 0 time (123us)
- #define tCYCH (230 * ClkFreq / 1000000) // Host bit window timing (230us)
- #define tDW1 (41 * ClkFreq / 1000000) // Slave sends 1 time (41us)
- #define tDW0 (113 * ClkFreq / 1000000) // Slave sends 0 time (113us)
- #define tTO (500 * ClkFreq / 1000000) // Time-Out Bit Receiption (500us)
- //-----------------------------------------------------
- void HDQSetup(void);
- void HDQWrite(unsigned char Addr, unsigned char Data);
- unsigned int HDQRead(unsigned char Addr);