This is the chip specific include file for T32CZ20 GPIO Driver note that there is a common include file for this HAL module that contains the APIs (such as the init function) that should be used by the application.
More...
|
enum | tr_hal_pin_mode_t {
TR_HAL_GPIO_MODE_GPIO = 0x00
,
TR_HAL_GPIO_MODE_UART_0_TX = 0x01
,
TR_HAL_GPIO_MODE_UART_1_TX = 0x02
,
TR_HAL_GPIO_MODE_UART_1_RTSN = 0x03
,
TR_HAL_GPIO_MODE_UART_2_TX = 0x04
,
TR_HAL_GPIO_MODE_UART_2_RTSN = 0x05
,
TR_HAL_GPIO_MODE_PWM0 = 0x06
,
TR_HAL_GPIO_MODE_PWM1 = 0x07
,
TR_HAL_GPIO_MODE_PWM2 = 0x08
,
TR_HAL_GPIO_MODE_PWM3 = 0x09
,
TR_HAL_GPIO_MODE_PWM4 = 0x0A
,
TR_HAL_GPIO_MODE_IRM = 0x0B
,
TR_HAL_GPIO_MODE_I2C_0_MASTER_SCL = 0x0C
,
TR_HAL_GPIO_MODE_I2C_0_MASTER_SDA = 0x0D
,
TR_HAL_GPIO_MODE_I2C_1_MASTER_SCL = 0x0E
,
TR_HAL_GPIO_MODE_I2C_1_MASTER_SDA = 0x0F
,
TR_HAL_GPIO_MODE_I2C_SLAVE_SCL = 0x10
,
TR_HAL_GPIO_MODE_I2C_SLAVE_SDA = 0x11
,
TR_HAL_GPIO_MODE_SPI_0_CLK = 0x12
,
TR_HAL_GPIO_MODE_SPI_0_SDATA_0 = 0x13
,
TR_HAL_GPIO_MODE_SPI_0_SDATA_1 = 0x14
,
TR_HAL_GPIO_MODE_SPI_0_SDATA_2 = 0x15
,
TR_HAL_GPIO_MODE_SPI_0_SDATA_3 = 0x16
,
TR_HAL_GPIO_MODE_SPI_0_CS_0 = 0x17
,
TR_HAL_GPIO_MODE_SPI_0_CS_1 = 0x18
,
TR_HAL_GPIO_MODE_SPI_0_CS_2 = 0x19
,
TR_HAL_GPIO_MODE_SPI_0_CS_3 = 0x1A
,
TR_HAL_GPIO_MODE_SPI_1_CLK = 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L_GPIO_MODE_UART_2_RX = 0xE1
,
TR_HAL_GPIO_MODE_UART_1_CTS = 0xE2
,
TR_HAL_GPIO_MODE_UART_1_RX = 0xE3
,
TR_HAL_GPIO_MODE_I2S_SDI = 0xE4
,
TR_HAL_GPIO_MODE_UART_0_RX = 0xE5
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_SDATA_1 = 0xE6
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_SDATA_0 = 0xE7
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_CLK = 0xE8
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_CS = 0xE9
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_SDATA_3 = 0xEA
,
TR_HAL_GPIO_MODE_SPI_0_PERIPH_SDATA_2 = 0xEB
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_SDATA_1 = 0xEC
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_SDATA_0 = 0xED
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_CLK = 0xEE
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_CS = 0xEF
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_SDATA_3 = 0xF0
,
TR_HAL_GPIO_MODE_SPI_1_PERIPH_SDATA_2 = 0xF1
,
TR_HAL_GPIO_INPUT_MODE_MAX = 0xF1
} |
| these are the pin MODEs to be passed to tr_hal_gpio_set_mode note that these are defined by the chip and cannot be changed see section 17.3 of datasheet More...
|
|
enum | tr_hal_direction_t {
TR_HAL_GPIO_DIRECTION_OUTPUT = 0
,
TR_HAL_GPIO_DIRECTION_INPUT = 1
} |
| values for setting the direction in the Trident HAL GPIO APIs More...
|
|
enum | tr_hal_level_t {
TR_HAL_GPIO_LEVEL_LOW = 0
,
TR_HAL_GPIO_LEVEL_HIGH = 1
} |
| values for setting the level in the Trident HAL GPIO APIs More...
|
|
enum | tr_hal_trigger_t {
TR_HAL_GPIO_TRIGGER_NONE = 0
,
TR_HAL_GPIO_TRIGGER_RISING_EDGE = 1
,
TR_HAL_GPIO_TRIGGER_FALLING_EDGE = 2
,
TR_HAL_GPIO_TRIGGER_EITHER_EDGE = 3
,
TR_HAL_GPIO_TRIGGER_LEVEL_LOW = 4
,
TR_HAL_GPIO_TRIGGER_LEVEL_HIGH = 5
} |
| values for setting the interrupt trigger in the Trident HAL GPIO APIs More...
|
|
enum | tr_hal_pullopt_t {
TR_HAL_PULLOPT_PULL_NONE = 0
,
TR_HAL_PULLOPT_PULL_DOWN_10K = 1
,
TR_HAL_PULLOPT_PULL_DOWN_100K = 2
,
TR_HAL_PULLOPT_PULL_DOWN_1M = 3
,
TR_HAL_PULLOPT_PULL_ALSO_NONE = 4
,
TR_HAL_PULLOPT_PULL_UP_10K = 5
,
TR_HAL_PULLOPT_PULL_UP_100K = 6
,
TR_HAL_PULLOPT_PULL_UP_1M = 7
,
TR_HAL_PULLOPT_MAX_VALUE = 7
} |
| values for setting the pull option in the Trident HAL GPIO APIs NOTE: these CANNOT be changed. These are in the chip data sheet THESE ARE NOT ARBITRARY More...
|
|
enum | tr_hal_debounce_time_t {
TR_HAL_DEBOUNCE_TIME_32_CLOCKS = 0
,
TR_HAL_DEBOUNCE_TIME_64_CLOCKS = 1
,
TR_HAL_DEBOUNCE_TIME_128_CLOCKS = 2
,
TR_HAL_DEBOUNCE_TIME_256_CLOCKS = 3
,
TR_HAL_DEBOUNCE_TIME_512_CLOCKS = 4
,
TR_HAL_DEBOUNCE_TIME_1024_CLOCKS = 5
,
TR_HAL_DEBOUNCE_TIME_2048_CLOCKS = 6
,
TR_HAL_DEBOUNCE_TIME_4096_CLOCKS = 7
,
TR_HAL_DEBOUNCE_TIME_MAX_VALUE = 7
} |
| values for setting the debounce time register each individual GPIO can be set to enable or disable debounce but the debounce time is set globally for ALL GPIOs. NOTE: these CANNOT be changed. These come from the chip data sheet More...
|
|
enum | tr_hal_drive_strength_t {
TR_HAL_DRIVE_STRENGTH_4_MA = 0
,
TR_HAL_DRIVE_STRENGTH_10_MA = 1
,
TR_HAL_DRIVE_STRENGTH_14_MA = 2
,
TR_HAL_DRIVE_STRENGTH_20_MA = 3
,
TR_HAL_DRIVE_STRENGTH_MAX = 3
,
TR_HAL_DRIVE_STRENGTH_DEFAULT = 3
} |
| values for setting the GPIO drive strength in the Trident HAL APIs NOTE: these CANNOT be changed. These come from the chip data sheet More...
|
|
enum | tr_hal_wake_mode_t {
TR_HAL_WAKE_MODE_NONE = 0
,
TR_HAL_WAKE_MODE_INPUT_LOW = 1
,
TR_HAL_WAKE_MODE_INPUT_HIGH = 2
} |
| values for setting the GPIO wake mode More...
|
|
enum | tr_hal_gpio_event_t {
TR_HAL_GPIO_EVENT_NONE = 0
,
TR_HAL_GPIO_EVENT_INPUT_TRIGGERED = 1
} |
| GPIO interrupt callback functions. More...
|
|
This is the chip specific include file for T32CZ20 GPIO Driver note that there is a common include file for this HAL module that contains the APIs (such as the init function) that should be used by the application.
this chip has 32 numbered GPIOs, from 0-31 GPIOs 2,3 and 12,13 and 18,19 and 24,25,26,27 are not available for use GPIOs 10,11 are used for programming, so these are not recommended to use
GPIOs are set to a mode that determines their function (GPIO, UART, SPI, etc) GPIOs can be set as input or output the drive strength, open drain, pull up, pull down, debounce can all be set
the user is encouraged to use the GPIO settings struct (tr_hal_gpio_settings_t) and tr_hal_gpio_init to set GPIO pins, since there is error checking in the init function
SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2025 Trident IoT, LLC https://www.tridentiot.com