Lib2 library implements wrapper functions and device driver for Raspberry Pi Pico.
With lib2 it is more easy to write C/C++applications for Pico.
See Getting Started with the Raspberry Pi Pico for information on getting up and running.
Add the file pico_lib2_import.cmake in folder external
to your application CMakeLists.txt.
Example CMakeLists.txt file entry:
cmake_minimum_required(VERSION 3.12)
# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)
# We also need LIB2
include(pico_lib2_import.cmake)
# Your project
project(myproj C CXX)
# Used compiler
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
#Your sourfiles
add_executable(myproj main.c)
# Add used libraries
target_link_libraries(myproj
lib2_sys
dev_ads1x15
)
# Setup stdio
pico_enable_stdio_usb(myproj 0)
pico_enable_stdio_uart(myproj 1)
# Create map/bin/hex file etc.
pico_add_extra_outputs(myproj)
https://github.com/iiot2k/pico-lib2-examples are examples for using Lib2.
GPIO Functions
I2C Functions
SPI Functions
ADC Functions
Time Functions
System Functions
Utility Functions
HD44780 LCD Driver with PCF8574
ADS1115 Four Channel 16-bit ADC
ADS1015 Four Channel 12-bit ADC
MCP4728 Four Channel 12-bit DAC
MCP4725 One Channel 12-bit DAC
DS3231 Accurate Real-Time-Clock