This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Feedback Requested: Tutorials, Documentation, adding peripherals, etc.

Other Parts Discussed in Thread: MOTORWARE, BOOSTXL-DRV8301

Hello MotorWare users.

We are adding some tutorials / documentation to better explain the HAL (Hardware Abstraction Layer) and show some more examples.  HAL is where all interface to the hardware/peripherals is located.

Attached is the first version for early review.

Please let us know

  • is this document helpful?
  • does anything need clarification?
  • anything missing?
  • What other topics / examples would be helpful?

 

Thank you for taking the time to respond.

MotorWare_HAL_v100.pdf
  • - This is a very helpful document. I wish we had this with version 12.

     - the statement: value = _IQ12toIQ((_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_8));

     will give us _IQ(-1.0) to _IQ(1.0). What if we want it giving us from _IQ(0.0) to _IQ(1.0 instead.

    - I think we would want to have the SCI included too. For example, this is what I have:

    then we could see the potentiometer working with some shown data

    (I had this code in flash and running it without toggle the flags )

    And of course if we have a multitasking examples added ( for debugging/control) then it would be a big bonus.

    Thanks Chris for the document.

  • Tinhtan Nguyen said:
    we would want to have the SCI included too

    Agree. I think many people (including me) want to dump their data or monitor the data using SCI.

    Also I2C and SPI. These will be useful when people want to store their parameters for example to EEPROM to be used later.

    Also for setting the clock (Internal, external clock, peripheral clock) and to use watchdog in hal.c. I think these should be documented too.

    Thanks!

    Best regards,

    Maria

  • Thanks for the feedback. The purpose of this doc is to provide the simple framework, and let users build on the examples.

    To answer the question about the scaling of the potentiometer read, I would do something like this:

    value = _IQ12toIQ((_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_8) - _IQ12(0.5));

    value = _IQmpy(value, _IQ(2.0));

    That way, value has the result from _IQ(-1.0) to _IQ(1.0)

    So far I have made note of the following examples needed:

    1. SCI Example

    2. SPI Example

    3. I2C Example

    4. Watchdog Management Example

    Tinhtan, what do you mean by "multitasking examples"?

    Maria, what specific examples would you like to see for setting the clocks?

    -Jorge

  • Jorge Zambada said:

    Tinhtan, what do you mean by "multitasking examples"?


    A SYS/BIOS task interacting with users through SCI could be an example.

  • Jorge Zambada said:
    what specific examples would you like to see for setting the clocks?

    For example, just like the one that mentioned by Chris in this thread:

    http://e2e.ti.com/support/microcontrollers/c2000/f/902/t/326222.aspx

    This should be documented somewhere.

    Another example, is like the one in this thread, he wanted to use external crystal:

    http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/337935.aspx

    Thank you!

    Best regards,

    Maria

  • Hi,

    I think this document will be very helpful for new users.

    I also think an example with external crystal will be helpful.

    Regards.

  • Manu36 said:

    I also think an example with external crystal will be helpful.

     
    Thanks for the feedback Manu36, I have added the external crystal example to the wish list.
     
    -Jorge
  • Hello,


    A usefull document for someone that don't understand nothing (like me) and try something on InstaSPIN FOC. The document have a simple language and clarified some basic things. I'm trying implement the potenciometer read. I want use the Launchpad w/28027F for a high voltage ACIM control, so I exported the motorware projects (C:\ti\motorware\motorware_1_01_00_12\sw\solutions\instaspin_foc\boards\hvkit_rev1p1\f28x\f2802xF\projects\ccs5) and try understand the code to adapt to my own purpose. After follow all the instructions on the tutorial, I have a doubt about the last part:

    "And we call the new function we created in a background loop, outside of the interrupt to avoid any CPU bandwidth hit.

    gPotentiometer = HAL_readPotentiometerData(halHandle);" (page 22)

    I already try all, but the value showned on gPotenciometer its always the same and no matter the position of the potenciometer. So, I don't know if I'm put the code at the right place or if it's missing something... Sorry for this basic question.

    Keep going with the good job of adding new tutorials and documents.

    Best Regards,

    Bruno Ramos

  • Can you try putting that function call in the ISR? If you put it in the background loop of a MotorWare project, keep in mind that the forever loop is stuck checking the enable system flag, so enable the system before checking if the potentiometer value read changed.

    // Waiting for enable system flag to be set

    while(!(gMotorVars.Flag_enableSys));

    -Jorge

  • what about adding diagnostics thresholding settings for bad sensor/over/under detection?

  • Could you be more specific? What sensor? Over or under detection of what?

    -Jorge

  • most of the ADCs are used for critical sensings like current, voltage, temperature, etc. each of these would have a range of normal operation, unipolar or bipolar, a warning level, and a fault level. so for each adc channel there would be some comparisons and returns the status of the sensing... for example, if a temperature sensor returns -100C on earth, most likely it is a bad sensor... such diagonostics may or may not be associated with counts so it may be better to have a lib or api to handle... 

  • Hello Jorge,


    Thanks for your reply. I already try everywhere and the result it's always the same.

    This is the value that I get, no matter the position of the pot.

    0447.proj_lab03a.rar

    using a standard user.h, because I don't have any motor connected yet. I'm trying understand the code before start with the experiments with the motor, so I don't know if this will create any problem for the experiment with the pot.

    Thanks,

    Bruno Ramos

  • When is MotoWare 13 being released? It is being referenced throughout the document.

    Cristhian

  • The example in the document is done for a 6x device. Seems like you are using a 2x device. This POT is connected to signal B0, but that B0 is connected to B7 through a switch:

    This switch is actually required to have pins 4 and 5 connected so that ADC-B7 (connected to motor phase 1 voltage) is connected to the ADC pin B7 of the 2xF. That actaully leaves ADC-B0 (POT connected here) disconnected.

    The quickest way to confirm this POT reading example is if you use a 6xM control card:

    http://www.ti.com/tool/tmdscncd28069miso

    Do you have one of these?

    -Jorge

  • Release 13 should be out by end of this week.

  • Hello Jorge,


    Unfortunatelly I don't have any 6xM control card to confirm the value of POT. But what really change in the software configuration between the code on the tutorial for 6xM device to 2xF device?

    Thanks,

    Bruno Ramos

  • Hello,

    About the example which could be full of interest for more users (I believe), perhaps you could add example of how to modify in SW the current level and also how to make flying start.

    Regards.

    Emmanuel

  • Any plans to have MotorWare run using SYS/BIOS?

  • Yes, we plan to use BIOS when we show how to run two motors on F2806x.  This project is probably for 2015 but the HW for this (new LaunchPad that can connect to two BOOSTXL-DRV8301) will release this year.

     

  • Bruno Ramos1 said:

    Unfortunatelly I don't have any 6xM control card to confirm the value of POT. But what really change in the software configuration between the code on the tutorial for 6xM device to 2xF device?

    Nothing changes from 6x to 2x as far as ADC configuration as it is the same ADC. What changes is what channel you want to add in the example. We added B0, since in the 6x there is a POT connected to this channel. Please reasign the following to any channel where you have some analog signal that you would like to try out using the 2x:

    // Potentiometer
    // Configure it so that ADCINT1 will trigger a potentiometer conversion
    ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_8,ADC_SocChanNumber_B0);
    ADC_setupSocTrigSrc(obj->adcHandle, ADC_SocNumber_8, ADC_Int1TriggersSOC);
    ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_8,ADC_SocSampleDelay_9_cycles);

    The highlighted text is the input channel assign to ADC result 8. Everything else in the example applies, so simply change the channel.

    -Jorge

  • Hello motorware team,

    Just minor suggestion for this document.

    I tried to add PWM output based on this document yesterday and all is great.

    Only one thing:

    6.4.4.   Create a Write Function
    This should be mentioned that this function is put in hal.h (because I did mistake to put it in hal.c :) )

    Thank you!

    Best regards,

    Maria

  • Using the document, I was able to make the start push button on the 8312EVM into XINT1, using section 6.6 as a reference. It's useful to see the examples demonstrated.

    I would like to see more of an explanation on the way motorware maps the interrupt. I'm used to using #pragma for interrupts.

    Cristhian

  • Maria,

    Thanks for the feedback. I just corrected the document.

    -Jorge

  • Cristhian Arbelaez said:

    I would like to see more of an explanation on the way motorware maps the interrupt. I'm used to using #pragma for interrupts.

    I will add a section that explains interrupt mapping in the next release. Thanks for the feedback.

    -Jorge

  • HAL_Gpio_LED3  instead of HAL_GPIO_LED3                         (6.6.7)

  • Hello ChrisClearman

         The document is helpful! I think you can do it better.

         1. I think it is not enough content about potentiometer use in document. It only offers tutorials to tell us how to read the value of pot.But to many people,it is important how to use the value of pot as reference speed to control motor and some relevant notes.

         2.The code is good for debugging and detection,but if download program to flash of chip,I think it will don't work.

    e.g.   while(!(gMotorVars.Flag_enableSys));     while(gMotorVars.Flag_enableSys)... etc,   these code statements will affect program execution in flash.  Is "gMotorVars.Flag_enableSys" replaced with the response of  external button?So could TI tell users some considerations in document if users want to download program to flash?

        3.The GPIO7 and 9 have been configured in HAL_setupGpios() function of hal.c file and HAL_readGpio( ) function has been defined in hal.h about "  Reading Push Buttons" section .So it will  change a duplicate definition if users write code according to page-29 of  document.Besides,it needs extra "disappears shakes"  codes for detecting the state of buttons in a practical application.

        4. It is necessary to  provide some relevant notes if users  detect status of button or potentiometer. e.g. if write "gPotentiometer = HAL_readPotentiometerData(halHandle);" statement into "while(gMotorVars.Flag_enableSys)" loop,you must be sure gMotorVars.Flag_enableSys=1 and gMotorVars.Flag_enableSys = 1.  otherwise you cannot get the correct value.

        5.If TI wants to users use motorware easily in their own design,i think TI can let users know how to peripheral configuration(OSC、PLL、System Clock、TIMER、WDOG、Interrupts、ePWM、Capture、eCAP、eQEP、ADC、DMA、SPI、SCI、I2C、eCAN) with C object oriented and API based coding techniques,not to name just a few.

  • Dear Chris,

    Please add GPIO Qualifier related API function in gpio.c file for future version.

    -Suprit 

  • Suprit,

    I believe the functions you need are in the 2x drivers, but they aren't working correctly.  This is from our bug tracking system.  Do you believe these functions - when working - will suffice?

    2014-05-29 11:21:24 CDT

    IO_setQualification and GPIO_setQualificationPeriod do not work correctly. Both functions overwrite unrelated bit fields with zeroes, and GPIO_setQualification shifts the value to be written one field too far for GPIO numbers above 15.

    These functions are currently only in the 02x drivers, but once corrected, I see no reason for them not to be added to the other devices' drivers.

    2014-06-04 11:16:36 CDT

    Fixed in the new MotorWare driver repo.
  • I was able to program the pushbuttons on my 8312EVM to start my motor. I set up my 'START' button to run my motor plan (I also set that GPIO and my XINT1).

    There is a lot of jumping around between the HAL.c, HAL.h, and GPIO.c files but it is all possible. Start by looking at your GPIO assignements and change them accordingly. In your code, you can use the HAL_readGPIO() function to read the input you are looking for.

    Again, I would read the HAL document inside this thread and the driver documentation for motorware.

    Cristhian

  • Dear Chris,

    Thank you for your reply.

    I already made GPIO Qualifier API functions for 6x device before query but found some wrong behaviour of this function so i put a query. When we will expect to remove this bug?

     "Do you believe these functions - when working - will suffice"

    Yes this is very useful function. In high voltage, current system due to radiate noise and also high switching  of system some glitch generate on feedback channel, so using this function we can eliminate unwanted system trip.

    Thanks & Regards,

    -Suprit

  • Suprit,

    attached are the latest f2806x\gpio.c and .h files that are in our repostitory. We haven't done final check-out on these yet, but I'd bet they work just fine.

    /* --COPYRIGHT--,BSD
     * Copyright (c) 2012, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * --/COPYRIGHT--*/
    //! \file   drivers/gpio/src/32b/f28x/f2806x/gpio.c
    //! \brief  The functions in this file are used to configure the general
    //!         purpose I/O (GPIO) registers
    //!
    //! (C) Copyright 2011, Texas Instruments, Inc.
    
    
    // **************************************************************************
    // the includes
    
    
    #include "sw/drivers/gpio/src/32b/f28x/f2806x/gpio.h"
    
    
    // **************************************************************************
    // the defines
    
    
    // **************************************************************************
    // the globals
    
    
    // **************************************************************************
    // the functions
    
    uint16_t GPIO_getData(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      if(gpioNumber < GPIO_Number_32)
        {
            return ((gpio->GPADAT >> gpioNumber) & 0x0001);
        }
      else
        {
            return ((gpio->GPBDAT >> (gpioNumber - GPIO_Number_32)) & 0x0001);
        }
    
    } // end of GPIO_getData() function
    
    
    uint16_t GPIO_getPortData(GPIO_Handle gpioHandle, const GPIO_Port_e gpioPort)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
      if(gpioPort == GPIO_Port_A)
        {
            return (gpio->GPADAT);
        }
      else if(gpioPort == GPIO_Port_B)
        {
            return (gpio->GPBDAT);
        }
    
      return (NULL);
    
    } // end of GPIO_getPortData() function
    
    
    GPIO_Handle GPIO_init(void *pMemory,const size_t numBytes)
    {
      GPIO_Handle gpioHandle;
    
    
      if(numBytes < sizeof(GPIO_Obj))
        {
          return((GPIO_Handle)NULL);
        }
    
      // assign the handle
      gpioHandle = (GPIO_Handle)pMemory;
    
      return(gpioHandle);
    } // end of GPIO_init() function
    
    
    void GPIO_setPullup(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber,const GPIO_Pullup_e pullup)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < GPIO_Number_32)
        {
          // clear the bit
          gpio->GPAPUD &= (~((uint32_t)1 << gpioNumber));
    
          // set the bit
          gpio->GPAPUD |= (uint32_t)pullup << gpioNumber;
        }
      else
        {
          // clear the bit
          gpio->GPBPUD &= (~((uint32_t)1 << (gpioNumber - GPIO_Number_32)));
    
          // set the bit
          gpio->GPBPUD |= (uint32_t)pullup << (gpioNumber - GPIO_Number_32);
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setPullup() function
    
    
    void GPIO_setDirection(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber,const GPIO_Direction_e direction)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < GPIO_Number_32)
        {
          // clear the bit
          gpio->GPADIR &= (~((uint32_t)1 << gpioNumber));
    
          // set the bit
          gpio->GPADIR |= (uint32_t)direction << gpioNumber;
        }
      else
        {
          // clear the bit
          gpio->GPBDIR &= (~((uint32_t)1 << (gpioNumber - GPIO_Number_32)));
    
          // set the bit
          gpio->GPBDIR |= (uint32_t)direction << (gpioNumber - GPIO_Number_32);
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setDirection() function
    
    
    void GPIO_setExtInt(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber,const CPU_ExtIntNumber_e intNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      // associate the interrupt with the GPIO pin
      gpio->GPIOXINTnSEL[intNumber] = gpioNumber;
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setExtInt() function
    
    
    bool GPIO_read(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
      bool gpio_status = 0;
      uint32_t gpio_read = 0;
    
    
      if(gpioNumber < GPIO_Number_32)
        {
          gpio_read = (gpio->GPADAT) & ((uint32_t)1 << gpioNumber);
        }
      else
        {
          gpio_read = (gpio->GPBDAT) & ((uint32_t)1 << (gpioNumber - GPIO_Number_32));
        }
    
      if(gpio_read == 0)
        {
          gpio_status = LOW;
        }
      else
        {
          gpio_status = HIGH;
        }
    
    
      return(gpio_status);
    } // end of GPIO_read() function
    
    
    void GPIO_setHigh(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < GPIO_Number_32)
        {
          gpio->GPASET = (uint32_t)1 << gpioNumber;
        }
      else
        {
          gpio->GPBSET = (uint32_t)1 << (gpioNumber - GPIO_Number_32);
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setHigh() function
    
    
    void GPIO_setLow(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < GPIO_Number_32)
        {
          gpio->GPACLEAR = (uint32_t)1 << gpioNumber;
        }
      else
        {
          gpio->GPBCLEAR = (uint32_t)1 << (gpioNumber - GPIO_Number_32);
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setLow() function
    
    
    void GPIO_setMode(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber,const GPIO_Mode_e mode)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < 16)
        {
          uint_least8_t lShift = gpioNumber << 1;
          uint32_t clearBits = (uint32_t)GPIO_GPMUX_CONFIG_BITS << lShift;
          uint32_t setBits = (uint32_t)mode << lShift;
    
          // clear the bits
          gpio->GPAMUX1 &= (~clearBits);
    
          // set the bits
          gpio->GPAMUX1 |= setBits;
        }
      else if(gpioNumber < 32)
        {
          uint_least8_t lShift = (gpioNumber - 16) << 1;
          uint32_t clearBits = (uint32_t)GPIO_GPMUX_CONFIG_BITS << lShift;
          uint32_t setBits = (uint32_t)mode << lShift;
    
          // clear the bits
          gpio->GPAMUX2 &= (~clearBits);
    
          // set the bits
          gpio->GPAMUX2 |= setBits;
        }
      else if(gpioNumber < 48)
        {
          uint_least8_t lShift = (gpioNumber - 32) << 1;
          uint32_t clearBits = (uint32_t)GPIO_GPMUX_CONFIG_BITS << lShift;
          uint32_t setBits = (uint32_t)mode << lShift;
    
          // clear the bits
          gpio->GPBMUX1 &= (~clearBits);
    
          // set the bits
          gpio->GPBMUX1 |= setBits;
        }
      else if(gpioNumber < 64)
        {
          uint_least8_t lShift = (gpioNumber - 48) << 1;
          uint32_t clearBits = (uint32_t)GPIO_GPMUX_CONFIG_BITS << lShift;
          uint32_t setBits = (uint32_t)mode << lShift;
    
          // clear the bits
          gpio->GPBMUX2 &= (~clearBits);
    
          // set the bits
          gpio->GPBMUX2 |= setBits;
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setMode() function
    
    
    void GPIO_setPortData(GPIO_Handle gpioHandle, const GPIO_Port_e gpioPort, const uint16_t data)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioPort == GPIO_Port_A)
        {
            gpio->GPADAT = data;
        }
      else if(gpioPort == GPIO_Port_B)
        {
            gpio->GPBDAT = data;
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setPortData() function
    
    void GPIO_setQualification(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Qual_e qualification)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber <= 15)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxQSELy_GPIOx_BITS << (2 * gpioNumber);
            gpio->GPAQSEL1 &= ~(clearBits);
            gpio->GPAQSEL1 |= (uint32_t)qualification << (2 * gpioNumber);
        }
      else if(gpioNumber <= 31)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxQSELy_GPIOx_BITS << (2 * (gpioNumber - 16));
            gpio->GPAQSEL2 &= ~(clearBits);
            gpio->GPAQSEL2 |= (uint32_t)qualification << (2 * (gpioNumber - 16));
        }
      else if(gpioNumber <= 47)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxQSELy_GPIOx_BITS << (2 * (gpioNumber - 32));
            gpio->GPBQSEL1 &= ~(clearBits);
            gpio->GPBQSEL1 |= (uint32_t)qualification << (2 * (gpioNumber - 32));
        }
      else if(gpioNumber <= 58)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxQSELy_GPIOx_BITS << (2 * (gpioNumber - 48));
            gpio->GPBQSEL2 &= ~(clearBits);
            gpio->GPBQSEL2 |= (uint32_t)qualification << (2 * (gpioNumber - 48));
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setQualification() function
    
    void GPIO_setQualificationPeriod(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const uint_least8_t period)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber <= 7)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS;
            gpio->GPACTRL &= ~(clearBits);
            gpio->GPACTRL |= (uint32_t)period;
        }
      else if(gpioNumber <= 15)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 8;
            gpio->GPACTRL &= ~(clearBits);
            gpio->GPACTRL |= (uint32_t)period << 8;
        }
      else if(gpioNumber <= 23)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 16;
            gpio->GPACTRL &= ~(clearBits);
            gpio->GPACTRL |= (uint32_t)period << 16;
        }
      else if(gpioNumber <= 31)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 24;
            gpio->GPACTRL &= ~(clearBits);
            gpio->GPACTRL |= (uint32_t)period << 24;
        }
      else if(gpioNumber <= 39)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS;
            gpio->GPBCTRL &= ~(clearBits);
            gpio->GPBCTRL |= (uint32_t)period;
        }
      else if(gpioNumber <= 44)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 8;
            gpio->GPBCTRL &= ~(clearBits);
            gpio->GPBCTRL |= (uint32_t)period << 8;
        }
      else if(gpioNumber <= 55)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 16;
            gpio->GPBCTRL &= ~(clearBits);
            gpio->GPBCTRL |= (uint32_t)period << 16;
        }
      else if(gpioNumber <= 58)
        {
            uint32_t clearBits = (uint32_t)GPIO_GPxCTRL_QUALPRDx_BITS << 24;
            gpio->GPBCTRL &= ~(clearBits);
            gpio->GPBCTRL |= (uint32_t)period << 24;
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_setQualificationPeriod() function
    
    
    void GPIO_toggle(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      if(gpioNumber < GPIO_Number_32)
        {
          gpio->GPATOGGLE = (uint32_t)1 << gpioNumber;
        }
      else
        {
          gpio->GPBTOGGLE = (uint32_t)1 << (gpioNumber - GPIO_Number_32);
        }
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_toggle() function
    
    
    void GPIO_lpmSelect(GPIO_Handle gpioHandle,const GPIO_Number_e gpioNumber)
    {
      GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      gpio->GPIOLPMSEL |= ((uint32_t)1 << gpioNumber);
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
    } // end of GPIO_lpmSelect() function
    

    7563.gpio.h 

    files updated at 3:25pm central

  • Seems to me, somebody wish somebody else will finish the project.

    Libraries are good, if we can see inside. For clarification un/known issues.

    If you want to move forward, use the examples and make your own library.

    In other words, you have to understand it.

    Once you fully rely on pre-chewed libraries without source code, you are cooked.

  • IT is like this Ti.com forum. You can reply and answer your own questions and comments. Was Anybody involved in debugging?
  • David,

    Are you answering to a specific individual in this thread? Or do you have a new issue? This thread is upwards of 2 years old - it is highly unlikely that anyone is still looking for support through this post. If you have an issue you'd like help with, consider making a new thread.

    Sean