Pico-Arduino
Public Member Functions | Protected Attributes | List of all members
PicoGPIOFunction Class Reference

The pico requires that the function of the pin is defined. In Arduino, there is no such concept: so we do this at the first call of the corresponding function: enum gpio_function { GPIO_FUNC_XIP = 0, GPIO_FUNC_SPI = 1, GPIO_FUNC_UART = 2, GPIO_FUNC_I2C = 3, GPIO_FUNC_PWM = 4, GPIO_FUNC_SIO = 5, GPIO_FUNC_PIO0 = 6, GPIO_FUNC_PIO1 = 7, GPIO_FUNC_GPCK = 8, GPIO_FUNC_USB = 9, GPIO_FUNC_NULL = 0xf, };. More...

#include <PicoGPIOFunction.h>

Public Member Functions

 PicoGPIOFunction (int maxPins=40)
 
bool setFunction (pin_size_t pinNumber, gpio_function func)
 
void setFunctionADC (pin_size_t pinNumber)
 
void initADC ()
 
int readPWM (int pinNumber, float scale=100.0)
 

Protected Attributes

uint8_t * pinInfo
 
bool adc_init_flag
 
int current_adc
 

Detailed Description

The pico requires that the function of the pin is defined. In Arduino, there is no such concept: so we do this at the first call of the corresponding function: enum gpio_function { GPIO_FUNC_XIP = 0, GPIO_FUNC_SPI = 1, GPIO_FUNC_UART = 2, GPIO_FUNC_I2C = 3, GPIO_FUNC_PWM = 4, GPIO_FUNC_SIO = 5, GPIO_FUNC_PIO0 = 6, GPIO_FUNC_PIO1 = 7, GPIO_FUNC_GPCK = 8, GPIO_FUNC_USB = 9, GPIO_FUNC_NULL = 0xf, };.

Author
Phil Schatzmann

The documentation for this class was generated from the following file: