Examples – Kramer Electronics VP-790 User Manual

Page 9

Advertising
background image

VP-790 Protocol –

Communication

5

1.7

8B

Examples

The following examples are used to explain how the API calls and protocol work:

Change the Contrast Setting for runtime use. Increase the contrast (gain) by
10% (see

Section 1.7.1

)

Save the Contrast Setting such that it is permanently stored in non-volatile
memory (flash) and used the next time the system is reset or powered up
again (see

Section 1.7.2

)

Read back the Contrast Setting from non-volatile memory (see

Section

1.7.3

)

Switch between inputs (see

Section 1.7.4

)

Rename a User (see

Section 1.7.5

)

1.7.1

127B

Change Contrast Setting:

The API byOSDContrastSet is used to change the contrast setting.

The API Index is decimal 124, i.e. hexadecimal

0x00 7C

. There is only one

parameter passed to the API function and this is the gain of UWORD32 type, i.e. a
4 byte value. The range of the parameter is from 0x00000000 (OSD slider position -
50, gain of 1–1/√2) to 0xFFFFFFFF (OSD slider position 50, gain of 1+1/√2 ). A
value of 0x7FFFFFFF corresponds to a gain factor of 1 which corresponds to the
OSD slider position in the middle respectively 0.

Increasing the contrast by 10% corresponds to a gain of 1.1. The parameter thus
has to be 0x7FFFFFFF + (0xFFFFFFFF – 0x7FFFFFFFF)*(0.1/(1/ /√2)) =

0x92 1A

18 50

.

The return value(s) of this API function is only an error code of BYTE type, i.e. a 1
byte value. It is

0x00

if the call was successful or an error occurred if it is not zero.

Let us assume the call was successful for this example.

All blue values are fixed and always identical for all commands.

The black values indicate the following payloads in bytes. For the API call the data
is 4 = 0x04 bytes long. The data package (line 3) is 12 bytes long plus the length of
the data. Therefore, the application header (line 2) indicates a payload of 12 + 4 =

Advertising