Cs 423 dick steflik
This presentation is the property of its rightful owner.
Sponsored Links
1 / 9

AVR32 GPIO PowerPoint PPT Presentation


  • 118 Views
  • Uploaded on
  • Presentation posted in: General

CS-423 Dick Steflik. AVR32 GPIO. What is a GPIO. GPIO – General Purpose Input/Output Flexible software control digital signal Each GPIO represents a bit connected to a MCU pin or ball (on the BGA) ‏ AVR32 GPIO Processor features

Download Presentation

AVR32 GPIO

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Cs 423 dick steflik

CS-423

Dick Steflik

AVR32 GPIO


What is a gpio

What is a GPIO

  • GPIO – General Purpose Input/Output

    • Flexible software control digital signal

    • Each GPIO represents a bit connected to a MCU pin or ball (on the BGA)‏

  • AVR32 GPIO Processor features

    • An input change interrupt - Enables level detection on any I/O line

    • Glitch filtering – reject pulses of < ½ clock cycle

    • Control of the internal pull-ups on I/O lines

    • Inout visability and output control


Use of gpios

Use of GPIOs

  • Configuration should be done in the board setup code, once setup can be used from:

    • User-space

      • Slow

      • Mainly used for turning something on/off

      • Can be used from scripts or C

    • Kernel-space

      • Device drivers

      • Fast


Dev gpio interface

/dev GPIO Interface

  • Uses the configfs ram based virtual file system

    • Mounts at /config (already done on NGW100)‏

      • mount -t configfs config /config

    • Exists only for the current boot session

      • Could be made to be created by running a script at system startup, script would have to create each object

    • Manipulated by mkdir and rmdir to create and remove objects


Config

/config

  • NGW100 already has three predefined GPIOs

    • bootled – GPIO0

    • leda – GPIO1 bit 19

    • ledb – GPIO2 bit 19

  • each GPIO directory has 4 files

    • gpio_id – which GPIO (0-4)‏

    • pin-mask – which pin(s)

    • oe_mask – output enable mask

    • enabled – enable the GPIO (0-disable, 1-enable)‏


Avr32 gpio

/dev

  • GPIO0

  • GPIO1- bit 19 LED A

  • GPIO2 – bit 19 LED B


Using

Using

  • Define devices in the shell

  • Use them from C using C I/O functions read/write/poll

  • define a file descriptor for the file in /dev

    • for output write to that file descriptor

    • for input read from the file descriptor

    • for waiting on a condition poll the filedescriptor


Gpios in a module

GPIOs in a module

  • GPIOs can be done faster and easier by doing from a kernel module (this is similar to what we did with the 2313s)‏


Led interface

LED Interface


  • Login