/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to private.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-05-01 17:21:14 UTC
  • Revision ID: csa@suren.me-20150501172114-zhfeilae8k10kvnx
Use pcitool debugging API

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
#include <pthread.h>
5
5
#include <pcilib/model.h>
 
6
#include <pcilib/debug.h>
6
7
#include "ipecamera.h"
7
8
 
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"
14
 
 
15
13
//#define IPECAMERA_ANNOUNCE_READY              //**< announce new event only after the reconstruction is done */
16
14
 
 
15
#define IPECAMERA_DEBUG
 
16
 
 
17
#ifdef IPECAMERA_DEBUG
 
18
# define IPECAMERA_DEBUG_BROKEN_FRAMES
 
19
# define IPECAMERA_DEBUG_RAW_PACKETS
 
20
#endif /* IPECAMERA_DEBUG */
 
21
 
17
22
#define IPECAMERA_REGISTER_TIMEOUT 10000        //**< us */
18
23
#define IPECAMERA_DMA_TIMEOUT 50000             //**< us */
19
24
 
50
55
#define IPECAMERA_MODE_11_BIT_ADC               1
51
56
#define IPECAMERA_MODE_10_BIT_ADC               0
52
57
 
 
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 */
 
65
 
 
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 */
 
73
 
 
74
#define ipecamera_debug(function, ...) \
 
75
    IPECAMERA_DEBUG_##function##_MESSAGE(IPECAMERA_DEBUG_##function, __VA_ARGS__)
 
76
 
 
77
#define ipecamera_debug_buffer(function, ...) \
 
78
    IPECAMERA_DEBUG_##function##_BUFFER(IPECAMERA_DEBUG_##function, __VA_ARGS__)
 
79
 
 
80
 
53
81
typedef uint32_t ipecamera_payload_t;
54
82
 
55
83
typedef struct {