Difference between revisions of "AXIOM Alpha"

From apertus wiki
Jump to: navigation, search
Line 25: Line 25:


so register '0' is at 0x60000000, register '1' at 0x60000004 ...
so register '0' is at 0x60000000, register '1' at 0x60000004 ...
This example script reads the current bitdepth the sensor is running with:
get_bitdepth () {
depth=$(( `cmv_reg 118` + 0 ))
[ $depth -eq 0 ] && echo "12 bit mode"
[ $depth -eq 1 ] && echo "10 bit mode"
[ $depth -eq 2 ] && echo "8 bit mode"
}

Revision as of 20:01, 25 September 2013

1 Developer Notes

1.1 Reading and Writing Sensor Register

This example script:

#!/bin/sh
cmv_reg() {
   addr=$(( 0x60000000 + ($1 * 4) ))
   [ $# -gt 1 ] && devmem $addr 32 $2
   devmem $addr 32
}
#change the registers 69/98/102/107/108/112 and 124                 
cmv_reg  69      2
cmv_reg  98  39705
cmv_reg 102   8312
cmv_reg 107   9814
cmv_reg 108  12381
cmv_reg 112      5
cmv_reg 124     15
#read the register 127
cmv_reg 127

basically the registers get mapped to 32bit spaces starting at a specific memory address (0x60000000 in this case), reading from that memory will show the register, writing to that memory will change it

so register '0' is at 0x60000000, register '1' at 0x60000004 ...


This example script reads the current bitdepth the sensor is running with:

get_bitdepth () {
	depth=$(( `cmv_reg 118` + 0 ))
	[ $depth -eq 0 ] && echo "12 bit mode"
	[ $depth -eq 1 ] && echo "10 bit mode"
	[ $depth -eq 2 ] && echo "8 bit mode"
}