-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcommon.h
31 lines (25 loc) · 1.01 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef COMMON_H_
#define COMMON_H_
#include <stdint.h>
/* common return code */
typedef int RET;
#define RET_OK 0x00000000
#define RET_NO_DATA 0x00000001
#define RET_TIMEOUT 0x00000002
#define RET_ERR 0x80000001
/* LOG macros */
#define LOG(str, ...) {printf("\x1b[39m"); printf("[%s:%d] " str, __FILE__, __LINE__, ##__VA_ARGS__);}
#define LOG_W(str, ...) {printf("\x1b[33m"); printf("[WARNING %s:%d] " str, __FILE__, __LINE__, ##__VA_ARGS__);}
#define LOG_E(str, ...) {printf("\x1b[31m"); printf("[ERROR %s:%d] " str, __FILE__, __LINE__, ##__VA_ARGS__);}
/* definition depending on specs and HW */
#define TARGET_FPS 30
#define WIDTH 320
#define HEIGHT 240
#define FILENAME_FORMAT "IMG_%04d.jpg"
/* device related definition (todo: should be separated file) */
#define DD_ILI_9341_SPI_SPI_DEV "/dev/spidev0.0"
#define DD_ILI_9341_SPI_GPIO_DC 26
#define DD_TP_TSC_2046_SPI_SPI_DEV "/dev/spidev0.1"
#define DD_TP_TSC_2046_SPI_GPIO_IRQ 19
#define DD_CAMERA_V2L4 "/dev/video0"
#endif /* COMMON_H_ */