wake-0 / fhvOS

This repository contains an os for the arm cortex a8 in combination with beaglebone.
GNU General Public License v2.0
7 stars 1 forks source link

[HAL] Add GPIO functionality to HAL #2

Closed trylimits closed 9 years ago

trylimits commented 9 years ago

The implemented LED stuff should be refactored to HAL

trylimits commented 9 years ago

I pushed a prototype implementation how HAL could look like. I introduced a platform.h, resp. platform.c which wraps the memory access in inline functions. I'm not entirely happy with the interfaces but I really would like to get rid of these HWREG(..) defines in some way.

Let's discuss the concept for that in the coaching tomorrow.

trylimits commented 9 years ago

Until Wednesday pls @trylimits

trylimits commented 9 years ago

Implemented but not tested yet. @Blackjack92 I would appreciate if you would review the concept of API Pin# and BeagleBone Pin#, resp. the mapping between those in gpio.c. Probably we could extend the mapping array and also add all those addresses. This way we could get rid of these getXXX(..) functions. Discussion on Wed.

wake-0 commented 9 years ago

I reviewed the concept, it seems good to me. The thing which was missing for my understanding was that the API Pin#s were not in the .h - file defined. When you add them to the .h - file it is okay.

trylimits commented 9 years ago

API Pin# are wrapped in functions, e.g. GPIOGetLedPin(int). If we would define API Pin#s in the header file we would assume that all hardware devices would have the same amount of GPIO pins.

trylimits commented 9 years ago

The mux mode in the function GPIOSetMuxMode(int, int) is not correct. The mux mode itself should be wrapped into an enum as it may be different on other hw devices.

@trylimits

trylimits commented 9 years ago

Should work for the moment. Tested with all 4 LEDs