| | 161 | |
|---|
| | 162 | void set_gpio(int gpio,int state) |
|---|
| | 163 | { |
|---|
| | 164 | #if defined(CYGPKG_HAL_MIPS_AR2316) |
|---|
| | 165 | *(volatile unsigned *)AR2316_GPIO_CR |= 1<<gpio; /*set GPIO0 to be output */ |
|---|
| | 166 | if (state) |
|---|
| | 167 | *(volatile unsigned *)AR2316_GPIO_DO |= 1<<gpio; /*set GPIO0 to 1 to spi flash CS normal state */ |
|---|
| | 168 | else |
|---|
| | 169 | *(volatile unsigned *)AR2316_GPIO_DO &= ~(1<<gpio); /*set GPIO0 to 1 to spi flash CS normal state */ |
|---|
| | 170 | #else |
|---|
| | 171 | *(volatile unsigned *)AR531X_GPIO_CR &= ~(1<<gpio); /*set GPIO0 to be output */ |
|---|
| | 172 | if (state) |
|---|
| | 173 | *(volatile unsigned *)AR531X_GPIO_DO |= 1<<gpio; /*set GPIO0 to 1 to spi flash CS normal state */ |
|---|
| | 174 | else |
|---|
| | 175 | *(volatile unsigned *)AR531X_GPIO_DO &= ~(1<<gpio); /*set GPIO0 to 1 to spi flash CS normal state */ |
|---|
| | 176 | #endif |
|---|
| | 177 | |
|---|
| | 178 | } |
|---|