/* CH376 chip hardware abstraction layer V1.0 */
/* Provide I/O interface subroutines */
#include <reg52.h>
#include "CH376INC.H"
#ifndef __CH376_HAL_H__
#define __CH376_HAL_H__
#ifdef __CX51__
#ifndef __C51__
# define __C51__ 1
#endif
#endif
#ifdef __C51__
#define BIG_ENDIAN 1
#endif
#ifdef __C51__
#pragma NOAREGS
#endif
/* Additional USB operating state definitions */
#define ERR_USB_UNKNOWN 0xFA /* Unknown error, should not happen, need Check hardware or program errors*/
/* Delay the specified microsecond time, adjust according to the main frequency of the microcontroller, inaccurate*/
void mDelayuS( UINT8 us );
/* Delay the specified millisecond time, adjusted according to the main frequency of the single-chip microcomputer, inaccurate*/
void mDelaymS( UINT8 ms );
void CH376_PORT_INIT( void ); /* CH376 communication interface initialization*/
void xEndCH376Cmd( void ); /* End CH376 command , only for SPI interface mode*/
void xWriteCH376Cmd( UINT8 mCmd ); /* write command to CH376*/
void xWriteCH376Data( UINT8 mData ); /* write data to CH376*/
UINT8 xReadCH376Data( void ); /* read from CH376 Data*/
UINT8 Query376Interrupt( void ); /* Query CH376 interrupt (INT# pin is low) */
UINT8 mInitCH376Host( void ); /* Initialize CH376 */
#endif
/* Provide I/O interface subroutines */
#include <reg52.h>
#include "CH376INC.H"
#ifndef __CH376_HAL_H__
#define __CH376_HAL_H__
#ifdef __CX51__
#ifndef __C51__
# define __C51__ 1
#endif
#endif
#ifdef __C51__
#define BIG_ENDIAN 1
#endif
#ifdef __C51__
#pragma NOAREGS
#endif
/* Additional USB operating state definitions */
#define ERR_USB_UNKNOWN 0xFA /* Unknown error, should not happen, need Check hardware or program errors*/
/* Delay the specified microsecond time, adjust according to the main frequency of the microcontroller, inaccurate*/
void mDelayuS( UINT8 us );
/* Delay the specified millisecond time, adjusted according to the main frequency of the single-chip microcomputer, inaccurate*/
void mDelaymS( UINT8 ms );
void CH376_PORT_INIT( void ); /* CH376 communication interface initialization*/
void xEndCH376Cmd( void ); /* End CH376 command , only for SPI interface mode*/
void xWriteCH376Cmd( UINT8 mCmd ); /* write command to CH376*/
void xWriteCH376Data( UINT8 mData ); /* write data to CH376*/
UINT8 xReadCH376Data( void ); /* read from CH376 Data*/
UINT8 Query376Interrupt( void ); /* Query CH376 interrupt (INT# pin is low) */
UINT8 mInitCH376Host( void ); /* Initialize CH376 */
#endif