mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
The Great ATSPI Renaming, part 6: change atrf API from atspi_* to atrf_*
- include/atrf.h, lib/atrf.c (struct atspi_dsc): renamed to "struct atrf_dsc" - include/atrf.h, lib/atrf.c (atspi_*): renamed all functions to atrf_* - include/misctxrx.h, lib/misctxrx.c (wait_for_interrupt): updated for API name change - atspi-id/atspi-id.c (show_usb_info, show_info, main), atspi-reset/atspi-reset.c (main), atspi-rssi/atspi-rssi.c (sweep, main), atspi-rssi/gui.h (gui), atspi-rssi/gui.c (sweep, gui), atspi-trim/atspi-trim.c (main), atspi-txrx/atspi-txrx.c (init_txrx, set_channel, set_power, receive, transmit, test_mode, main): updated for API name change
This commit is contained in:
@@ -32,18 +32,18 @@ static struct timeval t0;
|
||||
static volatile int run = 1;
|
||||
|
||||
|
||||
static void sweep(struct atspi_dsc *dsc)
|
||||
static void sweep(struct atrf_dsc *dsc)
|
||||
{
|
||||
int chan, rssi;
|
||||
struct timeval t;
|
||||
|
||||
for (chan = 11; chan <= 26; chan++) {
|
||||
atspi_reg_write(dsc, REG_PHY_CC_CCA, chan);
|
||||
atrf_reg_write(dsc, REG_PHY_CC_CCA, chan);
|
||||
/* 150 us, according to AVR2001 section 3.5 */
|
||||
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 10, 20);
|
||||
|
||||
gettimeofday(&t, NULL);
|
||||
rssi = atspi_reg_read(dsc, REG_PHY_RSSI) & RSSI_MASK;
|
||||
rssi = atrf_reg_read(dsc, REG_PHY_RSSI) & RSSI_MASK;
|
||||
t.tv_sec -= t0.tv_sec;
|
||||
t.tv_usec -= t0.tv_usec;
|
||||
printf("%d %f %d\n",
|
||||
@@ -77,7 +77,7 @@ static void usage(const char *name)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct atspi_dsc *dsc;
|
||||
struct atrf_dsc *dsc;
|
||||
unsigned long arg = 0, i;
|
||||
char *end;
|
||||
int c;
|
||||
@@ -115,12 +115,12 @@ int main(int argc, char **argv)
|
||||
|
||||
signal(SIGINT, die);
|
||||
|
||||
dsc = atspi_open();
|
||||
dsc = atrf_open();
|
||||
if (!dsc)
|
||||
return 1;
|
||||
|
||||
atspi_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TRX_OFF);
|
||||
atspi_reg_write(dsc, REG_TRX_STATE, TRX_CMD_RX_ON);
|
||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TRX_OFF);
|
||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_RX_ON);
|
||||
/*
|
||||
* We'll wait for the PLL lock after selecting the channel.
|
||||
*/
|
||||
@@ -133,9 +133,9 @@ int main(int argc, char **argv)
|
||||
sweep(dsc);
|
||||
}
|
||||
|
||||
atspi_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TRX_OFF);
|
||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TRX_OFF);
|
||||
|
||||
atspi_close(dsc);
|
||||
atrf_close(dsc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,16 +67,16 @@ static void shift_grid(int *z, int nx, int ny)
|
||||
}
|
||||
|
||||
|
||||
static void sweep(struct atspi_dsc *dsc, int *z)
|
||||
static void sweep(struct atrf_dsc *dsc, int *z)
|
||||
{
|
||||
int chan;
|
||||
|
||||
for (chan = 11; chan <= 26; chan++) {
|
||||
atspi_reg_write(dsc, REG_PHY_CC_CCA, chan);
|
||||
atrf_reg_write(dsc, REG_PHY_CC_CCA, chan);
|
||||
/* 150 us, according to AVR2001 section 3.5 */
|
||||
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 10, 20);
|
||||
|
||||
*z++ = Z_STEP*atspi_reg_read(dsc, REG_PHY_RSSI) & RSSI_MASK;
|
||||
*z++ = Z_STEP*atrf_reg_read(dsc, REG_PHY_RSSI) & RSSI_MASK;
|
||||
#if 0
|
||||
if (chan >= 13 && chan <= 19 )
|
||||
z[-1] = 3*28-(chan-16)*(chan-16)*(chan-16)*(chan-16);
|
||||
@@ -121,7 +121,7 @@ static void label_channels(SDL_Surface *s, int sx, int x0, int y0)
|
||||
}
|
||||
|
||||
|
||||
void gui(struct atspi_dsc *dsc)
|
||||
void gui(struct atrf_dsc *dsc)
|
||||
{
|
||||
SDL_Surface *surf;
|
||||
int z[N_CHAN*N_TIME];
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
#include "atrf.h"
|
||||
|
||||
|
||||
void gui(struct atspi_dsc *dsc);
|
||||
void gui(struct atrf_dsc *dsc);
|
||||
|
||||
#endif /* !GUI_H */
|
||||
|
||||
Reference in New Issue
Block a user