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

void TAP_ExitNormal();

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

void TAP_EnterNormal();

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

void TAP_Exit();

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

byte TAP_KbHit();

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

byte TAP_GetCh();

It returns one byte data from RS232 port.

Additional Documentation


TAP_PutCh

Topfield Documentation

void TAP_PutCh(byte c);

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.hhex key codefunction
RKEY_Cmd_00x10027test colour bars
RKEY_Cmd_10x10028blank screen
RKEY_Cmd_20x10029?
RKEY_Cmd_30x1002aall channels go blank
RKEY_Cmd_40x1002ball channels go blank
RKEY_Cmd_50x1002c?
RKEY_Cmd_60x1002djumps to the beginning of the timeshift/record buffer
RKEY_Cmd_70x1002e?
RKEY_Cmd_80x1002f?
RKEY_Cmd_90x10030?
RKEY_Cmd_a0x10031overwrites the first 1024 bytes of the disk with 0xff
RKEY_Cmd_b0x10032test bars - black and white split half screen
RKEY_Cmd_c0x10033test bars - black and red split half screen
RKEY_Cmd_d0x10034test bars - black and green split half screen
RKEY_Cmd_e0x10035test bars - black and blue split half screen
RKEY_Cmd_f0x10036FACTORY RESET
FKEY_AVMenu0xff001a/v output setting menu
FKEY_Sleep0xff002Sleep toggle
FKEY_SoundMenu0xff003Sound track menu
FKEY_FavMenu0xff004Favourites menu
FKEY_SubtitleMenu0xff005Subtitle track menu
FKEY_00060xff006?
FKEY_PIPBackward0xff007Move pip backwards
FKEY_PIPForward0xff008Move pip
FKEY_SetBookmark0xff009Set bookmark
FKEY_GotoBookmark0xff00aGoto 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

int TAP_Vfd_GetStatus();

It detects the availability of VFD.

return value : The status of VFD

return valuecomment
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 valuecomment
underTapCtrl : TRUEControlled by TAP
underTapCtrl : FALSEControlled 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.

parametercomment
dataThe data to be sent to the VFD
dataLenThe 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