common/csi: Add shutdown op.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2025-06-29 10:25:05 +02:00
parent 851af8ceba
commit 58d69cd571
2 changed files with 7 additions and 1 deletions

View File

@ -576,10 +576,15 @@ __weak int omv_csi_shutdown(omv_csi_t *csi, int enable) {
} else { } else {
omv_gpio_write(OMV_CSI_POWER_PIN, 1); omv_gpio_write(OMV_CSI_POWER_PIN, 1);
} }
mp_hal_delay_ms(OMV_CSI_POWER_DELAY);
} }
#endif #endif
mp_hal_delay_ms(10); // Call csi-specific shutdown function
if (csi->shutdown != NULL &&
csi->shutdown(csi, enable) != 0) {
return OMV_CSI_ERROR_CTL_FAILED;
}
return ret; return ret;
} }

View File

@ -354,6 +354,7 @@ typedef struct _omv_csi {
// Sensor function pointers // Sensor function pointers
int (*reset) (omv_csi_t *csi); int (*reset) (omv_csi_t *csi);
int (*sleep) (omv_csi_t *csi, int enable); int (*sleep) (omv_csi_t *csi, int enable);
int (*shutdown) (omv_csi_t *csi, int enable);
int (*match) (omv_csi_t *csi, size_t id); int (*match) (omv_csi_t *csi, size_t id);
int (*read_reg) (omv_csi_t *csi, uint16_t reg_addr); int (*read_reg) (omv_csi_t *csi, uint16_t reg_addr);
int (*write_reg) (omv_csi_t *csi, uint16_t reg_addr, uint16_t reg_data); int (*write_reg) (omv_csi_t *csi, uint16_t reg_addr, uint16_t reg_data);