Loading...
Searching...
No Matches
periph_cpu.h File Reference

Peripheral CPU definitions for the RP2350. More...

Detailed Description

Peripheral CPU definitions for the RP2350.

Author
Tom Hert git@a.nosp@m.nnsa.nosp@m.nn.eu

Definition in file periph_cpu.h.

#include <inttypes.h>
#include "cpu.h"
#include "core_cm33.h"
#include "RP2350.h"
#include "helpers.h"
#include "gpio_conf.h"
#include "clock_conf.h"
#include "uart_conf.h"
#include "timer_conf.h"
#include "multicore.h"
+ Include dependency graph for periph_cpu.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OSC_DEBUG_PIN_ID   15u
 GPIO Pin ID for oscillator debugging.
 
#define RESET_PLL_SYS   (1u << 14u)
 Reset bit for the system PLL.
 
#define RESET_PADS_BANK0   (1u << 9u)
 Reset bit for the pads bank 0.
 
#define RESET_UART0   (1u << 26u)
 Reset bit for UART0 peripheral.
 
#define RESET_UART1   (1u << 27u)
 Reset bit for UART1 peripheral.
 
#define RESET_IO_BANK0   (1u << 6u)
 Reset bit for the IO bank 0.
 
#define PADS_BANK0_GPIO0_IE_BITS   (1u << 6u)
 Input enable bit for GPIO0 in PADS_BANK0.
 
#define PADS_BANK0_ISO_BITS   (1u << 8u)
 Isolation bits for PADS_BANK0.
 

Functions

void rp2350_init (void)
 Initialize RP2350 specific CPU peripherals that are not architecture specific.
 
static uint32_t * calculate_gpio_pad_register_addr (gpio_t pin)
 Calculate the address of the GPIO pad register for a given pin.
 
static uint32_t calculate_gpio_io_status_register_addr (gpio_t pin)
 Calculate the address of the GPIO IO status register for a given pin.
 
static uint32_t * calculate_gpio_io_ctrl_register_addr (gpio_t pin)
 Calculate the address of the GPIO IO control register for a given pin.
 
#define HAVE_GPIO_T
 Overwrite the default GPIO type to use uint32_t.
 
#define GPIO_PIN(port, pin)
 Macro to create a GPIO pin identifier.
 
#define _u(x)
 This is a define used throughout the pico sdk.
 

Power management configuration

In SLEEP mode the processor enters deep sleep.

If all processors are in deep sleep, only the clocks enabled in CLOCKS->SLEEP_EN0 and CLOCKS->SLEEP_EN1 keep running. All of them are enabled after reset, so that every peripheral keeps working and can wake up the processor.

The DORMANT mode of the RP2350 is not supported yet, as RIOT does not have any wake-up sources for that yet (GPIO interrupt, AON timer).

#define RP2350_PM_SLEEP   (0U)
 processor in deep sleep
 
#define RP2350_PM_IDLE   (1U)
 processor in sleep (wfi)
 
#define PM_NUM_MODES   (2U)
 number of usable low power modes
 

Macro Definition Documentation

◆ _u

#define _u ( x)
Value:
((uint32_t)(x))

This is a define used throughout the pico sdk.

Definition at line 33 of file periph_cpu.h.

◆ GPIO_PIN

#define GPIO_PIN ( port,
pin )
Value:
(((port) & 0) | (pin))

Macro to create a GPIO pin identifier.

Parameters
portThe GPIO port (Currently only GPIO0)
pinThe GPIO pin number

Definition at line 30 of file periph_cpu.h.

◆ HAVE_GPIO_T

#define HAVE_GPIO_T

Overwrite the default GPIO type to use uint32_t.

Definition at line 22 of file periph_cpu.h.

◆ OSC_DEBUG_PIN_ID

#define OSC_DEBUG_PIN_ID   15u

GPIO Pin ID for oscillator debugging.

Definition at line 79 of file periph_cpu.h.

◆ PADS_BANK0_GPIO0_IE_BITS

#define PADS_BANK0_GPIO0_IE_BITS   (1u << 6u)

Input enable bit for GPIO0 in PADS_BANK0.

Definition at line 97 of file periph_cpu.h.

◆ PADS_BANK0_ISO_BITS

#define PADS_BANK0_ISO_BITS   (1u << 8u)

Isolation bits for PADS_BANK0.

Definition at line 100 of file periph_cpu.h.

◆ PM_NUM_MODES

#define PM_NUM_MODES   (2U)

number of usable low power modes

Definition at line 75 of file periph_cpu.h.

◆ RESET_IO_BANK0

#define RESET_IO_BANK0   (1u << 6u)

Reset bit for the IO bank 0.

Definition at line 94 of file periph_cpu.h.

◆ RESET_PADS_BANK0

#define RESET_PADS_BANK0   (1u << 9u)

Reset bit for the pads bank 0.

Definition at line 85 of file periph_cpu.h.

◆ RESET_PLL_SYS

#define RESET_PLL_SYS   (1u << 14u)

Reset bit for the system PLL.

Definition at line 82 of file periph_cpu.h.

◆ RESET_UART0

#define RESET_UART0   (1u << 26u)

Reset bit for UART0 peripheral.

Definition at line 88 of file periph_cpu.h.

◆ RESET_UART1

#define RESET_UART1   (1u << 27u)

Reset bit for UART1 peripheral.

Definition at line 91 of file periph_cpu.h.

◆ RP2350_PM_IDLE

#define RP2350_PM_IDLE   (1U)

processor in sleep (wfi)

Definition at line 74 of file periph_cpu.h.

◆ RP2350_PM_SLEEP

#define RP2350_PM_SLEEP   (0U)

processor in deep sleep

Definition at line 73 of file periph_cpu.h.

Function Documentation

◆ calculate_gpio_io_ctrl_register_addr()

static uint32_t * calculate_gpio_io_ctrl_register_addr ( gpio_t pin)
inlinestatic

Calculate the address of the GPIO IO control register for a given pin.

Parameters
pinThe GPIO pin number
Returns
The address of the GPIO IO control register for the given pin

Definition at line 137 of file periph_cpu.h.

◆ calculate_gpio_io_status_register_addr()

static uint32_t calculate_gpio_io_status_register_addr ( gpio_t pin)
static

Calculate the address of the GPIO IO status register for a given pin.

Parameters
pinThe GPIO pin number
Returns
The address of the GPIO IO status register for the given pin

Definition at line 126 of file periph_cpu.h.

◆ calculate_gpio_pad_register_addr()

static uint32_t * calculate_gpio_pad_register_addr ( gpio_t pin)
inlinestatic

Calculate the address of the GPIO pad register for a given pin.

Parameters
[in]pinThe GPIO pin number
Returns
The address of the GPIO pad register for the given pin

Definition at line 113 of file periph_cpu.h.