Struct cameleon::u3v::register_map::Abrm
source · pub struct Abrm { /* private fields */ }
Expand description
Represent Technology Agnostic Boot Register Map (ABRM
), refer to GenCP
specification for more
information about ABRM
.
To maintain consistency with the device data, Abrm
doesn’t cache any data. It means
that all methods of this struct cause communication with the device every time, thus the device
is expected to be opened when methods are called.
Examples
use cameleon::Camera;
use cameleon::u3v;
use cameleon::genapi;
// Enumerates cameras connected to the host.
let mut cameras = u3v::enumerate_cameras().unwrap();
// If no camera is found, return.
if cameras.is_empty() {
return;
}
let mut camera = cameras.pop().unwrap();
// Opens the camera.
camera.open();
let ctrl = &mut camera.ctrl;
// Get Abrm.
let abrm = ctrl.abrm().unwrap();
// Read serial number from ABRM.
let serial_number = abrm.serial_number(ctrl).unwrap();
println!("{}", serial_number);
// Check user defined name feature is supported.
// If it is suppoted, read from and write to the register.
let device_capability = abrm.device_capability().unwrap();
if device_capability.is_user_defined_name_supported() {
// Read from user defined name register.
let user_defined_name = abrm.user_defined_name(ctrl).unwrap().unwrap();
println!("{}", user_defined_name);
// Write new name to the register.
abrm.set_user_defined_name(ctrl, "cameleon").unwrap();
}
Implementations§
source§impl Abrm
impl Abrm
sourcepub fn new<Ctrl: DeviceControl + ?Sized>(
device: &mut Ctrl
) -> ControlResult<Self>
pub fn new<Ctrl: DeviceControl + ?Sized>( device: &mut Ctrl ) -> ControlResult<Self>
Constructs new Abrm
, consider using super::ControlHandle::abrm
instead.
sourcepub fn sbrm<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Sbrm>
pub fn sbrm<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Sbrm>
Returns Sbrm
, consider using super::ControlHandle::sbrm
instead.
sourcepub fn manifest_table<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<ManifestTable>
pub fn manifest_table<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<ManifestTable>
Returns ManifestTable
, consider using super::ControlHandle::manifest_table
instead.
sourcepub fn gencp_version<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Version>
pub fn gencp_version<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Version>
GenCP
version of the device.
sourcepub fn manufacturer_name<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<String>
pub fn manufacturer_name<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<String>
Manufacture name of the device.
sourcepub fn model_name<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<String>
pub fn model_name<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<String>
Model name of the device.
sourcepub fn family_name<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Option<String>>
pub fn family_name<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Option<String>>
Family name of the device.
NOTE: Some device doesn’t support this feature.
Please refer to DeviceCapability
to see whether the feature is available on the device.
sourcepub fn device_version<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<String>
pub fn device_version<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<String>
Device version, this information represents manufacturer specific information.
sourcepub fn manufacturer_info<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<String>
pub fn manufacturer_info<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<String>
Manufacturer info of the device, this information represents manufacturer specific information.
sourcepub fn serial_number<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<String>
pub fn serial_number<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<String>
Serial number of the device.
sourcepub fn user_defined_name<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Option<String>>
pub fn user_defined_name<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Option<String>>
User defined name of the device.
NOTE: Some device doesn’t support this feature.
Please refer to DeviceCapability
to see whether the feature is available on the device.
sourcepub fn set_user_defined_name<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl,
name: &str
) -> ControlResult<()>
pub fn set_user_defined_name<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl, name: &str ) -> ControlResult<()>
Set user defined name of the device.
Arguments
name
- A user defined name. The encoding must be ascii and the length must be less than 64.
NOTE: Some device doesn’t support this feature.
Please refer to DeviceCapability
to see whether the feature is available on the device.
sourcepub fn manifest_table_address<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<u64>
pub fn manifest_table_address<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<u64>
The initial address of manifest table.
To obtain ManifestTable
, it is easier to use Self::manifest_table
.
sourcepub fn sbrm_address<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<u64>
pub fn sbrm_address<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<u64>
The initial address of Sbrm
.
To obtain Sbrm
, it is easier to use Self::sbrm
.
sourcepub fn timestamp<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<u64>
pub fn timestamp<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<u64>
Timestamp that represents device internal clock in ns.
Before calling this method, please make sure to call Self::set_timestamp_latch_bit
that
updates timestamp register.
sourcepub fn set_timestamp_latch_bit<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<()>
pub fn set_timestamp_latch_bit<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<()>
Update timestamp register by set 1 to timestamp_latch
.
sourcepub fn timestamp_increment<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<u64>
pub fn timestamp_increment<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<u64>
Time stamp increment that indicates the ns/tick of the device internal clock.
For example a value of 1000 indicates the device clock runs at 1MHz.
sourcepub fn device_software_interface_version<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Option<String>>
pub fn device_software_interface_version<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Option<String>>
Device software version.
NOTE: Some device doesn’t support this feature.
Please refer to DeviceCapability
to see whether the feature is available on the device.
sourcepub fn maximum_device_response_time<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<Duration>
pub fn maximum_device_response_time<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<Duration>
Maximum device response time.
sourcepub fn device_capability(&self) -> ControlResult<DeviceCapability>
pub fn device_capability(&self) -> ControlResult<DeviceCapability>
Device capability.
sourcepub fn device_configuration<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl
) -> ControlResult<DeviceConfiguration>
pub fn device_configuration<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl ) -> ControlResult<DeviceConfiguration>
Current configuration of the device.
sourcepub fn write_device_configuration<Ctrl: DeviceControl + ?Sized>(
&self,
device: &mut Ctrl,
config: DeviceConfiguration
) -> ControlResult<()>
pub fn write_device_configuration<Ctrl: DeviceControl + ?Sized>( &self, device: &mut Ctrl, config: DeviceConfiguration ) -> ControlResult<()>
Write configuration to the device.