Merge pull request #371 from openmv/add_sensor_shutdown

Add sensor shutdown function.
This commit is contained in:
Ibrahim Abd Elkader 2018-09-05 17:00:56 +02:00 committed by GitHub
commit 8c840ddbd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -405,6 +405,18 @@ int sensor_sleep(int enable)
return 0; return 0;
} }
int sensor_shutdown(int enable)
{
if (enable) {
DCMI_PWDN_HIGH();
} else {
DCMI_PWDN_LOW();
}
systick_sleep(10);
return 0;
}
int sensor_read_reg(uint8_t reg_addr) int sensor_read_reg(uint8_t reg_addr)
{ {
if (sensor.read_reg == NULL) { if (sensor.read_reg == NULL) {

View File

@ -168,6 +168,9 @@ int sensor_get_id();
// Sleep mode. // Sleep mode.
int sensor_sleep(int enable); int sensor_sleep(int enable);
// Shutdown mode.
int sensor_shutdown(int enable);
// Read a sensor register. // Read a sensor register.
int sensor_read_reg(uint8_t reg_addr); int sensor_read_reg(uint8_t reg_addr);