Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: STM32L4xx_HAL_Driver CMSIS_DSP_401
main.h
00001 /** 00002 ****************************************************************************** 00003 * @file BSP/Inc/main.h 00004 * @author MCD Application Team 00005 * @version V1.1.0 00006 * @date 16-September-2015 00007 * @brief Header for main.c module 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00012 * 00013 * Redistribution and use in source and binary forms, with or without modification, 00014 * are permitted provided that the following conditions are met: 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 ****************************************************************************** 00036 */ 00037 00038 /* Define to prevent recursive inclusion -------------------------------------*/ 00039 #ifndef __MAIN_H 00040 #define __MAIN_H 00041 00042 /* Includes ------------------------------------------------------------------*/ 00043 #include "stdio.h" 00044 #include "string.h" 00045 #include "stm32l4xx_hal.h" 00046 #include "stm32l476g_discovery.h" 00047 00048 00049 #include "stm32l476g_discovery_glass_lcd.h" 00050 #include "stm32l476g_discovery_audio.h" 00051 #include "stm32l476g_discovery_qspi.h" 00052 00053 /* Exported constants --------------------------------------------------------*/ 00054 #define DEMO_NAME_CHAR_NB 20 00055 00056 /* Defines for the Audio playing process */ 00057 #define PAUSE_STATUS ((uint32_t)0x00) /* Audio Player in Pause Status */ 00058 #define RESUME_STATUS ((uint32_t)0x01) /* Audio Player in Resume Status */ 00059 #define IDLE_STATUS ((uint32_t)0x02) /* Audio Player in Idle Status */ 00060 00061 /* Exported types ------------------------------------------------------------*/ 00062 typedef enum 00063 { 00064 IDD_RUN = 0x00, 00065 IDD_SLEEP = 0x01, 00066 IDD_LPR_2MHZ = 0x02, 00067 IDD_LPR_SLEEP = 0x03, 00068 IDD_STOP2 = 0x04, 00069 IDD_STANDBY = 0x05, 00070 IDD_SHUTDOWN = 0x06, 00071 IDD_TEST_NB = 0x07, 00072 } Idd_StateTypeDef; 00073 00074 typedef struct 00075 { 00076 void (*DemoFunc)(void); 00077 uint8_t DemoName[DEMO_NAME_CHAR_NB]; 00078 uint32_t DemoIndex; 00079 }BSP_DemoTypedef; 00080 00081 typedef enum { 00082 AUDIO_DEMO_NONE = 0, 00083 AUDIO_DEMO_PLAYBACK, 00084 AUDIO_DEMO_RECORD 00085 } Audio_DemoTypeDef; 00086 00087 /* Exported variables --------------------------------------------------------*/ 00088 /* Variable indicating which audio demo is currently running (playback v.s. record) */ 00089 extern Audio_DemoTypeDef AudioDemo; 00090 00091 /* Flag indicating that audio playback must be paused or resumed */ 00092 extern __IO uint32_t PauseResumeStatus; 00093 00094 /* Flag indicating that audio playback must be exited */ 00095 extern __IO uint8_t AudioPlaybackExit; 00096 00097 /* Flag indicating that audio playback volume level must be changed */ 00098 extern __IO uint8_t VolumeChange; 00099 00100 /* Actual audio playback volume level */ 00101 extern __IO uint8_t Volume; 00102 00103 /* Flag indicating that audio record must be exited */ 00104 extern __IO uint8_t AudioRecordExit; 00105 00106 /* Flag indicating that record sample rate has been selected */ 00107 extern __IO uint8_t AudioRecordSampleRateSelected; 00108 00109 /* Flag indicating that record sample rate must be changed changed */ 00110 extern __IO uint8_t AudioRecordSampleRateChange; 00111 00112 /* Index within SamplesRates[] */ 00113 extern __IO uint8_t SampleRateIndex; 00114 00115 /* Exported macro ------------------------------------------------------------*/ 00116 #define COUNT_OF_EXAMPLE(x) (sizeof(x)/sizeof(BSP_DemoTypedef)) 00117 #define ABS(x) (x < 0) ? (-x) : x 00118 00119 /* Exported functions ------------------------------------------------------- */ 00120 void AudioPlay_demo(void); 00121 void AudioRecord_demo(void); 00122 void Idd_demo(void); 00123 void Gyro_demo(void); 00124 void Joystick_demo (void); 00125 void LCDGlass_demo(void); 00126 void Led_demo(void); 00127 void QSPI_demo(void); 00128 uint8_t CheckForUserInput(void); 00129 void SystemClock_Config(void); 00130 void SystemLowClock_Config(void); 00131 void SystemHardwareInit(void); 00132 void SystemHardwareDeInit(void); 00133 uint32_t SystemRtcBackupRead(void); 00134 void SystemRtcBackupWrite(uint32_t SaveIndex); 00135 void fibonacci_flash(int n); 00136 00137 void Error_Handler(void); 00138 void Convert_IntegerIntoChar(uint32_t number, uint16_t *p_tab); 00139 00140 #endif /* __MAIN_H */ 00141 00142 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 00143
Generated on Wed Jul 13 2022 00:08:45 by
1.7.2