Coder Social home page Coder Social logo

apu_gpio_lib's Introduction

APU2/3 GPIO access library

This is library for accessing the GPIO's of APU2/3 devices. Currently it supports accessing the GPIO's controlling the LED1,2,3, MODESW signal and SIMSWAP signal (apu3 only).

This library could be used as an example.

Required tools to build

  • gcc
  • cmake

How to compile

By default compiles statically linked library and some examples.

mkdir build
cd build
cmake ..
make

Example

After compilation. Examples are in dir build/example.

  • blinky - it blinks the LED2 and LED3 on APU.
  • simswap - changes the simswap pin value. Usage:
    • ./simswap - shows current pin state
    • ./simswap 1 - sets the simswap pin value to 1
    • ./simswap 0 - sets the simswap pin value to 0

Library API

Short API summary:

  • const char *apu_gpio_version(void) - returns library version string
  • int apu_gpio_init(void) - initializes the library and maps the gpio space
  • int apu_gpio_get_dir(unsigned offset) - gets gpio direction (1 - out, 0 - in)
  • int apu_gpio_set_dir(unsigned offset, unsigned direction) - sets gpio direction (1 - out, 0 - in)
  • int apu_gpio_get_val(unsigned offset) - gets gpio state
  • int apu_gpio_set_val(unsigned offset, unsigned value) - sets gpio value

apu_gpio_lib's People

Contributors

brainstone avatar mek-x avatar michaelsteinmann avatar relet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.