Compare commits

...

4 Commits

66 changed files with 9369 additions and 638 deletions

View File

@ -19,6 +19,7 @@ my_src/led.o: ../my_src/led.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,4 +66,6 @@ my_src/led.o: ../my_src/led.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h:

Binary file not shown.

View File

@ -20,7 +20,9 @@ my_src/main2.o: ../my_src/main2.c \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h ../my_src/led.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h ../my_src/led.h \
../my_src/oled.h
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h:
@ -68,4 +70,8 @@ my_src/main2.o: ../my_src/main2.c \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
../my_src/led.h:
../my_src/oled.h:

Binary file not shown.

73
Debug/my_src/oled.d Normal file
View File

@ -0,0 +1,73 @@
my_src/oled.o: ../my_src/oled.c ../my_src/oled.h ../my_src/oled-fonts.h \
../system/include/stm32f1xx/stm32f1xx_hal.h \
../include/stm32f1xx_hal_conf.h ../include/mxconstants.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h \
../system/include/stm32f1xx/stm32f1xx_hal_def.h \
../system/include/cmsis/device/stm32f1xx.h \
../system/include/cmsis/device/stm32f103xe.h \
../system/include/cmsis/core_cm3.h \
../system/include/cmsis/core_cmInstr.h \
../system/include/cmsis/cmsis_gcc.h \
../system/include/cmsis/core_cmFunc.h \
../system/include/cmsis/device/system_stm32f1xx.h \
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../my_src/oled.h:
../my_src/oled-fonts.h:
../system/include/stm32f1xx/stm32f1xx_hal.h:
../include/stm32f1xx_hal_conf.h:
../include/mxconstants.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h:
../system/include/stm32f1xx/stm32f1xx_hal_def.h:
../system/include/cmsis/device/stm32f1xx.h:
../system/include/cmsis/device/stm32f103xe.h:
../system/include/cmsis/core_cm3.h:
../system/include/cmsis/core_cmInstr.h:
../system/include/cmsis/cmsis_gcc.h:
../system/include/cmsis/core_cmFunc.h:
../system/include/cmsis/device/system_stm32f1xx.h:
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

BIN
Debug/my_src/oled.o Normal file

Binary file not shown.

View File

@ -5,15 +5,18 @@
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../my_src/led.c \
../my_src/main2.c
../my_src/main2.c \
../my_src/oled.c
OBJS += \
./my_src/led.o \
./my_src/main2.o
./my_src/main2.o \
./my_src/oled.o
C_DEPS += \
./my_src/led.d \
./my_src/main2.d
./my_src/main2.d \
./my_src/oled.d
# Each subdirectory must supply rules for building sources it contributes

Binary file not shown.

View File

