1 / 9

AVR32 GPIO

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

daphne
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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS-423 Dick Steflik AVR32 GPIO

  2. 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

  3. 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

  4. /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

  5. /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)‏

  6. /dev • GPIO0 • GPIO1- bit 19 LED A • GPIO2 – bit 19 LED B

  7. 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

  8. 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)‏

  9. LED Interface

More Related