STM32F1 HAL

Started by tha, June 14, 2022, 09:22:55 AM

Previous topic - Next topic

tha

3.2.2 Initialization and configuration structure
structures เหล่านี้ถูกกำหนดใน the generic driver header file เมื่อเป็นเรื่องปกติสำหรับทุก part numbers.  เมื่อพวกมันสามารถเปลี่ยนจาก one part number ไปอีกตัวหนึ่ง, the structures ถูกกำหนดใน the extension header file สำหรับแต่ละ part number.

Note: The config structure ถูกใช้เพื่อกำหนดค่าเริ่มต้น the sub-modules or sub-instances. ดูตัวอย่างข้างล่าง:

tha

3.2.3 Specific process structures
The specific process structures ถูกใช้สำหรับ specific process (common APIs). พวกมันถูกกำหนดใน the generic driver header file.
Example:

tha

3.3 API classification

The HAL APIs ถูกแบ่งออกเป็นสามประเภท:
•   Generic APIs: common generic APIs นำมาใช้กับทุก STM32 devices. APIs เหล่านี้จึงมีอยู่ใน the generic HAL driver files
     ของทุก STM32 microcontrollers.


tha

•   Extension APIs:
    ชุดของ API นี้ถูกแบ่งลงในสองประเภทย่อย :
    –   Family specific APIs: APIs นำมาใช้กับ a given family. พวกมันถูกวางอยู่ใน the extension HAL driver file (ดูตัวอย่างข้าง
         ล่างที่เกี่ยวข้องกับ the ADC).

    –   Device part number specific APIs: APIs เหล่านี้ถูกจัดให้มีใช้ใน the extension file และไม่ถูกจำกัดโดย specific define
         statements ที่สัมพันธ์กับ a given part number.

Note: The data structure ที่สัมพันธ์กับ the specific APIs ไม่ถูกจำกัดโดย the device part number define statement. มันถูก
         วางอยู่ใน the corresponding extension header C file.

tha

ตารางต่อไปนี้สรุปรวมที่ตั้งของประเภทต่างๆของ HAL APIs ใน the driver files.

1. ในบางกรณี, การจัดให้มีใช้สำหรับ a specific device part number อาจเปลี่ยนแปลง. ในกรณีนี้ the generic API ถูกประกาศเป็น weak function ใน the extension file. The API ถูกจัดให้มีใช้อีกครั้งเพื่อเขียนทับ the default function.

Note: Family specific APIs สัมพันธ์กับ a given family เท่านั้น. นี้หมายความว่าถ้า a specific API ถูกจัดให้มีใช้ใน another family, และ the arguments ของ family หลังนี้แตกต่างกัน, additional structures and arguments อาจจำเป็นต้องถูกเพิ่ม.

Note: The IRQ handlers ถูกใช้สำหรับ common and family specific processes.

tha

3.4 Devices supported by HAL drivers


tha


tha