-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat(sccb): new esp sccb component (IEC-92) #309
Conversation
|
@igrr @suda-morris PTAL |
901e384
to
763e82b
Compare
@ginkgm PTAL as well |
* - ESP_ERR_NO_MEM If out of memory | ||
* - ESP_OK On success | ||
*/ | ||
esp_err_t esp_sccb_new_i2c_ctlr(const esp_sccb_i2c_config_t *config, esp_sccb_handle_t *ret_handle); |
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.
question, if the user wants to use the same physical I2C bus for the camera and other i2c slave sensros, how can he do? Because now inside this function, we're allocating the I2C bus, this will take the ownership, and user can't get the same bus outside the sccb driver
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.
I will add a note in the header saying the I2C bus is owned by this API.
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.
how about let the user provide the I2C bus handle, and the sccb driver uses that bus handle?
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.
I think users won't use I2C bus together with SCCB driver
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.
Yes, the classic usage scenario is:
- Call
i2c_new_master_bus(&i2c_mst_config, &bus_handle)
to initialize the I2C bus, obtain the handler, and then usebus_handle
to control the sub-device(some sensors, just like led & motor) - Then use the
bus_handle
to control the camera sensors on the sccb bus.
Maintaining the reusability of this I2C port is an important issue.
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.
ok
d80a1e8
to
35405d3
Compare
uint16_t device_address; ///< I2C device raw address. (The 7/10 bit address without read/write bit) | ||
uint32_t scl_speed_hz; ///< I2C SCL line frequency | ||
i2c_clock_source_t clk_source; ///< Clock source of I2C master bus, channels in the same group must use the same clock source | ||
} esp_sccb_i2c_config_t; |
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.
does this driver follow bus-device model? If so, what does the sccb represents? If it's a bus driver, I didn't expect there is a device address in the same configuration structure. BTW, device address may reside in a camera sensor's own driver package in case different camera needs special initialization commands.
d6000f8
to
8f005a5
Compare
f3c265c
to
0d92ad8
Compare
f0fc46d
to
33f9ad4
Compare
33f9ad4
to
ee310a8
Compare
ee310a8
to
9f84a88
Compare
Checklist
url
field definedChange description
Please describe your change here