hololink::emulation::sensors::IMX274Emulator

View as Markdown
#include <hololink/emulation/sensors/imx274_emulator.hpp>

Inherits from: hololink::emulation::I2CPeripheral (public)


Constructors

IMX274Emulator

hololink::emulation::sensors::IMX274Emulator::IMX274Emulator()

Destructor

~IMX274Emulator

hololink::emulation::sensors::IMX274Emulator::~IMX274Emulator()

Methods

reset

void hololink::emulation::sensors::IMX274Emulator::reset()

Reset the IMX274Emulator memory map to its initial state.

attach_to_i2c

void hololink::emulation::sensors::IMX274Emulator::attach_to_i2c(
I2CController &i2c_controller,
uint8_t bus_address
) override

python:

def attach_to_i2c(self: hemu.sensors.IMX274Emulator, i2c_controller: hemu.I2CController, bus_address: int)

Attach the IMX274Emulator to an I2C controller at a specified bus

Parameters

i2c_controller
I2CController &

The I2C controller to attach to. Retrieved from HSBEmulator with get_i2c(controller_address)

bus_address
uint8_t

The bus address of the I2C controller

i2c_transaction

I2CStatus hololink::emulation::sensors::IMX274Emulator::i2c_transaction(
uint16_t peripheral_address,
const uint8_t *write_bytes,
uint16_t write_size,
uint8_t *read_bytes,
uint16_t read_size
) override

python:

def i2c_transaction(self: hemu.sensors.IMX274Emulator, peripheral_address: int, write_bytes: bytes, write_size: int, read_bytes: bytes, read_size: int) -> hemu.I2CStatus

Receive and act on I2C transaction from HSBEmulator’s I2C controller(s)

Returns: The status of the I2C transaction

Parameters

peripheral_address
uint16_t

The address of the peripheral to transaction with

write_bytes
const uint8_t *

The bytes to write to the peripheral

write_size
uint16_t

The size of the write bytes

read_bytes
uint8_t *

The bytes to read from the peripheral

read_size
uint16_t

The size of the read bytes

is_streaming

bool hololink::emulation::sensors::IMX274Emulator::is_streaming() const

Check if the Host application has set the sensor to streaming mode.

It is expected that the host application does not send any commands that set the sensor to streaming mode if the sensor is not yet configured.

Returns: True if the IMX274Emulator is streaming, false otherwise

get_pixel_width

uint16_t hololink::emulation::sensors::IMX274Emulator::get_pixel_width() const

Get the width of the configured image in pixels.

Returns: The width of the image in pixels or 0 if the sensor has not been configured; see is_streaming().

get_pixel_height

uint16_t hololink::emulation::sensors::IMX274Emulator::get_pixel_height() const

Get the height of the configured image in pixels.

Returns: The height of the image in pixels or 0 if the sensor has not been configured; see is_streaming().

get_bytes_per_line

uint16_t hololink::emulation::sensors::IMX274Emulator::get_bytes_per_line() const

Get the number of bytes per line of the sensor CSI image frame - not the packetized CSI image frame.

Returns: The number of bytes per line of the CSI image frame or 0 if the sensor has not been configured; see is_streaming().

get_image_start_byte

uint32_t hololink::emulation::sensors::IMX274Emulator::get_image_start_byte() const

Get the start byte offset for the CSI image frame.

Returns: The byte offset of the CSI image frame where the image starts or 0 if the sensor has not been configured; see is_streaming().

get_csi_length

uint32_t hololink::emulation::sensors::IMX274Emulator::get_csi_length() const

Get the length of the CSI data in bytes for the CSI image frame - not the packetized CSI image frame.

Returns: The length of the CSI data in bytes or 0 if the sensor has not been configured; see is_streaming().

get_pixel_bits

uint8_t hololink::emulation::sensors::IMX274Emulator::get_pixel_bits() const

Get the number of bits per pixel.

Returns: The number of bits per pixel or 0 if the sensor has not been configured; see is_streaming().

start

virtual void hololink::emulation::sensors::IMX274Emulator::start()

start the peripheral.

This will be called when I2CController itself starts and should not be done by the client code

stop

virtual void hololink::emulation::sensors::IMX274Emulator::stop()

stop the peripheral.

This will be called when the I2CController is stopped and should not be done by the client code

Peripheral should release all resources in case a subsequent start() is called.


Member variables

NameTypeDescription
memory_uint8_tThe memory map of the IMX274Emulator.