koreio_test.c File Reference

Include dependency graph for koreio_test.c:

Go to the source code of this file.

Defines

#define id   0x00000400
#define null   0x1E7F4000
#define one   0x1E7F7900
#define two   0x1E7F2400
#define three   0x1E7F3000
#define four   0x1E7F1900
#define five   0x1E7F1200
#define six   0x1E7F0200
#define seven   0x1E7F7800
#define eight   0x1E7F0000
#define nine   0x1E7F1000
#define can_status   0x02
#define id_led   0x00000300
#define can_data1   0x1E

Functions

static void ctrlc_handler (int sig)
int quit (int argc, char *argv[], void *data)
int readios (int argc, char *argv[], void *data)
int configio (int argc, char *argv[], void *data)
int resetio (int argc, char *argv[], void *data)
int changeled (int argc, char *argv[], void *data)
int changeio (int argc, char *argv[], void *data)
int setio (int argc, char *argv[], void *data)
int readad (int argc, char *argv[], void *data)
int readcan (int argc, char *argv[], void *data)
int can7seg (int argc, char *argv[], void *data)
int canled (int argc, char *argv[], void *data)
int setad (int argc, char *argv[], void *data)
int setratio (int argc, char *argv[], void *data)
int setfreq (int argc, char *argv[], void *data)
int readio (int argc, char *argv[], void *data)
int changepw (int argc, char *argv[], void *data)
int setpw (int argc, char *argv[], void *data)
int readi2c (int argc, char *argv[], void *data)
int writei2c (int argc, char *argv[], void *data)
int startscan (int argc, char *argv[], void *data)
int listscan (int argc, char *argv[], void *data)
int resetpw (int argc, char *argv[], void *data)
int timer (int argc, char *argv[], void *data)
int help (int argc, char *argv[], void *data)
int main (int argc, char *argv[])

Variables

static int quitReq = 0
static knet_dev_tkoreio
static kb_command_t cmds []
static char buf [1024]


Detailed Description

KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.
KoreIO test program

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA
Bug:
none discovered.
Todo:
nothing.

Definition in file koreio_test.c.


Define Documentation

#define can_data1   0x1E

#define can_status   0x02

#define eight   0x1E7F0000

#define five   0x1E7F1200

#define four   0x1E7F1900

#define id   0x00000400

#define id_led   0x00000300

#define nine   0x1E7F1000

#define null   0x1E7F4000

#define one   0x1E7F7900

#define seven   0x1E7F7800

#define six   0x1E7F0200

#define three   0x1E7F3000

#define two   0x1E7F2400


Function Documentation

int can7seg ( int  argc,
char *  argv[],
void *  data 
)

Write on the CAN bus and change the 7 seg value (work only with the CAN developement kit)

Definition at line 186 of file koreio_test.c.

References can_status, eight, five, four, kio_SendCAN(), nine, null, one, seven, six, three, and two.

Here is the call graph for this function:

int canled ( int  argc,
char *  argv[],
void *  data 
)

Change the state of the three led on the CAN developpement kit

Definition at line 250 of file koreio_test.c.

References can_data1, can_status, id_led, kio_SendCAN(), and status().

Here is the call graph for this function:

int changeio ( int  argc,
char *  argv[],
void *  data 
)

Change the given digital output value

Definition at line 115 of file koreio_test.c.

References kio_ChangeIO().

Here is the call graph for this function:

int changeled ( int  argc,
char *  argv[],
void *  data 
)

Change the LED state

Definition at line 100 of file koreio_test.c.

References kio_ChangeLed().

Here is the call graph for this function:

int changepw ( int  argc,
char *  argv[],
void *  data 
)

Change the given power output value

Definition at line 341 of file koreio_test.c.

References kio_ChangePW().

Here is the call graph for this function:

int configio ( int  argc,
char *  argv[],
void *  data 
)

Configure the given digital IO The first argument is the IO number The second argument is: 0 to set as input 1 to set as ouput 2 to set as pwm

Definition at line 66 of file koreio_test.c.

References kio_ConfigIO().

Here is the call graph for this function:

static void ctrlc_handler ( int  sig  )  [static]

Make sure the program terminate properly on a ctrl-c

Definition at line 35 of file koreio_test.c.

References quitReq.

int help ( int  argc,
char *  argv[],
void *  data 
)

Display a list of available commands.

Definition at line 453 of file koala_GoAutomation.c.

int listscan ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 423 of file koreio_test.c.

References kio_i2c_ListScan().

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 530 of file koreio_test.c.

References ctrlc_handler(), kb_init(), kb_parse_command(), kb_set_debug_level(), kio_GetFWVersion(), KNET_BUS_ANY, knet_close(), knet_open(), and quitReq.

Here is the call graph for this function:

int quit ( int  argc,
char *  argv[],
void *  data 
)

Quit the program.

Definition at line 43 of file koreio_test.c.

References quitReq.

int readad ( int  argc,
char *  argv[],
void *  data 
)

Read the given analog input value

Definition at line 145 of file koreio_test.c.

References kio_ReadAnalog().

Here is the call graph for this function:

int readcan ( int  argc,
char *  argv[],
void *  data 
)

