@@ -29,13 +29,30 @@ def measure_volts(self, type="core"):
29
29
else :
30
30
raise ValueError ("Type must be one of core, sdram_c, sdram_i, sdram_p" )
31
31
32
+ def measure_clock (self , type ):
33
+ if type in ["arm" , "core" , "h264" , "isp" , "v3d" , "uart" , "pwm" , "emmc" , "pixel" , "vec" , "hdmi" , "dpi" ]:
34
+ line = subprocess .check_output (["vcgencmd" , "measure_clock" , type ])
35
+ return self ._parse_line_get_value (line )
36
+ else :
37
+ raise ValueError ("Type must be on of arm, core, h264, isp, v3d, uart, pwm, emmc, pixel, vec, hdmi, dpi" )
38
+
32
39
def is_codec_available (self , codec ):
33
40
if codec in ["H264" , "MPG2" , "WVC1" , "MPG4" , "MJPG" , "WMV9" ]:
34
- line = subprocess .check_output (["line " , "codec_enabled" , codec ])
41
+ line = subprocess .check_output (["vcgencmd " , "codec_enabled" , codec ])
35
42
return self ._parse_line_get_value (line )
36
43
else :
37
44
raise ValueError ("Codec must be one of H264, MPG2, WVC1, MPG4, MJPG, WMV9" )
38
45
46
+ def get_version (self ):
47
+ return subprocess .check_output (["vcgencmd" , "version" ])
48
+
49
+ def set_display_power (self , power ):
50
+ if power in [0 , 1 ]:
51
+ subprocess .check_output (["vcgencmd" , str (power )])
52
+ else :
53
+ raise ValueError ("Power must be either 0 or 1" )
54
+
55
+
39
56
def _parse_line_get_value (self , line ):
40
57
return line .split ("=" )[1 ]
41
58
0 commit comments