pulled in gpio_data_get from the quahogcon guys.

This commit is contained in:
Mariano Alvira 2010-05-04 12:55:29 -04:00
parent 444d79e55f
commit 7b3a8b9f77
2 changed files with 10 additions and 0 deletions

View file

@ -13,6 +13,15 @@ inline void gpio_data(volatile uint64_t data)
*GPIO_DATA1 = (data >> 32);
}
inline uint64_t gpio_data_get(volatile uint64_t bits) {
uint64_t rdata = 0;
rdata = *GPIO_DATA0 & (bits & 0xffffffff);
rdata |= (*GPIO_DATA1 & (bits >> 32)) << 32;
return rdata;
}
inline void gpio_pad_pu_en(volatile uint64_t data)
{
*GPIO_PAD_PU_EN0 = (data & 0xffffffff);

View file

@ -27,6 +27,7 @@
inline void gpio_pad_dir(volatile uint64_t data);
inline void gpio_data(volatile uint64_t data);
inline uint64_t gpio_data_get(volatile uint64_t bits);
inline void gpio_pad_pu_en(volatile uint64_t data);
inline void gpio_data_sel(volatile uint64_t data);
inline void gpio_data_pu_sel(volatile uint64_t data);