The Library Capmode.lua (Lua Only) - Canon Camera Hackers Manual

Camera hackers manual berthold daum
Table of Contents

Advertisement

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.
5.5 CHDK commands
127

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents