Hi, I am not understand SSI interrupt to send char or array of char
Now I create system in tm4c1294 and use leds for indicate interrupt flags, and in interrupt handler clear it, but it not reset.
init ssi function
void SSI3_TI_init(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
GPIOPinConfigure(GPIO_PQ0_SSI3CLK);
GPIOPinConfigure(GPIO_PQ1_SSI3FSS);
GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0);
GPIOPinConfigure(GPIO_PQ3_SSI3XDAT1);
GPIOPinTypeSSI(GPIO_PORTQ_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1 |GPIO_PIN_0);
IntMasterEnable();
SSIConfigSetExpClk(SSI3_BASE, 48000000, SSI_FRF_TI, SSI_MODE_MASTER, 2000000, 8);
SSIIntRegister(SSI3_BASE, SSI3_Int_Handler);
SSIIntEnable(SSI3_BASE, SSI_TXEOT|SSI_RXFF);//SSI_RXTO|SSI_RXOR|SSI_TXFF
IntEnable(INT_SSI3);
SSIEnable(SSI3_BASE);
}
send func
void send_byte_ssi3 (uint32_t value)
{
while ( ((SSIIntStatus(SSI3_BASE, true)) & SSI_TXFF) == 0 );
SSIDataPut(SSI3_BASE, value );
}
interrupt handler
void SSI3_Int_Handler(void)
{
uint32_t ui32Status;
//
// Read the interrupt status to find the cause of the interrupt
//
ui32Status = SSIIntStatus(SSI3_BASE, true);
if (ui32Status & SSI_TXEOT)
{
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0);
SSIIntClear (SSI3_BASE, SSI_TXEOT);
}
if (ui32Status & SSI_TXFF)
{
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1);
SSIIntClear (SSI3_BASE, SSI_TXFF);
if(((SSIIntStatus(SSI3_BASE, true)) && SSI_TXFF) == 0)
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_PIN_0);
}
else
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_PIN_4);
}
}
}
main
int main(void)
{
uint32_t pui32DataTx[NUM_SSI_DATA];
uint32_t pui32DataRx[NUM_SSI_DATA];
uint32_t ui32Index;
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
InitConsole();
UARTprintf("SSI ->\n");
UARTprintf(" Mode: TI\n");
UARTprintf(" Data: 8-bit\n\n");
board_leds_ini();
SSI3_TI_init();
//
// Initialize the data to send.
//
pui32DataTx[0] = 't';
pui32DataTx[1] = 'i';
pui32DataTx[2] = '!';
//
// Display indication that the SSI is transmitting data.
//
UARTprintf("Sent:\n ");
//
// Send 3 bytes of data.
//
for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
{
//
// Display the data that SSI is transferring.
//
UARTprintf("'%c' ", pui32DataTx[ui32Index]);
//
// Send the data using the "blocking" put function. This function
// will wait until there is room in the send FIFO before returning.
// This allows you to assure that all the data you send makes it into
// the send FIFO.
//
send_byte_ssi3( pui32DataTx[ui32Index]);
}
//
// Wait until SSI0 is done transferring all the data in the transmit FIFO.
//
while(SSIBusy(SSI3_BASE))
{
}
//
// Display indication that the SSI is receiving data.
//
UARTprintf("\nReceived:\n ");
//
// Receive 3 bytes of data.
//
for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
{
//
// Receive the data using the "blocking" Get function. This function
// will wait until there is data in the receive FIFO before returning.
//
SSIDataGet(SSI3_BASE, &pui32DataRx[ui32Index]);
//
// Since we are using 8-bit data, mask off the MSB.
//
pui32DataRx[ui32Index] &= 0x00FF;
//
// Display the data that SSI0 received.
//
UARTprintf("'%c' ", pui32DataRx[ui32Index]);
}
UARTprintf("\n ");
//
// Return no errors
//
return(0);
}
In result I am not have SSI_TXEOT bit set, and not received information, bit SSI_TXFF but not work
Ps Thanks for all answers