5.5 CHDK commands
127
status = poke(address,value)
Writes the specified value into memory at the specified address.
Warning!
Make sure you know exactly what you are doing. Writing wrong memory
content could crash the operating system or even damage your camera!
num = get_flash_params_count()
Returns the number of parameters in flash memory. Canon cameras feature a nonvol-
atile flash memory to store data even when the battery is removed. The parameters in
that memory are numbered starting from zero.
str,num = get_parameter_data(id)
Returns the value of a specified flash memory parameter.
id
identifies the parameter.
The meaning of IDs may vary from platform to platform and is ongoing work. You can
find a listing at
http://chdk.wikia.com/wiki/Params
.
str
returns the parameter value as a string, which may contain nonprintable control
characters.
num
returns the parameter value as a number, provided the parameter length is not
longer than 4 bytes. Otherwise
nil
is returned.
bitand(x,y), bitor(x,y), bitxor(x,y), bitshl(x,y), bitshri(x,y),
bishru(x,y), bitnot(x)
These commands perform bitwise operations on integers:
AND
,
OR
,
XOR
,
SHIFT LEFT
,
SHIFT RIGHT
,
SHIFT RIGHT UNSIGNED
,
NEGATION
.
5.5.12 The library capmode.lua (
Lua
only)
The library
capmode.lua
is contained in the full CHDK distribution and sim-
plifies access to Canon capture modes such as
AUTO
,
P
,
TV
,
AV
,
M
,
PORTRAIT
,
NIGHT
,
LANDSCAPE
, ...,
EASY
,
SCN_DIGITAL_MACRO
, and
SCN_STITCH
. To use
these commands, you must load the library with the following instruction:
capmode = require("capmode")
capmode.mode_to_name
Lua
table that maps CHDK shooting mode numbers to mode names.
capmode.name_to_mode
Lua
table that maps mode names to CHDK shooting mode numbers.
index = capmode.get()
Returns the CHDK shooting mode number (section 5.6). Returns 0 if the camera is
in
Replay mode
.
name = capmode.get_name()
Returns the current shooting mode name (section 5.6). Returns
PLAY
if the camera
is in
Replay mode,
UNKNOWN
if the shooting mode is not known.
Summary of Contents for Camera
Page 1: ......
Page 2: ...The Canon Camera Hackers Manual ...
Page 3: ......
Page 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Page 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Page 25: ...16 CH APTER 3 ...
Page 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Page 213: ...204 CH APTER 6 ...
Page 253: ...244 AP PENDIX ...