Revert "misc cleanup"
[rpi-open-firmware.git] / drivers / BCM2708Gpio.cc
1 #include <drivers/BCM2708Gpio.hpp>
2
3 void BCM2708Gpio::setFunction(uint32_t pin_num, BCM2708PinmuxSetting function) {
4 uint32_t* fsel = reinterpret_cast<uint32_t*>(
5 reinterpret_cast<uint32_t>(&GP_FSEL0) + (0x4 * (pin_num/10))
6 );
7 uint32_t pin_shift = (pin_num % 10) * 3;
8
9 *fsel = (*fsel & (0x7 << pin_shift)) | function;
10 }
11
12 void BCM2708Gpio::init() {
13 setTag('GPIO');
14 }
15
16 IODriverCreateSingletonInstance(BCM2708Gpio);
This page took 0.068454 seconds and 4 git commands to generate.