Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions drivers/gpio/gpio_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ static int gpio_msp_pin_configure(const struct device *port, gpio_pin_t pin, gpi
break;
case GPIO_DISCONNECTED:
DL_GPIO_disableOutput(config->base, BIT(pin));
DL_GPIO_initPeripheralAnalogFunction(pincm);
break;
default:
return -ENOTSUP;
Expand Down Expand Up @@ -423,8 +424,25 @@ static int gpio_msp_port_get_direction(const struct device *port, gpio_port_pins
const struct gpio_msp_config *config = port->config;

map &= config->common.port_pin_mask;
*inputs = map & ~config->base->DOE31_0;
*outputs = map & config->base->DOE31_0;

if (outputs != NULL) {
*outputs = map & config->base->DOE31_0;
}

if (inputs != NULL) {
*inputs = 0;
gpio_port_pins_t remaining = map;

while (remaining) {
uint32_t pin = find_lsb_set(remaining) - 1;
uint32_t pincm = gpio_msp_get_pincm(config, pin);

if (IOMUX->SECCFG.PINCM[pincm] & IOMUX_PINCM_INENA_MASK) {
*inputs |= BIT(pin);
}
remaining &= ~BIT(pin);
}
}

return 0;
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/serial/uart_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ static int uart_msp_irq_rx_ready(const struct device *dev)

static int uart_msp_irq_is_pending(const struct device *dev)
{
struct uart_msp_data *data = dev->data;

return data->pending_interrupt != DL_UART_MAIN_IIDX_NO_INTERRUPT;
return uart_msp_irq_tx_ready(dev) || uart_msp_irq_rx_ready(dev);
}

static int uart_msp_irq_update(const struct device *dev)
Expand Down
13 changes: 13 additions & 0 deletions tests/drivers/gpio/gpio_basic_api/boards/lp_mspm33c321a.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2025 Texas Instruments
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
resources {
compatible = "test-gpio-basic-api";
out-gpios = <&gpiob 20 0>;
in-gpios = <&gpiob 21 0>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_GPIO_GET_CONFIG=y
CONFIG_GPIO_GET_DIRECTION=y
Loading