mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-08 14:43:04 +08:00
768 files changed
+421149
-797
No files matched your search
@@ -130,6 +130,7 @@ jobs:
|
||||
- {RTT_BSP: "at32/at32f403a-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "at32/at32f407-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "smartfusion2", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "raspberry-pico", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
|
||||
@@ -24,6 +24,7 @@ documentation/html
|
||||
*.d
|
||||
tools/kconfig-frontends/kconfig-mconf
|
||||
packages
|
||||
dist
|
||||
cconfig.h
|
||||
GPUCache
|
||||
|
||||
|
||||
@@ -114,8 +114,16 @@ CONFIG_DFS_FILESYSTEM_TYPES_MAX=2
|
||||
CONFIG_DFS_FD_MAX=16
|
||||
# CONFIG_RT_USING_DFS_MNTTABLE is not set
|
||||
# CONFIG_RT_USING_DFS_ELMFAT is not set
|
||||
# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set
|
||||
# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set
|
||||
# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set
|
||||
# CONFIG_RT_DFS_ELM_USE_LFN_3 is not set
|
||||
# CONFIG_RT_DFS_ELM_LFN_UNICODE_0 is not set
|
||||
# CONFIG_RT_DFS_ELM_LFN_UNICODE_1 is not set
|
||||
# CONFIG_RT_DFS_ELM_LFN_UNICODE_2 is not set
|
||||
# CONFIG_RT_DFS_ELM_LFN_UNICODE_3 is not set
|
||||
# CONFIG_RT_USING_DFS_DEVFS is not set
|
||||
CONFIG_RT_USING_DFS_ROMFS=y
|
||||
# CONFIG_RT_USING_DFS_ROMFS is not set
|
||||
# CONFIG_RT_USING_DFS_RAMFS is not set
|
||||
# CONFIG_RT_USING_DFS_UFFS is not set
|
||||
# CONFIG_RT_USING_DFS_JFFS2 is not set
|
||||
@@ -145,10 +153,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI is not set
|
||||
# CONFIG_RT_USING_WDT is not set
|
||||
CONFIG_RT_USING_AUDIO=y
|
||||
CONFIG_RT_AUDIO_REPLAY_MP_BLOCK_SIZE=1024
|
||||
CONFIG_RT_AUDIO_REPLAY_MP_BLOCK_COUNT=2
|
||||
CONFIG_RT_AUDIO_RECORD_PIPE_SIZE=512
|
||||
# CONFIG_RT_USING_AUDIO is not set
|
||||
# CONFIG_RT_USING_SENSOR is not set
|
||||
# CONFIG_RT_USING_TOUCH is not set
|
||||
# CONFIG_RT_USING_HWCRYPTO is not set
|
||||
@@ -328,6 +333,8 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_RDB is not set
|
||||
# CONFIG_PKG_USING_QRCODE is not set
|
||||
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
|
||||
# CONFIG_PKG_USING_ULOG_FILE is not set
|
||||
# CONFIG_PKG_USING_LOGMGR is not set
|
||||
# CONFIG_PKG_USING_ADBD is not set
|
||||
# CONFIG_PKG_USING_COREMARK is not set
|
||||
# CONFIG_PKG_USING_DHRYSTONE is not set
|
||||
@@ -343,6 +350,8 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_CPU_USAGE is not set
|
||||
# CONFIG_PKG_USING_GBK2UTF8 is not set
|
||||
# CONFIG_PKG_USING_VCONSOLE is not set
|
||||
# CONFIG_PKG_USING_KDB is not set
|
||||
# CONFIG_PKG_USING_WAMR is not set
|
||||
|
||||
#
|
||||
# system packages
|
||||
@@ -381,6 +390,11 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_UC_MODBUS is not set
|
||||
# CONFIG_PKG_USING_PPOOL is not set
|
||||
# CONFIG_PKG_USING_OPENAMP is not set
|
||||
# CONFIG_PKG_USING_RT_PRINTF is not set
|
||||
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
|
||||
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
|
||||
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
|
||||
# CONFIG_PKG_USING_QFPLIB_M3 is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -389,6 +403,7 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
|
||||
# CONFIG_PKG_USING_SHT2X is not set
|
||||
# CONFIG_PKG_USING_SHT3X is not set
|
||||
# CONFIG_PKG_USING_AS7341 is not set
|
||||
# CONFIG_PKG_USING_STM32_SDIO is not set
|
||||
# CONFIG_PKG_USING_ICM20608 is not set
|
||||
# CONFIG_PKG_USING_U8G2 is not set
|
||||
@@ -441,6 +456,7 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_NES is not set
|
||||
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
|
||||
# CONFIG_PKG_USING_VDEVICE is not set
|
||||
# CONFIG_PKG_USING_SGM706 is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -490,6 +506,7 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_TETRIS is not set
|
||||
# CONFIG_PKG_USING_LWGPS is not set
|
||||
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
|
||||
# CONFIG_PKG_USING_STATE_MACHINE is not set
|
||||
|
||||
#
|
||||
# Hardware Drivers Config
|
||||
@@ -499,13 +516,17 @@ CONFIG_RT_USING_LIBC=y
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
CONFIG_BSP_USING_USB_TO_USART=y
|
||||
CONFIG_BSP_USING_AUDIO=y
|
||||
CONFIG_BSP_USING_AUDIO_PLAY=y
|
||||
# CONFIG_BSP_USING_AUDIO is not set
|
||||
# CONFIG_BSP_USING_SDCARD is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
#
|
||||
CONFIG_BSP_USING_UART0=y
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -12,7 +12,7 @@
|
||||
|
||||
## 开发板介绍
|
||||
|
||||
ab32vg1-prougen 是 中科蓝讯(Bluetrum) 推出的一款基于 RISC-V 内核的开发板,最高主频为 120Mhz,该开发板芯片为 AB5301A。
|
||||
ab32vg1-prougen 是 中科蓝讯(Bluetrum) 推出的一款基于 RISC-V 内核的开发板,最高主频为 120Mhz,该开发板芯片为 AB32VG1。
|
||||
|
||||
开发板外观如下图所示:
|
||||
|
||||
@@ -20,7 +20,7 @@ ab32vg1-prougen 是 中科蓝讯(Bluetrum) 推出的一款基于 RISC-V 内核
|
||||
|
||||
该开发板常用 **板载资源** 如下:
|
||||
|
||||
- MCU:AB5301A,主频 120MHz,可超频至 192MHz,4Mbit FLASH ,192KB RAM。
|
||||
- MCU:AB32VG1,主频 120MHz,可超频至 192MHz,8Mbit FLASH ,192KB RAM。
|
||||
- 常用外设
|
||||
- LED: RGB灯
|
||||
- 按键: 3 个, USER(s2,s3) and RESET(s1)
|
||||
@@ -33,19 +33,20 @@ ab32vg1-prougen 是 中科蓝讯(Bluetrum) 推出的一款基于 RISC-V 内核
|
||||
| **板载外设** | **支持情况** | **备注** |
|
||||
| :----------- | :----------: | :---------- |
|
||||
| USB 转串口 | 支持 | |
|
||||
| SD卡 | 即将支持 | |
|
||||
| SD卡 | 支持 | |
|
||||
| IRDA | 即将支持 | |
|
||||
| 音频接口 | 即将支持 | |
|
||||
| 音频接口 | 支持 | |
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
| GPIO | 支持 | PA PB PE PF |
|
||||
| UART | 支持 | UART0/1/2 |
|
||||
| SDIO | 即将支持 | |
|
||||
| SDIO | 支持 | |
|
||||
| ADC | 即将支持 | |
|
||||
| SPI | 即将支持 | |
|
||||
| I2C | 即将支持 | 软件 I2C |
|
||||
| SPI | 即将支持 | 软件 SPI |
|
||||
| I2C | 支持 | 软件 I2C |
|
||||
| RTC | 即将支持 | |
|
||||
| WDT | 即将支持 | |
|
||||
| WDT | 支持 | |
|
||||
| FLASH | 即将支持 | |
|
||||
| TIMER | 支持 | |
|
||||
| PWM | 即将支持 | |
|
||||
| USB Device | 暂不支持 | |
|
||||
| USB Host | 暂不支持 | |
|
||||
@@ -73,11 +74,11 @@ ab32vg1-prougen 是 中科蓝讯(Bluetrum) 推出的一款基于 RISC-V 内核
|
||||
|
||||
#### 编译下载
|
||||
|
||||
运行 `scons` 编译得到 `.dcf` 固件,通过 `downloader` 进行下载
|
||||
通过 `RT-Thread Studio` 或者 `scons` 编译得到 `.dcf` 固件,通过 `Downloader` 进行下载
|
||||
|
||||
#### 运行结果
|
||||
|
||||
下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LED 常亮、绿色 LED 会周期性闪烁。
|
||||
下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LED 会周期性闪烁。
|
||||
|
||||
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
|
||||
@@ -1,21 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021/01/21 greedyhao The first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_fs.h>
|
||||
#include "dfs_romfs.h"
|
||||
#ifdef BSP_USING_SDIO
|
||||
|
||||
int mnt_init(void)
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
#include "drv_gpio.h"
|
||||
|
||||
// #define DRV_DEBUG
|
||||
#define DBG_TAG "app.card"
|
||||
#include <rtdbg.h>
|
||||
|
||||
void sd_mount(void *parameter)
|
||||
{
|
||||
if (dfs_mount(RT_NULL, "/", "rom", 0, &(romfs_root)) == 0)
|
||||
while (1)
|
||||
{
|
||||
rt_kprintf("ROM file system initializated!\n");
|
||||
rt_thread_mdelay(500);
|
||||
if(rt_device_find("sd0") != RT_NULL)
|
||||
{
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("sd card mount to '/'");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("sd card mount to '/' failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ab32_sdcard_mount(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
|
||||
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("ROM file system initializate failed!\n");
|
||||
LOG_E("create sd_mount thread err!");
|
||||
}
|
||||
|
||||
return 0;
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_ENV_EXPORT(mnt_init);
|
||||
INIT_APP_EXPORT(ab32_sdcard_mount);
|
||||
#endif
|
||||
@@ -1,17 +0,0 @@
|
||||
/* Generated by mkromfs. Edit with caution. */
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_romfs.h>
|
||||
|
||||
|
||||
|
||||
static const struct romfs_dirent _romfs_root[] = {
|
||||
{ROMFS_DIRENT_FILE, "ab32vg1", RT_NULL, 0}
|
||||
};
|
||||
|
||||
const struct romfs_dirent romfs_root = {
|
||||
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root)/sizeof(_romfs_root[0])
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -19,6 +19,18 @@ menu "Onboard Peripheral Drivers"
|
||||
default y
|
||||
endif
|
||||
|
||||
config BSP_USING_SDCARD
|
||||
bool "Enable SDCARD"
|
||||
select BSP_USING_SDIO
|
||||
default n
|
||||
|
||||
if BSP_USING_SDCARD
|
||||
config SDIO_MAX_FREQ
|
||||
int "sdio max freq"
|
||||
range 0 24000000
|
||||
default 24000000
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
@@ -28,6 +40,62 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default y
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C1
|
||||
comment "Notice: PE3 --> 16; PE2 --> 15"
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "I2C1 scl pin number"
|
||||
range 1 27
|
||||
default 16
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 27
|
||||
default 15
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
bool "Enable Watchdog Timer"
|
||||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM1
|
||||
bool "Enable TIM1"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM2
|
||||
bool "Enable TIM2"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM3
|
||||
bool "Enable TIM3"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM4
|
||||
bool "Enable TIM4"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM5
|
||||
bool "Enable TIM5"
|
||||
default n
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
@@ -34,12 +34,6 @@ SECTIONS
|
||||
} > init
|
||||
|
||||
.ram1 __ram1_vma : {
|
||||
*components*drivers**.o(.text* .rodata*)
|
||||
*device.o(.text*)
|
||||
. = ALIGN(32);
|
||||
} > ram1 AT > flash
|
||||
|
||||
.rti : {
|
||||
. = ALIGN(4);
|
||||
/* section information for initial */
|
||||
__rt_init_start = .;
|
||||
@@ -56,19 +50,38 @@ SECTIONS
|
||||
KEEP(*(VSymTab))
|
||||
__vsymtab_end = .;
|
||||
|
||||
. = ALIGN(32);
|
||||
. = ALIGN(4);
|
||||
PROVIDE(__ctors_start__ = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE(__ctors_end__ = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
*components*drivers**.o (.text*)
|
||||
*components.o (.text*)
|
||||
*idle.o (.text*)
|
||||
*object.o (.text*)
|
||||
*scheduler.o (.text*)
|
||||
} > ram1 AT > flash
|
||||
|
||||
.comm : {
|
||||
.comm __comm_vma : {
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.vector))
|
||||
EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *romfs.o *lib_a**.o) *(.text*)
|
||||
EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *dfs*filesystems**.o
|
||||
*romfs.o *lib_a**.o *divdi3.o *moddi3.o *divdf3.o *muldf3.o *eqtf2.o *getf2.o
|
||||
*letf2.o *multf3.o *subtf3.o *fixtfsi.o *floatsitf.o *extenddftf2.o
|
||||
*trunctfdf2.o *_clzsi2.o *cp-demangle.o *unwind*.o) *(.text)
|
||||
*finsh*shell.o (.text*)
|
||||
EXCLUDE_FILE (*components*libc**.o *romfs.o *lib_a**.o) *(.rodata*)
|
||||
*(.srodata*)
|
||||
*(.text.unlikely)
|
||||
*(.text.startup)
|
||||
EXCLUDE_FILE (*components*libc**.o *dfs*filesystems**.o *romfs.o *lib_a**.o
|
||||
*cp-demangle.o *divdf3.o *muldf3.o *multf3.o *unwind*.o *_clz.o) *(.rodata)
|
||||
*(.rodata.name)
|
||||
EXCLUDE_FILE(*lib_a**.o *cp-demangle.o *cp-demangle.o) *(.rodata.str1.4)
|
||||
EXCLUDE_FILE(*lib_a**.o *unwind*.o) *(.srodata)
|
||||
*(.rela*)
|
||||
*(.data*)
|
||||
*(.sdata*)
|
||||
. = ALIGN(512);
|
||||
*(.sdata*)
|
||||
} > comm AT > flash
|
||||
|
||||
.bss (NOLOAD):
|
||||
@@ -98,6 +111,7 @@ SECTIONS
|
||||
.flash : {
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
*(.srodata*)
|
||||
. = ALIGN(512);
|
||||
} > flash
|
||||
}
|
||||
@@ -107,4 +121,4 @@ __bank_size = SIZEOF(.flash);
|
||||
__comm_lma = LOADADDR(.comm);
|
||||
__comm_size = SIZEOF(.comm);
|
||||
__ram1_lma = LOADADDR(.ram1);
|
||||
__ram1_size = SIZEOF(.ram1) + SIZEOF(.rti);
|
||||
__ram1_size = SIZEOF(.ram1);
|
||||
@@ -1,13 +1,10 @@
|
||||
rtthread.siz:
|
||||
riscv64-unknown-elf-size --format=berkeley "rtthread.elf"
|
||||
all2: all
|
||||
sh ../pre_build.sh
|
||||
riscv32-elf-xmaker -b rtthread.xm
|
||||
riscv32-elf-xmaker -b download.xm
|
||||
|
||||
|
||||
clean2:
|
||||
-$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS)
|
||||
-$(RM) $(OBJS) *.elf
|
||||
-@echo ' '
|
||||
|
||||
|
||||
*.elf: $(wildcard D:/Softwares/RT-ThreadStudio/workspace/ab32vg1/link.lds)
|
||||
@@ -77,7 +77,6 @@
|
||||
#define DFS_FILESYSTEMS_MAX 2
|
||||
#define DFS_FILESYSTEM_TYPES_MAX 2
|
||||
#define DFS_FD_MAX 16
|
||||
#define RT_USING_DFS_ROMFS
|
||||
|
||||
/* Device Drivers */
|
||||
|
||||
@@ -86,10 +85,6 @@
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_SERIAL_RB_BUFSZ 64
|
||||
#define RT_USING_PIN
|
||||
#define RT_USING_AUDIO
|
||||
#define RT_AUDIO_REPLAY_MP_BLOCK_SIZE 1024
|
||||
#define RT_AUDIO_REPLAY_MP_BLOCK_COUNT 2
|
||||
#define RT_AUDIO_RECORD_PIPE_SIZE 512
|
||||
|
||||
/* Using USB */
|
||||
|
||||
@@ -169,8 +164,6 @@
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_USB_TO_USART
|
||||
#define BSP_USING_AUDIO
|
||||
#define BSP_USING_AUDIO_PLAY
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = []
|
||||
CPPPATH = [cwd]
|
||||
path = [cwd]
|
||||
path += [cwd + '/config']
|
||||
|
||||
if GetDepend('RT_USING_PIN'):
|
||||
src += ['drv_gpio.c']
|
||||
@@ -12,7 +13,19 @@ if GetDepend('RT_USING_PIN'):
|
||||
if GetDepend('RT_USING_SERIAL'):
|
||||
src += ['drv_usart.c']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
|
||||
if GetDepend('RT_USING_SDIO'):
|
||||
src += ['drv_sdio.c']
|
||||
|
||||
if GetDepend('RT_USING_I2C'):
|
||||
src += ['drv_soft_i2c.c']
|
||||
|
||||
if GetDepend('RT_USING_WDT'):
|
||||
src += ['drv_wdt.c']
|
||||
|
||||
if GetDepend('RT_USING_HWTIMER'):
|
||||
src += ['drv_hwtimer.c']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
|
||||
|
||||
objs = [group]
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021/01/18 greedyhao The first version
|
||||
*/
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-22 greedyhao first version
|
||||
*/
|
||||
|
||||
#ifndef __TIM_CONFIG_H__
|
||||
#define __TIM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TIM_DEV_INFO_CONFIG
|
||||
#define TIM_DEV_INFO_CONFIG \
|
||||
{ \
|
||||
.maxfreq = 1000000, \
|
||||
.minfreq = 3000, \
|
||||
.maxcnt = 0xFFFFFFFF, \
|
||||
.cntmode = HWTIMER_CNTMODE_UP, \
|
||||
}
|
||||
#endif /* TIM_DEV_INFO_CONFIG */
|
||||
|
||||
#ifdef BSP_USING_TIM1
|
||||
#ifndef TIM1_CONFIG
|
||||
#define TIM1_CONFIG \
|
||||
{ \
|
||||
.tim_handle = TIM1_BASE, \
|
||||
.tim_irqn = IRQ_TMR1_VECTOR, \
|
||||
.name = "timer1", \
|
||||
}
|
||||
#endif /* TIM1_CONFIG */
|
||||
#endif /* BSP_USING_TIM1 */
|
||||
|
||||
#ifdef BSP_USING_TIM2
|
||||
#ifndef TIM2_CONFIG
|
||||
#define TIM2_CONFIG \
|
||||
{ \
|
||||
.tim_handle = TIM2_BASE, \
|
||||
.tim_irqn = IRQ_TMR2_4_5_VECTOR, \
|
||||
.name = "timer2", \
|
||||
}
|
||||
#endif /* TIM1_CONFIG */
|
||||
#endif /* BSP_USING_TIM2 */
|
||||
|
||||
#ifdef BSP_USING_TIM3
|
||||
#ifndef TIM3_CONFIG
|
||||
#define TIM3_CONFIG \
|
||||
{ \
|
||||
.tim_handle = TIM3_BASE, \
|
||||
.tim_irqn = IRQ_IRRX_VECTOR, \
|
||||
.name = "timer3", \
|
||||
}
|
||||
#endif /* TIM1_CONFIG */
|
||||
#endif /* BSP_USING_TIM3 */
|
||||
|
||||
#ifdef BSP_USING_TIM4
|
||||
#ifndef TIM4_CONFIG
|
||||
#define TIM4_CONFIG \
|
||||
{ \
|
||||
.tim_handle = TIM4_BASE, \
|
||||
.tim_irqn = IRQ_TMR2_4_5_VECTOR, \
|
||||
.name = "timer4", \
|
||||
}
|
||||
#endif /* TIM1_CONFIG */
|
||||
#endif /* BSP_USING_TIM4 */
|
||||
|
||||
#ifdef BSP_USING_TIM5
|
||||
#ifndef TIM5_CONFIG
|
||||
#define TIM5_CONFIG \
|
||||
{ \
|
||||
.tim_handle = TIM5_BASE, \
|
||||
.tim_irqn = IRQ_TMR2_4_5_VECTOR, \
|
||||
.name = "timer5", \
|
||||
}
|
||||
#endif /* TIM1_CONFIG */
|
||||
#endif /* BSP_USING_TIM5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TIM_CONFIG_H__ */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-11-30 greedyhao first version
|
||||
*/
|
||||
|
||||
#ifndef DEV_SDIO_H__
|
||||
#define DEV_SDIO_H__
|
||||
|
||||
#include "drv_common.h"
|
||||
#include "board.h"
|
||||
#include "drivers/mmcsd_core.h"
|
||||
#include "drivers/sdio.h"
|
||||
|
||||
#define SDIO_BUFF_SIZE 1024
|
||||
#define SDIO_ALIGN_LEN 32
|
||||
|
||||
#ifndef SDIO_MAX_FREQ
|
||||
#define SDIO_MAX_FREQ (1000000)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_BASE_ADDRESS
|
||||
#define SDIO_BASE_ADDRESS (0x40012800U)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_CLOCK_FREQ
|
||||
#define SDIO_CLOCK_FREQ (48U * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_BUFF_SIZE
|
||||
#define SDIO_BUFF_SIZE (4096)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_ALIGN_LEN
|
||||
#define SDIO_ALIGN_LEN (32)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_MAX_FREQ
|
||||
#define SDIO_MAX_FREQ (24 * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
|
||||
#define HW_SDIO_CON_
|
||||
#define HW_SDIO_CON_CFLAG (0x01u << 12) /*!< 0:send command or received response not finish \
|
||||
1:send command or received response finish */
|
||||
#define HW_SDIO_CON_DFLAG (0x01u << 13) /*!< 0:send or received data not finish \
|
||||
1:send or received data finish */
|
||||
#define HW_SDIO_CON_CCRCE (0x01u << 14) /*!< 0:command crc no error \
|
||||
1:command crc error detected */
|
||||
#define HW_SDIO_CON_NRPS (0x01u << 15) /*!< 0:response received 1:no response received */
|
||||
#define HW_SDIO_CON_DCRCE (0x01u << 16) /*!< 0:read data crc no error \
|
||||
1:read data crc error detected */
|
||||
#define HW_SDIO_CON_CRCS (0x07u << 17) /*!< 101:error transmission \
|
||||
010:non-erroneous transmission \
|
||||
111:flash error */
|
||||
#define HW_SDIO_CON_BUSY (0x01u << 20) /*!< 0:device busy 1:device not busy */
|
||||
|
||||
#define HW_SDIO_ERRORS \
|
||||
(0)
|
||||
|
||||
#define HW_SDIO_POWER_OFF (0x00U)
|
||||
#define HW_SDIO_POWER_UP (0x02U)
|
||||
#define HW_SDIO_POWER_ON (0x03U)
|
||||
|
||||
#define HW_SDIO_FLOW_ENABLE (0x01U << 14)
|
||||
#define HW_SDIO_BUSWIDE_1B (0x00U << 11)
|
||||
#define HW_SDIO_BUSWIDE_4B (0x01U << 11)
|
||||
#define HW_SDIO_BUSWIDE_8B (0x02U << 11)
|
||||
#define HW_SDIO_BYPASS_ENABLE (0x01U << 10)
|
||||
#define HW_SDIO_IDLE_ENABLE (0x01U << 9)
|
||||
#define HW_SDIO_CLK_ENABLE (0x01U << 8)
|
||||
|
||||
#define HW_SDIO_SUSPEND_CMD (0x01U << 11)
|
||||
#define HW_SDIO_CPSM_ENABLE (0x01U << 10)
|
||||
#define HW_SDIO_WAIT_END (0x01U << 9)
|
||||
#define HW_SDIO_WAIT_INT (0x01U << 8)
|
||||
#define HW_SDIO_RESPONSE_NO (0x00U << 6)
|
||||
#define HW_SDIO_RESPONSE_SHORT (0x01U << 6)
|
||||
#define HW_SDIO_RESPONSE_LONG (0x03U << 6)
|
||||
|
||||
#define HW_SDIO_DATA_LEN_MASK (0x01FFFFFFU)
|
||||
|
||||
#define HW_SDIO_IO_ENABLE (0x01U << 11)
|
||||
#define HW_SDIO_RWMOD_CK (0x01U << 10)
|
||||
#define HW_SDIO_RWSTOP_ENABLE (0x01U << 9)
|
||||
#define HW_SDIO_RWSTART_ENABLE (0x01U << 8)
|
||||
#define HW_SDIO_DBLOCKSIZE_1 (0x00U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_2 (0x01U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_4 (0x02U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_8 (0x03U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_16 (0x04U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_32 (0x05U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_64 (0x06U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_128 (0x07U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_256 (0x08U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_512 (0x09U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_1024 (0x0AU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_2048 (0x0BU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_4096 (0x0CU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_8192 (0x0DU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_16384 (0x0EU << 4)
|
||||
#define HW_SDIO_DMA_ENABLE (0x01U << 3)
|
||||
#define HW_SDIO_STREAM_ENABLE (0x01U << 2)
|
||||
#define HW_SDIO_TO_HOST (0x01U << 1)
|
||||
#define HW_SDIO_DPSM_ENABLE (0x01U << 0)
|
||||
|
||||
#define HW_SDIO_DATATIMEOUT (0xF0000000U)
|
||||
|
||||
// struct ab32_sdio
|
||||
// {};
|
||||
|
||||
typedef rt_err_t (*dma_txconfig)(rt_uint32_t *src, int size);
|
||||
typedef rt_err_t (*dma_rxconfig)(rt_uint32_t *dst, int size);
|
||||
typedef rt_uint32_t (*sdio_clk_get)(hal_sfr_t hw_sdio);
|
||||
|
||||
struct ab32_sdio_des
|
||||
{
|
||||
hal_sfr_t hw_sdio;
|
||||
dma_txconfig txconfig;
|
||||
dma_rxconfig rxconfig;
|
||||
sdio_clk_get clk_get;
|
||||
};
|
||||
|
||||
struct ab32_sdio_config
|
||||
{
|
||||
hal_sfr_t instance;
|
||||
// struct dma_config dma_rx, dma_tx;
|
||||
};
|
||||
|
||||
struct ab32_sdio_class
|
||||
{
|
||||
const struct ab32_sdio_config *cfg;
|
||||
struct rt_mmcsd_host host;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-07 greedyhao first version
|
||||
*/
|
||||
|
||||
#ifndef __DRV_I2C__
|
||||
#define __DRV_I2C__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rthw.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
/* ab32 config class */
|
||||
struct ab32_soft_i2c_config
|
||||
{
|
||||
rt_uint8_t scl;
|
||||
rt_uint8_t sda;
|
||||
rt_uint8_t sda_mode;
|
||||
rt_uint8_t scl_mode;
|
||||
const char *bus_name;
|
||||
};
|
||||
|
||||
/* ab32 i2c dirver class */
|
||||
struct ab32_i2c
|
||||
{
|
||||
struct rt_i2c_bit_ops ops;
|
||||
struct rt_i2c_bus_device i2c2_bus;
|
||||
};
|
||||
|
||||
#ifdef BSP_USING_I2C1
|
||||
#define I2C1_BUS_CONFIG \
|
||||
{ \
|
||||
.scl = BSP_I2C1_SCL_PIN, \
|
||||
.sda = BSP_I2C1_SDA_PIN, \
|
||||
.bus_name = "i2c1", \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_I2C2
|
||||
#define I2C2_BUS_CONFIG \
|
||||
{ \
|
||||
.scl = BSP_I2C2_SCL_PIN, \
|
||||
.sda = BSP_I2C2_SDA_PIN, \
|
||||
.bus_name = "i2c2", \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_I2C3
|
||||
#define I2C3_BUS_CONFIG \
|
||||
{ \
|
||||
.scl = BSP_I2C3_SCL_PIN, \
|
||||
.sda = BSP_I2C3_SDA_PIN, \
|
||||
.bus_name = "i2c3", \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_I2C4
|
||||
#define I2C4_BUS_CONFIG \
|
||||
{ \
|
||||
.scl = BSP_I2C4_SCL_PIN, \
|
||||
.sda = BSP_I2C4_SDA_PIN, \
|
||||
.bus_name = "i2c4", \
|
||||
}
|
||||
#endif
|
||||
int rt_hw_i2c_init(void);
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2020, Bluetrum Development Team
|
||||
*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, Bluetrum Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-11-30 greedyhao first version
|
||||
*/
|
||||
|
||||
#include <board.h>
|
||||
|
||||
#ifdef RT_USING_WDT
|
||||
|
||||
// #define DRV_DEBUG
|
||||
#define LOG_TAG "drv.wdt"
|
||||
#include <drv_log.h>
|
||||
|
||||
struct ab32_wdt_obj
|
||||
{
|
||||
rt_watchdog_t watchdog;
|
||||
};
|
||||
static struct ab32_wdt_obj ab32_wdt;
|
||||
static struct rt_watchdog_ops ops;
|
||||
|
||||
static rt_err_t wdt_init(rt_watchdog_t *wdt)
|
||||
{
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t wdt_control(rt_watchdog_t *wdt, int cmd, void *arg)
|
||||
{
|
||||
rt_uint32_t tmp = 0;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
/* feed the watchdog */
|
||||
case RT_DEVICE_CTRL_WDT_KEEPALIVE:
|
||||
WDTCON = 0xa;
|
||||
break;
|
||||
/* set watchdog timeout */
|
||||
case RT_DEVICE_CTRL_WDT_SET_TIMEOUT:
|
||||
if (arg == RT_NULL) {
|
||||
LOG_E("The watchdog timeout argument cannot be NULL!");
|
||||
break;
|
||||
}
|
||||
|
||||
tmp = WDTCON & ~(0x7 << 20);
|
||||
|
||||
switch (*((rt_uint32_t *)arg))
|
||||
{
|
||||
case 0:
|
||||
LOG_I("The watchdog timeout is set to 1ms");
|
||||
tmp |= (0xa << 24) | (0x00 << 20);
|
||||
break;
|
||||
case 1:
|
||||
LOG_I("The watchdog timeout is set to 256ms");
|
||||
tmp |= (0xa << 24) | (0x01 << 20);
|
||||
break;
|
||||
case 2:
|
||||
LOG_I("The watchdog timeout is set to 512ms");
|
||||
tmp |= (0xa << 24) | (0x02 << 20);
|
||||
break;
|
||||
case 3:
|
||||
LOG_I("The watchdog timeout is set to 1024ms");
|
||||
tmp |= (0xa << 24) | (0x03 << 20);
|
||||
break;
|
||||
case 4:
|
||||
LOG_I("The watchdog timeout is set to 2048ms");
|
||||
tmp |= (0xa << 24) | (0x04 << 20);
|
||||
break;
|
||||
case 5:
|
||||
LOG_I("The watchdog timeout is set to 4096ms");
|
||||
tmp |= (0xa << 24) | (0x05 << 20);
|
||||
break;
|
||||
case 6:
|
||||
LOG_I("The watchdog timeout is set to 8192ms");
|
||||
tmp |= (0xa << 24) | (0x06 << 20);
|
||||
break;
|
||||
case 7:
|
||||
LOG_I("The watchdog timeout is set to 16384ms");
|
||||
tmp |= (0xa << 24) | (0x07 << 20);
|
||||
break;
|
||||
default:
|
||||
LOG_W("The watchdog timeout argument range from 0 to 7!");
|
||||
tmp = WDTCON;
|
||||
break;
|
||||
}
|
||||
WDTCON = tmp;
|
||||
LOG_D("WDTCON=%X", WDTCON);
|
||||
break;
|
||||
case RT_DEVICE_CTRL_WDT_GET_TIMEOUT:
|
||||
switch ((WDTCON >> 20) & 0x7)
|
||||
{
|
||||
case 0:
|
||||
LOG_D("The watchdog timeout is set to 1ms");
|
||||
break;
|
||||
case 1:
|
||||
LOG_D("The watchdog timeout is set to 256ms");
|
||||
break;
|
||||
case 2:
|
||||
LOG_D("The watchdog timeout is set to 512ms");
|
||||
break;
|
||||
case 3:
|
||||
LOG_D("The watchdog timeout is set to 1024ms");
|
||||
break;
|
||||
case 4:
|
||||
LOG_D("The watchdog timeout is set to 2048ms");
|
||||
break;
|
||||
case 5:
|
||||
LOG_D("The watchdog timeout is set to 4096ms");
|
||||
break;
|
||||
case 6:
|
||||
LOG_D("The watchdog timeout is set to 8192ms");
|
||||
break;
|
||||
case 7:
|
||||
LOG_D("The watchdog timeout is set to 16384ms");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case RT_DEVICE_CTRL_WDT_START:
|
||||
WDTCON = 0x110;
|
||||
break;
|
||||
default:
|
||||
LOG_W("This command is not supported.");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int rt_wdt_init(void)
|
||||
{
|
||||
ops.init = &wdt_init;
|
||||
ops.control = &wdt_control;
|
||||
ab32_wdt.watchdog.ops = &ops;
|
||||
/* register watchdog device */
|
||||
if (rt_hw_watchdog_register(&ab32_wdt.watchdog, "wdt", RT_DEVICE_FLAG_DEACTIVATE, RT_NULL) != RT_EOK)
|
||||
{
|
||||
LOG_E("wdt device register failed.");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
LOG_D("wdt device register success.");
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_BOARD_EXPORT(rt_wdt_init);
|
||||
|
||||
#endif /* RT_USING_WDT */
|
||||
@@ -13,7 +13,8 @@
|
||||
#define HAL_RCU_MODULE_ENABLED
|
||||
#define HAL_WDT_MODULE_ENABLED
|
||||
// #define HAL_DAC_MODULE_ENABLED
|
||||
// #define HAL_SD_MODULE_ENABLED
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
|
||||
/* Includes */
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
@@ -40,6 +41,10 @@
|
||||
#include "ab32vg1_hal_sd.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "ab32vg1_hal_tim.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#endif
|
||||
@@ -8,35 +8,73 @@
|
||||
#define AB32VG1_HAL_SD_H__
|
||||
|
||||
#include "ab32vg1_hal_def.h"
|
||||
|
||||
struct sd_init
|
||||
{
|
||||
// uint8_t
|
||||
};
|
||||
#include "ab32vg1_ll_sdio.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
struct sd_card_info
|
||||
{
|
||||
uint32_t rca; /*!< Specifies the Relative Card Address */
|
||||
uint8_t type; /*!< Specifies the card type */
|
||||
uint32_t rca; /*!< Specifies the Relative Card Address */
|
||||
uint32_t capacity; /*!< Specifies the capacity of the card */
|
||||
uint8_t abend; /*!< Specifies if the card is abnormal end */
|
||||
uint8_t flag_sdhc; /*!< Specifies if the card is SDHC card */
|
||||
uint8_t type; /*!< Specifies the card type */
|
||||
uint8_t state; /*!< Specifies the card state */
|
||||
uint8_t rw_state; /*!< Specifies the last r/w state of the card */
|
||||
};
|
||||
typedef struct sd_card_info* sd_card_info_t;
|
||||
|
||||
struct sd_cfg
|
||||
{
|
||||
uint16_t go_ready_retry;
|
||||
uint8_t identification_retry;
|
||||
uint8_t rw_retry;
|
||||
uint8_t rw_init_retry;
|
||||
uint8_t stop_retry;
|
||||
uint8_t rw_need_stop;
|
||||
};
|
||||
|
||||
struct sd_handle
|
||||
{
|
||||
hal_sfr_t instance;
|
||||
struct sd_init init;
|
||||
struct sdio_init init;
|
||||
struct sd_card_info sdcard;
|
||||
struct sd_cfg cfg;
|
||||
};
|
||||
typedef struct sd_handle* sd_handle_t;
|
||||
|
||||
#define SD0N (0x00u)
|
||||
#define SD0N (0x00u)
|
||||
|
||||
#define CARD_V1 (0x01u)
|
||||
#define CARD_V2 (0x02u)
|
||||
#define CARD_MMC (0x03u)
|
||||
// #define CARD_SDSC (0x00u)
|
||||
// #define CARD_SDHC (0x01u)
|
||||
// #define CARD_SECURED (0x03u)
|
||||
|
||||
enum
|
||||
{
|
||||
CARD_INVAL = 0x00,
|
||||
CARD_V1,
|
||||
CARD_V2,
|
||||
CARD_MMC
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HAL_SD_RW_STATE_IDLE = 0x00,
|
||||
HAL_SD_RW_STATE_READ,
|
||||
HAL_SD_RW_STATE_WRITE,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HAL_SD_STATE_RESET = 0x00,
|
||||
HAL_SD_STATE_NEW,
|
||||
HAL_SD_STATE_OK,
|
||||
HAL_SD_STATE_INVAL,
|
||||
};
|
||||
|
||||
#define SDMMC_CHECK_PATTERM (0x000001AAu)
|
||||
|
||||
#define SDMMC0_BASE ((hal_sfr_t)&SD0CON)
|
||||
|
||||
/* Initialization functions */
|
||||
hal_error_t hal_sd_init(sd_handle_t hsd);
|
||||
void hal_sd_deinit(uint32_t sdx);
|
||||
@@ -44,7 +82,7 @@ void hal_sd_mspinit(sd_handle_t hsd);
|
||||
|
||||
hal_error_t hal_sd_control(uint32_t control, uint32_t arg);
|
||||
void hal_sd_write(uint32_t sdx, uint32_t data);
|
||||
uint32_t hal_sd_read(uint32_t sdx);
|
||||
bool hal_sd_read(sd_handle_t hsd, void *buf, uint32_t lba);
|
||||
// void hal_uart_write_it(uint32_t uartx, uint8_t data);
|
||||
// uint8_t hal_uart_read_it(uint32_t uartx);
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2020, BLUETRUM Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef AB32VG1_HAL_TIM_H__
|
||||
#define AB32VG1_HAL_TIM_H__
|
||||
|
||||
#include "ab32vg1_hal_def.h"
|
||||
|
||||
enum
|
||||
{
|
||||
TMRxCON,
|
||||
TMRxCPND,
|
||||
TMRxCNT,
|
||||
TMRxPR,
|
||||
TMRxCPT,
|
||||
TMRxDUTY0,
|
||||
TMRxDUTY1,
|
||||
TMRxDUTY2
|
||||
};
|
||||
|
||||
#define TIM0_BASE ((hal_sfr_t)&TMR0CON)
|
||||
#define TIM1_BASE ((hal_sfr_t)&TMR1CON)
|
||||
#define TIM2_BASE ((hal_sfr_t)&TMR2CON)
|
||||
#define TIM3_BASE ((hal_sfr_t)&TMR3CON)
|
||||
#define TIM4_BASE ((hal_sfr_t)&TMR4CON)
|
||||
#define TIM5_BASE ((hal_sfr_t)&TMR5CON)
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,28 @@
|
||||
|
||||
struct sdio_init
|
||||
{
|
||||
uint32_t tmp;
|
||||
uint32_t clock_power_save; /*!< Specifies whether SDMMC Clock output is enabled or
|
||||
disabled when the bus is idle. */
|
||||
uint32_t clock_div; /*!< Specifies the clock frequency of the SDMMC controller.
|
||||
This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
|
||||
};
|
||||
typedef struct sdio_init* sdio_init_t;
|
||||
|
||||
#define SDMMC_CLOCK_POWER_SAVE_DISABLE (0x00u)
|
||||
#define SDMMC_CLOCK_POWER_SAVE_ENABLE (0x01u)
|
||||
|
||||
enum
|
||||
{
|
||||
SDxCON = 0, /* [20]:BUSY [19:17]:CRCS [16]:DCRCE [15]:NRPS [1]:Data bus width [0]:SD enable */
|
||||
SDxCPND,
|
||||
SDxBAUD,
|
||||
SDxCMD,
|
||||
SDxARG3,
|
||||
SDxARG2,
|
||||
SDxARG1,
|
||||
SDxARG0,
|
||||
SDxDMAADR,
|
||||
SDxDMACNT,
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -14,8 +14,8 @@ define symbol __ICFEDIT_size_proc_stack__ = 0x0;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x0800;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM_end__];
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM_start__ to __ICFEDIT_region_IROM_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
@@ -31,6 +31,4 @@ if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
|
||||
place in IROM_region { readonly };
|
||||
place in EROM_region { readonly section application_specific_ro };
|
||||
place in IRAM_region { readwrite, block CSTACK, block PROC_STACK, block HEAP };
|
||||
place in ERAM_region { readwrite section application_specific_rw };
|
||||
@@ -14,8 +14,8 @@ define symbol __ICFEDIT_size_proc_stack__ = 0x0;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x0800;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
define memory mem with size = 4G;
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM_end__];
|
||||
define region IROM_region = mem:[from __ICFEDIT_region_IROM_start__ to __ICFEDIT_region_IROM_end__];
|
||||
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
@@ -31,6 +31,4 @@ if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
|
||||
place in IROM_region { readonly };
|
||||
place in EROM_region { readonly section application_specific_ro };
|
||||
place in IRAM_region { readwrite, block CSTACK, block PROC_STACK, block HEAP };
|
||||
place in ERAM_region { readwrite section application_specific_rw };
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,26 @@
|
||||
mainmenu "RT-Thread Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config RTT_DIR
|
||||
string
|
||||
option env="RTT_ROOT"
|
||||
default "../.."
|
||||
|
||||
config PKGS_DIR
|
||||
string
|
||||
option env="PKGS_ROOT"
|
||||
default "packages"
|
||||
|
||||
source "$RTT_DIR/Kconfig"
|
||||
source "$PKGS_DIR/Kconfig"
|
||||
|
||||
config SOC_RP2040
|
||||
bool
|
||||
select ARCH_ARM_CORTEX_M0
|
||||
select RT_USING_COMPONENTS_INIT
|
||||
select RT_USING_USER_MAIN
|
||||
default y
|
||||
@@ -0,0 +1,79 @@
|
||||
# Raspberry PICO
|
||||
|
||||
## Introduction
|
||||
|
||||
**Raspberry Pi Pico is a low-cost, high-performance microcontroller board with flexible digital interfaces.**
|
||||
|
||||
**Key features include:**
|
||||
|
||||
- RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom
|
||||
- Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz
|
||||
- 264KB of SRAM, and 2MB of on-board Flash memory
|
||||
- Castellated module allows soldering direct to carrier boards
|
||||
- USB 1.1 with device and host support
|
||||
- Low-power sleep and dormant modes
|
||||
|
||||
- Drag-and-drop programming using mass storage over USB
|
||||
- 26 × multi-function GPIO pins
|
||||
- 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels
|
||||
- Accurate clock and timer on-chip
|
||||
- Temperature sensor
|
||||
- Accelerated floating-point libraries on-chip
|
||||
- 8 × Programmable I/O (PIO) state machines for custom peripheral support
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
## Supported compiler
|
||||
|
||||
Support GCC 6 and above compilers.
|
||||
|
||||
## Program firmware
|
||||
|
||||
### Step 1: build
|
||||
|
||||
```
|
||||
scons -c
|
||||
scons
|
||||
```
|
||||
|
||||
**gcc version >= 6.x.x**
|
||||
|
||||
### Step 2: flash
|
||||
|
||||
Run the following command in the linux environment.
|
||||
|
||||
```
|
||||
./libraries/generated/elf2uf2 rtthread-pico.elf rtthread-pico.uf2
|
||||
```
|
||||
|
||||
- Copy the rtthread-pico.uf2 file to the "RPI-RP2" disk
|
||||
- Then led blink.
|
||||
|
||||
## Running Result
|
||||
|
||||
The output information on serial port should be like this:
|
||||
|
||||
```
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.0.3 build Jan 28 2021
|
||||
2006 - 2021 Copyright by rt-thread team
|
||||
Hello, RT-Thread!
|
||||
msh >
|
||||
```
|
||||
|
||||
## Peripheral Condition
|
||||
|
||||
| Drive | Support | Remark |
|
||||
| ----- | ------- | ------ |
|
||||
| UART | Support | UART0 |
|
||||
| GPIO | Support | 0-29 |
|
||||
| I2C | - | - |
|
||||
| RTC | - | - |
|
||||
| SDIO | - | - |
|
||||
| SPI | - | - |
|
||||
| TIMER | - | - |
|
||||
| WDT | - | - |
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
from building import *
|
||||
|
||||
TARGET = 'rtthread-pico.' + rtconfig.TARGET_EXT
|
||||
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
CXX = rtconfig.CXX,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT)
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
@@ -0,0 +1,11 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = os.path.join(str(Dir('#')), 'applications')
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, str(Dir('#'))]
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
#define LED_PIN 25
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rt_kprintf("Hello, RT-Thread!\n");
|
||||
|
||||
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_pin_write(LED_PIN, 1);
|
||||
rt_thread_mdelay(1000);
|
||||
rt_pin_write(LED_PIN, 0);
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "board.h"
|
||||
#include "hardware/structs/systick.h"
|
||||
|
||||
uint8_t heap[1024 * 80];
|
||||
|
||||
void isr_systick(void)
|
||||
{
|
||||
/* enter interrupt */
|
||||
rt_interrupt_enter();
|
||||
|
||||
rt_tick_increase();
|
||||
|
||||
/* leave interrupt */
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
uint32_t systick_config(uint32_t ticks)
|
||||
{
|
||||
if ((ticks - 1UL) > M0PLUS_SYST_RVR_RELOAD_BITS)
|
||||
{
|
||||
return (1UL); /* Reload value impossible */
|
||||
}
|
||||
|
||||
mpu_hw->rvr = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||
mpu_hw->csr = M0PLUS_SYST_CSR_CLKSOURCE_BITS |
|
||||
M0PLUS_SYST_CSR_TICKINT_BITS |
|
||||
M0PLUS_SYST_CSR_ENABLE_BITS; /* Enable SysTick IRQ and SysTick Timer */
|
||||
return (0UL); /* Function successful */
|
||||
}
|
||||
|
||||
void rt_hw_board_init()
|
||||
{
|
||||
/* Configure the SysTick */
|
||||
systick_config(frequency_count_khz(CLOCKS_FC0_SRC_VALUE_ROSC_CLKSRC)*10000/RT_TICK_PER_SECOND);
|
||||
|
||||
rt_system_heap_init(heap, (uint8_t *)heap + sizeof(heap));
|
||||
|
||||
stdio_init_all();
|
||||
rt_hw_uart_init();
|
||||
|
||||
#ifdef RT_USING_CONSOLE
|
||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H__
|
||||
#define __BOARD_H__
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
#include "hardware/pll.h"
|
||||
#include "hardware/clocks.h"
|
||||
#include "hardware/structs/pll.h"
|
||||
#include "hardware/structs/clocks.h"
|
||||
|
||||
#define PICO_SRAM_SIZE 256
|
||||
#define PICO_SRAM_END (0x20000000 + PICO_SRAM_SIZE * 1024)
|
||||
|
||||
extern int __bss_end;
|
||||
#define HEAP_BEGIN (&__bss_end)
|
||||
#define HEAP_END PICO_SRAM_END
|
||||
|
||||
int rt_hw_uart_init(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#include "drv_gpio.h"
|
||||
|
||||
static void pico_pin_mode(struct rt_device *dev, rt_base_t pin, rt_base_t mode)
|
||||
{
|
||||
RT_ASSERT((0 <= pin) && (pin < N_GPIOS));
|
||||
|
||||
gpio_init(pin);
|
||||
switch (mode)
|
||||
{
|
||||
case PIN_MODE_OUTPUT:
|
||||
gpio_set_dir(pin, GPIO_OUT);
|
||||
break;
|
||||
case PIN_MODE_INPUT:
|
||||
gpio_set_dir(pin, GPIO_IN);
|
||||
break;
|
||||
case PIN_MODE_INPUT_PULLUP:
|
||||
gpio_pull_up(pin);
|
||||
break;
|
||||
case PIN_MODE_INPUT_PULLDOWN:
|
||||
gpio_pull_down(pin);
|
||||
break;
|
||||
case PIN_MODE_OUTPUT_OD:
|
||||
gpio_disable_pulls(pin);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void pico_pin_write(struct rt_device *dev, rt_base_t pin, rt_base_t value)
|
||||
{
|
||||
RT_ASSERT((0 <= pin) && (pin < N_GPIOS));
|
||||
gpio_put(pin, value);
|
||||
}
|
||||
|
||||
static int pico_pin_read(struct rt_device *device, rt_base_t pin)
|
||||
{
|
||||
RT_ASSERT((0 <= pin) && (pin < N_GPIOS));
|
||||
return (gpio_get(pin)? PIN_HIGH : PIN_LOW);
|
||||
}
|
||||
|
||||
static const struct rt_pin_ops ops =
|
||||
{
|
||||
pico_pin_mode,
|
||||
pico_pin_write,
|
||||
pico_pin_read,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
};
|
||||
|
||||
int rt_hw_gpio_init(void)
|
||||
{
|
||||
rt_device_pin_register("gpio", &ops, RT_NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_DEVICE_EXPORT(rt_hw_gpio_init);
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#ifndef __DRV_GPIO_H__
|
||||
#define __DRV_GPIO_H__
|
||||
|
||||
#include <rtdevice.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "board.h"
|
||||
|
||||
int rt_hw_gpio_init(void);
|
||||
|
||||
#endif /* __DRV_GPIO_H__ */
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
*/
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include "board.h"
|
||||
#include "drv_uart.h"
|
||||
|
||||
#include "hardware/uart.h"
|
||||
#include "hardware/irq.h"
|
||||
|
||||
#define UART_ID uart0
|
||||
#define BAUD_RATE 115200
|
||||
#define DATA_BITS 8
|
||||
#define STOP_BITS 1
|
||||
#define PARITY UART_PARITY_NONE
|
||||
|
||||
// We are using pins 0 and 1, but see the GPIO function select table in the
|
||||
// datasheet for information on which other pins can be used.
|
||||
#define UART_TX_PIN 0
|
||||
#define UART_RX_PIN 1
|
||||
|
||||
#define PICO_UART_DEVICE(uart) (struct pico_uart_dev *)(uart)
|
||||
|
||||
static struct pico_uart_dev uart0_dev;
|
||||
|
||||
struct pico_uart_dev
|
||||
{
|
||||
struct rt_serial_device parent;
|
||||
rt_uint32_t uart_periph;
|
||||
rt_uint32_t irqno;
|
||||
};
|
||||
|
||||
void pico_uart_isr(void)
|
||||
{
|
||||
rt_interrupt_enter();
|
||||
/* read interrupt status and clear it */
|
||||
if (uart_is_readable(uart0)) /* rx ind */
|
||||
{
|
||||
rt_hw_serial_isr(&uart0_dev.parent, RT_SERIAL_EVENT_RX_IND);
|
||||
}
|
||||
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
/*
|
||||
* UART interface
|
||||
*/
|
||||
static rt_err_t pico_uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
|
||||
{
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t pico_uart_control(struct rt_serial_device *serial, int cmd, void *arg)
|
||||
{
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static int pico_uart_putc(struct rt_serial_device *serial, char c)
|
||||
{
|
||||
uart_putc_raw(uart0, c);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int pico_uart_getc(struct rt_serial_device *serial)
|
||||
{
|
||||
int ch;
|
||||
|
||||
if (uart_is_readable(uart0))
|
||||
{
|
||||
ch = uart_get_hw(uart0)->dr;
|
||||
}
|
||||
else
|
||||
{
|
||||
ch =-1;
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
const static struct rt_uart_ops _uart_ops =
|
||||
{
|
||||
pico_uart_configure,
|
||||
pico_uart_control,
|
||||
pico_uart_putc,
|
||||
pico_uart_getc,
|
||||
RT_NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
* UART Initiation
|
||||
*/
|
||||
int rt_hw_uart_init(void)
|
||||
{
|
||||
rt_err_t ret = RT_EOK;
|
||||
|
||||
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
||||
|
||||
uart_init(UART_ID, 115200);
|
||||
|
||||
// Set the TX and RX pins by using the function select on the GPIO
|
||||
// Set datasheet for more information on function select
|
||||
gpio_set_function(UART_TX_PIN, GPIO_FUNC_UART);
|
||||
gpio_set_function(UART_RX_PIN, GPIO_FUNC_UART);
|
||||
|
||||
// Actually, we want a different speed
|
||||
// The call will return the actual baud rate selected, which will be as close as
|
||||
// possible to that requested
|
||||
uart_set_baudrate(UART_ID, BAUD_RATE);
|
||||
|
||||
// Set UART flow control CTS/RTS, we don't want these, so turn them off
|
||||
uart_set_hw_flow(UART_ID, false, false);
|
||||
|
||||
// Set our data format
|
||||
uart_set_format(UART_ID, DATA_BITS, STOP_BITS, PARITY);
|
||||
|
||||
// Turn off FIFO's - we want to do this character by character
|
||||
uart_set_fifo_enabled(UART_ID, false);
|
||||
|
||||
// Set up a RX interrupt
|
||||
// We need to set up the handler first
|
||||
// Select correct interrupt for the UART we are using
|
||||
int UART_IRQ = UART_ID == uart0 ? UART0_IRQ : UART1_IRQ;
|
||||
|
||||
// And set up and enable the interrupt handlers
|
||||
irq_set_exclusive_handler(UART_IRQ, pico_uart_isr);
|
||||
irq_set_enabled(UART_IRQ, true);
|
||||
|
||||
// Now enable the UART to send interrupts - RX only
|
||||
uart_set_irq_enables(UART_ID, true, false);
|
||||
|
||||
uart0_dev.parent.ops = &_uart_ops;
|
||||
uart0_dev.parent.config = config;
|
||||
|
||||
ret = rt_hw_serial_register(&uart0_dev.parent,
|
||||
"uart0",
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
&uart0_dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
// INIT_DEVICE_EXPORT(rt_hw_uart_init);
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-01-28 flybreak first version
|
||||
*/
|
||||
|
||||
#ifndef __USART_H__
|
||||
#define __USART_H__
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
int rt_hw_uart_init(void);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
|
After Width: | Height: | Size: 412 KiB |
@@ -0,0 +1,118 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
# get current directory
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = Split("""
|
||||
pico-sdk/src/rp2_common/pico_stdlib/stdlib.c
|
||||
pico-sdk/src/rp2_common/hardware_gpio/gpio.c
|
||||
pico-sdk/src/rp2_common/hardware_claim/claim.c
|
||||
pico-sdk/src/rp2_common/hardware_sync/sync.c
|
||||
pico-sdk/src/rp2_common/pico_platform/platform.c
|
||||
pico-sdk/src/rp2_common/hardware_uart/uart.c
|
||||
pico-sdk/src/common/pico_time/time.c
|
||||
pico-sdk/src/common/pico_time/timeout_helper.c
|
||||
pico-sdk/src/rp2_common/hardware_timer/timer.c
|
||||
pico-sdk/src/common/pico_sync/sem.c
|
||||
pico-sdk/src/common/pico_sync/lock_core.c
|
||||
pico-sdk/src/common/pico_sync/mutex.c
|
||||
pico-sdk/src/common/pico_sync/critical_section.c
|
||||
pico-sdk/src/common/pico_util/datetime.c
|
||||
pico-sdk/src/common/pico_util/pheap.c
|
||||
pico-sdk/src/common/pico_util/queue.c
|
||||
pico-sdk/src/rp2_common/pico_runtime/runtime.c
|
||||
pico-sdk/src/rp2_common/hardware_clocks/clocks.c
|
||||
pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c
|
||||
pico-sdk/src/rp2_common/hardware_xosc/xosc.c
|
||||
pico-sdk/src/rp2_common/hardware_pll/pll.c
|
||||
pico-sdk/src/rp2_common/hardware_vreg/vreg.c
|
||||
pico-sdk/src/rp2_common/hardware_irq/irq.c
|
||||
pico-sdk/src/rp2_common/pico_printf/printf.c
|
||||
pico-sdk/src/rp2_common/pico_bootrom/bootrom.c
|
||||
pico-sdk/src/rp2_common/pico_double/double_init_rom.c
|
||||
pico-sdk/src/rp2_common/pico_double/double_math.c
|
||||
pico-sdk/src/rp2_common/pico_float/float_aeabi.S
|
||||
pico-sdk/src/rp2_common/pico_float/float_init_rom.c
|
||||
pico-sdk/src/rp2_common/pico_float/float_math.c
|
||||
pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c
|
||||
pico-sdk/src/rp2_common/pico_standard_link/binary_info.c
|
||||
pico-sdk/src/rp2_common/pico_stdio/stdio.c
|
||||
pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c
|
||||
pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp
|
||||
pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S
|
||||
pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S
|
||||
pico-sdk/src/rp2_common/pico_divider/divider.S
|
||||
pico-sdk/src/rp2_common/pico_double/double_aeabi.S
|
||||
pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S
|
||||
pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S
|
||||
pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S
|
||||
pico-sdk/src/rp2_common/hardware_divider/divider.S
|
||||
pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S
|
||||
pico-sdk/src/rp2_common/pico_standard_link/crt0.S
|
||||
generated/bs2_default_padded_checksummed.S
|
||||
""")
|
||||
|
||||
path = [
|
||||
cwd + '/pico-sdk/src/common/pico_stdlib/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_gpio/include',
|
||||
cwd + '/pico-sdk/src/common/pico_base/include',
|
||||
cwd + '/pico-sdk/src/boards/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_platform/include',
|
||||
cwd + '/pico-sdk/src/rp2040/hardware_regs/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_base/include',
|
||||
cwd + '/pico-sdk/src/rp2040/hardware_structs/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_claim/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_sync/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_uart/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_divider/include',
|
||||
cwd + '/pico-sdk/src/common/pico_time/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_timer/include',
|
||||
cwd + '/pico-sdk/src/common/pico_sync/include',
|
||||
cwd + '/pico-sdk/src/common/pico_util/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_runtime/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_clocks/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_resets/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_watchdog/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_xosc/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_pll/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_vreg/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/hardware_irq/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_printf/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_bootrom/include',
|
||||
cwd + '/pico-sdk/src/common/pico_bit_ops/include',
|
||||
cwd + '/pico-sdk/src/common/pico_divider/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_double/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_int64_ops/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_float/include',
|
||||
cwd + '/pico-sdk/src/common/pico_binary_info/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_stdio/include',
|
||||
cwd + '/pico-sdk/src/rp2_common/pico_stdio_uart/include',
|
||||
cwd + '/generated/pico_base'
|
||||
]
|
||||
|
||||
CPPDEFINES = [
|
||||
'PICO_NO_BINARY_INFO',
|
||||
'PICO_NO_PROGRAM_INFO',
|
||||
'PICO_BIT_OPS_PICO=1',
|
||||
'PICO_BUILD=1',
|
||||
# 'PICO_CMAKE_BUILD_TYPE=\\"Release\\"',
|
||||
'PICO_COPY_TO_RAM=0',
|
||||
'PICO_CXX_ENABLE_EXCEPTIONS=0',
|
||||
'PICO_DIVIDER_HARDWARE=1',
|
||||
'PICO_DOUBLE_PICO=1',
|
||||
'PICO_FLOAT_PICO=1',
|
||||
'PICO_INT64_OPS_PICO=1',
|
||||
'PICO_MEM_OPS_PICO=1',
|
||||
'PICO_NO_FLASH=0',
|
||||
'PICO_NO_HARDWARE=0',
|
||||
'PICO_ON_DEVICE=1',
|
||||
'PICO_PRINTF_PICO=1',
|
||||
'PICO_STDIO_UART=1',
|
||||
'PICO_USE_BLOCKED_RAM=0'
|
||||
]
|
||||
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,20 @@
|
||||
// Padded and checksummed version of: /home/henson/Documents/rasp-pico/pico/pico-examples/build/pico_sdk/src/rp2_common/boot_stage2/bs2_default.bin
|
||||
|
||||
.section .boot2, "a"
|
||||
|
||||
.byte 0x00, 0xb5, 0x2f, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
|
||||
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
|
||||
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x28, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
|
||||
.byte 0x00, 0xf0, 0x3e, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
|
||||
.byte 0x2e, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
|
||||
.byte 0x26, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x29, 0xf8, 0x01, 0x21
|
||||
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x18, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
|
||||
.byte 0x17, 0x49, 0x18, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
|
||||
.byte 0x19, 0x66, 0x00, 0xf0, 0x0c, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x13, 0x49, 0x11, 0x48, 0x01, 0x60
|
||||
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd1, 0x10, 0x48, 0x00, 0x47, 0x03, 0xb5
|
||||
.byte 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd
|
||||
.byte 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd
|
||||
.byte 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00
|
||||
.byte 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x01, 0x01, 0x00, 0x10
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x27, 0x2a, 0x60
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
|
||||
// DO NOT EDIT!
|
||||
|
||||
|
||||
// based on PICO_CONFIG_HEADER_FILES:
|
||||
|
||||
#include "boards/pico.h"
|
||||
|
||||
// based on PICO_RP2040_CONFIG_HEADER_FILES:
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// ---------------------------------------
|
||||
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
|
||||
// ---------------------------------------
|
||||
|
||||
#ifndef _PICO_VERSION_H
|
||||
#define _PICO_VERSION_H
|
||||
|
||||
#define PICO_SDK_VERSION_MAJOR 1
|
||||
#define PICO_SDK_VERSION_MINOR 0
|
||||
#define PICO_SDK_VERSION_REVISION 0
|
||||
#define PICO_SDK_VERSION_STRING "1.0.0"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
.vscode
|
||||
cmake-*
|
||||
.DS_Store
|
||||
build
|
||||
@@ -0,0 +1,4 @@
|
||||
[submodule "tinyusb"]
|
||||
path = lib/tinyusb
|
||||
url = https://github.com/raspberrypi/tinyusb.git
|
||||
branch = pico
|
||||
@@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
if (NOT TARGET _pico_sdk_inclusion_marker)
|
||||
add_library(_pico_sdk_inclusion_marker INTERFACE)
|
||||
include(pico_sdk_init.cmake)
|
||||
|
||||
project(pico_sdk C CXX ASM)
|
||||
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
if (PICO_DEOPTIMIZED_DEBUG)
|
||||
message("Using fully de-optimized debug build (set PICO_DEOPTIMIZED_DEBUG=0 to optimize)")
|
||||
else()
|
||||
message("Using regular optimized debug build (set PICO_DEOPTIMIZED_DEBUG=1 to de-optimize)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
pico_is_top_level_project(PICO_SDK_TOP_LEVEL_PROJECT)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
if (NOT PICO_SDK_TOP_LEVEL_PROJECT)
|
||||
set(PICO_SDK 1 PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# allow customization
|
||||
add_sub_list_dirs(PICO_SDK_PRE_LIST_DIRS)
|
||||
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(src)
|
||||
|
||||
add_compile_options(-Winline)
|
||||
|
||||
if (PICO_SDK_TOP_LEVEL_PROJECT AND NOT DEFINED PICO_SDK_TESTS_ENABLED)
|
||||
set(PICO_SDK_TESTS_ENABLED 1)
|
||||
endif()
|
||||
if (PICO_SDK_TESTS_ENABLED)
|
||||
add_subdirectory(test)
|
||||
endif ()
|
||||
set(PICO_SDK_TESTS_ENABLED "${PICO_SDK_TESTS_ENABLED}" CACHE INTERNAL "Enable build of SDK tests")
|
||||
|
||||
# allow customization
|
||||
add_sub_list_dirs(PICO_SDK_POST_LIST_DIRS)
|
||||
|
||||
# add docs at the end, as we gather documentation dirs as we go
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Copyright 2020 (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,160 @@
|
||||
# Pico SDK
|
||||
|
||||
The Pico SDK provides the headers, libraries and build system
|
||||
necessary to write programs for the RP2040 based devices such as the Raspberry Pi Pico
|
||||
in C, C++ or assembly language.
|
||||
|
||||
The Pico SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
|
||||
A single program runs on the device at a time and starts with a conventional `main()` method. Standard C/C++ libraries are supported along with
|
||||
C level libraries/APIs for accessing all of the RP2040's hardware include PIO (Programmable IO)
|
||||
|
||||
Additionally the Pico SDK provides higher level libraries for dealing with timers, synchronization, USB (TinyUSB) and multi-core programming
|
||||
along with various utilities.
|
||||
|
||||
The Pico SDK can be used to build anything from simple applications, full fledged runtime environments such as MicroPython, to low level software
|
||||
such as RP2040's on chip bootrom itself.
|
||||
|
||||
Additional libraries/APIs that are not yet ready for inclusion in the Pico SDK can be found in [pico-extras](https://github.com/raspberrypi/pico-extras).
|
||||
|
||||
# Documentation
|
||||
|
||||
See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-started) for information on how to setup your
|
||||
hardware, IDE/environment and for how to build and debug software for the Raspberry Pi Pico
|
||||
and other RP2040 based devices.
|
||||
|
||||
See [Pico C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
|
||||
Pico SDK, exploring more advanced features, and complete PDF based API documentation.
|
||||
|
||||
See [Online Pico SDK API docs](https://rptl.io/pico-doxygen) for HTML based API documentation.
|
||||
|
||||
# Example code
|
||||
|
||||
See [pico-examples](https://github.com/raspberrypi/pico-examples) for example code you can build.
|
||||
|
||||
# Quick-start your own project
|
||||
|
||||
These instructions are exteremly terse, and Linux based only. For detailed steps,
|
||||
instructions for other platforms, and just in general, we recommend you see [Pico C/C++ SDK](https://rptl.io/pico-c-sdk)
|
||||
|
||||
1. Install CMake (at least version 3.12), and GCC cross compiler
|
||||
```
|
||||
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi
|
||||
```
|
||||
1. Set up your project to point to use the Pico SDK
|
||||
|
||||
* By cloning the Pico SDK locally (most common)
|
||||
1. `git clone` this Pico SDK repository
|
||||
1. Copy [pico_sdk_import.cmake](https://github.com/raspberrypi/pico-sdk/blob/master/external/pico_sdk_import.cmake)
|
||||
from the SDK into your project directory
|
||||
2. Set `PICO_SDK_PATH` to the SDK location in your environment, or pass it (`-DPICO_SDK_PATH=`) to cmake later.
|
||||
3. Setup a `CMakeLists.txt` like:
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# initialize the SDK based on PICO_SDK_PATH
|
||||
# note: this must happen before project()
|
||||
include(pico_sdk_import.cmake)
|
||||
|
||||
project(my_project)
|
||||
|
||||
# initialize the Pico SDK
|
||||
pico_sdk_init()
|
||||
|
||||
# rest of your project
|
||||
|
||||
```
|
||||
|
||||
* With Pico SDK as a submodule
|
||||
1. Clone the SDK as a submodule called `pico-sdk`
|
||||
1. Setup a `CMakeLists.txt` like:
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# initialize pico_sdk from submodule
|
||||
# note: this must happen before project()
|
||||
include(pico-sdk/pico_sdk_init.cmake)
|
||||
|
||||
project(my_project)
|
||||
|
||||
# initialize the Pico SDK
|
||||
pico_sdk_init()
|
||||
|
||||
# rest of your project
|
||||
|
||||
```
|
||||
|
||||
* With automatic download from github
|
||||
1. Copy [pico_sdk_import.cmake](https://github.com/raspberrypi/pico-sdk/blob/master/external/pico_sdk_import.cmake)
|
||||
from the SDK into your project directory
|
||||
1. Setup a `CMakeLists.txt` like:
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# initialize pico_sdk from GIT
|
||||
# (note this can come from environment, CMake cache etc)
|
||||
set(PICO_SDK_FETCH_FROM_GIT on)
|
||||
|
||||
# pico_sdk_import.cmake is a single file copied from this SDK
|
||||
# note: this must happen before project()
|
||||
include(pico_sdk_import.cmake)
|
||||
|
||||
project(my_project)
|
||||
|
||||
# initialize the Pico SDK
|
||||
pico_sdk_init()
|
||||
|
||||
# rest of your project
|
||||
|
||||
```
|
||||
|
||||
3. Setup a CMake build directory.
|
||||
For example, if not using an IDE:
|
||||
```
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
```
|
||||
|
||||
4. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Pico C/C++ SDK](https://rptl.io/pico-c-sdk) documentation
|
||||
for more information)
|
||||
|
||||
About the simplest you can do is a single source file (e.g. hello_world.c)
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
int main() {
|
||||
setup_default_uart();
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
And add the following to your `CMakeLists.txt`:
|
||||
|
||||
```cmake
|
||||
add_executable(hello_world
|
||||
hello_world.c
|
||||
)
|
||||
|
||||
# Add pico_stdlib library which aggregates commonly used features
|
||||
target_link_libraries(hello_world pico_stdlib)
|
||||
|
||||
# create map/bin/hex/uf2 file in addition to ELF.
|
||||
pico_add_extra_outputs(hello_world)
|
||||
```
|
||||
|
||||
Note this example uses the default UART for _stdout_;
|
||||
if you want ot use the default USB see the [hello-usb](https://github.com/raspberrypi/pico-examples/tree/master/hello_world/usb) example.
|
||||
|
||||
|
||||
5. Make your target from the build directory you created.
|
||||
```sh
|
||||
$ make hello_world
|
||||
```
|
||||
|
||||
6. You now have `hello_world.elf` to load via a debugger, or `hello_world.uf2` that can be installed and
|
||||
run on your Raspberry Pi Pico via drag and drop.
|
||||
@@ -0,0 +1,4 @@
|
||||
# this is included because toolchain file sets SYSTEM_NAME=PICO
|
||||
|
||||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
||||
set(CMAKE_EXECUTABLE_SUFFIX .elf)
|
||||
@@ -0,0 +1,29 @@
|
||||
# PICO_CMAKE_CONFIG: PICO_PLATFORM, platform to build for e.g. rp2040/host, default=rp2040 or environment value, group=build
|
||||
if (DEFINED ENV{PICO_PLATFORM} AND (NOT PICO_PLATFORM))
|
||||
set(PICO_PLATFORM $ENV{PICO_PLATFORM})
|
||||
message("Using PICO_PLATFORM from environment ('${PICO_PLATFORM}')")
|
||||
else()
|
||||
if (NOT PICO_PLATFORM)
|
||||
set(PICO_PLATFORM "rp2040")
|
||||
pico_message("Defaulting PICO_PLATFORM to ${PICO_PLATFORM} since not specified.")
|
||||
else()
|
||||
message("PICO platform is ${PICO_PLATFORM}.")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, host)")
|
||||
|
||||
# PICO_CMAKE_CONFIG: PICO_CMAKE_RELOAD_PLATFORM_FILE, custom CMake file to use to set up the platform environment, default=none, group=build
|
||||
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE "" CACHE INTERNAL "")
|
||||
set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms" CACHE INTERNAL "")
|
||||
|
||||
if (NOT PICO_CMAKE_PRELOAD_PLATFORM_FILE)
|
||||
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE ${PICO_CMAKE_PRELOAD_PLATFORM_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS "${PICO_CMAKE_PRELOAD_PLATFORM_FILE}")
|
||||
message(FATAL_ERROR "${PICO_CMAKE_PRELOAD_PLATFORM_FILE} does not exist. \
|
||||
Either specify a valid PICO_PLATFORM (or PICO_CMAKE_PRELOAD_PLATFORM_FILE).")
|
||||
endif ()
|
||||
|
||||
include(${PICO_CMAKE_PRELOAD_PLATFORM_FILE})
|
||||
@@ -0,0 +1,44 @@
|
||||
# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_PATH, Path to search for compiler, default=none (i.e. search system paths), group=build
|
||||
# Set your compiler path here if it's not in the PATH environment variable.
|
||||
set(PICO_TOOLCHAIN_PATH "" CACHE INTERNAL "")
|
||||
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Defaulting build type to '${default_build_type}' since not specified.")
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build, options are: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Default")
|
||||
error("Default build type is NOT supported")
|
||||
endif()
|
||||
|
||||
# PICO_CMAKE_CONFIG: PICO_COMPILER, Optionally specifies a different compiler (other than pico_arm_gcc.cmake) - this is not yet fully supported, default=none, group=build
|
||||
# If PICO_COMPILER is specified, set toolchain file to ${PICO_COMPILER}.cmake.
|
||||
if (DEFINED PICO_COMPILER)
|
||||
if (DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
get_filename_component(toolchain "${CMAKE_TOOLCHAIN_FILE}" NAME_WE)
|
||||
if (NOT "${PICO_COMPILER}" STREQUAL "${toolchain}")
|
||||
message(WARNING "CMAKE_TOOLCHAIN_FILE is already defined to ${toolchain}.cmake, you\
|
||||
need to delete cache and reconfigure if you want to switch compiler.")
|
||||
endif ()
|
||||
else ()
|
||||
set(toolchain_dir "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
|
||||
set(toolchain_file "${toolchain_dir}/${PICO_COMPILER}.cmake")
|
||||
if (EXISTS "${toolchain_file}")
|
||||
set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}" CACHE INTERNAL "")
|
||||
else ()
|
||||
# todo improve message
|
||||
message(FATAL_ERROR "Toolchain file \"${PICO_COMPILER}.cmake\" does not exist, please\
|
||||
select one from \"cmake/toolchains\" folder.")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message("PICO compiler is ${PICO_COMPILER}")
|
||||
unset(PICO_COMPILER CACHE)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
function(pico_message param)
|
||||
if (${ARGC} EQUAL 1)
|
||||
message("${param}")
|
||||
return()
|
||||
endif ()
|
||||
|
||||
if (NOT ${ARGC} EQUAL 2)
|
||||
message(FATAL_ERROR "Expect at most 2 arguments")
|
||||
endif ()
|
||||
message("${param}" "${ARGV1}")
|
||||
endfunction()
|
||||
|
||||
macro(assert VAR MSG)
|
||||
if (NOT ${VAR})
|
||||
message(FATAL_ERROR "${MSG}")
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
function(pico_find_in_paths OUT PATHS NAME)
|
||||
foreach(PATH IN LISTS ${PATHS})
|
||||
if (EXISTS ${PATH}/${NAME})
|
||||
get_filename_component(FULLNAME ${PATH}/${NAME} ABSOLUTE)
|
||||
set(${OUT} ${FULLNAME} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${OUT} "" PARENT_SCOPE)
|
||||
endfunction()
|
||||
Whitespace-only changes.
@@ -0,0 +1,7 @@
|
||||
if (NOT (DEFINED PICO_COMPILER OR DEFINED CMAKE_TOOLCHAIN_FILE))
|
||||
pico_message("Defaulting PICO platform compiler to pico_arm_gcc since not specified.")
|
||||
set(PICO_COMPILER "pico_arm_gcc")
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/pico/pico.cmake)
|
||||
@@ -0,0 +1,31 @@
|
||||
# Toolchain file is processed multiple times, however, it cannot access CMake cache on some runs.
|
||||
# We store the search path in an environment variable so that we can always access it.
|
||||
if (NOT "${PICO_TOOLCHAIN_PATH}" STREQUAL "")
|
||||
set(ENV{PICO_TOOLCHAIN_PATH} "${PICO_TOOLCHAIN_PATH}")
|
||||
endif ()
|
||||
|
||||
# Find the compiler executable and store its path in a cache entry ${compiler_path}.
|
||||
# If not found, issue a fatal message and stop processing. PICO_TOOLCHAIN_PATH can be provided from
|
||||
# commandline as additional search path.
|
||||
function(pico_find_compiler compiler_path compiler_exe)
|
||||
# Search user provided path first.
|
||||
find_program(
|
||||
${compiler_path} ${compiler_exe}
|
||||
PATHS ENV PICO_TOOLCHAIN_PATH
|
||||
PATH_SUFFIXES bin
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# If not then search system paths.
|
||||
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
|
||||
if (DEFINED ENV{PICO_TOOLCHAIN_PATH})
|
||||
message(WARNING "PICO_TOOLCHAIN_PATH specified ($ENV{PICO_TOOLCHAIN_PATH}), but ${compiler_exe} not found there")
|
||||
endif()
|
||||
find_program(${compiler_path} ${compiler_exe})
|
||||
endif ()
|
||||
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
|
||||
set(PICO_TOOLCHAIN_PATH "" CACHE PATH "Path to search for compiler.")
|
||||
message(FATAL_ERROR "Compiler '${compiler_exe}' not found, you can specify search path with\
|
||||
\"PICO_TOOLCHAIN_PATH\".")
|
||||
endif ()
|
||||
endfunction()
|
||||
@@ -0,0 +1,53 @@
|
||||
# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED
|
||||
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
|
||||
# i.e. CMake<Lang>Information and whatnot
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
|
||||
|
||||
# include our Platform/pico.cmake
|
||||
set(CMAKE_SYSTEM_NAME PICO)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
|
||||
|
||||
# Find CLANG
|
||||
pico_find_compiler(PICO_COMPILER_CC clang)
|
||||
pico_find_compiler(PICO_COMPILER_CXX clang)
|
||||
#pico_find_compiler(PICO_COMPILER_ASM armasm)
|
||||
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
|
||||
pico_find_compiler(PICO_OBJCOPY llvm-objcopy)
|
||||
pico_find_compiler(PICO_OBJDUMP llvm-objdump)
|
||||
|
||||
# Specify the cross compiler.
|
||||
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
|
||||
set(CMAKE_C_OUTPUT_EXTENSION .o)
|
||||
|
||||
# todo should we be including CMakeASMInformation anyway - i guess that is host side
|
||||
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
|
||||
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
set(CMAKE_INCLUDE_FLAG_ASM "-I")
|
||||
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
|
||||
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
|
||||
|
||||
# Disable compiler checks.
|
||||
set(CMAKE_C_COMPILER_FORCED TRUE)
|
||||
set(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||
|
||||
# Add target system root to cmake find path.
|
||||
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
|
||||
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
|
||||
|
||||
# Look for includes and libraries only in the target system prefix.
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
|
||||
include_directories(/usr/include/newlib)
|
||||
|
||||
# todo move to platform/Generix-xxx
|
||||
set(ARM_CLANG_COMMON_FLAGS " --target=arm-none-eabi -mcpu=cortex-m0plus -mthumb")
|
||||
set(CMAKE_C_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
set(CMAKE_ASM_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED
|
||||
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
|
||||
# i.e. CMake<Lang>Information and whatnot
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
|
||||
|
||||
# include our Platform/PICO.cmake
|
||||
set(CMAKE_SYSTEM_NAME PICO)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
|
||||
|
||||
# Find ARMClang.
|
||||
pico_find_compiler(PICO_COMPILER_CC armclang)
|
||||
pico_find_compiler(PICO_COMPILER_CXX armclang)
|
||||
pico_find_compiler(PICO_COMPILER_ASM armasm)
|
||||
set(PICO_COMPILER_ASM "${PICO_COMPILER_ASM}" CACHE INTERNAL "")
|
||||
pico_find_compiler(PICO_OBJCOPY llvm-objcopy)
|
||||
pico_find_compiler(PICO_OBJDUMP llvm-objdump)
|
||||
|
||||
# Specify the cross compiler.
|
||||
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
|
||||
set(CMAKE_C_OUTPUT_EXTENSION .o)
|
||||
|
||||
# todo should we be including CMakeASMInformation anyway - i guess that is host side
|
||||
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
|
||||
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
set(CMAKE_INCLUDE_FLAG_ASM "-I")
|
||||
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
|
||||
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
|
||||
|
||||
# Disable compiler checks.
|
||||
set(CMAKE_C_COMPILER_FORCED TRUE)
|
||||
set(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||
|
||||
# Add target system root to cmake find path.
|
||||
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
|
||||
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
|
||||
|
||||
# Look for includes and libraries only in the target system prefix.
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
|
||||
# todo move to platform/Generix-xxx
|
||||
set(ARM_CLANG_COMMON_FLAGS " --cpu=Cortex-M0plus")
|
||||
string(APPEND CMAKE_C_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
string(APPEND CMAKE_ASM_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
|
||||
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
|
||||
# i.e. CMake<Lang>Information and whatnot
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
|
||||
|
||||
# include our Platform/PICO.cmake
|
||||
set(CMAKE_SYSTEM_NAME PICO)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
|
||||
|
||||
if (NOT PICO_GCC_TRIPLE)
|
||||
if (DEFINED ENV{PICO_GCC_TRIPLE})
|
||||
set(PICO_GCC_TRIPLE $ENV{PICO_GCC_TRIPLE})
|
||||
message("PICO_GCC_TRIPLE set from environment: $ENV{PICO_GCC_TRIPLE}")
|
||||
else()
|
||||
set(PICO_GCC_TRIPLE arm-none-eabi)
|
||||
message("PICO_GCC_TRIPLE defaulted to arm-none-eabi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find GCC for ARM.
|
||||
pico_find_compiler(PICO_COMPILER_CC ${PICO_GCC_TRIPLE}-gcc)
|
||||
pico_find_compiler(PICO_COMPILER_CXX ${PICO_GCC_TRIPLE}-g++)
|
||||
set(PICO_COMPILER_ASM "${PICO_COMPILER_CC}" CACHE INTERNAL "")
|
||||
pico_find_compiler(PICO_OBJCOPY ${PICO_GCC_TRIPLE}-objcopy)
|
||||
pico_find_compiler(PICO_OBJDUMP ${PICO_GCC_TRIPLE}-objdump)
|
||||
|
||||
# Specify the cross compiler.
|
||||
set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
|
||||
set(CMAKE_C_OUTPUT_EXTENSION .o)
|
||||
|
||||
# todo should we be including CMakeASMInformation anyway - i guess that is host side
|
||||
set(CMAKE_ASM_COMPILER ${PICO_COMPILER_ASM} CACHE FILEPATH "ASM compiler")
|
||||
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
set(CMAKE_INCLUDE_FLAG_ASM "-I")
|
||||
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
|
||||
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
|
||||
|
||||
# Disable compiler checks.
|
||||
set(CMAKE_C_COMPILER_FORCED TRUE)
|
||||
set(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||
|
||||
# Add target system root to cmake find path.
|
||||
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
|
||||
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
|
||||
|
||||
# Look for includes and libraries only in the target system prefix.
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
|
||||
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
|
||||
|
||||
# todo move to platform/Generix-xxx
|
||||
set(ARM_GCC_COMMON_FLAGS " -march=armv6-m -mcpu=cortex-m0plus -mthumb")
|
||||
#set(ARM_GCC_COMMON_FLAGS " -mcpu=cortex-m0plus -mthumb")
|
||||
foreach(LANG IN ITEMS C CXX ASM)
|
||||
set(CMAKE_${LANG}_FLAGS_INIT "${ARM_GCC_COMMON_FLAGS}")
|
||||
if (PICO_DEOPTIMIZED_DEBUG)
|
||||
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
|
||||
else()
|
||||
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
|
||||
endif()
|
||||
set(CMAKE_${LANG}_LINK_FLAGS "-Wl,--build-id=none")
|
||||
endforeach()
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
find_package(Doxygen)
|
||||
if (PICO_SDK_TOP_LEVEL_PROJECT AND ${DOXYGEN_FOUND})
|
||||
set(PICO_BUILD_DOCS_DEFAULT 1)
|
||||
endif()
|
||||
option(PICO_BUILD_DOCS "Build HTML Doxygen docs" ${PICO_BUILD_DOCS_DEFAULT})
|
||||
|
||||
if (DEFINED ENV{PICO_EXAMPLES_PATH} AND NOT PICO_EXAMPLES_PATH)
|
||||
set(PICO_EXAMPLES_PATH $ENV{PICO_EXAMPLES_PATH})
|
||||
message("Using PICO_EXAMPLES_PATH from environment ('${PICO_EXAMPLES_PATH}')")
|
||||
endif()
|
||||
|
||||
if(PICO_BUILD_DOCS)
|
||||
if(NOT DOXYGEN_FOUND)
|
||||
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
if(PICO_EXAMPLES_PATH)
|
||||
get_filename_component(PICO_EXAMPLES_PATH "${PICO_EXAMPLES_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||
if (EXISTS ${PICO_EXAMPLES_PATH})
|
||||
message("Documentation example code will come from ${PICO_EXAMPLES_PATH}")
|
||||
else()
|
||||
message(WARNING "Documentation example code configured to come from ${PICO_EXAMPLES_PATH}, but that path does not exist")
|
||||
endif()
|
||||
add_custom_target(doc-pico-examples)
|
||||
else()
|
||||
ExternalProject_Add(doc-pico-examples
|
||||
GIT_REPOSITORY git@github.com:raspberrypi/pico-examples.git
|
||||
GIT_TAG master
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
ExternalProject_Get_property(doc-pico-examples SOURCE_DIR)
|
||||
ExternalProject_Get_property(doc-pico-examples GIT_REPOSITORY)
|
||||
ExternalProject_Get_property(doc-pico-examples GIT_TAG)
|
||||
set(PICO_EXAMPLES_PATH ${SOURCE_DIR})
|
||||
message("Documentation example code will come from git repo ${GIT_REPOSITORY}, branch ${GIT_TAG}")
|
||||
endif()
|
||||
|
||||
set(DOXY_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
|
||||
set(DOXY_INPUT_DIRS "${PICO_DOXYGEN_PATHS}")
|
||||
set(DOXY_EXCLUDE_DIRS "${PICO_DOXYGEN_EXCLUDE_PATHS}")
|
||||
set(DOXY_EXAMPLE_DIR "${PICO_EXAMPLES_PATH}")
|
||||
|
||||
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
|
||||
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
|
||||
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
|
||||
|
||||
add_custom_target(docs
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen"
|
||||
VERBATIM)
|
||||
|
||||
add_dependencies(docs doc-pico-examples)
|
||||
endif()
|
||||
@@ -0,0 +1,64 @@
|
||||
PROJECT_NAME = "Pico SDK"
|
||||
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
|
||||
|
||||
#STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@
|
||||
STRIP_FROM_PATH = @DOXY_INPUT_DIRS@
|
||||
# @PROJECT_BINARY_DIR@
|
||||
#INPUT = @doxy_main_page@ \
|
||||
# @PROJECT_SOURCE_DIR@ \
|
||||
# @PROJECT_BINARY_DIR@
|
||||
|
||||
FILE_PATTERNS = *.h \
|
||||
*.cpp \
|
||||
*.c \
|
||||
*.S \
|
||||
*.s \
|
||||
*.md
|
||||
|
||||
USE_MDFILE_AS_MAINPAGE = @PROJECT_SOURCE_DIR@/docs/mainpage.md
|
||||
LAYOUT_FILE = @PROJECT_SOURCE_DIR@/docs/DoxygenLayout.xml
|
||||
HTML_FOOTER = @PROJECT_SOURCE_DIR@/docs/footer.html
|
||||
HTML_HEADER = @PROJECT_SOURCE_DIR@/docs/header.html
|
||||
|
||||
PROJECT_BRIEF = "Pico SDK documentation"
|
||||
PROJECT_NUMBER = 1.0
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
# HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/docs/customdoxygen.css
|
||||
HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/docs/normalise.css @PROJECT_SOURCE_DIR@/docs/main.css @PROJECT_SOURCE_DIR@/docs/styles.css
|
||||
HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@/docs/logo-mobile.svg @PROJECT_SOURCE_DIR@/docs/logo.svg @PROJECT_SOURCE_DIR@/docs/search.svg \
|
||||
@PROJECT_SOURCE_DIR@/docs/main.js @PROJECT_SOURCE_DIR@/docs/pico.jpg @PROJECT_SOURCE_DIR@/docs/rp2040.png
|
||||
GENERATE_TREEVIEW = YES # This is needed as it wraps the content area in an HTML tag that we need to use
|
||||
HTML_COLORSTYLE_HUE = 350
|
||||
HTML_COLORSTYLE_SAT = 200
|
||||
HTML_COLORSTYLE_GAMMA = 150
|
||||
GENERATE_LATEX = NO
|
||||
GENERATE_XML = YES
|
||||
GROUP_GRAPHS = NO
|
||||
|
||||
ALIASES += tag=@internal
|
||||
ALIASES += end=@internal
|
||||
|
||||
OUTPUT_DIRECTORY = @DOXY_OUTPUT_DIR@
|
||||
INPUT = @PROJECT_SOURCE_DIR@/docs/index.h @DOXY_INPUT_DIRS@ @PROJECT_SOURCE_DIR@/docs/
|
||||
|
||||
#EXCLUDE = @DOXY_EXCLUDE_DIRS@ @PROJECT_SOURCE_DIR@/src/rp2040
|
||||
EXCLUDE = @DOXY_EXCLUDE_DIRS@
|
||||
RECURSIVE = YES
|
||||
EXAMPLE_PATH = @PICO_EXAMPLES_PATH@
|
||||
|
||||
# This is needed as we have a number of static inline functions that need to be documented.
|
||||
EXTRACT_STATIC = YES
|
||||
|
||||
EXTRACT_ALL = NO
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
#REPEAT_BRIEF = NO
|
||||
|
||||
# Need these next options to ensure that functions with modifiers do not confuse the Doxygen parser.
|
||||
# And any further function modifiers here.
|
||||
MACRO_EXPANSION = YES
|
||||
|
||||
PREDEFINED = __not_in_flash_func(x) \
|
||||
__time_critical_func(x) \
|
||||
__not_in_flash(x)= \
|
||||
__no_inline_not_in_flash(x)= \
|
||||
__attribute__(x)=
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,21 @@
|
||||
## Examples Index {#examples_page}
|
||||
|
||||
This page links to the various example code fragments in this documentation. For more complete examples, please see the pico_examples repository, which contains complete buildable projects.
|
||||
|
||||
- [RTC example](@ref rtc_example)
|
||||
- [UART example](@ref uart_example)
|
||||
- [ADC example](@ref adc_example)
|
||||
- [I2C example](@ref i2c_example)
|
||||
- [Clock example](@ref clock_example)
|
||||
- [Timer example](@ref timer_example)
|
||||
- [Flash programming example](@ref flash_example)
|
||||
- [Watchdog example](@ref watchdog_example)
|
||||
- [Divider example](@ref divider_example)
|
||||
- [PWM example](@ref pwm_example)
|
||||
- [Multicore example](@ref multicore_example)
|
||||
- [Reset example](@ref reset_example)
|
||||
|
||||
|
||||
All examples are "Copyright (c) 2020 Raspberry Pi (Trading) Ltd", and are released under a 3-Clause BSD licence. Briefly, this means you are free to use the example code
|
||||
as long as you retain the copyright notice. Full details on the licence can be found [here](https://opensource.org/licenses/BSD-3-Clause).
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
<script src="main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,61 @@
|
||||
<!-- HTML header for doxygen 1.8.20-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
|
||||
<!-- <link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/> -->
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<div class="navigation-mobile">
|
||||
<div class="logo--mobile">
|
||||
<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
|
||||
</div>
|
||||
<div class="navigation-toggle">
|
||||
<span class="line-1"></span>
|
||||
<span class="line-2">
|
||||
<p>Menu Toggle</p>
|
||||
</span>
|
||||
<span class="line-3"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<div class="logo">
|
||||
<a href="$relpath^index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="navigation-footer">
|
||||
<img src="logo-mobile.svg" alt="Raspberry Pi">
|
||||
<a href="https://www.raspberrypi.org/" target="_blank">By Raspberry Pi (Trading) Ltd</a>
|
||||
</div>
|
||||
<!-- <div class="search">
|
||||
<form>
|
||||
<input type="search" name="search" id="search" placeholder="Search">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
</div> -->
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// Here to organize documentation order
|
||||
|
||||
/**
|
||||
* \defgroup hardware Hardware APIs
|
||||
* This group of libraries provides a thin and efficient C API / abstractions to access the RP2040 hardware without having to read and write
|
||||
* hardware registers directly.
|
||||
* @{
|
||||
* \defgroup hardware_adc hardware_adc
|
||||
* \defgroup hardware_base hardware_base
|
||||
* \defgroup hardware_claim hardware_claim
|
||||
* \defgroup hardware_clocks hardware_clocks
|
||||
* \defgroup hardware_divider hardware_divider
|
||||
* \defgroup hardware_dma hardware_dma
|
||||
* \defgroup hardware_flash hardware_flash
|
||||
* \defgroup hardware_gpio hardware_gpio
|
||||
* \defgroup hardware_i2c hardware_i2c
|
||||
* \defgroup hardware_interp hardware_interp
|
||||
* \defgroup hardware_irq hardware_irq
|
||||
* \defgroup hardware_pio hardware_pio
|
||||
* \defgroup hardware_pll hardware_pll
|
||||
* \defgroup hardware_pwm hardware_pwm
|
||||
* \defgroup hardware_resets hardware_resets
|
||||
* \defgroup hardware_rtc hardware_rtc
|
||||
* \defgroup hardware_spi hardware_spi
|
||||
* \defgroup hardware_sync hardware_sync
|
||||
* \defgroup hardware_timer hardware_timer
|
||||
* \defgroup hardware_uart hardware_uart
|
||||
* \defgroup hardware_vreg hardware_vreg
|
||||
* \defgroup hardware_watchdog hardware_watchdog
|
||||
* \defgroup hardware_xosc hardware_xosc
|
||||
* @}
|
||||
*
|
||||
* \defgroup high_level High Level APIs
|
||||
* This group of libraries provide higher level functionality that isn't hardware related or provides a richer
|
||||
* set of functionality above the basic hardware interfaces
|
||||
* @{
|
||||
* \defgroup pico_multicore pico_multicore
|
||||
* \defgroup pico_stdlib pico_stdlib
|
||||
* \defgroup pico_sync pico_sync
|
||||
* \defgroup pico_time pico_time
|
||||
* \defgroup pico_util pico_util
|
||||
* @}
|
||||
*
|
||||
* \defgroup third_party Third-party Libraries
|
||||
* Third party libraries for implementing high level functionality.
|
||||
* @{
|
||||
* \defgroup tinyusb_device tinyusb_device
|
||||
* \defgroup tinyusb_host tinyusb_host
|
||||
* @}
|
||||
*
|
||||
* \defgroup runtime Runtime Infrastructure
|
||||
* Libraries that are used to provide efficient implementation of certain
|
||||
* language level and C library functions, as well as CMake INTERFACE libraries
|
||||
* abstracting the compilation and link steps in the SDK
|
||||
* @{
|
||||
* \defgroup boot_stage2 boot_stage2
|
||||
* \defgroup pico_base pico_base
|
||||
* \defgroup pico_bit_ops pico_bit_ops
|
||||
* \defgroup pico_bootrom pico_bootrom
|
||||
* \defgroup pico_cxx_options pico_cxx_options
|
||||
* \defgroup pico_divider pico_divider
|
||||
* \defgroup pico_double pico_double
|
||||
* \defgroup pico_float pico_float
|
||||
* \defgroup pico_int64_ops pico_int64_ops
|
||||
* \defgroup pico_malloc pico_malloc
|
||||
* \defgroup pico_mem_ops pico_mem_ops
|
||||
* \defgroup pico_platform pico_platform
|
||||
* \defgroup pico_printf pico_printf
|
||||
* \defgroup pico_runtime pico_runtime
|
||||
* \defgroup pico_stdio pico_stdio
|
||||
* \defgroup pico_standard_link pico_standard_link
|
||||
* @}
|
||||
*
|
||||
* \defgroup misc External API Headers
|
||||
* Headers for interfaces that are shared with code outside of the SDK
|
||||
* @{
|
||||
* \defgroup boot_picoboot boot_picoboot
|
||||
* \defgroup boot_uf2 boot_uf2
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="570" height="720">
|
||||
<path d="m 158.375,1.65625 c -3.6193,0.1123192 -7.51715,1.4493266 -11.9375,4.9375 C 135.61054,2.4174496 125.11041,0.9665612 115.71875,9.46875 101.22489,7.5879922 96.508461,11.469494 92.9375,16 89.754953,15.934135 69.118652,12.72793 59.65625,26.84375 35.874602,24.030329 28.359472,40.831625 36.875,56.5 c -4.856911,7.518955 -9.889503,14.947226 1.46875,29.28125 -4.018006,7.983514 -1.527431,16.64403 7.9375,27.125 -2.497857,11.2226 2.412077,19.14086 11.21875,25.3125 -1.64709,15.35756 14.083505,24.28743 18.78125,27.46875 1.803677,8.94868 5.56291,17.3927 23.53125,22.0625 2.96323,13.3361 13.76206,15.63906 24.21875,18.4375 -34.561929,20.08954 -64.20067,46.52266 -64,111.375 l -5.0625,9.03125 C 15.337882,350.69604 -20.316547,428.16001 35.4375,491.125 c 3.641871,19.70838 9.749589,33.86396 15.1875,49.53125 8.133834,63.13058 61.21763,92.69161 75.21875,96.1875 20.51653,15.62812 42.36818,30.45672 71.9375,40.84375 27.87515,28.74946 58.07388,39.7064 88.4375,39.6875 0.44515,-2.8e-4 0.89853,0.005 1.34375,0 30.36363,0.0189 60.56235,-10.93804 88.4375,-39.6875 29.56932,-10.38703 51.42097,-25.21563 71.9375,-40.84375 14.00112,-3.49589 67.08492,-33.05692 75.21875,-96.1875 5.43791,-15.66729 11.54562,-29.82287 15.1875,-49.53125 55.75404,-62.96499 20.09961,-140.42896 -19.53125,-164.53125 L 513.75,317.5625 c 0.20067,-64.85234 -29.43807,-91.28546 -64,-111.375 10.45669,-2.79844 21.25552,-5.1014 24.21875,-18.4375 17.96834,-4.6698 21.72758,-13.11382 23.53125,-22.0625 4.69775,-3.18132 20.42834,-12.11119 18.78125,-27.46875 8.80668,-6.17164 13.71661,-14.0899 11.21875,-25.3125 9.46494,-10.48097 11.9555,-19.141487 7.9375,-27.125 C 546.79575,71.447226 541.76316,64.018955 536.90625,56.5 545.42178,40.831625 537.90665,24.030329 514.125,26.84375 504.6626,12.72793 484.0263,15.934135 480.84375,16 477.27279,11.469494 472.55636,7.587992 458.0625,9.46875 448.67084,0.96656132 438.17071,2.41745 427.34375,6.59375 414.48455,-3.5536631 405.97149,4.580454 396.25,7.65625 380.67615,2.568472 377.11698,9.5371578 369.46875,12.375 352.4935,8.7869238 347.33315,16.598532 339.1875,24.84375 l -9.46875,-0.1875 c -25.61054,15.093115 -38.33378,45.825501 -42.84375,61.625 -4.51206,-15.801979 -17.20647,-46.534542 -42.8125,-61.625 l -9.46875,0.1875 C 226.4481,16.598532 221.28775,8.7869235 204.3125,12.375 196.66427,9.5371583 193.1051,2.5684729 177.53125,7.65625 c -6.37973,-2.0184911 -12.24667,-6.2144276 -19.15625,-6 z" style="fill:#000000" />
|
||||
<path d="m 107.39184,68.055583 c 67.94767,35.031357 107.44689,63.368967 129.08717,87.504467 -11.08235,44.41759 -68.89638,46.44464 -90.03559,45.19858 4.32842,-2.01474 7.93988,-4.42778 9.22051,-8.13574 -5.30449,-3.76981 -24.11289,-0.39719 -37.24363,-7.77416 5.04407,-1.04499 7.40348,-2.06302 9.76289,-5.78542 -12.40571,-3.9567 -25.76862,-7.36642 -33.627746,-13.92116 4.241253,0.0524 8.201156,0.9488 13.740366,-2.89271 -11.111694,-5.98819 -22.969108,-10.73351 -32.18139,-19.88738 5.745213,-0.14063 11.939452,-0.0568 13.740371,-2.16953 -10.17044,-6.30068 -18.751242,-13.30787 -25.853592,-20.97215 8.039979,0.97052 11.435284,0.13478 13.378782,-1.26556 -7.687795,-7.87419 -17.417559,-14.52319 -22.056911,-24.22644 5.969606,2.057484 11.431249,2.84506 15.36752,-0.180795 -2.612365,-5.893453 -13.805413,-9.369618 -20.248967,-23.141676 6.284359,0.609377 12.949606,1.371108 14.282753,0 C 61.802068,58.517346 56.796919,51.835885 51.887978,44.913906 65.338021,44.714177 85.715734,44.966253 84.792549,43.82914 l -8.31654,-8.497335 c 13.137617,-3.537241 26.580651,0.568164 36.339661,3.615887 4.38186,-3.457681 -0.0776,-7.82998 -5.42383,-12.294015 11.16496,1.490646 21.25382,4.057389 30.37345,7.593362 4.87238,-4.399329 -3.16389,-8.798658 -7.05098,-13.197987 17.24936,3.272568 24.55716,7.87068 31.81981,12.47481 5.26935,-5.050799 0.30166,-9.343299 -3.2543,-13.740371 13.00566,4.817048 19.70478,11.035551 26.75756,17.175463 2.39119,-3.227053 6.07494,-5.592408 1.62715,-13.378781 9.23416,5.322725 16.18926,11.59506 21.33374,18.621817 5.71336,-3.637941 3.40387,-8.613023 3.43509,-13.197987 9.59665,7.806516 15.68687,16.11395 23.14168,24.226443 1.50169,-1.093437 2.81661,-4.80171 3.97747,-10.666867 22.89539,22.211815 55.24591,78.158241 8.31654,100.340861 C 207.95028,109.95728 160.25292,86.016909 107.39184,68.055583 z" style="fill:#75a928" />
|
||||
<path d="M 467.92487,68.055583 C 399.9772,103.08694 360.47798,131.42455 338.8377,155.56005 c 11.08235,44.41759 68.89638,46.44464 90.03559,45.19858 -4.32842,-2.01474 -7.93988,-4.42778 -9.22051,-8.13574 5.30449,-3.76981 24.11289,-0.39719 37.24363,-7.77416 -5.04407,-1.04499 -7.40348,-2.06302 -9.76289,-5.78542 12.40571,-3.9567 25.76862,-7.36642 33.62775,-13.92116 -4.24126,0.0524 -8.20116,0.9488 -13.74037,-2.89271 11.11169,-5.98819 22.96911,-10.73351 32.18139,-19.88738 -5.74521,-0.14063 -11.93945,-0.0568 -13.74037,-2.16953 10.17044,-6.30068 18.75124,-13.30787 25.85359,-20.97215 -8.03998,0.97052 -11.43528,0.13478 -13.37878,-1.26556 7.68779,-7.87419 17.41756,-14.52319 22.05691,-24.22644 -5.96961,2.057484 -11.43125,2.84506 -15.36752,-0.180795 2.61237,-5.893453 13.80541,-9.369618 20.24897,-23.141676 -6.28436,0.609377 -12.94961,1.371108 -14.28276,0 2.92231,-11.888563 7.92746,-18.570024 12.8364,-25.492003 -13.45004,-0.199729 -33.82775,0.05235 -32.90457,-1.084766 l 8.31654,-8.497335 c -13.13762,-3.537241 -26.58065,0.568164 -36.33966,3.615887 -4.38186,-3.457681 0.0776,-7.82998 5.42383,-12.294015 -11.16496,1.490646 -21.25382,4.057389 -30.37345,7.593362 -4.87238,-4.399329 3.16389,-8.798658 7.05098,-13.197987 -17.24936,3.272568 -24.55716,7.87068 -31.81981,12.47481 -5.26935,-5.050799 -0.30166,-9.343299 3.2543,-13.740371 -13.00566,4.817048 -19.70478,11.035551 -26.75756,17.175463 -2.39119,-3.227053 -6.07494,-5.592408 -1.62715,-13.378781 -9.23416,5.322725 -16.18926,11.59506 -21.33374,18.621817 -5.71336,-3.637941 -3.40387,-8.613023 -3.43509,-13.197987 -9.59665,7.806516 -15.68687,16.11395 -23.14168,24.226443 -1.50169,-1.093437 -2.81661,-4.80171 -3.97747,-10.666867 -22.89539,22.211815 -55.24591,78.158241 -8.31654,100.340861 39.91877,-32.94716 87.61613,-56.887531 140.47721,-74.848857 z" style="fill:#75a928" />
|
||||
<path d="m 365.2046,521.84937 a 71.956154,66.532318 0 1 1 -143.91231,0 71.956154,66.532318 0 1 1 143.91231,0 z" transform="matrix(1.131107,0,0,1.1280497,-43.139135,-68.310983)" style="fill:#bc1142" />
|
||||
<path d="m 262.84091,276.64774 a 61.875,28.125 0 1 1 -123.75,0 61.875,28.125 0 1 1 123.75,0 z" transform="matrix(0.76741684,-1.1613112,2.171115,1.4224368,-560.88858,217.68859)" style="fill:#bc1142" />
|
||||
<path d="m 262.84091,276.64774 a 61.875,28.125 0 1 1 -123.75,0 61.875,28.125 0 1 1 123.75,0 z" transform="matrix(-0.76741684,-1.1613112,-2.171115,1.4224368,1134.8288,213.68859)" style="fill:#bc1142" />
|
||||
<path d="M 72.910253,342.0878 C 109.32447,332.33088 85.201845,492.72431 55.576871,479.56357 22.990103,453.35089 12.493801,376.58814 72.910253,342.0878 z" style="fill:#bc1142" />
|
||||
<path d="m 493.67828,340.0878 c -36.41422,-9.75692 -12.2916,150.63651 17.33338,137.47577 32.58677,-26.21268 43.08307,-102.97543 -17.33338,-137.47577 z" style="fill:#bc1142" />
|
||||
<path d="m 369.97158,220.6534 c 62.83486,-10.61013 115.11594,26.72229 113.01138,94.85796 -2.06693,26.12112 -136.15872,-90.96907 -113.01138,-94.85796 z" style="fill:#bc1142" />
|
||||
<path d="M 196.35975,218.6534 C 133.52489,208.04327 81.24381,245.37569 83.34837,313.51136 85.4153,339.63248 219.50709,222.54229 196.35975,218.6534 z" style="fill:#bc1142" />
|
||||
<path d="m 286.61932,202.75568 c -37.50259,-0.97548 -73.49548,27.83418 -73.58158,44.54443 -0.10462,20.30426 29.6512,41.09266 73.83726,41.62035 45.12305,0.32321 73.91561,-16.64049 74.0611,-37.59409 0.16484,-23.73996 -41.03879,-48.93744 -74.31678,-48.57069 z" style="fill:#bc1142" />
|
||||
<path d="m 288.90937,619.11675 c 32.69744,-1.42711 76.57083,10.53196 76.6568,26.39598 0.5427,15.4052 -39.78969,50.21055 -78.82634,49.53765 -40.42729,1.74391 -80.06908,-33.11559 -79.54951,-45.19859 -0.60506,-17.71593 49.226,-31.54796 81.71905,-30.73504 z" style="fill:#bc1142" />
|
||||
<path d="m 168.13874,525.10369 c 23.2791,28.04573 33.89066,77.31899 14.46355,91.84353 -18.37917,11.08784 -63.01228,6.52162 -94.736237,-39.05157 -21.395052,-38.24168 -18.637584,-77.15663 -3.615887,-88.58924 22.464424,-13.68429 57.173424,4.79902 83.888574,35.79728 z" style="fill:#bc1142" />
|
||||
<path d="m 405.0209,516.21177 c -25.18682,29.50165 -39.21227,83.30951 -20.83785,100.6428 17.56828,13.46361 64.7292,11.58162 99.56566,-36.75574 25.29599,-32.46471 16.82013,-86.68225 2.37077,-101.07511 -21.46408,-16.60213 -52.27691,4.64489 -81.09858,37.18805 z" style="fill:#bc1142" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.7 KiB |
File diff suppressed because it is too large.
Load diff
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,101 @@
|
||||
/************************/
|
||||
/* GENERAL */
|
||||
/************************/
|
||||
|
||||
body {
|
||||
color: #1e1e1e;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p, a, li, span, blockquote, input, textarea, select, label {
|
||||
font-family: 'Roboto', sans-serif !important;
|
||||
}
|
||||
|
||||
p {
|
||||
/* font-size: 16px;
|
||||
line-height: 25px;
|
||||
margin-bottom: 20px;*/
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
|
||||
/* Sidebar */
|
||||
#top {
|
||||
background-color: #F5F5F5;
|
||||
width: 275px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: auto !important;
|
||||
overflow: auto;
|
||||
padding: 25px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@media (max-width: 1012px) {
|
||||
#top {
|
||||
box-shadow: 5px 0px 10px 0px rgba(0,0,0,0.25);
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
left: -100%;
|
||||
width: 450px;
|
||||
background-color: #F5F5F5;
|
||||
transition: 0.2s left;
|
||||
}
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
#top {
|
||||
width: calc(100% - 50px);
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1012px) {
|
||||
#top.open {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Content */
|
||||
#doc-content {
|
||||
padding: 25px 50px 25px 290px;
|
||||
margin: 0 !important;
|
||||
height: auto !important;
|
||||
}
|
||||
@media (max-width: 1012px) {
|
||||
#doc-content {
|
||||
padding: 110px 40px 40px 40px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
#doc-content {
|
||||
padding: 90px 20px 50px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Hide the default doxygen stuff that we dont want */
|
||||
.ui-resizable-handle {
|
||||
display: none !important;
|
||||
}
|
||||
#nav-sync {
|
||||
display: none !important;
|
||||
}
|
||||
#nav-tree {
|
||||
height: 100% !important;
|
||||
background: none;
|
||||
overflow: auto;
|
||||
padding: 35px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#nav-path, #side-nav {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
// Trigger the mobile navigation
|
||||
$(document).on('click', '.navigation-toggle', function (event) {
|
||||
event.preventDefault();
|
||||
$(this).toggleClass('clicked');
|
||||
$('#top').toggleClass('open');
|
||||
});
|
||||
|
||||
// Add a class to all <li>'s with children
|
||||
$('#main-nav ul li > ul').parent().addClass('hasChildren');
|
||||
$('#main-nav .has-submenu').removeClass('has-submenu');
|
||||
$('#main-nav .sm').removeClass('sm');
|
||||
$('#main-nav .sm-dox').removeClass('sm-dox');
|
||||
$('#main-nav #main-menu').removeAttr('data-smartmenus-id');
|
||||
$('#main-nav #main-menu').removeAttr('id');
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
# Pico SDK
|
||||
|
||||
The Pico SDK (Software Development Kit) provides the headers, libraries and build system necessary to write programs for the RP2040 based devices such as the Raspberry Pi Pico in C, C++ or assembly language. The Pico SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
|
||||
|
||||
A single program runs on the device at a time with a conventional main() method. Standard C/C++ libraries are supported along with APIs for accessing the RP2040’s hardware, including DMA, IRQs, and the wide variety fixed function peripherals and PIO (Programmable IO).
|
||||
|
||||
Additionally the Pico SDK provides higher level libraries for dealing with timers, USB, synchronization and multi-core programming, along with additional high level functionality built using PIO such as audio. The Pico SDK can be used to build anything from simple applications, full fledged runtime environments such as MicroPython, to low level software such as the RP2040’s on chip bootrom itself.
|
||||
|
||||
This documentation is generated from the Pico SDK source tree using Doxygen. It provides basic information on the APIs used for each library, but does not provide usage information. Please refer to the Databooks for usage and more technical information.
|
||||
|
||||
## SDK Design
|
||||
|
||||
The RP2040 is a powerful chip, however it is an embedded environment, so both RAM, and program space are at premium. Additionally the trade offs between performance and other factors (e.g. edge case error handling, runtime vs compile time configuration) are necessarily much more visible to the developer than they might be on other higher level platforms.
|
||||
|
||||
The intention within the SDK has been for features to just work out of the box, with sensible defaults, but also to give the developer as much control and power as possible (if they want it) to fine tune every aspect of the application they are building and the libraries used.
|
||||
|
||||
## The build system
|
||||
|
||||
The Pico SDK uses CMake to manage the build. CMake is widely supported by IDEs (Integrated Development Environments), and allows a simple specification of the build (via CMakeLists.txt files), from which CMake can generate a build system (for use by `make`, `ninja` or other build tools) customized for the platform and by any configuration variables the developer chooses for a list of configuration variables).
|
||||
|
||||
Apart from being a widely used build system for C/C++ development, CMake is fundamental to the way the Pico SDK is structured, and how applications are configured and built.
|
||||
|
||||
The Pico SDK builds an executable which is bare metal, i.e. it includes the entirety of the code needed to run on the device (other than floating point and other optimized code contained in the bootrom within the RP2040).
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
This SDK contains a number of example code fragments. An index of these examples can be found [here](@ref examples_page)
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 29 29" xml:space="preserve"><style type="text/css">.st0{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;} .st1{fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;} .st2{fill:none;stroke:#000000;stroke-miterlimit:10;} .st3{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;stroke-dasharray:1.7411,1.7411;} .st4{fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:2.0261,4.0522;}</style><circle class="st0" cx="11.854" cy="11.854" r="9" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="2"/><path class="st1" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M18.451 18.451l7.695 7.695"/><metadata><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Description about="https://iconscout.com/legal#licenses" dc:title="search,find,magnifier,glass,magnify" dc:description="search,find,magnifier,glass,magnify" dc:publisher="Iconscout" dc:date="2017-10-04" dc:format="image/svg+xml" dc:language="en"><dc:creator><rdf:Bag><rdf:li>Jemis Mali</rdf:li></rdf:Bag></dc:creator></rdf:Description></rdf:RDF></metadata></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,30 @@
|
||||
## Documentation and datasheets {#weblinks_page}
|
||||
|
||||
The full documentation for the RP2040 and Raspberry Pi Pico board can be found at the following links
|
||||
|
||||
- [RP2040 Datasheet](https://rptl.io/rp2040-datasheet)
|
||||
- [Raspberry Pi Pico datasheet](https://rptl.io/pico-datasheet)
|
||||
- [Hardware Design with the RP2040](https://rptl.io/rp2040-design)
|
||||
- [Pico C/C++ SDK](https://rptl.io/pico-c-sdk)
|
||||
- [Pico Python SDK](https://rptl.io/pico-micropython)
|
||||
- [Getting Started with Raspberry Pi Pico](https://rptl.io/pico-get-started)
|
||||
|
||||
### Weblinks
|
||||
|
||||
At Raspberry Pi we have a very community based attitude to help. We run a very popular and busy forum where you can ask questions about any aspect of the Raspberry Pi ecosystem, including the Raspberry Pi Pico.
|
||||
|
||||
You can find our forums at the [following link](https://www.raspberrypi.org/forums).
|
||||
|
||||
For the main Raspberry Pi website, [see here](https://www.raspberrypi.org)
|
||||
|
||||
For the Raspberry Pi Pico page, [see here](https://rptl.io/rp2040-get-started)
|
||||
|
||||
### Github
|
||||
|
||||
All the source code for the Pico SDK, examples and other libraries can be found on Github.
|
||||
|
||||
- [Pico C/C++ SDK](https://github.com/raspberrypi/pico-sdk)
|
||||
- [Pico Examples](https://github.com/raspberrypi/pico-examples)
|
||||
- [Pico Extras - Libraries under development](https://github.com/raspberrypi/pico-extras)
|
||||
- [Pico Playground - Examples that use Pico Extras](https://github.com/raspberrypi/pico-playground)
|
||||
- [Pico Bootrom source code](https://github.com/raspberrypi/pico-bootrom)
|
||||
@@ -0,0 +1,62 @@
|
||||
# This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake
|
||||
|
||||
# This can be dropped into an external project to help locate this SDK
|
||||
# It should be include()ed prior to project()
|
||||
|
||||
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
|
||||
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
|
||||
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT))
|
||||
set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT})
|
||||
message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH))
|
||||
set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH})
|
||||
message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')")
|
||||
endif ()
|
||||
|
||||
set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the PICO SDK")
|
||||
set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of PICO SDK from git if not otherwise locatable")
|
||||
set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK")
|
||||
|
||||
if (NOT PICO_SDK_PATH)
|
||||
if (PICO_SDK_FETCH_FROM_GIT)
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR})
|
||||
if (PICO_SDK_FETCH_FROM_GIT_PATH)
|
||||
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||
endif ()
|
||||
FetchContent_Declare(
|
||||
pico_sdk
|
||||
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
|
||||
GIT_TAG master
|
||||
)
|
||||
if (NOT pico_sdk)
|
||||
message("Downloading PICO SDK")
|
||||
FetchContent_Populate(pico_sdk)
|
||||
set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR})
|
||||
endif ()
|
||||
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
|
||||
else ()
|
||||
message(FATAL_ERROR
|
||||
"PICO SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git."
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||
if (NOT EXISTS ${PICO_SDK_PATH})
|
||||
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found")
|
||||
endif ()
|
||||
|
||||
set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE})
|
||||
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the PICO SDK")
|
||||
endif ()
|
||||
|
||||
set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the PICO SDK" FORCE)
|
||||
|
||||
include(${PICO_SDK_INIT_CMAKE_FILE})
|
||||
@@ -0,0 +1,54 @@
|
||||
# Initialize the PICO SDK
|
||||
# This file must be included prior to the project() call
|
||||
|
||||
if (_PICO_SDK_INIT)
|
||||
return()
|
||||
endif ()
|
||||
set(_PICO_SDK_INIT 1)
|
||||
|
||||
function(pico_is_top_level_project VAR)
|
||||
string(TOLOWER ${CMAKE_CURRENT_LIST_DIR} __list_dir)
|
||||
string(TOLOWER ${CMAKE_SOURCE_DIR} __source_dir)
|
||||
if (__source_dir STREQUAL __list_dir)
|
||||
set(${VAR} 1 PARENT_SCOPE)
|
||||
else()
|
||||
set(${VAR} 0 PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if (NOT PICO_SDK_PATH)
|
||||
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
endif ()
|
||||
|
||||
get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||
|
||||
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to the Pico SDK" FORCE)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PICO_SDK_PATH}/cmake)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_version.cmake)
|
||||
include(pico_utils)
|
||||
|
||||
message("Pico SDK is located at ${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
include(pico_pre_load_platform)
|
||||
|
||||
# todo perhaps this should be included by the platform instead?
|
||||
# We want to configure correct toolchain prior to project load
|
||||
include(pico_pre_load_toolchain)
|
||||
|
||||
macro(pico_sdk_init)
|
||||
if (NOT CMAKE_PROJECT_NAME)
|
||||
message(WARNING "pico_sdk_init() should be called after the project is created (and languages added)")
|
||||
endif()
|
||||
add_subdirectory(${PICO_SDK_PATH} pico_sdk)
|
||||
endmacro()
|
||||
|
||||
macro(add_sub_list_dirs var)
|
||||
foreach(LIST_DIR IN LISTS ${var})
|
||||
get_filename_component(SHORT_NAME "${LIST_DIR}" NAME)
|
||||
message("Including custom CMakeLists.txt ${SHORT_NAME}")
|
||||
add_subdirectory(${LIST_DIR} ${SHORT_NAME})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, pico_base
|
||||
set(PICO_SDK_VERSION_MAJOR 1)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, pico_base
|
||||
set(PICO_SDK_VERSION_MINOR 0)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, pico_base
|
||||
set(PICO_SDK_VERSION_REVISION 0)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
|
||||
set(PICO_SDK_VERSION_STRING "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}")
|
||||
@@ -0,0 +1,89 @@
|
||||
cmake_policy(SET CMP0079 NEW) # allow inserting of dependencies into our INTERFACE libraries
|
||||
set(PICO_PLATFORM_CMAKE_FILE "" CACHE INTERNAL "")
|
||||
set(PICO_DOXYGEN_PATHS "" CACHE INTERNAL "") # generated each time
|
||||
|
||||
if (NOT PICO_PLATFORM_CMAKE_FILE)
|
||||
set(PICO_PLATFORM_CMAKE_FILE ${CMAKE_CURRENT_LIST_DIR}/${PICO_PLATFORM}.cmake CACHE INTERNAL "")
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS "${PICO_PLATFORM_CMAKE_FILE}")
|
||||
message(FATAL_ERROR "${PICO_PLATFORM_CMAKE_FILE} does not exist. \
|
||||
Either specify a valid PICO_PLATFORM (or PICO_PLATFORM_CMAKE_FILE).")
|
||||
endif ()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/board_setup.cmake)
|
||||
|
||||
# todo add option to disable skip flag
|
||||
function(pico_add_subdirectory subdir)
|
||||
string(TOUPPER ${subdir} subdir_upper)
|
||||
set(replace_flag SKIP_${subdir_upper})
|
||||
if (NOT ${replace_flag})
|
||||
add_subdirectory(${subdir})
|
||||
else ()
|
||||
message("Not including ${subdir} because ${replace_flag} defined.")
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
function(pico_wrap_function TARGET FUNCNAME)
|
||||
target_link_options(${TARGET} INTERFACE "LINKER:--wrap=${FUNCNAME}")
|
||||
endfunction()
|
||||
|
||||
function(pico_add_map_output TARGET)
|
||||
get_target_property(target_type ${TARGET} TYPE)
|
||||
if ("EXECUTABLE" STREQUAL "${target_type}")
|
||||
target_link_options(${TARGET} PRIVATE "LINKER:-Map=$<TARGET_PROPERTY:NAME>${CMAKE_EXECUTABLE_SUFFIX}.map")
|
||||
else ()
|
||||
target_link_options(${TARGET} INTERFACE "LINKER:-Map=$<TARGET_PROPERTY:NAME>${CMAKE_EXECUTABLE_SUFFIX}.map")
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
macro(pico_simple_hardware_target NAME)
|
||||
pico_simple_hardware_headers_target(${NAME})
|
||||
pico_simple_hardware_impl_target(${NAME})
|
||||
endmacro()
|
||||
|
||||
macro(pico_simple_hardware_headers_target NAME)
|
||||
if (NOT TARGET hardware_${NAME}_headers)
|
||||
add_library(hardware_${NAME}_headers INTERFACE)
|
||||
|
||||
target_include_directories(hardware_${NAME}_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
target_link_libraries(hardware_${NAME}_headers INTERFACE pico_base_headers)
|
||||
if (NOT PICO_NO_HARDWARE)
|
||||
target_link_libraries(hardware_${NAME}_headers INTERFACE hardware_structs hardware_claim)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(pico_simple_hardware_headers_only_target NAME)
|
||||
if (NOT TARGET hardware_${NAME})
|
||||
add_library(hardware_${NAME} INTERFACE)
|
||||
|
||||
target_include_directories(hardware_${NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
target_link_libraries(hardware_${NAME} INTERFACE pico_base_headers)
|
||||
if (NOT PICO_NO_HARDWARE)
|
||||
target_link_libraries(hardware_${NAME} INTERFACE hardware_structs)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(pico_simple_hardware_impl_target NAME)
|
||||
if (NOT TARGET hardware_${NAME})
|
||||
add_library(hardware_${NAME} INTERFACE)
|
||||
|
||||
target_sources(hardware_${NAME} INTERFACE
|
||||
${CMAKE_CURRENT_LIST_DIR}/${NAME}.c
|
||||
)
|
||||
|
||||
target_link_libraries(hardware_${NAME} INTERFACE hardware_${NAME}_headers pico_platform)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(pico_add_doxygen SOURCE_DIR)
|
||||
set(PICO_DOXYGEN_PATHS "${PICO_DOXYGEN_PATHS} ${SOURCE_DIR}" CACHE INTERNAL "")
|
||||
endfunction()
|
||||
|
||||
function(pico_add_doxygen_exclude SOURCE_DIR)
|
||||
set(PICO_DOXYGEN_EXCLUDE_PATHS "${PICO_DOXYGEN_EXCLUDE_PATHS} ${SOURCE_DIR}" CACHE INTERNAL "")
|
||||
endfunction()
|
||||
|
||||
include(${PICO_PLATFORM_CMAKE_FILE})
|
||||
@@ -0,0 +1,31 @@
|
||||
# PICO_CMAKE_CONFIG: PICO_BOARD, The board name being built for. This is overridable from the user environment, type=string, default=rp2040, group=build
|
||||
if (DEFINED ENV{PICO_BOARD})
|
||||
set(PICO_BOARD $ENV{PICO_BOARD})
|
||||
message("Using PICO_BOARD from environment ('${PICO_BOARD}')")
|
||||
else()
|
||||
if (NOT PICO_BOARD)
|
||||
set(PICO_BOARD "pico")
|
||||
pico_message("Defaulting PICO target board to ${PICO_BOARD} since not specified.")
|
||||
else()
|
||||
message("PICO target board is ${PICO_BOARD}.")
|
||||
endif()
|
||||
endif()
|
||||
set(PICO_BOARD ${PICO_BOARD} CACHE STRING "PICO target board (e.g. pico)")
|
||||
|
||||
# PICO_CMAKE_CONFIG: PICO_BOARD_CMAKE_DIRS, Directors to look for <PICO_BOARD>.cmake in. This is overridable from the user environment, type=list, default="", group=build
|
||||
if (DEFINED ENV{PICO_BOARD_CMAKE_DIRS})
|
||||
set(PICO_BOARD_CMAKE_DIRS $ENV{PICO_BOARD_CMAKE_DIRS})
|
||||
message("Using PICO_BOARD_CMAKE_DIRS from environment ('${PICO_BOARD_CMAKE_DIRS}')")
|
||||
endif()
|
||||
|
||||
list(APPEND PICO_BOARD_CMAKE_DIRS ${CMAKE_CURRENT_LIST_DIR}/boards)
|
||||
|
||||
pico_find_in_paths(PICO_BOARD_CMAKE_FILE PICO_BOARD_CMAKE_DIRS ${PICO_BOARD}.cmake)
|
||||
if (EXISTS "${PICO_BOARD_CMAKE_FILE}")
|
||||
message("Using CMake board configuration from ${PICO_BOARD_CMAKE_FILE}")
|
||||
include(${PICO_BOARD_CMAKE_FILE} board_config)
|
||||
else()
|
||||
include(boards/generic_board.cmake)
|
||||
endif()
|
||||
|
||||
list(APPEND PICO_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/boards/include) # so boards/foo.h can be explicitly included
|
||||
@@ -0,0 +1,23 @@
|
||||
# For boards without their own cmake file, simply include a header
|
||||
|
||||
# PICO_CMAKE_CONFIG: PICO_BOARD_HEADER_DIRS, Directors to look for <PICO_BOARD>.h in. This is overridable from the user environment, type=list, default="", group=build
|
||||
if (DEFINED ENV{PICO_BOARD_HEADER_DIRS})
|
||||
set(PICO_BOARD_HEADER_DIRS $ENV{PICO_BOARD_HEADER_DIRS})
|
||||
message("Using PICO_BOARD_HEADER_DIRS from environment ('${PICO_BOARD_HEADER_DIRS}')")
|
||||
endif()
|
||||
set(PICO_BOARD_HEADER_DIRS ${PICO_BOARD_HEADER_DIRS} CACHE STRING "PICO board header directories")
|
||||
|
||||
list(APPEND PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}/include/boards)
|
||||
pico_find_in_paths(PICO_BOARD_HEADER_FILE PICO_BOARD_HEADER_DIRS ${PICO_BOARD}.h)
|
||||
|
||||
if (EXISTS ${PICO_BOARD_HEADER_FILE})
|
||||
message("Using board configuration from ${PICO_BOARD_HEADER_FILE}")
|
||||
list(APPEND PICO_CONFIG_HEADER_FILES ${PICO_BOARD_HEADER_FILE})
|
||||
else()
|
||||
set(msg "Unable to find definition of board '${PICO_BOARD}' (specified by PICO_BOARD):\n")
|
||||
list(JOIN PICO_BOARD_HEADER_DIRS ", " DIRS)
|
||||
string(CONCAT msg ${msg} " Looked for ${PICO_BOARD}.h in ${DIRS} (additional paths specified by PICO_BOARD_HEADER_DIRS)\n")
|
||||
list(JOIN PICO_BOARD_CMAKE_DIRS ", " DIRS)
|
||||
string(CONCAT msg ${msg} " Looked for ${PICO_BOARD}.cmake in ${DIRS} (additional paths specified by PICO_BOARD_CMAKE_DIRS)")
|
||||
message(FATAL_ERROR ${msg})
|
||||
endif()
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_NONE_H
|
||||
#define _BOARDS_NONE_H
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
// This header may be included by other board headers as "boards/pico.h"
|
||||
|
||||
#ifndef _BOARDS_PICO_H
|
||||
#define _BOARDS_PICO_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
// -----------------------------------------------------
|
||||
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
|
||||
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_VGABOARD_H
|
||||
#define _BOARDS_VGABOARD_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 21
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25 // same as Pico
|
||||
#endif
|
||||
|
||||
// Audio pins. I2S BCK, LRCK are on the same pins as PWM L/R.
|
||||
// - When outputting I2S, PWM sees BCK and LRCK, which should sound silent as
|
||||
// they are constant duty cycle, and above the filter cutoff
|
||||
// - When outputting PWM, I2S DIN should be low, so I2S should remain silent.
|
||||
#define VGABOARD_I2S_DIN_PIN 26
|
||||
#define VGABOARD_I2S_BCK_PIN 27
|
||||
#define VGABOARD_I2S_LRCK_PIN 28
|
||||
|
||||
#define VGABOARD_PWM_L_PIN 28
|
||||
#define VGABOARD_PWM_R_PIN 27
|
||||
|
||||
#define VGABOARD_VGA_COLOR_PIN_BASE 0
|
||||
#define VGABOARD_VGA_SYNC_PIN_BASE 16
|
||||
|
||||
// Note DAT2/3 are shared with UART TX/RX (pull jumpers off header to access
|
||||
// UART pins and disconnect SD DAT2/3)
|
||||
#define VGABOARD_SD_CLK_PIN 5
|
||||
#define VGABOARD_SD_CMD_PIN 18
|
||||
#define VGABOARD_SD_DAT0_PIN 19
|
||||
|
||||
// Note buttons are shared with VGA colour LSBs -- if using VGA, you can float
|
||||
// the pin on VSYNC assertion and sample on VSYNC deassertion
|
||||
#define VGABOARD_BUTTON_A_PIN 0
|
||||
#define VGABOARD_BUTTON_B_PIN 6
|
||||
#define VGABOARD_BUTTON_C_PIN 11
|
||||
|
||||
#ifndef PICO_SCANVIDEO_COLOR_PIN_BASE
|
||||
#define PICO_SCANVIDEO_COLOR_PIN_BASE VGABOARD_VGA_COLOR_PIN_BASE
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SCANVIDEO_SYMC_PIN_BASE
|
||||
#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_CLK_PIN
|
||||
#define PICO_SD_CLK_PIN VGABOARD_SD_CLK_PIN
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_CMD_PIN
|
||||
#define PICO_SD_CMD_PIN VGABOARD_SD_CMD_PIN
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_DAT0_PIN
|
||||
#define PICO_SD_DAT0_PIN VGABOARD_SD_DAT0_PIN
|
||||
#endif
|
||||
|
||||
#define PICO_AUDIO_I2S_DATA_PIN VGABOARD_I2S_DIN_PIN
|
||||
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE VGABOARD_I2S_BCK_PIN
|
||||
|
||||
#define PICO_AUDIO_PWM_L_PIN VGABOARD_PWM_L_PIN
|
||||
#define PICO_AUDIO_PWM_R_PIN VGABOARD_PWM_R_PIN
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#define PICO_VGA_BOARD
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
pico_add_subdirectory(boot_picoboot)
|
||||
pico_add_subdirectory(boot_uf2)
|
||||
pico_add_subdirectory(pico_base)
|
||||
|
||||
# PICO_CMAKE_CONFIG: PICO_BARE_METAL, Flag to exclude anything except base headers from the build, type=bool, default=0, group=build
|
||||
if (NOT PICO_BARE_METAL)
|
||||
pico_add_subdirectory(pico_bit_ops)
|
||||
pico_add_subdirectory(pico_binary_info)
|
||||
pico_add_subdirectory(pico_divider)
|
||||
pico_add_subdirectory(pico_sync)
|
||||
pico_add_subdirectory(pico_time)
|
||||
pico_add_subdirectory(pico_util)
|
||||
pico_add_subdirectory(pico_stdlib)
|
||||
endif()
|
||||
|
||||
pico_add_doxygen(${CMAKE_CURRENT_LIST_DIR})
|
||||
@@ -0,0 +1,3 @@
|
||||
This directory code that is common to all builds regardless of `PICO_PLATFORM`. It is a mix
|
||||
of common header files, or high level functionality built entirely using `hardware_` or `pico_` libraries provided
|
||||
by the actual target `PICO_PLATFORM``
|
||||
@@ -0,0 +1,2 @@
|
||||
add_library(boot_picoboot_headers INTERFACE)
|
||||
target_include_directories(boot_picoboot_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
Loaded 100 of 768 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user