diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d7eac97 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "liboni"] + path = liboni + url = https://github.com/open-ephys/liboni diff --git a/CMakeLists.txt b/CMakeLists.txt index e6beb36..7e985f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.5.0) + if (NOT DEFINED GUI_BASE_DIR) if (DEFINED ENV{GUI_BASE_DIR}) set(GUI_BASE_DIR $ENV{GUI_BASE_DIR}) @@ -12,12 +13,6 @@ get_filename_component(PLUGIN_NAME ${PROJECT_FOLDER} NAME) project(OE_PLUGIN_${PLUGIN_NAME}) set(CMAKE_SHARED_LIBRARY_PREFIX "") -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(LINUX 1) - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Debug) - endif() -endif() set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS OEPLUGIN @@ -29,7 +24,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:NDEBUG=1> ) - set(SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Source) file(GLOB_RECURSE SRC_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/*.cpp" "${SOURCE_PATH}/*.h") set(GUI_COMMONLIB_DIR ${GUI_BASE_DIR}/installed_libs) @@ -38,11 +32,7 @@ set(CONFIGURATION_FOLDER $<$:Debug>$<$>:Releas list(APPEND CMAKE_PREFIX_PATH ${GUI_COMMONLIB_DIR} ${GUI_COMMONLIB_DIR}/${CONFIGURATION_FOLDER}) -if (APPLE) - add_library(${PLUGIN_NAME} MODULE ${SRC_FILES}) -else() - add_library(${PLUGIN_NAME} SHARED ${SRC_FILES}) -endif() +add_library(${PLUGIN_NAME} SHARED ${SRC_FILES}) target_compile_features(${PLUGIN_NAME} PUBLIC cxx_auto_type cxx_generalized_initializers) target_include_directories(${PLUGIN_NAME} PUBLIC ${GUI_BASE_DIR}/JuceLibraryCode ${GUI_BASE_DIR}/JuceLibraryCode/modules ${GUI_BASE_DIR}/Plugins/Headers ${GUI_COMMONLIB_DIR}/include) @@ -60,30 +50,13 @@ if (NOT CMAKE_LIBRARY_ARCHITECTURE) endif() #Libraries and compiler options -if(MSVC) - target_link_libraries(${PLUGIN_NAME} ${GUI_BIN_DIR}/open-ephys.lib) - target_compile_options(${PLUGIN_NAME} PRIVATE /sdl- /W0) - - install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/plugins CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) - install(FILES $ DESTINATION ${GUI_BIN_DIR}/plugins OPTIONAL) - - set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../libs) -elseif(LINUX) - target_link_libraries(${PLUGIN_NAME} GL X11 Xext Xinerama asound dl freetype pthread rt) - set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS - "-fvisibility=hidden -fPIC -rdynamic -Wl,-rpath,'$$ORIGIN/../shared'") - target_compile_options(${PLUGIN_NAME} PRIVATE -fPIC -rdynamic) - target_compile_options(${PLUGIN_NAME} PRIVATE -O3) #enable optimization for linux debug - - install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/plugins) -elseif(APPLE) - set_target_properties(${PLUGIN_NAME} PROPERTIES BUNDLE TRUE) - set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS - "-undefined dynamic_lookup -rpath @loader_path/../../../../shared") - - install(TARGETS ${PLUGIN_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/plugins-api8) - set(CMAKE_PREFIX_PATH /opt/local) -endif() +target_link_libraries(${PLUGIN_NAME} ${GUI_BIN_DIR}/open-ephys.lib) +target_compile_options(${PLUGIN_NAME} PRIVATE /sdl- /W0 /MP) + +install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/plugins CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) +install(FILES $ DESTINATION ${GUI_BIN_DIR}/plugins OPTIONAL) + +set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../libs) #create filters for vs and xcode @@ -94,22 +67,71 @@ foreach( src_file IN ITEMS ${SRC_FILES}) source_group("${group_name}" FILES "${src_file}") endforeach() -#additional libraries, if needed -set(LIBONI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI) -target_include_directories(${PLUGIN_NAME} PRIVATE ${LIBONI_DIR}/include) - -if (MSVC) - set(LIBONI_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI/win64) - target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/liboni.lib") - target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/riffa.lib") - target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/onidriver_riffa.lib") - install(DIRECTORY ${LIBONI_LIB_DIR}/ DESTINATION ${GUI_BIN_DIR}/shared FILES_MATCHING PATTERN "*.dll") -elseif(LINUX) - find_library(LIBONI_LIBRARIES oni liboni PATHS ${CMAKE_CURRENT_SOURCE_DIR}/libONI/linux) - target_link_libraries(${PLUGIN_NAME} ${LIBONI_LIBRARIES}) - install(DIRECTORY ${LIBONI_DIR}/linux/ DESTINATION ${GUI_BIN_DIR}/shared FILES_MATCHING PATTERN "*.so") -elseif(APPLE) - set(LIBONI_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI/osx) - target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/liboni.dylib") - install(FILES ${LIBONI_LIB_DIR}/liboni.dylib DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api8) -endif() + +function(vs_set_all_configurations target_name target_config_name) + foreach(config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${config} config_upper) + set_property( + TARGET ${target_name} + APPEND PROPERTY MAP_IMPORTED_CONFIG_${config_upper} "${target_config_name}" + ) + endforeach() +endfunction() + + +# add liboni project + +set(LIBONI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/liboni/api/liboni") +set(LIBONI_NAME liboni) +set(LIBONI_PNAME "submodule_${LIBONI_NAME}") + +include_external_msproject ( + ${LIBONI_PNAME} + "${LIBONI_DIR}/liboni.vcxproj" + PLATFORM ${CMAKE_LIBRARY_ARCHITECTURE} +) + +vs_set_all_configurations(${LIBONI_PNAME} "ReleaseStatic") + +add_library("${LIBONI_NAME}" STATIC IMPORTED) +set_target_properties("${LIBONI_NAME}" PROPERTIES + IMPORTED_LOCATION "${LIBONI_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/ReleaseStatic/liboni.lib" + INTERFACE_INCLUDE_DIRECTORIES "${LIBONI_DIR}") + +add_dependencies(${LIBONI_NAME} ${LIBONI_PNAME}) +target_link_libraries(${PLUGIN_NAME} "${LIBONI_NAME}") + +# add riffa project + +set(RIFFA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/liboni/drivers/riffa/windows/lib") +set(RIFFA_NAME riffa) +set(RIFFA_PNAME "submodule_${RIFFA_NAME}") + +include_external_msproject ( + ${RIFFA_PNAME} + "${RIFFA_DIR}/riffa.vcxproj" + PLATFORM ${CMAKE_LIBRARY_ARCHITECTURE} +) + +vs_set_all_configurations(${RIFFA_PNAME} "Release") + +# add onidriver_riffa project + +set(ONIDRIVER_RIFFA_DIR "${LIBONI_DIR}/drivers/riffa") +set(ONIDRIVER_RIFFA_NAME libonidriver_riffa) +set(ONIDRIVER_RIFFA_PNAME "submodule_${ONIDRIVER_RIFFA_NAME}") + +include_external_msproject ( + ${ONIDRIVER_RIFFA_PNAME} + "${ONIDRIVER_RIFFA_DIR}/onidriver_riffa.vcxproj" + PLATFORM ${CMAKE_LIBRARY_ARCHITECTURE} +) + +vs_set_all_configurations(${ONIDRIVER_RIFFA_PNAME} "Release") + + +add_dependencies(${ONIDRIVER_RIFFA_PNAME} ${RIFFA_PNAME}) + +# Ensure needed DLLs are installed to the shared folder + +install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/$/riffa.dll" "${CMAKE_BINARY_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/$/${ONIDRIVER_RIFFA_NAME}.dll" DESTINATION ${GUI_BIN_DIR}/shared) diff --git a/README.md b/README.md index 0a64f7f..a4cc210 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,16 @@ Code │ └── ... ``` +To get a fresh install of the repository, use `git clone --recurse-submodules` to fetch the submodule as well. + +For existing clones of the repo, run `git submodule update --init --recursive` to initialize the submodule and update it simultaneously. + ### Windows **Requirements:** [Visual Studio](https://visualstudio.microsoft.com/) and [CMake](https://cmake.org/install/) +#### Create OnixSource project using CMAKE + From the `Build` directory, enter: ```bash @@ -42,38 +48,4 @@ cmake -G "Visual Studio 17 2022" -A x64 .. Next, launch Visual Studio and open the `OE_PLUGIN_onix-source.sln` file that was just created. Select the appropriate configuration (Debug/Release) and build the solution. Selecting the `INSTALL` project and manually building it will copy the `.dll` and any other required files into the GUI's `plugins` directory. The next time you launch the GUI from Visual Studio, the ONIX Source plugin should be available. - - -### Linux - -**Requirements:** [CMake](https://cmake.org/install/) - -From the `Build` directory, enter: - -```bash -cmake -G "Unix Makefiles" .. -cd Debug -make -j -make install -``` - -This will build the plugin and copy the `.so` file into the GUI's `plugins` directory. The next time you launch the compiled version of the GUI, the ONIX Source plugin should be available. - - -### macOS - -**Requirements:** [Xcode](https://developer.apple.com/xcode/) and [CMake](https://cmake.org/install/) - -From the `Build` directory, enter: - -```bash -cmake -G "Xcode" .. -``` - -Next, launch Xcode and open the `onix-source.xcodeproj` file that now lives in the “Build” directory. - -Running the `ALL_BUILD` scheme will compile the plugin; running the `INSTALL` scheme will install the `.bundle` file to `/Users//Library/Application Support/open-ephys/plugins-api8`. the ONIX Source plugin should be available the next time you launch the GUI from Xcode. - - - diff --git a/libONI/include/oni.h b/libONI/include/oni.h deleted file mode 100644 index 05521fe..0000000 --- a/libONI/include/oni.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ONI_H__ -#define __ONI_H__ - -// Version macros for compile-time API version detection -// NB: see https://semver.org/ -#define ONI_VERSION_MAJOR 4 -#define ONI_VERSION_MINOR 3 -#define ONI_VERSION_PATCH 5 - -#define ONI_MAKE_VERSION(major, minor, patch) \ - ((major) * 10000 + (minor) * 100 + (patch)) -#define ONI_VERSION \ - ONI_MAKE_VERSION(ONI_VERSION_MAJOR, ONI_VERSION_MINOR, ONI_VERSION_PATCH) - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -// OS-specific definitions -#ifdef _WIN32 -#ifdef LIBONI_EXPORTS -#define ONI_EXPORT __declspec(dllexport) -#else -#define ONI_EXPORT -#endif -#else -#define ONI_EXPORT -#endif - -#include "onidefs.h" - -// Acquisition context -typedef struct oni_ctx_impl *oni_ctx; - -// Device type -typedef struct { - // NB: Block read so don't change order - oni_size_t idx; // Complete rsv.rsv.hub.idx device table index - oni_dev_id_t id; // Device ID number - oni_size_t version; // Device firmware version - oni_size_t read_size; // Device data read size per frame in bytes - oni_size_t write_size; // Device data write size per frame in bytes - -} oni_device_t; - -// Frame type -typedef struct { - const oni_fifo_time_t time; // Frame time (ACQCLKHZ) - const oni_fifo_dat_t dev_idx; // Device index that produced or accepts the frame - const oni_fifo_dat_t data_sz; // Size in bytes of data buffer - char *data; // Raw data block - -} oni_frame_t; - -// Context management -ONI_EXPORT oni_ctx oni_create_ctx(const char *drv_name); -ONI_EXPORT int oni_init_ctx(oni_ctx ctx, int host_idx); -ONI_EXPORT int oni_destroy_ctx(oni_ctx ctx); - -// Context option getting/setting -ONI_EXPORT int oni_get_opt(const oni_ctx ctx, int ctx_opt, void *value, size_t *size); -ONI_EXPORT int oni_set_opt(oni_ctx ctx, int ctx_opt, const void *value, size_t size); - -// Driver option getting/setting -ONI_EXPORT int oni_get_driver_opt(const oni_ctx ctx, int drv_opt, void *value, size_t *size); -ONI_EXPORT int oni_set_driver_opt(oni_ctx ctx, int drv_opt, const void *value, size_t size); - -// Hardware inspection, manipulation, and IO -ONI_EXPORT int oni_read_reg(const oni_ctx ctx, oni_dev_idx_t dev_idx, oni_reg_addr_t addr, oni_reg_val_t *value); -ONI_EXPORT int oni_write_reg(const oni_ctx ctx, oni_dev_idx_t dev_idx, oni_reg_addr_t addr, oni_reg_val_t value); -ONI_EXPORT int oni_read_frame(const oni_ctx ctx, oni_frame_t **frame); -ONI_EXPORT int oni_create_frame(const oni_ctx ctx, oni_frame_t **frame, oni_dev_idx_t dev_idx, void *data, size_t data_sz); -ONI_EXPORT int oni_write_frame(const oni_ctx ctx, const oni_frame_t *frame); -ONI_EXPORT void oni_destroy_frame(oni_frame_t *frame); - -// Helpers -ONI_EXPORT void oni_version(int *major, int *minor, int *patch); -ONI_EXPORT const char *oni_error_str(int err); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libONI/include/onidefs.h b/libONI/include/onidefs.h deleted file mode 100644 index 147a02f..0000000 --- a/libONI/include/onidefs.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef __ONI_DEFS_H__ -#define __ONI_DEFS_H__ -#include - -// Frame header size in bytes -// NB: Header is [dev_idx, data_sz, time] -#define ONI_FRAMEHEADERSZ 2 * sizeof(oni_fifo_dat_t) + sizeof(oni_fifo_time_t) - -// Context options -enum { - ONI_OPT_DEVICETABLE = 0, - ONI_OPT_NUMDEVICES, - ONI_OPT_RUNNING, - ONI_OPT_RESET, - ONI_OPT_SYSCLKHZ, - ONI_OPT_ACQCLKHZ, - ONI_OPT_RESETACQCOUNTER, - ONI_OPT_HWADDRESS, - ONI_OPT_MAXREADFRAMESIZE, - ONI_OPT_MAXWRITEFRAMESIZE, - ONI_OPT_BLOCKREADSIZE, - ONI_OPT_BLOCKWRITESIZE, - ONI_OPT_CUSTOMBEGIN, -}; - -// NB: If you add an error here, make sure to update oni_error_str() in oni.c -enum { - ONI_ESUCCESS = 0, // Success - ONI_EPATHINVALID = -1, // Invalid stream path, fail on open - ONI_EDEVID = -2, // Invalid device ID - ONI_EDEVIDX = -3, // Invalid device index - ONI_EWRITESIZE = -4, // Data size is not an integer multiple of the write size for the designated device - ONI_EREADFAILURE = -5, // Failure to read from a stream/register - ONI_EWRITEFAILURE = -6, // Failure to write to a stream/register - ONI_ENULLCTX = -7, // Attempt to use a NULL context - ONI_ESEEKFAILURE = -8, // Failure to seek on stream - ONI_EINVALSTATE = -9, // Invalid operation for the current context run state - ONI_EINVALOPT = -10, // Invalid context option - ONI_EINVALARG = -11, // Invalid function arguments - ONI_ECOBSPACK = -12, // Invalid COBS packet - ONI_ERETRIG = -13, // Attempt to trigger an already triggered operation - ONI_EBUFFERSIZE = -14, // Supplied buffer is too small - ONI_EBADDEVTABLE = -15, // Badly formatted device table supplied by firmware - ONI_EBADALLOC = -16, // Bad dynamic memory allocation - ONI_ECLOSEFAIL = -17, // File descriptor close failure, check errno - ONI_EREADONLY = -18, // Attempted write to read only object (register, context option, etc) - ONI_EUNIMPL = -19, // Specified, but unimplemented, feature - ONI_EINVALREADSIZE = -20, // Block read size is smaller than the maximal read frame size - ONI_ENOREADDEV = -21, // Frame read attempted when there are no readable devices in the device table - ONI_EINIT = -22, // Hardware initialization failed - ONI_EWRITEONLY = -23, // Attempted to read from a write only object (register, context option, etc) - ONI_EINVALWRITESIZE = -24, // Write buffer pre-allocation size is smaller than the maximal write frame size - ONI_ENOTWRITEDEV = -25, // Frame allocation attempted for a non-writable device - ONI_EDEVIDXREPEAT = -26, // Device table contains repeated device indices - ONI_EPROTCONFIG = -27, // Attempted to directly read or write a protected configuration option - - // NB: Always at bottom - ONI_MINERRORNUM = -28 -}; - -// Registers available in the specification -typedef enum { - ONI_CONFIG_DEV_IDX = 0, - ONI_CONFIG_REG_ADDR, - ONI_CONFIG_REG_VALUE, - ONI_CONFIG_RW, - ONI_CONFIG_TRIG, - ONI_CONFIG_RUNNING, - ONI_CONFIG_RESET, - ONI_CONFIG_SYSCLKHZ, - ONI_CONFIG_ACQCLKHZ, - ONI_CONFIG_RESETACQCOUNTER, - ONI_CONFIG_HWADDRESS, - ONI_CONFIG_CUSTOMBEGIN, -} oni_config_t; - -// Fixed width device types -// TODO: I feel like oni.h and onidefs.h should only deal with standard signed -// or unsigned integer types and it should be the drivers' job to translate -// these to fixed width integers instead of having these typedefs -typedef uint32_t oni_size_t; -typedef uint32_t oni_dev_id_t; // Device IDs are 32-bit numbers -typedef uint32_t oni_dev_idx_t; // Device idx are 32-bit, byte.byte.btye.byte addresses -typedef uint32_t oni_reg_addr_t; // Registers use a 32-bit address -typedef uint32_t oni_reg_val_t; // Registers have 32-bit values -typedef uint32_t oni_fifo_dat_t; // FIFOs use 32-bit words; // TODO: find a way to remove -typedef uint64_t oni_fifo_time_t; // FIFO bound timers use 64-bit words; // TODO: find a way to remove - -#define BYTE_TO_FIFO_SHIFT 2; // TODO: find a way to remove - -// Register size -#define ONI_REGSZ sizeof(oni_reg_val_t) - -#endif diff --git a/libONI/include/onidriver.h b/libONI/include/onidriver.h deleted file mode 100644 index 9b28306..0000000 --- a/libONI/include/onidriver.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __ONI_DRIVER_H__ -#define __ONI_DRIVER_H__ - -#include -#include - -#include "onidefs.h" - -// Possible read streams -typedef enum { - ONI_READ_STREAM_DATA = 0, - ONI_READ_STREAM_SIGNAL -} oni_read_stream_t; - -// Possible write streams. -typedef enum { - ONI_WRITE_STREAM_DATA = 0 -} oni_write_stream_t; - -// Generic pointer for driver-specific options -typedef void *oni_driver_ctx; - -// Prototype functions for drivers. Every driver has to implement these -#ifndef ONI_DRIVER_IGNORE_FUNCTION_PROTOTYPES // For use only for including in the main library driver loader -#ifdef _WIN32 -#define ONI_DRIVER_EXPORT __declspec(dllexport) -#else -#define ONI_DRIVER_EXPORT -#endif - -ONI_DRIVER_EXPORT oni_driver_ctx oni_driver_create_ctx(); -ONI_DRIVER_EXPORT int oni_driver_destroy_ctx(oni_driver_ctx); - -// Initialize driver. Argument is the host device index -ONI_DRIVER_EXPORT int oni_driver_init(oni_driver_ctx driver_ctx, int host_idx); -ONI_DRIVER_EXPORT int oni_driver_read_stream(oni_driver_ctx driver_ctx, oni_read_stream_t stream, void *data, size_t size); -ONI_DRIVER_EXPORT int oni_driver_write_stream(oni_driver_ctx driver_ctx, oni_write_stream_t stream, const char *data, size_t size); -ONI_DRIVER_EXPORT int oni_driver_read_config(oni_driver_ctx driver_ctx, oni_config_t config, oni_reg_val_t *value); -ONI_DRIVER_EXPORT int oni_driver_write_config(oni_driver_ctx driver_ctx, oni_config_t config, oni_reg_val_t value); - -// This gets called when oni_set_opt is called. This method does not need to -// perform any configuration but it is provided for the driver to do some -// internal adjustments if required -ONI_DRIVER_EXPORT int oni_driver_set_opt_callback(oni_driver_ctx driver_ctx, int oni_option, const void *value, size_t option_len); - -// Functions to get and set set driver-specific options. This kind of optiosn -// must be avoided when necessary to allow for a general interface -ONI_DRIVER_EXPORT int oni_driver_set_opt(oni_driver_ctx driver_ctx, int driver_option, const void *value, size_t option_len); -ONI_DRIVER_EXPORT int oni_driver_get_opt(oni_driver_ctx driver_ctx, int driver_option, void *value, size_t* option_len); - -// Get a string identifying the driver -ONI_DRIVER_EXPORT const oni_driver_info_t *oni_driver_info(); - -#endif - -#endif diff --git a/libONI/include/onix.h b/libONI/include/onix.h deleted file mode 100644 index b2e616c..0000000 --- a/libONI/include/onix.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef __ONIX_H__ -#define __ONIX_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _WIN32 -#define ONI_EXPORT __declspec(dllexport) -#else -#define ONI_EXPORT -#endif - -// NB: Device IDs are 32-bit integers with the following format: -// Reserved(8-bit).Company(8-bit).Device(16-bit) -// NB: If you add a device here, make sure to update oni_device_str(). -enum { - ONIX_NULL = 0, // Placeholder device - ONIX_INFO = 1, // Virtual device that provides status and error information - ONIX_RHD2132 = 2, // Intan RHD2132 bioamplifier - ONIX_RHD2164 = 3, // Intan RHD2162 bioamplifier - ONIX_ESTIM = 4, // Electrical stimulation subcircuit - ONIX_OSTIM = 5, // Optical stimulation subcircuit - ONIX_TS4231 = 6, // Triad semiconductor TS421 optical to digital converter - ONIX_DINPUT32 = 7, // 32-bit digital input port - ONIX_DOUTPUT32 = 8, // 32-bit digital output port - ONIX_BNO055 = 9, // BNO055 9-DOF IMU - ONIX_TEST0 = 10, // A test device used for debugging - ONIX_NEUROPIX1R0 = 11, // Neuropixels 1.0 - ONIX_HEARTBEAT = 12, // Host heartbeat - ONIX_AD51X2 = 13, // AD51X2 digital potentiometer - ONIX_FMCVCTRL = 14, // Open Ephys FMC Host Board rev. 1.3 link voltage control subcircuit - ONIX_AD7617 = 15, // AD7617 ADC/DAS - ONIX_AD576X = 16, // AD576X DAC - ONIX_TESTREG0 = 17, // A test device used for testing remote register programming - ONIX_BREAKDIG1R3 = 18, // Open Ephys Breakout Board rev. 1.3 digital and user IO - ONIX_FMCCLKIN1R3 = 19, // Open Ephys FMC Host Board rev. 1.3 clock input subcircuit - ONIX_FMCCLKOUT1R3 = 20, // Open Ephys FMC Host Board rev. 1.3 clock output subcircuit - ONIX_TS4231V2ARR = 21, // Triad semiconductor TS421 optical to digital converter array targeting V2 base-stations - ONIX_FMCANALOG1R3 = 22, // Open Ephys FMC Host Board rev. 1.3 analog IO subcircuit - ONIX_FMCLINKCTRL = 23, // Open Ephys FMC Host Board coaxial headstage link control circuit - ONIX_DS90UB9RAW = 24, // Raw DS90UB9x deserializer - ONIX_TS4231V1ARR = 25, // Triad semiconductor TS421 optical to digital converter array targeting V1 base-stations - ONIX_MAX10ADCCORE = 26, // Max10 internal ADC device - ONIX_LOADTEST = 27, // Variable load testing device - ONIX_MEMUSAGE = 28, // Acquisition hardware buffer usage reporting device - // Accidentally skipped - ONIX_HARPSYNCINPUT = 30, // Harp synchronization data input device - ONIX_RHS2116 = 31, // Intan RHS2116 bioamplifier and stimulator - ONIX_RHS2116TRIGGER = 32, // Multi Intan RHS2116 stimulation trigger - ONIX_NRIC1384 = 33 // IMEC NRIC1384 384-channel bioaquisition chip -}; - -// Each hub has a "hidden" information device with a fixed device index and -// several read only registers -#define ONIX_HUB_DEV_IDX 254 // Device index - -// Hub device register addresses -enum { - ONIX_HUB_HARDWAREID = 0, // Hub hardware ID - ONIX_HUB_HARDWAREREV = 1, // Hub hardware revision - ONIX_HUB_FIRMWAREVER = 2, // Hub firmware version - ONIX_HUB_CLKRATEHZ = 4, // Hub clock rate in Hz - ONIX_HUB_DELAYNS = 5, // Hub to host transmission delay in nanoseconds -}; - -// NB: Hub IDs are 32-bit integers that uniquely identify the hub. They have the folowing format: -// Reserved(8-bit).Company(8-bit).Hub(16-bit) -// NB: If you add a hub here, make sure to update oni_hub_str(). -enum { - ONIX_HUB_NULL = 0, // Placeholder hub - ONIX_HUB_FMCHOST = 1, // Open Ephys FMC host - ONIX_HUB_HS64 = 2, // Open Ephys headstage-64 - ONIX_HUB_HSNP = 3, // Open Ephys headstage-neuropix1 - ONIX_HUB_HSRHS2116 = 4, // Open Ephys headstage-rhs2116 - ONIX_HUB_HS64S = 5, // Open Ephys headstage-64s - ONIX_HUB_HSNP1ET = 6, // Open Ephys headstage-neuropix1e-te - ONIX_HUB_HSNP2EB = 7, // Open Ephys headstage-neuropix2e-beta - ONIX_HUB_HSNP2E = 8, // Open Ephys headstage-neuropix2e - ONIX_HUB_HSNRIC1384 = 9, // Open Ephys headstage-nric1384 - ONIX_HUB_HSNP1EH = 10, // Open Ephys headstage-neuropix1e-hirose - ONIX_HUB_RHYTHM = 11 // Open Ephys Acquisition Board Rhythm wrapper - -}; - -// ONIX Specific configuration registers -enum { - ONIX_OPT_PASSTHROUGH = ONI_OPT_CUSTOMBEGIN, -}; - -// Human readable strings from IDs -ONI_EXPORT const char *onix_device_str(int dev_id); -ONI_EXPORT const char *onix_hub_str(int hub_hardware_id); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libONI/linux/liboni.so b/libONI/linux/liboni.so deleted file mode 100644 index a5e163d..0000000 Binary files a/libONI/linux/liboni.so and /dev/null differ diff --git a/libONI/osx/liboni.dylib b/libONI/osx/liboni.dylib deleted file mode 100644 index cbc38e4..0000000 Binary files a/libONI/osx/liboni.dylib and /dev/null differ diff --git a/libONI/win64/liboni.dll b/libONI/win64/liboni.dll deleted file mode 100644 index 7ecaa57..0000000 Binary files a/libONI/win64/liboni.dll and /dev/null differ diff --git a/libONI/win64/liboni.lib b/libONI/win64/liboni.lib deleted file mode 100644 index 09c1d6f..0000000 Binary files a/libONI/win64/liboni.lib and /dev/null differ diff --git a/libONI/win64/libonidriver_riffa.dll b/libONI/win64/libonidriver_riffa.dll deleted file mode 100644 index 44d21e2..0000000 Binary files a/libONI/win64/libonidriver_riffa.dll and /dev/null differ diff --git a/libONI/win64/onidriver_riffa.lib b/libONI/win64/onidriver_riffa.lib deleted file mode 100644 index 3953b25..0000000 Binary files a/libONI/win64/onidriver_riffa.lib and /dev/null differ diff --git a/libONI/win64/riffa.dll b/libONI/win64/riffa.dll deleted file mode 100644 index 9966d5e..0000000 Binary files a/libONI/win64/riffa.dll and /dev/null differ diff --git a/libONI/win64/riffa.lib b/libONI/win64/riffa.lib deleted file mode 100644 index 20b004b..0000000 Binary files a/libONI/win64/riffa.lib and /dev/null differ diff --git a/liboni b/liboni new file mode 160000 index 0000000..9c73bbb --- /dev/null +++ b/liboni @@ -0,0 +1 @@ +Subproject commit 9c73bbb3b05461b30e01d43f9fc37994f696357e