diff --git a/include/maca.h b/include/maca.h index e9079ea9d..3091685ce 100644 --- a/include/maca.h +++ b/include/maca.h @@ -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); diff --git a/src/maca.c b/src/maca.c index 6f0608aba..9416e4dd4 100644 --- a/src/maca.c +++ b/src/maca.c @@ -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) {