/************************************************************************ * JAPI.h * * V1.0.6 Jerry.Wang (Íõ¿¡) 2010 05 26 * * +8618603055209 jerry.wang@sz.newspirit.com.hk * * New Spirit Electronic Technology Development(Shenzhen)Co.,Ltd. * ************************************************************************/ #ifndef __JAPI_H__ #define __JAPI_H__ #include "NUSBH.h" typedef void (*JAPI_V1F)(unsigned long s0); typedef void (*JAPI_V2F)(unsigned long s0,unsigned long s1); typedef void (*JAPI_V3F)(unsigned long s0,unsigned long s1,unsigned long s2); #define ScreenWidth 160 #define ScreenHeight 120 #define Key_Run (1<<8) #define Key_Select (1<<8) #define Key_Menu (1<<9) #define Key_Input1 (1<<10) #define Key_Input2 (1<<11) #define Key_RightBackward (1<<12) #define Key_RightForward (1<<13) #define Key_LeftForward (1<<14) #define Key_LeftBackward (1<<15) #define Key_Home (1<<16) #define DIconSign 1 #define DIconFps 2 #define DIconCH 4 #define DIconIRled 8 #define DIconSpeaker 0x10 #define DIconIcon1 0x20 #define DIconIcon2 0x40 #define DIconIcon3 0x80 extern unsigned long JAPI_Version(void); extern unsigned long JAPI_ReadReg(unsigned long RegAddr); extern void JAPI_WriteReg(unsigned long RegAddr,unsigned long RegVal); extern void JAPI_Exit(void); extern void JAPI_Sleep(unsigned long pieces); extern void JAPI_Idle(void); extern unsigned long JAPI_GetKey(void); extern void JAPI_ResetTimer0(void); extern unsigned char JAPI_GetTimer0(void); extern void JAPI_ResetTimer1(void); extern unsigned char JAPI_GetTimer1(void); extern void JAPI_ResetTimer2(void); extern unsigned short JAPI_GetTimer2(void); //-------------------------------- extern void JAPI_AttachVideoProc(JAPI_V3F PicProc); extern void JAPI_FreeVideoProc(void); extern void JAPI_AttachAudioProc(JAPI_V2F AudioProc); extern void JAPI_FreeAudioProc(void); extern void JAPI_AttachQVGAProc(JAPI_V1F QVGAproc); extern void JAPI_FreeQVGAProc(void); extern unsigned long JAPI_GetCtrlStatus(void); extern unsigned long JAPI_GetAdcPosAddr(void); extern unsigned long JAPI_OpenRfAudio(void); extern unsigned long JAPI_CloseRfAudio(void); extern unsigned long JAPI_SendRfAudio(unsigned long *pData,unsigned long len); extern unsigned long JAPI_OpenRfVideo(void); extern unsigned long JAPI_CloseRfVideo(void); extern unsigned long JAPI_SendRfVideo(unsigned long *pData,unsigned long len); //******************************************************************************** extern unsigned long JAPI_TransFile(void *pData,unsigned long len); extern long JAPI_FS_Open(void); extern void JAPI_FS_Close(void); extern long JAPI_FS_FileOpen(unsigned short *fn); extern void JAPI_FS_FileClose(long fh); extern long JAPI_FS_FileRead(long fh,void *pBuffer,unsigned long buffLen,unsigned long *len); extern long JAPI_FS_FileWrite(long fh,void *pBuffer,unsigned long buffLen,unsigned long *len); extern long JAPI_FS_FileDelete(unsigned short *FullPathName); extern long JAPI_FS_FileSeek(long fh,long pos); extern long JAPI_FS_FileCreate(unsigned short *Path,unsigned short *FullPathName); extern unsigned long JAPI_FS_GetFileSize(long FileHandle); extern long JAPI_FS_FileFlush(long fh); extern long JAPI_SD_Open(unsigned long *pNull); extern void JAPI_SD_Close(void); extern long JAPI_SD_GetCardSize(void *pVoid,unsigned long *pSize); extern long JAPI_SD_Read(unsigned long StartSecAddr,unsigned long SectsCnt,void *pBuffer); extern long JAPI_SD_Write(unsigned long StartSecAddr,unsigned long SectsCnt,void *pBuffer); extern long JAPI_SD_Flush(void); //********************************************************************* extern void JAPI_APU_SetVolume(unsigned char v); extern void JAPI_APU_Start(void); extern void JAPI_APU_Stop(void); extern unsigned int JAPI_APU_IsBusy(void); extern void JAPI_APU_RegisterFetchData(unsigned long Addr); extern void JAPI_APU_SetBuffer(unsigned int BufferAddr); extern void JAPI_APU_SetBufferSize(unsigned char Index,unsigned short size); extern void JAPI_APU_Open(unsigned int sr,unsigned short chn); extern void JAPI_APU_Close(void); extern void JAPI_APU_IntHandle(void); extern int JAPI_FRAME_CreateFrame(unsigned long pBuffer); extern int JAPI_FRAME_DestroyFrame(unsigned long pBuffer); extern int JAPI_FRAME_AlterColor(unsigned long pBuffer, unsigned char eColor); extern int JAPI_FRAME_CopyFrame(unsigned long pBuffer,unsigned long pRes); extern unsigned long JAPI_MotorOpen(void); extern unsigned long JAPI_MotorCtrl(unsigned long vol); extern void JAPI_MotorClose(void); extern void JAPI_SetMotorLeft(int speed); extern void JAPI_SetMotorRight(int speed); extern void JAPI_SetRCKeyCtrl(unsigned char bCtrl); extern void JAPI_SetRCIcon(unsigned char bCtrl); extern void JAPI_SetRCSnd(unsigned char bCtrl); extern void JAPI_IRon(void); extern void JAPI_IRoff(void); extern void JAPI_GetIRCtrl(void); extern void JAPI_QuitIRCtrl(void); //===================================== extern unsigned short JAPI_ReadBatteryVoltage(void); //extern unsigned short JAPI_ReadMotorSL(void); // Deleted //extern unsigned short JAPI_ReadMotorSR(void); // Deleted extern unsigned short JAPI_ReadADC(unsigned char adcCH); //----------------------------- extern void JAPI_ClearPDTimer(void); extern void JAPI_SetPDTimer(unsigned short seconds); //----------------------------- RF extern void JAPI_RF_StartRadio(void); extern void JAPI_RF_StopRadio(void); extern void JAPI_RF_OpenConnection(void); extern void JAPI_RF_CloseConnection(void); extern unsigned short JAPI_RF_GetChannel(void); //---------------------------------- extern unsigned char JAPI_GetCmdAck(void); //---------------------- IO extern unsigned char JAPI_GetIoInput(void); extern void JAPI_SetIoOutputMode(unsigned char pin); extern void JAPI_SetIoInputMode(unsigned char pin); extern void JAPI_SetIoHigh(unsigned char pin); extern void JAPI_SetIoLow(unsigned char pin); extern void JAPI_SetIoPullUp(unsigned char pin); #endif