m5_isp_is.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 MRV_IS_BASE 0x2300
  16. #define REG_BASE MRV_IS_BASE
  17. static const reg_field_s reg_desc[] = {
  18. /* structure field order
  19. reg_name, offset,reset_value,msb,lsb, field_name, field_desc */
  20. {"ISP_IS_CTRL", "Image Stabilization Control Register",
  21. 0x00002300, 0x00000000, 0, 0, "is_en", "Image stabilization state. 0: off ; 1: on"},
  22. {"ISP_IS_RECENTER", "Image Stabilization Re-center Register",
  23. 0x00002304, 0x00000000, 0, 0, "is_recenter", "0: re-center feature switched off; 1..7: re-centering by (cur_h/v_offs-H/V_OFFS)/2^RECENTER"},
  24. {"ISP_IS_H_OFFS", "Horizontal Offset of Output Window",
  25. 0x00002308, 0x00000000, 13, 0, "is_h_offs", "Horizontal picture offset in pixels"},
  26. {"ISP_IS_V_OFFS", "Vertical Offset of Output Window",
  27. 0x0000230C, 0x00000000, 13, 0, "is_v_offs", "Vertical picture offset in lines"},
  28. {"ISP_IS_H_SIZE", "Horizontal Output Picture Size",
  29. 0x00002310, 0x00001000, 13, 0, "is_h_size", "Horizontal picture size in pixels if ISP_MODE is set to: ..."},
  30. {"ISP_IS_V_SIZE", "Vertical Output Picture Size",
  31. 0x00002314, 0x00001000, 13, 0, "is_v_size", "Vertical picture size in lines"},
  32. };
  33. int light_isp_is_reg_dump(reg_analyzer_info_s *ra_info)
  34. {
  35. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  36. return ra_dump_reg_fields(ra_info, reg_desc, count);
  37. }
  38. int light_isp_is_reg_define(reg_analyzer_info_s *ra_info)
  39. {
  40. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  41. return ra_dump_reg_define(ra_info, reg_desc, count);
  42. }
  43. int light_isp_is_reg_find(reg_analyzer_info_s *ra_info)
  44. {
  45. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  46. return ra_dump_reg_find(ra_info, reg_desc, count);
  47. }