Zephyr API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Pin Control Protocol

Pin configuration and control via SCMI . More...

Files

file  pinctrl.h
 Header file for the SCMI Pin Control Protocol.
 

Data Structures

struct  scmi_pinctrl_settings
 Describes the parameters for the PINCTRL_SETTINGS_CONFIGURE command. More...
 

Macros

#define ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE   (10 * 2)
 Maximum number of config words carried by a PINCTRL_SETTINGS_CONFIGURE command.
 
#define SCMI_PINCTRL_NO_FUNCTION   0xFFFFFFFF
 Sentinel scmi_pinctrl_settings::function value meaning "no function".
 
#define SCMI_PINCTRL_CONFIG_ATTRIBUTES(fid_valid, cfg_num, selector)
 Build the attributes word of a PINCTRL_SETTINGS_CONFIGURE command.
 
#define SCMI_PINCTRL_SELECTOR_PIN   0x0
 Selector value: the settings apply to a single pin.
 
#define SCMI_PINCTRL_SELECTOR_GROUP   0x1
 Selector value: the settings apply to a group of pins.
 
#define SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM(attributes)
 Extract the number of configurations from an attributes word.
 
#define SCMI_PINCTRL_ATTRIBUTES_FID_VALID(attributes)
 Extract the fid_valid value (1 if the function ID field is valid, 0 otherwise) from an attributes word.
 
#define SCMI_PIN_CONTROL_PROTOCOL_SUPPORTED_VERSION   0x10000
 Version of the SCMI pin control protocol supported by this driver.
 

Enumerations

enum  scmi_pinctrl_config {
  SCMI_PINCTRL_DEFAULT = 0 , SCMI_PINCTRL_BIAS_BUS_HOLD = 1 , SCMI_PINCTRL_BIAS_DISABLE = 2 , SCMI_PINCTRL_BIAS_HIGH_Z = 3 ,
  SCMI_PINCTRL_BIAS_PULL_UP = 4 , SCMI_PINCTRL_BIAS_PULL_DEFAULT = 5 , SCMI_PINCTRL_BIAS_PULL_DOWN = 6 , SCMI_PINCTRL_DRIVE_OPEN_DRAIN = 7 ,
  SCMI_PINCTRL_DRIVE_OPEN_SOURCE = 8 , SCMI_PCINTRL_DRIVE_PUSH_PULL = 9 , SCMI_PCINTRL_DRIVE_STRENGTH = 10 , SCMI_PINCTRL_INPUT_DEBOUNCE = 11 ,
  SCMI_PINCTRL_INPUT_MODE = 12 , SCMI_PINCTRL_PULL_MODE = 13 , SCMI_PINCTRL_INPUT_VALUE = 14 , SCMI_PINCTRL_INPUT_SCHMITT = 15 ,
  SCMI_PINCTRL_LP_MODE = 16 , SCMI_PINCTRL_OUTPUT_MODE = 17 , SCMI_PINCTRL_OUTPUT_VALUE = 18 , SCMI_PINCTRL_POWER_SOURCE = 19 ,
  SCMI_PINCTRL_SLEW_RATE = 20 , SCMI_PINCTRL_RESERVED_START = 21 , SCMI_PINCTRL_RESERVED_END = 191 , SCMI_PINCTRL_VENDOR_START = 192
}
 Pinctrl configurations. More...
 

Functions

int scmi_pinctrl_settings_configure (struct scmi_pinctrl_settings *settings)
 Send the PINCTRL_SETTINGS_CONFIGURE command and get its reply.
 

Detailed Description

Pin configuration and control via SCMI .

Macro Definition Documentation

◆ ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE

#define ARM_SCMI_PINCTRL_MAX_CONFIG_SIZE   (10 * 2)

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Maximum number of config words carried by a PINCTRL_SETTINGS_CONFIGURE command.

◆ SCMI_PIN_CONTROL_PROTOCOL_SUPPORTED_VERSION

#define SCMI_PIN_CONTROL_PROTOCOL_SUPPORTED_VERSION   0x10000

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Version of the SCMI pin control protocol supported by this driver.

◆ SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM

#define SCMI_PINCTRL_ATTRIBUTES_CONFIG_NUM ( attributes)

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Value:
(((attributes) & GENMASK(9, 2)) >> 2)
#define GENMASK(h, l)
Create a contiguous bitmask starting at bit position l and ending at position h.
Definition util.h:80

Extract the number of configurations from an attributes word.

◆ SCMI_PINCTRL_ATTRIBUTES_FID_VALID

