add radio_on and radio_off.

This commit is contained in:
Mariano Alvira 2009-05-11 12:01:15 -04:00
parent 05bd6c897c
commit ebee1f67d7
2 changed files with 15 additions and 0 deletions

View File

@ -412,6 +412,8 @@ void init_phy(void);
void vreg_init(void);
void ResumeMACASync(void);
void radio_init(void);
void radio_off(void);
void radio_on(void);
uint32_t init_from_flash(uint32_t addr);
void set_power(uint8_t power);
void set_channel(uint8_t chan);

View File

@ -146,6 +146,19 @@ void vreg_init(void) {
*(volatile uint32_t *)(0x80003048) = 0x00000ff8; /* start the regulators */
}
void radio_off(void) {
/* turn off the radio regulators */
reg(0x80003048) = 0x00000f00;
/* hold the maca in reset */
maca_reset = maca_reset_rst;
}
void radio_on(void) {
/* turn the radio regulators back on */
reg(0x80003048) = 0x00000f78;
/* reinitialize the phy */
init_phy();
}
/* radio_init has been tested to be good */
void radio_init(void) {