找回密码
 立即注册

使用微信账号登录

只需一步,快速开始

查看: 10|回复: 0

[Nordic] nRF54L15 GPIO 特性(五)

[复制链接]
连续签到天数:1天
签到总天数:8天
签到总奖励:36金币
发表于 6 小时前 | 显示全部楼层 |阅读模式
nRF54L15 进入system off前需要关闭不使用的RAM
#ifdef CONFIG_SOC_NRF54L15_CPUAPP  /* Disable RAM retention in System OFF as it is not utilized by this sample. */  uint32_t ram_sections = 8;  nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false);  nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0,   BIT_MASK(ram_sections), false);#endif sys_poweroff();
4. 将特殊GPIOs 配置为通用 GPIOs4.1 NFC pin 作为通用 GPIO
在NCSv2.8.0,在device tree overlay中修改UICR配置:
&uicr {      nfct-pins-as-gpios;};
添加后,系统启动时会自动擦写、配置UICR.
4.2 RESET PIN 作为通用 GPIO
对于nRF54L15,nRESET是Pin Reset专用pin. 查datasheet上可知,芯片并未为其分配作为通用GPIO口的Port和Pin number,nrf5340也是如此.
对于nrf52系列,可以通过ncs代码将nReset配置为通用GPIO口。其中:
​ nRF52805/52810/52811/52832对应GPIO口P0.21
​ nRF52820/52833/52840对应GPIO口P0.18
拿nrf52840 nreset举例,PSELRESET[0]和PSELREET[1]的值都是PIN=18,PORT=0,CONNECT=0的情况下,P0.18才会作为Reset引脚使用。否则,P0.18作为普通GPIO使用。Reset信号无法映射到其他GPIO。将nrf52的NReset pin配置为通用GPIO只需在devicetree中加如下代码:
&uicr{          /delete-property/ gpio-as-nreset;};
VS Code默认的烧录(west flash 烧录)会将pin reset打开导致程序里面删掉的UICR pin reset失效(相当于写了值到UICR)
4.3 低频晶振引脚XL1 XL2 作为通用 GPIO4.3.1 对于 nrf52840/nrf53,P0.00/P0.01为XL1 XL2
​ a. CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
​ b.devicetree 修改
&gpio1 {    gpio-reserved-ranges = < 0x6 0x1 >, < 0x8 0x3 >, < 0x11 0x7 >;    /*去除XL1,XL2描述,可选项*/    gpio-line-names = "AREF", "A0", "A1", "RTS", "TXD", "CTS", "RXD", "NFC1", "NFC2", "BUTTON1", "BUTTON2", "LED1", "LED2", "LED3", "LED4", "QSPI CS", "RESET", "QSPI CLK", "QSPI DIO0", "QSPI DIO1", "QSPI DIO2", "QSPI DIO3", "BUTTON3", "BUTTON4", "SDA", "SCL", "A2", "A3", "A4", "A5";};
4.3.2 对于nRF54L15,P1.00/P1.01 为XL1 XL2
​ CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
5. 其他外设对GPIO的复用
A. Nordic nRF54L15给外设配置GPIO时,原则上是使用自己域内的IO口,同时需参考datasheet和nRF54L15DK的配置。外设的gpio配置可以自动覆盖(Override)GPIO的原来的输入输出方向、输出值等配置。
[td]
Peripheral
Description
UARTE20/21
Can use any pin on P1. Can connect across power domains to dedicated pins on P2.
SPIMOO
Has dedicated pins on P2. For 32 MHz operation, the pins must be configured usingextra high drive EO/E1 configuration in the DRIVE0/1 fields of the PIN_CNF GPIOregister.
SPIM20/21
Can use any pins on P1; see notes on clock pins. Can be connect across powerdomains to dedicated pins on P2.
SPIS20/21
Can use any pins on P1; see notes on clock pins. Can connect across power domainsto dedicated pins on P2.
TRACE
Has dedicated pins that must be configured using extra high drive EO/E1configuration in the DRIVE0/1 fields of the PIN_CNF GPIO register.
GRTC
Has dedicated pins for clock and PWM output.
TAMPC
Has dedicated pins for active shield input and output.
FLPR
Uses dedicated pins on P2 for emulated peripherals such as QSPI.
RADIO
Uses dedicated pins on P1 for antenna switch control (DFEGPIO for directionfinding).
NFC
Uses dedicated pins as listed in the pin assignments table for the selected device.These pins are configured as NFC antenna pins from reset. To use the pins forDigital 1/0, NFC function must be disabled in the NFCT - Near field communicationtag on page 348 peripheral.
B.peripheral 域(APB10,APB20,APB30)内的串行数据接口外设可以自由使用自己域内通用GPIO口
C. Port2(APB00)上的dedicated pins可以被peripheral 域内的串行数据接口如SPIM/SPIS/UARTE使用,但是仅限于P2内的dedicated Pin(参考Pin Assignment Table),比如:
​ a.Peripheral域内的SPI PSEL.MOSI可以使用P2 MOSI,但不能使用其他P2的其他GPIO
​ b.由于P2上没有TWI 的dedicated pin,所以periperal 区域的TWI不能跨域使用P2 GPIO
D. Nordic54L给外设配置GPIO时,外设时钟有专用GPIO口:
下图中红色GPIO口可用于时钟.


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册  

×
楼主热帖
积分商城 - 让您的金币更有价值!||官方Q群 - 让您的沟通更加及时!
您需要登录后才可以回帖 登录 | 立即注册  

本版积分规则

小黑屋|手机版|我爱蓝牙网 - 52Bluetooth

GMT+8, 2025-9-4 17:11 , Processed in 0.155893 second(s), 12 queries , Gzip On, MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表