-
Notifications
You must be signed in to change notification settings - Fork 7.8k
drivers: video: Himax HM01B0 camera sensor driver #94894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f16a06f
to
63c60da
Compare
Thank you for splitting it out of #93688! I think the last thing it needs is an entry in the test framework so that this driver is checked automatically for build errors. You can insert a devicetree entry for it in this file: Then this should be enough for the CI to build the driver on every pull request. |
63c60da
to
42a6083
Compare
I hope it is ok https://github.com/NinoSc/zephyr/blob/42a6083cf50e3e4580ed8d265084a3a896667cc3/tests/drivers/build_all/video/app.overlay#L136 |
Quick questions, observations: As mentioned in #93688 Wondering if you have it running on any specific hardware and have it displaying or saving any frames? Example on GIGA 4 bit mode (Arducam Camera for GIGA) There are 244 rows of data generated. Each row generates 652 bytes of data. Two bytes per pixel so 356 pixels per row: For the heck of it, I just now tried 160x120 and: But all of this was on STM32H7... processor And working around issues of 4 bits of data per clock / DMA transfer and how do you However the number for rows/columns generated per the settings I would assume is the same for most processors. Will be fun to experiment once this is merged... |
#define HM01B0_INIT(inst) \ | ||
const struct hm01b0_config hm01b0_config_##inst = { \ | ||
.i2c = I2C_DT_SPEC_INST_GET(inst), \ | ||
.data_bits = DT_INST_PROP(inst, data_bits), \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the runtime if statement you could shrink the driver flash usage a small amount with:
.data_bits = DT_INST_PROP(inst, data_bits), \ | |
.ctrl_val = HM01B0_CTRL_VAL(DT_INST_PROP(inst, data_bits)), \ |
And:
#define HM01B0_CTRL_VAL(data_bits) \
((data_bits) == 8 ? 0x02 : \
(data_bits) == 4 ? 0x42 : \
(data_bits) == 1 ? 0x22 : 0x00)
The Devicetree enum will ensure only 1, 4 or 8 is valid for the data-bits
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion!
I applied it
Hi @KurtE, thanks for the detailed information. Unfortunately I am away and I don't have the analyzer (I have only the board - rp2350 and the camera). |
Add Himax HM01B0 camera sensor driver. It depends on I2C and it is required to configure the camera. Signed-off-by: Antonino Scarpaci <[email protected]>
42a6083
to
9df58ef
Compare
|
Thanks @NinoSc - looks like you are getting a good image. What I am wondering however is something that I am not sure if either of us can answer but more of a generic question You are asking the: camera for an image that is 320x240: Wondering if this can be fixed by changing the initialization of the registers for the different resolutions:
I was in the process of playing with some of this. But I also was trying to bring in more of their EDIT: - Their register set did not change anything that effected the Width/Height Your combined PR works: As your Video code: video_pio_dma.c is setup to manipulate the stream returned by the camera.
Which I believe program code then skips the border bits. I don't know the RPI PIO stuff so have not walked through But this is all pretty specific to this camera and this setup. Should something more generic be done? It is also unclear to me in a generic way: on how we should handle the config->data_bits for GRAY if the camera Currently I have it hacked with another FORMAT type: VIDEO_PIX_FMT_GREY_44 which then says that the Thanks again. |
Add Himax HM01B0 camera sensor driver.
It depends on I2C and it is required to configure the camera.
reference PR: #93688