aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-01-25 22:23:13 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-01-25 22:23:17 +0100
commit2fff65aed2477a503c72629d27e2a330d30c02d1 (patch)
tree96fd9f2f8151e266c0cf8563a714d7bab8aa7cb0 /thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt
parent41fdd2b1f35bcb4224fdb8fee2b959e09d1f5916 (diff)
downloadstm32f103-playground-2fff65aed2477a503c72629d27e2a330d30c02d1.tar.gz
stm32f103-playground-2fff65aed2477a503c72629d27e2a330d30c02d1.tar.bz2
stm32f103-playground-2fff65aed2477a503c72629d27e2a330d30c02d1.tar.xz
stm32f103-playground-2fff65aed2477a503c72629d27e2a330d30c02d1.zip
o Seemingly working Mutexes.
o Dropping the privileged/unprivileged split for now.
Diffstat (limited to 'thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt')
-rw-r--r--thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/platform_config.h128
-rw-r--r--thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/readme.txt117
-rw-r--r--thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/stm32f10x_conf.h76
3 files changed, 321 insertions, 0 deletions
diff --git a/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/platform_config.h b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/platform_config.h
new file mode 100644
index 0000000..b0f39c6
--- /dev/null
+++ b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/platform_config.h
@@ -0,0 +1,128 @@
+/**
+ ******************************************************************************
+ * @file USART/Interrupt/platform_config.h
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 08-April-2011
+ * @brief Evaluation board specific configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __PLATFORM_CONFIG_H
+#define __PLATFORM_CONFIG_H
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* Uncomment the line corresponding to the STMicroelectronics evaluation board
+ used to run the example */
+#if !defined (USE_STM3210B_EVAL) && !defined (USE_STM3210E_EVAL) && !defined (USE_STM3210C_EVAL) && !defined (USE_STM32100B_EVAL) && !defined (USE_STM32100E_EVAL)
+ //#define USE_STM32100B_EVAL
+ //#define USE_STM3210B_EVAL
+ //#define USE_STM3210E_EVAL
+ //#define USE_STM3210C_EVAL
+ #define USE_STM32100E_EVAL
+#endif
+
+/* Define the STM32F10x hardware depending on the used evaluation board */
+#ifdef USE_STM3210B_EVAL
+
+ #define USARTy USART1
+ #define USARTy_GPIO GPIOA
+ #define USARTy_CLK RCC_APB2Periph_USART1
+ #define USARTy_GPIO_CLK RCC_APB2Periph_GPIOA
+ #define USARTy_RxPin GPIO_Pin_10
+ #define USARTy_TxPin GPIO_Pin_9
+ #define USARTy_IRQn USART1_IRQn
+ #define USARTy_IRQHandler USART1_IRQHandler
+
+ #define USARTz USART2
+ #define USARTz_GPIO GPIOD
+ #define USARTz_CLK RCC_APB1Periph_USART2
+ #define USARTz_GPIO_CLK RCC_APB2Periph_GPIOD
+ #define USARTz_RxPin GPIO_Pin_6
+ #define USARTz_TxPin GPIO_Pin_5
+ #define USARTz_IRQn USART2_IRQn
+ #define USARTz_IRQHandler USART2_IRQHandler
+
+#elif defined (USE_STM3210E_EVAL) || defined (USE_STM32100E_EVAL)
+
+ #define USARTy USART1
+ #define USARTy_GPIO GPIOA
+ #define USARTy_CLK RCC_APB2Periph_USART1
+ #define USARTy_GPIO_CLK RCC_APB2Periph_GPIOA
+ #define USARTy_RxPin GPIO_Pin_10
+ #define USARTy_TxPin GPIO_Pin_9
+ #define USARTy_IRQn USART1_IRQn
+ #define USARTy_IRQHandler USART1_IRQHandler
+
+ #define USARTz USART2
+ #define USARTz_GPIO GPIOA
+ #define USARTz_CLK RCC_APB1Periph_USART2
+ #define USARTz_GPIO_CLK RCC_APB2Periph_GPIOA
+ #define USARTz_RxPin GPIO_Pin_3
+ #define USARTz_TxPin GPIO_Pin_2
+ #define USARTz_IRQn USART2_IRQn
+ #define USARTz_IRQHandler USART2_IRQHandler
+
+#elif defined USE_STM3210C_EVAL
+
+ #define USARTy USART2
+ #define USARTy_GPIO GPIOD
+ #define USARTy_CLK RCC_APB1Periph_USART2
+ #define USARTy_GPIO_CLK RCC_APB2Periph_GPIOD
+ #define USARTy_RxPin GPIO_Pin_6
+ #define USARTy_TxPin GPIO_Pin_5
+ #define USARTy_IRQn USART2_IRQn
+ #define USARTy_IRQHandler USART2_IRQHandler
+
+ #define USARTz USART3
+ #define USARTz_GPIO GPIOC
+ #define USARTz_CLK RCC_APB1Periph_USART3
+ #define USARTz_GPIO_CLK RCC_APB2Periph_GPIOC
+ #define USARTz_RxPin GPIO_Pin_11
+ #define USARTz_TxPin GPIO_Pin_10
+ #define USARTz_IRQn USART3_IRQn
+ #define USARTz_IRQHandler USART3_IRQHandler
+
+#elif defined USE_STM32100B_EVAL
+
+ #define USARTy USART1
+ #define USARTy_GPIO GPIOA
+ #define USARTy_CLK RCC_APB2Periph_USART1
+ #define USARTy_GPIO_CLK RCC_APB2Periph_GPIOA
+ #define USARTy_RxPin GPIO_Pin_10
+ #define USARTy_TxPin GPIO_Pin_9
+ #define USARTy_IRQn USART1_IRQn
+ #define USARTy_IRQHandler USART1_IRQHandler
+
+ #define USARTz USART2
+ #define USARTz_GPIO GPIOD
+ #define USARTz_CLK RCC_APB1Periph_USART2
+ #define USARTz_GPIO_CLK RCC_APB2Periph_GPIOD
+ #define USARTz_RxPin GPIO_Pin_6
+ #define USARTz_TxPin GPIO_Pin_5
+ #define USARTz_IRQn USART2_IRQn
+ #define USARTz_IRQHandler USART2_IRQHandler
+
+#endif /* USE_STM3210B_EVAL */
+
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+
+#endif /* __PLATFORM_CONFIG_H */
+
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
diff --git a/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/readme.txt b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/readme.txt
new file mode 100644
index 0000000..fa9a2a9
--- /dev/null
+++ b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/readme.txt
@@ -0,0 +1,117 @@
+/**
+ @page USART_Interrupt USART Interrupts example
+
+ @verbatim
+ ******************** (C) COPYRIGHT 2011 STMicroelectronics *******************
+ * @file USART/Interrupt/readme.txt
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 08-April-2011
+ * @brief Description of the USART Interrupts example.
+ ******************************************************************************
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ ******************************************************************************
+ @endverbatim
+
+@par Example Description
+
+This example provides a basic communication between USARTy and USARTz using
+interrupts. USARTy and USARTz can be USART1 and USART2 or USART2 and USART3,
+depending on the STMicroelectronics EVAL board you are using.
+
+USARTz sends TxBuffer2 to USARTy which sends TxBuffer1 to USARTz. The data received
+by USARTy and USARTz are stored respectively in RxBuffer1 and RxBuffer2. The data
+transfer is managed in USARTy_IRQHandler and USARTz_IRQHandler in stm32f10x_it.c file.
+
+USARTy and USARTz configured as follow:
+ - BaudRate = 9600 baud
+ - Word Length = 8 Bits
+ - One Stop Bit
+ - No parity
+ - Hardware flow control disabled (RTS and CTS signals)
+ - Receive and transmit enabled
+
+
+@par Directory contents
+
+ - USART/Interrupt/platform_config.h Evaluation board specific configuration file
+ - USART/Interrupt/stm32f10x_conf.h Library Configuration file
+ - USART/Interrupt/stm32f10x_it.h Interrupt handlers header file
+ - USART/Interrupt/stm32f10x_it.c Interrupt handlers
+ - USART/Interrupt/main.c Main program
+ - USART/Interrupt/system_stm32f10x.c STM32F10x system source file
+
+@par Hardware and Software environment
+
+ - This example runs on STM32F10x Connectivity line, High-Density, High-Density
+ Value line, Medium-Density, XL-Density, Medium-Density Value line, Low-Density
+ and Low-Density Value line Devices.
+
+ - This example has been tested with STMicroelectronics STM32100E-EVAL (High-Density
+ Value line), STM32100B-EVAL (Medium-Density Value line), STM3210C-EVAL (Connectivity line),
+ STM3210E-EVAL (High-Density and XL-Density) and STM3210B-EVAL (Medium-Density)
+ evaluation boards and can be easily tailored to any other supported device
+ and development board.
+ To select the STMicroelectronics evaluation board used to run the example,
+ uncomment the corresponding line in USART/Interrupt/platform_config.h file
+
+ - STM32100E-EVAL Set-up
+ - Connect a null-modem female/female RS232 cable between CN10 (USART1) and
+ CN5 (USART2).
+ @note Make sure that jumper JP5 is not open.
+
+ - STM32100B-EVAL Set-up
+ - Connect a null-modem female/female RS232 cable between CN10 (USART1) and
+ CN9 (USART2).
+ @note In this case USART2 Tx and Rx pins are remapped by software on PD.05
+ and PD.06 respectively.
+
+ - STM3210C-EVAL Set-up
+ - Connect USART2 Tx pin (PD.05) to USART3 Rx pin (PC.11)
+ - Connect USART2 Rx pin (PD.06) to USART3 Tx pin (PC.10)
+ @note In this case USART3 Tx and Rx pins are remapped by software.
+ Make sure that jumpers JP19 and JP18 are open.
+
+ - STM3210E-EVAL Set-up
+ - Connect a null-modem female/female RS232 cable between CN12 (USART1) and
+ CN8 (USART2).
+
+ - STM3210B-EVAL Set-up
+ - Connect a null-modem female/female RS232 cable between CN6 (USART1) and
+ CN5 (USART2).
+ - In this case USART2 Tx and Rx pins are remapped by software on PD.05
+ and PD.06 respectively.
+
+@par How to use it ?
+
+In order to make the program work, you must do the following :
+ - Copy all source files from this example folder to the template folder under
+ Project\STM32F10x_StdPeriph_Template
+ - Open your preferred toolchain
+ - Rebuild all files and load your image into target memory
+ - Run the example
+
+@note
+ - Low-density Value line devices are STM32F100xx microcontrollers where the
+ Flash memory density ranges between 16 and 32 Kbytes.
+ - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx
+ microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes.
+ - Medium-density Value line devices are STM32F100xx microcontrollers where
+ the Flash memory density ranges between 64 and 128 Kbytes.
+ - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx
+ microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes.
+ - High-density Value line devices are STM32F100xx microcontrollers where
+ the Flash memory density ranges between 256 and 512 Kbytes.
+ - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
+ the Flash memory density ranges between 256 and 512 Kbytes.
+ - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
+ the Flash memory density ranges between 512 and 1024 Kbytes.
+ - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
+
+ * <h3><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h3>
+ */
diff --git a/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/stm32f10x_conf.h b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/stm32f10x_conf.h
new file mode 100644
index 0000000..96b210c
--- /dev/null
+++ b/thirdparty/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/Interrupt/stm32f10x_conf.h
@@ -0,0 +1,76 @@
+/**
+ ******************************************************************************
+ * @file USART/Interrupt/stm32f10x_conf.h
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 08-April-2011
+ * @brief Library configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F10x_CONF_H
+#define __STM32F10x_CONF_H
+
+/* Includes ------------------------------------------------------------------*/
+/* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */
+#include "stm32f10x_adc.h"
+#include "stm32f10x_bkp.h"
+#include "stm32f10x_can.h"
+#include "stm32f10x_cec.h"
+#include "stm32f10x_crc.h"
+#include "stm32f10x_dac.h"
+#include "stm32f10x_dbgmcu.h"
+#include "stm32f10x_dma.h"
+#include "stm32f10x_exti.h"
+#include "stm32f10x_flash.h"
+#include "stm32f10x_fsmc.h"
+#include "stm32f10x_gpio.h"
+#include "stm32f10x_i2c.h"
+#include "stm32f10x_iwdg.h"
+#include "stm32f10x_pwr.h"
+#include "stm32f10x_rcc.h"
+#include "stm32f10x_rtc.h"
+#include "stm32f10x_sdio.h"
+#include "stm32f10x_spi.h"
+#include "stm32f10x_tim.h"
+#include "stm32f10x_usart.h"
+#include "stm32f10x_wwdg.h"
+#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* Uncomment the line below to expanse the "assert_param" macro in the
+ Standard Peripheral Library drivers code */
+/* #define USE_FULL_ASSERT 1 */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr: If expr is false, it calls assert_failed function which reports
+ * the name of the source file and the source line number of the call
+ * that failed. If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0)
+#endif /* USE_FULL_ASSERT */
+
+#endif /* __STM32F10x_CONF_H */
+
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/