Skip to content

Commit

Permalink
QHYSDK v24.11.03
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Nov 3, 2024
1 parent a3fb055 commit bfb7af8
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 7 deletions.
1 change: 1 addition & 0 deletions libqhy/85-qhyccd.rules
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0415", RUN+="/sbin/fxload -t fx3 -I
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0200", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY5III200.img -D $env{DEVNAME}"
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0585", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY5III585.img -D $env{DEVNAME}"
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0678", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY5III678.img -D $env{DEVNAME}"
ATTRS{idVendor}=="19b4", ATTRS{idProduct}=="0677", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/Origin678.img -D $env{DEVNAME}"
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0715", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY5III715.img -D $env{DEVNAME}"
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0568", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY5III568.img -D $env{DEVNAME}"
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0587", RUN+="/sbin/fxload -t fx3 -I /lib/firmware/qhy/miniCam8.img -D $env{DEVNAME}"
Expand Down
4 changes: 2 additions & 2 deletions libqhy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project (libqhy)

# QHY SDK 24.07.29
set (LIBQHY_VERSION "24.7.29")
# QHY SDK 24.11.03
set (LIBQHY_VERSION "24.11.3")
set (LIBQHY_SOVERSION "20")

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
Expand Down
Binary file modified libqhy/firmware/QHY1253.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY268.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY5III200.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY600.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY990.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY991.img
Binary file not shown.
Binary file modified libqhy/firmware/QHY992.img
Binary file not shown.
Binary file modified libqhy/libqhyccd.dylib
Binary file not shown.
Binary file modified libqhy/libqhyccd_armv8.bin
Binary file not shown.
Binary file modified libqhy/libqhyccd_x86_64.bin
Binary file not shown.
54 changes: 49 additions & 5 deletions libqhy/qhyccd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#include "qhyccdstruct.h"
#include "stdint.h"
#include "config.h"
#if __CPP_MODE__
#include <functional>
#include <string>

#endif



Expand All @@ -28,7 +29,9 @@ EXPORTC void STDCALL SetQHYCCDLogLevel(uint8_t logLevel);

#if (defined(__linux__ )&&!defined (__ANDROID__)) ||(defined (__APPLE__)&&defined( __MACH__)) ||(defined(__linux__ )&&defined (__ANDROID__))

#if __CPP_MODE__
EXPORTC void STDCALL SetQHYCCDLogFunction(std::function<void(const std::string &message)> logFunction);
#endif
EXPORTC void STDCALL SetQHYCCDBufferNumber(uint32_t BufNumber);

#endif
Expand Down Expand Up @@ -148,7 +151,11 @@ EXPORTC uint32_t STDCALL InitQHYCCD(qhyccd_handle *handle);
on do not have,return QHYCCD_ERROR_NOTSUPPORT \n
another QHYCCD_ERROR code on other failures
*/
#if __CPP_MODE__
EXPORTC uint32_t STDCALL IsQHYCCDControlAvailable(qhyccd_handle *handle,CONTROL_ID controlId);
#else
EXPORTC uint32_t STDCALL IsQHYCCDControlAvailable(qhyccd_handle *handle,int controlId);
#endif

/** @fn uint32_t GetQHYCCDControlName(qhyccd_handle *handle,CONTROL_ID controlId,char *IDname)
@brief get the specified ControlName from camera
Expand All @@ -160,7 +167,11 @@ EXPORTC uint32_t STDCALL IsQHYCCDControlAvailable(qhyccd_handle *handle,CONTROL_
on do not have,return QHYCCD_ERROR_NOTSUPPORT \n
another QHYCCD_ERROR code on other failures
*/
#if __CPP_MODE__
EXPORTC uint32_t STDCALL GetQHYCCDControlName(qhyccd_handle *handle,CONTROL_ID controlId,char *IDname);
#else
EXPORTC uint32_t STDCALL GetQHYCCDControlName(qhyccd_handle *handle,int controlId,char *IDname);
#endif

/** \fn uint32_t SetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId,double value)
\brief set params to camera
Expand All @@ -173,8 +184,11 @@ EXPORTC uint32_t STDCALL GetQHYCCDControlName(qhyccd_handle *handle,CONTROL_ID c
QHYCCD_ERROR_SETPARAMS,if set params to camera failed \n
another QHYCCD_ERROR code on other failures
*/

#if __CPP_MODE__
EXPORTC uint32_t STDCALL SetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId, double value);
#else
EXPORTC uint32_t STDCALL SetQHYCCDParam(qhyccd_handle *handle,int controlId, double value);
#endif

