All System Function Documentation
TAP_SystemProc
Topfield Documentation
void TAP_SystemProc(void)
It SHOULD be called continuously to get the system resources in application mode.
It should be called repeatedly to process the RS232 data or remote controllers that are firmware's resources. If it is not called in application mode, the TAP application cannot use the RS232 data or remote controller.
It is HIGHLY recommended NOT to call this function in TSR mode because all the resources can be available even without this function in TSR mode.
Additional Documentation
It is legitimate to call this function in a TAP in TSR mode and doing so will not (by itself) cause problems.
If you do this you must be particularly careful to avoid infinite recursion (a call to TAP_SystemProc will re-enter your TAP via TAP_EventHandler, and if that in turn calls TAP_SystemProc and the cycle repeats the Toppy will crash due to a stack overflow).
Calling TAP_SystemProc in TSR mode is useful to allow easier coding of modal messages to the user - it is possible to create an equivalent of the MessageBox() function that will return the user choice rather than having to show the UI, return, handle events and eventually route the choice to the code that needs it. YesNoBox in
libc++utils? works this way.
TAP_GetState
Topfield Documentation
void TAP_GetState(dword* state, dword* subState);
It gets the current status of firmware.
- state : the state of firmware
- subState : detailed state of firmware
Additional Documentation
Put Additional Documentation here.
TAP_ExitNormal
Topfield Documentation
It makes the firmware to exit from the normal state. The normal state means that the system can display the info box, volume bar or any other OSD. All the OSD regions are initialized and cleared after this function. This function SHOULD be called to use OSD functions in TAP application.
Additional Documentation
EMJB: Note that unless TAP_ExitNormal() has been called, "<<" & ">>" keypresses are still processed by the firmware even if zero has been return by the event handler.
EMJB: On the TF5800 this function prevents the MHEG engine from loading (if not already loaded).
TAP_EnterNormal
Topfield Documentation
It makes the firmware to enter the normal state. The firmware can display info box or any other OSD after this function.
Additional Documentation
EMJB: Calling TAP_EnterNormal() clears previous OSD messages even if TAP_ExitNormal() has not been called.
EMJB: Calling TAP_EnterNormal() when the Toppy has a menu/channel list/archive etc displayed appears to set the Toppy back to State_Normal/Substate_Normal without clearing the relevant on-screen displays.
TAP_Exit
Topfield Documentation
It ends the TAP application.
This function SHOULD be called to finish the TAP application in TSR mode.
Additional Documentation
TAP_Exit returns (having set a flag first) to the calling code - you should ensure that the return path back up to returning out of TAP_EventHandler is valid if you have done cleanup before calling TAP_Exit.
The firmware seems to actually unload the TAP just before the first IDLE_EVENT after the TAP_Exit call. It's unclear whether it is possible for another type of event (i.e. key press) to arrive between calling TAP_Exit and the next IDLE event. Good coding practice would suggest setting an internal flag when calling TAP_Exit and returning immediately from TAP_EventHandler if this flag is set.
TAP_KbHit
Topfield Documentation
It checks if there is a new data in RS232 port. It returns 0 if there is no data. If a new data is available, it returns non-zero value.
Additional Documentation
TAP_GetCh
Topfield Documentation
It returns one byte data from RS232 port.
Additional Documentation
TAP_PutCh
Topfield Documentation
It puts one byte data to RS232 port.
Additional Documentation
TAP_Print
Topfield Documentation
void TAP_Print(const void *fmt, ...);
It puts a formatted string data to RS232 port. It will be useful in case of debugging the TAP application.
Additional Documentation
Don't use float variables and formats, you'll get unpredictable output.
TAP_GetSystemVar
Topfield Documentation
int TAP_GetSystemVar( int varId )
It returns the system stting information.
varId : Identification number of the following system variables.
The Identification number is defined in the TAP.H.
For the detailed information, refer the TAP.H.
- SYSVAR_Vol Volome
- SYSVAR_OsdLan Menu Language
- SYSVAR_SubLan Subtitle Language
- SYSVAR_AudLan Audio Language
- SYSVAR_TvType Tv Type
- SYSVAR_VideoOut Video Output
- SYSVAR_ScartType Scart Type
- SYSVAR_TvRatio Tv Aspect Ratio
- SYSVAR_16_9_Display 16:9 Display Format
- SYSVAR_SoundMode Sound Mode
- SYSVAR_UhfType UHF Type
- SYSVAR_UhfCh UHF Channel
- SYSVAR_OsdAlpha OSD Transparency
- SYSVAR_IBoxTime Info Box Display Time
- SYSVAR_IBoxPos Info Box Position
- SYSVAR_Timeshift Time shifting
Additional Documentation
TAP_GetSystemVar(SYSVAR_Vol)returns a value in the range 0x00 (0%) to 0x11 (100%) when not muted, to which 0x80 is added when muted. This is the same scaling as used in TAP_SetSystemVar(SYSVAR_Vol), but different from that in TAP_SetSoundLevel().
TAP_SetSystemVar
Topfield Documentation
int TAP_SetSystemVar( int varId, int value )
It sets the system variable.
It returns the set value.
- varId : Identification number of the following system variables.
- value : the value to be set to the system variable.
The Identification number is defined in the TAP.H.
For the detailed information, refer the TAP.H.
- SYSVAR_Vol Volome
- SYSVAR_OsdLan Menu Language
- SYSVAR_SubLan Subtitle Language
- SYSVAR_AudLan Audio Language
- SYSVAR_TvType Tv Type
- SYSVAR_VideoOut Video Output
- SYSVAR_ScartType Scart Type
- SYSVAR_TvRatio Tv Aspect Ratio
- SYSVAR_16_9_Display 16:9 Display Format
- SYSVAR_SoundMode Sound Mode
- SYSVAR_UhfType UHF Type
- SYSVAR_UhfCh UHF Channel
- SYSVAR_OsdAlpha OSD Transparency
- SYSVAR_IBoxTime Info Box Display Time
- SYSVAR_IBoxPos Info Box Position
- SYSVAR_Timeshift Time shifting
Additional Documentation
TAP_SetSystemVar(SYSVAR_Vol) requires a value in the range 0x00 (0%) to 0x11 (100%). This is the same scaling as used in TAP_GetSystemVar(SYSVAR_Vol), but different from that in TAP_SetSoundLevel(). However if the value returned by TAP_GetSystemVar(SYSVAR_Vol) while muted is used, it will be treated as invalid and the level set to zero.
TAP_WriteSystemVar
Topfield Documentation
int TAP_WriteSystemVar();
It saves the value in the EEPROM.
If it is not called after changing the system variables by
TAP_SetSystemVar(), the variables cannot be saved.
return value : 0 for Success, other value for ERROR
Additional Documentation
TAP_GenerateEvent
Topfield Documentation
void TAP_GenerateEvent( word evtCode, dword param1, dword param2 )
It makes an event such as input from the RCU.
- evtCode : event (only the EVT_KEY is supported now)
- param1, param2 : The event value
Additional Documentation
This function behaves rather strangely on the TF5800 due to the mappings applied to keys to support the UK's remote layout. For example, to generate an RKEY_Exit keypress, RKEY_AudioTrk must be sent.
Some key codes have a special function
name from key.h | hex key code | function |
---|
RKEY_Cmd_0 | 0x10027 | test colour bars |
RKEY_Cmd_1 | 0x10028 | blank screen |
RKEY_Cmd_2 | 0x10029 | ? |
RKEY_Cmd_3 | 0x1002a | all channels go blank |
RKEY_Cmd_4 | 0x1002b | all channels go blank |
RKEY_Cmd_5 | 0x1002c | ? |
RKEY_Cmd_6 | 0x1002d | jumps to the beginning of the timeshift/record buffer |
RKEY_Cmd_7 | 0x1002e | ? |
RKEY_Cmd_8 | 0x1002f | ? |
RKEY_Cmd_9 | 0x10030 | ? |
RKEY_Cmd_a | 0x10031 | overwrites the first 1024 bytes of the disk with 0xff |
RKEY_Cmd_b | 0x10032 | test bars - black and white split half screen |
RKEY_Cmd_c | 0x10033 | test bars - black and red split half screen |
RKEY_Cmd_d | 0x10034 | test bars - black and green split half screen |
RKEY_Cmd_e | 0x10035 | test bars - black and blue split half screen |
RKEY_Cmd_f | 0x10036 | FACTORY RESET |
FKEY_AVMenu | 0xff001 | a/v output setting menu |
FKEY_Sleep | 0xff002 | Sleep toggle |
FKEY_SoundMenu | 0xff003 | Sound track menu |
FKEY_FavMenu | 0xff004 | Favourites menu |
FKEY_SubtitleMenu | 0xff005 | Subtitle track menu |
FKEY_0006 | 0xff006 | ? |
FKEY_PIPBackward | 0xff007 | Move pip backwards |
FKEY_PIPForward | 0xff008 | Move pip |
FKEY_SetBookmark | 0xff009 | Set bookmark |
FKEY_GotoBookmark | 0xff00a | Goto bookmark |
TAP_SetBaudRate
Topfield Documentation
void TAP_SetBaudRate( dword baudRate )
It sets the baud rate of serial port.
baudRate : 150 / 300 / 600 / 1200 / 2400 / 4800 / 9600 / 19200 / 28800 / 38400 / 56000 / 57600 / 76800 /
115200 / 128000 (bps)
Additional Documentation
TAP_Vfd_GetStatus
Topfield Documentation
It detects the availability of VFD.
return value : The status of VFD
return value | comment |
---|
VFD_NotSupport (0) | No VFD |
VFD_LedEmulMode (1) | VFD works in LED emulation mode. It does not support TAP. |
VFD_VfdMode (2) | VFD works in VFD Mode. |
Additional Documentation
Required firmware for this function is at least 5.11.51 (Mar 16 2005)
This function was introduced in API Version 1.20.
This function returns value VFD_NotSupport for all Topfield models, except the TF5500PVR and the TF5510PVR, that have a vfd dot matrix display.
With this function you can check whether the vfd is availabe and working in normal mode.
If the return value equals VFD_VfdMode, functions
TAP_Vfd_Control() and
TAP_Vfd_SendData() may be used to control the display.
The display of the Masterpiece series cannot be programmed using these functions.
VFD = Vacuum Fluorescent Display
TAP_Vfd_Control
Topfield Documentation
void TAP_Vfd_Control( bool underTapCtrl);
It gets the control over the VFD.
parameter value | comment |
---|
underTapCtrl : TRUE | Controlled by TAP |
underTapCtrl : FALSE | Controlled by firmware |
Additional Documentation
Required firmware for this function is at least 5.11.51 (Mar 16 2005)
Only use this function after
TAP_Vfd_GetStatus() returned VFD_VfdMode=2.
VFD = Vacuum Fluorescent Display
TAP_Vfd_SendData
Topfield Documentation
void TAP_Vfd_SendData(byte *data, byte dataLen);
It outputs the data to the VFD.
parameter | comment |
---|
data | The data to be sent to the VFD |
dataLen | The length of data |
Additional Documentation
Required firmware for this function is at least 5.11.51 (Mar 16 2005)
This function was introduced in API Version 1.20.
Only use this function after
TAP_Vfd_GetStatus() returned VFD_VfdMode (=2) and
TAP_Vfd_Control(TRUE) has been executed.
VFD = Vacuum Fluorescent Display