Beispiel #1
0
void maca_init(void) {
    reset_maca();
    radio_init();
    flyback_init();
    init_phy();
    free_head = 0;
    tx_head = 0;
    rx_head = 0;
    rx_end = 0;
    tx_end = 0;
    dma_tx = 0;
    dma_rx = 0;
    free_all_packets();

#if DEBUG_MACA
    Print_Packets("maca_init");
#endif

    /* initial radio command */
    /* nop, promiscuous, no cca */
    *MACA_CONTROL = (1 << PRM) | (NO_CCA << MODE);

    enable_irq(MACA);
    *INTFRC = (1 << INT_NUM_MACA);
}
Beispiel #2
0
void maca_init(void) {
    reset_maca();
    radio_init();
    flyback_init();
    init_phy();
    set_channel(0); /* things get weird if you never set a channel */
    set_power(0);   /* set the power too --- who knows what happens if you don't */
    free_head = 0;
    tx_head = 0;
    rx_head = 0;
    rx_end = 0;
    tx_end = 0;
    dma_tx = 0;
    dma_rx = 0;
    free_all_packets();

#if DEBUG_MACA
    Print_Packets("maca_init");
#endif

    /* initial radio command */
    /* nop, promiscuous, no cca */
    *MACA_CONTROL =
        (prm_mode << PRM) |
        (NO_CCA << MACA_MODE);

    enable_irq(MACA);
    *INTFRC = (1 << INT_NUM_MACA);
}
void maca_on(void) {
	/* turn the radio regulators back on */
	reg(0x80003048) =  0x00000f78; 
	/* reinitialize the phy */
	reset_maca();
	init_phy();
	
	enable_irq(MACA);
	*INTFRC = (1 << INT_NUM_MACA);
}