NAME

k8055m_set_output, k8055m_get_output -- Set/get the status of all digital and pwm output ports

LIBRARY

k8055-pic18f access library

SYNOPSIS

#include "k8055m.h"

int
k8055m_set_output(int cardNumber, int digitalMask, int digitalValue, int pwmMask, int pwmValue1, int pwmValue2);

int
k8055m_get_output(int cardNumber, int *digitalValue, int *pwmValue1, int* pwmValue2);
    

DESCRIPTION

With k8055m_set_output() one or more digital and pwm ports can be set at once. Which digital ports are to be changed is specified in the lower 8 bits of digitalMask and their new status or/off is given in the lower 8 bits of digitalValue.. Likewise which pwm ports are affected are specified in the lower 2 bits of pwmMask and their duty cycle in the range of 0 .. 1023 in pwmValue1 and pwmValue2.

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_output() return those initial or the latest requested settings.

RETURN VALUES

k8055m_set_output() and k8055m_get_output() return 0 on success, -1 on error.