# 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 Top-Level Mode Multiplexer Device Access
Library API Reference Guide (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
- 0 – General purpose
- Nonzero – Alternate functions (see the FUNC_SEL bit in the GPIO_CFGn
register)
|
| dir | Direction when the GPIO is set as a general-purpose pin
- DAL_GPIO_INPUT – Input
- DAL_GPIO_OUTPUT – Output
|
| pull | Pull type
- DAL_GPIO_PULL_UP – Pull up
- DAL_GPIO_PULL_DOWN – Pull down
- DAL_GPIO_NO_PULL – No pull
- DAL_GPIO_KEEP – Keeper
|
| drvstr | Drive strength for this signal
- DAL_GPIO_nMA, where n – 2, 4, 6, 8, 10, 12, 14, or 16
|
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)