Allright, now I´ve changed the pwmgen value to minus for rev. So I got the DIR pin awake.
Here my final hal for all who find it use full:
Code:
#*******************
# SPINDLE 0
#*******************
setp hm2_5i24.0.pwmgen.pwm_frequency [SPINDLE_0]PWM_FREQ
setp hm2_5i24.0.pwmgen.00.scale [SPINDLE_0]OUTPUT_SCALE
setp hm2_5i24.0.pwmgen.00.output-type 1
setp hm2_5i24.0.pwmgen.00.out0.invert_output true # rising value -> rising voltage
setp hm2_5i24.0.pwmgen.00.out1.invert_output true # gpio 017 DIR M4 - high if pwmgen.00.value will be minus
setp hm2_5i24.0.gpio.016.is_output true # gpio 016 Aux M3 - set as output
setp hm2_5i24.0.gpio.016.invert_output true
net spindle-speed-cmd spindle.0.speed-out => hm2_5i24.0.pwmgen.00.value # rpm for PWM
net spindle-on spindle.0.on => hm2_5i24.0.pwmgen.00.enable # FU and PWM enable
net spindle-fwd spindle.0.forward => hm2_5i24.0.gpio.016.out # gpio 016 / Aux (M3)
my whole linuxcnc setup can be found here:
Linuxcnc config on github