k8055m_set_digital_out, k8055m_set_digital_out_all, k80ffm_get_digital_out, k8055m_get_digital_out_all -- Set/get the status of one or more digital output ports.
k8055-pic18f access library
#include "k8055m.h" int k8055m_set_digital_out(int cardNumber, int port, int value); int k8055m_set_digital_out_all(int cardNumber, int mask, int value); int k8055m_get_digital_out(int cardNumber, int port); int k8055m_get_digital_out_all(int cardNumber);
k8055m_set_digital_out() turns the specified output port on or off. Digital output
ports are numbered 0 .. 7. This only has an effect if the output port is currently
configured to normal mode. The call is ignored otherwise.
k8055m_set_digital_out_all() sets one or more digital output ports on or off.
Which ports are to be changed is specified in the lower 8 bits of mask and
their new status or/off is given in the lower 8 bits of value.
If the card's auto-flush feature is turned off, then a call to k8055m_set_digital_out()
or k8055m_set_digital_out_all() will not be sent to the card and the resulting
changes will be accumulated until k8055m_flush() is called or the card's auto-flush
feature is enabled.
The k8055-pic18f modified card retains its output port states while the USB is disconnected,
as long as it keeps running on a powered USB hub or similar power supply. k8055m_open()
actually queries the card for its current configuration and output port settings.
k8055m_get_digital_out() and k8055m_get_digital_out_all() return those initial
or the latest requested status.
k8055m_set_digital_out() and k8055m_set_digital_out_all() return 0 on success, -1 on error. k8055m_get_digital_out() and k8055m_get_digital_out_all() return the current output setting or -1 on error.