Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 63

Advertising
background image

KTD-S0057-I

Page 59 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


int main (void)
{

printf ("\nTIMER test program\n");

if (open_reg_range ())

{

printf ("Cannot open register range !\n\n");

return

-1;

}

if

(timer_reset

())

{

close_reg_range

();

printf ("TIMER init error !\n\n");

return

-1;

}

/* Use only values from 0 to 255 to define the duty cycle, 127 generates a duty cycle of 50% */

if (start_pwm (127))

{

close_reg_range

();

printf ("Wrong duty cycle value !\n\n");

return

-1;

}

close_reg_range

();

printf

("\n");

return

0;

}

Advertising
This manual is related to the following products: