generated from thinkode/modelRepository
resolved: activating/deactivating peripherals
This commit is contained in:
19
hardware/cpp/include/detectFTDIBridge.h
Normal file
19
hardware/cpp/include/detectFTDIBridge.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char* serialNumber;
|
||||
char* description;
|
||||
int isOpen;
|
||||
} FTDIPeripheralC;
|
||||
|
||||
int get_peripherals_number();
|
||||
void get_ftdi_devices(FTDIPeripheralC* devices, int count);
|
||||
void free_ftdi_device(FTDIPeripheralC* device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,15 +1,30 @@
|
||||
// Declare the C++ function from the shared library
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
DMX_OK,
|
||||
DMX_CHANNEL_TOO_LOW_ERROR,
|
||||
DMX_CHANNEL_TOO_HIGH_ERROR,
|
||||
DMX_VALUE_TOO_LOW_ERROR,
|
||||
DMX_VALUE_TOO_HIGH_ERROR,
|
||||
DMX_OPEN_ERROR,
|
||||
DMX_SET_BAUDRATE_ERROR,
|
||||
DMX_SET_DATA_CHARACTERISTICS_ERROR,
|
||||
DMX_SET_FLOW_ERROR,
|
||||
DMX_UNKNOWN_ERROR
|
||||
} DMXError;
|
||||
|
||||
typedef void DMXDevice;
|
||||
|
||||
extern DMXDevice* dmx_create();
|
||||
|
||||
extern void* dmx_destroy(DMXDevice* dev);
|
||||
|
||||
extern bool dmx_connect(DMXDevice* dev);
|
||||
extern DMXError dmx_connect(DMXDevice* dev, char* serialNumber);
|
||||
|
||||
extern void dmx_activate(DMXDevice* dev);
|
||||
extern DMXError dmx_activate(DMXDevice* dev);
|
||||
|
||||
extern void dmx_deactivate(DMXDevice* dev);
|
||||
extern DMXError dmx_deactivate(DMXDevice* dev);
|
||||
|
||||
extern void dmx_setValue(DMXDevice* dev, int channel, int value);
|
||||
extern DMXError dmx_setValue(DMXDevice* dev, uint16_t channel, uint8_t value);
|
||||
Reference in New Issue
Block a user