How to read data from ADC port

Hello.

I’m trying to read data from ADC port on Beaglebone Black which comes from joystick and buttons. I’m new with cocos2d-x and using to make some simple program that running on Android JellyBean on BBB. I know cocos2d-x supports touch input but have no idea how to read an analog data. (or converted to digital through ADC port)

Hope it could be possible at least. :> Thanks to read.