Go to the documentation of this file.00001 #ifndef BASE_GPIO_H
00002 #define BASE_GPIO_H
00003
00004 #include "base/Peripheral.h"
00005
00006 #include "base/defines_gpio.h"
00007
00008
00009 namespace base {
00010
00011 class Gpio : public base::Peripheral {
00012 protected:
00013 public:
00014 static const char* name(int n);
00015
00016 Gpio(base::Board* board);
00017 virtual ~Gpio();
00018
00019 int setSyncBaud(int gpio_nr, uint32_t ratediv);
00020 int setSyncBaud(int gpio_nr, uint32_t offset,
00021 uint32_t even, uint32_t odd);
00022
00023 int getSyncBaud(int gpio_nr, uint32_t& ratediv);
00024 int getSyncBaud(int gpio_nr, uint32_t& offset,
00025 uint32_t& even, uint32_t& odd);
00026
00027 int setSyncScale(uint32_t val);
00028 int getSyncScale(uint32_t& val);
00029
00030 int getConfig(uint32_t& mask);
00031 int setConfig(uint32_t mask);
00032 int setConfig(int gpio_nr, bool riseedge, bool falledge,
00033 bool throttled, bool extrafunc,
00034 bool altin);
00035
00036 static bool packConfig(uint32_t& mask, int gpio_nr,
00037 bool riseedge, bool falledge,
00038 bool throttled, bool extrafunc,
00039 bool altin);
00040 static bool unpackConfig(uint32_t mask, int gpio_nr,
00041 bool& riseedge, bool& falledge,
00042 bool& throttled, bool& extrafunc,
00043 bool& altin);
00044
00045 static void addAddrMap(base::Board* board);
00046 };
00047
00048 }
00049
00050 #endif