Go to the source code of this file.
Functions | |
static void | ctrlc_handler (int sig) |
int | quit (int argc, char *argv[], void *data) |
int | configio (int argc, char *argv[], void *data) |
int | resetio (int argc, char *argv[], void *data) |
int | setio (int argc, char *argv[], void *data) |
int | readio (int argc, char *argv[], void *data) |
int | pwm_on (int argc, char *argv[], void *data) |
int | pwm_off (int argc, char *argv[], void *data) |
int | pwm_ratio (int argc, char *argv[], void *data) |
int | pwm_freq (int argc, char *argv[], void *data) |
int | pwm_config (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 kb_command_t | cmds [] |
static char | buf [1024] |
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 output
Definition at line 44 of file gpio_test.c.
References kb_gpio_dir(), and kb_gpio_function().
static void ctrlc_handler | ( | int | sig | ) | [static] |
Make sure the program terminate properly on a ctrl-c
Definition at line 19 of file gpio_test.c.
References quitReq.
Referenced by main().
int help | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Display a list of available commands.
Definition at line 208 of file gpio_test.c.
References kb_command_s::name.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 225 of file gpio_test.c.
References buf, ctrlc_handler(), kb_init(), kb_parse_command(), kb_pwm_init(), kb_set_debug_level(), and quitReq.
int pwm_config | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Activate the given pwm
Definition at line 167 of file gpio_test.c.
References kb_pwm_config().
int pwm_freq | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Activate the given pwm
Definition at line 151 of file gpio_test.c.
References kb_pwm_period().
int pwm_off | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Desactivate the given pwm
Definition at line 117 of file gpio_test.c.
References kb_pwm_desactivate().
int pwm_on | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Activate the given pwm
Definition at line 100 of file gpio_test.c.
References kb_pwm_activate().
int pwm_ratio | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Activate the given pwm
Definition at line 134 of file gpio_test.c.
References kb_pwm_duty().
int quit | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
int readio | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Read the given digital input value
Definition at line 83 of file gpio_test.c.
References kb_gpio_get().
int resetio | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Reset the given digital output value
Definition at line 61 of file gpio_test.c.
References kb_gpio_clear().
int setio | ( | int | argc, | |
char * | argv[], | |||
void * | data | |||
) |
Set the given digital output value
Definition at line 73 of file gpio_test.c.
References kb_gpio_set().
char buf[1024] [static] |
Main program to process the command line.
Definition at line 223 of file gpio_test.c.
Referenced by hem_beep(), hem_fastRead(), hem_fastWrite(), hem_getOSVersion(), hem_readAmbientLightSensors(), hem_readI2C(), hem_readProximitySensors(), hem_readSwitches(), hem_readTVRemote(), hem_setLEDs(), hem_setSpeed(), hem_writeI2C(), kb_parse_config_file(), kb_wav_play(), kio_i2c_ReturnRead(), kio_ReadAnalog(), kio_ReadCAN(), knet_write16(), knet_write32(), knet_write8(), koa_changeLed(), koa_getOSVersion(), koa_readAD(), koa_readAmbient(), koa_readBattery(), koa_readInput(), koa_readPosition(), koa_readProximity(), koa_readSensor(), koa_readSpeed(), koa_readStatus(), koa_setOutput(), koa_setPidPosition(), koa_setPidSpeed(), koa_setPosition(), koa_setPositionCounter(), koa_setProfile(), koa_setPWM(), koa_setSpeed(), koa_sound_task(), and main().
kb_command_t cmds[] [static] |
Initial value:
{ { "quit" , 0 , 0 , quit } , { "exit" , 0 , 0 , quit } , { "bye" , 0 , 0 , quit } , { "readio" , 1 , 1 , readio }, { "setio" , 1 , 1 , setio }, { "cleario" , 1 , 1 , resetio }, { "configio" , 2 , 2 , configio }, { "pwm_on" , 1 , 1 , pwm_on }, { "pwm_off" , 1 , 1 , pwm_off }, { "pwm_ratio" , 2 , 2 , pwm_ratio}, { "pwm_freq" , 2 , 2 , pwm_freq }, { "pwm_config" , 3 , 3 , pwm_config }, { "help" , 0 , 0 , help } , { NULL , 0 , 0 , NULL } }
Definition at line 188 of file gpio_test.c.
int quitReq = 0 [static] |