]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blobdiff - sw/app/rocon/appl_pxmc.c
RoCoN: add test for channels mutual current ADC calibration and check.
[fpga/lx-cpu1/lx-rocon.git] / sw / app / rocon / appl_pxmc.c
index fdd9ef98fba155032e30e7aa2f607e6bc794aec4..ec520dce6b422cba53830e2da86ffd00db342278 100644 (file)
@@ -393,6 +393,19 @@ pxmc_rocon_pwm_chan2reg(unsigned chan)
   return pwm_reg;
 }
 
+int pxmc_rocon_pwm_direct_wr(unsigned chan, unsigned pwm, int en)
+{
+  volatile uint32_t *pwm_reg;
+  pwm_reg = pxmc_rocon_pwm_chan2reg(chan);
+
+  if (pwm_reg == &pxmc_rocon_pwm_dummy_reg)
+    return -1;
+
+  *pwm_reg = pwm | (en? 0x4000: 0x8000);
+
+  return 0;
+}
+
 /**
  * pxmc_rocon_pwm3ph_wr - Output of the 3-phase PWM to the hardware
  * @mcs:  Motion controller state information