bool DigitalInputPin::Value() { int ret = 0; switch( GPIOPorts[ (int)_pin ] ) { case PortA: { ret = GPIOA_PDIR & GPIO_PDIR_PDI( GPIO_PIN( GPIOPinNumbers[ (int)_pin ] ) ); break; } case PortB: { ret = GPIOB_PDIR & GPIO_PDIR_PDI( GPIO_PIN( GPIOPinNumbers[ (int)_pin ] ) ); break; } case PortC: { ret = GPIOC_PDIR & GPIO_PDIR_PDI( GPIO_PIN( GPIOPinNumbers[ (int)_pin ] ) ); break; } case PortD: { ret = GPIOD_PDIR & GPIO_PDIR_PDI( GPIO_PIN( GPIOPinNumbers[ (int)_pin ] ) ); break; } case PortE: { ret = GPIOE_PDIR & GPIO_PDIR_PDI( GPIO_PIN( GPIOPinNumbers[ (int)_pin ] ) ); break; } } return ret; }
/* * Play Button: PORT B PIN 11 * */ T_BOOL VolDownButtonState(void){ return (T_BOOL)((GPIOB_PDIR & GPIO_PDIR_PDI(GPIO_PIN(11)))==0); }
/* * Play Button: PORT B PIN 8 * */ T_BOOL PlayButtonState(void){ return (T_BOOL)((GPIOB_PDIR & GPIO_PDIR_PDI(GPIO_PIN(8)))==0); }
/* * Play Button: PORT B PIN 9 * */ T_BOOL StopButtonState(void){ return (T_BOOL)((GPIOB_PDIR & GPIO_PDIR_PDI(GPIO_PIN(9)))==0); }