All of them are preloaded in the programmer.
prog_apps
prog_apps -u app.trb
prog_apps -r app.trb
prog_apps -i
prog_apps -a application_number -x action_number -s data
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <tprog/tproglib.h> #include "../module-src/myapp.h" void help () { printf ("Usage: myapp\n"); printf ("-a application\tuse application, default is %s\n", APP_AVR_PROG); printf ("-d device\tuse USB device, default is %s\n", USBDEVICE); printf ("-h\t\thelp\n"); printf ("-v\t\tverbose\n"); exit (-1); } int main (int argc, char **argv) { int result; u8 *dev = USBDEVICE; u8 *app_name = APP_MY; u8 answer[2048]; u16 answerLen; u16 i; do { result = getopt (argc, argv, "hd:a:v"); switch (result) { case 'a': app_name = optarg; break; case 'd': dev = optarg; break; case 'h': help (); break; case 'v': verbose_inc (); break; } } while (result > 0); open_device (dev); if (select_app (app_name) != NO_ERROR) { close_device (); fprintf (stderr, "Cannot open application %s\n", app_name); exit (-1); } usb_send (ACTION_MY_INIT, 0, NULL, &answerLen, answer); printf ("MY APP initialized, %s\n", app_name); usb_send (ACTION_MY_DO_SOMETHING, 0, NULL, &answerLen, answer); printf ("Answer "); for (i = 0; i < answerLen; i++) printf ("%02X", answer[0]); close_device (); }
Copyright © 2004 BLADOX | Turbo Programmer version 2.0
|