mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-26 04:00:38 +02:00
tools/atrf-txrx/atrf-txrx.c: add section headers and update clkm comment
This commit is contained in:
parent
8ac87a3fa1
commit
8710be5665
@ -74,9 +74,12 @@ enum mode {
|
|||||||
static volatile int run = 1;
|
static volatile int run = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Helper functions -------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clkm: 0 disable CLKM
|
* mhz: 0 disable CLKM
|
||||||
* >0 output 2^(clkm-1) MHz signal
|
* >0 output specified clock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct atrf_dsc *init_txrx(const char *driver, int trim, unsigned mhz)
|
static struct atrf_dsc *init_txrx(const char *driver, int trim, unsigned mhz)
|
||||||
@ -138,6 +141,9 @@ static void set_rate(struct atrf_dsc *dsc, uint8_t rate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Message transmit/receive ------------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
static void receive_message(struct atrf_dsc *dsc)
|
static void receive_message(struct atrf_dsc *dsc)
|
||||||
{
|
{
|
||||||
uint8_t buf[MAX_PSDU+1]; /* PSDU+LQI */
|
uint8_t buf[MAX_PSDU+1]; /* PSDU+LQI */
|
||||||
@ -320,6 +326,9 @@ static void transmit_hmac(struct atrf_dsc *dsc, const char *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- PER test ---------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static void transmit_pattern(struct atrf_dsc *dsc, double pause_s, int times)
|
static void transmit_pattern(struct atrf_dsc *dsc, double pause_s, int times)
|
||||||
{
|
{
|
||||||
uint8_t buf[MAX_PSDU];
|
uint8_t buf[MAX_PSDU];
|
||||||
@ -355,6 +364,9 @@ static void transmit_pattern(struct atrf_dsc *dsc, double pause_s, int times)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Ping -------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static void ping_tx(struct atrf_dsc *dsc, const struct ping *pck)
|
static void ping_tx(struct atrf_dsc *dsc, const struct ping *pck)
|
||||||
{
|
{
|
||||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_PLL_ON);
|
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_PLL_ON);
|
||||||
@ -440,6 +452,9 @@ static void ping(struct atrf_dsc *dsc, double max_wait_s, int master)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Continuous wave test ---------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static int test_mode(struct atrf_dsc *dsc, uint8_t cont_tx, const char *cmd)
|
static int test_mode(struct atrf_dsc *dsc, uint8_t cont_tx, const char *cmd)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
@ -459,6 +474,9 @@ static int test_mode(struct atrf_dsc *dsc, uint8_t cont_tx, const char *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Command-line processing ------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static void die(int sig)
|
static void die(int sig)
|
||||||
{
|
{
|
||||||
run = 0;
|
run = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user