0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef M5MOLS_REG_H
0013 #define M5MOLS_REG_H
0014
0015 #define M5MOLS_I2C_MAX_SIZE 4
0016 #define M5MOLS_BYTE_READ 0x01
0017 #define M5MOLS_BYTE_WRITE 0x02
0018
0019 #define I2C_CATEGORY(__cat) ((__cat >> 16) & 0xff)
0020 #define I2C_COMMAND(__comm) ((__comm >> 8) & 0xff)
0021 #define I2C_SIZE(__reg_s) ((__reg_s) & 0xff)
0022 #define I2C_REG(__cat, __cmd, __reg_s) ((__cat << 16) | (__cmd << 8) | __reg_s)
0023
0024
0025
0026
0027
0028
0029 #define CAT_SYSTEM 0x00
0030 #define CAT_PARAM 0x01
0031 #define CAT_MONITOR 0x02
0032 #define CAT_AE 0x03
0033 #define CAT_WB 0x06
0034 #define CAT_EXIF 0x07
0035 #define CAT_FD 0x09
0036 #define CAT_LENS 0x0a
0037 #define CAT_CAPT_PARM 0x0b
0038 #define CAT_CAPT_CTRL 0x0c
0039 #define CAT_FLASH 0x0f
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 #define SYSTEM_VER_CUSTOMER I2C_REG(CAT_SYSTEM, 0x00, 1)
0055 #define SYSTEM_VER_PROJECT I2C_REG(CAT_SYSTEM, 0x01, 1)
0056 #define SYSTEM_VER_FIRMWARE I2C_REG(CAT_SYSTEM, 0x02, 2)
0057 #define SYSTEM_VER_HARDWARE I2C_REG(CAT_SYSTEM, 0x04, 2)
0058 #define SYSTEM_VER_PARAMETER I2C_REG(CAT_SYSTEM, 0x06, 2)
0059 #define SYSTEM_VER_AWB I2C_REG(CAT_SYSTEM, 0x08, 2)
0060
0061 #define SYSTEM_SYSMODE I2C_REG(CAT_SYSTEM, 0x0b, 1)
0062 #define REG_SYSINIT 0x00
0063 #define REG_PARAMETER 0x01
0064 #define REG_MONITOR 0x02
0065 #define REG_CAPTURE 0x03
0066
0067 #define SYSTEM_CMD(__cmd) I2C_REG(CAT_SYSTEM, cmd, 1)
0068 #define SYSTEM_VER_STRING I2C_REG(CAT_SYSTEM, 0x0a, 1)
0069 #define REG_SAMSUNG_ELECTRO "SE"
0070 #define REG_SAMSUNG_OPTICS "OP"
0071 #define REG_SAMSUNG_TECHWIN "TB"
0072
0073 #define SYSTEM_STATUS I2C_REG(CAT_SYSTEM, 0x0c, 1)
0074
0075
0076 #define SYSTEM_INT_FACTOR I2C_REG(CAT_SYSTEM, 0x10, 1)
0077
0078 #define SYSTEM_INT_ENABLE I2C_REG(CAT_SYSTEM, 0x11, 1)
0079 #define REG_INT_MODE (1 << 0)
0080 #define REG_INT_AF (1 << 1)
0081 #define REG_INT_ZOOM (1 << 2)
0082 #define REG_INT_CAPTURE (1 << 3)
0083 #define REG_INT_FRAMESYNC (1 << 4)
0084 #define REG_INT_FD (1 << 5)
0085 #define REG_INT_LENS_INIT (1 << 6)
0086 #define REG_INT_SOUND (1 << 7)
0087 #define REG_INT_MASK 0x0f
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098 #define PARM_MON_SIZE I2C_REG(CAT_PARAM, 0x01, 1)
0099
0100
0101 #define PARM_MON_FPS I2C_REG(CAT_PARAM, 0x02, 1)
0102 #define REG_FPS_30 0x02
0103
0104
0105 #define PARM_INTERFACE I2C_REG(CAT_PARAM, 0x00, 1)
0106 #define REG_INTERFACE_MIPI 0x02
0107
0108
0109 #define PARM_EFFECT I2C_REG(CAT_PARAM, 0x0b, 1)
0110 #define REG_EFFECT_OFF 0x00
0111 #define REG_EFFECT_NEGA 0x01
0112 #define REG_EFFECT_EMBOSS 0x06
0113 #define REG_EFFECT_OUTLINE 0x07
0114 #define REG_EFFECT_WATERCOLOR 0x08
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128 #define MON_ZOOM I2C_REG(CAT_MONITOR, 0x01, 1)
0129
0130
0131 #define MON_CFIXR I2C_REG(CAT_MONITOR, 0x0a, 1)
0132
0133 #define MON_CFIXB I2C_REG(CAT_MONITOR, 0x09, 1)
0134 #define REG_CFIXB_SEPIA 0xd8
0135 #define REG_CFIXR_SEPIA 0x18
0136
0137 #define MON_EFFECT I2C_REG(CAT_MONITOR, 0x0b, 1)
0138 #define REG_COLOR_EFFECT_OFF 0x00
0139 #define REG_COLOR_EFFECT_ON 0x01
0140
0141
0142 #define MON_CHROMA_EN I2C_REG(CAT_MONITOR, 0x10, 1)
0143
0144 #define MON_CHROMA_LVL I2C_REG(CAT_MONITOR, 0x0f, 1)
0145 #define REG_CHROMA_OFF 0x00
0146 #define REG_CHROMA_ON 0x01
0147
0148
0149 #define MON_EDGE_EN I2C_REG(CAT_MONITOR, 0x12, 1)
0150
0151 #define MON_EDGE_LVL I2C_REG(CAT_MONITOR, 0x11, 1)
0152 #define REG_EDGE_OFF 0x00
0153 #define REG_EDGE_ON 0x01
0154
0155
0156 #define MON_TONE_CTL I2C_REG(CAT_MONITOR, 0x25, 1)
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170 #define AE_LOCK I2C_REG(CAT_AE, 0x00, 1)
0171 #define REG_AE_UNLOCK 0x00
0172 #define REG_AE_LOCK 0x01
0173
0174
0175 #define AE_MODE I2C_REG(CAT_AE, 0x01, 1)
0176 #define REG_AE_OFF 0x00
0177 #define REG_AE_ALL 0x01
0178 #define REG_AE_CENTER 0x03
0179 #define REG_AE_SPOT 0x06
0180
0181 #define AE_ISO I2C_REG(CAT_AE, 0x05, 1)
0182 #define REG_ISO_AUTO 0x00
0183 #define REG_ISO_50 0x01
0184 #define REG_ISO_100 0x02
0185 #define REG_ISO_200 0x03
0186 #define REG_ISO_400 0x04
0187 #define REG_ISO_800 0x05
0188
0189
0190 #define AE_EV_PRESET_MONITOR I2C_REG(CAT_AE, 0x0a, 1)
0191
0192 #define AE_EV_PRESET_CAPTURE I2C_REG(CAT_AE, 0x0b, 1)
0193 #define REG_SCENE_NORMAL 0x00
0194 #define REG_SCENE_PORTRAIT 0x01
0195 #define REG_SCENE_LANDSCAPE 0x02
0196 #define REG_SCENE_SPORTS 0x03
0197 #define REG_SCENE_PARTY_INDOOR 0x04
0198 #define REG_SCENE_BEACH_SNOW 0x05
0199 #define REG_SCENE_SUNSET 0x06
0200 #define REG_SCENE_DAWN_DUSK 0x07
0201 #define REG_SCENE_FALL 0x08
0202 #define REG_SCENE_NIGHT 0x09
0203 #define REG_SCENE_AGAINST_LIGHT 0x0a
0204 #define REG_SCENE_FIRE 0x0b
0205 #define REG_SCENE_TEXT 0x0c
0206 #define REG_SCENE_CANDLE 0x0d
0207
0208
0209 #define AE_MAN_GAIN_MON I2C_REG(CAT_AE, 0x12, 2)
0210
0211 #define AE_MAX_GAIN_MON I2C_REG(CAT_AE, 0x1a, 2)
0212
0213 #define AE_MAN_GAIN_CAP I2C_REG(CAT_AE, 0x26, 2)
0214
0215 #define AE_INDEX I2C_REG(CAT_AE, 0x38, 1)
0216 #define REG_AE_INDEX_20_NEG 0x00
0217 #define REG_AE_INDEX_15_NEG 0x01
0218 #define REG_AE_INDEX_10_NEG 0x02
0219 #define REG_AE_INDEX_05_NEG 0x03
0220 #define REG_AE_INDEX_00 0x04
0221 #define REG_AE_INDEX_05_POS 0x05
0222 #define REG_AE_INDEX_10_POS 0x06
0223 #define REG_AE_INDEX_15_POS 0x07
0224 #define REG_AE_INDEX_20_POS 0x08
0225
0226
0227
0228
0229
0230
0231 #define AWB_LOCK I2C_REG(CAT_WB, 0x00, 1)
0232 #define REG_AWB_UNLOCK 0x00
0233 #define REG_AWB_LOCK 0x01
0234
0235 #define AWB_MODE I2C_REG(CAT_WB, 0x02, 1)
0236 #define REG_AWB_AUTO 0x01
0237 #define REG_AWB_PRESET 0x02
0238
0239
0240 #define AWB_MANUAL I2C_REG(CAT_WB, 0x03, 1)
0241 #define REG_AWB_INCANDESCENT 0x01
0242 #define REG_AWB_FLUORESCENT_1 0x02
0243 #define REG_AWB_FLUORESCENT_2 0x03
0244 #define REG_AWB_DAYLIGHT 0x04
0245 #define REG_AWB_CLOUDY 0x05
0246 #define REG_AWB_SHADE 0x06
0247 #define REG_AWB_HORIZON 0x07
0248 #define REG_AWB_LEDLIGHT 0x09
0249
0250
0251
0252
0253 #define EXIF_INFO_EXPTIME_NU I2C_REG(CAT_EXIF, 0x00, 4)
0254 #define EXIF_INFO_EXPTIME_DE I2C_REG(CAT_EXIF, 0x04, 4)
0255 #define EXIF_INFO_TV_NU I2C_REG(CAT_EXIF, 0x08, 4)
0256 #define EXIF_INFO_TV_DE I2C_REG(CAT_EXIF, 0x0c, 4)
0257 #define EXIF_INFO_AV_NU I2C_REG(CAT_EXIF, 0x10, 4)
0258 #define EXIF_INFO_AV_DE I2C_REG(CAT_EXIF, 0x14, 4)
0259 #define EXIF_INFO_BV_NU I2C_REG(CAT_EXIF, 0x18, 4)
0260 #define EXIF_INFO_BV_DE I2C_REG(CAT_EXIF, 0x1c, 4)
0261 #define EXIF_INFO_EBV_NU I2C_REG(CAT_EXIF, 0x20, 4)
0262 #define EXIF_INFO_EBV_DE I2C_REG(CAT_EXIF, 0x24, 4)
0263 #define EXIF_INFO_ISO I2C_REG(CAT_EXIF, 0x28, 2)
0264 #define EXIF_INFO_FLASH I2C_REG(CAT_EXIF, 0x2a, 2)
0265 #define EXIF_INFO_SDR I2C_REG(CAT_EXIF, 0x2c, 2)
0266 #define EXIF_INFO_QVAL I2C_REG(CAT_EXIF, 0x2e, 2)
0267
0268
0269
0270
0271 #define FD_CTL I2C_REG(CAT_FD, 0x00, 1)
0272 #define BIT_FD_EN 0
0273 #define BIT_FD_DRAW_FACE_FRAME 4
0274 #define BIT_FD_DRAW_SMILE_LVL 6
0275 #define REG_FD(shift) (1 << shift)
0276 #define REG_FD_OFF 0x0
0277
0278
0279
0280
0281 #define AF_MODE I2C_REG(CAT_LENS, 0x01, 1)
0282 #define REG_AF_NORMAL 0x00
0283 #define REG_AF_MACRO 0x01
0284 #define REG_AF_POWEROFF 0x07
0285
0286 #define AF_EXECUTE I2C_REG(CAT_LENS, 0x02, 1)
0287 #define REG_AF_STOP 0x00
0288 #define REG_AF_EXE_AUTO 0x01
0289 #define REG_AF_EXE_CAF 0x02
0290
0291 #define AF_STATUS I2C_REG(CAT_LENS, 0x03, 1)
0292 #define REG_AF_FAIL 0x00
0293 #define REG_AF_SUCCESS 0x02
0294 #define REG_AF_IDLE 0x04
0295 #define REG_AF_BUSY 0x05
0296
0297 #define AF_VERSION I2C_REG(CAT_LENS, 0x0a, 1)
0298
0299
0300
0301
0302 #define CAPP_YUVOUT_MAIN I2C_REG(CAT_CAPT_PARM, 0x00, 1)
0303 #define REG_YUV422 0x00
0304 #define REG_BAYER10 0x05
0305 #define REG_BAYER8 0x06
0306 #define REG_JPEG 0x10
0307
0308 #define CAPP_MAIN_IMAGE_SIZE I2C_REG(CAT_CAPT_PARM, 0x01, 1)
0309 #define CAPP_JPEG_SIZE_MAX I2C_REG(CAT_CAPT_PARM, 0x0f, 4)
0310 #define CAPP_JPEG_RATIO I2C_REG(CAT_CAPT_PARM, 0x17, 1)
0311
0312 #define CAPP_MCC_MODE I2C_REG(CAT_CAPT_PARM, 0x1d, 1)
0313 #define REG_MCC_OFF 0x00
0314 #define REG_MCC_NORMAL 0x01
0315
0316 #define CAPP_WDR_EN I2C_REG(CAT_CAPT_PARM, 0x2c, 1)
0317 #define REG_WDR_OFF 0x00
0318 #define REG_WDR_ON 0x01
0319 #define REG_WDR_AUTO 0x02
0320
0321 #define CAPP_LIGHT_CTRL I2C_REG(CAT_CAPT_PARM, 0x40, 1)
0322 #define REG_LIGHT_OFF 0x00
0323 #define REG_LIGHT_ON 0x01
0324 #define REG_LIGHT_AUTO 0x02
0325
0326 #define CAPP_FLASH_CTRL I2C_REG(CAT_CAPT_PARM, 0x41, 1)
0327 #define REG_FLASH_OFF 0x00
0328 #define REG_FLASH_ON 0x01
0329 #define REG_FLASH_AUTO 0x02
0330
0331
0332
0333
0334 #define CAPC_MODE I2C_REG(CAT_CAPT_CTRL, 0x00, 1)
0335 #define REG_CAP_NONE 0x00
0336 #define REG_CAP_ANTI_SHAKE 0x02
0337
0338
0339 #define CAPC_SEL_FRAME I2C_REG(CAT_CAPT_CTRL, 0x06, 1)
0340
0341 #define CAPC_START I2C_REG(CAT_CAPT_CTRL, 0x09, 1)
0342 #define REG_CAP_START_MAIN 0x01
0343 #define REG_CAP_START_THUMB 0x03
0344
0345 #define CAPC_IMAGE_SIZE I2C_REG(CAT_CAPT_CTRL, 0x0d, 4)
0346 #define CAPC_THUMB_SIZE I2C_REG(CAT_CAPT_CTRL, 0x11, 4)
0347
0348
0349
0350
0351
0352
0353
0354
0355 #define FLASH_CAM_START I2C_REG(CAT_FLASH, 0x12, 1)
0356 #define REG_START_ARM_BOOT 0x01
0357 #define REG_IN_FLASH_MODE 0x00
0358
0359 #endif