#include <types.h>
#include <sdrv_common.h>
#include <pinctrl.h>
Go to the source code of this file.
|
| status_t | sdrv_pinctrl_init (uint32_t count, const pin_settings_config_t *configs) |
| |
| status_t | sdrv_pinctrl_set_mux (uint32_t pin_index, pin_mux_e mux) |
| |
| status_t | sdrv_pinctrl_set_opendrain (uint32_t pin_index, pin_open_drain_e open_drain) |
| |
| status_t | sdrv_pinctrl_set_pull (uint32_t pin_index, pin_pull_config_e pull_config) |
| |
| status_t | sdrv_pinctrl_set_drive_strength (uint32_t pin_index, pin_drive_strength_e drive_strength) |
| |
| status_t | sdrv_pinctrl_set_slew_rate (uint32_t pin_index, pin_slew_rate_e slew_rate) |
| |
| status_t | sdrv_pinctrl_set_input_select (uint32_t pin_index, pin_input_select_e input_select) |
| |
| status_t | sdrv_pinctrl_set_force_input (uint32_t pin_index, pin_force_input_e force_input) |
| |
| status_t | sdrv_pinctrl_set_mode_select (uint32_t pin_index, pin_mode_select_e mode_select) |
| |
| status_t | sdrv_pinctrl_clear_dispmux_config (void) |
| |
| status_t | sdrv_pinctrl_set_high_resistance (uint32_t pin_index) |
| |
| status_t | sdrv_pinctrl_ctrl_init_pin (sdrv_pinctrl_t *pinctrl, struct sdrv_gpio *gpio, const pin_settings_config_t *pin_cfg) |
| |
| status_t | sdrv_pinctrl_ctrl_set_mux (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_mux_e mux) |
| |
| status_t | sdrv_pinctrl_ctrl_set_opendrain (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_open_drain_e open_drain) |
| |
| status_t | sdrv_pinctrl_ctrl_set_pull (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_pull_config_e pull_config) |
| |
| status_t | sdrv_pinctrl_ctrl_set_drive_strength (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_drive_strength_e drive_strength) |
| |
| status_t | sdrv_pinctrl_ctrl_set_slew_rate (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_slew_rate_e slew_rate) |
| |
| status_t | sdrv_pinctrl_ctrl_set_input_select (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_input_select_e input_select) |
| |
| status_t | sdrv_pinctrl_ctrl_set_force_input (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_force_input_e force_input) |
| |
| status_t | sdrv_pinctrl_ctrl_set_mode_select (sdrv_pinctrl_t *pinctrl, uint32_t pin_index, pin_mode_select_e mode_select) |
| |
| status_t | sdrv_pinctrl_ctrl_clear_dispmux_config (sdrv_pinctrl_t *pinctrl) |
| |
| status_t | sdrv_pinctrl_ctrl_set_high_resistance (sdrv_pinctrl_t *pinctrl, struct sdrv_gpio *gpio, uint32_t pin_index) |
| |
- Copyright
- Copyright (c) 2022 Semidrive Semiconductor. All rights reserved.
◆ pin_data_direction_e
Definition for pin data direction, only valid for pin mux as gpio.
◆ pin_drive_strength_e
Definition for pin current drive strength.
◆ pin_force_input_e
Definition for pin force input config.
PIN_FORCE_INPUT_NORMAL means external level has no effect to pin origin ouput. PIN_FORCE_INPUT_ENABLE means if pin output high, external circle pull down pin, pad will read low. PIN_FORCE_INPUT_HIGH means internal force pin tie to high level. PIN_FORCE_INPUT_LOW means internal force pin tie to low level.
◆ pin_input_select_e
Definition for pin input select. Only valid for PAD input signal. CMOS SCHMITT can generate a stable square wave signal, it has filtering and anti-interference capability. Recommended configuration CMOS SCHMITT for digital signals.
◆ pin_interrupt_config_e
Definition for pin interrupt type, only valid for pin mux as gpio.
◆ pin_level_type_e
Definition for pin initial output level, only valid for pin mux as gpio output.
◆ pin_mode_select_e
Definition for pin mode select config.
PIN_MODE_DIGITAL use for digital pin. PIN_MODE_SELECT_NORMAL use for analog pin and reference voltage is 3.3V. PIN_MODE_DOWN_CONVERSION use for analog pin and reference voltage is 5V.
◆ pin_mux_e
Definition for pin mux function, each pin has different function, detail see datasheet.
◆ pin_open_drain_e
Definition for pin output type.
◆ pin_pull_config_e
Definition for pin internal pull type.
◆ pin_settings_config_t
Definiction for pin initialize config.
◆ pin_slew_rate_e
Definition for pin slew rate type.
◆ sdrv_input_select_t
Definition for INPUT SELECT REGISTER config.
◆ sdrv_pinctrl_t
Definition for Pinctrl instance.
◆ pin_data_direction
Definition for pin data direction, only valid for pin mux as gpio.
| Enumerator |
|---|
| PIN_INPUT_DIRECTION | gpio direction input
|
| PIN_OUTPUT_DIRECTION | gpio direction output
|
◆ pin_drive_strength
Definition for pin current drive strength.
| Enumerator |
|---|
| PIN_DS_2MA | drive strength 2mA
|
| PIN_DS_8MA | drive strength 8mA
|
| PIN_DS_4MA | drive strength 4mA
|
| PIN_DS_12MA | drive strength 12mA
|
◆ pin_force_input
Definition for pin force input config.
PIN_FORCE_INPUT_NORMAL means external level has no effect to pin origin ouput. PIN_FORCE_INPUT_ENABLE means if pin output high, external circle pull down pin, pad will read low. PIN_FORCE_INPUT_HIGH means internal force pin tie to high level. PIN_FORCE_INPUT_LOW means internal force pin tie to low level.
| Enumerator |
|---|
| PIN_FORCE_INPUT_NORMAL | pin force input normal
|
| PIN_FORCE_INPUT_ENABLE | pin force input enable
|
| PIN_FORCE_INPUT_HIGH | pin force input high
|
| PIN_FORCE_INPUT_LOW | pin force input low
|
◆ pin_input_select
Definition for pin input select. Only valid for PAD input signal. CMOS SCHMITT can generate a stable square wave signal, it has filtering and anti-interference capability. Recommended configuration CMOS SCHMITT for digital signals.
| Enumerator |
|---|
| PIN_IS_CMOS | input select cmos
|
| PIN_IS_CMOS_SCHMITT | input select cmos schmitt
|
◆ pin_interrupt_config
Definition for pin interrupt type, only valid for pin mux as gpio.
| Enumerator |
|---|
| PIN_INTERRUPT_DISABLED | interrupt disable
|
| PIN_INTERRUPT_HIGH_LEVEL | high level interrupt active
|
| PIN_INTERRUPT_LOW_LEVEL | low level interrupt active
|
| PIN_INTERRUPT_RISING_EDGE | rising edge interrupt active
|
| PIN_INTERRUPT_FALLING_EDGE | falling edge interrupt active
|
| PIN_INTERRUPT_BOTH_EDGE | both edge interrupt active
|
◆ pin_level_type
Definition for pin initial output level, only valid for pin mux as gpio output.
| Enumerator |
|---|
| PIN_LEVEL_LOW | gpio initial output low
|
| PIN_LEVEL_HIGH | gpio initial output high
|
◆ pin_mode_select
Definition for pin mode select config.
PIN_MODE_DIGITAL use for digital pin. PIN_MODE_SELECT_NORMAL use for analog pin and reference voltage is 3.3V. PIN_MODE_DOWN_CONVERSION use for analog pin and reference voltage is 5V.
| Enumerator |
|---|
| PIN_MODE_DIGITAL | digital pin
|
| PIN_MODE_SELECT_NORMAL | pass pad signal as is, only for Analog-digital combo IO
|
| PIN_MODE_DOWN_CONVERSION | down coversion of pad signal before passing to core, only for Analog-digital combo IO
|
◆ pin_mux
Definition for pin mux function, each pin has different function, detail see datasheet.
| Enumerator |
|---|
| PIN_MUX_ALT0 | MUX0
|
| PIN_MUX_ALT1 | MUX1
|
| PIN_MUX_ALT2 | MUX2
|
| PIN_MUX_ALT3 | MUX3
|
| PIN_MUX_ALT4 | MUX4
|
| PIN_MUX_ALT5 | MUX5
|
| PIN_MUX_ALT6 | MUX6
|
| PIN_MUX_ALT7 | MUX7
|
| PIN_MUX_ALT8 | MUX8
|
| PIN_MUX_ALT9 | MUX9
|
◆ pin_open_drain
Definition for pin output type.
| Enumerator |
|---|
| PIN_OPEN_DRAIN | open drain output
|
| PIN_PUSH_PULL | push pull output
|
◆ pin_pull_config
Definition for pin internal pull type.
| Enumerator |
|---|
| PIN_NOPULL | no pull
|
| PIN_PULL_DOWN | pull down
|
| PIN_PULL_UP | pull up
|
◆ pin_slew_rate
Definition for pin slew rate type.
| Enumerator |
|---|
| PIN_SR_FAST | slew rate fast
|
| PIN_SR_SLOW | slew rate slow
|
◆ sdrv_pinctrl_error
PINCTRL status error code.
| Enumerator |
|---|
| SDRV_PINCTRL_BAD_PIN | |
| SDRV_PINCTRL_CTRL_NULL | |
◆ sdrv_pinctrl_clear_dispmux_config()
| status_t sdrv_pinctrl_clear_dispmux_config |
( |
void |
| ) |
|
Clear display mux config.
This function used to clear display mux config. If GPIO_L0 - GPIO_L9 not use for LVDS, you must call this function.
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_clear_dispmux_config()
Clear display mux config.
This function used to clear display mux config. If GPIO_L0 - GPIO_L9 not use for LVDS, you must call this function.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_init_pin()
Initialize one pin as pre-defined.
- Parameters
-
| [in] | pinctrl | pin belongs PINCTRL contoller instance. |
| [in] | gpio | pin belongs GPIO contoller instance. |
| [in] | pin_cfg | pre-defined pin config. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_drive_strength()
Config drive strength for specific pin.
This function config pin current drive strength.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | drive_strength | current drive strength defined in pin_drive_strength_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_force_input()
Config force input for specific pin.
This function config force input type for a specific pin. For Multiply slave device in bus, cs pin should config to force input enable, such as I2C clock etc.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | force_input | force input defined in pin_force_input_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_high_resistance()
Config pin to high resistance.
This function use to config pin as high resistance.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | gpio | GPIO contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_input_select()
Config input select for specific pin.
This function config pin input select cmos or cmos schmitt.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | input_select | input select defined in pin_input_select_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_mode_select()
Config mode select for specific pin.
This function config mode select register for one pin. normal/down coversion only valid for Analog-digital combo IO (GPIOA/B/C) normal: passes pad signal as is down coversion: enable down coversion of pad signal before passing to core
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | mode_select | mode select defined in pin_mode_select_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_mux()
Config mux function for specific pin.
This function select a mux function for specific pin.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | mux | mux function |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_opendrain()
Config output type for specific pin.
This function config pin output use open drain or push pull.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | open_drain | output type defined in pin_open_drain_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_pull()
Config pull type for specific pin.
This function config pin internal pull config.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | pull_config | pull type defined in pin_pull_config_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_ctrl_set_slew_rate()
Config slew rate for specific pin.
This function config pin slew rate.
- Parameters
-
| [in] | pinctrl | PINCTRL contoller instance. |
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | slew_rate | slew rate type defined in pin_slew_rate_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_init()
Initialize pins as pre-defined.
- Parameters
-
| [in] | count | pin numbers to be initilized. |
| [in] | configs | pre-defined pin config array list. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_drive_strength()
Config drive strength for specific pin.
This function config pin current drive strength.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | drive_strength | current drive strength defined in pin_drive_strength_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_force_input()
Config force input for specific pin.
This function config force input type for a specific pin. For Multiply slave device in bus, cs pin should config to force input enable, such as I2C clock etc.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | force_input | force input defined in pin_force_input_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_high_resistance()
| status_t sdrv_pinctrl_set_high_resistance |
( |
uint32_t |
pin_index | ) |
|
Config pin to high resistance.
This function use to config pin as high resistance.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_input_select()
Config input select for specific pin.
This function config pin input select cmos or cmos schmitt.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | input_select | input select defined in pin_input_select_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_mode_select()
Config mode select for specific pin.
This function config mode select register for one pin. normal/down coversion only valid for Analog-digital combo IO (GPIOA/B/C) normal: passes pad signal as is down coversion: enable down coversion of pad signal before passing to core
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | mode_select | mode select defined in pin_mode_select_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_mux()
Config mux function for specific pin.
This function select a mux function for specific pin.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | mux | mux function |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_opendrain()
Config output type for specific pin.
This function config pin output use open drain or push pull.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | open_drain | output type defined in pin_open_drain_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_pull()
Config pull type for specific pin.
This function config pin internal pull config.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | pull_config | pull type defined in pin_pull_config_e. |
- Returns
- SDRV_STATUS_OK or error code.
◆ sdrv_pinctrl_set_slew_rate()
Config slew rate for specific pin.
This function config pin slew rate.
- Parameters
-
| [in] | pin_index | defined pin macro in pinctrl.h. |
| [in] | slew_rate | slew rate type defined in pin_slew_rate_e. |
- Returns
- SDRV_STATUS_OK or error code.