gpio_lm3s.h
Go to the documentation of this file.00001
00036 #ifndef GPIO_LM3S_H
00037 #define GPIO_LM3S_H
00038
00039 #include <io/lm3s.h>
00040
00044
00045 enum
00046 {
00047 GPIO_DIR_MODE_IN = 0,
00048 GPIO_DIR_MODE_OUT,
00049 GPIO_DIR_MODE_HW,
00050 };
00051
00052
00056
00057 enum
00058 {
00059 GPIO_STRENGTH_2MA = 0,
00060 GPIO_STRENGTH_4MA,
00061 GPIO_STRENGTH_8MA,
00062 GPIO_STRENGTH_8MA_SC,
00063 };
00064
00065
00069
00070 enum
00071 {
00072 GPIO_PIN_TYPE_ANALOG = 0,
00073 GPIO_PIN_TYPE_STD,
00074 GPIO_PIN_TYPE_STD_WPU,
00075 GPIO_PIN_TYPE_STD_WPD,
00076 GPIO_PIN_TYPE_OD,
00077 GPIO_PIN_TYPE_OD_WPU,
00078 GPIO_PIN_TYPE_OD_WPD,
00079 };
00080
00081
00082
00083 INLINE void lm3s_gpioPinWrite(uint32_t port, uint8_t pins, uint8_t val)
00084 {
00085 HWREG(port + GPIO_O_DATA + (pins << 2)) = val;
00086 }
00087
00088
00089 INLINE uint32_t lm3s_gpioPinRead(uint32_t port, uint8_t pins)
00090 {
00091 return HWREG(port + GPIO_O_DATA + (pins << 2));
00092 }
00093
00094 int lm3s_gpioPinConfig(uint32_t port, uint8_t pins,
00095 uint32_t mode, uint32_t strength, uint32_t type);
00096
00097 #endif