STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
main.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __MAIN_H
40 #define __MAIN_H
41 
42 /* Includes ------------------------------------------------------------------*/
43 #include "stm32f7xx_hal.h"
44 #include "usbd_core.h"
45 #include "usbd_desc.h"
46 #include "usbd_audio.h"
47 #include "usbd_audio_if.h"
48 #include "usbd_main.h"
49 #include "stm32f769i_discovery.h"
55 
56 #include "cmsis_os.h"
57 #include "semphr.h"
58 #include "arm_math.h"
59 
60 #include "AudioPlayer.h"
61 #include "SPDIF_Rx.h"
62 #include "SPDIF_Tx.h"
63 #include "VUMeter.h"
64 
65 //what is our main function:
66 //#define main_http main
67 #define main_audio main
68 
69 // stop watch to measure performance
72 
73 #define TIM_MEASURE_BEGIN do { \
74  if ( ! time_begin) \
75  time_begin = hTim2.Instance->CNT; \
76  } \
77  while(0)
78 #define TIM_MEASURE_START time_start = hTim2.Instance->CNT
79 #define TIM_MEASURE_END time_end = hTim2.Instance->CNT; \
80  time_diff = time_end - time_start
81 #define TIM_MEASURE_TOTAL time_total = time_end - time_begin; time_begin = 0
82 
85 extern DFSDM_Filter_HandleTypeDef hAudioInTopLeftFilter;
86 extern DFSDM_Filter_HandleTypeDef hAudioInTopRightFilter;
87 
88 extern LTDC_HandleTypeDef hltdc_discovery;
89 extern DSI_HandleTypeDef hdsi_discovery;
90 
91 /* Exported types ------------------------------------------------------------*/
92 /* Exported constants --------------------------------------------------------*/
93 #ifdef UDANTE
94 #undef USE_DHCP /* we do not need DHCP with Network Audio, any IP address, just listen */
95  /* it does not work anyway because just IP and UDP stack enabled */
96 #else
97 #define USE_DHCP /* enable DHCP, if disabled static address is used*/
98 #endif
99 
100 /*Static IP ADDRESS*/
101 #ifdef UDANTE
102 /* with Network Audio - we do not need really IP address, running in promiscuous mode and never sending */
103 #define IP_ADDR0 192
104 #define IP_ADDR1 168
105 #define IP_ADDR2 1
106 #define IP_ADDR3 180
107 #else
108 #define IP_ADDR0 192
109 #define IP_ADDR1 168
110 #define IP_ADDR2 1
111 #define IP_ADDR3 180
112 #endif
113 
114 /*NETMASK*/
115 #define NETMASK_ADDR0 255
116 #define NETMASK_ADDR1 255
117 #define NETMASK_ADDR2 255
118 #define NETMASK_ADDR3 0
119 
120 /*Gateway Address*/
121 #define GW_ADDR0 IP_ADDR0
122 #define GW_ADDR1 IP_ADDR1
123 #define GW_ADDR2 IP_ADDR2
124 #define GW_ADDR3 1
125 
126 /* Exported macro ------------------------------------------------------------*/
127 /* Exported functions ------------------------------------------------------- */
128 
129 #endif /* __MAIN_H */
130 
131 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
volatile uint32_t time_total
Definition: main.h:70
DSI_HandleTypeDef hdsi_discovery
This file contains definitions for STM32F769I-Discovery LEDs, push-buttons hardware resources...
This file contains the common defines and functions prototypes for the stm32f769i_discovery_sdram.c driver.
This file contains the common defines and functions prototypes for the stm32f769i_discovery_qspi.c driver.
This file contains the common defines and functions prototypes for the stm32469i_discovery_lcd.c driver.
TIM_HandleTypeDef hTim2
Definition: main.h:71
volatile uint32_t time_end
Definition: main.h:70
This file contains all the functions prototypes for the HAL module driver.
volatile uint32_t time_start
Definition: main.h:70
LTDC_HandleTypeDef hltdc_discovery
DFSDM_Filter_HandleTypeDef hAudioInTopLeftFilter
TIM Time Base Handle Structure definition.
DFSDM_Filter_HandleTypeDef hAudioInTopRightFilter
This file contains the common defines and functions prototypes for the stm32f769i_discovery_ts.c driver.
header file for the usbd_audio.c file.
This file contains the common defines and functions prototypes for the stm32f769i_discovery_audio.c driver.
volatile uint32_t time_diff
Definition: main.h:70
SAI_HandleTypeDef haudio_out_sai
Header file for usbd_core.c file.
volatile uint32_t time_begin
Definition: main.h:70
SAI_HandleTypeDef haudio_in_sai