Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8847603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:13:47+00:00 2026-06-14T12:13:47+00:00

I am trying to learn expansion header configuration of a processor on this instruction

  • 0

I am trying to learn expansion header configuration of a processor on this instruction http://41j.com/blog/2011/09/beagleboard-gpio-input-driverless/

I have a part that I could not understand

volatile ulong *pinconf;
pinconf = (ulong*) mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x48000000);
pinconf[0x2168/4] = 0x001C001C;

Can anyone explain how does the pinconf array works? what value does it store?

Edit: What I really could not understand what does pinconf[0x2168/4] mean. is it an hexadecimal array and what value does it refer to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:13:48+00:00Added an answer on June 14, 2026 at 12:13 pm

    I’m the original blog/code author, here’s what I meant:

    To answer your main point, pinconf[0x2168/4] refers to the address 0x48002168. The pinconf array starts at the address 0x48000000. It’s been defined as a ulong [1], which on ARM processors is 4 bytes. I know I want to access the address pinconf+0x2168. To convert the address 0x2168 into an index in pinconf I need to divide by 4.


    Walking through the code from the start:

    volatile ulong *pinconf;
    

    pinconf is defined as a ulong (32bit int) pointer. It’s defined as volatile, this means that something outside of our code may change its value. It tells the compiler that every time we use that value we need to read it from memory, this stops the compiler doing clever optimisations that may screw things up.

    pinconf = (ulong*) mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x48000000);
    

    This sets pinconf to point to the address 0x48000000. Normally you could do something like:

    pinconf = (ulong*) 0x48000000;
    

    To make pinconf point to an address, but this won’t work. 0x48000000 is a protected address, it’s only accessible by the kernel. The mmap magic gives you a way to access the address from userspace.

    pinconf[0x2168/4] = 0x001C001C;
    

    We’ve covered this already, but this is writing a value to the address: 0x48000000+0x2168. The value 0x48002168 comes from the OMAP3 datasheets, and is used to do memory mapped IO with the GPIO system. We divide by 4 to convert the address 0x2168 to an index in pinconf.

    [1] I should probably have used a uint32_t to be honest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to learn a bit about PDO and is going through this tutorial .
I'm a rails developer trying to learn Backbone and then I ran into this
trying to learn and practice arrays but I have a problem with this small
I am trying to learn the basics of dependency injection (DI). To this end
I'm trying learn Python (3 to be more specific) and I'm getting this error:
Trying to learn how to clone this Soda Theme for Sublime Text 2 with
I'm trying learn more about RavenDB and at the moment to focus on how
I am trying learn the use of lambda expressions and hence still struggling to
Trying to learn Sencha Touch 2 and I can't seem to find out how
Trying to learn about php's arrays today. I have a set of arrays like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.