Skip to content
Snippets Groups Projects
Commit d6916cd3 authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

move api headers into own subdirectory

parent be64dbc8
Branches
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ target_link_libraries(${PROJECT_NAME} ${LIBUSB_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${LIBUSB_INCLUDE_DIRS})
add_definitions("-std=c17 -Wall -O2 -fno-strict-aliasing")
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(FILES ./coincellhell.c DESTINATION include)
install(FILES ./coincellhell/coincellhell.h ./coincellhell/usbcommands.h DESTINATION include/${PROJECT_NAME})
link_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(${PROJECT_NAME}_cli main.c)
......@@ -36,12 +36,12 @@ target_link_libraries( ${PROJECT_NAME}_cli ${PROJECT_NAME})
add_definitions("-std=c17 -Wall -O2 -fno-strict-aliasing")
install(TARGETS ${PROJECT_NAME}_cli DESTINATION bin)
configure_file(pkgconfig/eismuliplexer.pc.in pkgconfig/eismuliplexer.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/eismuliplexer.pc DESTINATION lib/pkgconfig)
configure_file(pkgconfig/libcoincellhell.pc.in pkgconfig/libcoincellhell.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libcoincellhell.pc DESTINATION lib/pkgconfig)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/libeismulitplexer.doxygen.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/libeismulitplexer.doxygen)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/libcoincellhell.doxygen.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/libcoincellhell.doxygen)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
......
......@@ -33,7 +33,7 @@
#include <stdio.h>
#include <assert.h>
#include "coincellhell.h"
#include "coincellhell/coincellhell.h"
#include "usbshm.h"
#include "usbcommands.h"
......
......@@ -51,15 +51,24 @@ struct coincellhell
struct heater_state
{
/** true if heater is enabled*/
bool enabled;
/** true if heater is close to its setpoint*/
bool ready;
/** true if heater is currently exectueting a ramp*/
bool ramp;
/** true if the system has detected a fault with this heater*/
bool fault;
/** current command (0-255) that is being sent to the dac for this heater*/
uint8_t dacCommand;
/** current target temperature for this heater*/
float setpoint;
/** if a ramp is currently being executed, its final temperature will be set here*/
float rampTarget;
/** if a ramp is currently being executed, the unix timestamp at which it was started*/
time_t rampStartTime;
/** if a ramp is currently being executed, the unix timestamp at it will complete*/
time_t rampStopTime;
};
......
#pragma once
/**
Api to controll EISmultiplexer devices.
* @addtogroup API User API
* This api allows you to controll the EISmultiplexer device.
* @{
*/
typedef enum {
COMMAND_LED_ON = 0,
COMMAND_LED_OFF,
......@@ -23,3 +30,7 @@ typedef enum {
TEMP_LOCATION_SIDE,
TEMP_LOCATION_INVALID,
} temperature_sensor_location_t;
/*
* @}
*/
......@@ -234,7 +234,8 @@ int usbshm_readControlTransfer(struct usbshm* instance, const uint8_t request, c
libusb_fill_control_setup(instance->priv->buffer, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN,
request, wValue, wIndex, length);
instance->priv->transfer = libusb_alloc_transfer(0);
libusb_fill_control_transfer(instance->priv->transfer, instance->priv->handle, instance->priv->buffer, &usbshm_transferCallBack, instance, 100);
libusb_fill_control_transfer(instance->priv->transfer, instance->priv->handle, instance->priv->buffer,
&usbshm_transferCallBack, instance, 100);
int ret = libusb_submit_transfer(instance->priv->transfer);
pthread_mutex_unlock(libusbDataMutex);
if(ret < 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment