PinOut: GPIO_Input / GPIO_Output
GPIO( GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin );Read / Write をするピンを設定します
// 例 GPIO pa5(GPIOA, GPIO_PIN_5);
GPIO_PinState read() const noexcept;
HAL_GPIO_ReadPin()
の結果を返します// 例 pa5.read();
GPIO_PinState isSet() const noexcept;
GPIO::read()
の結果がGPIO_PIN_SET
であればtrue
を返します// 例 pa5.isSet();
GPIO_PinState isReset() const noexcept;
GPIO::read()
の結果がGPIO_PIN_RESET
であればtrue
を返します// 例 pa5.isReset();
void write( GPIO_PinState PinState ) const noexcept;
HAL_GPIO_WritePin()
を実行します// 例 pa5.write(GPIO_PIN_SET); pa5.write(GPIO_PIN_RESET); pa5.write(pc13.read());
void set() const noexcept;
GPIO::write(GPIO_PIN_SET)
を実行します// 例 pa5.set();
void setIf( bool condition ) const noexcept;
condition
がtrue
の時にset()
false
の時にreset()
を実行します// 例 pa5.setIf(pc13.isReset());
void reset() const noexcept;
GPIO::write(GPIO_PIN_RESET)
を実行します// 例 pa5.reset();
void resetIf( bool condition ) const noexcept;
condition
がtrue
の時にreset()
false
の時にset()
を実行します// 例 pa5.resetIf(pc13.isSet());
void toggle() const noexcept;
HAL_GPIO_TogglePin()
を実行します// 例 pa5.toggle();