mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1381 from openmv/sensor_rename2
Rename dcmi/dma config functions.
This commit is contained in:
commit
6ca526827e
@ -73,7 +73,7 @@ PIXEL_LOOP:
|
||||
.wrap
|
||||
|
||||
% c-sdk {
|
||||
int sensor_config(uint32_t pixformat)
|
||||
int sensor_dcmi_config(uint32_t pixformat)
|
||||
{
|
||||
uint offset;
|
||||
pio_sm_config config;
|
||||
|
||||
@ -57,7 +57,7 @@ PIXEL_LOOP:
|
||||
.wrap
|
||||
|
||||
% c-sdk {
|
||||
int sensor_config(uint32_t pixformat)
|
||||
int sensor_dcmi_config(uint32_t pixformat)
|
||||
{
|
||||
uint offset;
|
||||
pio_sm_config config;
|
||||
|
||||
@ -233,7 +233,7 @@ void sensor_init0();
|
||||
int sensor_init();
|
||||
|
||||
// Configure DCMI hardware interface.
|
||||
int sensor_config(uint32_t pixformat);
|
||||
int sensor_dcmi_config(uint32_t pixformat);
|
||||
|
||||
// Abort frame capture and disable IRQs, DMA etc..
|
||||
int sensor_abort();
|
||||
|
||||
@ -336,7 +336,7 @@ int sensor_init()
|
||||
}
|
||||
|
||||
// Configure the DCMI interface.
|
||||
if (sensor_config(PIXFORMAT_INVALID) != 0){
|
||||
if (sensor_dcmi_config(PIXFORMAT_INVALID) != 0){
|
||||
// DCMI config failed
|
||||
return -6;
|
||||
}
|
||||
@ -358,7 +358,7 @@ int sensor_init()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sensor_config(uint32_t pixformat)
|
||||
int sensor_dcmi_config(uint32_t pixformat)
|
||||
{
|
||||
uint32_t dcmi_pins[] = {
|
||||
DCMI_D0_PIN,
|
||||
|
||||
@ -89,7 +89,7 @@ const int resolution[][2] = {
|
||||
{2592, 1944}, /* WQXGA2 */
|
||||
};
|
||||
|
||||
static void dma_config(int w, int h, int bpp, uint32_t *capture_buf, bool rev_bytes)
|
||||
static void sensor_dma_config(int w, int h, int bpp, uint32_t *capture_buf, bool rev_bytes)
|
||||
{
|
||||
dma_channel_abort(DCMI_DMA_CHANNEL);
|
||||
dma_irqn_set_channel_enabled(DCMI_DMA, DCMI_DMA_CHANNEL, false);
|
||||
@ -567,7 +567,7 @@ int sensor_set_pixformat(pixformat_t pixformat)
|
||||
MAIN_FB()->bpp = -1;
|
||||
|
||||
// Reconfigure PIO DCMI program.
|
||||
return sensor_config(pixformat);
|
||||
return sensor_dcmi_config(pixformat);
|
||||
}
|
||||
|
||||
int sensor_set_framesize(framesize_t framesize)
|
||||
@ -1017,7 +1017,7 @@ int sensor_snapshot(sensor_t *sensor, image_t *image, uint32_t flags)
|
||||
}
|
||||
|
||||
// Configure the DMA on the first frame, for later frames only the write is changed.
|
||||
dma_config(MAIN_FB()->u, MAIN_FB()->v, MAIN_FB()->bpp, (void *) buffer->data,
|
||||
sensor_dma_config(MAIN_FB()->u, MAIN_FB()->v, MAIN_FB()->bpp, (void *) buffer->data,
|
||||
(SENSOR_HW_FLAGS_GET(sensor, SENSOR_HW_FLAGS_RGB565_REV) && MAIN_FB()->bpp == 2));
|
||||
|
||||
// Unblock the state machine
|
||||
|
||||
@ -132,7 +132,7 @@ void ISC_SPI_DMA_IRQHandler(void)
|
||||
}
|
||||
#endif // ISC_SPI
|
||||
|
||||
static int dma_config()
|
||||
static int sesnsor_dma_config()
|
||||
{
|
||||
// DMA Stream configuration
|
||||
#if defined(MCU_SERIES_H7)
|
||||
@ -477,13 +477,13 @@ int sensor_init()
|
||||
}
|
||||
|
||||
/* Configure the DCMI DMA Stream */
|
||||
if (dma_config() != 0) {
|
||||
if (sesnsor_dma_config() != 0) {
|
||||
// DMA problem
|
||||
return -5;
|
||||
}
|
||||
|
||||
// Configure the DCMI interface.
|
||||
if (sensor_config(PIXFORMAT_INVALID) != 0){
|
||||
if (sensor_dcmi_config(PIXFORMAT_INVALID) != 0) {
|
||||
// DCMI config failed
|
||||
return -6;
|
||||
}
|
||||
@ -504,7 +504,7 @@ int sensor_init()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sensor_config(uint32_t pixformat)
|
||||
int sensor_dcmi_config(uint32_t pixformat)
|
||||
{
|
||||
// VSYNC clock polarity
|
||||
DCMIHandle.Init.VSPolarity = SENSOR_HW_FLAGS_GET(&sensor, SENSOR_HW_FLAGS_VSYNC) ?
|
||||
@ -717,7 +717,7 @@ int sensor_shutdown(int enable)
|
||||
} else {
|
||||
DCMI_PWDN_HIGH();
|
||||
}
|
||||
ret = sensor_config(sensor.pixformat);
|
||||
ret = sensor_dcmi_config(sensor.pixformat);
|
||||
}
|
||||
|
||||
systick_sleep(10);
|
||||
@ -795,7 +795,7 @@ int sensor_set_pixformat(pixformat_t pixformat)
|
||||
framebuffer_auto_adjust_buffers();
|
||||
|
||||
// Re-configure DCMI.
|
||||
return sensor_config(pixformat);
|
||||
return sensor_dcmi_config(pixformat);
|
||||
}
|
||||
|
||||
int sensor_set_framesize(framesize_t framesize)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user