Pin number conversion helpers, port register macros and default pin definitions.
More...
|
|
#define | PNUM_MASK 0xFF |
| | Pin number mask, allows to retrieve the pin number without ALTx.
|
| |
|
#define | PNUM_NOT_DEFINED NUM_DIGITAL_PINS |
| | Pin not defined.
|
| |
|
#define | PIN_SPI_SS 10 |
| |
|
#define | PIN_SPI_SS1 4 |
| |
|
#define | PIN_SPI_SS2 7 |
| |
|
#define | PIN_SPI_SS3 8 |
| |
|
#define | PIN_SPI_MOSI 11 |
| |
|
#define | PIN_SPI_MISO 12 |
| |
|
#define | PIN_SPI_SCK 13 |
| |
|
#define | PIN_WIRE_SDA 14 |
| |
|
#define | PIN_WIRE_SCL 15 |
| |
|
#define | PIN_I3C_SDA 14 |
| |
|
#define | PIN_I3C_SCL 15 |
| |
|
#define | NOT_AN_INTERRUPT (pin_size_t)NC |
| | Value returned by digitalPinToInterrupt() when the pin cannot be used as an interrupt.
|
| |
| #define | digitalPinToPinName(p) |
| | Convert a digital pin number (Dxx) to a PinName (PX_n).
|
| |
| #define | analogInputToDigitalPin(p) (NUM_DIGITAL_PINS) |
| | Convert an analog pin number (Ax) to a digital pin number.
|
| |
| #define | digitalPinToInterrupt(p) (digitalPinIsValid(p) ? p : NOT_AN_INTERRUPT) |
| | Convert a digital pin number to an interrupt number.
|
| |
| #define | digitalPinHasI2C(p) |
| | Check whether a digital pin has an I2C (SDA or SCL) function.
|
| |
|
#define | digitalPinHasPWM(p) (pin_in_pinmap(digitalPinToPinName(p), PinMap_TIM)) |
| | Check whether a digital pin has a PWM (timer) function.
|
| |
| #define | digitalPinHasSerial(p) |
| | Check whether a digital pin has a UART (RX or TX) function.
|
| |
| #define | digitalPinHasSPI(p) |
| | Check whether a digital pin has an SPI (MOSI, MISO, SCLK or SSEL) function.
|
| |
|
#define | digitalPinToPort(p) (get_GPIO_Port(STM_PORT(digitalPinToPinName(p)))) |
| | Get the GPIO port (GPIO_TypeDef pointer) of a digital pin.
|
| |
|
#define | digitalPinToBitMask(p) (STM_GPIO_PIN(digitalPinToPinName(p))) |
| | Get the bit mask of a digital pin in its GPIO port registers.
|
| |
|
#define | analogInPinToBit(p) (STM_GPIO_PIN(digitalPinToPinName(p))) |
| | Get the bit mask of an analog pin in its GPIO port registers.
|
| |
|
#define | portOutputRegister(P) (&(P->ODR)) |
| | Get the address of the output data register of a GPIO port.
|
| |
|
#define | portInputRegister(P) (&(P->IDR)) |
| | Get the address of the input data register of a GPIO port.
|
| |
|
#define | portSetRegister(P) (&(P->BSRR)) |
| | Get the address of the set register of a GPIO port.
|
| |
|
#define | portClearRegister(P) (&(P->BRR)) |
| |
|
#define | portModeRegister(P) (&(P->MODER)) |
| |
| #define | portConfigRegister(P) (portModeRegister(P)) |
| | Get the address of the mode register of a GPIO port.
|
| |
| #define | digitalPinIsValid(p) (digitalPinToPinName(p) != NC) |
| | Check whether a digital pin number is valid, i.e.
|
| |
| #define | digitalPinFirstOccurence(p) (pinNametoDigitalPin(digitalPinToPinName(p))) |
| | Get the first occurrence of a pin in digitalPin[].
|
| |
|
#define | pinIsAnalogInput digitalpinIsAnalogInput |
| | Convenient macro to handle Analog for Firmata, see digitalpinIsAnalogInput().
|
| |
|
#define | ADC_RESOLUTION 10 |
| | Default resolution of analogRead() values, in bits.
|
| |
|
#define | DACC_RESOLUTION 12 |
| | Resolution of the DAC, in bits.
|
| |
|
#define | PWM_RESOLUTION 8 |
| | Default resolution of analogWrite() values, in bits.
|
| |
|
#define | PWM_FREQUENCY 1000 |
| | Default PWM frequency of analogWrite(), in Hertz.
|
| |
|
#define | PWM_MAX_DUTY_CYCLE 4095 |
| | Maximum PWM duty cycle value.
|
| |
Pin number conversion helpers, port register macros and default pin definitions.