Browse Source

添加UART1

div1
QQyyblithe 2 years ago
parent
commit
cb9e5e16a5
9 changed files with 225 additions and 168 deletions
  1. +7
    -7
      IAR/settings/test01.dbgdt
  2. +1
    -1
      IAR/settings/test01.dnx
  3. +15
    -15
      IAR/settings/test01.wsdt
  4. +141
    -141
      IAR/test01.dep
  5. +2
    -1
      user/main.c
  6. +13
    -0
      user/pin_Init.c
  7. +3
    -0
      user/pin_Init.h
  8. +41
    -2
      user/uart_Interrupt.c
  9. +2
    -1
      user/uart_Interrupt.h

+ 7
- 7
IAR/settings/test01.dbgdt
File diff suppressed because it is too large
View File


+ 1
- 1
IAR/settings/test01.dnx View File

@@ -35,7 +35,7 @@
<LeaveTargetRunning>_ 0</LeaveTargetRunning>
</JLinkDriver>
<DebugChecksum>
<Checksum>2166995177</Checksum>
<Checksum>1035944093</Checksum>
</DebugChecksum>
<Exceptions>
<StopOnUncaught>_ 0</StopOnUncaught>


+ 15
- 15
IAR/settings/test01.wsdt
File diff suppressed because it is too large
View File


+ 141
- 141
IAR/test01.dep View File

