Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
gpio.h
00001 #ifndef _GPIO_HPP 00002 #define _GPIO_HPP 00003 00004 #include <stdint.h> 00005 00006 #define GPIO_DIR_INPUT 0 00007 #define GPIO_DIR_OUTPUT 1 00008 00009 #include <PinNames.h> 00010 00011 class GPIO { 00012 public: 00013 uint8_t port; 00014 uint8_t pin; 00015 GPIO(PinName); 00016 GPIO(uint8_t port, uint8_t pin); 00017 GPIO(uint8_t port, uint8_t pin, uint8_t direction); 00018 // ~GPIO(); 00019 void setup(); 00020 void set_direction(uint8_t direction); 00021 void output(); 00022 void input(); 00023 void write(uint8_t value); 00024 void set(); 00025 void clear(); 00026 uint8_t get(); 00027 00028 int operator=(int); 00029 }; 00030 00031 #endif /* _GPIO_HPP */
Generated on Tue Jul 12 2022 20:09:02 by 1.7.2