diff --git a/src/omv/ports/nrf/cambus_struct.h b/src/omv/ports/nrf/cambus_struct.h deleted file mode 100644 index a192b775f..000000000 --- a/src/omv/ports/nrf/cambus_struct.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the OpenMV project. - * - * Copyright (c) 2013-2019 Ibrahim Abdelkader - * Copyright (c) 2013-2019 Kwabena W. Agyeman - * - * This work is licensed under the MIT license, see the file LICENSE for details. - * - * NRF port camera bus struct definition. - */ -#ifndef __CAMBUS_STRUCT_H__ -#define __CAMBUS_STRUCT_H__ - -#include "nrfx_twi.h" - -typedef enum _cambus_speed { - CAMBUS_SPEED_STANDARD = TWI_FREQUENCY_FREQUENCY_K100, ///< 100 kbps - CAMBUS_SPEED_FULL = TWI_FREQUENCY_FREQUENCY_K250, ///< 250 kbps - CAMBUS_SPEED_FAST = TWI_FREQUENCY_FREQUENCY_K400 ///< 400 kbps -} cambus_speed_t; - -typedef struct _cambus { - uint32_t id; - uint32_t speed; - uint32_t scl_pin; - uint32_t sda_pin; - uint32_t initialized; - nrfx_twi_t twi; -} cambus_t; -#endif // __CAMBUS_STRUCT_H__ diff --git a/src/omv/ports/stm32/cambus_struct.h b/src/omv/ports/stm32/cambus_struct.h deleted file mode 100644 index 4b81600f7..000000000 --- a/src/omv/ports/stm32/cambus_struct.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of the OpenMV project. - * - * Copyright (c) 2013-2019 Ibrahim Abdelkader - * Copyright (c) 2013-2019 Kwabena W. Agyeman - * - * This work is licensed under the MIT license, see the file LICENSE for details. - * - * STM32 port camera bus struct definition. - */ -#ifndef __CAMBUS_STRUCT_H__ -#define __CAMBUS_STRUCT_H__ - -#include STM32_HAL_H - -typedef enum _cambus_speed { - #if defined(STM32F4) - CAMBUS_SPEED_STANDARD =(100000U), - CAMBUS_SPEED_FULL =(400000U), - CAMBUS_SPEED_FAST =(400000U), - #elif defined(STM32F7) - // These timing values are for f_I2CCLK=54MHz and are only approximate - CAMBUS_SPEED_STANDARD =(0x1090699B), - CAMBUS_SPEED_FULL =(0x70330309), - CAMBUS_SPEED_FAST =(0x50100103), - #elif defined(STM32H7) - // I2C timing obtained from the CUBEMX. - CAMBUS_SPEED_STANDARD =(0x20D09DE7), - CAMBUS_SPEED_FULL =(0x40900C22), - CAMBUS_SPEED_FAST =(0x4030040B), - #else - #error "no I2C timings for this MCU" - #endif -} cambus_speed_t ; - -typedef struct _cambus { - uint32_t id; - uint32_t speed; - uint32_t scl_pin; - uint32_t sda_pin; - GPIO_TypeDef *port; - // This pointer will be set to its respective I2C handle defined in MicroPython - // because all I2C IRQs are defined in stm32_it.c and handled by MicroPython. - I2C_HandleTypeDef *i2c; -} cambus_t; -#endif // __CAMBUS_STRUCT_H__