Gem_isp_enhance.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // =============================================================================
  2. // File : Gem_isp_enhance.c
  3. // Version : v1.0
  4. // Author : Honglei Zhu
  5. // Date : 2014.12.5
  6. // -----------------------------------------------------------------------------
  7. // Description :
  8. //
  9. // -----------------------------------------------------------------------------
  10. #include "Gem_isp_enhance.h"
  11. #include "Gem_isp_io.h"
  12. void isp_enhance_init_io (isp_enhance_ptr_t p_enhance)
  13. {
  14. int data0, data1, data2;
  15. data0 = ((p_enhance->sharp.enable & 0x01) << 0)
  16. | ((p_enhance->sharp.mode & 0x01) << 1)
  17. | ((p_enhance->sharp.coring & 0x07) << 5)
  18. | ((p_enhance->sharp.strength & 0xFF) << 8)
  19. | ((p_enhance->sharp.gainmax & 0x3FF) << 16)
  20. ;
  21. data1 = ((p_enhance->bcst.enable & 0x001) << 31)
  22. | ((p_enhance->bcst.bright & 0x3FF) << 0)
  23. | ((p_enhance->bcst.offset0 & 0x3FF) << 10)
  24. | ((p_enhance->bcst.offset1 & 0x3FF) << 20)
  25. ;
  26. data2 = ((p_enhance->bcst.contrast & 0x7FF) << 0)
  27. | ((p_enhance->bcst.satuation & 0x7FF) << 11)
  28. | ((p_enhance->bcst.hue & 0x0FF) << 24)
  29. ;
  30. Gem_write ((GEM_ENHANCE_BASE+0x00), data0);
  31. Gem_write ((GEM_ENHANCE_BASE+0x04), data1);
  32. Gem_write ((GEM_ENHANCE_BASE+0x08), data2);
  33. }