@@ -5,398 +5,398 @@
<configuration>
<name>Debug</name>
<outputs>
<file>$PROJ_DIR$\..\drivers\fsl_common.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_gpio.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_port.h</file>
<file>$PROJ_DIR$\..\startup\MKV56F24.h</file>
<file>$PROJ_DIR$\..\startup\startup_MKV56F24.s</file>
<file>$PROJ_DIR$\..\startup\system_MKV56F24.c</file>
<file>$PROJ_DIR$\..\user\delay.c</file>
<file>$PROJ_DIR$\..\Include\mpu_armv7.h</file>
<file>$PROJ_DIR$\..\drivers\fsl_uart.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_clock.c</file>
<file>$PROJ_DIR$\..\user\delay.h</file>
<file>$PROJ_DIR$\Debug\Obj\delay.o</file>
<file>$PROJ_DIR$\..\user\uart_Interrupt.c</file>
<file>$PROJ_DIR$\..\user\uart_Interrupt.h</file>
<file>$PROJ_DIR$\..\user\main.c</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.__cstat.et</file>
<file>$PROJ_DIR$\..\drivers\fsl_common.h</file>
<file>$PROJ_DIR$\..\user\pin_Init.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_gpio.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_clock.c</file>
<file>$PROJ_DIR$\..\drivers\fsl_common.c</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_common.__cstat.et</file>
<file>$TOOLKIT_DIR$\inc\c\ysizet.h</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product.h</file>
<file>$PROJ_DIR$\..\startup\MKV56F24.h</file>
<file>$PROJ_DIR$\..\Include\core_cm7.h</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product_string.h</file>
<file>$TOOLKIT_DIR$\inc\c\iccarm_builtin.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_common.xcl</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product.h</file>
<file>$PROJ_DIR$\Debug\Exe\test01.out</file>
<file>$PROJ_DIR$\..\Include\cmsis_version.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_clock.xcl</file>
<file>$PROJ_DIR$\Debug\List\test01.map</file>
<file>$TOOLKIT_DIR$\inc\c\string.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_gpio.o</file>
<file>$PROJ_DIR$\..\user\delay.c</file>
<file>$PROJ_DIR$\..\user\pin_Init.c</file>
<file>$TOOLKIT_DIR$\inc\c\iccarm_builtin.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_clock.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\main.__cstat.et</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product_string.h</file>
<file>$PROJ_DIR$\..\Include\mpu_armv7.h</file>
<file>$PROJ_DIR$\..\startup\system_MKV56F24.c</file>
<file>$PROJ_DIR$\..\startup\startup_MKV56F24.s</file>
<file>$TOOLKIT_DIR$\inc\c\stddef.h</file>
<file>$TOOLKIT_DIR$\inc\c\yvals.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_common.__cstat.et</file>
<file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
<file>$TOOLKIT_DIR$\config\linker\NXP\MKV5xF512xxx24.icf</file>
<file>$PROJ_DIR$\..\user\delay.h</file>
<file>$PROJ_DIR$\Debug\Obj\delay.o</file>
<file>$PROJ_DIR$\..\startup\fsl_device_registers.h</file>
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_str.__cstat.et</file>
<file>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console.c</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product_stdlib.h</file>
<file>$PROJ_DIR$\Debug\Obj\test01.pbd</file>
<file>$PROJ_DIR$\..\utilities\str\fsl_str.h</file>
<file>$TOOLKIT_DIR$\inc\c\math.h</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_str.xcl</file>
<file>$PROJ_DIR$\..\drivers\fsl_gpio.h</file>
<file>$PROJ_DIR$\..\startup\system_MKV56F24.h</file>
<file>$PROJ_DIR$\..\startup\MKV56F24_features.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_gpio.xcl</file>
<file>$PROJ_DIR$\..\Include\cmsis_compiler.h</file>
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
<file>$PROJ_DIR$\..\utilities\str\fsl_str.c</file>
<file>$TOOLKIT_DIR$\inc\c\ycheck.h</file>
<file>$PROJ_DIR$\Debug\Obj\test01.pbd</file>
<file>$PROJ_DIR$\..\Include\cmsis_iccarm.h</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Product_stdlib.h</file>
<file>$PROJ_DIR$\Debug\Obj\system_MKV56F24.o</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_clock.o</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\system_MKV56F24.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_gpio.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\startup_MKV56F24.o</file>
<file>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console_conf.h</file>
<file>$PROJ_DIR$\..\utilities\fsl_assert.c</file>
<file>$PROJ_DIR$\Debug\Obj\main.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_clock.o</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_str.xcl</file>
<file>$PROJ_DIR$\..\Include\cmsis_compiler.h</file>
<file>$TOOLKIT_DIR$\inc\c\stdlib.h</file>
<file>$PROJ_DIR$\Debug\Obj\system_MKV56F24.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\system_MKV56F24.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
<file>$PROJ_DIR$\..\Include\cmsis_iccarm.h</file>
<file>$PROJ_DIR$\Debug\Obj\system_MKV56F24.o</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_float_setup.h</file>
<file>$PROJ_DIR$\..\utilities\str\fsl_str.c</file>
<file>$TOOLKIT_DIR$\inc\c\stdlib.h</file>
<file>$PROJ_DIR$\Debug\Obj\startup_MKV56F24.o</file>
<file>$PROJ_DIR$\..\startup\fsl_device_registers.h</file>
<file>$TOOLKIT_DIR$\inc\c\assert.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_str.__cstat.et</file>
<file>$PROJ_DIR$\..\utilities\str\fsl_str.h</file>
<file>$PROJ_DIR$\..\drivers\fsl_gpio.h</file>
<file>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console.c</file>
<file>$PROJ_DIR$\..\startup\system_MKV56F24.h</file>
<file>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console_conf.h</file>
<file>$PROJ_DIR$\..\utilities\fsl_assert.c</file>
<file>$TOOLKIT_DIR$\inc\c\math.h</file>
<file>$PROJ_DIR$\..\startup\MKV56F24_features.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_gpio.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\pin_Init.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_str.o</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_debug_console.xcl</file>
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_common.o</file>
<file>$TOOLKIT_DIR$\inc\c\stdint.h</file>
<file>$PROJ_DIR$\..\drivers\fsl_clock.h</file>
<file>$TOOLKIT_DIR$\inc\c\stdarg.h</file>
<file>$PROJ_DIR$\Debug\Obj\delay.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.o</file>
<file>$TOOLKIT_DIR$\inc\c\DLib_Defaults.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.o</file>
<file>$TOOLKIT_DIR$\lib\dl7M_tln.a</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_common.o</file>
<file>$TOOLKIT_DIR$\inc\c\stdbool.h</file>
<file>$PROJ_DIR$\Debug\Obj\pin_Init.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\pin_Init.o</file>
<file>$PROJ_DIR$\..\user\pin_Init.h</file>
<file>$PROJ_DIR$\Debug\Obj\delay.xcl</file>
<file>$PROJ_DIR$\..\drivers\fsl_uart.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_uart.o</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_uart.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.o</file>
<file>$PROJ_DIR$\..\drivers\fsl_uart.c</file>
<file>$PROJ_DIR$\..\user\uart_Interrupt.c</file>
<file>$PROJ_DIR$\..\user\uart_Interrupt.h</file>
<file>$PROJ_DIR$\Debug\Obj\delay.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\pin_Init.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_uart.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_uart.__cstat.et</file>
<file>$TOOLKIT_DIR$\inc\c\stdarg.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_debug_console.xcl</file>
<file>$PROJ_DIR$\..\user\pin_Init.h</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_clock.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\pin_Init.__cstat.et</file>
<file>$PROJ_DIR$\Debug\Obj\uart_Interrupt.__cstat.et</file>
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
<file>$PROJ_DIR$\Debug\Obj\fsl_assert.o</file>
</outputs>
<file>
<name>[ROOT_NODE]</name>
<outputs>
<tool>
<name>ILINK</name>
<file> 20 23</file>
<file> 16 18</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\startup\startup_MKV56F24.s</name>
<outputs>
<tool>
<name>AARM</name>
<file> 42</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\startup\system_MKV56F24.c</name>
<name>$PROJ_DIR$\..\drivers\fsl_common.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 40</file>
<file> 77</file>
</tool>
<tool>
<name>__cstat</name>
<file> 48</file>
<file> 33</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 49</file>
<file> 15</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 69 36 28 72 35 19 33 1 15 21 46 38 17 5 59 63</file>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\user\delay.c</name>
<name>$PROJ_DIR$\..\drivers\fsl_gpio.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 32</file>
<file> 21</file>
</tool>
<tool>
<name>__cstat</name>
<file> 88</file>
<file> 55</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 79</file>
<file> 47</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70 31</file>
<file> 44 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\user\main.c</name>
<name>$PROJ_DIR$\..\drivers\fsl_uart.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 51</file>
<file> 82</file>
</tool>
<tool>
<name>__cstat</name>
<file> 26</file>
<file> 86</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 43</file>
<file> 85</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70 57 78 31 87</file>
<file> 81 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\user\pin_Init.c</name>
<name>$PROJ_DIR$\..\drivers\fsl_clock.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 77</file>
<file> 52</file>
</tool>
<tool>
<name>__cstat</name>
<file> 91</file>
<file> 90</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 76</file>
<file> 25</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70 0 57 78 80</file>
<file> 72 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\drivers\fsl_gpio.c</name>
<name>$PROJ_DIR$\..\user\uart_Interrupt.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 25</file>
<file> 74</file>
</tool>
<tool>
<name>__cstat</name>
<file> 41</file>
<file> 79</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 64</file>
<file> 68</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 57 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70</file>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72 8 81 89</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\drivers\fsl_clock.c</name>
<name>$PROJ_DIR$\..\user\main.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 44</file>
<file> 60</file>
</tool>
<tool>
<name>__cstat</name>
<file> 90</file>
<file> 26</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 22</file>
<file> 58</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 70 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63</file>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72 44 89 5 8</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\drivers\fsl_common.c</name>
<name>$PROJ_DIR$\Debug\Exe\test01.out</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 68</file>
</tool>
<tool>
<name>__cstat</name>
<file> 13</file>
</tool>
<tool>
<name>BICOMP</name>
<name>ILINK</name>
<file> 18</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70</file>
<name>ILINK</name>
<file> 35 6 52 77 21 82 60 80 65 62 74 91 34 49 76</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Debug\Exe\test01.out</name>
<name>$PROJ_DIR$\..\user\delay.c</name>
<outputs>
<tool>
<name>ILINK</name>
<file> 23</file>
<name>ICCARM</name>
<file> 6</file>
</tool>
<tool>
<name>__cstat</name>
<file> 83</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 73</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ILINK</name>
<file> 30 32 44 68 25 81 51 77 42 40 84 67 29 34 74</file>
<name>ICCARM</name>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72 5</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\utilities\str\fsl_str.c</name>
<name>$PROJ_DIR$\..\user\pin_Init.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 65</file>
<file> 80</file>
</tool>
<tool>
<name>__cstat</name>
<file> 55</file>
<file> 69</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 45</file>
<file> 84</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 62 36 28 72 35 19 52 71 47 14 39 56 8 54 75 69 24 16 27 33 1 15 21 46 38 17 5 59 63 70 60</file>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72 2 44 89 81</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console.c</name>
<name>$PROJ_DIR$\..\startup\system_MKV56F24.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 62</file>
</tool>
<tool>
<name>__cstat</name>
<file> 59</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 66</file>
<file> 54</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 71 47 36 28 72 35 19 14 39 60 8 54 75 69 24 16 27 33 1 15 21 46 38 17 5 59 63 70 56</file>
<file> 71 51 32 75 42 12 66 13 14 17 48 61 24 28 45 46</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\utilities\fsl_assert.c</name>
<name>$PROJ_DIR$\..\startup\startup_MKV56F24.s</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 73</file>
</tool>
<tool>
<name>__cstat</name>
<file> 7</file>
<name>AARM</name>
<file> 65</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\utilities\debug_console\fsl_debug_console.c</name>
<outputs>
<tool>
<name>BICOMP</name>
<file> 50</file>
<file> 88</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70</file>
<file> 87 64 51 32 75 42 12 11 38 56 10 67 78 71 19 27 31 66 13 14 17 48 61 24 28 45 46 72 40</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\drivers\fsl_uart.c</name>
<name>$PROJ_DIR$\..\utilities\str\fsl_str.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 81</file>
<file> 70</file>
</tool>
<tool>
<name>__cstat</name>
<file> 89</file>
<file> 36</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 82</file>
<file> 43</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 80 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70</file>
<file> 41 51 32 75 42 12 63 87 64 11 38 40 10 67 78 71 19 27 31 66 13 14 17 48 61 24 28 45 46 72 56</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\user\uart_Interrupt.c</name>
<name>$PROJ_DIR$\..\utilities\fsl_assert.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 84</file>
<file> 92</file>
</tool>
<tool>
<name>__cstat</name>
<file> 92</file>
<file> 20</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 83</file>
<file> 53</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCARM</name>
<file> 8 54 36 28 72 35 19 75 69 24 14 16 47 39 27 33 1 15 21 46 38 17 5 59 63 70 87 80 78</file>
<file> 10 67 51 32 75 42 12 78 71 19 11 27 64 38 31 66 13 14 17 48 61 24 28 45 46 72</file>
</tool>
</inputs>
</file>


