SERIAL INTERFACE DEVELOPERS GUIDE
5.2.5 McbReadDataMem
Call this function to read a block of memory from the DSP. At the lower level the call may be broken
into several calls to the DSP controller to read the entire block. This function can also be used to read
registers or a block of registers that are mapped into the DSP data memory space.
Function Definition: MCBCOM MCBCOM_API DWORD McbReadDataMem(HMCBCOM hCom,
LPVOID dest, DWORD addr, WORD size);
Note that the function parameter for size is in bytes and the DSP base integer size is 16-bits, so to
read a single memory location requires the parameter to be 2.
5.2.6 McbWriteDataMem
Call this function to write a block of memory to the DSP. At the lower level the call may be broken into
several calls to the DSP controller to write the entire block. This function can also be used to write
registers or a block of registers that are mapped into the DSP data memory space.
Function Definition: MCBCOM_API DWORD McbWriteDataMem(HMCBCOM hCom, LPCVOID src,
DWORD addr, WORD size);
5.2.7 McbWriteDataMemMask
Call this function to write a block memory to the DSP with a mask parameter. At the lower level the
call may be broken into several calls to the DSP controller to write the entire block. This function is
useful when it is necessary to modify only a portion of a 16-bit register or location, thus providing a
means to update a location without having to perform a read-modify-write at the higher level.
Function Definition: MCBCOM_API DWORD McbWriteDataMemMask(HMCBCOM hCom, LPCVOID
src, LPCVOID mask, DWORD addr, WORD size);
5.2.8 McbSendAppCmd
Call this function to initiate a user defined command on the DSP controller. Typically commands are
used when it is necessary to perform a sequence of events or to access resources that are outside of
the DSP data memory space.
Function Definition: MCBCOM_API DWORD McbSendAppCmd(HMCBCOM hCom, BYTE code,
DWORD argSize, LPCVOID argBuff);
An example of this function is shown below in paragraph
X5.3X.
5.2.9 McbGetAppCmdStatus
Call this function to retrieve the status of any outstanding commands. It is good practice to call this
function to check the camera status before sending any new commands.
Function Definition: MCBCOM_API DWORD McbGetAppCmdStatus(HMCBCOM hCom, LPBYTE
pCmdStatus);
5.3 Lumitron Defined Commands
Once the connection is verified a command can be sent to the camera electronics. A full list of
available commands for the electronics is listed in. The paragraphs that follow will have a more
detailed description of each command, the command response, and any arguments that are supplied
with a specific command.
Below is an example of how to initiate a command to enable the focus motor in the ‘far’ direction. First
check the status of the camera to ensure that a command is not already being executed. The
‘GetPCMStatus’ is a wrapper function that calls the McbGetAppCmdStatus function and includes a
timeout.
5