#include <mxfapi.h>
uint32 initHandler(HMXF_SERVER server, uint64 deviceIndex, uint64 moduleIndex, uint64 channelIndex, uint64 attrib, uint64* value);
int main(void)
{
HMXF_SERVER server;
HMXF_DEVICE device=0;
HMXF_CHANNEL txChannel=0;
HMXF_BUFFER txBuffer=0;
uint32 rc;
char szTemp[32];
uint64 timer=0, time=0;
if (!rc)
if(!rc)
if (!rc)
rc =
mxfChannelGet(server, MXF_CLASS_PULSE, MXF_SCLASS_TX_CHANNEL, MXF_MODULE_MULTI, 0, &txChannel);
if(!rc)
if(!rc)
{
rc =
mxfAttributeUint64Set(txChannel, KMXF_PULSE_ELECTRICAL_SELECTION, VMXF_PULSE_ELECTRICAL_SELECT_CUSTOM);
if(!rc)
if (!rc)
if (!rc)
}
if (!rc)
if(!rc)
if (!rc)
{
printf("Set line to 0\n\r");
memset(&Rec, 0, sizeof(Rec));
Rec.
mode = MXF_PULSE_DATAREC_MODE_LOW;
}
if (!rc)
{
printf("Set line to 1\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_HIGH;
}
if (!rc)
{
printf("Set line to 0 in 500 msec\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_LOW;
if (!rc)
{
timer += 500000;
}
}
if (!rc)
{
printf("Start a pulse schedule 50 usec after low state\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_SCHED_START;
timer += 50;
}
if (!rc)
{
printf("Re-Start a pulse schedule in 1 sec\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_SCHED_START;
if(!rc)
{
timer += 1000000;
}
}
if (!rc)
{
printf("Change the current duty cycle to 25 usec high, 25 usec low after 500 msec\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_SCHED_START_EOP;
timer += 500000;
}
if (!rc)
{
printf("Change the current duty cycle to 100 usec high, 100 usec low at the end of the current pulse repeat count\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_SCHED_START_EOR;
}
if (!rc)
{
printf("Stop the shedule after 2 seconds (set the line to low state)\n\r");
Rec.
mode = MXF_PULSE_DATAREC_MODE_LOW_EOP;
timer += 2000000;
}
do
{
if (!rc)
if (!rc)
} while (time < timer && !rc);
if (rc)
printf("ERROR, rc=%08lx\n\r", rc);
printf("Press enter to terminate ...");
fgets(szTemp, sizeof(szTemp), stdin);
if(txBuffer)
return rc;
}
uint32 initHandler(HMXF_SERVER server, uint64 deviceIndex, uint64 moduleIndex, uint64 channelIndex, uint64 attrib, uint64* value)
{
HMXF_DEVICE device;
uint32 rc;
server = server;
deviceIndex = deviceIndex;
if (attrib == KMXF_CHANNEL_CLASS)
{
if (!rc)
if (!rc && (deviceInfo.
modules[moduleIndex].
type == MXF_MODULE_MULTI))
{
if (channelIndex == 4)
{
*value = MXF_CLASS_PULSE;
return TRUE;
}
}
}
return FALSE;
}