+ 2
- 1
user/main.c View File

@@ -12,7 +12,8 @@ void main()
{
Delay_Init(); //延时函数初始化
pin_Init(); //GPIO初始化
UART_InterrputInit(); //UART2初始化
UART1_InterrputInit(); //UART0初始化
UART2_InterrputInit(); //UART2初始化
while (1)
{
GPIO_PinWrite(GPIOA, 15, 0);


+ 13
- 0
user/pin_Init.c View File

@@ -42,5 +42,18 @@ void UART2_InitPins(void)
| SIM_SOPT5_UART1RXSRC(SOPT5_UART1RXSRC_UART_RX));
}

/*****************UART1引脚初始化*************************/
void UART1_InitPins(void)
{
CLOCK_EnableClock(kCLOCK_PortE); //开启PORT时钟
PORT_SetPinMux(PORTE, 0U, kPORT_MuxAlt3); //PTE0配置为UART1_TX
PORT_SetPinMux(PORTE, 1U, kPORT_MuxAlt3); //PTE1配置为UART1_RX
SIM->SOPT5 = ((SIM->SOPT5 &
/* UART0收发数据源选择*/
(~(SIM_SOPT5_UART1TXSRC_MASK | SIM_SOPT5_UART1RXSRC_MASK)))
| SIM_SOPT5_UART1TXSRC(SOPT5_UART1TXSRC_UART_TX)
| SIM_SOPT5_UART1RXSRC(SOPT5_UART1RXSRC_UART_RX));
}




