NAME

k8055m -- k8055-pic18f access library

LIBRARY

k8055-pic18f access library

SYNOPSIS

#include "k8055m.h"

DESCRIPTION

The k8055-pic18f (K8055M) is a community project based on the original Velleman K8055 USB Experiment Interface Board. The K8055M has the microcontroller replaced with a more modern PIC18F2550/2455 chip and is running an open source firmware.

The API described here does not work with the original K8055 or the newer K8055N boards.

FUNTIONS

int k8055m_init(void) Library initialization.

void k8055m_exit(void) Library cleanup.

char *k8055m_last_error(void) Return a string describing the last error that occured.

int k8055m_card_present(int cardNumber) Determine if card cardNumber is present.

int k8055m_open(int cardNumber) Open card cardNumber

int k8055m_close(int cardNumber) Close card cardNumber

int k8055m_reset(int cardNumber) Restore card to defaults.


int k8055m_set_digital_out_mode(int cardNumber, int port, int mode) Set the output mode of a digital port.

int k8055m_get_digital_out_mode(int cardNumber, int port) Return the current output mode of a digital port.

int k8055m_set_pwm_out_mode(int cardNumber, int port, int mode) Set the output mode of an pwm port.

int k8055m_get_pwm_out_mode(int cardNumber, int port) Return the current output mode of an pwm port.

int k8055m_set_report_interval(int cardNumber, int msMin, int msMax) Set the minimum and maximum HID report interval.

int k8055m_get_report_interval(int cardNumber, int *msMin, int *msMax) Set the minimum and maximum HID report interval.

int k8055m_get_digital_in(int cardNumber, int port) Return the status of a digital input port.

int k8055m_get_digital_in_all(int cardNumber) Return the status of all digital input ports.

int k8055m_get_analog_in(int cardNumber, int port) Return the status of an analog input port.

int k8055m_set_digital_out(int cardNumber, int port, int value) Set/clear a digital output port.

int k8055m_set_digital_out_all(int cardNumber, int mask, int value) Set/clear multiple digital output ports.

int k8055m_get_digital_out(int cardNumber, int port) Return the current setting of a digital output port.

int k8055m_get_digital_out_all(int cardNumber) Return the current setting of all digital output ports.

int k8055m_set_pwm_out(int cardNumber, int port, int value) Set the duty cycle of a pwm output port.

int k8055m_get_pwm_out(int cardNumber, int port) Return the current setting of a pwm output port.

int k8055m_set_output(int cardNumber, int digitalMask, int digitalValue, int pwmMask, int pwmValue1, int pwmValue2) Set/clear multiple digital and pwm output ports.

int k8055m_get_output(int cardNumber, int *digitalValue, int *pwmValue1, int *pwmValue2) Return the current setting of all digital and pwm output ports.

int k8055m_set_counter(int cardNumber, int counter, int value) Set a counter to a specific value.

int k8055m_get_counter(int cardNumber, int counter) Return the current value of a counter.

int k8055m_set_debounce_time(int cardNumber, int counter, int us100) Set the debounce time of a counter.

int k8055m_get_debounce_time(int cardNumber, int counter) Return the current debounce time of a counter.

int k8055m_set_servo(int cardNumber, int port, float pulseWidth, int pulseHigh) Set the pulse width and direction or a digital output port.

int k8055m_get_servo(int cardNumber, int port, float *pulseWidth, int *pulseHigh) Query the pulse width and direction or a digital output port.

int k8055m_set_auto_flush(int cardNumber, int flag) Set/clear the auto-flush feature of a card.

int k8055m_get_auto_flush(int cardNumber) Return the current auto-flush setting of a card.

int k8055m_flush(int cardNumber) Send output port changes to the card when auto-flush is disabled.

int k8055m_query_config1(int cardNumber) Instruct a card to report its current configuration settings.

int k8055m_query_output(int cardNumber) Instruct a card to report its current output port settings.

int k8055m_query_counter_debounce(int cardNumber) Instruct a card to report its current counter debounce settings.

int k8055m_poll(int cardNumber) Wait until a card sent an HID report.

int k8055m_recv(int cardNumber, K8055M_ReportMessage_t *report) Receive the next HID report.

int k8055m_recv_raw(int cardNumber, K8055M_ReportMessage_t *report) Receive the next raw HID report.

int k8055m_send_raw(int cardNumber, K8055M_CommandMessage_t *command) Send a raw HID command.