Skip to content

File wiring_custom.h

FileList > arduino > src > wiring > wiring_custom.h

Go to the source code of this file.

  • #include <Arduino.h>

Classes

Type Name
struct PinInfo

Public Types

Type Name
typedef struct PinData_s PinData

Public Attributes

Type Name
int _analogReadResolution
int _analogWritePeriod
int _analogWriteResolution
PinInfo * lt_arduino_pin_gpio_map
PinInfo lt_arduino_pin_info_list

Public Functions

Type Name
int analogRead (pin_size_t pinNumber)
Read voltage from ADC and return a value between 0 and the current reading resolution.
uint16_t analogReadMaxVoltage (pin_size_t pinNumber)
Get max reading voltage for the specified pin (millivolts).
void analogReadResolution (int res)
Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023).
uint16_t analogReadVoltage (pin_size_t pinNumber)
Read voltage from analog input (in millivolts).
void analogWriteFrequency (int hz)
Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS).
void analogWritePeriod (int us)
Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz).
void analogWriteResolution (int res)
Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255).
void mainTask (const void * arg)
Main setup() and loop() task. Not to be called directly.
PinInfo * pinByGpio (uint32_t gpio)
Find PinInfo struct by GPIO number. Returns NULL if not found.
PinInfo * pinByIndex (uint32_t index)
Get PinInfo struct for the specified index. Returns NULL if pin index is invalid.
bool pinEnabled (PinInfo * pin, uint32_t mask)
Check if pin has all features represented by 'mask' enabled.
uint32_t pinIndex (PinInfo * pin)
Get index of PinInfo in the global pin info table.
PinInfo * pinInfo (pin_size_t pinNumber)
Get PinInfo struct for the specified number. Returns NULL if pin number is invalid.
void pinModeNone (pin_size_t pinNumber)
Deinitialize the pin, by removing all enabled modes.
void pinModeRemove (pin_size_t pinNumber, uint32_t mask)
Disable modes specified by 'mask'.
void pinRemoveMode (PinInfo * pin, uint32_t mask)
bool pinSupported (PinInfo * pin, uint32_t mask)
Check if pin supports all features represented by 'mask'.
void runPeriodicTasks ()
Run periodic tasks, like printing free heap or checking millis() overflow.
bool startMainTask (void)
Run mainTask & start OS kernel (family-defined). Return false if an error occured; else do not return and and keep the OS kernel running.

Macros

Type Name
define PIN_ADC (1 << 4)
define PIN_DAC (1 << 5)
define PIN_GPIO (1 << 1)
define PIN_I2C (1 << 6)
define PIN_I2S (1 << 7)
define PIN_IRQ (1 << 2)
define PIN_JTAG (1 << 8)
define PIN_MODE_ALL 0xFFFFFFFF
define PIN_NONE (1 << 0)
define PIN_PWM (1 << 3)
define PIN_SPI (1 << 9)
define PIN_SWD (1 << 10)
define PIN_UART (1 << 11)

Public Types Documentation

typedef PinData

typedef struct PinData_s PinData;

Public Attributes Documentation

variable _analogReadResolution

int _analogReadResolution;

variable _analogWritePeriod

int _analogWritePeriod;

variable _analogWriteResolution

int _analogWriteResolution;

variable lt_arduino_pin_gpio_map

PinInfo* lt_arduino_pin_gpio_map[PINS_GPIO_MAX+1];

variable lt_arduino_pin_info_list

PinInfo lt_arduino_pin_info_list[PINS_COUNT];

Public Functions Documentation

function analogRead

int analogRead (
    pin_size_t pinNumber
) 

function analogReadMaxVoltage

uint16_t analogReadMaxVoltage (
    pin_size_t pinNumber
) 

function analogReadResolution

void analogReadResolution (
    int res
) 

function analogReadVoltage

uint16_t analogReadVoltage (
    pin_size_t pinNumber
) 

function analogWriteFrequency

void analogWriteFrequency (
    int hz
) 

function analogWritePeriod

void analogWritePeriod (
    int us
) 

function analogWriteResolution

void analogWriteResolution (
    int res
) 

function mainTask

void mainTask (
    const void * arg
) 

function pinByGpio

PinInfo * pinByGpio (
    uint32_t gpio
) 

function pinByIndex

PinInfo * pinByIndex (
    uint32_t index
) 

function pinEnabled

bool pinEnabled (
    PinInfo * pin,
    uint32_t mask
) 

function pinIndex

uint32_t pinIndex (
    PinInfo * pin
) 

function pinInfo

PinInfo * pinInfo (
    pin_size_t pinNumber
) 

function pinModeNone

inline void pinModeNone (
    pin_size_t pinNumber
) 

function pinModeRemove

void pinModeRemove (
    pin_size_t pinNumber,
    uint32_t mask
) 

function pinRemoveMode

void pinRemoveMode (
    PinInfo * pin,
    uint32_t mask
) 

function pinSupported

bool pinSupported (
    PinInfo * pin,
    uint32_t mask
) 

function runPeriodicTasks

Run periodic tasks, like printing free heap or checking millis() overflow.

void runPeriodicTasks () 

This is called during delaying operations, like yield() or delay().

function startMainTask

bool startMainTask (
    void
) 

Macro Definition Documentation

define PIN_ADC

#define PIN_ADC (1 << 4)

define PIN_DAC

#define PIN_DAC (1 << 5)

define PIN_GPIO

#define PIN_GPIO (1 << 1)

define PIN_I2C

#define PIN_I2C (1 << 6)

define PIN_I2S

#define PIN_I2S (1 << 7)

define PIN_IRQ

#define PIN_IRQ (1 << 2)

define PIN_JTAG

#define PIN_JTAG (1 << 8)

define PIN_MODE_ALL

#define PIN_MODE_ALL 0xFFFFFFFF

define PIN_NONE

#define PIN_NONE (1 << 0)

define PIN_PWM

#define PIN_PWM (1 << 3)

define PIN_SPI

#define PIN_SPI (1 << 9)

define PIN_SWD

#define PIN_SWD (1 << 10)

define PIN_UART

#define PIN_UART (1 << 11)

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.h