Changeset 424

Show
Ignore:
Timestamp:
02/17/07 22:03:22 (2 years ago)
Author:
goodea
Message:

organize

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/cmucam2/cmucam2.c

    r423 r424  
    6060char *cmucam2_cmds[CMUCAM2_CMD_END]; 
    6161 
     62static void set_cmucam2_commands (void) 
     63{ 
     64  cmucam2_cmds[RETURN] = "**"; 
     65 
     66  /* Buffer Commands */ 
     67  //  BM buffer mode 
     68  //  RF read frame 
     69 
     70  /* Camera Module Commands */ 
     71  cmucam2_cmds[CAMERA_REG] = "CR"; 
     72  //  CP camera power 
     73  //  CT camera type 
     74 
     75  /* Data Rate Commands */ 
     76  //  DM delay mode 
     77  cmucam2_cmds[POLL_MODE] = "PM"; 
     78  //  PS packet skip 
     79  //  RM raw mode 
     80  //  PF packet filter 
     81  //  OM output packet mask 
     82 
     83  /* Servo Commands */ 
     84  cmucam2_cmds[SET_SERVO] = "SV"; 
     85  //  SP servo parameters 
     86  //  GP get servo position 
     87  //  SM servo mask 
     88  //  SO servo output 
     89 
     90  /* Image Windowing Commands */ 
     91  cmucam2_cmds[SEND_FRAME] = "SF"; 
     92  cmucam2_cmds[DOWN_SAMPLE] = "DS"; 
     93  cmucam2_cmds[VIRTUAL_WINDOW] = "VW"; 
     94  //  FS frame stream 
     95  cmucam2_cmds[HI_RES] = "HR"; 
     96  cmucam2_cmds[GET_WINDOW] = "GW"; 
     97  //  PD pixel difference 
     98 
     99  /* Auxiliary I/O Commands */ 
     100  //  GB get button 
     101  //  GI get auxiliary I/O 
     102  cmucam2_cmds[LED_0] = "L0"; 
     103  //  L1 LED control 
     104 
     105  /* Color Tracking Commands */ 
     106  cmucam2_cmds[TRACK_COLOR] = "TC"; 
     107  cmucam2_cmds[TRACK_INVERT] = "TI"; 
     108  cmucam2_cmds[TRACK_WINDOW] = "TW"; 
     109  cmucam2_cmds[NOISE_FILTER] = "NF"; 
     110  cmucam2_cmds[LINE_MODE] = "LM"; 
     111  cmucam2_cmds[GET_TRACK] = "GT"; 
     112  //  ST set tracking parameters 
     113 
     114  /* Histogram Commands */ 
     115  cmucam2_cmds[GET_HISTOGRAM] = "GH"; 
     116  //  HC histogram config 
     117  //  HT histogram track 
     118 
     119  /* Frame Differencing Commands */ 
     120  cmucam2_cmds[FRAME_DIFF] = "FD"; 
     121  //  DC difference channel 
     122  //  LF load frame 
     123  //  MD mask difference 
     124  //  UD upload difference 
     125  //  HD hires difference 
     126 
     127  /* Color Statistics Commands */ 
     128  cmucam2_cmds[GET_MEAN] = "GM"; 
     129 
     130  /* System Level Commands */ 
     131  //  SD sleep deeply 
     132  //  SL sleep 
     133  cmucam2_cmds[RESET] = "RS"; 
     134  cmucam2_cmds[GET_VERSION] = "GV"; 
     135 
     136  /* CMUcam3 New Commands */ 
     137  cmucam2_cmds[SEND_JPEG] = "SJ"; 
     138  cmucam2_cmds[GET_POLLY] = "GP"; 
     139} 
     140 
     141 
    62142static void cmucam2_get_histogram(cc3_histogram_pkt_t *h_pkt, bool poll_mode, bool quiet); 
    63143static void cmucam2_get_mean (cc3_color_info_pkt_t * t_pkt, 
     
    69149                                 bool line_mode, bool auto_led, bool quite); 
    70150static int32_t cmucam2_get_command (int32_t * cmd, int32_t * arg_list); 
    71 static void set_cmucam2_commands (void); 
    72151static void print_ACK (void); 
    73152static void print_NCK (void); 
    74153static void cmucam2_write_t_packet (cc3_track_pkt_t * pkt); 
    75154static void cmucam2_write_h_packet (cc3_histogram_pkt_t *pkt); 
    76 void cmucam2_send_image_direct (bool auto_led); 
     155static void cmucam2_send_image_direct (bool auto_led); 
    77156 
    78157int main (void) 
     
    766845 
    767846 
    768 void set_cmucam2_commands (void) 
    769 { 
    770   cmucam2_cmds[RETURN] = "**"; 
    771  
    772   /* Buffer Commands */ 
    773   //  BM buffer mode 
    774   //  RF read frame 
    775  
    776   /* Camera Module Commands */ 
    777   cmucam2_cmds[CAMERA_REG] = "CR"; 
    778   //  CP camera power 
    779   //  CT camera type 
    780  
    781   /* Data Rate Commands */ 
    782   //  DM delay mode 
    783   cmucam2_cmds[POLL_MODE] = "PM"; 
    784   //  PS packet skip 
    785   //  RM raw mode 
    786   //  PF packet filter 
    787   //  OM output packet mask 
    788  
    789   /* Servo Commands */ 
    790   cmucam2_cmds[SET_SERVO] = "SV"; 
    791   //  SP servo parameters 
    792   //  GP get servo position 
    793   //  SM servo mask 
    794   //  SO servo output 
    795  
    796   /* Image Windowing Commands */ 
    797   cmucam2_cmds[SEND_FRAME] = "SF"; 
    798   cmucam2_cmds[DOWN_SAMPLE] = "DS"; 
    799   cmucam2_cmds[VIRTUAL_WINDOW] = "VW"; 
    800   //  FS frame stream 
    801   cmucam2_cmds[HI_RES] = "HR"; 
    802   cmucam2_cmds[GET_WINDOW] = "GW"; 
    803   //  PD pixel difference 
    804  
    805   /* Auxiliary I/O Commands */ 
    806   //  GB get button 
    807   //  GI get auxiliary I/O 
    808   cmucam2_cmds[LED_0] = "L0"; 
    809   //  L1 LED control 
    810  
    811   /* Color Tracking Commands */ 
    812   cmucam2_cmds[TRACK_COLOR] = "TC"; 
    813   cmucam2_cmds[TRACK_INVERT] = "TI"; 
    814   cmucam2_cmds[TRACK_WINDOW] = "TW"; 
    815   cmucam2_cmds[NOISE_FILTER] = "NF"; 
    816   cmucam2_cmds[LINE_MODE] = "LM"; 
    817   cmucam2_cmds[GET_TRACK] = "GT"; 
    818   //  ST set tracking parameters 
    819  
    820   /* Histogram Commands */ 
    821   cmucam2_cmds[GET_HISTOGRAM] = "GH"; 
    822   //  HC histogram config 
    823   //  HT histogram track 
    824  
    825   /* Frame Differencing Commands */ 
    826   cmucam2_cmds[FRAME_DIFF] = "FD"; 
    827   //  DC difference channel 
    828   //  LF load frame 
    829   //  MD mask difference 
    830   //  UD upload difference 
    831   //  HD hires difference 
    832  
    833   /* Color Statistics Commands */ 
    834   cmucam2_cmds[GET_MEAN] = "GM"; 
    835  
    836   /* System Level Commands */ 
    837   //  SD sleep deeply 
    838   //  SL sleep 
    839   cmucam2_cmds[RESET] = "RS"; 
    840   cmucam2_cmds[GET_VERSION] = "GV"; 
    841  
    842   /* CMUcam3 New Commands */ 
    843   cmucam2_cmds[SEND_JPEG] = "SJ"; 
    844   cmucam2_cmds[GET_POLLY] = "GP"; 
    845 } 
    846847 
    847848//int32_t cmucam2_get_command(cmucam2_command_t *cmd, int32_t *arg_list)