#define SCMI_PINCTRL_ATTRIBUTES_FID_VALID ( attributes)

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Value:
FIELD_GET(BIT(10), attributes)
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define FIELD_GET(mask, value)
Definition silabs-pinctrl-siwx91x.h:14

Extract the fid_valid value (1 if the function ID field is valid, 0 otherwise) from an attributes word.

◆ SCMI_PINCTRL_CONFIG_ATTRIBUTES

#define SCMI_PINCTRL_CONFIG_ATTRIBUTES ( fid_valid,
cfg_num,
selector )

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Value:
(SCMI_FIELD_MAKE(fid_valid, BIT(0), 10) | \
SCMI_FIELD_MAKE(cfg_num, GENMASK(7, 0), 2) | \
SCMI_FIELD_MAKE(selector, GENMASK(1, 0), 0))
#define SCMI_FIELD_MAKE(x, mask, shift)
Create an SCMI message field.
Definition util.h:428

Build the attributes word of a PINCTRL_SETTINGS_CONFIGURE command.

Parameters
fid_valid1 if the function ID field is valid, 0 otherwise
cfg_numNumber of configurations carried by the command
selectorSelects what is being configured (see SCMI_PINCTRL_SELECTOR_*)

◆ SCMI_PINCTRL_NO_FUNCTION

#define SCMI_PINCTRL_NO_FUNCTION   0xFFFFFFFF

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Sentinel scmi_pinctrl_settings::function value meaning "no function".

◆ SCMI_PINCTRL_SELECTOR_GROUP

#define SCMI_PINCTRL_SELECTOR_GROUP   0x1

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Selector value: the settings apply to a group of pins.

◆ SCMI_PINCTRL_SELECTOR_PIN

#define SCMI_PINCTRL_SELECTOR_PIN   0x0

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Selector value: the settings apply to a single pin.

Enumeration Type Documentation

◆ scmi_pinctrl_config

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Pinctrl configurations.

Enumerator
SCMI_PINCTRL_DEFAULT 

Default configuration.

SCMI_PINCTRL_BIAS_BUS_HOLD 

Bias the pin using a bus hold (keeper) circuit.

SCMI_PINCTRL_BIAS_DISABLE 

Disable all biasing.

SCMI_PINCTRL_BIAS_HIGH_Z 

High-impedance (floating) bias.

SCMI_PINCTRL_BIAS_PULL_UP 

Pull the pin up.

SCMI_PINCTRL_BIAS_PULL_DEFAULT 

Apply the default pull bias.

SCMI_PINCTRL_BIAS_PULL_DOWN 

Pull the pin down.

SCMI_PINCTRL_DRIVE_OPEN_DRAIN 

Open-drain output drive.

SCMI_PINCTRL_DRIVE_OPEN_SOURCE 

Open-source output drive.

SCMI_PCINTRL_DRIVE_PUSH_PULL 

Push-pull output drive (note: name kept for ABI compatibility)

SCMI_PCINTRL_DRIVE_STRENGTH 

Output drive strength (note: name kept for ABI compatibility)

SCMI_PINCTRL_INPUT_DEBOUNCE 

Input debounce time.

SCMI_PINCTRL_INPUT_MODE 

Input mode enable.

SCMI_PINCTRL_PULL_MODE 

Pull mode selection.

SCMI_PINCTRL_INPUT_VALUE 

Input value.

SCMI_PINCTRL_INPUT_SCHMITT 

Input Schmitt-trigger enable.

SCMI_PINCTRL_LP_MODE 

Low-power mode.

SCMI_PINCTRL_OUTPUT_MODE 

Output mode enable.

SCMI_PINCTRL_OUTPUT_VALUE 

Output value.

SCMI_PINCTRL_POWER_SOURCE 

Power source selection.

SCMI_PINCTRL_SLEW_RATE 

Output slew rate.

SCMI_PINCTRL_RESERVED_START 

First reserved configuration type.

SCMI_PINCTRL_RESERVED_END 

Last reserved configuration type.

SCMI_PINCTRL_VENDOR_START 

First vendor-specific configuration type.

Function Documentation

◆ scmi_pinctrl_settings_configure()

int scmi_pinctrl_settings_configure ( struct scmi_pinctrl_settings * settings)

#include <zephyr/drivers/firmware/scmi/pinctrl.h>

Send the PINCTRL_SETTINGS_CONFIGURE command and get its reply.

Parameters
settingsPointer to settings to be applied
Returns
0 on success, negative errno value on failure.