isp_hist256.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 0x00002100
  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_HIST256_PROP", "Histogram properties",
  20. 0x00002100, 0x00000000, 9, 3, "stepsize", "Histogram pre-divider" LINE_PADDING_6TAB
  21. "Process every (step size)th pixel; all other pixels are skipped" LINE_PADDING_6TAB
  22. "0,1,2: not allowed" LINE_PADDING_6TAB
  23. "3: process every third input pixel" LINE_PADDING_6TAB
  24. "4: process every fourth input pixel" LINE_PADDING_6TAB
  25. "..." LINE_PADDING_6TAB
  26. "7FH: process every 127th pixel"},
  27. {NULL, NULL, 0x00002100, 0x00000000, 2, 0, "hist_mode", "Histogram mode, luminance is taken at ISP output before" LINE_PADDING_6TAB
  28. " output formatter, RGB is taken at xtalk output" LINE_PADDING_6TAB
  29. "0: disable, no measurements" LINE_PADDING_6TAB
  30. "1: RGB combined histogram" LINE_PADDING_6TAB
  31. "2: R histogram" LINE_PADDING_6TAB
  32. "3: G histogram" LINE_PADDING_6TAB
  33. "4: B histogram" LINE_PADDING_6TAB
  34. "5: Y (luminance) histogram" LINE_PADDING_6TAB
  35. "6, 7: must not be used"},
  36. };
  37. int light_isp_hist256_reg_dump(reg_analyzer_info_s *ra_info)
  38. {
  39. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  40. return ra_dump_reg_fields(ra_info, reg_desc, count);
  41. }
  42. int light_isp_hist256_reg_define(reg_analyzer_info_s *ra_info)
  43. {
  44. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  45. return ra_dump_reg_define(ra_info, reg_desc, count);
  46. }
  47. int light_isp_hist256_reg_find(reg_analyzer_info_s *ra_info)
  48. {
  49. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  50. return ra_dump_reg_find(ra_info, reg_desc, count);
  51. }