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

[DeviceManager] Implement a Device Manager #14

Closed trylimits closed 9 years ago

trylimits commented 9 years ago

The Device Manager should be responsible for managing all devices and their drivers. It should also encapsulate the driver access.

trylimits commented 9 years ago

@Blackjack92 @mpe5651 This is a first prototype of the Device Manager. Pls review.

wake-0 commented 9 years ago

Looks good, very clean. Pls add comments to the functions for a better understanding.

ghost commented 9 years ago

Looks nice to me at the moment. I still have some obscurities about some implementation details, but we'll clarify them tomorrow.

trylimits commented 9 years ago

Works for the moment. Example of usage:

DeviceManagerInit();

int i = 0;
char* leds[] = { "LED0", "LED1", "LED2", "LED3" };
for (i = 0; i < 4; i++) {
    device_t led = DeviceManagerGetDevice(leds[i], 4);
    DeviceManagerOpen(led);
    DeviceManagerWrite(led, "1", 1);
}

Changes and adaptions should be treated in new tickets.