Added channel_get() to the cc2x3x RF drivers

This commit is contained in:
George Oikonomou 2012-04-30 17:04:55 +01:00
parent d66241fd97
commit 43f2790357
5 changed files with 15 additions and 8 deletions

View file

@ -104,6 +104,7 @@ PROCESS(cc2430_rf_process, "CC2430 RF driver");
/*---------------------------------------------------------------------------*/
static uint8_t rf_initialized = 0;
static uint8_t __data rf_flags;
static uint8_t rf_channel;
static int on(void); /* prepare() needs our prototype */
static int off(void); /* transmit() needs our prototype */
@ -194,9 +195,17 @@ cc2430_rf_channel_set(uint8_t channel)
cc2430_rf_command(ISRXON);
rf_channel = channel;
return (int8_t) channel;
}
/*---------------------------------------------------------------------------*/
uint8_t
cc2430_rf_channel_get()
{
return rf_channel;
}
/*---------------------------------------------------------------------------*/
/**
* Select RF transmit power.
*

View file

@ -74,6 +74,7 @@ extern const struct radio_driver cc2430_rf_driver;
void cc2430_rf_command(uint8_t command);
int8_t cc2430_rf_channel_set(uint8_t channel);
uint8_t cc2430_rf_channel_get();
uint8_t cc2430_rf_power_set(uint8_t new_power);
void cc2430_rf_set_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr);

View file

@ -121,6 +121,7 @@
extern const struct radio_driver cc2530_rf_driver;
/*---------------------------------------------------------------------------*/
int8_t cc2530_rf_channel_set(uint8_t channel);
#define cc2530_rf_channel_get() ((uint8_t)((FREQCTRL + 44) / 5))
uint8_t cc2530_rf_power_set(uint8_t new_power);
void cc2530_rf_set_addr(uint16_t pan);
/*---------------------------------------------------------------------------*/