@ -1,23 +1,23 @@
:020000040800F2
:1000000000C00020F9020008D5150008D915000825
:10001000DD150008E1150008E515000800000000E6
:10002000000000000000000000000000E9150008CA
:10003000ED15000800000000F1150008F515000896
:1000400065130008651300086513000865130008B0
:1000500065130008651300086513000865130008A0
:100060006513000865130008651300086513000890
:100070006513000865130008651300086513000880
:100080006513000865130008651300086513000870
:100090006513000865130008651300086513000860
:1000A0006513000865130008651300086513000850
:1000B0006513000865130008651300086513000840
:1000C0006513000865130008651300086513000830
:1000D0006513000865130008651300086513000820
:1000E0006513000865130008651300086513000810
:1000F0006513000865130008651300086513000800
:1001000065130008651300086513000865130008EF
:1001100065130008651300086513000865130008DF
:1001200065130008651300086513000865130008CF
:1000000000C00020F9020008E51A0008E91A0008FB
:10001000ED1A0008F11A0008F51A000800000000A7
:10002000000000000000000000000000F91A0008B5
:10003000FD1A000800000000011B0008051B000855
:10004000AD170008AD170008AD170008AD17000880
:10005000AD170008AD170008AD170008AD17000870
:10006000AD170008AD170008AD170008AD17000860
:10007000AD170008AD170008AD170008AD17000850
:10008000AD170008AD170008AD170008AD17000840
:10009000AD170008AD170008AD170008AD17000830
:1000A000AD170008AD170008AD170008AD17000820
:1000B000AD170008AD170008AD170008AD17000810
:1000C000AD170008AD170008AD170008AD17000800
:1000D000AD170008AD170008AD170008AD170008F0
:1000E000AD170008AD170008AD170008AD170008E0
:1000F000AD170008AD170008AD170008AD170008D0
:10010000AD170008AD170008AD170008AD170008BF
:10011000AD170008AD170008AD170008AD170008AF
:10012000AD170008AD170008AD170008AD1700089F
:1001300000000000000000000000000000000000BF
:1001400000000000000000000000000000000000AF
:10015000000000000000000000000000000000009F
@ -29,22 +29,22 @@
:1001B000000000000000000000000000000000003F
:1001C000000000000000000000000000000000002F
:1001D000000000000000000000000000000000001F
:1001E0005FF8E0F100B583B001F0ACF8304B314A74
:1001E0005FF8E0F100B583B001F0D0FA304B314A4E
:1001F0001360314A1360314B314A03E011681960D2
:10020000043304322F498B42F8D32A4B1A682E4B01
:100210009A4204D1284B1A682C4B9A4200D0FEE730
:10022000234B2B4A13602B4A13602B4B02E0002216
:100230001A600433294A9342F9D3254B1B6813B93A
:10024000244B1B6803B1FEE701F088F8694601A85A
:1002500001F070F8224C234B1C1BA410002504E075
:10024000244B1B6803B1FEE701F0ACFA694601A834
:1002500001F094FA224C234B1C1BA410002504E04F
:100260001F4B53F8253098470135AC42F8DC1E4C43
:100270001E4B1C1BA410002504E01B4B53F825301B
:1002800098470135AC42F8DC0099019801F04AF931
:1002800098470135AC42F8DC0099019801F0A4FBD5
:100290000546174C174B1C1BA41004E0013C144BE3
:1002A00053F824309847002CF8DC284601F040F839
:1002A00053F824309847002CF8DC284601F064FA13
:1002B000BABADECA000000201000002000000020B2
:1002C0001C18000814000020785634123254769816
:1002D00014000020600100201400002064010020B0
:1002C000B82400081400002078563412325476986E
:1002D00014000020BC01002014000020C0010020F8
:1002E0009403000894030008940300089403000892
:1002F000940300089403000808B5FFF773FF00BFDC
:1003000000BEFEE71EF0040F0CBFEFF30880EFF312
@ -54,64 +54,64 @@
:100340000880EFF309807146074A104700BEFEE7B8
:1003500000BEFEE700BEFEE700BEFEE770470000FD
:0C03600019030008350300084D030008D5
:10036C001C18000800000020140000201C180008B5
:10037C0000000000000000001400002064010020B8
:10036C00B82400080000002014000020B824000865
:10037C00000000000000000014000020C00100205C
:08038C00000000000000000069
:1003940010B5044600F0C4FF064BA3FB00308009EF
:1003A40000F098F8002221464FF0FF3000F050F89A
:1003B400002010BDD34D621008B5074A136843F0FE
:1003C40010031360032000F025F80020FFF7E0FF7E
:1003D40001F0B6F8002008BD00200240024A13686C
:1003D40001F012FB002008BD00200240024A13680D
:1003E40001331360704700BF18000020014B1868E8
:1003F400704700BF1800002010B582B00190FFF7CD
:10040400F5FF0446FFF7F2FF001B019B9842F9D366
:1004140002B010BD10B50446C31E042B03D9BA2183
:10042400094801F08BF8094AD36823F4E0631B04FC
:10042400094801F0E7FA094AD36823F4E0631B049E
:100434001B0C240204F4E064234343F0BF6343F43D
:100444000033D36010BD00BF6C17000800ED00E05E
:100444000033D36010BD00BFB41D000800ED00E010
:1004540070B504460E4615460F2A03D9D2211A4810
:1004640001F06CF80F2E03D9D321174801F066F878
:1004640001F0C8FA0F2E03D9D321174801F0C2FABC
:10047400164BDA68C2F30222C2F10701042928BF2D
:100484000421131D062B01D9033A00E000220123A5
:1004940003FA01F101393140914003FA02F2013AC1
:1004A4002A400A43002C06DA04F00F041201D2B2E7
:1004B400074B1A5570BD1201D2B204F1604404F521
:1004C400614484F8002370BD6C17000800ED00E05F
:1004C400614484F8002370BDB41D000800ED00E011
:1004D40014ED00E00138B0F1807F0AD2064B586079
:1004E400F021064A82F823100020986007221A603F
:1004F40070470120704700BF10E000E000ED00E00D
:1005040010B50446042805D020B14FF4DF71084823
:1005140001F014F8042C05D1064A136843F00403CF
:1005140001F070FA042C05D1064A136843F0040371
:10052400136010BD034A136823F00403136010BD65
:100534006C17000810E000E008B501F07DF808BD74
:10053400B41D000810E000E008B501F005FB08BD9B
:100544002DE9F04383B080460F46B54B98421BD04B
:1005540003F58063984217D003F58063984213D063
:1005640003F5806398420FD003F5806398420BD063
:1005740003F58063984207D003F58063984203D063
:10058400CF21A84800F0DAFF3B881BB9D021A54849
:1005940000F0D4FF7B68012B22D9112B20D0022B31
:10058400CF21A84801F036FA3B881BB9D021A548F1
:1005940001F030FA7B68012B22D9112B20D0022BD9
:1005A4001ED0122B1CD0A04A934219D002F58012FF
:1005B400934215D002F58012934211D0A2F5F8129D
:1005C40093420DD002F58012934209D002F58012B5
:1005D400934205D0032B03D0D121924800F0AEFF03
:1005D400934205D0032B03D0D121924801F00AFAAB
:1005E4004FF000094E463FE10125B5403C682C40E0
:1005F400A54240F038818A4B98451BD003F58063AF
:10060400984517D003F58063984513D003F58063AC
:1006140098450FD003F5806398450BD003F58063AC
:10062400984507D003F58063984503D0DF217D48C2
:1006340000F084FF7B68122B49D00CD8022B3AD0EF
:1006340001F0E0F97B68122B49D00CD8022B3AD098
:1006440004D8002B4FD0012B1ED067E0032B60D0C1
:10065400112B24D062E0754A934244D008D8A2F505
:10066400801293423FD002F58032934256D13AE051
:100674006F4A934237D002F58032934233D0A2F5C9
:10068400801293424AD12EE0FB68013B022B03D92E
:10069400E721644800F052FFD7F80C903EE0FB6875
:1006A400013B022B03D9EE215E4800F047FFFB68B3
:10069400E721644801F0AEF9D7F80C903EE0FB681E
:1006A400013B022B03D9EE215E4801F0A3F9FB685C
:1006B40003F1040932E0FB68013B022B03D9F52165
:1006C400584800F03BFFFB6803F1080926E0FB688B
:1006D400013B022B03D9FC21524800F02FFFFB6899
:1006C400584801F097F9FB6803F1080926E0FB6834
:1006D400013B022B03D9FC21524801F08BF9FB6842
:1006E40003F10C091AE0BB68022B04D940F209118A
:1006F4004C4800F023FFBB6873B1012B04D1C8F848
:1006F4004C4801F07FF9BB6873B1012B04D1C8F8F1
:1007040010504FF0080909E0C8F814504FF00809D8
:1007140004E04FF0000901E04FF00409FF2C01D878
:10072400404601E008F10400FF2C01D8B30002E0C8
@ -130,22 +130,22 @@
:1007F40013607B6813F4003F04D0104A536823430A
:10080400536004E00D4A536823EA040353607B6891
:1008140013F4801F14D0094A93682343936014E0AF
:10082400000801409C17000800001110000021106E
:1008240000080140E41D0008000011100000211020
:10083400000031100010024000000140000401409B
:100844000C4A936823EA040393607B6813F4001F43
:1008540004D0084AD3681C43D46004E0054AD36832
:1008640023EA0404D46001360F2E7FF6BDAE03B034
:10087400BDE8F0830004014070B5064615460C46F9
:1008840021B94FF4F271084800F058FE012D04D943
:1008940040F2E511044800F051FE0DB1346170BD21
:1008A4002404346170BD00BF9C17000838B50446A9
:1008B4000D4621B94FF4FD71034800F03FFEE16895
:1008C4006940E16038BD00BF9C17000830B583B0B3
:1008D400044620B94FF48771B94800F02FFE23680D
:1008E4003BB113F00F0F04D140F20F11B44800F0E4
:1008F40025FE236813F0010F00F0A380636853B151
:1008840021B94FF4F271084801F0B4F8012D04D9EC
:1008940040F2E511044801F0ADF80DB1346170BDCA
:1008A4002404346170BD00BFE41D000838B504465B
:1008B4000D4621B94FF4FD71034801F09BF8E1683E
:1008C4006940E16038BD00BFE41D000830B583B065
:1008D400044620B94FF48771B94801F08BF82368B6
:1008E4003BB113F00F0F04D140F20F11B44801F0E3
:1008F40081F8236813F0010F00F0A380636853B1FB
:10090400B3F5803F07D0B3F5A02F04D040F2151102
:10091400AB4800F013FEAB4B5B6803F00C03042BF5
:10091400AB4801F06FF8AB4B5B6803F00C03042B9E
:100924000AD0A84B5B6803F00C03082B1BD1A54B22
:100934005B6813F4803F16D04FF4003393FAA3F3AB
:10094400A04B1A684FF4003393FAA3F3B3FA83F37A
@ -165,8 +165,8 @@
:100A240093FAA3F3674B1A684FF4003393FAA3F3D2
:100A3400B3FA83F303F01F0322FA03F313F0010F55
:100A4400E6D1236813F0020F00F0A0802369012B84
:100A540004D940F249115A4800F070FD63691F2B14
:100A640004D94FF4A571564800F068FD554B5B68F6
:100A540004D940F249115A4800F0CCFF63691F2BB6
:100A640004D94FF4A571564800F0C4FF554B5B6898
:100A740013F00C0F0AD0534B5B6803F00C03082BE4
:100A840027D1504B5B6813F4803F22D1022393FAA1
:100A9400A3F34C4B1A68022393FAA3F3B3FA83F338
@ -186,9 +186,9 @@
:100B7400144B1A68022393FAA3F3B3FA83F303F032
:100B84001F0322FA03F313F0010FE8D1236813F0D3
:100B9400080F5CD0A369012B04D94FF4C571084830
:100BA40000F0CCFCA3696BB3012292FAA2F3B3FA6E
:100BA40000F028FFA3696BB3012292FAA2F3B3FA0F
:100BB40083F3054941F82320FFF718FC05460BE0B1
:100BC400E01700080010024080044242FFF70EFCC8
:100BC400281E00080010024080044242FFF70EFC79
:100BD400401B022800F2EF81022393FAA3F293FA56
:100BE400A3F2A44A526A93FAA3F3B3FA83F303F089
:100BF4001F0322FA03F313F0010FE7D00120FFF7DC
@ -198,7 +198,7 @@
:100C340093FAA3F28F4A526A93FAA3F3B3FA83F3B3
:100C440003F01F0322FA03F313F0010FE7D1236823
:100C540013F0040F00F0AB80E368012B06D9052BD9
:100C640004D040F2B711854800F068FC814BDA6982
:100C640004D040F2B711854800F0C4FE814BDA6924
:100C740042F08052DA61DB6903F080530193019BF7
:100C84007F4A136843F480731360FFF7AFFB054694
:100C940005E0FFF7ABFB401B642800F29081784B22
@ -219,25 +219,25 @@
:100D84005B0943F00203DBB2022B02D1394B1A6A2E
:100D940001E0384B5A6A022393FAA3F3B3FA83F3BC
:100DA40003F01F0322FA03F313F0010FD9D1E3690F
:100DB400022B04D940F24721304800F0BFFBE3691D
:100DB400022B04D940F24721304800F01BFEE369BE
:100DC400002B00F002812B4A526802F00C02082A20
:100DD40000F0FD80022B40F0B780236A3BB1B3F5ED
:100DE400803F04D04FF41471244800F0A7FB636AD9
:100DE400803F04D04FF41471244800F003FE636A7A
:100DF40073B3B3F5802F2BD0B3F5002F28D0B3F500
:100E0400402F25D0B3F5801F22D0B3F5A01F1FD0EB
:100E1400B3F5C01F1CD0B3F5E01F19D0B3F5001F04
:100E240016D0B3F5101F13D0B3F5201F10D0B3F5AF
:100E3400301F0DD0B3F5401F0AD0B3F5501F07D0B3
:100E4400B3F5601F04D040F251210C4800F076FB4A
:100E4400B3F5601F04D040F251210C4800F0D2FDEC
:100E54004FF0807393FAA3F3B3FA83F39B0003F187
:100E6400844303F5840300221A60FFF7BFFA0546A2
:100E74000EE000BF0010024080044242E017000868
:100E74000EE000BF0010024080044242281E000819
:100E840000700040FFF7B2FA401B022800F2A18074
:100E94004FF0007393FAA3F3514B1A684FF00073A9
:100EA40093FAA3F3B3FA83F303F01F0322FA03F3D1
:100EB40013F0010FE6D1236AB3F5803F10D1A36884
:100EC4003BB1B3F5003F04D040F26721454800F040
:100ED40035FB43494B6823F40032A36813434B604A
:100ED40091FD43494B6823F40032A36813434B60EC
:100EE4003F48436823F47411236A626A13430B4333
:100EF40043604FF0807393FAA3F3B3FA83F39B0038
:100F040003F1844303F5840301221A60FFF76EFAA8
@ -254,7 +254,7 @@
:100FB40014E0032012E0032010E003200EE00320DD
:100FC4000CE003200AE0032008E0002006E00120F2
:100FD40004E0032002E0032000E0032003B030BD5E
:100FE40000100240E017000830B486B01F4D02AC78
:100FE40000100240281E000830B486B01F4D02AC29
:100FF40028686968AA68EB680FC42B8AADF80430C6
:101004001B4B5B6803F00C02082A2AD103F470110D
:101014004FF4701292FAA2F2B2FA82F221FA02F2B8
@ -262,19 +262,19 @@
:101034005B6803F400314FF4003393FAA3F3B3FA7B
:1010440083F321FA03F306A90B4413F8140C094B98
:10105400B3FBF0F000FB02F004E0074800FB02F0F1
:1010640000E0044806B030BC704700BFCC1700084D
:1010640000E0044806B030BC704700BF141E0008FE
:101074000010024000127A0000093D0070B50D46D0
:10108400044620B94FF42F71A04800F057FA2368A2
:1010940013F00F0F04D140F2BD219C4800F04EFA2A
:1010A400022D04D940F2BE21984800F047FA984B2B
:10108400044620B94FF42F71A04800F0B3FC236844
:1010940013F00F0F04D140F2BD219C4800F0AAFCCC
:1010A400022D04D940F2BE21984800F0A3FC984BCD
:1010B4001B6803F007039D420BD9954A136823F07C
:1010C40007032B431360136803F007039D4240F0AA
:1010D4000D81236813F0020F1DD0A368A3B1802BE8
:1010E40012D0902B10D0A02B0ED0B02B0CD0C02B34
:1010F4000AD0D02B08D0E02B06D0F02B04D040F23D
:10110400D721824800F01AFA82494B6823F0F00292
:10110400D721824800F076FC82494B6823F0F00234
:10111400A36813434B60236813F0010F00F0818030
:101124006368022B04D940F2DE21784800F006FA05
:101124006368022B04D940F2DE21784800F062FCA7
:101134006268012A13D14FF4003393FAA3F3754B79
:1011440019684FF4003393FAA3F3B3FA83F303F06B
:101154001F0321FA03F313F0010F28D1C8E0022A78
@ -295,98 +295,300 @@
:101244009D4261D1236813F0040F19D0E36883B180
:10125400B3F5806F0DD0B3F5A06F0AD0B3F5C06FAE
:1012640007D0B3F5E06F04D040F23231274800F0E4
:1012740065F928494B6823F4E062E36813434B6043
:10127400C1FB28494B6823F4E062E36813434B60E5
:10128400236813F0080F1AD0236983B1B3F5806F74
:101294000DD0B3F5A06F0AD0B3F5C06F07D0B3F586
:1012A400E06F04D040F23931184800F047F9194A88
:1012A400E06F04D040F23931184800F0A3FB194A2A
:1012B400536823F46053216943EAC1035360FFF781
:1012C40093FE144B5B6803F0F002F02393FAA3F34C
:1012D400B3FA83F322FA03F30F4AD35CD8400F4BDB
:1012E40018600020FFF754F8002070BD012070BD85
:1012F400012070BD012070BD012070BD032070BDB0
:10130400032070BD032070BD012070BDE0170008EC
:1013140000200240001002400C1800080C000020BD
:10132400014B1868704700BF0C000020FEE700BFA7
:1013340001230360014B0B60704700BF04000020D1
:1013440008B500F00FF8024B024A9A6008BD00BFCE
:1013540000ED00E00000000808B500F029F808BD21
:10136400FEE700000F4B1A6842F001021A60596848
:101374000D4A0A405A601A6822F0847222F48032BC
:101384001A601A6822F480221A605A6822F4FE0253
:101394005A604FF41F029A604FF00062034B9A6048
:1013A400704700BF001002400000FFF800ED00E0AD
:1013B4001F4B5B6803F00C03042B06D0082B08D0EA
:1013C4003BBB1C4A1C4B1A6026E01A4A1A4B1A6093
:1013D40022E0174A53685268C3F38343023312F47A
:1013E400803F05D1154A02FB03F3134A136013E04F
:1013F4000F4A526812F4003F05D0104A02FB03F36F
:101404000D4A136008E00B4A02FB03F30A4A136017
:1014140002E0084A084B1A60054B5B68C3F30313E8
:10142400074AD15C044A1368CB401360704700BF7D
:101434000010024000127A000C00002000093D0058
:101444000C18000810B586B0134B9A6942F01002CC
:101454009A619A6902F010020092009A9A6942F025
:1014640004029A619B6903F004030193019B0B4CF2
:1014740000224FF400512046FFF7FEF94FF40053C9
:101484000293012303930223059302A92046FFF745
:1014940057F806B010BD00BF001002400010014014
:1014A40008B500F0CDF8FEE700B591B0012306932E
:1014B4004FF4803307930022089202220D920E9378
:1014C4004FF4E0130F9306A8FFF700FA08B1FFF7F3
:1014D400E7FF0F23019302210291002303934FF4AA
:1014E40080620492059301A8FFF7C8FD08B1FFF7D5
:1014F400D7FFFFF715FF094BA3FB00308009FEF768
:10150400E9FF0420FEF7FCFF002211464FF0FF30F4
:10151400FEF79EFF11B05DF804FB00BFD34D6210CF
:1015240008B500F081F8FEF747FFFFF7BDFFFFF7AE
:1015340089FF00F087F800F07BF8FCE7704700BFF4
:1015440000B583B0204B9A6942F001029A619B690D
:1015540003F001030193019B0320FEF75BFF0022CC
:1015640011466FF00B00FEF773FF002211466FF077
:101574000A00FEF76DFF002211466FF00900FEF726
:1015840067FF002211466FF00400FEF761FF00229E
:1015940011466FF00300FEF75BFF002211466FF067
:1015A4000100FEF755FF002211464FF0FF30FEF711
:1015B4004FFF064A536823F0E06343F0007353601F
:1015C40003B05DF804FB00BF0010024000000140BE
:1015D400704700BFFEE700BFFEE700BFFEE700BFA5
:1015E400FEE700BF704700BF704700BF704700BFF1
:1015F40008B5FEF7F3FEFEF79FFF08BD08B54FF4EC
:1016040000510248FFF752F908BD00BF0010014025
:1016140008B54FF47A7300221146024800F02EF800
:1016240008BD00BF0116000808B500F00FF808BD9A
:1016340008B500F043F808BD08B500F06BF808BD24
:10164400704700BF08B5FFF7E3FF08BD30B40023BF
:101654000EE0094C9900CA189500601900226251E5
:1016640042600272C2602846204402610133DBB248
:101674000F2BEED930BC704720000020F0B50024B9
:1016840017E0274604EB8406B5000B4E3544ED689D
:101694006DB934464FEA870E0EEB0705AE00A51967
:1016A400A2516B6000232B72E8602961F0BD013404
:1016B400E4B20F2CE5D9F0BD2000002070B5002461
:1016C40022E004EB84029300114A1344DB68CBB19B
:1016D40004EB840293000E4A13441B7A93B1A100D5
:1016E40021448A000A4E1644013B3372F368306980
:1016F4009847736833B904EB8405AB00044A134478
:101704000022DA600134E4B20F2CDAD970BD00BFD4
:101714002000002070B400231FE003EB830082004C
:1017240010480244D268B2B103EB830082000D4832
:10173400825852B904469A00D518A80025186E6834
:101744002650287A411C297205E003EB83018800A6
:10175400013A04490A500133DBB20F2BDDD970BCC6
:10176400704700BF200000202E2E2F7379737465FC
:101774006D2F7372632F73746D3332663178782FE3
:1017840073746D3332663178785F68616C5F636F50
:10179400727465782E6300002E2E2F73797374652E
:1017A4006D2F7372632F73746D3332663178782FB3
:1017B40073746D3332663178785F68616C5F67701B
:1017C400696F2E6300000000020304050607080980
:1017D4000A0B0C0D0E0F1010010200002E2E2F7399
:1017E400797374656D2F7372632F73746D333266FE
:1017F4003178782F73746D3332663178785F68612D
:101804006C5F7263632E6300000000000000000040
:081814000102030406070809A4
:10181C00785634121C0000200000000000A24A047C
:04182C003254769824
:10130400032070BD032070BD012070BD281E00089D
:101314000020024000100240B01E00080C00002013
:10132400014B1868704700BF0C0000202DE9F04104
:1013340005460E4690461C46FFF758F80746B8F196
:10134400000F2AD05BE0B4F1FF3F26D024B1FFF7B1
:101354004DF8C01B844220D22A68536823F0E0036E
:1013640053602A68136823F040031360AB6AB3F533
:10137400005F09D12A68136823F4005313602A68B4
:10138400136843F400531360012385F8513000239C
:1013940085F850300320BDE8F0812B689B6836EA5D
:1013A4000303D0D10020BDE8F081B4F1FF3F26D083
:1013B40024B1FFF71BF8C01B844220D22A6853686B
:1013C40023F0E00353602A68136823F0400313609A
:1013D400AB6AB3F5005F09D12A68136823F400539C
:1013E40013602A68136843F400531360012385F8DB
:1013F4005130002385F850300320BDE8F0812B687C
:101404009B6836EA0303D0D00020BDE8F08100BF1A
:10141400F0B583B090F85150EDB2012D40F0D18079
:10142400002900F0D080002A00F0CF801F46164625
:101434000D46044683683BB1B3F5004F04D040F237
:10144400A311674800F0D6FA94F85030012B00F04D
:10145400BE80012384F85030122384F851300023D5
:1014640063652563A686E686E364A364A363A38712
:10147400E387A36AB3F5005F09D12268136823F4F4
:10148400005313602268136843F400531360A36885
:10149400B3F5004F04D12268136843F4804313600A
:1014A40023681A6812F0400F03D11A6842F0400210
:1014B4001A60E368002B2CD1636813B1E38E012B0F
:1014C4001AD12268236B591C21631B78D360E38EE5
:1014D400013BE38610E03B46002202212046FFF751
:1014E40025FF002875D12268236B591C21631B78C2
:1014F400D360E38E013BE386E38E002BEBD1A36A3A
:10150400B3F5005F33D12268136843F4805313604A
:101514002DE0636813B1E38E012B1CD12368226B89
:101524001288DA60236B02332363E38E013BE38684
:1015340011E03B46002202212046FFF7F7FE002877
:1015440049D12368226B1288DA60236B0233236348
:10155400E38E013BE386E38E002BEAD1A36AB3F565
:10156400005F04D12268136843F4805313603B4640
:10157400002202212046FFF7D9FE28B1636D43F013
:1015840010036365032327E03B46012280212046A4
:10159400FFF7CCFE034628B1636D43F01003636587
:1015A400032319E0A2682AB92268D16801919268DC
:1015B4000192019A012284F85120002284F85020DB
:1015C4000AE0022308E0012306E0012304E00223E9
:1015D40002E0032300E00323184603B0F0BD00BF7C
:1015E400541E0008002800F0BC8010B504460368AF
:1015F4005D4A93420BD0A2F57842934207D002F59C
:101604008062934203D06B21584800F0F3F9636879
:1016140033B1B3F5827F03D06C21544800F0EAF96A
:10162400A3684BB1B3F5806F06D0B3F5004F03D078
:101634006D214E4800F0DEF9E368B3F5006F04D085
:101644001BB16E21494800F0D5F923692BB1022B57
:1016540003D06F21454800F0CDF96369012B03D90C
:101664007021424800F0C6F9A369B3F5007F07D0A2
:1016740033B1B3F5802F03D071213C4800F0BAF99F
:10168400E3698BB1082B0FD0102B0DD0182B0BD086
:10169400202B09D0282B07D0302B05D0382B03D092
:1016A4007221324800F0A6F9236A2BB1802B03D0B3
:1016B40073212E4800F09EF9636A1BB174212B48F4
:1016C40000F098F9A36A33B1B3F5005F03D0752134
:1016D400264800F08FF9E36A013B4FF6FE7293420D
:1016E40003D97621214800F085F994F8513013F09C
:1016F400FF0F02D1204600F0C7F9022384F85130CD
:101704002268136823F04003136021686268A368A9
:101714001A43E3681A4323691A4363691A43A369A2
:1017240003F400731343E2691343226A1343A26A66
:101734001A430A602168638B03F00402636A13434B
:101744004B602368E26A1A612268D36923F4006358
:10175400D3610020064B18706065012384F8513072
:1017640010BD0120704700BF00300140801E0008FA
:101774001C000020FEE700BF01230360014B0B6047
:10178400704700BF0400002008B500F00FF8024BBA
:10179400024A9A6008BD00BF00ED00E000000008A6
:1017A40008B500F029F808BDFEE700000F4B1A68E1
:1017B40042F001021A6059680D4A0A405A601A68D8
:1017C40022F0847222F480321A601A6822F4802291
:1017D4001A605A6822F4FE025A604FF41F029A609B
:1017E4004FF00062034B9A60704700BF0010024044
:1017F4000000FFF800ED00E01F4B5B6803F00C03F2
:10180400042B06D0082B08D03BBB1C4A1C4B1A6087
:1018140026E01A4A1A4B1A6022E0174A53685268A3
:10182400C3F38343023312F4803F05D1154A02FB0C
:1018340003F3134A136013E00F4A526812F4003F93
:1018440005D0104A02FB03F30D4A136008E00B4A6B
:1018540002FB03F30A4A136002E0084A084B1A60C9
:10186400054B5B68C3F30313074AD15C044A13684E
:10187400CB401360704700BF0010024000127A0092
:101884000C00002000093D00B01E0008F0B587B030
:101894001C4B9A6942F010029A619A6902F0100294
:1018A4000092009A9A6942F004029A619B6903F0DB
:1018B40004030193019B144F00224FF40051384656
:1018C400FEF7DAFF114C002206212046FEF7D4FF72
:1018D400012208212046FEF7CFFF4FF40053029364
:1018E400012603960225059502A93846FEF728FE2F
:1018F4000E2302930396059502A92046FEF720FEC7
:1019040007B0F0BD00100240001001400008014083
:1019140008B500F01DF9FEE708B50E480E4B03604C
:101924004FF48273436000238360C3600222026128
:10193400012242614FF4007282611822C261036283
:10194400436283620A23C362FFF74CFE08B1FFF7C8
:10195400DFFF08BD240000200030014000B591B035
:10196400012306934FF48033079300220892022246
:101974000D920E934FF4E0130F9306A8FEF7A6FF03
:1019840008B1FFF7C5FF0F23019302210291002341
:1019940003934FF480620492059301A8FFF76EFB52
:1019A40008B1FFF7B5FFFFF7BBFC094BA3FB003001
:1019B4008009FEF78FFD0420FEF7A2FD00221146E8
:1019C4004FF0FF30FEF744FD11B05DF804FB00BF9B
:1019D400D34D621008B500F0AFF8FEF7EDFCFFF749
:1019E400BDFFFFF753FFFFF797FF00F0B3F800F0D8
:1019F400A7F8FCE7704700BF00B583B0204B9A6995
:101A040042F001029A619B6903F001030193019B77
:101A14000320FEF7FFFC002211466FF00B00FEF7D7
:101A240017FD002211466FF00A00FEF711FD002297
:101A340011466FF00900FEF70BFD002211466FF00E
:101A44000400FEF705FD002211466FF00300FEF7C7
:101A5400FFFC002211466FF00100FEF7F9FC0022A2
:101A640011464FF0FF30FEF7F3FC064A536823F0AB
:101A7400E06343F00073536003B05DF804FB00BF00
:101A840000100240000001400268134B9A4222D128
:101A940010B586B003F560439A6942F480529A61A6
:101AA4009B6903F480530193019BA02302930223B7
:101AB400039303230593094C02A92046FEF740FD36
:101AC4004023029300230393049302A92046FEF7C4
:101AD40037FD06B010BD70470030014000080140DA
:101AE400704700BFFEE700BFFEE700BFFEE700BF90
:101AF400FEE700BF704700BF704700BF704700BFDC
:101B040008B5FEF76BFCFEF717FD08BD08B54FF4EA
:101B140000510248FEF7CAFE08BD00BF0010014094
:101B240008B54FF47A7300221146024800F0CAF84F
:101B340008BD00BF111B000808B500F0ABF808BDD4
:101B440008B500F0DFF808BD08B500F007F908BDD6
:101B5400704700BF08B5FFF7E3FF034A00210846BA
:101B640000F058F808BD00BFC01E000808B50246C2
:101B740002210248FEF780FE08BD00BF00080140B4
:101B840008B5024608210248FEF776FE08BD00BFEC
:101B94000008014010B582B002AC04F8010D002029
:101BA400FFF7EEFF0120FFF7E1FF002301222146AA
:101BB4000348FFF72DFC0120FFF7E2FF02B010BD40
:101BC4002400002010B582B002AC04F8010D0020FE
:101BD400FFF7D6FF0020FFF7C9FF002301222146AB
:101BE4000348FFF715FC0120FFF7CAFF02B010BD40
:101BF4002400002010B504465039C8B2FFF7E2FFB4
:101C0400200940F01000FFF7DDFF04F00F00FFF79C
:101C1400D9FF10BD2DE9F8430646884691460027B2
:101C24002FE0203DEDB2782E04D908F101085FFAC7
:101C340088F8002641463046FFF7DCFF002407E021
:101C440004EB0513124AD05CFFF7A4FF0134E4B29D
:101C5400072CF5D908F10101C9B23046FFF7CAFFD4
:101C6400002408E004EB05130833094AD05CFFF7AD
:101C740091FF0134E4B2072CF4D90836F6B20137E7
:101C8400FFB219F90750002DCBD1BDE8F88300BF8E
:101C9400C81E000830B400230EE0094C9900CA188D
:101CA400950060190022625142600272C2602846A7
:101CB400204402610133DBB20F2BEED930BC7047F4
:101CC4007C000020F0B5002417E0274604EB8406CE
:101CD400B5000B4E3544ED686DB934464FEA870EB6
:101CE4000EEB0705AE00A519A2516B6000232B7201
:101CF400E8602961F0BD0134E4B20F2CE5D9F0BDF0
:101D04007C00002070B5002422E004EB84029300E0
:101D1400114A1344DB68CBB104EB840293000E4AEE
:101D240013441B7A93B1A10021448A000A4E16443D
:101D3400013B3372F36830699847736833B904EB35
:101D44008405AB00044A13440022DA600134E4B28F
:101D54000F2CDAD970BD00BF7C00002070B40023C2
:101D64001FE003EB8300820010480244D268B2B142
:101D740003EB830082000D48825852B904469A004E
:101D8400D518A80025186E682650287A411C297297
:101D940005E003EB83018800013A04490A5001334A
:101DA400DBB20F2BDDD970BC704700BF7C00002074
:101DB4002E2E2F73797374656D2F7372632F737462
:101DC4006D3332663178782F73746D3332663178BF
:101DD400785F68616C5F636F727465782E6300006E
:101DE4002E2E2F73797374656D2F7372632F737432
:101DF4006D3332663178782F73746D33326631788F
:101E0400785F68616C5F6770696F2E630000000023
:101E140002030405060708090A0B0C0D0E0F101027
:101E2400010200002E2E2F73797374656D2F737267
:101E3400632F73746D3332663178782F73746D3316
:101E440032663178785F68616C5F7263632E630019
:101E54002E2E2F73797374656D2F7372632F7374C1
:101E64006D3332663178782F73746D33326631781E
:101E7400785F68616C5F7370692E63002E2E2F7318
:101E8400797374656D2F7372632F73746D33326657
:101E94003178782F73746D3332663178785F686186
:101EA4006C5F7370695F65782E630000000000004A
:101EB40000000000010203040607080948616C6C75
:101EC4006F0000000000000000000000000000009F
:101ED40000000000000000F80000000000000033D3
:101EE4003000000000100C06100C0600000000007A
:101EF4000000000040C07840C0784000043F040463
:101F04003F040400007088FC08300000001820FF23
:101F1400211E0000F008F000E018000000211C035E
:101F24001E211E0000F00888700000001E212324DA
:101F34001927211010160E000000000000000000F8
:101F440000000000000000E0180402000000000788
:101F54001820400000020418E0000000004020188F
:101F640007000000404080F0804040000202010F62
:101F740001020200000000F0000000000101011F46
:101F840001010100000000000000000080B07000AA
:101F9400000000000000000000000000000101013A
:101FA40001010101000000000000000000303000C9
:101FB40000000000000000008060180400601806A3
:101FC4000100000000E010080810E000000F1020DD
:101FD40020100F00001010F8000000000020203F27
:101FE40020200000007008080888700000302824B1
:101FF4002221300000300888884830000018202052
:1020040020110E000000C02010F800000007042476
:10201400243F240000F808888808080000192120BB
:1020240020110E0000E0108888180000000F112015
:1020340020110E0000380808C83808000000003FCE
:10204400000000000070880808887000001C22212D
:1020540021221C0000E010080810E00000003122DA
:1020640022110F00000000C0C0000000000000307A
:1020740030000000000000800000000000008060CC
:10208400000000000000804020100800000102044D
:102094000810200040404040404040000404040434
:1020A40004040400000810204080000000201008F0
:1020B40004020100007048080808F0000000003025
:1020C40036010000C030C828E810E00007182724B3
:1020D40023140B000000C038E0000000203C230261
:1020E4000227382008F8888888700000203F2020C4
:1020F40020110E00C03008080808380007182020F6
:102104002010080008F808080810E000203F2020EC
:1021140020100F0008F88888E8081000203F2020CD
:102124002320180008F88888E8081000203F2000C1
:1021340003000000C03008080838000007182020F9
:10214400221E020008F808000008F808203F2101B8
:1021540001213F20000808F8080800000020203F63
:102164002020000000000808F8080800C0808080D3
:102174007F00000008F888C028180800203F2001CC
:102184002638200008F8080000000000203F202026
:102194002020300008F8F800F8F80800203F003F3D
:1021A400003F200008F830C00008F808203F200055
:1021B40007183F00E01008080810E0000F10202066
:1021C40020100F0008F808080808F000203F21013B
:1021D40001010000E01008080810E0000F18242492
:1021E40038504F0008F8888888887000203F200005
:1021F400030C3020007088080808380000382021BB
:1022040021221C00180808F8080818000000203FC4
:102214002000000008F808000008F808001F20202B
:1022240020201F000878880000C8380800000738FC
:102234000E010000F80800F80008F800033C07004D
:10224400073C0300081868808068180820302C03B5
:10225400032C30200838C800C83808000000203F8C
:102264002000000010080808C8380800203826217B
:1022740020201800000000FE020202000000007F7F
:1022840040404000000C30C000000000000000018D
:102294000638C00000020202FE0000000040404078
:1022A4007F0000000000040202020400000000009D
:1022B400000000000000000000000000808080801A
:1022C4008080808000020204000000000000000002
:1022D400000000000000808080800000001924229B
:1022E40022223F2008F8008080000000003F1120D7
:1022F40020110E000000008080800000000E1120DC
:1023040020201100000000808088F800000E1120B9
:1023140020103F200000808080800000001F2222C7
:1023240022221300008080F0888888180020203F33
:10233400202000000000808080808000006B949446
:102344009493600008F8008080800000203F210002
:1023540000203F2000809898000000000020203FCB
:1023640020200000000000809898000000C08080B9
:10237400807F000008F8000080808000203F240255
:102384002D302000000808F8000000000020203F45
:10239400202000008080808080808000203F2000FA
:1023A4003F20003F8080008080800000203F21008B
:1023B40000203F200000808080800000001F20203B
:1023C40020201F00808000808000000080FFA1206A
:1023D40020110E000000008080808000000E11207B
:1023E40020A0FF80808080008080800020203F210A
:1023F40020000100000080808080800000332424BD
:1024040024241900008080E0808000000000001F68
:10241400202000008080000000808000001F202019
:1024240020103F20808080000080808000010E30DA
:102434000806010080800080008080800F300C033B
:102444000C300F0000808000808080000020312E3E
:102454000E312000808080000080808080818E701A
:102464001806010000808080808080000021302CCC
:102474002221300000000000807C020200000000E5
:10248400003F404000000000FF000000000000008A
:10249400FF0000000002027C800000000040403F7A
:1024A4000000000000060101020204040000000014
:0424B4000000000024
:1024B80078563412200000200000000000A24A04D0
:0424C800325476987C
:04000005080001E509
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@ src/main.o: ../src/main.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
/home/wn/workspace-stm32/newcar/my_src/main2.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,4 +66,6 @@ src/main.o: ../src/main.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
/home/wn/workspace-stm32/newcar/my_src/main2.h:

