Forums - How do you configure PMIC_GPIO_23?

3 posts / 0 new
Last post
How do you configure PMIC_GPIO_23?
d.argyle
Join Date: 28 Apr 17
Posts: 1
Posted: Tue, 2017-09-19 15:11

How can I configure the PMIC GPIOs to use?

In some of your documentation you say "Refer to the SW user guide for exact settings and options" But you don't have any indication of where that is. Do I need to put anything in my blsp.config? I am using the gpio test code from the dspal, and it says that I am successfully able to open /dev/gpio-23 in my DSP code. But I am not getting any output from the output pin when I toggle it.

Any help would be greatly appreciated.

Here is some code I have to open and toggle:

 

#define GPIO_DEVICE_PATH "/dev/gpio-23"
 
static int gpio_led_fd;
 
int DSPInterface_led_open()
{
    gpio_led_fd = open(GPIO_DEVICE_PATH, 0);
    if (gpio_led_fd == -1)
    {
        LOG_MSG("Failed to open device %s", GPIO_DEVICE_PATH);
        return -1;
    }
    LOG_MSG("Opened device %s", GPIO_DEVICE_PATH);
 
    struct dspal_gpio_ioctl_config_io config = {
        .direction = DSPAL_GPIO_DIRECTION_OUTPUT,
        .pull      = DSPAL_GPIO_PULL_DOWN,
        .drive     = DSPAL_GPIO_2MA,
    };
 
    // configure GPIO device into general purpose IO mode
    if (ioctl(gpio_led_fd, DSPAL_GPIO_IOCTL_CONFIG_IO, (void *) &config) != 0)
    {
        LOG_MSG("ioctl gpio device failed");
        return -1;
    }
 
    return 0;
}
 
int DSPInterface_led_toggle_on()
{
    LOG_MSG("Turning on LEDs");
 
    int input = 1;
    if (write(gpio_led_fd, &input, 1) != 1)
    {
        LOG_MSG("failed to turn on LEDs");
        return -1;
    }
 
    LOG_MSG("LEDs on");
 
    return 0;
}
  • Up0
  • Down0
drone_guy
Join Date: 14 Nov 16
Posts: 37
Posted: Tue, 2017-09-26 13:41

PMIC GPIO pins are not accessible from DSP. PMIC is outside of the APQ8074, so it's a completely different subsystem. In your test, you were actually activating the APQ's GPIO 23 and luckily it was UART5 TX, which is normally not used (reserved for the Sirf Star V GPS receiver communication). You can check the schematic for more details and select another pin that is connected directly to APQ.

Alex K

  • Up0
  • Down0
bryanribas
Join Date: 31 Dec 16
Posts: 7
Posted: Fri, 2017-11-17 13:52

Are PMIC_MPP02, 03 or 04 accessible to the CPU or DSP? I am trying to use an analog input GPIO. 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.