diff --git a/libqhy/85-qhyccd.rules b/libqhy/85-qhyccd.rules index 8b467e0f7..cf57a2770 100644 --- a/libqhy/85-qhyccd.rules +++ b/libqhy/85-qhyccd.rules @@ -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}" diff --git a/libqhy/CMakeLists.txt b/libqhy/CMakeLists.txt index 4ed997907..e781ed285 100644 --- a/libqhy/CMakeLists.txt +++ b/libqhy/CMakeLists.txt @@ -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/") diff --git a/libqhy/firmware/QHY1253.img b/libqhy/firmware/QHY1253.img index 950ab1131..5ff5045a3 100644 Binary files a/libqhy/firmware/QHY1253.img and b/libqhy/firmware/QHY1253.img differ diff --git a/libqhy/firmware/QHY268.img b/libqhy/firmware/QHY268.img index eb73b9284..5cc2f2182 100644 Binary files a/libqhy/firmware/QHY268.img and b/libqhy/firmware/QHY268.img differ diff --git a/libqhy/firmware/QHY5III200.img b/libqhy/firmware/QHY5III200.img index 7413a027e..ea05cb8c7 100644 Binary files a/libqhy/firmware/QHY5III200.img and b/libqhy/firmware/QHY5III200.img differ diff --git a/libqhy/firmware/QHY600.img b/libqhy/firmware/QHY600.img index 962b149db..cfa1ccf9c 100644 Binary files a/libqhy/firmware/QHY600.img and b/libqhy/firmware/QHY600.img differ diff --git a/libqhy/firmware/QHY990.img b/libqhy/firmware/QHY990.img index 4ea0655db..f00801123 100644 Binary files a/libqhy/firmware/QHY990.img and b/libqhy/firmware/QHY990.img differ diff --git a/libqhy/firmware/QHY991.img b/libqhy/firmware/QHY991.img index 5f97edd1c..b264c0e1a 100644 Binary files a/libqhy/firmware/QHY991.img and b/libqhy/firmware/QHY991.img differ diff --git a/libqhy/firmware/QHY992.img b/libqhy/firmware/QHY992.img index 0fc284be8..a1573cea8 100644 Binary files a/libqhy/firmware/QHY992.img and b/libqhy/firmware/QHY992.img differ diff --git a/libqhy/libqhyccd.dylib b/libqhy/libqhyccd.dylib index dd2bda52e..089b063ba 100644 Binary files a/libqhy/libqhyccd.dylib and b/libqhy/libqhyccd.dylib differ diff --git a/libqhy/libqhyccd_armv8.bin b/libqhy/libqhyccd_armv8.bin index 003aa88ef..5ed701f8b 100644 Binary files a/libqhy/libqhyccd_armv8.bin and b/libqhy/libqhyccd_armv8.bin differ diff --git a/libqhy/libqhyccd_x86_64.bin b/libqhy/libqhyccd_x86_64.bin index a59d3983b..6d6ac91b5 100644 Binary files a/libqhy/libqhyccd_x86_64.bin and b/libqhy/libqhyccd_x86_64.bin differ diff --git a/libqhy/qhyccd.h b/libqhy/qhyccd.h index dd9deecc5..4982ef717 100644 --- a/libqhy/qhyccd.h +++ b/libqhy/qhyccd.h @@ -4,9 +4,10 @@ #include "qhyccdstruct.h" #include "stdint.h" #include "config.h" +#if __CPP_MODE__ #include #include - +#endif @@ -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 logFunction); +#endif EXPORTC void STDCALL SetQHYCCDBufferNumber(uint32_t BufNumber); #endif @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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); */ @@ -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); @@ -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" @@ -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); diff --git a/libqhy/qhyccdcamdef.h b/libqhy/qhyccdcamdef.h index 6b8f6e114..c2568ff56 100644 --- a/libqhy/qhyccdcamdef.h +++ b/libqhy/qhyccdcamdef.h @@ -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 @@ -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 @@ -1506,6 +1518,8 @@ #define PCIE_CAPTURE_WRITE_C (0x66666665) +#define PCIE_EMMC_WRITE_C (0x00001111) + #define PCIE_DWORD (4) diff --git a/libqhy/qhyccderr.h b/libqhy/qhyccderr.h index 595c4f1cf..9d888dede 100644 --- a/libqhy/qhyccderr.h +++ b/libqhy/qhyccderr.h @@ -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 */ diff --git a/libqhy/qhyccdstruct.h b/libqhy/qhyccdstruct.h index 6b238a73d..ec927d3ae 100644 --- a/libqhy/qhyccdstruct.h +++ b/libqhy/qhyccdstruct.h @@ -9,6 +9,7 @@ #ifndef __QHYCCDSTRUCTDEF_H__ #define __QHYCCDSTRUCTDEF_H__ +#if __CPP_MODE__ #if defined (_WIN32) #ifndef EXPORTFUNC #define EXPORTFUNC extern "C" __declspec(dllexport) @@ -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" @@ -46,6 +64,10 @@ typedef uint64_t QHYDWORD; #endif +/** + * usb vendor request command + */ +#define QHYCCD_REQUEST_RQT 0x00 /** * usb vendor request command