Pico-Arduino
Classes | Typedefs | Enumerations | Functions | Variables
pico_arduino Namespace Reference

Pico Arduino Framework. More...

Classes

class  ArduinoPicoTone
 ArduinoPicoTone provides static methods for PicoTone. More...
 
class  Buffers
 We are managing a 2 collections of memory arrays: One for the available buffers which can be requested to record data and the buffers of filled data which need to be processed (e.g. stored to a SD drive) More...
 
class  Map
 A simple key value map collection. More...
 
class  MuliticoreFifo
 The RP2040 contains two FIFOs for passing data, messages or ordered events between the two cores. Each FIFO is 32 bits wide, and 8 entries deep. One of the FIFOs can only be written by core 0, and read by core 1. The other can only be written by core 1, and read by core 0. More...
 
class  PicoDMA
 We can use the Pico DMA to copy data "in the background" while the processor is doing some other work. One PicoDMA object represents a single DMA channel which is reserved the first time it is needed. You can release it explicity after you are done with the processing. More...
 
class  PicoHardwareI2C
 Arduino I2C implementation using the Pico functionality. In Arduino we can read and write individal characters wheresease in Pico the operations have to be done with arrays. We therefore create a read and write buffer to cache the operations. More...
 
class  PicoHardwareSPI
 Arduino HardwareSPI interface using the Pico API. We use the following default pins spi0: pinRx = 16; pinTx = 19; pinCS = 17; pinSCK = 18; spi1: pinRx = 12; pinTx = 11; pinCS = 13; pinSCK = 10; On the master miso = pinRx and mosi = pinTx. More...
 
class  PicoLogger
 A simple Logger that writes messages dependent on the log level. More...
 
class  PicoPinFunction
 The pico requires that the function of the pin is defined. In Arduino, there is no such concept - however we need to define if the pin is input or output. More...
 
class  PicoPWM
 This is an even more powerfull PWM API where we can specify a user defined input range and the cycle frequency in hz. More...
 
class  PicoPWMNano
 Basic PWM API based on the input and output in nano seconds The Raspberry Pico has 8 controllable PWM slices with each 2 channels, so we can control up to 16 pwm devices at the same time! This is Simple Basic PWM API where we specifiy the periods and duty cyle in Nanoseconds. More...
 
class  PicoPWMReader
 PWM class which supports the input of PWM signals. More...
 
class  PicoPWMWriter
 Support for the generation of PWM signals. For the standard Arduino functionality we use on fixed frequency (defined in the constructor). If you use this API you can define separate frequencies per slice by creating separate instances. More...
 
class  PicoSerialUART
 Serial Stream for a defined UART. By default we use the following pins: UART0 tx/rx = gp0/gp1; UART1 tx/rx = gp4/gp5;. More...
 
class  PicoSerialUSB
 PicoUSBSerial is using the pico USB output. It is mapped to the Arduino Serial variable. More...
 
class  PicoTone
 We use the TimerAlarmRepeating to generate tones. More...
 
struct  PinInfo
 Information about an the status and the Arduino PinMode of an individual pin. More...
 
class  PinSetup
 Base class for function specific pin setup and pin use functionality. More...
 
class  PinSetupADC
 Pin Initialization for ADC. More...
 
class  PinSetupGPIO
 Pin Initialization for GPIO. More...
 
class  PIOManager
 The PIO subsystem on RP2040 allows you to write small, simple programs for what are called PIO state machines, of which RP2040 has eight split across two PIO instances. A state machine is responsible for setting and reading one or more GPIOs, buffering data to or from the processor (or RP2040’s ultra-fast DMA subsystem), and notifying the processor, via IRQ or polling, when data or attention is needed. More...
 
class  Queue
 Construct a new Pico Queue object. More...
 
class  Semaphore
 Pico Semaphore which might be useful if you use the 2 processors (e.g. with the Thread class) More...
 
class  Servo
 We provide an alternative Pico implementation for the Servo class which is compatible with the Arduino Servo library. More...
 
class  SoftwareSerial
 Software Serial Arduino Stream which uses the Pico PIO. More...
 
class  SoundBuffer
 SoundBuffer where the data is standardized, amplified and clipped. More...
 
class  StreamPrintf
 Support for Serial.printf. The maximum printable length is defined by PRINTF_BUFFER_SIZE which is set to 512 by default. More...
 
class  Thread
 Adds support for running code on the second processor core (core1) More...
 
class  TimerAlarm
 Alarm functions for scheduling future execution. More...
 
class  TimerAlarmRepeating
 Repeating Timer functions for simple scheduling of repeated execution. More...
 
class  Vector
 Vector implementation which provides the most important methods as defined by std::vector. This is neither part of Pico nor of the Arduino framwork but nevertheless it is quite handy to have and most of the times quite better then dealing with raw c arrays. More...
 

Typedefs

typedef int64_t(* alarm_callback_t) (alarm_id_t id, void *user_data)
 
typedef bool(* repeating_timer_callback_t) (repeating_timer_t *rt)
 
typedef void(* ThreadCB) (void *arg)
 

Enumerations

enum  PinFunctionEnum { PIN_FUNC_UNDEFINED , PIN_FUNC_GPIO , PIN_FUNC_ADC , PIN_FUNC_PWM }
 Supported pin functions.
 
enum  TimeUnit { MS , US }
 

Functions

PicoSerialUART Serial1 (0)
 
PicoSerialUART Serial2 (1)
 
PicoHardwareSPI SPI (spi0)
 Provides the SPI and SPI1 object to support interfacing via SPI. More...
 
PicoHardwareSPI SPI1 (spi1)
 
int64_t stop_tone_callback (alarm_id_t id, void *user_data)
 
PicoHardwareI2C Wire (i2c0, 160, I2C_SDA, I2C_SCL)
 Provides the Wire object to support interfacing via I2C. More...
 
PicoHardwareI2C Wire1 (i2c1, 160, I2C1_SDA, I2C1_SCL)
 

Variables

PicoPWM ArduionPwm (PICO_ARDUINO_PWM_FREQUENCY, 255)
 
PinSetupADC InstancePinSetupADC = PinSetupADC::instance()
 
PinSetupGPIO InstancePinSetupGPIO
 
PicoLogger Logger
 
int pico_pwm_actual_pin
 
uint32_t pico_pwm_wrap_count
 For measureDutyCycle we need to track the pwm wrap interrupts.
 
PicoPinFunction PinFunction = PicoPinFunction::instance()
 
PicoSerialUSB Serial
 

Detailed Description

Pico Arduino Framework.

Author
Phil Schatzmann

Function Documentation

◆ SPI()

PicoHardwareSPI pico_arduino::SPI ( spi0  )
inline

Provides the SPI and SPI1 object to support interfacing via SPI.

Author
Phil Schatzmann

◆ Wire()

PicoHardwareI2C pico_arduino::Wire ( i2c0  ,
160  ,
I2C_SDA  ,
I2C_SCL   
)
inline

Provides the Wire object to support interfacing via I2C.

Author
Phil Schatzmann