![]() |
SCAMP-5c Vision System
1.0.0
An image sensor with a parallel processor on focal plane
|
Go to the source code of this file.
Data Structures | |
class | reg |
operand of this type can only be an ipu register More... | |
class | r_int |
operand of this type can be either an ipu register or a constant integer of range [0,255] or [-128,127] More... | |
class | r_int16 |
similar to r_int, but it can be assigned with a constant integer of range [0,65535] More... | |
class | port |
operand of this type can only be a port address More... | |
Functions | |
_mov (reg d, r_int s) | |
move data in to a register More... | |
_or (reg d, r_int s) | |
bitwise OR operation More... | |
_and (reg d, r_int s) | |
bitwise AND operation More... | |
_add (reg d, r_int s) | |
add two data ( d = d + s ) More... | |
_sub (reg d, r_int s) | |
subtract two data ( d = d - s ) More... | |
_jump (label l) | |
jump the program to a labeled position More... | |
_jump (condition f, label l) | |
jump the program conditionally to a labeled position More... | |
ipu_delay_50us_x (r_int t) | |
time delay with a resolution of 50 us More... | |
ipu_wait_frame_trigger () | |
wait until a frame trigger is detected More... | |
ipu_pixel_set (dreg b1, r_int x, r_int y) | |
set one pixel in a DREG plane More... | |
dreg | ipu_pixel_select (r_int x, r_int y, r_int mx, r_int my) |
set all pixel a DREG plane of which their coordinates match the rules More... | |
ipu_pixel_filter (dreg b1, r_int x, r_int y, r_int mx, r_int my) | |
similar to ipu_pixel_select, but the result will be ANDed with the DREG More... | |
reg | ipu_global_sum (areg a, r_int k) |
sum all pixels in a AREG plane, then sample More... | |
move data in to a register
d | the destinated register |
s | the data to be moved |
Example Usage: _mov(s0,0)
_mov(s0,15)
_mov(s3,s4)
Flagging:
set Z if s is equal to the data originally stored in d
bitwise OR operation
d | the destinated register, LHS of the OR operation |
s | RHS of the OR operation |
Example Usage: _or(s0,128)
_or(s0,s1)
Flagging: Z.
bitwise AND operation
d | the destinated register, LHS of the AND operation |
s | RHS of the AND operation |
Example Usage: _and(s0,15)
_and(s0,s1)
Flagging: Z.
add two data ( d = d + s )
d | the destinated register, LHS of the addition |
s | RHS of the addition |
Example Usage: _add(s0,10)
_add(s1,s2)
Flagging: Z, C.
subtract two data ( d = d - s )
d | the destinated register, LHS of the subtraction |
s | RHS of the subtraction |
Example Usage: _sub(s0,1)
_sub(s1,s2)
Flagging: Z, C.
_jump | ( | label | l | ) |
_jump | ( | condition | f, |
label | l | ||
) |
jump the program conditionally to a labeled position
f | the condition, can be either of c,nc,z,nz |
l | a labeled position in the program |
For the condition part, the Z or C flag produced by previous instructions will be checked.
Example Usage:
The following structure is a loop iterating 10 times:
ipu_delay_50us_x | ( | r_int | t | ) |
ipu_wait_frame_trigger | ( | ) |
wait until a frame trigger is detected
The frame trigger signal is a series of pulse with a frequency specified by host_set_frame_rate.
The following structure provide a frame of which the exposure time is the interval between two frame triggers:
set one pixel in a DREG plane
[in,out] | b1 | the DREG plane |
[in] | x | x coordinate of the pixel |
[in] | y | y coordinate of the pixel |
Example Usage:
Make (30,50) and (50,50) in R5 DREG plane to be 1:
set all pixel a DREG plane of which their coordinates match the rules
[in] | x | x coordinate match of the pixels |
[in] | y | y coordinate match of the pixels |
[in] | mx | x coordinate mask of the pixels |
[in] | my | y coordinate mask of the pixels |
Example Usage:
For R5 DREG plane, make all pixel with x and y coordinates in in the format "xxxxx101" (binary form) to be 1:
Note:
Binary form of 248 is 11111000, which is used as the coordinate mask.
Binary form of 5 is 00000101. which is used as the matching part.
similar to ipu_pixel_select, but the result will be ANDed with the DREG
[in] | b1 | the selection result will be ANDed with this DREG |
[in] | x | x coordinate match of the pixels |
[in] | y | y coordinate match of the pixels |
[in] | mx | x coordinate mask of the pixels |
[in] | my | y coordinate mask of the pixels |
Example Usage:
Make a rectangular with bottom left corner on (64,64) and top right corner (127,127) in R5:
Notice that it is very difficult to make up these parameters in mind. Instead, it is more feasible to try some combinations using a program like Example 10: DREG Selecting.
Another example:
Compose a rectangular of size 128x128 in the center of R5 DREG plane:
sum all pixels in a AREG plane, then sample
[in] | a | the AREG plane |
[in] | k | the ADC gain setting |
The ADC gain value need to be determined through testing.
Example 11: Analogue Regional Summation demonstrates how to sum only a specific region in a AREG plane.
Example Usage:
Sum all pixels in A with a ADC gain of 15, store the sampling result in s0: