isp_afm.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 0x00002000
  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_AFM_CTRL", "Auto Focus Measurement Unit Control Register",
  20. 0x00002000, 0x00000000, 0, 0, "afm_en", "AF measurement enable. 0: disable; 1: enable" LINE_PADDING_6TAB
  21. "Writing a 1 to this register starts a new measurement " LINE_PADDING_6TAB
  22. "and resets the afm_fin (measurement finished) interrupt to 0." LINE_PADDING_6TAB
  23. "As long as the afm_en is 1, the AFM unit calculates new sharpness values for each frame."},
  24. };
  25. int light_isp_afm_reg_dump(reg_analyzer_info_s *ra_info)
  26. {
  27. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  28. return ra_dump_reg_fields(ra_info, reg_desc, count);
  29. }
  30. int light_isp_afm_reg_define(reg_analyzer_info_s *ra_info)
  31. {
  32. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  33. return ra_dump_reg_define(ra_info, reg_desc, count);
  34. }
  35. int light_isp_afm_reg_find(reg_analyzer_info_s *ra_info)
  36. {
  37. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  38. return ra_dump_reg_find(ra_info, reg_desc, count);
  39. }