From 7809ca5e89a83ad54607c73ad5be5af1cec47d3a Mon Sep 17 00:00:00 2001
From: Sergey Musikhin <musihin_sergei@mail.ru>
Date: Thu, 17 Jun 2021 18:59:41 +0000
Subject: [PATCH] Show PMIC controls

---
 grc/gen_bladerf_blocks.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/grc/gen_bladerf_blocks.py b/grc/gen_bladerf_blocks.py
index 34d8d5d..10711b7 100644
--- a/grc/gen_bladerf_blocks.py
+++ b/grc/gen_bladerf_blocks.py
@@ -25,6 +25,7 @@ category: '[bladeRF]'
 flags: throttle
 
 parameters:
+
   
 - id: metadata
   label: Metadata
@@ -109,6 +110,14 @@ parameters:
   dtype: real
   default: 10000
   hide: ${'$'}{ 'none' if use_dac == 'True' else 'part'} 
+  
+- id: show_pmic
+  label: 'Show PMIC controls'
+  dtype: enum
+  default: False
+  options: ['False', 'True']
+  hide: part  
+  
 
 - id: xb200
   category: x40/x115
@@ -167,6 +176,7 @@ inputs:
 - domain: message
   id: pmic_in
   optional: true
+  hide: ${'$'}{show_pmic == 'False'}
   
 % if sourk == 'source':
 outputs:
@@ -182,7 +192,8 @@ outputs:
 - domain: message
   id: pmic_out
   optional: true
-
+  hide: ${'$'}{show_pmic == 'False'}
+  
 templates:
   imports: |-
      import bladeRF
@@ -228,8 +239,7 @@ templates:
     self.${'$'}{id}.set_gain_mode(${'$'}{${'gain_mode' + str(n)}}, ${n})    
     % endif
     self.${'$'}{id}.set_gain(${'$'}{${'gain' + str(n)}}, ${n})
-    self.${'$'}{id}.set_if_gain(${'$'}{${'if_gain' + str(n)}}, ${n})
-    
+    self.${'$'}{id}.set_if_gain(${'$'}{${'if_gain' + str(n)}}, ${n})    
     ${'%'} endif
     % endfor
   callbacks:
-- 
GitLab