Go to the documentation of this file.
19 #define M5MOLS_I2C_MAX_SIZE 4
20 #define M5MOLS_BYTE_READ 0x01
21 #define M5MOLS_BYTE_WRITE 0x02
23 #define I2C_CATEGORY(__cat) ((__cat >> 16) & 0xff)
24 #define I2C_COMMAND(__comm) ((__comm >> 8) & 0xff)
25 #define I2C_SIZE(__reg_s) ((__reg_s) & 0xff)
26 #define I2C_REG(__cat, __cmd, __reg_s) ((__cat << 16) | (__cmd << 8) | __reg_s)
33 #define CAT_SYSTEM 0x00
34 #define CAT_PARAM 0x01
35 #define CAT_MONITOR 0x02
41 #define CAT_CAPT_PARM 0x0b
42 #define CAT_CAPT_CTRL 0x0c
43 #define CAT_FLASH 0x0f
58 #define SYSTEM_VER_CUSTOMER I2C_REG(CAT_SYSTEM, 0x00, 1)
59 #define SYSTEM_VER_PROJECT I2C_REG(CAT_SYSTEM, 0x01, 1)
60 #define SYSTEM_VER_FIRMWARE I2C_REG(CAT_SYSTEM, 0x02, 2)
61 #define SYSTEM_VER_HARDWARE I2C_REG(CAT_SYSTEM, 0x04, 2)
62 #define SYSTEM_VER_PARAMETER I2C_REG(CAT_SYSTEM, 0x06, 2)
63 #define SYSTEM_VER_AWB I2C_REG(CAT_SYSTEM, 0x08, 2)
65 #define SYSTEM_SYSMODE I2C_REG(CAT_SYSTEM, 0x0b, 1)
66 #define REG_SYSINIT 0x00
67 #define REG_PARAMETER 0x01
68 #define REG_MONITOR 0x02
69 #define REG_CAPTURE 0x03
71 #define SYSTEM_CMD(__cmd) I2C_REG(CAT_SYSTEM, cmd, 1)
72 #define SYSTEM_VER_STRING I2C_REG(CAT_SYSTEM, 0x0a, 1)
73 #define REG_SAMSUNG_ELECTRO "SE"
74 #define REG_SAMSUNG_OPTICS "OP"
75 #define REG_SAMSUNG_TECHWIN "TB"
77 #define SYSTEM_STATUS I2C_REG(CAT_SYSTEM, 0x0c, 1)
80 #define SYSTEM_INT_FACTOR I2C_REG(CAT_SYSTEM, 0x10, 1)
82 #define SYSTEM_INT_ENABLE I2C_REG(CAT_SYSTEM, 0x11, 1)
83 #define REG_INT_MODE (1 << 0)
84 #define REG_INT_AF (1 << 1)
85 #define REG_INT_ZOOM (1 << 2)
86 #define REG_INT_CAPTURE (1 << 3)
87 #define REG_INT_FRAMESYNC (1 << 4)
88 #define REG_INT_FD (1 << 5)
89 #define REG_INT_LENS_INIT (1 << 6)
90 #define REG_INT_SOUND (1 << 7)
91 #define REG_INT_MASK 0x0f
102 #define PARM_MON_SIZE I2C_REG(CAT_PARAM, 0x01, 1)
105 #define PARM_MON_FPS I2C_REG(CAT_PARAM, 0x02, 1)
106 #define REG_FPS_30 0x02
109 #define PARM_INTERFACE I2C_REG(CAT_PARAM, 0x00, 1)
110 #define REG_INTERFACE_MIPI 0x02
113 #define PARM_EFFECT I2C_REG(CAT_PARAM, 0x0b, 1)
114 #define REG_EFFECT_OFF 0x00
115 #define REG_EFFECT_NEGA 0x01
116 #define REG_EFFECT_EMBOSS 0x06
117 #define REG_EFFECT_OUTLINE 0x07
118 #define REG_EFFECT_WATERCOLOR 0x08
132 #define MON_ZOOM I2C_REG(CAT_MONITOR, 0x01, 1)
135 #define MON_CFIXR I2C_REG(CAT_MONITOR, 0x0a, 1)
137 #define MON_CFIXB I2C_REG(CAT_MONITOR, 0x09, 1)
138 #define REG_CFIXB_SEPIA 0xd8
139 #define REG_CFIXR_SEPIA 0x18
141 #define MON_EFFECT I2C_REG(CAT_MONITOR, 0x0b, 1)
142 #define REG_COLOR_EFFECT_OFF 0x00
143 #define REG_COLOR_EFFECT_ON 0x01
146 #define MON_CHROMA_EN I2C_REG(CAT_MONITOR, 0x10, 1)
148 #define MON_CHROMA_LVL I2C_REG(CAT_MONITOR, 0x0f, 1)
149 #define REG_CHROMA_OFF 0x00
150 #define REG_CHROMA_ON 0x01
153 #define MON_EDGE_EN I2C_REG(CAT_MONITOR, 0x12, 1)
155 #define MON_EDGE_LVL I2C_REG(CAT_MONITOR, 0x11, 1)
156 #define REG_EDGE_OFF 0x00
157 #define REG_EDGE_ON 0x01
160 #define MON_TONE_CTL I2C_REG(CAT_MONITOR, 0x25, 1)
174 #define AE_LOCK I2C_REG(CAT_AE, 0x00, 1)
175 #define REG_AE_UNLOCK 0x00
176 #define REG_AE_LOCK 0x01
179 #define AE_MODE I2C_REG(CAT_AE, 0x01, 1)
180 #define REG_AE_OFF 0x00
181 #define REG_AE_ALL 0x01
182 #define REG_AE_CENTER 0x03
183 #define REG_AE_SPOT 0x06
185 #define AE_ISO I2C_REG(CAT_AE, 0x05, 1)
186 #define REG_ISO_AUTO 0x00
187 #define REG_ISO_50 0x01
188 #define REG_ISO_100 0x02
189 #define REG_ISO_200 0x03
190 #define REG_ISO_400 0x04
191 #define REG_ISO_800 0x05
194 #define AE_EV_PRESET_MONITOR I2C_REG(CAT_AE, 0x0a, 1)
196 #define AE_EV_PRESET_CAPTURE I2C_REG(CAT_AE, 0x0b, 1)
197 #define REG_SCENE_NORMAL 0x00
198 #define REG_SCENE_PORTRAIT 0x01
199 #define REG_SCENE_LANDSCAPE 0x02
200 #define REG_SCENE_SPORTS 0x03
201 #define REG_SCENE_PARTY_INDOOR 0x04
202 #define REG_SCENE_BEACH_SNOW 0x05
203 #define REG_SCENE_SUNSET 0x06
204 #define REG_SCENE_DAWN_DUSK 0x07
205 #define REG_SCENE_FALL 0x08
206 #define REG_SCENE_NIGHT 0x09
207 #define REG_SCENE_AGAINST_LIGHT 0x0a
208 #define REG_SCENE_FIRE 0x0b
209 #define REG_SCENE_TEXT 0x0c
210 #define REG_SCENE_CANDLE 0x0d
213 #define AE_MAN_GAIN_MON I2C_REG(CAT_AE, 0x12, 2)
215 #define AE_MAX_GAIN_MON I2C_REG(CAT_AE, 0x1a, 2)
217 #define AE_MAN_GAIN_CAP I2C_REG(CAT_AE, 0x26, 2)
219 #define AE_INDEX I2C_REG(CAT_AE, 0x38, 1)
220 #define REG_AE_INDEX_20_NEG 0x00
221 #define REG_AE_INDEX_15_NEG 0x01
222 #define REG_AE_INDEX_10_NEG 0x02
223 #define REG_AE_INDEX_05_NEG 0x03
224 #define REG_AE_INDEX_00 0x04
225 #define REG_AE_INDEX_05_POS 0x05
226 #define REG_AE_INDEX_10_POS 0x06
227 #define REG_AE_INDEX_15_POS 0x07
228 #define REG_AE_INDEX_20_POS 0x08
235 #define AWB_LOCK I2C_REG(CAT_WB, 0x00, 1)
236 #define REG_AWB_UNLOCK 0x00
237 #define REG_AWB_LOCK 0x01
239 #define AWB_MODE I2C_REG(CAT_WB, 0x02, 1)
240 #define REG_AWB_AUTO 0x01
241 #define REG_AWB_PRESET 0x02
244 #define AWB_MANUAL I2C_REG(CAT_WB, 0x03, 1)
245 #define REG_AWB_INCANDESCENT 0x01
246 #define REG_AWB_FLUORESCENT_1 0x02
247 #define REG_AWB_FLUORESCENT_2 0x03
248 #define REG_AWB_DAYLIGHT 0x04
249 #define REG_AWB_CLOUDY 0x05
250 #define REG_AWB_SHADE 0x06
251 #define REG_AWB_HORIZON 0x07
252 #define REG_AWB_LEDLIGHT 0x09
257 #define EXIF_INFO_EXPTIME_NU I2C_REG(CAT_EXIF, 0x00, 4)
258 #define EXIF_INFO_EXPTIME_DE I2C_REG(CAT_EXIF, 0x04, 4)
259 #define EXIF_INFO_TV_NU I2C_REG(CAT_EXIF, 0x08, 4)
260 #define EXIF_INFO_TV_DE I2C_REG(CAT_EXIF, 0x0c, 4)
261 #define EXIF_INFO_AV_NU I2C_REG(CAT_EXIF, 0x10, 4)
262 #define EXIF_INFO_AV_DE I2C_REG(CAT_EXIF, 0x14, 4)
263 #define EXIF_INFO_BV_NU I2C_REG(CAT_EXIF, 0x18, 4)
264 #define EXIF_INFO_BV_DE I2C_REG(CAT_EXIF, 0x1c, 4)
265 #define EXIF_INFO_EBV_NU I2C_REG(CAT_EXIF, 0x20, 4)
266 #define EXIF_INFO_EBV_DE I2C_REG(CAT_EXIF, 0x24, 4)
267 #define EXIF_INFO_ISO I2C_REG(CAT_EXIF, 0x28, 2)
268 #define EXIF_INFO_FLASH I2C_REG(CAT_EXIF, 0x2a, 2)
269 #define EXIF_INFO_SDR I2C_REG(CAT_EXIF, 0x2c, 2)
270 #define EXIF_INFO_QVAL I2C_REG(CAT_EXIF, 0x2e, 2)
275 #define FD_CTL I2C_REG(CAT_FD, 0x00, 1)
277 #define BIT_FD_DRAW_FACE_FRAME 4
278 #define BIT_FD_DRAW_SMILE_LVL 6
279 #define REG_FD(shift) (1 << shift)
280 #define REG_FD_OFF 0x0
285 #define AF_MODE I2C_REG(CAT_LENS, 0x01, 1)
286 #define REG_AF_NORMAL 0x00
287 #define REG_AF_MACRO 0x01
288 #define REG_AF_POWEROFF 0x07
290 #define AF_EXECUTE I2C_REG(CAT_LENS, 0x02, 1)
291 #define REG_AF_STOP 0x00
292 #define REG_AF_EXE_AUTO 0x01
293 #define REG_AF_EXE_CAF 0x02
295 #define AF_STATUS I2C_REG(CAT_LENS, 0x03, 1)
296 #define REG_AF_FAIL 0x00
297 #define REG_AF_SUCCESS 0x02
298 #define REG_AF_IDLE 0x04
299 #define REG_AF_BUSY 0x05
301 #define AF_VERSION I2C_REG(CAT_LENS, 0x0a, 1)
306 #define CAPP_YUVOUT_MAIN I2C_REG(CAT_CAPT_PARM, 0x00, 1)
307 #define REG_YUV422 0x00
308 #define REG_BAYER10 0x05
309 #define REG_BAYER8 0x06
310 #define REG_JPEG 0x10
312 #define CAPP_MAIN_IMAGE_SIZE I2C_REG(CAT_CAPT_PARM, 0x01, 1)
313 #define CAPP_JPEG_SIZE_MAX I2C_REG(CAT_CAPT_PARM, 0x0f, 4)
314 #define CAPP_JPEG_RATIO I2C_REG(CAT_CAPT_PARM, 0x17, 1)
316 #define CAPP_MCC_MODE I2C_REG(CAT_CAPT_PARM, 0x1d, 1)
317 #define REG_MCC_OFF 0x00
318 #define REG_MCC_NORMAL 0x01
320 #define CAPP_WDR_EN I2C_REG(CAT_CAPT_PARM, 0x2c, 1)
321 #define REG_WDR_OFF 0x00
322 #define REG_WDR_ON 0x01
323 #define REG_WDR_AUTO 0x02
325 #define CAPP_LIGHT_CTRL I2C_REG(CAT_CAPT_PARM, 0x40, 1)
326 #define REG_LIGHT_OFF 0x00
327 #define REG_LIGHT_ON 0x01
328 #define REG_LIGHT_AUTO 0x02
330 #define CAPP_FLASH_CTRL I2C_REG(CAT_CAPT_PARM, 0x41, 1)
331 #define REG_FLASH_OFF 0x00
332 #define REG_FLASH_ON 0x01
333 #define REG_FLASH_AUTO 0x02
338 #define CAPC_MODE I2C_REG(CAT_CAPT_CTRL, 0x00, 1)
339 #define REG_CAP_NONE 0x00
340 #define REG_CAP_ANTI_SHAKE 0x02
343 #define CAPC_SEL_FRAME I2C_REG(CAT_CAPT_CTRL, 0x06, 1)
345 #define CAPC_START I2C_REG(CAT_CAPT_CTRL, 0x09, 1)
346 #define REG_CAP_START_MAIN 0x01
347 #define REG_CAP_START_THUMB 0x03
349 #define CAPC_IMAGE_SIZE I2C_REG(CAT_CAPT_CTRL, 0x0d, 4)
350 #define CAPC_THUMB_SIZE I2C_REG(CAT_CAPT_CTRL, 0x11, 4)
359 #define FLASH_CAM_START I2C_REG(CAT_FLASH, 0x12, 1)
360 #define REG_START_ARM_BOOT 0x01
361 #define REG_IN_FLASH_MODE 0x00