NAME
k8055m_set_digital_out_mode, k8055m_get_digital_out_mode -- Control or query
the mode of a digital output.
LIBRARY
k8055-pic18f access library
SYNOPSIS
#include "k8055m.h"
int
k8055m_set_digital_out_mode(int cardNumber, int port, int mode);
int
k8055m_get_digital_out_mode(int cardNumber, int port);
DESCRIPTION
k8055m_set_digital_out_mode() is used to set the mode of one of the
8 digital output ports. The possible values for mode are:
- K8055M_DIGITAL_OUT_MODE_NORMAL (0) - The port reacts to the usual k8055m_set_output(), k8055m_set_digital_out() etc.
functions. Each time, the USB host computer needs a change in the logical 0/1 state of the output port,
a USB message needs to be sent to the K8055M board.
- K8055M_DIGITAL_OUT_MODE_SERVO (1) - The port will operate as a standard hobby servo controller.
It will send PWM pulses at a frequency of 40 Hz. The pulse width and direction will be controlled by
the function k8055m_set_servo(). Once this mode and the pulse width are set, the K8055M will
keep emitting 40 pulses per second without further communication from the USB host necessary.
RETURN VALUES
k8055m_set_digital_out_mode() returns 0 on success, -1 on error.
k8055m_get_digital_out_mode() returns the current mode or -1 on error.
SEE ALSO
k8055m_set_servo()