|
| 1 | +/* |
| 2 | +Copyright (c) 2019 SparkFun Electronics |
| 3 | +
|
| 4 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | +of this software and associated documentation files (the "Software"), to deal |
| 6 | +in the Software without restriction, including without limitation the rights |
| 7 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 | +copies of the Software, and to permit persons to whom the Software is |
| 9 | +furnished to do so, subject to the following conditions: |
| 10 | +
|
| 11 | +The above copyright notice and this permission notice shall be included in all |
| 12 | +copies or substantial portions of the Software. |
| 13 | +
|
| 14 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 20 | +SOFTWARE. |
| 21 | +*/ |
| 22 | + |
| 23 | +#ifndef HM01B0_PLATFORM_EDGE_H |
| 24 | +#define HM01B0_PLATFORM_EDGE_H |
| 25 | + |
| 26 | +#ifdef __cplusplus |
| 27 | +extern "C" |
| 28 | +{ |
| 29 | +#endif |
| 30 | + |
| 31 | +#define HM01B0_PIN_D0 AM_BSP_GPIO_CAMERA_HM01B0_D0 |
| 32 | +#define HM01B0_PIN_D1 AM_BSP_GPIO_CAMERA_HM01B0_D1 |
| 33 | +#define HM01B0_PIN_D2 AM_BSP_GPIO_CAMERA_HM01B0_D2 |
| 34 | +#define HM01B0_PIN_D3 AM_BSP_GPIO_CAMERA_HM01B0_D3 |
| 35 | +#define HM01B0_PIN_D4 AM_BSP_GPIO_CAMERA_HM01B0_D4 |
| 36 | +#define HM01B0_PIN_D5 AM_BSP_GPIO_CAMERA_HM01B0_D5 |
| 37 | +#define HM01B0_PIN_D6 AM_BSP_GPIO_CAMERA_HM01B0_D6 |
| 38 | +#define HM01B0_PIN_D7 AM_BSP_GPIO_CAMERA_HM01B0_D7 |
| 39 | +#define HM01B0_PIN_VSYNC AM_BSP_GPIO_CAMERA_HM01B0_VSYNC |
| 40 | +#define HM01B0_PIN_HSYNC AM_BSP_GPIO_CAMERA_HM01B0_HSYNC |
| 41 | +#define HM01B0_PIN_PCLK AM_BSP_GPIO_CAMERA_HM01B0_PCLK |
| 42 | +#define HM01B0_PIN_SCL AM_BSP_CAMERA_HM01B0_I2C_SCL_PIN |
| 43 | +#define HM01B0_PIN_SDA AM_BSP_CAMERA_HM01B0_I2C_SDA_PIN |
| 44 | + |
| 45 | + |
| 46 | +// Some boards do not support TRIG or INT pins |
| 47 | +#ifdef AM_BSP_GPIO_CAMERA_HM01B0_TRIG |
| 48 | +#define HM01B0_PIN_TRIG AM_BSP_GPIO_CAMERA_HM01B0_TRIG |
| 49 | +#endif // AM_BSP_GPIO_CAMERA_HM01B0_TRIG |
| 50 | + |
| 51 | +#ifdef AM_BSP_GPIO_CAMERA_HM01B0_INT |
| 52 | +#define HM01B0_PIN_INT AM_BSP_GPIO_CAMERA_HM01B0_INT |
| 53 | +#endif // AM_BSP_GPIO_CAMERA_HM01B0_INT |
| 54 | + |
| 55 | + |
| 56 | +// Define AP3B's CTIMER and output pin for HM01B0 MCLK generation |
| 57 | +#define HM01B0_MCLK_GENERATOR_MOD AM_BSP_CAMERA_HM01B0_MCLK_GEN_MOD |
| 58 | +#define HM01B0_MCLK_GENERATOR_SEG AM_BSP_CAMERA_HM01B0_MCLK_GEN_SEG |
| 59 | +#define HM01B0_PIN_MCLK AM_BSP_CAMERA_HM01B0_MCLK_PIN |
| 60 | + |
| 61 | +// Deifne I2C controller and SCL(pin8)/SDA(pin9) are configured automatically. |
| 62 | +#define HM01B0_IOM_MODE AM_HAL_IOM_I2C_MODE |
| 63 | +#define HM01B0_IOM_MODULE AM_BSP_CAMERA_HM01B0_I2C_IOM |
| 64 | +#define HM01B0_I2C_CLOCK_FREQ AM_HAL_IOM_100KHZ |
| 65 | + |
| 66 | + |
| 67 | +#ifdef __cplusplus |
| 68 | +} |
| 69 | +#endif |
| 70 | + |
| 71 | +#endif // HM01B0_PLATFORM_EDGE_H |
0 commit comments