This repository, developed under the TRIBE Laboratory from INESC TEC, provides libraries and tools for working with RP2040. Hardware and firmware material for complete integration of the microcontroller are available, allowing to standardize its usage alongside different projects and needs.
In terms of hardware, if you need to integrate RP2040 into your PCB, you can contact the contributors.
In terms of software/firmware, there are libraries for working on the interface/communications layer and drivers for sensing and actuating devices.
You can find documentation about its usage in the following link: https://github.com/INESCTEC/tribe-rp-drivers/blob/main/software/README.md
Follow the folder structure for your project to easily standardize the integrations inside the teamwork:
PROJECT_NAME
|
|__ extern
|__ tribe-rp-drivers
|__ ...
|__ software
|__ src
|__ include
|__ CMakeLists.txt
|__ hardware
To use this repository in your project, add it as a submodule of the repository that you’re working on, inside extern folder.
git submodule add https://github.com/INESCTEC/tribe-rp-drivers
Some submodules have to be initialized and updated. Use the following command inside the root folder.
git submodule update --init --recursive
In PROJECT_NAME/software/CMakeLists.txt follow the example:
cmake_minimum_required(VERSION 3.16)
include(pico_sdk_import.cmake)
project(PROJECT_NAME C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
# Find linker paths
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/drivers/)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/interfaces/)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/third-party/)
# Find include paths
include_directories(PROJECT_NAME PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/drivers/include/)
include_directories(PROJECT_NAME PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/interfaces/include/)
include_directories(PROJECT_NAME PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../../extern/tribe-rp-drivers/software/build/third_party/include/)
add_executable(PROJECT_EXEC_NAME
src/file_name.cpp)
pico_enable_stdio_usb(PROJECT_EXEC_NAME 1)
pico_enable_stdio_uart(PROJECT_EXEC_NAME 0)
pico_add_extra_outputs(PROJECT_EXEC_NAME)
# Link libraries
target_link_libraries(PROJECT_EXEC_NAME
rp_agrolib_driver_name
rp_agrolib_interface_name
pico_stdlib
)
The driver library should come before the interface library.
The following tool versions are used and validated in CI:
- clang-format >= 18
- cppcheck >= 2.13
Using different versions may lead to formatting or static analysis differences.
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf
- I2C
- UART
- USB
- Simple GPIO
- Simple PWM
- Simple Timer
- Simple I2C
- Simple ADC
- Air temperature and humidity sensor HTU21D
- Flash memory
- Stepper motor driver DRV8825
- Stepper motor general use
- Servo motor DRS0101
- GNSS LC29H (Quectel)
- USB power delivery TPS25750DRJKR (Texas)
- Optical distance sensor GP2Y0E02B
- LiDAR VL53L4CD ToF
- LiDAR TFmini-Plus
- ADS1115
- ADS1232
- BNO055 IMU
- FD60 linear actuator
- LD20 linear actuator
- MCP23017 16-Bit I/O expander
- ADS8684 - 16-Bit, 500-kSPS, 4-Ch SAR ADC w/ programmable (±10/±5/±2.5V) input ranges on +5V supply
- AD7980 - 16-Bit, 1 MSPS, PulSAR ADC in MSOP/LFCSP
- AD5680 - 5 V 18-Bit nanoDAC® in a SOT-23
We thank the following team members for their contributions to this repository:
| Name | |
|---|---|
| Pedro Moura (main contact) | pedro.h.moura@inesctec.pt |
| André Aguiar | andre.s.aguiar@inesctec.pt |
| Daniel Silva | daniel.q.silva@inesctec.pt |
| Domingos Bento | domingos.bento@inesctec.pt |
| Francisco Terra | francisco.m.terra@inesctec.pt |
| Filipe Santos | filipe.n.santos@inesctec.pt |
| Isabel Pinheiro | isabel.a.pinheiro@inesctec.pt |
| João Castro | joao.t.castro@inesctec.pt |
| Pedro Rodrigues | pedro.rodrigues@inesctec.pt |
| Vítor Tinoco | vitor.tinoco@inesctec.pt |
| Sandro Magalhães | sandro.a.magalhaes@inesctec.pt |
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