+ 3
- 0
user/pin_Init.h View File

@@ -4,9 +4,12 @@
/*****************宏定义*************************/
#define SOPT5_UART1RXSRC_UART_RX 0x00u //选择UART1_RX pin模式接收数据
#define SOPT5_UART1TXSRC_UART_TX 0x00u //选择UART1_RT pin模式发送数据
#define SOPT5_UART0RXSRC_UART_RX 0x00u //选择UART0_RX pin模式接收数据
#define SOPT5_UART0TXSRC_UART_TX 0x00u //选择UART0_RT pin模式发送数据

/*****************函数声明*************************/
void pin_Init(); //PTA15引脚初始化
void UART2_InitPins(void); //UART2引脚初始化
void UART1_InitPins(void); //UART1引脚初始化

#endif

+ 41
- 2
user/uart_Interrupt.c View File

@@ -9,10 +9,24 @@ uint8_t demoRingBuffer[DEMO_RING_BUFFER_SIZE];
uint16_t txIndex; //发送数据计数变量
volatile uint16_t rxIndex; //接收数据计数变量

/*****************UART1初始化*************************/
void UART1_InterrputInit()
{
UART1_InitPins(); //UART1引脚初始化
uart_config_t config; //参数设置
UART_GetDefaultConfig(&config);
config.baudRate_Bps = 9600; //设置波特率
config.enableTx = true;
config.enableRx = true;
UART_Init(UART1, &config, SystemCoreClock); //初始化配置
UART_EnableInterrupts(UART1, kUART_RxDataRegFullInterruptEnable | kUART_RxOverrunInterruptEnable); //使能Rx中断
EnableIRQ(UART1_RX_TX_IRQn); //开启中断
}