/** \fn double GetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId)
\brief get the params value from camera
Expand All @@ -186,7 +200,11 @@ EXPORTC uint32_t STDCALL SetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID control
QHYCCD_ERROR_GETPARAMS,if get camera params'value failed \n
another QHYCCD_ERROR code on other failures
*/
#if __CPP_MODE__
EXPORTC double STDCALL GetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId);
#else
EXPORTC double STDCALL GetQHYCCDParam(qhyccd_handle *handle,int controlId);
#endif

/** \fn uint32_t GetQHYCCDParamMinMaxStep(qhyccd_handle *handle,CONTROL_ID controlId,double *min,double *max,double *step)
\brief get the params value from camera
Expand All @@ -200,7 +218,11 @@ EXPORTC double STDCALL GetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId
QHYCCD_ERROR_NOTSUPPORT,if the camera do not have the function \n
another QHYCCD_ERROR code on other failures
*/
#if __CPP_MODE__
EXPORTC uint32_t STDCALL GetQHYCCDParamMinMaxStep(qhyccd_handle *handle,CONTROL_ID controlId,double *min,double *max,double *step);
#else
EXPORTC uint32_t STDCALL GetQHYCCDParamMinMaxStep(qhyccd_handle *handle,int controlId,double *min,double *max,double *step);
#endif

/** @fn uint32_t SetQHYCCDResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
@brief set camera ouput resolution
Expand Down Expand Up @@ -808,9 +830,15 @@ EXPORTC uint32_t STDCALL SetQHYCCDReadMode(qhyccd_handle *h,uint32_t modeNumber)
// Get the read mode
EXPORTC uint32_t STDCALL GetQHYCCDReadMode(qhyccd_handle *h,uint32_t* modeNumber);

#if __CPP_MODE__
EXPORTC uint32_t STDCALL GetQHYCCDBeforeOpenParam(
QHYCamMinMaxStepValue *p,
CONTROL_ID controlId);
#else
EXPORTC uint32_t STDCALL GetQHYCCDBeforeOpenParam(
QHYCamMinMaxStepValue *p,
int controlId);
#endif
/*
EXPORTC uint32_t STDCALL GetQHYCCDBeforeOpenReadMode(QHYCamReadModeInfo *p);
*/
Expand Down Expand Up @@ -936,12 +964,17 @@ EXPORTFUNC void STDCALL QHYCCDResetFlashULVOError(qhyccd_handle *handle);
EXPORTFUNC void STDCALL QHYCCDTestFlashULVOError(qhyccd_handle *handle);
EXPORTFUNC void STDCALL QHYCCDSetFlashInitPWM(qhyccd_handle *handle,uint8_t pwm);
EXPORTFUNC void STDCALL QHYCCDGetDebugDataD3(qhyccd_handle *handle, char* debugData_raw64);
#if __CPP_MODE__
EXPORTFUNC uint32_t STDCALL QHYCCDSolve(int timeout_s, float scale_l, float scale_h,float center_ra, float center_dec,float center_r, float& s_ra, float& s_dec,float& s_size_x,float& s_size_y, float& s_rotation);
EXPORTFUNC void STDCALL QHYCCDEqualizeHistogram(uint8_t * pdata, int width, int height, int bpp);
void QHYCCDGetDebugControlID(CONTROL_ID controlId, bool hasValue, bool isSetValue, double value);
#else
void QHYCCDGetDebugControlID(int controlId, bool hasValue, bool isSetValue, double value);
#endif
EXPORTFUNC void STDCALL QHYCCDEqualizeHistogram(uint8_t * pdata, int width, int height, int bpp);


