#ifndef __SVT_H__ #define __SVT_H__ #define SCREEN_WIDTH 160 #define SCREEN_HEIGHT 120 typedef enum { false=0, true=!false }bool; typedef char* String; typedef unsigned char uint8; typedef unsigned int uint16; typedef unsigned long uint32; typedef long File; // // Define basic routines expected // extern void Start(void); extern bool Run(void); extern void End(void); // Logging void Log(String text, ... ); // Time void Sleep( uint32 us ); void ResetTimer( void ); uint16 ReadTimer( void ); // IR void OpenIR(); void SetIR( bool state ); void CloseIR(); void SetLED( bool state ); // Get Voltage / Current uint16 SVT_GetBatteryVoltage(); #define KEY_RUN (1<<0) #define KEY_SELECT (1<<0) #define KEY_MENU (1<<1) #define KEY_INPUT1 (1<<2) #define KEY_INPUT2 (1<<3) #define KEY_RIGHT_BACK (1<<4) #define KEY_RIGHT_FORWARD (1<<5) #define KEY_LEFT_BACK (1<<7) #define KEY_LEFT_FORWARD (1<<6) #define KEY_HOME (1<<8) bool GetRemoteKeyStatus( int key ); int GetRemoteKeys(); bool GetCarPushButton(); // Motor control void OpenMotors(); void SetLeftMotor( int speed ); void SetRightMotor( int speed ); void SetMotors( int leftSpeed, int rightSpeed ); void CloseMotors(); uint16 GetLeftMotorCurrent(); uint16 GetRightMotorCurrent(); // File IO long OpenFileSystem(); void CloseFileSystem(); long CreateFile( String pathName ); long DeleteFile( String pathName ); File OpenFile( String pathName ); void CloseFile( File f ); long SeekFile( File f, long pos); long ReadFile( File f, void* buffer, uint32 bufferLength ); long WriteFile( File f, void* buffer, uint32 bufferLength ); long FlushFile( File f ); // Graphics typedef struct { unsigned char R; unsigned char G; unsigned char B; unsigned char Transparent; } Color; // Images extern int Image0; extern int Image1; extern int Image2; extern int Image3; void RegisterDefaultImages( void ); void OpenImageRegister( void ); int RegisterImage( void* image, int size); void CloseImageRegister( void ); void OpenGraphics(void); void CloseGraphics(void); void DrawRectangle( int lx, int ty, int rx, int by, Color rgba ); void SetLineWidth( int w ); void ClearRectangle( int lx, int ty, int rx, int by ); int DrawText(int x, int y, String fmt, ...); void SetTextColor( Color rgba ); void DrawImage( int imageIndex, int x, int y, Color transparent ); void SetScreen( Color rgba); void ClearScreen(void); void SetRectangle( int lx, int ty, int rx, int by, Color rgba); void ScrollRectangle(int lx, int ty, int rx, int by, int mx, int my); void Show(void); // Hardware int ReadADC( int channel ); int GetBatteryVoltage( ); // Audio bool StartAudioPlayback( char* filename ); bool IsAudioPlaying(); bool StartAudioRecording( char* filename ); bool WriteAudioData(); void StopAudioRecording(); // //// Still to modify - probably wait for next release... //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); // ////-------------------------------- //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_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); #endif