Topics

PTT with GPIO on PlutoSDR


Evariste Courjaud
 

To Simon :just a share of my code to implement easily PTT on GPO_0 of plutosdr. If it could be of nay help :

void fmc_enable_tx_lo(void)
  {
  struct iio_channel *chn = NULL;
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
  chn = iio_device_find_channel(dev, "altvoltage1", true);
  iio_channel_attr_write_bool(chn, "powerdown", false);
  }
   
  void fmc_disable_tx_lo(void)
  {
  struct iio_channel *chn = NULL;
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
  chn = iio_device_find_channel(dev, "altvoltage1", true);
  iio_channel_attr_write_bool(chn, "powerdown", true);
  }
  void fmc_tx_ptt(bool Tx)
  {
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
   
   
  if(Tx)
  {
   
  fmc_enable_tx_lo();
   
  iio_device_debug_attr_write(dev,"direct_reg_access","0x27 0x10");
  }
  else
  {
   
  fmc_disable_tx_lo();
  iio_device_debug_attr_write(dev,"direct_reg_access","0x27 0x00");
  }
   
   
  }


Siegfried Jackstien
 

ahhh yes please add that function :-)

dg9bfc sigi

Am 17.11.2019 um 11:53 schrieb Evariste Courjaud:

To Simon :just a share of my code to implement easily PTT on GPO_0 of plutosdr. If it could be of nay help :

void fmc_enable_tx_lo(void)
  {
  struct iio_channel *chn = NULL;
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
  chn = iio_device_find_channel(dev, "altvoltage1", true);
  iio_channel_attr_write_bool(chn, "powerdown", false);
  }
   
  void fmc_disable_tx_lo(void)
  {
  struct iio_channel *chn = NULL;
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
  chn = iio_device_find_channel(dev, "altvoltage1", true);
  iio_channel_attr_write_bool(chn, "powerdown", true);
  }
  void fmc_tx_ptt(bool Tx)
  {
  iio_device *dev = NULL;
  dev = get_ad9361_phy(m_ctx);
   
   
  if(Tx)
  {
   
  fmc_enable_tx_lo();
   
  iio_device_debug_attr_write(dev,"direct_reg_access","0x27 0x10");
  }
  else
  {
   
  fmc_disable_tx_lo();
  iio_device_debug_attr_write(dev,"direct_reg_access","0x27 0x00");
  }
   
   
  }


Joe Puma
 

Replying to bring this post back into focus. 

Joe


Siegfried Jackstien
 

not needed ...

the "real" development is done in the test team group and we already have it "in focus" :-)

greetz sigi dg9bfc

Am 01.04.2020 um 17:41 schrieb Joe Puma:

Replying to bring this post back into focus. 

Joe