/*****************UART2初始化*************************/
void UART_InterrputInit()
void UART2_InterrputInit()
{
UART2_InitPins(); //串口引脚初始化
UART2_InitPins(); //UART2引脚初始化
uart_config_t config; //参数设置
UART_GetDefaultConfig(&config);
config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE; //设置波特率
@@ -21,6 +35,31 @@ void UART_InterrputInit()
UART_Init(DEMO_UART, &config, SystemCoreClock); //初始化配置
UART_EnableInterrupts(DEMO_UART, kUART_RxDataRegFullInterruptEnable | kUART_RxOverrunInterruptEnable); //使能Rx中断
EnableIRQ(UART2_RX_TX_IRQn); //开启中断
UART_WriteByte(DEMO_UART, demoRingBuffer[txIndex]); //发送一帧数据(一个字节,8个数据位)
}

/*****************UART1中断服务函数**********************/
void UART1_RX_TX_IRQHandler(void)
{
uint16_t data;
if ((kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) & UART_GetStatusFlags(UART0)) //接收到数据标志
{
data = UART_ReadByte(UART1);
if (((rxIndex + 1) % DEMO_RING_BUFFER_SIZE) != txIndex) //
{
demoRingBuffer[rxIndex] = data;
rxIndex++;
rxIndex %= DEMO_RING_BUFFER_SIZE;
}
}
/*将接收到的数据返回*/
if ((kUART_TxDataRegEmptyFlag & UART_GetStatusFlags(DEMO_UART)) && (rxIndex != txIndex)) //发送中断标志
{
UART_WriteByte(DEMO_UART, demoRingBuffer[txIndex]); //发送一帧数据(一个字节,8个数据位)
txIndex++;
txIndex %= DEMO_RING_BUFFER_SIZE;
}
SDK_ISR_EXIT_BARRIER;
}

/*****************UART2中断服务函数**********************/


+ 2
- 1
user/uart_Interrupt.h View File

@@ -8,7 +8,8 @@
#define DEMO_RING_BUFFER_SIZE 16

/*****************函数声明*************************/
void UART_InterrputInit(); //串口初始化
void UART2_InterrputInit(); //UART2串口初始化
void UART1_InterrputInit(); //UART0串口初始化


#endif

Loading…
Cancel
Save