00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _WGE100LIB_H_
00036 #define _WGE100LIB_H_
00037 #include <stdint.h>
00038 #include "list.h"
00039 #include "ipcam_packet.h"
00040
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045
00046
00047
00048
00049 #define WGE100LIB_VERSION_MAJOR 0x01
00050 #define WGE100LIB_VERSION_MINOR 0x05
00051 #define WGE100LIB_VERSION ((WGE100LIB_VERSION_MAJOR <<8) | WGE100LIB_VERSION_MINOR )
00052
00053
00054
00055
00056
00057
00058 #define TRIG_STATE_INTERNAL 0
00059 #define TRIG_STATE_EXTERNAL 1
00060 #define TRIG_STATE_ALTERNATE 4
00061 #define TRIG_STATE_RISING 2
00062
00063
00064
00065
00066 typedef struct
00067 {
00068 size_t width;
00069 size_t height;
00070
00071 uint32_t frame_number;
00072
00073 size_t lastMissingLine;
00074 size_t missingLines;
00075 int shortFrame;
00076
00077 uint8_t *frameData;
00078 PacketEOF *eofInfo;
00079
00080 struct timeval startTime;
00081 } wge100FrameInfo;
00082
00083
00084
00085 int wge100LibVersion( void );
00086
00087 int wge100FindByUrl(const char *url, IpCamList *camera, unsigned wait_us, const char **errmsg);
00088 int wge100Discover(const char *ifName, IpCamList *ipCamList, const char *ipAddress, unsigned wait_us);
00089 int wge100Configure( IpCamList *camInfo, const char *ipAddress, unsigned wait_us);
00090 int wge100StartVid( const IpCamList *camInfo, const uint8_t mac[6], const char *ipAddress, uint16_t port );
00091 int wge100StopVid( const IpCamList *camInfo );
00092 int wge100Reset( IpCamList *camInfo );
00093 int wge100ReconfigureFPGA( IpCamList *camInfo );
00094 int wge100GetTimer( const IpCamList *camInfo, uint64_t *time_us );
00095 int wge100ReliableFlashRead( const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut, int *retries );
00096 int wge100FlashRead( const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut );
00097 int wge100ReliableFlashWrite( const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn, int *retries );
00098 int wge100FlashWrite( const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn );
00099 int wge100ReliableSensorRead( const IpCamList *camInfo, uint8_t reg, uint16_t *data, int *retries );
00100 int wge100SensorRead( const IpCamList *camInfo, uint8_t reg, uint16_t *data );
00101 int wge100ReliableSensorWrite( const IpCamList *camInfo, uint8_t reg, uint16_t data, int *retries );
00102 int wge100SensorWrite( const IpCamList *camInfo, uint8_t reg, uint16_t data );
00103 int wge100ConfigureBoard( const IpCamList *camInfo, uint32_t serial, MACAddress *mac );
00104 int wge100TriggerControl( const IpCamList *camInfo, uint32_t triggerType );
00105 int wge100SensorSelect( const IpCamList *camInfo, uint8_t index, uint32_t reg );
00106 int wge100ImagerSetRes( const IpCamList *camInfo, uint16_t horizontal, uint16_t vertical );
00107 int wge100ImagerModeSelect( const IpCamList *camInfo, uint32_t mode );
00108
00110 typedef int (*FrameHandler)(wge100FrameInfo *frame_info, void *userData);
00111 int wge100VidReceive( const char *ifName, uint16_t port, size_t height, size_t width, FrameHandler frameHandler, void *userData );
00112 int wge100VidReceiveAuto( IpCamList *camera, size_t height, size_t width, FrameHandler frameHandler, void *userData );
00113
00114 #define CONFIG_PRODUCT_ID 6805018
00115 #define ERR_TIMEOUT 100
00116 #define ERR_CONFIG_ARPFAIL 200
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122 #endif // _WGE100LIB_H_