Read the can message in the buffer and erase it

Definition at line 163 of file koreio_test.c.

References can_data1, can_status, id, and kio_ReadCAN().

Here is the call graph for this function:

int readi2c ( int  argc,
char *  argv[],
void *  data 
)

read on the secondary I2C bus n_times (max 4)

Definition at line 371 of file koreio_test.c.

References kio_i2c_ReturnRead(), and kio_i2c_StartRead().

Here is the call graph for this function:

int readio ( int  argc,
char *  argv[],
void *  data 
)

Read the given IO state

Definition at line 326 of file koreio_test.c.

References kio_ReadIO().

Here is the call graph for this function:

int readios ( int  argc,
char *  argv[],
void *  data 
)

Read all the IO states and display them. The first digit displayed is IO0 and the last is IO15. A x is displayed for IOs in output mode and a p is displayed for IOs in pwm mode

Definition at line 53 of file koreio_test.c.

int resetio ( int  argc,
char *  argv[],
void *  data 
)

Reset the given digital output value

Definition at line 85 of file koreio_test.c.

References kio_ClearIO().

Here is the call graph for this function:

int resetpw ( int  argc,
char *  argv[],
void *  data 
)

Reset the given power output value

Definition at line 443 of file koreio_test.c.

References kio_ClearPW().

Here is the call graph for this function:

int setad ( int  argc,
char *  argv[],
void *  data 
)

Change the given analog output value

Definition at line 278 of file koreio_test.c.

References kio_SetANValue().

Here is the call graph for this function:

int setfreq ( int  argc,
char *  argv[],
void *  data 
)

Set the PWM channel frequence

Definition at line 311 of file koreio_test.c.

References kio_ChangePWM_freq().

Here is the call graph for this function:

int setio ( int  argc,
char *  argv[],
void *  data 
)

Set the given digital output value

Definition at line 130 of file koreio_test.c.

References kio_SetIO().

Here is the call graph for this function:

int setpw ( int  argc,
char *  argv[],
void *  data 
)

Set the given power output value

Definition at line 356 of file koreio_test.c.

References kio_SetPW().

Here is the call graph for this function:

int setratio ( int  argc,
char *  argv[],
void *  data 
)

Set the PWM channel ratio

Definition at line 296 of file koreio_test.c.

References kio_ChangePWM_ratio().

Here is the call graph for this function:

int startscan ( int  argc,
char *  argv[],
void *  data 
)

Start an address Scan on the secondary I2C bus. The list of answering devices must be consulted using readlist.

Definition at line 414 of file koreio_test.c.

References kio_i2c_StartScan().

Here is the call graph for this function:

int timer ( int  argc,
char *  argv[],
void *  data 
)

Handle the Analog measurement timestamp timer Argument 1 is: 0 to reset the timer 1 to stop the timer 2 to launch the timer

Definition at line 462 of file koreio_test.c.

References kio_Timer().

Here is the call graph for this function:

int writei2c ( int  argc,
char *  argv[],
void *  data 
)

Write on the secondary I2C bus

Definition at line 401 of file koreio_test.c.

References kio_i2c_Write().

Here is the call graph for this function:


Variable Documentation

char buf[1024] [static]

Main program to process the command line.

Definition at line 528 of file koreio_test.c.

kb_command_t cmds[] [static]

Initial value:

 {
  { "quit"            , 0 , 0 , quit } ,
  { "exit"            , 0 , 0 , quit } ,
  { "bye"             , 0 , 0 , quit } ,
  { "readios"         , 0 , 0 , readios },
  { "readio"          , 1 , 1 , readio },
  { "setio"           , 1 , 1 , setio },
  { "cleario"         , 1 , 1 , resetio },
  { "setratio"        , 2 , 2 , setratio },
  { "setfreq"         , 1 , 1 , setfreq },
  { "setpw"           , 1 , 1 , setpw },
  { "clearpw"         , 1 , 1 , resetpw },
  { "changepw"        , 1 , 1 , changepw },
  { "changeio"        , 1 , 1 , changeio },
  { "changeled"       , 1 , 1 , changeled },
  { "configio"        , 2 , 2 , configio },
  { "readad"          , 1 , 1 , readad },
  { "setad"           , 2 , 2 , setad },
  { "startscan"       , 0 , 0 , startscan},
  { "listscan"        , 0 , 0 , listscan},
  { "readi2c"         , 3 , 3 , readi2c },
  { "writei2c"        , 3 , 3 , writei2c },
  { "readcan"         , 0 , 0 , readcan},
  { "can7seg"         , 1 , 1 , can7seg},
  { "canled"          , 2 , 2 , canled},
  { "timer"           , 1 , 1 , timer},
  { "help"            , 0 , 0 , help } ,
  { NULL              , 0 , 0 , NULL }
}
The command table contains: command name : min number of args : max number of args : the function to call

Definition at line 480 of file koreio_test.c.

knet_dev_t* koreio [static]

Definition at line 29 of file koreio_test.c.

int quitReq = 0 [static]

Definition at line 28 of file koreio_test.c.


Generated on Wed Dec 15 11:49:30 2010 for KoreBot Library by  doxygen 1.5.5