.
| Lens Functions
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_focus | Y | Y | gets current focus distance in mm
|
| get_focus_mode | Y | Y | returns focus mode, 0=auto, 1=MF, 3=inf., 4=macro, 5=supermacro
|
| get_focus_ok | Y | Y | returns 0=focus not ok, 1=ok if get_focus_state<>0 and get_shooting=1
|
| get_focus_state | Y | Y | returns focus status, > 0 focus successful, =0 not successful, < 0 MF
|
| get_IS_mode | Y | Y | get image stabilization mode
|
| get_zoom | Y | Y | returns current zoom position
|
| get_zoom_steps | Y | Y | returns the number of zoom steps supported by the camera
|
| set_aflock | Y | Y | locks the lens focus at the current position
|
| set_focus | Y | Y | sets current focus distance in mm
|
| set_zoom | Y | Y | sets the current zoom position
|
| set_zoom_rel | Y | Y | moves zoom position a relative amount
|
| set_zoom_speed | Y | Y | sets zoom speed (only works on some cameras)
|
| Depth of Field
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_dofinfo | Y | - | get DOF table (uBASIC commands below)
|
| get_dof | - | Y | get the depth of sharpness in mm
|
| get_far_limit | - | Y | get the far acceptable sharpness distance
|
| get_near_limit | - | Y | get near acceptable sharpness distance
|
| get_focal_length | - | Y | get current lens focal length
|
| get_hyp_dist | - | Y | get hyperfocal distance
|
| Exposure Functions
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_av | N | Y | obsolete - replaced with get_user_av_id
|
| get_av96 | Y | Y | gets APEX96 aperature value
|
| get_bv96 | Y | Y | gets APEX96 luminance value
|
| get_ev | Y | Y | get exposure adjustment amount
|
| get_iso | N | Y | obsolete - replaced with get_iso_mode
|
| get_iso_market | Y | Y | get inflated marketing ISO value
|
| get_iso_mode | Y | Y | obtain ISO mode
|
| get_iso_real | Y | Y | get actual ISO value
|
| get_nd_present | Y | Y | returns whether camera has an ND filter (and / or diaphragm )
|
| get_sv96 | Y | Y | gets APEX96 ISO sensitivity setting
|
| get_tv96 | Y | Y | gets APEX96 exposure time
|
| get_user_av_id | Y | Y | gets M mode override APEX96 aperature value by index
|
| get_user_av96 | Y | Y | gets APEX96 aperature value
|
| get_user_tv_id | Y | Y | gets M mode override APEX96 exposure time by index
|
| get_user_tv96 | Y | Y | gets M mode override APEX96 exposure value
|
| set_av | N | Y | obsolete - replaced with set_user_av_by_id
|
| set_av_rel | N | Y | obsolete - replaced with set_user_ac_by_id_rel
|
| set_av96 | Y | Y | sets the APEX96 aperature value
|
| set_av96_direct | Y | Y | sets the APEX96 aperature value (bypass validation check)
|
| set_ev | Y | Y | sets exposure adjustment amount
|
| set_iso | N | Y | obsolete - replaced with set_iso_mode
|
| set_iso_mode | Y | Y | <needs a definition>
|
| set_iso_real | Y | Y | <needs a definition>
|
| set_nd_filter | Y | Y | moves neutral density filter into or out of the optical path
|
| set_sv96 | Y | Y | set APEX96 sensitivity value
|
| set_tv | N | Y | obsolete - replaced with set_user_tv_by_id
|
| set_tv_rel | N | Y | obsolete - replaced with set_user_tv_by_id_rel
|
| set_tv96 | Y | Y | set APEX96 exposure time
|
| set_tv96_direct | Y | Y | set APEX96 exposure time (bypass validity checks)
|
| set_user_av_by_id | Y | Y | set user override APEX96 aperature by index (M mode only)
|
| set_user_av_by_id_rel | Y | Y | set user override APEX96 aperature by index relative (M mode only)
|
| set_user_av96 | Y | Y | set user override APEX96 aperature (M mode only)
|
| set_user_tv_by_id | Y | Y | set user override APEX96 exposure time index (M mode only)
|
| set_user_tv_by_id_rel | Y | Y | set user override APEX96 exposure time index offset (M mode only)
|
| set_user_tv96 | Y | Y | set user override APEX96 exposure time (M mode only)
|
| Camera Functions
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_capture_mode | N | Y | gets current camera Program mode setting
|
| get_display_mode | N | Y | returns state of LCD display info
|
| get_drive_mode | Y | Y | returns shutter drive mode (single, continuous, timer )
|
| get_flash_mode | Y | Y | returns flash mode (flash auto, flash on, flash off)
|
| get_flash_params_count | Y | N | returns # of flash memory parameters available in camera
|
| get_flash_ready | Y | Y | returns status indicating if flash is ready to fire
|
| get_meminfo | Y | N | get camera memory information
|
| get_mode | Y | Y | returns whether record mode or playback mode is active
|
| get_movie_status | Y | Y | gets state of video recording (off,on,paused)
|
| get_orientation_sensor | Y | Y | get camera rotation sensor value
|
| get_parameter_data | Y | N | get data from camera\'s flash memory
|
| get_prop | Y | Y | get PropertyCase value as short integer
|
| get_prop_str | Y | N | get the value of a PropertyCase as a string
|
| get_propset | Y | Y | get the propset number for this camera
|
| get_quality | N | Y | returns the current capture quality setting in Canon grades
|
| get_resolution | N | Y | returns the current capture resolution setting in Canon grades
|
| get_shooting | Y | Y | return value indicates if shooting is done
|
| get_temperature | Y | Y | returns specified temperature sensor value
|
| get_vbatt | Y | Y | get current battery charge state
|
| get_video_button | Y | Y | returns whether on not the camera has a video button
|
| get_video_details | Y | N | returns a struct with viewport configuration info
|
| is_capture_mode_valid | Y | Y | check if CHDK mode number is valid for this camera
|
| play_sound | Y | * | plays the specified sound sequence (uBASIC use playsound)
|
| reboot | Y | Y | restart the camera
|
| restore | Y | Y | specifies the routine called before a script terminates
|
| set_backlight | Y | Y | turns the LCD screen backlight on or off
|
| set_capture_mode | Y | Y | set capture mode by CHDK mode number
|
| set_capture_mode_canon | Y | Y | set capture mode by PROPCASE_SHOOTING_MODE value
|
| set_led | Y | Y | turns on or off the selected camera LED
|
| set_movie_status | Y | Y | allow video recording to pause, unpause and stop
|
| set_prop | Y | Y | set PropertyCase value as short integer
|
| set_prop_str | Y | N | used to set arbitraty sized propcases in Lua
|
| set_quality | N | Y | set the quality (in Canon grades),
|
| set_record | Y | Y | set playback or record mode
|
| set_resolution | N | Y | Set the resolution (in Canon grades)
|
| shut_down | Y | Y | turns the camera off
|
| switch_mode_usb | Y | Y | set playback or record mode while PTP USB connected
|
| Keypad & Switches
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| click | Y | Y | press and release a key
|
| is_key | Y | Y | detemines if specified key was pressed
|
| is_pressed | Y | Y | determines if specified key is being pressed
|
| press | Y | Y | activates the specified camera button
|
| release | Y | Y | releases the specified camera button
|
| shoot | Y | Y | takes a picture
|
| wait_click | Y | Y | waits for any camera button to be pressed
|
| wheel_left | Y | Y | simulates moving jog dial wheel to the left
|
| wheel_right | Y | Y | simulates moving jog dial wheel to the right
|
| SD Card Functions
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_disk_size | Y | Y | returns size of SD card
|
| get_exp_count | Y | Y | return number of shots in a session
|
| get_free_disk_space | Y | Y | return space left on SD card
|
| get_jpg_count | Y | Y | return number of JPG shots left on SD card
|
| get_partitionInfo | Y | Y | get partition information from the SD card
|
| set_file_attributes | Y | Y | set file attributes of file on SD card
|
| swap_partitions | Y | Y | changes the partition order if SD card has multiple partitions
|
| Script Status Functions
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| autostarted | Y | Y | checks if script was autostarted
|
| end | N | Y | terminate uBASIC program execution
|
| file_browser | Y | Y | activate SD card file browser on LCD screen
|
| get_autostart | Y | Y | reads the conf.script_autostart
|
| get_day_seconds | Y | Y | return number of seconds since midnight
|
| get_tick_count | Y | Y | gets time in tic units since camera startup
|
| get_time | Y | Y | returns elements of the camera\'s current date / time setting
|
| set_autostart(a) | Y | Y | write conf.script_autostart (0=off, 1=on, 2=once)
|
| set_yield | Y | Y | control how much of the Camera CPU time is used by scripting engine
|
| sleep | Y | Y | halts program execution for specified number of milliseconds
|
| Firmware Interface
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| call_event_proc(name,...) | Y | N | calls a registered event procedure.
|
| call_func_ptr(fptr,...) | Y | N | call ARM or Thumb function in camera RAM or ROM
|
| get_levent_def | Y | N | returns (name, id, param) if index is valid, otherwise nil
|
| get_levent_def_by_index | Y | N | returns (name, id, param) if index is valid, otherwise nil
|
| get_levent_index | Y | N | returns the index of the given event
|
| post_levent_for_npt | Y | N | <needs a definition>
|
| post_levent_to_ui | Y | N | <needs a definition>
|
| set_levent_active | Y | N | <needs a definition>
|
| set_levent_script_mode | Y | N | <needs a definition>
|
| Text Console
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| cls | Y | Y | clear console screen
|
| console_redraw | Y | Y | manually refresh/rewrite the script console
|
| print | Y | Y | displays a line of text on console area of LCD screen
|
| print_screen | Y | N | causes text written to screen to also be written to file on the SD card
|
| set_console_autoredraw | Y | Y | enable or disable automatic rewrite/refresh of the console
|
| set_console_layout | Y | Y | sets the dimensions the LCD message console
|
| LCD Graphics
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| draw_clear | Y | N | clear drawing area on LCD screen
|
| draw_ellipse | Y | N | draws an ellipse on LCD screen
|
| draw_ellipse_filled | Y | N | draws a filled ellipse on LCD screen
|
| draw_line | Y | N | draw a line on LCD screen
|
| draw_pixel | Y | N | draws a single pixel on LCD screen
|
| draw_rect | Y | N | draws a rectangle on LCD screen
|
| draw_rect_filled | Y | N | draws a filled rectangle on LCD screen
|
| draw_string | Y | N | prints a text string on LCD screen
|
| textbox | Y | N | input text function for Lua scripts
|
| RAW
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_raw | Y | Y | return status of RAW disabled or enabled
|
| get_raw_count | Y | Y | return number of RAW shots that will fit on remaining SD card space
|
| get_raw_nr | Y | Y | return state of RAW noise reduction ( off, on )
|
| raw_merge_add_file | Y | N | adds a RAW file to the current merge process
|
| raw_merge_end | Y | N | ends a RAW merge process on the camera
|
| raw_merge_start | Y | N | begins a RAW merge process on the camera
|
| set_raw | Y | Y | enables or disables the storage of RAW images
|
| set_raw_develop | Y | N | develop RAW image on next shot
|
| set_raw_nr | Y | Y | enables or disable noise reduction in RAW mode
|
| CHDK Functionality
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| enter_alt | Y | N | activates CHDK mode
|
| exit_alt | Y | Y | exits CHDK mode
|
| get_buildinfo | Y | N | return info about CHDK version running on the camera
|
| get_config_value | Y | Y | get currently selected state of CHDK menu item
|
| get_histo_range | Y | Y | return % if values in given range on histogram
|
| get_platform_id | N | Y | get the camera's platform ID value
|
| set_config_value | Y | Y | sets specified CHDK config value to specified value
|
| shot_histo_enable | Y | Y | enables creation of histogram data from a shot
|
| Programming
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| bitand(a, b) | Y | N | returns bitwise logical AND of two variables
|
| bitnot(a) | Y | N | returns bitwise inversion of a variable
|
| bitor(a, b) | Y | N | returns bitwise logical OR of two variables
|
| bitshl(a) | Y | N | returns logical shift left of a variable
|
| bitshri(a) | Y | N | returns logical right of a variable (top bit stays in same state afterwards)
|
| bitshru(a) | Y | N | returns logical right of a variable (top bit = 0 afterwards)
|
| bitxor(a, b) | Y | N | returns logical exclusive or of two variables
|
| peek | Y | N | reads from specified camera memory address
|
| poke | Y | N | writes to specified camera memory address
|
| Motion Detection
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| md_detect_motion | Y | Y | waits for a change in specified screen cells caused by motion
|
| md_get_cell_diff | Y | Y | gets change in motion detect level in specified cell
|
| USB Port Interface
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_usb_power | Y | Y | get status of USB connector ( voltage present or not present )
|
| read_usb_msg | Y | N | read a message from the CHDK ptp usb interface
|
| write_usb_msg | Y | N | write a message via the CHDK ptp interface
|
| Tone Curves
|
|
|
|
| Function Link
| Lua
| uBASIC
| Description
|
| get_curve_file | Y | N | Lua commands to control tone curves
|
| get_curve_state | Y | N | Lua commands to control tone curves
|
| set_curve_file | Y | N | load a tone curve file
|
| set_curve_state | Y | N | enable/disable the use of a tone curve file
|
|
|
|
|
|
|