Skip to content

imoken1122/asi-camera-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asi-camera-rs

This repository is a simplified Rust binding of Zwo ASI Camera driver.

The ASI Camera SDK is distributed here. (This driver does not yet support MacOS Apple silicon.)

Tested OS

  • MacOS Apple silicon M2 ( Rosseta2 )
  • Ubuntu 22.04 x86_64

Other OS (Linux Windows, RasPi) and architecture have not been tested.

Run

First connect the ASI Camera using USB

Linux

 RUST_LOG=debug cargo run -r --example snapshot_mode

 RUST_LOG=debug cargo run -r --example video_mode

MacOS

For MacOS, add --target x86_64-apple-darwin

 
 rustup target add x86_64-apple-darwin

 RUST_LOG=debug cargo run -r --example snapshot_mode  --target x86_64-apple-darwin

API call sequence

Official recommended order of function calls

An example implementations snapshot_mode.rs and video_mode.rs is implemented according to the following order.

1. Initialize

  1. ASIGetNumOfConnectedCameras: Get the count of connected cameras.
  2. ASIGetCameraProperty: Retrieve camera information (ID, name, resolution, etc.).
  3. ASIOpenCamera: Open a camera.
  4. ASIInitCamera: Initialize the camera.
  5. ASIGetNumOfControls: Get the count of control types.
  6. ASIGetControlCaps: Retrieve the capacity of each control type.
  7. ASISetROIFormat: Set image size and format.
  8. ASISetStartPos: Set the starting position for the Region of Interest (ROI).

2. Get and Set Control Value

  1. ASIGetControlValue: Get control values.
  2. ASISetControlValue: Set control values (except for setting exposure time in trigger mode).

3. Capture image

  • video mode
  • snapshot mode