SCAMP-5c Vision System  1.0.0
An image sensor with a parallel processor on focal plane
Functions
usb_macros.h File Reference

Go to the source code of this file.

Functions

reg usb_slider (handle h)
 get the value of a slider from the host More...
 
 usb_aout (areg a1, handle h)
 sample and output an entire 256x256 AREG plane More...
 
 usb_d2aout (dreg b1, handle h)
 output an entire 256x256 DREG plane as an analog image More...
 
 usb_stream_begin (handle h)
 begin streaming data to the host More...
 
 usb_stream_send (r_int v)
 send a value for the ongoing stream More...
 
 usb_stream_end (r_int p, r_int v)
 end an ongoing data stream More...
 
 usb_scan_events (handle h, dreg r, r_int16 n)
 scan upto a certain number of points in a DREG plane and send their coordinates to the host More...
 

Detailed Description

Author
Jianing Chen

Function Documentation

reg usb_slider ( handle  h)

get the value of a slider from the host

Parameters
hhandle of the slider
Returns
the value of the slider

Example Usage:

1 s0 = usb.slider(my_slider_1)
usb_aout ( areg  a1,
handle  h 
)

sample and output an entire 256x256 AREG plane

Parameters
a1the analogue register
hhandle of the display window

This transmit the image stored in an analogue register array to the host.

Note, this macro contains a large routine and some polling waits. In fact, for most of alogrithms in development, the output macros within a frame cycle takes much more time than the alogrithm itself.

Example Usage:

1 pe.rpix(B,C)
2 usb.aout(C,my_window_1)
usb_d2aout ( dreg  b1,
handle  h 
)

output an entire 256x256 DREG plane as an analog image

Parameters
b1the digital register
hhandle of the display window

This macro first renders the DREG plane as a black/white analogue image, then transmit the analogue image to the host.

Example Usage:

1 pe.rpix(B,C)
2 where(C)
3 R5 = FLAG
4 all
5 usb.d2aout(R5,my_window_1)
usb_stream_begin ( handle  h)

begin streaming data to the host

Parameters
hthe datesheet to hold the values
usb_stream_send ( r_int  v)

send a value for the ongoing stream

Parameters
vvalue to be sent
usb_stream_end ( r_int  p,
r_int  v 
)

end an ongoing data stream

Parameters
pnumber of padding bytes
vvalue to be padded
usb_scan_events ( handle  h,
dreg  r,
r_int16  n 
)

scan upto a certain number of points in a DREG plane and send their coordinates to the host

Parameters
hthe datesheet to hold the values
rthe DREG plane to be scanned
nmaximum number of points