STM32學(xué)習(xí)記錄9:STM32F10X_XX宏定義的選擇
[cpp]view plaincopy
- #if!defined(STM32F10X_LD)&&!defined(STM32F10X_MD)&&!defined(STM32F10X_HD)&&!defined(STM32F10X_CL)
- /*#defineSTM32F10X_LD*//*!
- /*#defineSTM32F10X_MD*//*!
- /*#defineSTM32F10X_HD*//*!
- #defineSTM32F10X_CL/*!
- #endif
- /*#defineSTM32F10X_MD*//*!
至于要使用哪個(gè)宏,則需要根據(jù)具體的芯片來(lái)進(jìn)行選擇。那么,這些宏又對(duì)應(yīng)著哪些具體的芯片呢?其實(shí)我們可以在《Reference manual》的第九章中找到答案,如文檔截圖:
這段話的意思很明顯,如果是STM32F105xx和STM32F107xx,是Connectivity Line Devices,則宏定義選擇的是STM32F10X_CL;如果是別的型號(hào),則根據(jù)FLASH的容量來(lái)進(jìn)行選擇??赡芪淖謱?xiě)的有點(diǎn)不太清楚,還是以表格來(lái)說(shuō)明:
宏 | MCU型號(hào) | FLASH大小 |
STM32F10X_LD | STM32F101xx STM32F102xx STM32F103xx | 16 ~ 32 Kbytes |
STM32F10X_MD | STM32F101xx STM32F102xx STM32F103xx | 64 ~ 128 Kbytes |
STM32F10X_HD | STM32F101xx STM32F103xx | 256 ~ 512 Kbytes |
STM32F10X_CL | STM32F105xx STM32F107xx | 忽略 |
這些參數(shù),和MDK的設(shè)備參數(shù)一致,如圖所示:
評(píng)論