EasyManua.ls Logo

Microsemi SmartFusion2 - Page 782

Microsemi SmartFusion2
829 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Fabric Interface Interrupt Controller
UG0331 User Guide Revision 15.0 748
Example: The following code illustrates the usage of the MSS to the fabric interrupt in conjunction with
the Timer1 interrupt.
int main()
{
// STEP 1 - Enable Timer1 MSS to Fabric Interrupt (MSS_INT_M2F[10])
INTERRUPT_CTRL_BITBAND->TIMER1_INTR_ENBL = 1;
// STEP 2 - Configure Timer1 in PERIODIC MODE
MSS_TIM1_init(MSS_TIMER_PERIODIC_MODE );
// STEP 3 - Load count value
MSS_TIM1_load_immediate(10000000 );
// STEP 4 - Start Timer1
MSS_TIM1_start();
// STEP 5 - Enable Timer1 Interrupt and IRQ in NVIC
MSS_TIM1_enable_irq();
// Foreground loop
for(;;)
{
;
}
return 0;
}
/*
* Connect MSS_INT_M2F[10] signal to LED.
* Toggle LED on TIM1 interrupt.
*/
__attribute__((__interrupt__)) void Timer1_IRQHandler( void )
{
uint32_t timer1_interrupt;
// Read Timer1 MSS to Fabric Interrupt status
timer1_interrupt = INTERRUPT_CTRL_BITBAND->TIMER1_INTR_STATUS;
// Delay for extending the Timer1 MSS to fabric Interrupt pulse width
delay(10000);
/* Clear TIM1 interrupt */
MSS_TIM1_clear_irq();
}
23.3.2.2.2 Soft Processor in FPGA fabric
If MSS peripheral interrupt sources to be used as an interrupt sources to a soft processor within the
FPGA fabric, the following steps to be implemented in soft processor.
Step 1 - Enabling the MSS to the Fabric interrupt
Set M2F interrupt enable register bit of MSS peripheral in <INTERRUPT_ENABLE0> or
<INTERRUPT_ENABLE1> registers.
For example, to enable Timer1 MSS to fabric interrupt (MSS_INT_M2F [10]), TIMER1_INTR_ENBL bit in
INTERRUPT_ENABLE0 register must be set.

Table of Contents

Other manuals for Microsemi SmartFusion2

Related product manuals