Ignore:
Timestamp:
10/17/10 05:42:36 (3 years ago)
Author:
reyalp
Message:

ptp support based on mweerden's proposal in http://chdk.setepontos.com/index.php/topic,4338.msg52984.html#msg52984
this is currently disabled by default. See http://chdk.setepontos.com/index.php/topic,4338.msg55942.html#msg55942 for additional information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/platform.h

    r944 r957  
    486486 
    487487/* 
    488  shut down the display and reboot the camera.  
    489  bootfile is the name of the file to boot. 
    490   Must be an unencoded ARM binary, will be loaded at 0x1900 
    491   For cameras which use encoded diskboot, loader/<camera>/main.bin may be used 
    492   For cameras which do not use encoded diskboot, DISKBOOT.BIN may be used 
    493   No sanity checking is performed on the binary, except that the size is >= 4 bytes 
    494  If bootfile is NULL, camera firmware is rebooted. DISKBOOT.BIN will be loaded or not according to normal rules 
    495  returns 0 on failure, does not return on success 
    496  does NOT save camera settings to flash 
    497  does NOT retract lens before rebooting 
    498  calling from playback mode is recommended 
     488 reboot, optionally loading a different binary 
     489 see lib/armutil/reboot.c for documentation 
    499490*/ 
    500491int reboot(const char *bootfile); 
     
    503494#define finished() debug_led(0) 
    504495 
     496 
     497#ifdef CAM_CHDK_PTP 
     498 
     499typedef struct { 
     500    int code; 
     501    int sess_id; 
     502    int trans_id; 
     503    int num_param; 
     504    int param1; 
     505    int param2; 
     506    int param3; 
     507    int param4; 
     508    int param5; 
     509} PTPContainer; 
     510 
     511typedef struct { 
     512    int handle; 
     513    int (*send_data)(int handle, const char *buf, int part_size, int total_size, int, int, int); // (0xFF9F525C), total_size should be 0 except for the first call 
     514    int (*recv_data)(int handle, char *buf, int size, int, int); // (0xFF9F5500) 
     515    int (*send_resp)(int handle, PTPContainer *resp); // (0xFF9F5688) 
     516    int (*get_data_size)(int handle); // (0xFF9F5830) 
     517    int (*send_err_resp)(int handle, PTPContainer *resp); // (0xFF9F5784) 
     518    int unknown1; // ??? 
     519    int (*f2)(); // ??? (0xFF8D5B24) 
     520    int (*f3)(); // ??? (0xFF8D5B5C) 
     521    // more?? 
     522} ptp_data; 
     523 
     524typedef int (*ptp_handler)(int, ptp_data*, int, int, int, int, int, int, int, int); 
     525 
     526int add_ptp_handler(int opcode, ptp_handler handler, int unknown); 
     527 
     528void init_chdk_ptp(); 
     529void init_chdk_ptp_task(); 
     530 
     531#endif // CAM_CHDK_PTP 
     532 
     533int switch_mode_usb(int mode); // 0 = playback, 1 = record; return indicates success 
     534                               // N.B.: switch_mode only supported when USB is connected 
     535 
     536void ExitTask(); 
     537 
    505538#endif 
Note: See TracChangeset for help on using the changeset viewer.