wge100lib.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2009, 2010 Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 #ifndef _WGE100LIB_H_
36 #define _WGE100LIB_H_
37 #include <stdint.h>
38 #include "list.h"
39 #include "ipcam_packet.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
46 /*
47  * Firmware version number
48  */
49 #define WGE100LIB_VERSION_MAJOR 0x01
50 #define WGE100LIB_VERSION_MINOR 0x05
51 #define WGE100LIB_VERSION ((WGE100LIB_VERSION_MAJOR <<8) | WGE100LIB_VERSION_MINOR )
52 
53 
54 /*
55  * Trigger Modes
56  */
57 
58 #define TRIG_STATE_INTERNAL 0
59 #define TRIG_STATE_EXTERNAL 1
60 #define TRIG_STATE_ALTERNATE 4
61 #define TRIG_STATE_RISING 2
62 
63 /*
64  * The wge100FrameInfo structure is returned to the frame handler
65  */
66 typedef struct
67 {
68  size_t width;
69  size_t height;
70 
71  uint32_t frame_number;
72 
74  size_t missingLines;
76 
77  uint8_t *frameData;
79 
80  struct timeval startTime;
82 
83 
84 
85 int wge100LibVersion( void );
86 
87 int wge100FindByUrl(const char *url, IpCamList *camera, unsigned wait_us, const char **errmsg);
88 int wge100Discover(const char *ifName, IpCamList *ipCamList, const char *ipAddress, unsigned wait_us);
89 int wge100Configure( IpCamList *camInfo, const char *ipAddress, unsigned wait_us);
90 int wge100StartVid( const IpCamList *camInfo, const uint8_t mac[6], const char *ipAddress, uint16_t port );
91 int wge100StopVid( const IpCamList *camInfo );
92 int wge100Reset( IpCamList *camInfo );
93 int wge100ReconfigureFPGA( IpCamList *camInfo );
94 int wge100GetTimer( const IpCamList *camInfo, uint64_t *time_us );
95 int wge100ReliableFlashRead( const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut, int *retries );
96 int wge100FlashRead( const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut );
97 int wge100ReliableFlashWrite( const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn, int *retries );
98 int wge100FlashWrite( const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn );
99 int wge100ReliableSensorRead( const IpCamList *camInfo, uint8_t reg, uint16_t *data, int *retries );
100 int wge100SensorRead( const IpCamList *camInfo, uint8_t reg, uint16_t *data );
101 int wge100ReliableSensorWrite( const IpCamList *camInfo, uint8_t reg, uint16_t data, int *retries );
102 int wge100SensorWrite( const IpCamList *camInfo, uint8_t reg, uint16_t data );
103 int wge100ConfigureBoard( const IpCamList *camInfo, uint32_t serial, MACAddress *mac );
104 int wge100TriggerControl( const IpCamList *camInfo, uint32_t triggerType );
105 int wge100SensorSelect( const IpCamList *camInfo, uint8_t index, uint32_t reg );
106 int wge100ImagerSetRes( const IpCamList *camInfo, uint16_t horizontal, uint16_t vertical );
107 int wge100ImagerModeSelect( const IpCamList *camInfo, uint32_t mode );
108 
110 typedef int (*FrameHandler)(wge100FrameInfo *frame_info, void *userData);
111 int wge100VidReceive( const char *ifName, uint16_t port, size_t height, size_t width, FrameHandler frameHandler, void *userData );
112 int wge100VidReceiveAuto( IpCamList *camera, size_t height, size_t width, FrameHandler frameHandler, void *userData );
113 
114 #define CONFIG_PRODUCT_ID 6805018
115 #define ERR_TIMEOUT 100
116 #define ERR_CONFIG_ARPFAIL 200
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif // _WGE100LIB_H_
int wge100ReliableFlashRead(const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut, int *retries)
Definition: wge100lib.c:906
int wge100ReliableFlashWrite(const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn, int *retries)
Definition: wge100lib.c:1014
int wge100Reset(IpCamList *camInfo)
Definition: wge100lib.c:788
size_t lastMissingLine
Definition: wge100lib.h:73
uint32_t frame_number
Definition: wge100lib.h:71
int wge100Configure(IpCamList *camInfo, const char *ipAddress, unsigned wait_us)
Definition: wge100lib.c:532
uint8_t MACAddress[6]
Definition: ipcam_packet.h:75
int wge100ReliableSensorRead(const IpCamList *camInfo, uint8_t reg, uint16_t *data, int *retries)
Definition: wge100lib.c:1349
size_t height
Definition: wge100lib.h:69
int wge100FlashWrite(const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn)
Definition: wge100lib.c:1077
int wge100FlashRead(const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut)
Definition: wge100lib.c:940
PacketEOF * eofInfo
Definition: wge100lib.h:78
int wge100ReliableSensorWrite(const IpCamList *camInfo, uint8_t reg, uint16_t data, int *retries)
Definition: wge100lib.c:1252
int wge100FindByUrl(const char *url, IpCamList *camera, unsigned wait_us, const char **errmsg)
Definition: wge100lib.c:94
int wge100ImagerModeSelect(const IpCamList *camInfo, uint32_t mode)
Definition: wge100lib.c:1491
int wge100VidReceiveAuto(IpCamList *camera, size_t height, size_t width, FrameHandler frameHandler, void *userData)
Definition: wge100lib.c:1908
int wge100TriggerControl(const IpCamList *camInfo, uint32_t triggerType)
Definition: wge100lib.c:1135
int wge100Discover(const char *ifName, IpCamList *ipCamList, const char *ipAddress, unsigned wait_us)
Definition: wge100lib.c:372
int wge100ImagerSetRes(const IpCamList *camInfo, uint16_t horizontal, uint16_t vertical)
Definition: wge100lib.c:1548
int wge100GetTimer(const IpCamList *camInfo, uint64_t *time_us)
Definition: wge100lib.c:832
size_t missingLines
Definition: wge100lib.h:74
int wge100LibVersion(void)
int wge100StopVid(const IpCamList *camInfo)
Definition: wge100lib.c:700
int wge100ConfigureBoard(const IpCamList *camInfo, uint32_t serial, MACAddress *mac)
Definition: wge100lib.c:1194
int wge100VidReceive(const char *ifName, uint16_t port, size_t height, size_t width, FrameHandler frameHandler, void *userData)
Definition: wge100lib.c:1889
uint8_t * frameData
Definition: wge100lib.h:77
int(* FrameHandler)(wge100FrameInfo *frame_info, void *userData)
A FrameHandler function returns zero to continue to receive data, non-zero otherwise.
Definition: wge100lib.h:110
int wge100SensorRead(const IpCamList *camInfo, uint8_t reg, uint16_t *data)
Definition: wge100lib.c:1378
int wge100ReconfigureFPGA(IpCamList *camInfo)
Definition: wge100lib.c:750
int wge100StartVid(const IpCamList *camInfo, const uint8_t mac[6], const char *ipAddress, uint16_t port)
Definition: wge100lib.c:638
size_t width
Definition: wge100lib.h:68
int wge100SensorWrite(const IpCamList *camInfo, uint8_t reg, uint16_t data)
Definition: wge100lib.c:1291
int wge100SensorSelect(const IpCamList *camInfo, uint8_t index, uint32_t reg)
Definition: wge100lib.c:1438


wge100_camera
Author(s): Blaise Gassend, Patrick Mihelich, Eric MacIntosh, David Palchak
autogenerated on Mon Jun 10 2019 15:44:16