From 8a70c18d1e1444c509710aacfc4dfceb371d3c6a Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 5 May 2018 01:53:30 +0000 Subject: [PATCH] firmware: add debug output to hmc542 driver. --- artiq/firmware/libboard_artiq/hmc542.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/libboard_artiq/hmc542.rs b/artiq/firmware/libboard_artiq/hmc542.rs index 70cd8af54..52490cdd3 100644 --- a/artiq/firmware/libboard_artiq/hmc542.rs +++ b/artiq/firmware/libboard_artiq/hmc542.rs @@ -21,7 +21,7 @@ fn set_pins(card_index: usize, chan_index: usize, pins: u32) { clock::spin_us(100); } -/// Attenuation is in units of 0.5dB, from 0dB (0) to 31.5dB (63). +/// Attenuation is in units of 0.5 dB, from 0 dB (0) to 31.5 dB (63). pub fn program(card_index: usize, chan_index: usize, atten: u8) { assert!(card_index < 4 && chan_index < 2); @@ -42,6 +42,10 @@ pub fn program(card_index: usize, chan_index: usize, atten: u8) { set_pins(sin | PIN_CLK); } set_pins(PIN_LE); + + debug!("card {} channel {} set to {}{} dB", + card_index, chan_index, + atten / 2, if atten % 2 != 0 { ".5" } else { "" }); } /// See `program`.