เพื่อใช้ an I/O ในการกำหนดค่าที่ให้, ผู้ใช้ต้องดำเนินการดังต่อไปนี้:
• Debug function: หลังจากแต่ละ device reset พินเหล่านี้จะถูกกำหนดเป็น alternate function pins สามารถใช้ได้โดยทันทีโดย
the debugger host
• System function: MCOx pins ต้องถูกกำหนดค่าใน alternate function mode.
• GPIO: กำหนดค่า the desired I/O เป็น output, input or analog ใน the GPIOx_MODER register.
• Peripheral alternate function:
– ต่อ the I/O เข้ากับ the desired AFx ในหนึ่งของ the GPIOx_AFRL or GPIOx_AFRH register.
– เลือกประเภท, pull-up/pull-down and output speed โดยทาง the GPIOx_OTYPER, GPIOx_PUPDR and
GPIOx_OSPEEDER registers, ตามลำดับ.
– กำหนดค่า the desired I/O เป็น an alternate function ใน the GPIOx_MODER register
• Additional functions:
– สำหรับ the ADC and DAC, กำหนดค่า the desired I/O ใน analog mode ใน the GPIOx_MODER register และกำหนด
ค่า the required function ใน the ADC and DAC registers. สำหรับ the additional functions อย่าง RTC_OUT,
RTC_TS, RTC_TAMPx, WKUPx and oscillators, กำนหดค่า the required function ใน the related RTC, PWR and
RCC registers. ฟังชั่นเหล่านี้มี priority เหนือ the configuration ใน the standard GPIO registers. สำหรับรายละเอียด
เกี่ยวกับ I/O ที่ควบคุมโดย the RTC, ดูที่ Section 29.3: RTC functional description บนหน้า 915.
• EVENTOUT
– กำหนดค่า the I/O pin ที่ใช้เพื่อเอ๊าพุท the core EVENTOUT signal โดยการต่อมันเข้ากับ AF15
ดูที่ the “Alternate function mapping” table ใน the device datasheet สำหรับรายละเอียดการแม็ปของ the alternate function I/O pins.