Query: gpiopwm
OS: netbsd
Section: 4
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GPIOPWM(4) BSD Kernel Interfaces Manual GPIOPWM(4)NAMEgpiopwm -- support for pulsing GPIO pins in softwareSYNOPSISgpiopwm* at gpio? offset ? mask 1 gpiopwm* at gpio?DESCRIPTIONThe gpiopwm driver allows for pulsing GPIO pins in software using the callout(9) facility. The pulse frequency and duty cycle are specified indirectly by setting an ``on'' and ``off'' period, in ticks. Both values are accessible as sysctl(3) variables.SYSCTL VARIABLESThe following sysctl(3) variables are used to define the pulsing: hw.gpiopwmN.off Define the ``off'' period in ticks. hw.gpiopwmN.on Define the ``on'' period in ticks. Only when both the ``on'' and the ``off'' period are set to values higher than zero pulsing will start. To stop the pulsing, set either value to zero.EXAMPLESTo pulse a pin on a machine with 100 ticks/second with a frequency of 1Hz and a duty cycle of 20%, the ``on'' period must be set to 20 and the ``off'' period must be set to 80. The following example will pulse the error LED of a Soekris net4801 with a frequency of 1 Hz and a duty cycle of 20%: # gpioctl gpio0 20 set pp # gpioctl gpio0 attach gpiopwm 20 1 # sysctl -w hw.gpiopwm0.off=80 # sysctl -w hw.gpiopwm0.on=20SEE ALSOgpio(4), intro(4), gpioctl(8), sysctl(8)HISTORYThe gpiopwm driver first appeared in NetBSD 6.0.AUTHORSThe gpiopwm driver was written by Marc Balmer <marc@msys.ch>.BSDNovember 13, 2011 BSD