|
Open Model Railroad Network (OpenMRN)
|
#include "os/Gpio.hxx"#include "inc/hw_types.h"#include "inc/hw_ints.h"#include "driverlib/gpio.h"#include "driverlib/prcm.h"#include "inc/hw_memmap.h"#include "driverlib/rom_map.h"Go to the source code of this file.
Classes | |
| class | CC3200Gpio< GPIO_BASE, GPIO_PIN > |
| Generic GPIO class implementation. More... | |
| struct | GpioOutputPin< Base, SAFE_VALUE, INVERT > |
| Parametric GPIO output class. More... | |
| struct | GpioOutputSafeLow< Defs > |
| Defines a GPIO output pin, initialized to be an output pin with low level. More... | |
| struct | GpioOutputSafeHigh< Defs > |
| Defines a GPIO output pin, initialized to be an output pin with high level. More... | |
| struct | GpioInputPin< Base, ACTIVE_HIGH > |
| Parametric GPIO input class. More... | |
| struct | GpioInputOutputPin< Defs > |
| Common class for GPIO input pins. More... | |
Macros | |
| #define | DECL_PIN(NAME, PORT, NUM) |
| Helper macro for declaring a pin. | |
| #define | GPIO_PIN(NAME, BaseClass, PORT, NUM) |
| Helper macro for defining GPIO pins on the CC3200 microcontrollers. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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 HOLDER 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.
Helper declarations for using GPIO pins on CC3200 MCUs.
Note about barriers:
GCC is extremely efficient at optimizing the memory access instructions that we use for writing to GPIO output pins. In many cases writing to multiple GPIO pins turns into back-to-back Thumb instructions, and the hardware peripheral seems to be unable to process bus transactions this fast. We therefore add a barrier after each GPIO write. The barrier ensures that the execution continues after the GPIO write only once the transaction is successfully completed by the bus. We tested that back to back GPIO writes are operational. The barrier also ensures correct sequencing against other effects of the running program. One GPIO write is about 50 nsec (4 clock cycles), the shortest pulse we can generate is 100 nsec.
Definition in file CC3200GPIO.hxx.
| #define DECL_PIN | ( | NAME, | |
| PORT, | |||
| NUM | |||
| ) |
Helper macro for declaring a pin.
Definition at line 63 of file CC3200GPIO.hxx.
| #define GPIO_PIN | ( | NAME, | |
| BaseClass, | |||
| PORT, | |||
| NUM | |||
| ) |
Helper macro for defining GPIO pins on the CC3200 microcontrollers.
| NAME | is the basename of the declaration. For NAME==FOO the macro declared FOO_Pin as a structure on which the read-write functions will be available. |
| BaseClass | is the initialization structure, such as GpioOutputSafeHigh or GpioOutputSafeLow. |
| PORT | is the letter/number (e.g A0, A1, A2, A3) |
| NUM | is the pin number, such as 3 |
Example: GPIO_PIN(FOO, GpioOutputSafeHigh, A0, 3); ... FOO_Pin::set(true);
Definition at line 255 of file CC3200GPIO.hxx.