PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/Libraries/TVout/spec/video_properties.h

https://github.com/iljamalenkov/pal_voltmeter
C++ Header | 67 lines | 27 code | 10 blank | 30 comment | 0 complexity | 8b69d98ce30dac2e650c97c7c412188c MD5 | raw file
  1. /*
  2. Copyright (c) 2010 Myles Metzer
  3. Permission is hereby granted, free of charge, to any person
  4. obtaining a copy of this software and associated documentation
  5. files (the "Software"), to deal in the Software without
  6. restriction, including without limitation the rights to use,
  7. copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the
  9. Software is furnished to do so, subject to the following
  10. conditions:
  11. The above copyright notice and this permission notice shall be
  12. included in all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  15. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  17. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  18. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. /*
  23. This File contains the timing definitions for the TVout AVR composite video
  24. generation Library
  25. */
  26. #ifndef VIDEO_TIMING_H
  27. #define VIDEO_TIMING_H
  28. #define _CYCLES_PER_US (F_CPU / 1000000)
  29. #define _TIME_HORZ_SYNC 4.7
  30. #define _TIME_VIRT_SYNC 58.85
  31. #define _TIME_ACTIVE 46
  32. #define _CYCLES_VIRT_SYNC ((_TIME_VIRT_SYNC * _CYCLES_PER_US) - 1)
  33. #define _CYCLES_HORZ_SYNC ((_TIME_HORZ_SYNC * _CYCLES_PER_US) - 1)
  34. //Timing settings for NTSC
  35. #define _NTSC_TIME_SCANLINE 63.55
  36. #define _NTSC_TIME_OUTPUT_START 12
  37. #define _NTSC_LINE_FRAME 262
  38. #define _NTSC_LINE_START_VSYNC 0
  39. #define _NTSC_LINE_STOP_VSYNC 3
  40. #define _NTSC_LINE_DISPLAY 216
  41. #define _NTSC_LINE_MID ((_NTSC_LINE_FRAME - _NTSC_LINE_DISPLAY)/2 + _NTSC_LINE_DISPLAY/2)
  42. #define _NTSC_CYCLES_SCANLINE ((_NTSC_TIME_SCANLINE * _CYCLES_PER_US) - 1)
  43. #define _NTSC_CYCLES_OUTPUT_START ((_NTSC_TIME_OUTPUT_START * _CYCLES_PER_US) - 1)
  44. //Timing settings for PAL
  45. #define _PAL_TIME_SCANLINE 64
  46. #define _PAL_TIME_OUTPUT_START 12.5
  47. #define _PAL_LINE_FRAME 312
  48. #define _PAL_LINE_START_VSYNC 0
  49. #define _PAL_LINE_STOP_VSYNC 7
  50. #define _PAL_LINE_DISPLAY 260
  51. #define _PAL_LINE_MID ((_PAL_LINE_FRAME - _PAL_LINE_DISPLAY)/2 + _PAL_LINE_DISPLAY/2)
  52. #define _PAL_CYCLES_SCANLINE ((_PAL_TIME_SCANLINE * _CYCLES_PER_US) - 1)
  53. #define _PAL_CYCLES_OUTPUT_START ((_PAL_TIME_OUTPUT_START * _CYCLES_PER_US) - 1)
  54. #endif