OK, so I did quite some research today and came up with working code to set a pin high and then use FTM0 Channel0 to set the pin low again 100µS later
Code:
void ftm0_isr(void)
{
if(FTM0_C0SC & FTM_CSC_CHF) {
// There has been an interrupt with channel 0 of FTM0
FTM0_C0SC &= ~FTM_CSC_CHF; // First clear the channel flag because if you don't, then this ISR will continue to be called (K66 manual p 1148)
digitalWriteFast(13,LOW);
}
}
void setup() {
pinMode(13, OUTPUT); // Configure pin 13 (led) as an output
FTM0_MODE |= FTM_MODE_WPDIS; // Configure Features Mode Selection : Write Protection Disable (K66 manual p 1154)
FTM0_MODE |= FTM_MODE_FTMEN; // Configure Features Mode Selection : Flex Timer module enable (K66 manual p 1154)
FTM0_MODE |= FTM_MODE_INIT; // Configure Features Mode Selection : Perform init functions (K66 manual p 1153)
FTM0_SC = 0x00; // Configure Status And Control : Set this to zero before changing the modulus (K66 manual p 1144)
FTM0_CNTIN = 0x0000; // Configure Counter Initial Value : Set initial value of flextimer 0 to 0 (K66 manual p 1150)
FTM0_CNT = 0x0000; // Configure Counter : Reset the count to zero. It doesn't matter what value you write to _CNT since te counter will be loaded with FTM0_CNT whenever you write to this register (K66 manual p 1150)
FTM0_MOD = 0xFFFF; // Configure Counter Modulo : max modulus = 65535, so counter will run from 0 to 65535 and then overflow to 0 and count on (K66 manual p 1146)
FTM0_SC |= FTM_SC_CLKS(0b1); // Configure Status And Control : Set Clock Source to be 01: System Clock, which makes the counter run (K66 manual p 1145)
FTM0_SC |= FTM_SC_PS(0b111); // Configure Status And Control : Set Prescale Factor Selection to 111, which divides the clock by 128 (K66 manual p 1145)
FTM0_C0SC &= ~FTM_CSC_MSB; // Configure Channel Status And Control: Enable Output Compare Mode (K66 manual p 1149)
FTM0_C0SC |= FTM_CSC_MSA; // Configure Channel Status And Control: Enable Output Compare Mode (K66 manual p 1149)
NVIC_ENABLE_IRQ(IRQ_FTM0); // Enable the IRQ Interrupt for FTM0
FTM0_C0V = 0; // Set initial compare to 0 (K66 manual p 1147) , but this actually not even needed in this example
}
void loop()
{
delay(100);
digitalWriteFast(13,HIGH);
FTM0_CNT = 0x0000; // Configure Counter : Reset the count to zero. It doesn't matter what value you write to _CNT since te counter will be loaded with FTM0_CNT whenever you write to this register (K66 manual p 1150)
FTM0_C0V = 47;
FTM0_C0SC |= FTM_CSC_CHIE; // Configure Channel Status And Control: Enable Channel Compare Interrupt (K66 manual p 1148)
}
But.... although this code works perfectly, I'm looking for possible refinement.
This code . uses digitalWriteFast to set and reset pin 13 (ledpin) and this works fine.
Upon compare, ftm0_isr is called, which resets the correct interrupt flag and also sets pin 13 low again.
The main purpose for this code is to be able to set a pin high in mijn main loop somewhere and then rely on ftm0 to make the pin go low again 100µS later
I do understand that this code above works (tested with logic analyzer) and is a way to do it, but....
This code is using FTM0 on Channel 0 and FTM0_CH0 is exposed on pin 22 -> B11 (alt 4)
Could somebody help me out a little about HOW I could connect this so that instead of having to call digitalWriteFast, I could have pin 22 be toggled on and off based on this channel 0?
Could I eliminate the ftm0_isr routine completely ?
I know on arduino Due I was able to configure the system so that on start of the timer/channel , the pin gets set high and on compare it is automatically set low + the interrupt enable for that channel is disabled. (so you have to reenable the interrupt after each shot, which is wanted behaviour)
Hopefully somebody can help me out a little bit. I tried to document about every line in my code. Could be handy for other people reading and also for me in future of course 
PS Don't look too much at my main loop. It is just setup for testing purposes so my main loop sets up a pulse on pin13 10 times a second and then asks the ISR routine connected to FTM0 CHANNEL0 to set it low again 100µS laser