5
5
#include <pcilib/model.h>
6
#include <pcilib/debug.h>
6
7
#include "ipecamera.h"
8
9
//#define IPECAMERA_BUG_MISSING_PAYLOAD //**< CMOSIS fails to provide a first payload for each frame, therefore the frame is 32 bit shorter */
9
10
#define IPECAMERA_BUG_MULTIFRAME_PACKETS //**< This is by design, start of packet comes directly after the end of last one in streaming mode */
10
11
//#define IPECAMERA_BUG_INCOMPLETE_PACKETS //**< Support incomplete packets, i.e. check for frame magic even if full frame size is not reached yet (slow) */
11
12
#define IPECAMERA_BUG_POSTPONED_READ
12
#define IPECAMERA_DEBUG_BROKEN_FRAMES "/mnt/frames"
13
//#define IPECAMERA_DEBUG_RAW_PACKETS "/mnt/frames"
15
13
//#define IPECAMERA_ANNOUNCE_READY //**< announce new event only after the reconstruction is done */
15
#define IPECAMERA_DEBUG
17
#ifdef IPECAMERA_DEBUG
18
# define IPECAMERA_DEBUG_BROKEN_FRAMES
19
# define IPECAMERA_DEBUG_RAW_PACKETS
20
#endif /* IPECAMERA_DEBUG */
17
22
#define IPECAMERA_REGISTER_TIMEOUT 10000 //**< us */
18
23
#define IPECAMERA_DMA_TIMEOUT 50000 //**< us */
50
55
#define IPECAMERA_MODE_11_BIT_ADC 1
51
56
#define IPECAMERA_MODE_10_BIT_ADC 0
58
#ifdef IPECAMERA_DEBUG_BROKEN_FRAMES
59
# define IPECAMERA_DEBUG_BROKEN_FRAMES_MESSAGE(function, ...) pcilib_debug_message (#function, __FILE__, __LINE__, __VA_ARGS__)
60
# define IPECAMERA_DEBUG_BROKEN_FRAMES_BUFFER(function, ...) pcilib_debug_data_buffer (#function, __VA_ARGS__)
61
#else /* IPECAMERA_DEBUG_BROKEN_FRAMES */
62
# define IPECAMERA_DEBUG_BROKEN_FRAMES_MESSAGE(function, ...)
63
# define IPECAMERA_DEBUG_BROKEN_FRAMES_BUFFER(function, ...)
64
#endif /* IPECAMERA_DEBUG_BROKEN_FRAMES */
66
#ifdef IPECAMERA_IPECAMERA_DEBUG_RAW_PACKETS
67
# define IPECAMERA_DEBUG_RAW_PACKETS_MESSAGE(function, ...) pcilib_debug_message (#function, __FILE__, __LINE__, __VA_ARGS__)
68
# define IPECAMERA_DEBUG_RAW_PACKETS_BUFFER(function, ...) pcilib_debug_data_buffer (#function, __VA_ARGS__)
69
#else /* IPECAMERA_IPECAMERA_DEBUG_RAW_PACKETS */
70
# define IPECAMERA_DEBUG_RAW_PACKETS_MESSAGE(function, ...)
71
# define IPECAMERA_DEBUG_RAW_PACKETS_BUFFER(function, ...)
72
#endif /* IPECAMERA_IPECAMERA_DEBUG_RAW_PACKETS */
74
#define ipecamera_debug(function, ...) \
75
IPECAMERA_DEBUG_##function##_MESSAGE(IPECAMERA_DEBUG_##function, __VA_ARGS__)
77
#define ipecamera_debug_buffer(function, ...) \
78
IPECAMERA_DEBUG_##function##_BUFFER(IPECAMERA_DEBUG_##function, __VA_ARGS__)
53
81
typedef uint32_t ipecamera_payload_t;