isp_exposure.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2021 Alibaba Group Holding Limited
  3. * Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <stdint.h>
  12. #include <unistd.h>
  13. #include <string.h>
  14. #include "ra_common.h"
  15. #define REG_BASE 0x00002600
  16. static const reg_field_s reg_desc[] = {
  17. /* structure field order
  18. reg_name, offset,reset_value,msb,lsb, field_name, field_desc */
  19. {"ISP_EXP_CONF", "Exposure Control",
  20. 0x00002600, 0x00000000, 31, 31, "exp_alt_mode", "0: luminance calculation according to Y=16+0.25R+0.5G+0.1094B" LINE_PADDING_6TAB
  21. "1: luminance calculation according to Y=(R+G+B) x 0.332"},
  22. {NULL, NULL, 0x00002600, 0x00000000, 3, 2, "exp_src_select", "data source select 1:wdr 0:csm"},
  23. {NULL, NULL, 0x00002600, 0x00000000, 1, 1, "autostop", "0: continuous measurement; 1: stop measuring after a complete frame"},
  24. {"ISP_EXPV2_CTRL", "raw exposure control",
  25. 0x000026A0, 0x00000000, 3, 2, "expv2_input_select", "00: degamma output; 01: awb_gain output; 10: WDR3 output; 11: not used"},
  26. {NULL, NULL, 0x000026A0, 0x00000000, 1, 1, "expv2_autostop", "0: continous measurement; 1: stop measuring after a complete frame"},
  27. {NULL, NULL, 0x000026A0, 0x00000000, 0, 0, "expv2_enable", "1: start measuring a frame" LINE_PADDING_6TAB
  28. "The exp block will reset this bit and halt after " LINE_PADDING_6TAB
  29. "completing one frame if bit 'autostop' is set to 1"},
  30. };
  31. int light_isp_exposure_reg_dump(reg_analyzer_info_s *ra_info)
  32. {
  33. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  34. return ra_dump_reg_fields(ra_info, reg_desc, count);
  35. }
  36. int light_isp_exposure_reg_define(reg_analyzer_info_s *ra_info)
  37. {
  38. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  39. return ra_dump_reg_define(ra_info, reg_desc, count);
  40. }
  41. int light_isp_exposure_reg_find(reg_analyzer_info_s *ra_info)
  42. {
  43. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  44. return ra_dump_reg_find(ra_info, reg_desc, count);
  45. }