# DALTLMM data definitions

Source: [https://docs.qualcomm.com/doc/80-88500-4/topic/28_DALTLMM_data_definitions.html](https://docs.qualcomm.com/doc/80-88500-4/topic/28_DALTLMM_data_definitions.html)

DALTLMM describe some of the public macros and data structures that are used by the
    TLMM module.

For more information, see <cite class="cite">Top-Level Mode Multiplexer Device Access
        Library API Reference Guide</cite> (80-N2096-1).

## Macros

- DAL\_GPIO\_CFG
    The macro generates a configuration signal for a GPIO
            (DALGpioSignalType).

        define DAL_GPIO_CFG(gpio, func, dir, pull, drive) \
        (((gpio) & 0x3FF)<< 4 | \
        ((func) & 0xF)|    \
        ((dir) & 0x1) << 14| \
        ((pull) & 0x3) << 15| \
        ((drive)& 0xF) << 17)
        Copy to clipboard

Table : DAL_GPIO_CFG parameter description

    | Parameter | Description |
    | --- | --- |
    | gpio | GPIO number associated with this signal |
    | func | GPIO function associated with this signal<ul class="ul" id="DALTLMM_data_definitions_28__ul_hbm_tbm_cxb"><br>                      <li class="li">0 – General purpose</li><br><br>                      <li class="li">Nonzero – Alternate functions (see the FUNC_SEL bit in the GPIO_CFGn<br>                        register)</li><br><br>                    </ul> |
    | dir | Direction when the GPIO is set as a general-purpose pin<ul class="ul" id="DALTLMM_data_definitions_28__ul_c5h_vbm_cxb"><br>                      <li class="li">DAL_GPIO_INPUT – Input</li><br><br>                      <li class="li">DAL_GPIO_OUTPUT – Output </li><br><br>                    </ul> |
    | pull | Pull type<ul class="ul" id="DALTLMM_data_definitions_28__ul_emt_wbm_cxb"><br>                      <li class="li">DAL_GPIO_PULL_UP – Pull up</li><br><br>                      <li class="li">DAL_GPIO_PULL_DOWN – Pull down </li><br><br>                      <li class="li">DAL_GPIO_NO_PULL – No pull</li><br><br>                      <li class="li">DAL_GPIO_KEEP – Keeper</li><br><br>                    </ul> |
    | drvstr | Drive strength for this signal<ul class="ul" id="DALTLMM_data_definitions_28__ul_ink_ybm_cxb"><br>                      <li class="li">DAL_GPIO_nMA, where n – 2, 4, 6, 8, 10, 12, 14, or 16</li><br><br>                    </ul> |

    For example, the following function generates the configuration data for GPIO
            0, general purpose output, no pull, and drive strength of
          2 mA:

        uint32 gpio0_cfg = DAL_GPIO_CFG(0, 0, DAL_GPIO_OUTPUT, \ 
        DAL_GPIO_NO_PULL, DAL_GPIO_2MA);
        Copy to clipboard

## DAL\_GPIO\_CFG\_OUT

The macro specifies an extra outval that defines the output state (High or Low) of the GPIO.

    define DAL_GPIO_CFG_OUT(gpio, func, dir, pull, drive, outval) \
    (DAL_GPIO_CFG((gpio), (func), (dir), (pull), (drive))\
    | (((outval)|0x2) << 0x15))
    Copy to clipboard

This macro is needed when defining the low-power configuration of an output GPIO.

## GPIO state variable

The following variable stores a list of GPIO IDs used to verify whether any configuration of the
        GPIO is legitimate. For more information, see [DALTLMM APIs](https://docs.qualcomm.com/doc/80-88500-4/topic/29_DALTLMM_interface_description.html) .

`Static DALGpioSecAccessType *ganGpioIdUsers;`

**Parent Topic:** [GPIO DAL driver](https://docs.qualcomm.com/doc/80-88500-4/topic/25_GPIO_DAL_driver.html)

Last Published: Aug 18, 2023

[Previous Topic
GPIO configuration timeline](https://docs.qualcomm.com/bundle/publicresource/80-88500-4/topics/27_GPIO_configuration_timeline.md) [Next Topic
DALTLMM APIs](https://docs.qualcomm.com/bundle/publicresource/80-88500-4/topics/29_DALTLMM_interface_description.md)