[an error occurred while processing this directive]
|
// for VC55009 (DA250) only
//{for VC5509A DA255 please reference to silicon errata}
#include /** DSP sleep down routine (don't work from CCS environment!!!)*/ /* Enable EXTERNAL HARDWARE INTERRUPT 0 EXT_INT0 */
E-mail:
info@telesys.ru
#include
#include
#include
#include
/** Power mode initialization () */
void Init_IDLE_Mode(void)
{
// make preliminary settings ->
// IRQ_globalDisable();
// CSL_init(); // moved to the main unit
// IRQ_setVecs((Uint32)(&VECSTART)); // moved to the main unit
// <-
// (sprs163d page58)
asm("\t OR #2000h, port(#6C00h) ;====> allow EHPI to be idle");
asm("\t RPT #30");
asm("\t NOP");
asm("\t AND #7FFCh, port(#6C00h) ;====> clear [parallel port mode] bits");
asm("\t OR #0001h, port(#6C00h) ;====> set EMIF mode");
asm("\t RPT #30");
asm("\t NOP");
// setup EXTERNAL HARDWARE INTERRUPT 0
IRQ_clear(2); //IRQ_clear(IRQ_EVT_SINT2);
IRQ_disable(2); //IRQ_disable(IRQ_EVT_SINT2);
IRQ_plug(2, &WakeUp_IRQ); //IRQ_plug(IRQ_EVT_SINT2, &WakeUp_IRQ);
MCBSP_FSET(PCR2,IDLEEN,1); //mcbsp2 idle
TIMER_FSET(TCR0,IDLEEN,1); //timer1 idle
TIMER_FSET(TCR1,IDLEEN,1); //timer2 idle
asm("\t OR #0001h, port(#7000h) ;====> allow USB to be idle");
PWR_RSET(ICR, 0x2C);
PWR_powerDown(PWR_WAKEUP_MI);
}
void DSP_Sleep_Down(void)
{
// disable all your interrupts in this place
IRQ_clear(2);//IRQ_clear(IRQ_EVT_SINT2);
IRQ_enable(2);//IRQ_enable(IRQ_EVT_SINT2);
// -- for 12MHz crystall
asm("\t MOV #0200h, port(#1E00h) ;====> set USBPLL to 4x lock mode to make it ran at 48MHz for 12 MHz input CLK");
asm("\t MOV #0210h, port(#1E00h) ;====> enable the USBPLL");
asm("\t OR #0001h, port(#7000h) ;====> allow USB to be idle");
PWR_RSET(ICR, 0x2C);
asm("\t IDLE");
asm("\t OR #4000h, port(#6C00h) ;====> disable clock oscilator");
asm("\t RPT #30");
asm("\t NOP");
PWR_RSET(ICR, 0x3F);
PWR_powerDown(PWR_WAKEUP_MI);
}
/** WakeUp interrupt attached to EXTERNAL HARDWARE INTERRUPT 0 EXT_INT0 event*/
interrupt void WakeUp_IRQ()
{
IRQ_disable((2));//IRQ_disable(IRQ_EVT_SINT2);
asm("\t AND #3FFFh, port(#6C00h) ;====> enable clock oscilator");
asm("\t RPT #100");
asm("\t NOP");
PWR_RSET(ICR, IDLE_CFG);
PWR_powerDown(PWR_WAKEUP_MI);
asm("\t RPT #100");
asm("\t NOP");
asm("\t BSET XF");
// + enable all your interrupts
}
Ответы