Binary file not shown.

View File

@ -19,7 +19,8 @@ src/stm32f1xx_hal_msp.o: ../src/stm32f1xx_hal_msp.c \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -64,3 +65,5 @@ src/stm32f1xx_hal_msp.o: ../src/stm32f1xx_hal_msp.c \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

Binary file not shown.

View File

@ -20,6 +20,7 @@ src/stm32f1xx_it.o: ../src/stm32f1xx_it.c \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
../include/stm32f1xx_it.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -66,4 +67,6 @@ src/stm32f1xx_it.o: ../src/stm32f1xx_it.c \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
../include/stm32f1xx_it.h:

Binary file not shown.

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_cortex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_cortex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_dma.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_dma.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_flash.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_flash.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_flash_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_flash_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_pwr.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_pwr.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -0,0 +1,70 @@
system/src/stm32f1xx/stm32f1xx_hal_spi.o: \
../system/src/stm32f1xx/stm32f1xx_hal_spi.c \
../system/include/stm32f1xx/stm32f1xx_hal.h \
../include/stm32f1xx_hal_conf.h ../include/mxconstants.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h \
../system/include/stm32f1xx/stm32f1xx_hal_def.h \
../system/include/cmsis/device/stm32f1xx.h \
../system/include/cmsis/device/stm32f103xe.h \
../system/include/cmsis/core_cm3.h \
../system/include/cmsis/core_cmInstr.h \
../system/include/cmsis/cmsis_gcc.h \
../system/include/cmsis/core_cmFunc.h \
../system/include/cmsis/device/system_stm32f1xx.h \
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
../include/stm32f1xx_hal_conf.h:
../include/mxconstants.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h:
../system/include/stm32f1xx/stm32f1xx_hal_def.h:
../system/include/cmsis/device/stm32f1xx.h:
../system/include/cmsis/device/stm32f103xe.h:
../system/include/cmsis/core_cm3.h:
../system/include/cmsis/core_cmInstr.h:
../system/include/cmsis/cmsis_gcc.h:
../system/include/cmsis/core_cmFunc.h:
../system/include/cmsis/device/system_stm32f1xx.h:
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

Binary file not shown.

View File

@ -0,0 +1,70 @@
system/src/stm32f1xx/stm32f1xx_hal_spi_ex.o: \
../system/src/stm32f1xx/stm32f1xx_hal_spi_ex.c \
../system/include/stm32f1xx/stm32f1xx_hal.h \
../include/stm32f1xx_hal_conf.h ../include/mxconstants.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h \
../system/include/stm32f1xx/stm32f1xx_hal_def.h \
../system/include/cmsis/device/stm32f1xx.h \
../system/include/cmsis/device/stm32f103xe.h \
../system/include/cmsis/core_cm3.h \
../system/include/cmsis/core_cmInstr.h \
../system/include/cmsis/cmsis_gcc.h \
../system/include/cmsis/core_cmFunc.h \
../system/include/cmsis/device/system_stm32f1xx.h \
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h \
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h \
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma.h \
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
../include/stm32f1xx_hal_conf.h:
../include/mxconstants.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc.h:
../system/include/stm32f1xx/stm32f1xx_hal_def.h:
../system/include/cmsis/device/stm32f1xx.h:
../system/include/cmsis/device/stm32f103xe.h:
../system/include/cmsis/core_cm3.h:
../system/include/cmsis/core_cmInstr.h:
../system/include/cmsis/cmsis_gcc.h:
../system/include/cmsis/core_cmFunc.h:
../system/include/cmsis/device/system_stm32f1xx.h:
../system/include/stm32f1xx/Legacy/stm32_hal_legacy.h:
../system/include/stm32f1xx/stm32f1xx_hal_rcc_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio.h:
../system/include/stm32f1xx/stm32f1xx_hal_gpio_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma.h:
../system/include/stm32f1xx/stm32f1xx_hal_dma_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash.h:
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

Binary file not shown.

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_tim.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_tim.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -20,7 +20,8 @@ system/src/stm32f1xx/stm32f1xx_hal_tim_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_cortex.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
../system/include/stm32f1xx/stm32f1xx_hal.h:
@ -65,3 +66,5 @@ system/src/stm32f1xx/stm32f1xx_hal_tim_ex.o: \
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h:
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:

View File

@ -14,6 +14,8 @@ C_SRCS += \
../system/src/stm32f1xx/stm32f1xx_hal_pwr.c \
../system/src/stm32f1xx/stm32f1xx_hal_rcc.c \
../system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.c \
../system/src/stm32f1xx/stm32f1xx_hal_spi.c \
../system/src/stm32f1xx/stm32f1xx_hal_spi_ex.c \
../system/src/stm32f1xx/stm32f1xx_hal_tim.c \
../system/src/stm32f1xx/stm32f1xx_hal_tim_ex.c
@ -28,6 +30,8 @@ OBJS += \
./system/src/stm32f1xx/stm32f1xx_hal_pwr.o \
./system/src/stm32f1xx/stm32f1xx_hal_rcc.o \
./system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.o \
./system/src/stm32f1xx/stm32f1xx_hal_spi.o \
./system/src/stm32f1xx/stm32f1xx_hal_spi_ex.o \
./system/src/stm32f1xx/stm32f1xx_hal_tim.o \
./system/src/stm32f1xx/stm32f1xx_hal_tim_ex.o
@ -42,6 +46,8 @@ C_DEPS += \
./system/src/stm32f1xx/stm32f1xx_hal_pwr.d \
./system/src/stm32f1xx/stm32f1xx_hal_rcc.d \
./system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.d \
./system/src/stm32f1xx/stm32f1xx_hal_spi.d \
./system/src/stm32f1xx/stm32f1xx_hal_spi_ex.d \
./system/src/stm32f1xx/stm32f1xx_hal_tim.d \
./system/src/stm32f1xx/stm32f1xx_hal_tim_ex.d

