STM32F7 6 General-purpose I/Os (GPIO)

Started by tha, October 25, 2022, 02:48:57 PM

Previous topic - Next topic

tha

6.4.7 GPIO port bit set/reset register (GPIOx_BSRR) (x = A to K)

Address offset: 0x18
Reset value: 0x0000 0000



Bits 31:16 BR[15:0]: Port x reset I/O pin y (y = 15 to 0)
     บิตเหล่านี้เขียนได้เพียงอย่างเดียว. การอ่านไปยังบิตเหล่านี้จะส่งคืนค่า 0x0000.
     0: ไม่มี action บน the corresponding ODRx bit
     1: จะรีเซ็ต the corresponding ODRx bit
  Note: ถ้าทั้ง BSx and BRx ถูกเซ็ต, BSx มี priority.

Bits 15:0 BS[15:0]: Port x set I/O pin y (y = 15 to 0)
     บิตเหล่านี้เขียนได้เพียงอย่างเดียว. การอ่านไปยังบิตเหล่านี้จะส่งคืนค่า 0x0000.
     0: ไม่มี action บน the corresponding ODRx bit
     1: จะเซ็ต the corresponding ODRx bit

tha

6.4.8 GPIO port configuration lock register (GPIOx_LCKR) (x = A to K)

register นี้ถูกใช้เพื่อล็อค the configuration ของ the port bits เมื่อ a correct write sequence ถูกนำมาใช้กับ bit 16 (LCKK). ค่าของ bits [15:0] ถูกใช้เพื่อล็อค the configuration ของ the GPIO. ในระหว่าง the write sequence, ค่าของ LCKR[15:0] ต้องไม่เปลี่ยน. เมื่อ the LOCK sequence ถูกนำมาใช้บน a port bit แล้ว, ค่าของ port bit นี้ไม่สามารถถูกแก้ไขได้อีกต่อไปจนกระทั่ง the next MCU reset or peripheral reset.

Note: A specific write sequence ถูกใช้เพื่อเขียนไปยัง the GPIOx_LCKR register. เฉพาะ word access (32-bit long)       
         ถูกอนุญาตให้ในระหว่าง locking sequence นี้.


แต่ละ lock bit จะแช่แข็ง a specific configuration register (control and alternate function registers).

Address offset: 0x1C
Reset value: 0x0000 0000



Bits 31:17 Reserved, must be kept at reset value.

Bit 16 LCKK: Lock key
     บิตนี้สามารถถูกอ่านได้ตลอดเวลา. มันสามารถถูกแก้ไขได้เฉพาะการใช้ the lock key write sequence.
     0: Port configuration lock key ไม่ทำงาน
     1: Port configuration lock key ทำงาน. The GPIOx_LCKR register ถูกล็อคจนกระทั่ง the next MCU reset หรือ
         peripheral reset.

     LOCK key write sequence:
     WR LCKR[16] = '1' + LCKR[15:0]
     WR LCKR[16] = '0' + LCKR[15:0]
     WR LCKR[16] = '1' + LCKR[15:0]
     RD LCKR
     RD LCKR[16] = '1' (read operation นี้เป็นทางเลือกแต่มันจะยืนยันได้ว่า the lock ทำงาน)

Note: ในระหว่าง the LOCK key write sequence, ค่าของ LCK[15:0] ต้องไม่เปลี่ยน.
           error ใดๆใน the lock sequence จะละทิ้ง the lock.
           หลังจาก the first lock sequence บนบิตใดๆของ the port, read access ใดบน the LCKK bit จะส่งคืนกลับ '1' จนกระทั่ง
           the next MCU reset หรือ peripheral reset.

Bits 15:0 LCK[15:0]: Port x lock I/O pin y (y = 15 to 0)
     บิตเหล่านี้ถูกอ่าน/เขียนได้แต่สามารถถูกเขียนเฉพาะเมื่อ the LCKK bit เป็น '0.
     0: Port configuration ไม่ถูกล็อค
     1: Port configuration ถูกล็อค

tha

6.4.9 GPIO alternate function low register (GPIOx_AFRL) (x = A to K)

Address offset: 0x20
Reset value: 0x0000 0000



Bits 31:0 AFR[7:0][3:0]: Alternate function selection for port x I/O pin y (y = 7 to 0)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า alternate function I/Os.
     0000: AF0
     0001: AF1
     0010: AF2
     0011: AF3
     0100: AF4
     0101: AF5
     0110: AF6
     0111: AF7
     1000: AF8
     1001: AF9
     1010: AF10
     1011: AF11
     1100: AF12
     1101: AF13
     1110: AF14
     1111: AF15


tha

6.4.10 GPIO alternate function high register (GPIOx_AFRH) (x = A to J)

Address offset: 0x24
Reset value: 0x0000 0000



Bits 31:0 AFR[15:8][3:0]: Alternate function selection for port x I/O pin y (y = 15 to 8)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า alternate function I/Os.
     0000: AF0
     0001: AF1
     0010: AF2
     0011: AF3
     0100: AF4
     0101: AF5
     0110: AF6
     0111: AF7
     1000: AF8
     1001: AF9
     1010: AF10
     1011: AF11
     1100: AF12
     1101: AF13
     1110: AF14
     1111: AF15

tha

6.4.11 GPIO register map

The following table ให้ the GPIO register map and reset values.