Struct mlx9064x::CameraDriver[][src]

pub struct CameraDriver<Cam, Clb, I2C, const HEIGHT: usize, const WIDTH: usize, const NUM_BYTES: usize> { /* fields omitted */ }
Expand description

The shared camera driver for the MLX90640 and MLX90641 thermopiles.

These cameras offer higher resolutions and faster refresh rates than other common low-cost thermal cameras, but they come with some differences in operation, as well as much more processing required to end up with a grid of temperatures.

The biggest impact to users of these modules is that one of the generate_image_* functions will need to be called twice (once for each subpage) before a full image is available.

Implementations

Create a new CameraDriver, obtaining the calibration data from the camera over I²C.

Create a CameraDriver for accessing the camera at the given I²C address.

MLX9064*s can be configured to use any I²C address (except 0x00), but the default address is 0x33.

Get the last measured subpage.

Check if there is new data available, and if so, which subpage.

Clear the data available flag, signaling to the camera that the controller is ready for more data.

This flag can only be reset by the controller.

Check if the overwrite enabled flag is set.

This flag is only effective when data_hold_enabled is active.

Enabled (or disable) overwriting of data in RAM with new data.

Check if the camera is using subpages.

When disabled, only one page will be measured. The default is to use subpages.

Enabled (or disable) the use of subpages.

Check if the “Enable data hold” flag is set.

When this flag (bit 2 on 0x800D) is set, data is not copied to RAM unless the enable_overwrite flag is set. The default is for this mode to be disabled.

Enabled (or disable) data holding.

Check if the camera is in subpage repeat mode.

This flag only has an effect if subpages is enabled. In subpage repeat mode, only the subpage set in selected_subpage will be measured and updated. When disabled, the active subpage will alternate between the two. The default is disabled.

Enabled (or disable) subpage repeat mode.

Get the currently selected subpage when subpage repeat is enabled.

This setting only has an effect when subpage_repeat is enabled. The default value is Subpage::Zero.

Set the currently selected subpage when subpage repeat is enabled.

Read the frame rate from the camera.

The default frame rate is 2 FPS.

Set camera’s frame rate.

Get the current resolution of the ADC in the camera.

The default resolution is 18 bits.

Set ADC resolution within the camera.

Get the current access pattern used by the camera when updating subpages.

The default for the MLX90640 is the chess patterm while the default for the MLX90641 is the interleaved pattern.

Set the access pattern used by the camera.

Get the emissivity value that is being used for calculations currently.

The default emissivity is 1, unless a camera has a different value stored in EEPROM, in which case that value is used. The default can also be overridden, but this change is not stored on the camera.

Override the emissivity value used in temperature calculations.

The default emissivity is 1, unless a camera has a different value stored in EEPROM, in which case that value is used. This method allows a new value to be used to compensate for emissivity.

Use the default emissivity value.

This is the opposite to override_emissivity, as it uses the default emissivity from either the camera (if the camera has a value set) or 1.

Retrieve the current reflected temperature value.

When the temperature of the ambient environment is not known, this function will return None. See set_reflected_temperature for more information.

Set the reflected temperature value.

This value is used to compensate for infrared radiation not being emitted by an object itself, but being emitted by the ambient environment and reflected by an object being measured. This value is distinct from the one from ambient_temperature, but if not explicitly known it can be estimated from that value.

Get the most recent ambient temperature calculation.

What the datasheets (and this crate) refer to as “ambient temperature” should be better understood as the ambient temperature of the camera itself, not of the area being imaged. These values will usually be different because the camera generates some heat itself, and the sensor used for this value is within the camera module. See MelexisCamera::SELF_HEATING for more details.

This value is calculated as part of the overall image calculations. If that process hasn’t been performed yet (by calling generate_image_if_ready or similar), this method will return None.

The height of the thermal image, in pixels.

The width of the thermal image, in pixels.

Generate a thermal “image” from the camera’s current data.

This function does not check if there is new data, it just copies the

Generate a thermal “image” from the camera’s current data, if there’s new data.

This function first checks to see if there is new data available, and if there is it copies that data into the provided buffer. It will then clear the data ready flag afterwards, signaliing to the camera that we are ready for more data. The Ok value is a boolean for whether or not data was ready and copied.

Synchronize with the camera’s frame update timing

This function ignores any new data, then forces a new measurement by the camera, only returning when that measurement is complete. This can be used to synchronize frame access from the controller to the update time of the camera.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.