View File

@ -5,9 +5,9 @@ SourcePath=/home/wn/workspace-stm32/newcar/cube/newcar/Src
SourceFiles=stm32f1xx_it.h;stm32f1xx_hal_conf.h;mxconstants.h;stm32f1xx_it.c;stm32f1xx_hal_msp.c;main.c;
[PreviousLibFiles]
LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xg.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f100xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xg.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f105xc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f102xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f107xc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f100xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f102x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xb.h;
LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xg.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f100xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xg.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f105xc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f102xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f107xc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f100xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f102x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f101xb.h;
[PreviousUsedRideFiles]
SourceFiles=../Src/main.c;../Src/stm32f1xx_it.c;../Src/stm32f1xx_hal_msp.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s;
SourceFiles=../Src/main.c;../Src/stm32f1xx_it.c;../Src/stm32f1xx_hal_msp.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s;
HeaderPath=../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Include;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;

View File

@ -0,0 +1,674 @@
/**
******************************************************************************
* @file stm32f1xx_hal_spi.h
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @brief Header file of SPI HAL module.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F1xx_HAL_SPI_H
#define __STM32F1xx_HAL_SPI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal_def.h"
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
/** @addtogroup SPI
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup SPI_Exported_Types SPI Exported Types
* @{
*/
/**
* @brief SPI Configuration Structure definition
*/
typedef struct
{
uint32_t Mode; /*!< Specifies the SPI operating mode.
This parameter can be a value of @ref SPI_mode */
uint32_t Direction; /*!< Specifies the SPI Directional mode state.
This parameter can be a value of @ref SPI_Direction_mode */
uint32_t DataSize; /*!< Specifies the SPI data size.
This parameter can be a value of @ref SPI_data_size */
uint32_t CLKPolarity; /*!< Specifies the serial clock steady state.
This parameter can be a value of @ref SPI_Clock_Polarity */
uint32_t CLKPhase; /*!< Specifies the clock active edge for the bit capture.
This parameter can be a value of @ref SPI_Clock_Phase */
uint32_t NSS; /*!< Specifies whether the NSS signal is managed by
hardware (NSS pin) or by software using the SSI bit.
This parameter can be a value of @ref SPI_Slave_Select_management */
uint32_t BaudRatePrescaler; /*!< Specifies the Baud Rate prescaler value which will be
used to configure the transmit and receive SCK clock.
This parameter can be a value of @ref SPI_BaudRate_Prescaler
@note The communication clock is derived from the master
clock. The slave clock does not need to be set */
uint32_t FirstBit; /*!< Specifies whether data transfers start from MSB or LSB bit.
This parameter can be a value of @ref SPI_MSB_LSB_transmission */
uint32_t TIMode; /*!< Specifies if the TI mode is enabled or not.
This parameter can be a value of @ref SPI_TI_mode */
uint32_t CRCCalculation; /*!< Specifies if the CRC calculation is enabled or not.
This parameter can be a value of @ref SPI_CRC_Calculation */
uint32_t CRCPolynomial; /*!< Specifies the polynomial used for the CRC calculation.
This parameter must be a number between Min_Data = 0 and Max_Data = 65535 */
}SPI_InitTypeDef;
/**
* @brief HAL SPI State structure definition
*/
typedef enum
{
HAL_SPI_STATE_RESET = 0x00, /*!< SPI not yet initialized or disabled */
HAL_SPI_STATE_READY = 0x01, /*!< SPI initialized and ready for use */
HAL_SPI_STATE_BUSY = 0x02, /*!< SPI process is ongoing */
HAL_SPI_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
HAL_SPI_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
HAL_SPI_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
HAL_SPI_STATE_ERROR = 0x03 /*!< SPI error state */
}HAL_SPI_StateTypeDef;
/**
* @brief SPI handle Structure definition
*/
typedef struct __SPI_HandleTypeDef
{
SPI_TypeDef *Instance; /*!< SPI registers base address */
SPI_InitTypeDef Init; /*!< SPI communication parameters */
uint8_t *pTxBuffPtr; /*!< Pointer to SPI Tx transfer Buffer */
uint16_t TxXferSize; /*!< SPI Tx transfer size */
uint16_t TxXferCount; /*!< SPI Tx Transfer Counter */
uint8_t *pRxBuffPtr; /*!< Pointer to SPI Rx transfer Buffer */
uint16_t RxXferSize; /*!< SPI Rx transfer size */
uint16_t RxXferCount; /*!< SPI Rx Transfer Counter */
DMA_HandleTypeDef *hdmatx; /*!< SPI Tx DMA handle parameters */
DMA_HandleTypeDef *hdmarx; /*!< SPI Rx DMA handle parameters */
void (*RxISR)(struct __SPI_HandleTypeDef * hspi); /*!< function pointer on Rx ISR */
void (*TxISR)(struct __SPI_HandleTypeDef * hspi); /*!< function pointer on Tx ISR */
HAL_LockTypeDef Lock; /*!< SPI locking object */
__IO HAL_SPI_StateTypeDef State; /*!< SPI communication state */
__IO uint32_t ErrorCode; /*!< SPI Error code */
}SPI_HandleTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup SPI_Exported_Constants SPI Exported Constants
* @{
*/
/** @defgroup SPI_Error_Codes SPI Error Codes
* @{
*/
#define HAL_SPI_ERROR_NONE ((uint32_t)0x00) /*!< No error */
#define HAL_SPI_ERROR_MODF ((uint32_t)0x01) /*!< MODF error */
#define HAL_SPI_ERROR_CRC ((uint32_t)0x02) /*!< CRC error */
#define HAL_SPI_ERROR_OVR ((uint32_t)0x04) /*!< OVR error */
#define HAL_SPI_ERROR_DMA ((uint32_t)0x08) /*!< DMA transfer error */
#define HAL_SPI_ERROR_FLAG ((uint32_t)0x10) /*!< Flag: RXNE,TXE, BSY */
/**
* @}
*/
/** @defgroup SPI_mode SPI mode
* @{
*/
#define SPI_MODE_SLAVE ((uint32_t)0x00000000)
#define SPI_MODE_MASTER (SPI_CR1_MSTR | SPI_CR1_SSI)
/**
* @}
*/
/** @defgroup SPI_Direction_mode SPI Direction mode
* @{
*/
#define SPI_DIRECTION_2LINES ((uint32_t)0x00000000)
#define SPI_DIRECTION_2LINES_RXONLY SPI_CR1_RXONLY
#define SPI_DIRECTION_1LINE SPI_CR1_BIDIMODE
/**
* @}
*/
/** @defgroup SPI_data_size SPI data size
* @{
*/
#define SPI_DATASIZE_8BIT ((uint32_t)0x00000000)
#define SPI_DATASIZE_16BIT SPI_CR1_DFF
/**
* @}
*/
/** @defgroup SPI_Clock_Polarity SPI Clock Polarity
* @{
*/
#define SPI_POLARITY_LOW ((uint32_t)0x00000000)
#define SPI_POLARITY_HIGH SPI_CR1_CPOL
/**
* @}
*/
/** @defgroup SPI_Clock_Phase SPI Clock Phase
* @{
*/
#define SPI_PHASE_1EDGE ((uint32_t)0x00000000)
#define SPI_PHASE_2EDGE SPI_CR1_CPHA
/**
* @}
*/
/** @defgroup SPI_Slave_Select_management SPI Slave Select management
* @{
*/
#define SPI_NSS_SOFT SPI_CR1_SSM
#define SPI_NSS_HARD_INPUT ((uint32_t)0x00000000)
#define SPI_NSS_HARD_OUTPUT ((uint32_t)(SPI_CR2_SSOE << 16))
/**
* @}
*/
/** @defgroup SPI_BaudRate_Prescaler SPI BaudRate Prescaler
* @{
*/
#define SPI_BAUDRATEPRESCALER_2 ((uint32_t)0x00000000)
#define SPI_BAUDRATEPRESCALER_4 ((uint32_t)SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_8 ((uint32_t)SPI_CR1_BR_1)
#define SPI_BAUDRATEPRESCALER_16 ((uint32_t)SPI_CR1_BR_1 | SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_32 ((uint32_t)SPI_CR1_BR_2)
#define SPI_BAUDRATEPRESCALER_64 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_128 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_1)
#define SPI_BAUDRATEPRESCALER_256 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0)
/**
* @}
*/
/** @defgroup SPI_MSB_LSB_transmission SPI MSB LSB transmission
* @{
*/
#define SPI_FIRSTBIT_MSB ((uint32_t)0x00000000)
#define SPI_FIRSTBIT_LSB SPI_CR1_LSBFIRST
/**
* @}
*/
/** @defgroup SPI_TI_mode SPI TI mode disable
* @brief SPI TI Mode not supported for STM32F1xx family
* @{
*/
#define SPI_TIMODE_DISABLE ((uint32_t)0x00000000)
/**
* @}
*/
/** @defgroup SPI_CRC_Calculation SPI CRC Calculation
* @{
*/
#define SPI_CRCCALCULATION_DISABLE ((uint32_t)0x00000000)
#define SPI_CRCCALCULATION_ENABLE SPI_CR1_CRCEN
/**
* @}
*/
/** @defgroup SPI_Interrupt_configuration_definition SPI Interrupt configuration definition
* @{
*/
#define SPI_IT_TXE SPI_CR2_TXEIE
#define SPI_IT_RXNE SPI_CR2_RXNEIE
#define SPI_IT_ERR SPI_CR2_ERRIE
/**
* @}
*/
/** @defgroup SPI_Flag_definition SPI Flag definition
* @{
*/
#define SPI_FLAG_RXNE SPI_SR_RXNE
#define SPI_FLAG_TXE SPI_SR_TXE
#define SPI_FLAG_CRCERR SPI_SR_CRCERR
#define SPI_FLAG_MODF SPI_SR_MODF
#define SPI_FLAG_OVR SPI_SR_OVR
#define SPI_FLAG_BSY SPI_SR_BSY
/**
* @}
*/
/**
* @}
*/
/* Private constants ---------------------------------------------------------*/
/** @defgroup SPI_Private_Constants SPI Private Constants
* @{
*/
#define SPI_INVALID_CRC_ERROR 0 /* CRC error wrongly detected */
#define SPI_VALID_CRC_ERROR 1 /* CRC error is true */
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup SPI_Exported_Macros SPI Exported Macros
* @{
*/
/** @brief Reset SPI handle state
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SPI_STATE_RESET)
/** @brief Enable the specified SPI interrupts.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the interrupt source to enable.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval None
*/
#define __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
/** @brief Disable the specified SPI interrupts.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the interrupt source to disable.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval None
*/
#define __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
/** @brief Check if the specified SPI interrupt source is enabled or disabled.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the SPI interrupt source to check.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval The new state of __IT__ (TRUE or FALSE).
*/
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
/** @brief Check whether the specified SPI flag is set or not.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __FLAG__: specifies the flag to check.
* This parameter can be one of the following values:
* @arg SPI_FLAG_RXNE: Receive buffer not empty flag
* @arg SPI_FLAG_TXE: Transmit buffer empty flag
* @arg SPI_FLAG_CRCERR: CRC error flag
* @arg SPI_FLAG_MODF: Mode fault flag
* @arg SPI_FLAG_OVR: Overrun flag
* @arg SPI_FLAG_BSY: Busy flag
* @retval The new state of __FLAG__ (TRUE or FALSE).
*/
#define __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
/** @brief Clear the SPI CRCERR pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_CRCERRFLAG(__HANDLE__) ((__HANDLE__)->Instance->SR = ~(SPI_FLAG_CRCERR))
/** @brief Clear the SPI MODF pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__) \
do{ \
__IO uint32_t tmpreg; \
tmpreg = (__HANDLE__)->Instance->SR; \
tmpreg = CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE); \
UNUSED(tmpreg); \
}while(0)
/** @brief Clear the SPI OVR pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__) \
do{ \
__IO uint32_t tmpreg; \
tmpreg = (__HANDLE__)->Instance->DR; \
tmpreg = (__HANDLE__)->Instance->SR; \
UNUSED(tmpreg); \
}while(0)
/** @brief Enables the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
/** @brief Disables the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
/**
* @}
*/
/* Private macros -----------------------------------------------------------*/
/** @defgroup SPI_Private_Macros SPI Private Macros
* @{
*/
/** @brief Checks if SPI Mode parameter is in allowed range.
* @param __MODE__: specifies the SPI Mode.
* This parameter can be a value of @ref SPI_mode
* @retval None
*/
#define IS_SPI_MODE(__MODE__) (((__MODE__) == SPI_MODE_SLAVE) || ((__MODE__) == SPI_MODE_MASTER))
/** @brief Checks if SPI Direction Mode parameter is in allowed range.
* @param __MODE__: specifies the SPI Direction Mode.
* This parameter can be a value of @ref SPI_Direction_mode
* @retval None
*/
#define IS_SPI_DIRECTION_MODE(__MODE__) (((__MODE__) == SPI_DIRECTION_2LINES) || \
((__MODE__) == SPI_DIRECTION_2LINES_RXONLY) || \
((__MODE__) == SPI_DIRECTION_1LINE))
/** @brief Checks if SPI Direction Mode parameter is 1 or 2 lines.
* @param __MODE__: specifies the SPI Direction Mode.
* @retval None
*/
#define IS_SPI_DIRECTION_2LINES_OR_1LINE(__MODE__) (((__MODE__) == SPI_DIRECTION_2LINES) || \
((__MODE__) == SPI_DIRECTION_1LINE))
/** @brief Checks if SPI Direction Mode parameter is 2 lines.
* @param __MODE__: specifies the SPI Direction Mode.
* @retval None
*/
#define IS_SPI_DIRECTION_2LINES(__MODE__) ((__MODE__) == SPI_DIRECTION_2LINES)
/** @brief Checks if SPI Data Size parameter is in allowed range.
* @param __DATASIZE__: specifies the SPI Data Size.
* This parameter can be a value of @ref SPI_data_size
* @retval None
*/
#define IS_SPI_DATASIZE(__DATASIZE__) (((__DATASIZE__) == SPI_DATASIZE_16BIT) || \
((__DATASIZE__) == SPI_DATASIZE_8BIT))
/** @brief Checks if SPI Serial clock steady state parameter is in allowed range.
* @param __CPOL__: specifies the SPI serial clock steady state.
* This parameter can be a value of @ref SPI_Clock_Polarity
* @retval None
*/
#define IS_SPI_CPOL(__CPOL__) (((__CPOL__) == SPI_POLARITY_LOW) || \
((__CPOL__) == SPI_POLARITY_HIGH))
/** @brief Checks if SPI Clock Phase parameter is in allowed range.
* @param __CPHA__: specifies the SPI Clock Phase.
* This parameter can be a value of @ref SPI_Clock_Phase
* @retval None
*/
#define IS_SPI_CPHA(__CPHA__) (((__CPHA__) == SPI_PHASE_1EDGE) || \
((__CPHA__) == SPI_PHASE_2EDGE))
/** @brief Checks if SPI Slave select parameter is in allowed range.
* @param __NSS__: specifies the SPI Slave Slelect management parameter.
* This parameter can be a value of @ref SPI_Slave_Select_management
* @retval None
*/
#define IS_SPI_NSS(__NSS__) (((__NSS__) == SPI_NSS_SOFT) || \
((__NSS__) == SPI_NSS_HARD_INPUT) || \
((__NSS__) == SPI_NSS_HARD_OUTPUT))
/** @brief Checks if SPI Baudrate prescaler parameter is in allowed range.
* @param __PRESCALER__: specifies the SPI Baudrate prescaler.
* This parameter can be a value of @ref SPI_BaudRate_Prescaler
* @retval None
*/
#define IS_SPI_BAUDRATE_PRESCALER(__PRESCALER__) (((__PRESCALER__) == SPI_BAUDRATEPRESCALER_2) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_4) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_8) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_16) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_32) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_64) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_128) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_256))
/** @brief Checks if SPI MSB LSB transmission parameter is in allowed range.
* @param __BIT__: specifies the SPI MSB LSB transmission (whether data transfer starts from MSB or LSB bit).
* This parameter can be a value of @ref SPI_MSB_LSB_transmission
* @retval None
*/
#define IS_SPI_FIRST_BIT(__BIT__) (((__BIT__) == SPI_FIRSTBIT_MSB) || \
((__BIT__) == SPI_FIRSTBIT_LSB))
/** @brief Checks if SPI TI mode parameter is in allowed range.
* @param __MODE__: specifies the SPI TI mode.
* This parameter can be a value of @ref SPI_TI_mode
* @retval None
*/
#define IS_SPI_TIMODE(__MODE__) ((__MODE__) == SPI_TIMODE_DISABLE)
/** @brief Checks if SPI CRC calculation enabled state is in allowed range.
* @param __CALCULATION__: specifies the SPI CRC calculation enable state.
* This parameter can be a value of @ref SPI_CRC_Calculation
* @retval None
*/
#define IS_SPI_CRC_CALCULATION(__CALCULATION__) (((__CALCULATION__) == SPI_CRCCALCULATION_DISABLE) || \
((__CALCULATION__) == SPI_CRCCALCULATION_ENABLE))
/** @brief Checks if SPI polynomial value to be used for the CRC calculation, is in allowed range.
* @param __POLYNOMIAL__: specifies the SPI polynomial value to be used for the CRC calculation.
* This parameter must be a number between Min_Data = 0 and Max_Data = 65535
* @retval None
*/
#define IS_SPI_CRC_POLYNOMIAL(__POLYNOMIAL__) (((__POLYNOMIAL__) >= 0x1) && ((__POLYNOMIAL__) <= 0xFFFF))
/** @brief Sets the SPI transmit-only mode.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_1LINE_TX(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
/** @brief Sets the SPI receive-only mode.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_1LINE_RX(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
/** @brief Resets the CRC calculation of the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_RESET_CRC(__HANDLE__) do{CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_CRCEN);\
SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_CRCEN);}while(0)
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup SPI_Exported_Functions
* @{
*/
/* Initialization/de-initialization functions **********************************/
/** @addtogroup SPI_Exported_Functions_Group1
* @{
*/
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DeInit (SPI_HandleTypeDef *hspi);
void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi);
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/* I/O operation functions *****************************************************/
/** @addtogroup SPI_Exported_Functions_Group2
* @{
*/
HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_DMAPause(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi);
void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/* Peripheral State and Control functions **************************************/
/** @addtogroup SPI_Exported_Functions_Group3
* @{
*/
HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi);
uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/**
* @}
*/
/* Private functions --------------------------------------------------------*/
/** @addtogroup SPI_Private_Functions
* @{
*/
uint8_t SPI_ISCRCErrorValid(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F1xx_HAL_SPI_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,217 @@
/**
******************************************************************************
* @file stm32f1xx_hal_spi_ex.c
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @brief Extended SPI HAL module driver.
*
* This file provides firmware functions to manage the following
* functionalities SPI extension peripheral:
* + Extended Peripheral Control functions
*
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
/** @addtogroup SPI
* @{
*/
#ifdef HAL_SPI_MODULE_ENABLED
/** @defgroup SPI_Private_Variables SPI Private Variables
* @{
*/
/* Variable used to determine if device is impacted by implementation of workaround
related to wrong CRC errors detection on SPI2. Conditions in which this workaround has to be applied, are:
- STM32F101CDE/STM32F103CDE
- Revision ID : Z
- SPI2
- In receive only mode, with CRC calculation enabled, at the end of the CRC reception,
the software needs to check the CRCERR flag. If it is found set, read back the SPI_RXCRC:
+ If the value is 0, the complete data transfer is successful.
+ Otherwise, one or more errors have been detected during the data transfer by CPU or DMA.
If CRCERR is found reset, the complete data transfer is considered successful.
*/
uint8_t uCRCErrorWorkaroundCheck = 0;
/**
* @}
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @addtogroup SPI_Exported_Functions
* @{
*/
/** @addtogroup SPI_Exported_Functions_Group1
*
* @{
*/
/**
* @brief Initializes the SPI according to the specified parameters
* in the SPI_InitTypeDef and create the associated handle.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
* the configuration information for SPI module.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
{
/* Check the SPI handle allocation */
if(hspi == NULL)
{
return HAL_ERROR;
}
/* Check the parameters */
assert_param(IS_SPI_ALL_INSTANCE(hspi->Instance));
assert_param(IS_SPI_MODE(hspi->Init.Mode));
assert_param(IS_SPI_DIRECTION_MODE(hspi->Init.Direction));
assert_param(IS_SPI_DATASIZE(hspi->Init.DataSize));
assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity));
assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase));
assert_param(IS_SPI_NSS(hspi->Init.NSS));
assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit));
assert_param(IS_SPI_TIMODE(hspi->Init.TIMode));
assert_param(IS_SPI_CRC_CALCULATION(hspi->Init.CRCCalculation));
assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial));
if(hspi->State == HAL_SPI_STATE_RESET)
{
/* Init the low level hardware : GPIO, CLOCK, NVIC... */
HAL_SPI_MspInit(hspi);
}
hspi->State = HAL_SPI_STATE_BUSY;
/* Disble the selected SPI peripheral */
__HAL_SPI_DISABLE(hspi);
/*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/
/* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management,
Communication speed, First bit and CRC calculation state */
WRITE_REG(hspi->Instance->CR1, (hspi->Init.Mode | hspi->Init.Direction | hspi->Init.DataSize |
hspi->Init.CLKPolarity | hspi->Init.CLKPhase | (hspi->Init.NSS & SPI_CR1_SSM) |
hspi->Init.BaudRatePrescaler | hspi->Init.FirstBit | hspi->Init.CRCCalculation) );
/* Configure : NSS management */
WRITE_REG(hspi->Instance->CR2, (((hspi->Init.NSS >> 16) & SPI_CR2_SSOE) | hspi->Init.TIMode));
/*---------------------------- SPIx CRCPOLY Configuration ------------------*/
/* Configure : CRC Polynomial */
WRITE_REG(hspi->Instance->CRCPR, hspi->Init.CRCPolynomial);
#if defined (STM32F101x6) || defined (STM32F101xB) || defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F102x6) || defined (STM32F102xB) || defined (STM32F103x6) || defined (STM32F103xB) || defined (STM32F103xE) || defined (STM32F103xG) || defined (STM32F105xC) || defined (STM32F107xC)
/* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */
CLEAR_BIT(hspi->Instance->I2SCFGR, SPI_I2SCFGR_I2SMOD);
#endif
#if defined (STM32F101xE) || defined (STM32F103xE)
/* Check RevisionID value for identifying if Device is Rev Z (0x0001) in order to enable workaround for
CRC errors wrongly detected */
/* Pb is that ES_STM32F10xxCDE also identify an issue in Debug registers access while not in Debug mode.
Revision ID information is only available in Debug mode, so Workaround could not be implemented
to distinguish Rev Z devices (issue present) from more recent version (issue fixed).
So, in case of Revison Z F101 or F103 devices, below variable should be assigned to 1 */
uCRCErrorWorkaroundCheck = 0;
#else
uCRCErrorWorkaroundCheck = 0;
#endif
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
hspi->State = HAL_SPI_STATE_READY;
return HAL_OK;
}
/**
* @}
*/
/**
* @}
*/
/** @addtogroup SPI_Private_Functions
* @{
*/
/**
* @brief Checks if encountered CRC error could be corresponding to wrongly detected errors
* according to SPI instance, Device type, and revision ID.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
* the configuration information for SPI module.
* @retval CRC error validity (SPI_INVALID_CRC_ERROR or SPI_VALID_CRC_ERROR).
*/
uint8_t SPI_ISCRCErrorValid(SPI_HandleTypeDef *hspi)
{
#if defined (STM32F101xE) || defined (STM32F103xE)
/* Check how to handle this CRC error (workaround to be applied or not) */
/* If CRC errors could be wrongly detected (issue 2.15.2 in STM32F10xxC/D/E silicon limitations ES (DocID14732 Rev 13) */
if ( (uCRCErrorWorkaroundCheck != 0) && (hspi->Instance == SPI2) )
{
if (hspi->Instance->RXCRCR == 0)
{
return (SPI_INVALID_CRC_ERROR);
}
}
return (SPI_VALID_CRC_ERROR);
#else
return (SPI_VALID_CRC_ERROR);
#endif
}
/**
* @}
*/
#endif /* HAL_SPI_MODULE_ENABLED */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -43,6 +43,12 @@
#define LED_Pin GPIO_PIN_13
#define LED_GPIO_Port GPIOC
#define OLED_DC_Pin GPIO_PIN_1
#define OLED_DC_GPIO_Port GPIOA
#define OLED_RST_Pin GPIO_PIN_2
#define OLED_RST_GPIO_Port GPIOA
#define OLED_CS_Pin GPIO_PIN_3
#define OLED_CS_GPIO_Port GPIOA
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */

