[][src]Struct mt9v034_i2c::Mt9v034

pub struct Mt9v034<I2C> { /* fields omitted */ }

Main driver struct

Implementations

impl<I2C, CommE> Mt9v034<I2C> where
    I2C: Write<Error = CommE> + Read<Error = CommE> + WriteRead<Error = CommE>, 
[src]

pub fn new(i2c: I2C, address: u8) -> Self[src]

Create a new instance with an i2c address

pub fn set_context(&mut self, context: ParamContext) -> Result<(), Error<CommE>>[src]

With this sensor, the user may switch between two full register sets (listed in Table 7) by writing to a context switch change bit in register 0x07. This context switch will change all registers (no shadowing) at the frame start time and have the new values apply to the immediate next exposure and readout time (frame n+1), except for shutter width and V1-V4 control, which will take effect for next exposure but will show up in the n+2 image.

pub fn setup(&mut self) -> Result<(), Error<CommE>>[src]

Second-stage configuration

pub fn setup_with_dimensions(
    &mut self,
    win_width_a: u16,
    win_height_a: u16,
    col_bin_a: BinningFactor,
    row_bin_a: BinningFactor,
    win_width_b: u16,
    win_height_b: u16,
    col_bin_b: BinningFactor,
    row_bin_b: BinningFactor,
    default_context: ParamContext
) -> Result<(), Error<CommE>>
[src]

Setup with configurable Context A and Context B dimensions. Use this method instead setup if you know the exact dimensions and binning you need.

  • win_width and win_height are the window dimensions in pixels that will be collected
  • col_bin is the column binning and row_bin is the row binning that describes how many rows or columns are combined from the window into single result pixels
  • default_context sets which configuration context (A or B) is set as the initial active context

pub fn set_agc_pixel_count(
    &mut self,
    max_pixels: u32
) -> Result<(), Error<CommE>>
[src]

Set just the maximum pixels to be used for adjusting automatic gain control Note this the output pixel count, ie the pixels post-binning

pub fn set_general_defaults(
    &mut self,
    max_pixel_count: u32
) -> Result<(), Error<CommE>>
[src]

Set some general configuration defaults

  • max_pixel_count is the maximum output pixels that will be used in the default context

pub fn set_context_b_default_dimensions(&mut self) -> Result<(), Error<CommE>>[src]

Set default image capture dimensions for Context B

pub fn set_context_a_default_dimensions(&mut self) -> Result<(), Error<CommE>>[src]

Set default image capture dimensions for Context A

pub fn set_context_dimensions(
    &mut self,
    context: ParamContext,
    window_h: u16,
    window_w: u16,
    col_bin_factor: BinningFactor,
    row_bin_factor: BinningFactor
) -> Result<(), Error<CommE>>
[src]

Configure image capture dimensions for the given context

  • context the configuration context (A or B) to configure
  • window_h and window_w: dimensions of the pixel window to collect pixels from
  • column_binning binning to apply to the window's columns
  • row_binning binning to apply to the window's rows

pub fn set_context_a_shutter_defaults(&mut self) -> Result<(), Error<CommE>>[src]

Set default shutter values for Context A

pub fn set_context_b_shutter_defaults(&mut self) -> Result<(), Error<CommE>>[src]

Set default shutter values for Context B

pub fn enable_pixel_test_pattern(
    &mut self,
    enable: bool,
    pattern: PixelTestPattern
) -> Result<(), Error<CommE>>
[src]

Set a test pattern to test pixel data transfer from the camera

pub fn protect_all_registers(
    &mut self,
    protect: bool
) -> Result<(), Error<CommE>>
[src]

Write-protect (or unprotect) all writable registers. If you enable register protection, then any subsequent writes to registers (except the write-protection register itself) will not be committed.

pub fn read_reg_u8(&mut self, reg: u8) -> Result<u8, Error<CommE>>[src]

Read a u8 from an 8-bit address

pub fn read_reg_u16(&mut self, reg: u8) -> Result<u16, Error<CommE>>[src]

Read a u16 from an 8-bit address

pub fn write_reg_u8(&mut self, reg: u8, val: u8) -> Result<(), Error<CommE>>[src]

Write a u8 to an 8-bit address

pub fn write_reg_u16(&mut self, reg: u8, data: u16) -> Result<(), Error<CommE>>[src]

Write a u16 to an 8-bit address

Auto Trait Implementations

impl<I2C> Send for Mt9v034<I2C> where
    I2C: Send

impl<I2C> Sync for Mt9v034<I2C> where
    I2C: Sync

impl<I2C> Unpin for Mt9v034<I2C> where
    I2C: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.