User guide
154 RealCT Direct API Developer Guide
Chapter 5: MVIP-90
Example 7. CONFIG_CLOCK Sample Code
#include “brktddm.h”
int main(int argc, char **argv)
{
BRKT_HANDLE BoardHandle; /* T1 board device handle */
BOOLEAN IoctlResult; /* Result of IOCTL call */
BRKT_SIZE_T BytesReturned; /* Bytes returned from IOCTL call*/
USHORT ClockValue;
/* Open T1 board device */
BoardHandle = BrktOpenDevice (BRKT_DEVICE_T1_BOARD, 0);
/* Configure MVIP clock. Synchronous call. */
ClockValue = CLOCK_REF_NET1 | SEC8K_DRIVEN_BY_NET1;
IoctlResult = BrktDeviceIoControl (
BoardHandle,
CONFIG_CLOCK,
&ClockValue, /* Buffer to driver */
sizeof(ClockValue),
NULL,
0,
&BytesReturned,
NULL); /* Wait until I/O is complete */
if (!IoctlResult)
printf ("CONFIG_CLOCK failed: BrktGetLastError = %d\n",
BrktGetLastError (BoardHandle));
BrktCloseDevice(BoardHandle);
}