View File

@ -75,7 +75,7 @@
/*#define HAL_SD_MODULE_ENABLED */
/*#define HAL_SDRAM_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
/*#define HAL_SRAM_MODULE_ENABLED */
/*#define HAL_TIM_MODULE_ENABLED */
/*#define HAL_UART_MODULE_ENABLED */

View File

@ -38,6 +38,7 @@
/* USER CODE END Includes */
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi1;
/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
@ -48,6 +49,7 @@
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_SPI1_Init(void);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
@ -75,6 +77,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
@ -131,6 +134,29 @@ void SystemClock_Config(void)
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
/* SPI1 init function */
static void MX_SPI1_Init(void)
{
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi1) != HAL_OK)
{
Error_Handler();
}
}
/** Configure pins as
* Analog
* Input
@ -150,12 +176,24 @@ static void MX_GPIO_Init(void)
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
/*Configure GPIO pin : LED_Pin */
GPIO_InitStruct.Pin = LED_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : OLED_DC_Pin OLED_RST_Pin OLED_CS_Pin */
GPIO_InitStruct.Pin = OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
/* USER CODE BEGIN 4 */

View File

@ -77,6 +77,65 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
GPIO_InitTypeDef GPIO_InitStruct;
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspInit 0 */
/* USER CODE END SPI1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI1_CLK_ENABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN SPI1_MspInit 1 */
/* USER CODE END SPI1_MspInit 1 */
}
}
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspDeInit 0 */
/* USER CODE END SPI1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_SPI1_CLK_DISABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
}
/* USER CODE BEGIN SPI1_MspDeInit 1 */
/* USER CODE END SPI1_MspDeInit 1 */
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */

View File

@ -4,17 +4,24 @@ KeepUserPlacement=false
Mcu.Family=STM32F1
Mcu.IP0=NVIC
Mcu.IP1=RCC
Mcu.IP2=SYS
Mcu.IPNb=3
Mcu.IP2=SPI1
Mcu.IP3=SYS
Mcu.IPNb=4
Mcu.Name=STM32F103V(C-D-E)Tx
Mcu.Package=LQFP100
Mcu.Pin0=PC13-TAMPER-RTC
Mcu.Pin1=OSC_IN
Mcu.Pin10=PA14
Mcu.Pin11=VP_SYS_VS_Systick
Mcu.Pin2=OSC_OUT
Mcu.Pin3=PA13
Mcu.Pin4=PA14
Mcu.Pin5=VP_SYS_VS_Systick
Mcu.PinsNb=6
Mcu.Pin3=PA1
Mcu.Pin4=PA2
Mcu.Pin5=PA3
Mcu.Pin6=PA5
Mcu.Pin7=PA6
Mcu.Pin8=PA7
Mcu.Pin9=PA13
Mcu.PinsNb=12
Mcu.UserConstants=
Mcu.UserName=STM32F103VCTx
MxCube.Version=4.16.1
@ -33,10 +40,29 @@ OSC_IN.Mode=HSE-External-Oscillator
OSC_IN.Signal=RCC_OSC_IN
OSC_OUT.Mode=HSE-External-Oscillator
OSC_OUT.Signal=RCC_OSC_OUT
PA1.GPIOParameters=GPIO_Label
PA1.GPIO_Label=OLED_DC
PA1.Locked=true
PA1.Signal=GPIO_Output
PA13.Mode=Serial_Wire
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial_Wire
PA14.Signal=SYS_JTCK-SWCLK
PA2.GPIOParameters=GPIO_Label
PA2.GPIO_Label=OLED_RST
PA2.Locked=true
PA2.Signal=GPIO_Output
PA3.GPIOParameters=PinState,GPIO_Label
PA3.GPIO_Label=OLED_CS
PA3.Locked=true
PA3.PinState=GPIO_PIN_SET
PA3.Signal=GPIO_Output
PA5.Mode=Full_Duplex_Master
PA5.Signal=SPI1_SCK
PA6.Mode=Full_Duplex_Master
PA6.Signal=SPI1_MISO
PA7.Mode=Full_Duplex_Master
PA7.Signal=SPI1_MOSI
PC13-TAMPER-RTC.GPIOParameters=GPIO_Label
PC13-TAMPER-RTC.GPIO_Label=LED
PC13-TAMPER-RTC.Locked=true
@ -72,7 +98,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=SW4STM32
ProjectManager.ToolChainLocation=/home/wn/workspace-stm32/newcar/cube/newcar
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false,2-MX_SPI1_Init-SPI1-false
RCC.ADCFreqValue=36000000
RCC.AHBFreq_Value=72000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2
@ -100,6 +126,12 @@ RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=72000000
RCC.USBFreq_Value=72000000
RCC.VCOOutput2Freq_Value=8000000
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16
SPI1.CLKPhase=SPI_PHASE_2EDGE
SPI1.CLKPolarity=SPI_POLARITY_HIGH
SPI1.CalculateBaudRate=4.5 MBits/s
SPI1.IPParameters=Mode,BaudRatePrescaler,CalculateBaudRate,CLKPolarity,CLKPhase
SPI1.Mode=SPI_MODE_MASTER
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
board=newcar

View File

@ -43,6 +43,12 @@
#define LED_Pin GPIO_PIN_13
#define LED_GPIO_Port GPIOC
#define OLED_DC_Pin GPIO_PIN_1
#define OLED_DC_GPIO_Port GPIOA
#define OLED_RST_Pin GPIO_PIN_2
#define OLED_RST_GPIO_Port GPIOA
#define OLED_CS_Pin GPIO_PIN_3
#define OLED_CS_GPIO_Port GPIOA
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */

View File

@ -75,7 +75,7 @@
/*#define HAL_SD_MODULE_ENABLED */
/*#define HAL_SDRAM_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
/*#define HAL_SRAM_MODULE_ENABLED */
/*#define HAL_TIM_MODULE_ENABLED */
/*#define HAL_UART_MODULE_ENABLED */

View File

