mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
cores/video: Add check of Video Timings and list available ones when not supported.
This commit is contained in:
parent
2ed5f14e9e
commit
c182f4db5f
1 changed files with 9 additions and 1 deletions
|
@ -141,7 +141,15 @@ video_data_layout = [
|
|||
|
||||
class VideoTimingGenerator(Module, AutoCSR):
|
||||
def __init__(self, default_video_timings="800x600@60Hz"):
|
||||
vt = video_timings[default_video_timings]
|
||||
# Check / Get Video Timings.
|
||||
try:
|
||||
vt = video_timings[default_video_timings]
|
||||
except KeyError:
|
||||
msg = [f"Video Timings {default_video_timings} not supported, availables:"]
|
||||
for video_timing in video_timings.keys():
|
||||
msg.append(f" - {video_timing} / {video_timings[video_timing]['pix_clk']/1e6:3.2f}MHz.")
|
||||
raise ValueError("\n".join(msg))
|
||||
|
||||
# MMAP Control/Status Registers.
|
||||
self._enable = CSRStorage(reset=1)
|
||||
|
||||
|
|
Loading…
Reference in a new issue