thomas haine
/
CIS001_v2_v2
cis001v2
main.h@7:4c77f017b4b8, 2021-01-06 (annotated)
- Committer:
- thomashaine
- Date:
- Wed Jan 06 13:35:17 2021 +0000
- Revision:
- 7:4c77f017b4b8
- Parent:
- 6:b544e474f959
- Child:
- 8:66caa906d24c
before_linkert_test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomashaine | 0:e7352f4f3dcb | 1 | /* USER CODE BEGIN Header */ |
thomashaine | 0:e7352f4f3dcb | 2 | /** |
thomashaine | 0:e7352f4f3dcb | 3 | ****************************************************************************** |
thomashaine | 0:e7352f4f3dcb | 4 | * @file : main.h |
thomashaine | 0:e7352f4f3dcb | 5 | * @brief : Header for main.c file. |
thomashaine | 0:e7352f4f3dcb | 6 | * This file contains the common defines of the application. |
thomashaine | 0:e7352f4f3dcb | 7 | ****************************************************************************** |
thomashaine | 0:e7352f4f3dcb | 8 | * @attention |
thomashaine | 0:e7352f4f3dcb | 9 | * |
thomashaine | 0:e7352f4f3dcb | 10 | * <h2><center>© Copyright (c) 2020 STMicroelectronics. |
thomashaine | 0:e7352f4f3dcb | 11 | * All rights reserved.</center></h2> |
thomashaine | 0:e7352f4f3dcb | 12 | * |
thomashaine | 0:e7352f4f3dcb | 13 | * This software component is licensed by ST under BSD 3-Clause license, |
thomashaine | 0:e7352f4f3dcb | 14 | * the "License"; You may not use this file except in compliance with the |
thomashaine | 0:e7352f4f3dcb | 15 | * License. You may obtain a copy of the License at: |
thomashaine | 0:e7352f4f3dcb | 16 | * opensource.org/licenses/BSD-3-Clause |
thomashaine | 0:e7352f4f3dcb | 17 | * |
thomashaine | 0:e7352f4f3dcb | 18 | ****************************************************************************** |
thomashaine | 0:e7352f4f3dcb | 19 | */ |
thomashaine | 0:e7352f4f3dcb | 20 | /* USER CODE END Header */ |
thomashaine | 0:e7352f4f3dcb | 21 | |
thomashaine | 0:e7352f4f3dcb | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 23 | #ifndef __MAIN_H |
thomashaine | 0:e7352f4f3dcb | 24 | #define __MAIN_H |
thomashaine | 0:e7352f4f3dcb | 25 | |
thomashaine | 0:e7352f4f3dcb | 26 | #ifdef __cplusplus |
thomashaine | 0:e7352f4f3dcb | 27 | extern "C" { |
thomashaine | 0:e7352f4f3dcb | 28 | #endif |
thomashaine | 0:e7352f4f3dcb | 29 | |
thomashaine | 0:e7352f4f3dcb | 30 | /* Includes ------------------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 31 | #include "stm32h7xx_hal.h" |
thomashaine | 0:e7352f4f3dcb | 32 | |
thomashaine | 7:4c77f017b4b8 | 33 | |
thomashaine | 0:e7352f4f3dcb | 34 | /* Private includes ----------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 35 | /* USER CODE BEGIN Includes */ |
thomashaine | 0:e7352f4f3dcb | 36 | |
thomashaine | 0:e7352f4f3dcb | 37 | /* USER CODE END Includes */ |
thomashaine | 0:e7352f4f3dcb | 38 | |
thomashaine | 0:e7352f4f3dcb | 39 | /* Exported types ------------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 40 | /* USER CODE BEGIN ET */ |
thomashaine | 0:e7352f4f3dcb | 41 | |
thomashaine | 0:e7352f4f3dcb | 42 | /* USER CODE END ET */ |
thomashaine | 0:e7352f4f3dcb | 43 | |
thomashaine | 0:e7352f4f3dcb | 44 | /* Exported constants --------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 45 | /* USER CODE BEGIN EC */ |
thomashaine | 0:e7352f4f3dcb | 46 | |
thomashaine | 6:b544e474f959 | 47 | const int frame_bsize_8b =640*480*1; //640*480 pixels de 1 byte |
thomashaine | 6:b544e474f959 | 48 | const int frame_bsize_QQVGA_8b =160*120*1; //160*120 pixels de 1 byte |
thomashaine | 6:b544e474f959 | 49 | const int frame_bsize_10b =640*480*2; //640*480 pixels de 2 byte |
thomashaine | 6:b544e474f959 | 50 | const int frame_bsize_QQVGA_10b =160*120*2; //160*120 pixels de 2 byte |
thomashaine | 0:e7352f4f3dcb | 51 | |
thomashaine | 0:e7352f4f3dcb | 52 | /* USER CODE END EC */ |
thomashaine | 0:e7352f4f3dcb | 53 | |
thomashaine | 0:e7352f4f3dcb | 54 | /* Exported macro ------------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 55 | /* USER CODE BEGIN EM */ |
thomashaine | 0:e7352f4f3dcb | 56 | |
thomashaine | 0:e7352f4f3dcb | 57 | /* USER CODE END EM */ |
thomashaine | 0:e7352f4f3dcb | 58 | |
thomashaine | 0:e7352f4f3dcb | 59 | /* Exported functions prototypes ---------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 60 | void Error_Handler(void); |
thomashaine | 0:e7352f4f3dcb | 61 | |
thomashaine | 0:e7352f4f3dcb | 62 | /* USER CODE BEGIN EFP */ |
thomashaine | 0:e7352f4f3dcb | 63 | |
thomashaine | 0:e7352f4f3dcb | 64 | /* Private function prototypes -----------------------------------------------*/ |
thomashaine | 1:5060c8ea0ccd | 65 | // functions for sending frame over ethernet |
thomashaine | 1:5060c8ea0ccd | 66 | void print_start_frame(void); |
thomashaine | 1:5060c8ea0ccd | 67 | void send_frame_ethernet(void); |
thomashaine | 1:5060c8ea0ccd | 68 | int send_frame_ethernet_nohandshake_while(void); |
thomashaine | 1:5060c8ea0ccd | 69 | |
thomashaine | 1:5060c8ea0ccd | 70 | |
thomashaine | 6:b544e474f959 | 71 | void process_message(int rcount, char* rbuffer); |
thomashaine | 6:b544e474f959 | 72 | |
thomashaine | 1:5060c8ea0ccd | 73 | // configuration functions |
thomashaine | 1:5060c8ea0ccd | 74 | static void MX_GPIO_Init(void); |
thomashaine | 1:5060c8ea0ccd | 75 | static void MX_DMA_Init(void); |
thomashaine | 1:5060c8ea0ccd | 76 | static void MX_DCMI_Init_8b(void); |
thomashaine | 1:5060c8ea0ccd | 77 | static void MX_DCMI_Init_10b(void); |
thomashaine | 1:5060c8ea0ccd | 78 | |
thomashaine | 1:5060c8ea0ccd | 79 | // capture functions |
thomashaine | 1:5060c8ea0ccd | 80 | void start_capture_10b(); |
thomashaine | 1:5060c8ea0ccd | 81 | void start_video(); |
thomashaine | 1:5060c8ea0ccd | 82 | void suspend_capture(void); |
thomashaine | 1:5060c8ea0ccd | 83 | void resume_capture(void); |
thomashaine | 1:5060c8ea0ccd | 84 | void stop_capture(void); |
thomashaine | 0:e7352f4f3dcb | 85 | |
thomashaine | 0:e7352f4f3dcb | 86 | |
thomashaine | 0:e7352f4f3dcb | 87 | /* USER CODE END EFP */ |
thomashaine | 0:e7352f4f3dcb | 88 | |
thomashaine | 0:e7352f4f3dcb | 89 | /* Private defines -----------------------------------------------------------*/ |
thomashaine | 0:e7352f4f3dcb | 90 | #define B1_Pin GPIO_PIN_13 |
thomashaine | 0:e7352f4f3dcb | 91 | #define B1_GPIO_Port GPIOC |
thomashaine | 0:e7352f4f3dcb | 92 | #define OSC32_IN_Pin GPIO_PIN_14 |
thomashaine | 0:e7352f4f3dcb | 93 | #define OSC32_IN_GPIO_Port GPIOC |
thomashaine | 0:e7352f4f3dcb | 94 | #define OSC32_OUT_Pin GPIO_PIN_15 |
thomashaine | 0:e7352f4f3dcb | 95 | #define OSC32_OUT_GPIO_Port GPIOC |
thomashaine | 0:e7352f4f3dcb | 96 | #define USB_FS_PWR_EN_Pin GPIO_PIN_10 |
thomashaine | 0:e7352f4f3dcb | 97 | #define USB_FS_PWR_EN_GPIO_Port GPIOF |
thomashaine | 0:e7352f4f3dcb | 98 | #define PH0_MCU_Pin GPIO_PIN_0 |
thomashaine | 0:e7352f4f3dcb | 99 | #define PH0_MCU_GPIO_Port GPIOH |
thomashaine | 0:e7352f4f3dcb | 100 | #define PH1_MCU_Pin GPIO_PIN_1 |
thomashaine | 0:e7352f4f3dcb | 101 | #define PH1_MCU_GPIO_Port GPIOH |
thomashaine | 0:e7352f4f3dcb | 102 | #define LD1_Pin GPIO_PIN_0 |
thomashaine | 0:e7352f4f3dcb | 103 | #define LD1_GPIO_Port GPIOB |
thomashaine | 0:e7352f4f3dcb | 104 | #define LD3_Pin GPIO_PIN_14 |
thomashaine | 0:e7352f4f3dcb | 105 | #define LD3_GPIO_Port GPIOB |
thomashaine | 0:e7352f4f3dcb | 106 | #define STLINK_RX_Pin GPIO_PIN_8 |
thomashaine | 0:e7352f4f3dcb | 107 | #define STLINK_RX_GPIO_Port GPIOD |
thomashaine | 0:e7352f4f3dcb | 108 | #define STLINK_TX_Pin GPIO_PIN_9 |
thomashaine | 0:e7352f4f3dcb | 109 | #define STLINK_TX_GPIO_Port GPIOD |
thomashaine | 0:e7352f4f3dcb | 110 | #define USB_FS_OVCR_Pin GPIO_PIN_7 |
thomashaine | 0:e7352f4f3dcb | 111 | #define USB_FS_OVCR_GPIO_Port GPIOG |
thomashaine | 0:e7352f4f3dcb | 112 | #define USB_FS_VBUS_Pin GPIO_PIN_9 |
thomashaine | 0:e7352f4f3dcb | 113 | #define USB_FS_VBUS_GPIO_Port GPIOA |
thomashaine | 0:e7352f4f3dcb | 114 | #define USB_FS_ID_Pin GPIO_PIN_10 |
thomashaine | 0:e7352f4f3dcb | 115 | #define USB_FS_ID_GPIO_Port GPIOA |
thomashaine | 0:e7352f4f3dcb | 116 | #define USB_FS_N_Pin GPIO_PIN_11 |
thomashaine | 0:e7352f4f3dcb | 117 | #define USB_FS_N_GPIO_Port GPIOA |
thomashaine | 0:e7352f4f3dcb | 118 | #define USB_FS_P_Pin GPIO_PIN_12 |
thomashaine | 0:e7352f4f3dcb | 119 | #define USB_FS_P_GPIO_Port GPIOA |
thomashaine | 0:e7352f4f3dcb | 120 | #define LD2_Pin GPIO_PIN_1 |
thomashaine | 0:e7352f4f3dcb | 121 | #define LD2_GPIO_Port GPIOE |
thomashaine | 0:e7352f4f3dcb | 122 | /* USER CODE BEGIN Private defines */ |
thomashaine | 0:e7352f4f3dcb | 123 | |
thomashaine | 0:e7352f4f3dcb | 124 | /* USER CODE END Private defines */ |
thomashaine | 0:e7352f4f3dcb | 125 | |
thomashaine | 0:e7352f4f3dcb | 126 | #ifdef __cplusplus |
thomashaine | 0:e7352f4f3dcb | 127 | } |
thomashaine | 0:e7352f4f3dcb | 128 | #endif |
thomashaine | 0:e7352f4f3dcb | 129 | |
thomashaine | 0:e7352f4f3dcb | 130 | #endif /* __MAIN_H */ |
thomashaine | 0:e7352f4f3dcb | 131 | |
thomashaine | 0:e7352f4f3dcb | 132 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |