- added missing declarations
- reduced compiler warnings git-svn-id: http://moon:8086/svn/mips@180 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+2
-2
@@ -15,13 +15,13 @@ uint32_t gpio_clean(gpio_if_t *pGPIO)
|
||||
|
||||
uint32_t gpio_write(gpio_if_t *pGPIO, uint32_t mask, uint32_t shift, uint32_t offset, uint32_t value)
|
||||
{
|
||||
*(pGPIO->pBase + offset) = (*(pGPIO->pBase + offset) & ~(mask << shift)) | ((value & mask) << shift);
|
||||
*(pGPIO->pBase + offset) = (((*(pGPIO->pBase + offset) >> shift) & ~mask) | (value & mask)) << shift;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t gpio_read(gpio_if_t *pGPIO, uint32_t mask, uint32_t shift, uint32_t offset, uint32_t *pValue)
|
||||
{
|
||||
*pValue = (*(pGPIO->pBase + offset) & (mask << shift)) >> shift;
|
||||
*pValue = (*(pGPIO->pBase + offset) >> shift) & mask;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user