@ -21,6 +21,7 @@
#include "stm32f1xx_hal.h"
#include "led.h"
#include "oled.h"
@ -43,6 +44,8 @@ void my_errorHandler() {
void my_setup_2() {
blinkInit();
LED_P8x16Str(0, 0, "Hallo");
}

226
my_src/oled-fonts.h Normal file
View File

@ -0,0 +1,226 @@
/*
* oled-fonts.h
*
* Created on: May 29, 2017
* Author: wn
*/
#ifndef OLED_FONTS_H_
#define OLED_FONTS_H_
/*
* Code found at http://www.instructables.com/id/How-to-use-OLED-display-arduino-module/
* Thank you very much!
* Adapted from Arduino to STM32 HAL by wollud1969
*/
const unsigned char F6x8[][6] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // sp
{ 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 }, // !
{ 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 }, // "
{ 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // #
{ 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // $
{ 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 }, // %
{ 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 }, // &
{ 0x00, 0x00, 0x05, 0x03, 0x00, 0x00 }, // '
{ 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 }, // (
{ 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 }, // )
{ 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 }, // *
{ 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 }, // +
{ 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 }, // ,
{ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 }, // -
{ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 }, // .
{ 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 }, // /
{ 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0
{ 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1
{ 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2
{ 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3
{ 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4
{ 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5
{ 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6
{ 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7
{ 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8
{ 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9
{ 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 }, // :
{ 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 }, // ;
{ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 }, // <
{ 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 }, // =
{ 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 }, // >
{ 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 }, // ?
{ 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E }, // @
{ 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C }, // A
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C
{ 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F
{ 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G
{ 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H
{ 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I
{ 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J
{ 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K
{ 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L
{ 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M
{ 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P
{ 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q
{ 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R
{ 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 }, // S
{ 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T
{ 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U
{ 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V
{ 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W
{ 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 }, // X
{ 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y
{ 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z
{ 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [ 91
{ 0x00, 0x02, 0x04 ,0x08, 0x10, 0x20 }, // \92
{ 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ]
{ 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^
{ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 }, // _
{ 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 }, // '
{ 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 }, // a
{ 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 }, // c
{ 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F }, // d
{ 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 }, // e
{ 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f
{ 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C }, // g
{ 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h
{ 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i
{ 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 }, // j
{ 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k
{ 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l
{ 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 }, // o
{ 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 }, // p
{ 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC }, // q
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r
{ 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 }, // s
{ 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t
{ 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u
{ 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v
{ 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w
{ 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 }, // x
{ 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // y
{ 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z
{ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 } // horiz lines
};
const unsigned char F8X16[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//!1
0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//"2
0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//#3
0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$4
0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//%5
0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//&6
0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//'7
0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//(8
0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//)9
0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//*10
0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+11
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//,12
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//-13
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//.14
0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,///15
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//016
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//117
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//218
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//319
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//420
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//521
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//622
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//723
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//824
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//925
0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//:26
0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//;27
0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//<28
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//=29
0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//>30
0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//?31
0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@32
0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A33
0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B34
0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C35
0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D36
0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E37
0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F38
0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G39
0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H40
0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I41
0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J42
0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K43
0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L44
0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M45
0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N46
0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O47
0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P48
0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q49
0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R50
0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S51
0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T52
0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U53
0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V54
0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W55
0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X56
0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y57
0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z58
0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[59
0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\60
0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//]61
0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^62
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_63
0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//`64
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a65
0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b66
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c67
0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d68
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e69
0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f70
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g71
0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h72
0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i73
0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j74
0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k75
0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l76
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m77
0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n78
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o79
0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p80
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q81
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r82
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s83
0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t84
0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//unsigned char5
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v86
0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w87
0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x88
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y89
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z90
0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{91
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//|92
0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//}93
0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~94
};
#endif /* OLED_FONTS_H_ */

525
my_src/oled.c Normal file
View File

@ -0,0 +1,525 @@
/*
* Code found at http://www.instructables.com/id/How-to-use-OLED-display-arduino-module/
* Thank you very much!
* Adapted from Arduino to STM32 HAL by wollud1969
*/
#include "oled.h"
#include "oled-fonts.h"
#include "stm32f1xx_hal.h"
#define HIGH GPIO_PIN_SET
#define LOW GPIO_PIN_RESET
// DO: SPI Clk, D1: SPI Data
extern SPI_HandleTypeDef hspi1;
static void __LEDPIN_RST(GPIO_PinState v) {
HAL_GPIO_WritePin(OLED_RST_GPIO_Port, OLED_RST_Pin, v);
}
static void __LEDPIN_DC(GPIO_PinState v) {
HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, v);
}
static void __LEDPIN_CS(GPIO_PinState v) {
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, v);
}
void LED_WrDat(unsigned char data)
{
__LEDPIN_CS(LOW);
__LEDPIN_DC(HIGH);
HAL_SPI_Transmit(&hspi1, &data, 1, 0);
__LEDPIN_CS(HIGH);
}
void LED_WrCmd(unsigned char cmd)
{
__LEDPIN_CS(LOW);
__LEDPIN_DC(LOW);
HAL_SPI_Transmit(&hspi1, &cmd, 1, 0);
__LEDPIN_CS(HIGH);
}
void LED_Set_Pos(unsigned char x, unsigned char y)
{
LED_WrCmd(0xb0+y);
LED_WrCmd(((x&0xf0)>>4)|0x10);
LED_WrCmd((x&0x0f)|0x00);
}
void LED_Fill(unsigned char bmp_data)
{
unsigned char y,x;
for(y=0;y<8;y++)
{
LED_WrCmd(0xb0+y);
LED_WrCmd(0x00);
LED_WrCmd(0x10);
for(x=0;x<128;x++)
LED_WrDat(bmp_data);
}
}
void LED_CLS(void)
{
unsigned char y,x;
for(y=0;y<8;y++)
{
LED_WrCmd(0xb0+y);
LED_WrCmd(0x00);
LED_WrCmd(0x10);
for(x=0;x<128;x++)
LED_WrDat(0);
}
}
void LED_DLY_ms(unsigned int ms)
{
uint32_t start = HAL_GetTick();
while (HAL_GetTick() < start + ms);
}
void SetStartColumn(unsigned char d)
{
LED_WrCmd(0x00+d%16); // Set Lower Column Start Address for Page Addressing Mode
// Default => 0x00
LED_WrCmd(0x10+d/16); // Set Higher Column Start Address for Page Addressing Mode
// Default => 0x10
}
void SetAddressingMode(unsigned char d)
{
LED_WrCmd(0x20); // Set Memory Addressing Mode
LED_WrCmd(d); // Default => 0x02
// 0x00 => Horizontal Addressing Mode
// 0x01 => Vertical Addressing Mode
// 0x02 => Page Addressing Mode
}
void SetColumnAddress(unsigned char a, unsigned char b)
{
LED_WrCmd(0x21); // Set Column Address
LED_WrCmd(a); // Default => 0x00 (Column Start Address)
LED_WrCmd(b); // Default => 0x7F (Column End Address)
}
void SetPageAddress(unsigned char a, unsigned char b)
{
LED_WrCmd(0x22); // Set Page Address
LED_WrCmd(a); // Default => 0x00 (Page Start Address)
LED_WrCmd(b); // Default => 0x07 (Page End Address)
}
void SetStartLine(unsigned char d)
{
LED_WrCmd(0x40|d); // Set Display Start Line
// Default => 0x40 (0x00)
}
void SetContrastControl(unsigned char d)
{
LED_WrCmd(0x81); // Set Contrast Control
LED_WrCmd(d); // Default => 0x7F
}
void Set_Charge_Pump(unsigned char d)
{
LED_WrCmd(0x8D); // Set Charge Pump
LED_WrCmd(0x10|d); // Default => 0x10
// 0x10 (0x00) => Disable Charge Pump
// 0x14 (0x04) => Enable Charge Pump
}
void Set_Segment_Remap(unsigned char d)
{
LED_WrCmd(0xA0|d); // Set Segment Re-Map
// Default => 0xA0
// 0xA0 (0x00) => Column Address 0 Mapped to SEG0
// 0xA1 (0x01) => Column Address 0 Mapped to SEG127
}
void Set_Entire_Display(unsigned char d)
{
LED_WrCmd(0xA4|d); // Set Entire Display On / Off
// Default => 0xA4
// 0xA4 (0x00) => Normal Display
// 0xA5 (0x01) => Entire Display On
}
void Set_Inverse_Display(unsigned char d)
{
LED_WrCmd(0xA6|d); // Set Inverse Display On/Off
// Default => 0xA6
// 0xA6 (0x00) => Normal Display
// 0xA7 (0x01) => Inverse Display On
}
void Set_Multiplex_Ratio(unsigned char d)
{
LED_WrCmd(0xA8); // Set Multiplex Ratio
LED_WrCmd(d); // Default => 0x3F (1/64 Duty)
}
void Set_Display_On_Off(unsigned char d)
{
LED_WrCmd(0xAE|d); // Set Display On/Off
// Default => 0xAE
// 0xAE (0x00) => Display Off
// 0xAF (0x01) => Display On
}
void SetStartPage(unsigned char d)
{
LED_WrCmd(0xB0|d); // Set Page Start Address for Page Addressing Mode
// Default => 0xB0 (0x00)
}
void Set_Common_Remap(unsigned char d)
{
LED_WrCmd(0xC0|d); // Set COM Output Scan Direction
// Default => 0xC0
// 0xC0 (0x00) => Scan from COM0 to 63
// 0xC8 (0x08) => Scan from COM63 to 0
}
void Set_Display_Offset(unsigned char d)
{
LED_WrCmd(0xD3); // Set Display Offset
LED_WrCmd(d); // Default => 0x00
}
void Set_Display_Clock(unsigned char d)
{
LED_WrCmd(0xD5); // Set Display Clock Divide Ratio / Oscillator Frequency
LED_WrCmd(d); // Default => 0x80
// D[3:0] => Display Clock Divider
// D[7:4] => Oscillator Frequency
}
void Set_Precharge_Period(unsigned char d)
{
LED_WrCmd(0xD9); // Set Pre-Charge Period
LED_WrCmd(d); // Default => 0x22 (2 Display Clocks [Phase 2] / 2 Display Clocks [Phase 1])
// D[3:0] => Phase 1 Period in 1~15 Display Clocks
// D[7:4] => Phase 2 Period in 1~15 Display Clocks
}
void Set_Common_Config(unsigned char d)
{
LED_WrCmd(0xDA); // Set COM Pins Hardware Configuration
LED_WrCmd(0x02|d); // Default => 0x12 (0x10)
// Alternative COM Pin Configuration
// Disable COM Left/Right Re-Map
}
void Set_VCOMH(unsigned char d)
{
LED_WrCmd(0xDB); // Set VCOMH Deselect Level
LED_WrCmd(d); // Default => 0x20 (0.77*VCC)
}
void Set_NOP(void)
{
LED_WrCmd(0xE3); // Command for No Operation
}
void oledInit(void)
{
// LEDPIN_Init();
// LED_PORT=0X0F;
//LED_SCLH;;;
//LED_RSTL;;;
//digitalWrite(SCL_PIN,HIGH);;;
__LEDPIN_RST(LOW);
// for(i=0;i<100;i++)asm("nop");
LED_DLY_ms(50);
//LED_RSTH;;;
__LEDPIN_RST(HIGH);
Set_Display_On_Off(0x00); // Display Off (0x00/0x01)
Set_Display_Clock(0x80); // Set Clock as 100 Frames/Sec
Set_Multiplex_Ratio(0x3F); // 1/64 Duty (0x0F~0x3F)
Set_Display_Offset(0x00); // Shift Mapping RAM Counter (0x00~0x3F)
SetStartLine(0x00); // Set Mapping RAM Display Start Line (0x00~0x3F)
Set_Charge_Pump(0x04); // Enable Embedded DC/DC Converter (0x00/0x04)
SetAddressingMode(0x02); // Set Page Addressing Mode (0x00/0x01/0x02)
Set_Segment_Remap(0x01); // Set SEG/Column Mapping
Set_Common_Remap(0x08); // Set COM/Row Scan Direction
Set_Common_Config(0x10); // Set Sequential Configuration (0x00/0x10)
SetContrastControl(0xCF); // Set SEG Output Current
Set_Precharge_Period(0xF1); // Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
Set_VCOMH(0x40); // Set VCOM Deselect Level
Set_Entire_Display(0x00); // Disable Entire Display On (0x00/0x01)
Set_Inverse_Display(0x00); // Disable Inverse Display On (0x00/0x01)
Set_Display_On_Off(0x01); // Display On (0x00/0x01)
LED_Fill(0x00); //clear all
LED_Set_Pos(0,0);
}
void LED_P6x8Char(unsigned char x,unsigned char y,unsigned char ch)
{
unsigned char c=0,i=0;
c =ch-32;
if(x>122)
{
x=0;
y++;
}
LED_Set_Pos(x,y);
for(i=0;i<6;i++)
{
LED_WrDat(F6x8[c][i]);
}
}
void LED_P6x8Str(unsigned char x,unsigned char y,char ch[])
{
unsigned char c=0,i=0,j=0;
while (ch[j]!='\0')
{
c =ch[j]-32;
if(x>126)
{
x=0;
y++;
}
LED_Set_Pos(x,y);
for(i=0;i<6;i++)
{
LED_WrDat(F6x8[c][i]);
}
x+=6;
j++;
}
}
void LED_P8x16Str(unsigned char x,unsigned char y,char ch[])
{
unsigned char c=0,i=0,j=0;
while (ch[j]!='\0')
{
c =ch[j]-32;
if(x>120)
{
x=0;
y++;
}
LED_Set_Pos(x,y);
for(i=0;i<8;i++)
{
LED_WrDat(F8X16[(c<<4)+i]);
}
LED_Set_Pos(x,y+1);
for(i=0;i<8;i++)
{
LED_WrDat(F8X16[(c<<4)+i+8]);
}
x+=8;
j++;
}
}
void LED_PrintBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char bmp[])
{
int ii=0;
unsigned char x,y;
for(y=y0;y<=y1;y++)
{
LED_Set_Pos(x0,y);
for(x=x0;x<x1;x++)
{
LED_WrDat(bmp[ii++]);
}
}
}
//void LED_PrintValueC(unsigned char x, unsigned char y, char data)
//{
// unsigned char i,j,k;
// if(data < 0)
// {
// LED_P6x8Char(x,y,'-');
// data = - data;
// }
// else
// {
// LED_P6x8Char(x,y,'+');
// }
// i = data/100;
// j = (data%100)/10;
// k = data%10;
// LED_P6x8Char(x+6,y,i+48);
// LED_P6x8Char(x+12,y,j+48);
// LED_P6x8Char(x+18,y,k+48);
//}
//
//
//void LED_PrintValueI(unsigned char x, unsigned char y, int data)
//{
// unsigned char i,j,k,l,m;
// if(data < 0)
// {
// LED_P6x8Char(x,y,'-');
// data = - data;
// }
//// else
//// {
//// LED_P6x8Char(x,y,'+');
//// }
//
// l = data/10000;
// m= (data%10000)/1000;
// i = (data%1000)/100;
// j = (data%100)/10;
// k = data%10;
//
// unsigned char c;
// c = (l == 0) ? ' ' : (l + 48); LED_P6x8Char(x+6,y,c);
// c = (m == 0 && l == 0) ? ' ' : (m + 48); LED_P6x8Char(x+12,y,c);
// c = (i == 0 && m == 0 && l == 0) ? ' ' : (i + 48); LED_P6x8Char(x+18,y,c);
// c = (j == 0 && i == 0 && m == 0 && l == 0) ? ' ' : (j + 48); LED_P6x8Char(x+24,y,c);
// LED_P6x8Char(x+30,y,k+48);
//}
//
//void LED_PrintValueFP(unsigned char x, unsigned char y, unsigned int data, unsigned char num)
//{
// unsigned char m,i,j,k;
// LED_P6x8Char(x, y, '.');
// m= data/1000;
// i = (data%1000)/100;
// j = (data%100)/10;
// k = data%10;
// switch(num)
// {
// case 1: LED_P6x8Char(x+6,y,k+48);
// break;
// case 2: LED_P6x8Char(x+6,y,j+48);
// LED_P6x8Char(x+12,y,k+48);
// break;
// case 3: LED_P6x8Char(x+6,y,i+48);
// LED_P6x8Char(x+12,y,j+48);
// LED_P6x8Char(x+18,y,k+48);
// break;
// case 4: LED_P6x8Char(x+6,y,m+48);
// LED_P6x8Char(x+12,y,i+48);
// LED_P6x8Char(x+18,y,j+48);
// LED_P6x8Char(x+24,y,k+48);
// break;
// }
//}
//
//
//void LED_PrintValueF(unsigned char x, unsigned char y, float data, unsigned char num)
//{
// unsigned char l,m,i,j,k;
// unsigned char databiti = 6;
// unsigned int tempdataui = 0;
// int tempdataii = (int)data;
// long int tempdatalp = (long int)((data - (int)data)*10000);
//
//
// if(data < 0.0000001) LED_P6x8Char(x, y,'-');
// else LED_P6x8Char(x, y,'+');
// if(tempdataii < 0)tempdataii = - tempdataii;
// tempdataui = tempdataii;
// l = tempdataui/10000;
// m= (tempdataui%10000)/1000;
// i = (tempdataui%1000)/100;
// j = (tempdataui%100)/10;
// k = tempdataui%10;
// if (l != 0)
// {
// LED_P6x8Char(x+6,y,l+48);
// LED_P6x8Char(x+12,y,m+48);
// LED_P6x8Char(x+18,y,i+48);
// LED_P6x8Char(x+24,y,j+48);
// LED_P6x8Char(x+30,y,k+48);
// }
// else if(m != 0)
// {
// databiti = 5;
// LED_P6x8Char(x+6,y,m+48);
// LED_P6x8Char(x+12,y,i+48);
// LED_P6x8Char(x+18,y,j+48);
// LED_P6x8Char(x+24,y,k+48);
// }
// else if(i != 0)
// {
// databiti = 4;
// LED_P6x8Char(x+6,y,i+48);
// LED_P6x8Char(x+12,y,j+48);
// LED_P6x8Char(x+18,y,k+48);
// }
// else if(j != 0)
// {
// databiti = 3;
// LED_P6x8Char(x+6,y,j+48);
// LED_P6x8Char(x+12,y,k+48);
// }
// else
// {
// databiti = 2;
// LED_P6x8Char(x+6,y,k+48);
// }
// if(tempdatalp < 0)tempdatalp = - tempdatalp;
// switch(num)
// {
// case 0: break;
// case 1: LED_PrintValueFP(x + databiti * 6, y, (unsigned int)(tempdatalp / 1000),num);break;
// case 2: LED_PrintValueFP(x + databiti * 6, y, (unsigned int)(tempdatalp / 100),num);break;
// case 3: LED_PrintValueFP(x + databiti * 6, y, (unsigned int)(tempdatalp / 10),num);break;
// case 4: LED_PrintValueFP(x + databiti * 6, y, (unsigned int)(tempdatalp),num);break;
// }
//}
void LED_Cursor(unsigned char cursor_column, unsigned char cursor_row)
{
if(cursor_row != 0)
{
if(cursor_column == 1) LED_Set_Pos(0, cursor_row + 2);
else LED_Set_Pos(80 + (cursor_column - 2)*6, cursor_row + 2);
LED_WrDat(0xFF);
LED_WrDat(0xFF);
LED_WrDat(0xFF);
LED_WrDat(0xFF);
LED_WrDat(0xFF);
LED_WrDat(0xFF);
}
}
#if 0
void setup()
{
LEDPIN_Init();
LED_Init();
}
void loop()
{
LED_P8x16Str(23,0,"welcome to");
LED_P8x16Str(40,2,"Smart");
LED_P8x16Str(20,4,"Prototyping");
}
#endif

37
my_src/oled.h Normal file
View File

@ -0,0 +1,37 @@
/*
* oled.h
*
* Created on: May 29, 2017
* Author: wn
*/
#ifndef OLED_H_
#define OLED_H_
/*
* Code found at http://www.instructables.com/id/How-to-use-OLED-display-arduino-module/
* Thank you very much!
* Adapted from Arduino to STM32 HAL by wollud1969
*/
void oledInit(void);
void LED_CLS(void);
void LED_Set_Pos(unsigned char x,unsigned char y);//Set the coordinate
void LED_WrDat(unsigned char data); //Write Data
void LED_P6x8Char(unsigned char x,unsigned char y,unsigned char ch);
void LED_P6x8Str(unsigned char x,unsigned char y,char ch[]);
void LED_P8x16Str(unsigned char x,unsigned char y,char ch[]);
void LED_PrintBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char bmp[]);
void LED_Fill(unsigned char dat);
//void LED_PrintValueC(unsigned char x, unsigned char y,char data);
//void LED_PrintValueI(unsigned char x, unsigned char y, int data);
//void LED_PrintValueF(unsigned char x, unsigned char y, float data, unsigned char num);
void LED_PrintEdge(void);
void LED_Cursor(unsigned char cursor_column, unsigned char cursor_row);
void LED_PrintLine(void);
#endif /* OLED_H_ */

View File

@ -39,6 +39,7 @@
/* USER CODE END Includes */
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi1;
/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
@ -49,6 +50,7 @@
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_SPI1_Init(void);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
@ -77,6 +79,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
my_setup_2();
@ -135,6 +138,29 @@ void SystemClock_Config(void)
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
/* SPI1 init function */
static void MX_SPI1_Init(void)
{
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi1) != HAL_OK)
{
Error_Handler();
}
}
/** Configure pins as
* Analog
* Input
@ -154,12 +180,24 @@ static void MX_GPIO_Init(void)
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
/*Configure GPIO pin : LED_Pin */
GPIO_InitStruct.Pin = LED_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : OLED_DC_Pin OLED_RST_Pin OLED_CS_Pin */
GPIO_InitStruct.Pin = OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
/* USER CODE BEGIN 4 */

View File

@ -38,6 +38,7 @@
/* USER CODE END Includes */
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi1;
/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
@ -48,6 +49,7 @@
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_SPI1_Init(void);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
@ -75,6 +77,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
@ -131,6 +134,29 @@ void SystemClock_Config(void)
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
/* SPI1 init function */
static void MX_SPI1_Init(void)
{
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi1) != HAL_OK)
{
Error_Handler();
}
}
/** Configure pins as
* Analog
* Input
@ -150,12 +176,24 @@ static void MX_GPIO_Init(void)
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
/*Configure GPIO pin : LED_Pin */
GPIO_InitStruct.Pin = LED_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : OLED_DC_Pin OLED_RST_Pin OLED_CS_Pin */
GPIO_InitStruct.Pin = OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
/* USER CODE BEGIN 4 */

View File

@ -77,6 +77,65 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
GPIO_InitTypeDef GPIO_InitStruct;
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspInit 0 */
/* USER CODE END SPI1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI1_CLK_ENABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN SPI1_MspInit 1 */
/* USER CODE END SPI1_MspInit 1 */
}
}
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspDeInit 0 */
/* USER CODE END SPI1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_SPI1_CLK_DISABLE();
/**SPI1 GPIO Configuration
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
}
/* USER CODE BEGIN SPI1_MspDeInit 1 */
/* USER CODE END SPI1_MspDeInit 1 */
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */

View File

@ -0,0 +1,674 @@
/**
******************************************************************************
* @file stm32f1xx_hal_spi.h
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @brief Header file of SPI HAL module.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F1xx_HAL_SPI_H
#define __STM32F1xx_HAL_SPI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal_def.h"
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
/** @addtogroup SPI
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup SPI_Exported_Types SPI Exported Types
* @{
*/
/**
* @brief SPI Configuration Structure definition
*/
typedef struct
{
uint32_t Mode; /*!< Specifies the SPI operating mode.
This parameter can be a value of @ref SPI_mode */
uint32_t Direction; /*!< Specifies the SPI Directional mode state.
This parameter can be a value of @ref SPI_Direction_mode */
uint32_t DataSize; /*!< Specifies the SPI data size.
This parameter can be a value of @ref SPI_data_size */
uint32_t CLKPolarity; /*!< Specifies the serial clock steady state.
This parameter can be a value of @ref SPI_Clock_Polarity */
uint32_t CLKPhase; /*!< Specifies the clock active edge for the bit capture.
This parameter can be a value of @ref SPI_Clock_Phase */
uint32_t NSS; /*!< Specifies whether the NSS signal is managed by
hardware (NSS pin) or by software using the SSI bit.
This parameter can be a value of @ref SPI_Slave_Select_management */
uint32_t BaudRatePrescaler; /*!< Specifies the Baud Rate prescaler value which will be
used to configure the transmit and receive SCK clock.
This parameter can be a value of @ref SPI_BaudRate_Prescaler
@note The communication clock is derived from the master
clock. The slave clock does not need to be set */
uint32_t FirstBit; /*!< Specifies whether data transfers start from MSB or LSB bit.
This parameter can be a value of @ref SPI_MSB_LSB_transmission */
uint32_t TIMode; /*!< Specifies if the TI mode is enabled or not.
This parameter can be a value of @ref SPI_TI_mode */
uint32_t CRCCalculation; /*!< Specifies if the CRC calculation is enabled or not.
This parameter can be a value of @ref SPI_CRC_Calculation */
uint32_t CRCPolynomial; /*!< Specifies the polynomial used for the CRC calculation.
This parameter must be a number between Min_Data = 0 and Max_Data = 65535 */
}SPI_InitTypeDef;
/**
* @brief HAL SPI State structure definition
*/
typedef enum
{
HAL_SPI_STATE_RESET = 0x00, /*!< SPI not yet initialized or disabled */
HAL_SPI_STATE_READY = 0x01, /*!< SPI initialized and ready for use */
HAL_SPI_STATE_BUSY = 0x02, /*!< SPI process is ongoing */
HAL_SPI_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
HAL_SPI_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
HAL_SPI_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
HAL_SPI_STATE_ERROR = 0x03 /*!< SPI error state */
}HAL_SPI_StateTypeDef;
/**
* @brief SPI handle Structure definition
*/
typedef struct __SPI_HandleTypeDef
{
SPI_TypeDef *Instance; /*!< SPI registers base address */
SPI_InitTypeDef Init; /*!< SPI communication parameters */
uint8_t *pTxBuffPtr; /*!< Pointer to SPI Tx transfer Buffer */
uint16_t TxXferSize; /*!< SPI Tx transfer size */
uint16_t TxXferCount; /*!< SPI Tx Transfer Counter */
uint8_t *pRxBuffPtr; /*!< Pointer to SPI Rx transfer Buffer */
uint16_t RxXferSize; /*!< SPI Rx transfer size */
uint16_t RxXferCount; /*!< SPI Rx Transfer Counter */
DMA_HandleTypeDef *hdmatx; /*!< SPI Tx DMA handle parameters */
DMA_HandleTypeDef *hdmarx; /*!< SPI Rx DMA handle parameters */
void (*RxISR)(struct __SPI_HandleTypeDef * hspi); /*!< function pointer on Rx ISR */
void (*TxISR)(struct __SPI_HandleTypeDef * hspi); /*!< function pointer on Tx ISR */
HAL_LockTypeDef Lock; /*!< SPI locking object */
__IO HAL_SPI_StateTypeDef State; /*!< SPI communication state */
__IO uint32_t ErrorCode; /*!< SPI Error code */
}SPI_HandleTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup SPI_Exported_Constants SPI Exported Constants
* @{
*/
/** @defgroup SPI_Error_Codes SPI Error Codes
* @{
*/
#define HAL_SPI_ERROR_NONE ((uint32_t)0x00) /*!< No error */
#define HAL_SPI_ERROR_MODF ((uint32_t)0x01) /*!< MODF error */
#define HAL_SPI_ERROR_CRC ((uint32_t)0x02) /*!< CRC error */
#define HAL_SPI_ERROR_OVR ((uint32_t)0x04) /*!< OVR error */
#define HAL_SPI_ERROR_DMA ((uint32_t)0x08) /*!< DMA transfer error */
#define HAL_SPI_ERROR_FLAG ((uint32_t)0x10) /*!< Flag: RXNE,TXE, BSY */
/**
* @}
*/
/** @defgroup SPI_mode SPI mode
* @{
*/
#define SPI_MODE_SLAVE ((uint32_t)0x00000000)
#define SPI_MODE_MASTER (SPI_CR1_MSTR | SPI_CR1_SSI)
/**
* @}
*/
/** @defgroup SPI_Direction_mode SPI Direction mode
* @{
*/
#define SPI_DIRECTION_2LINES ((uint32_t)0x00000000)
#define SPI_DIRECTION_2LINES_RXONLY SPI_CR1_RXONLY
#define SPI_DIRECTION_1LINE SPI_CR1_BIDIMODE
/**
* @}
*/
/** @defgroup SPI_data_size SPI data size
* @{
*/
#define SPI_DATASIZE_8BIT ((uint32_t)0x00000000)
#define SPI_DATASIZE_16BIT SPI_CR1_DFF
/**
* @}
*/
/** @defgroup SPI_Clock_Polarity SPI Clock Polarity
* @{
*/
#define SPI_POLARITY_LOW ((uint32_t)0x00000000)
#define SPI_POLARITY_HIGH SPI_CR1_CPOL
/**
* @}
*/
/** @defgroup SPI_Clock_Phase SPI Clock Phase
* @{
*/
#define SPI_PHASE_1EDGE ((uint32_t)0x00000000)
#define SPI_PHASE_2EDGE SPI_CR1_CPHA
/**
* @}
*/
/** @defgroup SPI_Slave_Select_management SPI Slave Select management
* @{
*/
#define SPI_NSS_SOFT SPI_CR1_SSM
#define SPI_NSS_HARD_INPUT ((uint32_t)0x00000000)
#define SPI_NSS_HARD_OUTPUT ((uint32_t)(SPI_CR2_SSOE << 16))
/**
* @}
*/
/** @defgroup SPI_BaudRate_Prescaler SPI BaudRate Prescaler
* @{
*/
#define SPI_BAUDRATEPRESCALER_2 ((uint32_t)0x00000000)
#define SPI_BAUDRATEPRESCALER_4 ((uint32_t)SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_8 ((uint32_t)SPI_CR1_BR_1)
#define SPI_BAUDRATEPRESCALER_16 ((uint32_t)SPI_CR1_BR_1 | SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_32 ((uint32_t)SPI_CR1_BR_2)
#define SPI_BAUDRATEPRESCALER_64 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_0)
#define SPI_BAUDRATEPRESCALER_128 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_1)
#define SPI_BAUDRATEPRESCALER_256 ((uint32_t)SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0)
/**
* @}
*/
/** @defgroup SPI_MSB_LSB_transmission SPI MSB LSB transmission
* @{
*/
#define SPI_FIRSTBIT_MSB ((uint32_t)0x00000000)
#define SPI_FIRSTBIT_LSB SPI_CR1_LSBFIRST
/**
* @}
*/
/** @defgroup SPI_TI_mode SPI TI mode disable
* @brief SPI TI Mode not supported for STM32F1xx family
* @{
*/
#define SPI_TIMODE_DISABLE ((uint32_t)0x00000000)
/**
* @}
*/
/** @defgroup SPI_CRC_Calculation SPI CRC Calculation
* @{
*/
#define SPI_CRCCALCULATION_DISABLE ((uint32_t)0x00000000)
#define SPI_CRCCALCULATION_ENABLE SPI_CR1_CRCEN
/**
* @}
*/
/** @defgroup SPI_Interrupt_configuration_definition SPI Interrupt configuration definition
* @{
*/
#define SPI_IT_TXE SPI_CR2_TXEIE
#define SPI_IT_RXNE SPI_CR2_RXNEIE
#define SPI_IT_ERR SPI_CR2_ERRIE
/**
* @}
*/
/** @defgroup SPI_Flag_definition SPI Flag definition
* @{
*/
#define SPI_FLAG_RXNE SPI_SR_RXNE
#define SPI_FLAG_TXE SPI_SR_TXE
#define SPI_FLAG_CRCERR SPI_SR_CRCERR
#define SPI_FLAG_MODF SPI_SR_MODF
#define SPI_FLAG_OVR SPI_SR_OVR
#define SPI_FLAG_BSY SPI_SR_BSY
/**
* @}
*/
/**
* @}
*/
/* Private constants ---------------------------------------------------------*/
/** @defgroup SPI_Private_Constants SPI Private Constants
* @{
*/
#define SPI_INVALID_CRC_ERROR 0 /* CRC error wrongly detected */
#define SPI_VALID_CRC_ERROR 1 /* CRC error is true */
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup SPI_Exported_Macros SPI Exported Macros
* @{
*/
/** @brief Reset SPI handle state
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SPI_STATE_RESET)
/** @brief Enable the specified SPI interrupts.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the interrupt source to enable.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval None
*/
#define __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
/** @brief Disable the specified SPI interrupts.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the interrupt source to disable.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval None
*/
#define __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
/** @brief Check if the specified SPI interrupt source is enabled or disabled.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __INTERRUPT__: specifies the SPI interrupt source to check.
* This parameter can be one of the following values:
* @arg SPI_IT_TXE: Tx buffer empty interrupt enable
* @arg SPI_IT_RXNE: RX buffer not empty interrupt enable
* @arg SPI_IT_ERR: Error interrupt enable
* @retval The new state of __IT__ (TRUE or FALSE).
*/
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
/** @brief Check whether the specified SPI flag is set or not.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @param __FLAG__: specifies the flag to check.
* This parameter can be one of the following values:
* @arg SPI_FLAG_RXNE: Receive buffer not empty flag
* @arg SPI_FLAG_TXE: Transmit buffer empty flag
* @arg SPI_FLAG_CRCERR: CRC error flag
* @arg SPI_FLAG_MODF: Mode fault flag
* @arg SPI_FLAG_OVR: Overrun flag
* @arg SPI_FLAG_BSY: Busy flag
* @retval The new state of __FLAG__ (TRUE or FALSE).
*/
#define __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
/** @brief Clear the SPI CRCERR pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_CRCERRFLAG(__HANDLE__) ((__HANDLE__)->Instance->SR = ~(SPI_FLAG_CRCERR))
/** @brief Clear the SPI MODF pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__) \
do{ \
__IO uint32_t tmpreg; \
tmpreg = (__HANDLE__)->Instance->SR; \
tmpreg = CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE); \
UNUSED(tmpreg); \
}while(0)
/** @brief Clear the SPI OVR pending flag.
* @param __HANDLE__: specifies the SPI handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__) \
do{ \
__IO uint32_t tmpreg; \
tmpreg = (__HANDLE__)->Instance->DR; \
tmpreg = (__HANDLE__)->Instance->SR; \
UNUSED(tmpreg); \
}while(0)
/** @brief Enables the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
/** @brief Disables the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define __HAL_SPI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
/**
* @}
*/
/* Private macros -----------------------------------------------------------*/
/** @defgroup SPI_Private_Macros SPI Private Macros
* @{
*/
/** @brief Checks if SPI Mode parameter is in allowed range.
* @param __MODE__: specifies the SPI Mode.
* This parameter can be a value of @ref SPI_mode
* @retval None
*/
#define IS_SPI_MODE(__MODE__) (((__MODE__) == SPI_MODE_SLAVE) || ((__MODE__) == SPI_MODE_MASTER))
/** @brief Checks if SPI Direction Mode parameter is in allowed range.
* @param __MODE__: specifies the SPI Direction Mode.
* This parameter can be a value of @ref SPI_Direction_mode
* @retval None
*/
#define IS_SPI_DIRECTION_MODE(__MODE__) (((__MODE__) == SPI_DIRECTION_2LINES) || \
((__MODE__) == SPI_DIRECTION_2LINES_RXONLY) || \
((__MODE__) == SPI_DIRECTION_1LINE))
/** @brief Checks if SPI Direction Mode parameter is 1 or 2 lines.
* @param __MODE__: specifies the SPI Direction Mode.
* @retval None
*/
#define IS_SPI_DIRECTION_2LINES_OR_1LINE(__MODE__) (((__MODE__) == SPI_DIRECTION_2LINES) || \
((__MODE__) == SPI_DIRECTION_1LINE))
/** @brief Checks if SPI Direction Mode parameter is 2 lines.
* @param __MODE__: specifies the SPI Direction Mode.
* @retval None
*/
#define IS_SPI_DIRECTION_2LINES(__MODE__) ((__MODE__) == SPI_DIRECTION_2LINES)
/** @brief Checks if SPI Data Size parameter is in allowed range.
* @param __DATASIZE__: specifies the SPI Data Size.
* This parameter can be a value of @ref SPI_data_size
* @retval None
*/
#define IS_SPI_DATASIZE(__DATASIZE__) (((__DATASIZE__) == SPI_DATASIZE_16BIT) || \
((__DATASIZE__) == SPI_DATASIZE_8BIT))
/** @brief Checks if SPI Serial clock steady state parameter is in allowed range.
* @param __CPOL__: specifies the SPI serial clock steady state.
* This parameter can be a value of @ref SPI_Clock_Polarity
* @retval None
*/
#define IS_SPI_CPOL(__CPOL__) (((__CPOL__) == SPI_POLARITY_LOW) || \
((__CPOL__) == SPI_POLARITY_HIGH))
/** @brief Checks if SPI Clock Phase parameter is in allowed range.
* @param __CPHA__: specifies the SPI Clock Phase.
* This parameter can be a value of @ref SPI_Clock_Phase
* @retval None
*/
#define IS_SPI_CPHA(__CPHA__) (((__CPHA__) == SPI_PHASE_1EDGE) || \
((__CPHA__) == SPI_PHASE_2EDGE))
/** @brief Checks if SPI Slave select parameter is in allowed range.
* @param __NSS__: specifies the SPI Slave Slelect management parameter.
* This parameter can be a value of @ref SPI_Slave_Select_management
* @retval None
*/
#define IS_SPI_NSS(__NSS__) (((__NSS__) == SPI_NSS_SOFT) || \
((__NSS__) == SPI_NSS_HARD_INPUT) || \
((__NSS__) == SPI_NSS_HARD_OUTPUT))
/** @brief Checks if SPI Baudrate prescaler parameter is in allowed range.
* @param __PRESCALER__: specifies the SPI Baudrate prescaler.
* This parameter can be a value of @ref SPI_BaudRate_Prescaler
* @retval None
*/
#define IS_SPI_BAUDRATE_PRESCALER(__PRESCALER__) (((__PRESCALER__) == SPI_BAUDRATEPRESCALER_2) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_4) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_8) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_16) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_32) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_64) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_128) || \
((__PRESCALER__) == SPI_BAUDRATEPRESCALER_256))
/** @brief Checks if SPI MSB LSB transmission parameter is in allowed range.
* @param __BIT__: specifies the SPI MSB LSB transmission (whether data transfer starts from MSB or LSB bit).
* This parameter can be a value of @ref SPI_MSB_LSB_transmission
* @retval None
*/
#define IS_SPI_FIRST_BIT(__BIT__) (((__BIT__) == SPI_FIRSTBIT_MSB) || \
((__BIT__) == SPI_FIRSTBIT_LSB))
/** @brief Checks if SPI TI mode parameter is in allowed range.
* @param __MODE__: specifies the SPI TI mode.
* This parameter can be a value of @ref SPI_TI_mode
* @retval None
*/
#define IS_SPI_TIMODE(__MODE__) ((__MODE__) == SPI_TIMODE_DISABLE)
/** @brief Checks if SPI CRC calculation enabled state is in allowed range.
* @param __CALCULATION__: specifies the SPI CRC calculation enable state.
* This parameter can be a value of @ref SPI_CRC_Calculation
* @retval None
*/
#define IS_SPI_CRC_CALCULATION(__CALCULATION__) (((__CALCULATION__) == SPI_CRCCALCULATION_DISABLE) || \
((__CALCULATION__) == SPI_CRCCALCULATION_ENABLE))
/** @brief Checks if SPI polynomial value to be used for the CRC calculation, is in allowed range.
* @param __POLYNOMIAL__: specifies the SPI polynomial value to be used for the CRC calculation.
* This parameter must be a number between Min_Data = 0 and Max_Data = 65535
* @retval None
*/
#define IS_SPI_CRC_POLYNOMIAL(__POLYNOMIAL__) (((__POLYNOMIAL__) >= 0x1) && ((__POLYNOMIAL__) <= 0xFFFF))
/** @brief Sets the SPI transmit-only mode.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_1LINE_TX(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
/** @brief Sets the SPI receive-only mode.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_1LINE_RX(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
/** @brief Resets the CRC calculation of the SPI.
* @param __HANDLE__: specifies the SPI Handle.
* This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
* @retval None
*/
#define SPI_RESET_CRC(__HANDLE__) do{CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_CRCEN);\
SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_CRCEN);}while(0)
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup SPI_Exported_Functions
* @{
*/
/* Initialization/de-initialization functions **********************************/
/** @addtogroup SPI_Exported_Functions_Group1
* @{
*/
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DeInit (SPI_HandleTypeDef *hspi);
void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi);
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/* I/O operation functions *****************************************************/
/** @addtogroup SPI_Exported_Functions_Group2
* @{
*/
HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
HAL_StatusTypeDef HAL_SPI_DMAPause(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi);
HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi);
void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi);
void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/* Peripheral State and Control functions **************************************/
/** @addtogroup SPI_Exported_Functions_Group3
* @{
*/
HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi);
uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/**
* @}
*/
/* Private functions --------------------------------------------------------*/
/** @addtogroup SPI_Private_Functions
* @{
*/
uint8_t SPI_ISCRCErrorValid(SPI_HandleTypeDef *hspi);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F1xx_HAL_SPI_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,217 @@
/**
******************************************************************************
* @file stm32f1xx_hal_spi_ex.c
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @brief Extended SPI HAL module driver.
*
* This file provides firmware functions to manage the following
* functionalities SPI extension peripheral:
* + Extended Peripheral Control functions
*
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
/** @addtogroup SPI
* @{
*/
#ifdef HAL_SPI_MODULE_ENABLED
/** @defgroup SPI_Private_Variables SPI Private Variables
* @{
*/
/* Variable used to determine if device is impacted by implementation of workaround
related to wrong CRC errors detection on SPI2. Conditions in which this workaround has to be applied, are:
- STM32F101CDE/STM32F103CDE
- Revision ID : Z
- SPI2
- In receive only mode, with CRC calculation enabled, at the end of the CRC reception,
the software needs to check the CRCERR flag. If it is found set, read back the SPI_RXCRC:
+ If the value is 0, the complete data transfer is successful.
+ Otherwise, one or more errors have been detected during the data transfer by CPU or DMA.
If CRCERR is found reset, the complete data transfer is considered successful.
*/
uint8_t uCRCErrorWorkaroundCheck = 0;
/**
* @}
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @addtogroup SPI_Exported_Functions
* @{
*/
/** @addtogroup SPI_Exported_Functions_Group1
*
* @{
*/
/**
* @brief Initializes the SPI according to the specified parameters
* in the SPI_InitTypeDef and create the associated handle.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
* the configuration information for SPI module.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
{
/* Check the SPI handle allocation */
if(hspi == NULL)
{
return HAL_ERROR;
}
/* Check the parameters */
assert_param(IS_SPI_ALL_INSTANCE(hspi->Instance));
assert_param(IS_SPI_MODE(hspi->Init.Mode));
assert_param(IS_SPI_DIRECTION_MODE(hspi->Init.Direction));
assert_param(IS_SPI_DATASIZE(hspi->Init.DataSize));
assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity));
assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase));
assert_param(IS_SPI_NSS(hspi->Init.NSS));
assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit));
assert_param(IS_SPI_TIMODE(hspi->Init.TIMode));
assert_param(IS_SPI_CRC_CALCULATION(hspi->Init.CRCCalculation));
assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial));
if(hspi->State == HAL_SPI_STATE_RESET)
{
/* Init the low level hardware : GPIO, CLOCK, NVIC... */
HAL_SPI_MspInit(hspi);
}
hspi->State = HAL_SPI_STATE_BUSY;
/* Disble the selected SPI peripheral */
__HAL_SPI_DISABLE(hspi);
/*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/
/* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management,
Communication speed, First bit and CRC calculation state */
WRITE_REG(hspi->Instance->CR1, (hspi->Init.Mode | hspi->Init.Direction | hspi->Init.DataSize |
hspi->Init.CLKPolarity | hspi->Init.CLKPhase | (hspi->Init.NSS & SPI_CR1_SSM) |
hspi->Init.BaudRatePrescaler | hspi->Init.FirstBit | hspi->Init.CRCCalculation) );
/* Configure : NSS management */
WRITE_REG(hspi->Instance->CR2, (((hspi->Init.NSS >> 16) & SPI_CR2_SSOE) | hspi->Init.TIMode));
/*---------------------------- SPIx CRCPOLY Configuration ------------------*/
/* Configure : CRC Polynomial */
WRITE_REG(hspi->Instance->CRCPR, hspi->Init.CRCPolynomial);
#if defined (STM32F101x6) || defined (STM32F101xB) || defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F102x6) || defined (STM32F102xB) || defined (STM32F103x6) || defined (STM32F103xB) || defined (STM32F103xE) || defined (STM32F103xG) || defined (STM32F105xC) || defined (STM32F107xC)
/* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */
CLEAR_BIT(hspi->Instance->I2SCFGR, SPI_I2SCFGR_I2SMOD);
#endif
#if defined (STM32F101xE) || defined (STM32F103xE)
/* Check RevisionID value for identifying if Device is Rev Z (0x0001) in order to enable workaround for
CRC errors wrongly detected */
/* Pb is that ES_STM32F10xxCDE also identify an issue in Debug registers access while not in Debug mode.
Revision ID information is only available in Debug mode, so Workaround could not be implemented
to distinguish Rev Z devices (issue present) from more recent version (issue fixed).
So, in case of Revison Z F101 or F103 devices, below variable should be assigned to 1 */
uCRCErrorWorkaroundCheck = 0;
#else
uCRCErrorWorkaroundCheck = 0;
#endif
hspi->ErrorCode = HAL_SPI_ERROR_NONE;
hspi->State = HAL_SPI_STATE_READY;
return HAL_OK;
}
/**
* @}
*/
/**
* @}
*/
/** @addtogroup SPI_Private_Functions
* @{
*/
/**
* @brief Checks if encountered CRC error could be corresponding to wrongly detected errors
* according to SPI instance, Device type, and revision ID.
* @param hspi: pointer to a SPI_HandleTypeDef structure that contains
* the configuration information for SPI module.
* @retval CRC error validity (SPI_INVALID_CRC_ERROR or SPI_VALID_CRC_ERROR).
*/
uint8_t SPI_ISCRCErrorValid(SPI_HandleTypeDef *hspi)
{
#if defined (STM32F101xE) || defined (STM32F103xE)
/* Check how to handle this CRC error (workaround to be applied or not) */
/* If CRC errors could be wrongly detected (issue 2.15.2 in STM32F10xxC/D/E silicon limitations ES (DocID14732 Rev 13) */
if ( (uCRCErrorWorkaroundCheck != 0) && (hspi->Instance == SPI2) )
{
if (hspi->Instance->RXCRCR == 0)
{
return (SPI_INVALID_CRC_ERROR);
}
}
return (SPI_VALID_CRC_ERROR);
#else
return (SPI_VALID_CRC_ERROR);
#endif
}
/**
* @}
*/
#endif /* HAL_SPI_MODULE_ENABLED */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/