/** * @briefSet a GPIO pin state via the GPIO byte register * @parampGPIO: The base of GPIO peripheral on the chip * @param port: GPIO Port number where @a pin is located * @parampin: GPIO pin to set * @paramsetting: true for high, false for low * @returnNothing * @noteThis function replaces Chip_GPIO_WritePortBit() */ STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting) |
Example: Chip_GPIO_SetPinState(LPC_GPIO, 0, 5, true); /* Set PIO0_5 high */ |
/** * @briefSet all GPIO raw pin states (regardless of masking) * @parampGPIO: The base of GPIO peripheral on the chip * @paramport: GPIO Port number where @a pin is located * @paramvalue: Value to set all GPIO pin states (0..n) to * @returnNothing */ STATIC INLINE void Chip_GPIO_SetPortValue(LPC_GPIO_T *pGPIO, uint8_t port, uint32_t value) |
Example: Chip_GPIO_SetPortValue(LPC_GPIO, 0, ((1<<5) | (1<<7))); /* Set PIO0_5 and PIO0_7 high, but all others low */ |
Chip_GPIO_SetPortOutLow(LPC_GPIO, 1, ((1<<4) | (1<<5) | (1<<9))); /* Set only pins 4, 5, and 9 on port 1 low */ Chip_GPIO_SetPortOutHigh(LPC_GPIO, 1, ((1<<4) | (1<<5) | (1<<9))); /* Set only pins 4, 5, and 9 on port 1 high*/ |