#if __CPP_MODE__
EXPORTFUNC int STDCALL QHYCCD_fpga_list(struct fpga_info_list &list);
#endif
EXPORTFUNC uint32_t STDCALL QHYCCD_fpga_open(int id);
EXPORTFUNC void STDCALL QHYCCD_fpga_close();
EXPORTFUNC int STDCALL QHYCCD_fpga_send(int chnl, void * data, int len, int destoff, int last, uint64_t timeout);
Expand All @@ -960,6 +993,15 @@ EXPORTFUNC uint32_t STDCALL GetQHYCCDSensorName(qhyccd_handle *handle, char *nam
EXPORTFUNC uint8_t STDCALL GetCameraIsSuperSpeedFromID(char* id);

EXPORTC void STDCALL EnableSupportOICamera(char* password);

EXPORTC void STDCALL QHYCCDResetEMMC(qhyccd_handle* handle, bool reset);
EXPORTC uint32_t STDCALL QHYCCDReadEMMCState(qhyccd_handle* handle);
EXPORTC uint32_t STDCALL QHYCCDReadEMMCAddress(qhyccd_handle* handle);
EXPORTC uint32_t STDCALL QHYCCDReadEMMCFPGAData(qhyccd_handle* handle, uint32_t* data);
EXPORTC uint32_t STDCALL QHYCCDOpenEMMCMode(qhyccd_handle* handle, bool open);
EXPORTC uint32_t STDCALL QHYCCDReadEMMC(qhyccd_handle* handle, uint32_t address, uint32_t length, unsigned char* buffer);
EXPORTC uint32_t STDCALL QHYCCDWriteEMMC(qhyccd_handle* handle, uint32_t address, uint32_t length, unsigned char* buffer);

#if 0//PCIE_MODE_TEST

#include "riffa.h"
Expand Down Expand Up @@ -1036,7 +1078,9 @@ void call_critical_event_error(qhyccd_handle *h);
EXPORTFUNC void RegisterPnpEventIn( void (*in_pnp_event_in_func)(char *id));
EXPORTFUNC void RegisterPnpEventOut( void (*in_pnp_event_out_func)(char *id));
EXPORTFUNC void RegisterTransferEventError( void (*transfer_event_error_func)());
EXPORTFUNC uint32_t STDCALL PCIEClearDDR(qhyccd_handle *handle);
//EXPORTFUNC uint32_t STDCALL PCIEClearDDR(qhyccd_handle *handle);
EXPORTFUNC void STDCALL SetPCIECardInfo(qhyccd_handle* handle, unsigned char index, unsigned char value);
EXPORTFUNC uint32_t STDCALL PCIEWriteCameraRegister1(qhyccd_handle* handle, unsigned char idx, unsigned char val);
EXPORTFUNC uint32_t STDCALL PCIEWriteCameraRegister2(qhyccd_handle *handle, unsigned char idx, unsigned char val);
EXPORTFUNC uint32_t STDCALL QHYCCD_DbGainToGainValue(qhyccd_handle *h,double dbgain,double *gainvalue);
EXPORTFUNC uint32_t STDCALL QHYCCD_GainValueToDbGain(qhyccd_handle *h,double gainvalue,double *dbgain);
Expand Down
14 changes: 14 additions & 0 deletions libqhy/qhyccdcamdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@

#define DEVICETYPE_QHY600M_C600MC2 4148

#define DEVICETYPE_QHY5III585M 4149
#define DEVICETYPE_QHY661 4150

#define DEVICETYPE_ORIGIN678C 4151
#define DEVICETYPE_ORIGIN678M 4152

#define DEVICETYPE_QHY1920M_OI1920M 4153
#define DEVICETYPE_QHY1920C_OI1920C 4154

/**
* Type define for QHY5IIIEND*/
#define DEVICETYPE_QHY5IIIEND 4999
Expand Down Expand Up @@ -1131,6 +1140,9 @@
#define QHY411_MAX_WIDTH 14304
#define QHY411_MAX_HEIGHT 10748

#define QHY661_MAX_WIDTH 13960
#define QHY661_MAX_HEIGHT 9696

// 10802-92-54=10656 max_y-topBlank-bottomBlank=imageHeight
// 14304-48-48=14208 max_x-leftBlank-rightBlank=imageWidth
// only y-shift is supported by most sensor
Expand Down Expand Up @@ -1506,6 +1518,8 @@

#define PCIE_CAPTURE_WRITE_C (0x66666665)

#define PCIE_EMMC_WRITE_C (0x00001111)


#define PCIE_DWORD (4)

Expand Down
4 changes: 4 additions & 0 deletions libqhy/qhyccderr.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
* Other error */
#define QHYCCD_ERROR 0xFFFFFFFF

#define QHYCCD_ERROR_IMAGESHIFT -2

#define QHYCCD_ERROR_DEVICELOSE -3

#if 0
/**
* There is no camera connected */
Expand Down
22 changes: 22 additions & 0 deletions libqhy/qhyccdstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef __QHYCCDSTRUCTDEF_H__
#define __QHYCCDSTRUCTDEF_H__

#if __CPP_MODE__
#if defined (_WIN32)
#ifndef EXPORTFUNC
#define EXPORTFUNC extern "C" __declspec(dllexport)
Expand All @@ -24,6 +25,23 @@
#define STDCALL
#define EXPORTC extern "C"
#endif
#else
#if defined (_WIN32)
#ifndef EXPORTFUNC
#define EXPORTFUNC
#endif
#ifndef STDCALL
#define STDCALL
#endif
#ifndef EXPORTC
#define EXPORTC
#endif
#else
#define EXPORTFUNC
#define STDCALL
#define EXPORTC
#endif
#endif

#include "stdint.h"

Expand All @@ -46,6 +64,10 @@ typedef uint64_t QHYDWORD;

#endif

/**
* usb vendor request command
*/
#define QHYCCD_REQUEST_RQT 0x00

/**
* usb vendor request command
Expand Down

0 comments on commit bfb7af8

Please sign in to comment.