I need to set a pin to high at the last n bits of a SPI transfer. It can also be CS line of the SPI.
What is the best way of doinf this?
Is there a way to trigger a PWM pulse automatically after starting a SPI transfer?
Hi,The SPI Frame Output Trigger (Table 49-12 RM rev7) can be routed to a GPIO pin (TRGMUX_OUTx function).The GPIO will then be set HIGH at the end of each frame when CS negates.
PCC->PCCn[PCC_PORTA_INDEX ] |= PCC_PCCn_CGC_MASK; /* Enable clock for PORTA */PORTA->PCR |= PORT_PCR_MUX(7); /* Port A0: MUX = ALT7, TRGMUX_OUT3 */TRGMUX->TRGMUXn = 0x3D000000; /* LPSPI1_Frame trigger */
Retrieving data ...