本文整理汇总了C++中PIO_Get函数的典型用法代码示例。如果您正苦于以下问题:C++ PIO_Get函数的具体用法?C++ PIO_Get怎么用?C++ PIO_Get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PIO_Get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: platform_pio_op
pio_type platform_pio_op( unsigned port, pio_type pinmask, int op )
{
Pin* pin;
pio_type retval = 1;
pin = pio_port_desc + port;
pin->mask = pinmask;
switch( op )
{
case PLATFORM_IO_PORT_SET_VALUE:
case PLATFORM_IO_PIN_SET:
PIO_Set( pin );
break;
case PLATFORM_IO_PIN_CLEAR:
PIO_Clear( pin );
break;
case PLATFORM_IO_PORT_DIR_INPUT:
pin->mask = 0x7FFFFFFF;
case PLATFORM_IO_PIN_DIR_INPUT:
pin->type = PIO_INPUT;
PIO_Configure( pin, 1 );
break;
case PLATFORM_IO_PORT_DIR_OUTPUT:
pin->mask = 0x7FFFFFFF;
case PLATFORM_IO_PIN_DIR_OUTPUT:
pin->type = PIO_OUTPUT_0;
PIO_Configure( pin, 1 );
break;
case PLATFORM_IO_PORT_GET_VALUE:
pin->mask = 0x7FFFFFFF;
pin->type = PIO_INPUT;
retval = PIO_Get( pin );
break;
case PLATFORM_IO_PIN_GET:
retval = PIO_Get( pin ) & pinmask ? 1 : 0;
break;
case PLATFORM_IO_PIN_PULLUP:
pin->pio->PIO_PPUER = pinmask;
break;
case PLATFORM_IO_PIN_NOPULL:
pin->pio->PIO_PPUDR = pinmask;
break;
default:
retval = 0;
break;
}
return retval;
}
示例2: ISR_Bp2
/**
* @brief Interrupt handler for Button 2 - decrements the counter value
*/
static void ISR_Bp2(void)
{
// Check if the button has been pressed
if (!PIO_Get(&pinPB2))
{
//wait until button gets released
while (!PIO_Get(&pinPB2))
;
counter = ((counter-1)%8);
}
}
示例3: stepper_get_step_mode
uint8_t stepper_get_step_mode(void) {
bool usm[2] = {PIO_Get(&pin_usm[0]), PIO_Get(&pin_usm[1])};
if(!usm[0] && !usm[1]) {
return STEP_MODE_FULL;
} else if(usm[0] && !usm[1]) {
return STEP_MODE_HALF;
} else if(!usm[0] && usm[1]) {
return STEP_MODE_QUARTER;
} else {
return STEP_MODE_EIGTH;
}
}
示例4: prvConfigureVBus
static void prvConfigureVBus( void )
{
const Pin xVBusPin = PIN_USB_VBUS;
const uint32_t ulPriority = 7; /* Highest. */
/* Configure PIO to generate an interrupt on status change. */
PIO_Configure( &xVBusPin, 1 );
PIO_ConfigureIt( &xVBusPin );
/* Ensure interrupt is disabled before setting the mode and installing the
handler. The priority of the tick interrupt should always be set to the
lowest possible. */
AIC->AIC_SSR = ID_PIOE;
AIC->AIC_IDCR = AIC_IDCR_INTD;
AIC->AIC_SMR = AIC_SMR_SRCTYPE_EXT_POSITIVE_EDGE | ulPriority;
AIC->AIC_SVR = ( uint32_t ) prvVBusISRHandler;
/* Start with the interrupt clear. */
AIC->AIC_ICCR = AIC_ICCR_INTCLR;
PIO_EnableIt( &xVBusPin );
AIC_EnableIT( ID_PIOE );
/* Check current level on VBus */
if( PIO_Get( &xVBusPin ) != pdFALSE )
{
/* If VBUS present, force the connect */
USBD_Connect();
}
else
{
USBD_Disconnect();
}
}
示例5: ISR_Pit
//------------------------------------------------------------------------------
/// Interrupt service routine for the PIT. Debounces the wake-up pin input.
//------------------------------------------------------------------------------
static void ISR_Pit(void)
{
static unsigned long debounceCounter = DEBOUNCE_TIME;
unsigned long pisr = 0;
// Read the PISR
pisr = PIT_GetStatus() & AT91C_PITC_PITS;
if (pisr != 0) {
// Read the PIVR. It acknowledges the IT
PIT_GetPIVR();
}
// Button released
if (PIO_Get(&pinWakeUp)) {
debounceCounter = DEBOUNCE_TIME;
}
// Button still pressed
else {
debounceCounter--;
}
// End of debounce time
if (debounceCounter == 0) {
debounceCounter = DEBOUNCE_TIME;
PIT_DisableIT();
AT91C_BASE_PITC->PITC_PIMR &= ~AT91C_PITC_PITEN;
COMPOSITEDDriver_RemoteWakeUp();
}
}
示例6: SysTick_Handler
//------------------------------------------------------------------------------
/// Interrupt service routine for the system tick. Debounces the wake-up pin input.
//------------------------------------------------------------------------------
void SysTick_Handler(void)
{
// Button released
if (PIO_Get(&pinWakeUp))
{
debounceCounter = DEBOUNCE_TIME;
}
// Button still pressed
else
{
debounceCounter--;
}
// End of debounce time
if (debounceCounter == 0)
{
// Disable debounce timer
SysTick_Configure(1, BOARD_MCK/1000, 0);
debounceCounter = DEBOUNCE_TIME;
HIDDMouseDriver_RemoteWakeUp();
}
}
示例7: ENCODER_ISR_UP
//updates position value if turning clockwise
void ENCODER_ISR_UP (const Pin *encoder_pin_cw )
{
//only updates on change from high to low
if(!PIO_Get(encoder_pin_cw)){
encoder_position_output++;
}
}
示例8: Accel_Z_ST
int Accel_Z_ST(void)
{
char value[2];
while(!PIO_Get(&(accIntPins[0]))){nop();} // wait for data ready pin
ReadAccelData(0x2C|(1<<7), value, 2); // ST chip
return ((signed char)value[1]<<8)|value[0];
}
示例9: usb_isr_vbus
void usb_isr_vbus(const Pin *pin) {
// Check current level on VBus
if (PIO_Get(&pin_usb_detect)) {
USBD_Connect();
} else {
USBD_Disconnect();
}
}
示例10: WakeUpHandler
//------------------------------------------------------------------------------
/// Interrupt service routine for the remote wake-up pin. Starts the debouncing
/// sequence.
//------------------------------------------------------------------------------
static void WakeUpHandler(const Pin *pin)
{
TRACE_DEBUG("Wake-up handler\n\r");
// Check current level on the remote wake-up pin
if (!PIO_Get(&pinWakeUp)) {
ConfigurePit();
}
}
示例11: AccelCallback
static void AccelCallback(void)
{
#ifdef STACCEL
char value[6];
while(!PIO_Get(&(accIntPins[0]))){nop();} // wait for data ready pin
ReadAccelData(0x28|(1<<7),value,6); // ST chip
g_AccelX = ((signed char)value[1]<<8)|value[0];
g_AccelY = ((signed char)value[3]<<8)|value[2];
g_AccelZ = ((signed char)value[5]<<8)|value[4];
#else
char value[3];
if(g_idle) return;
while(!PIO_Get(&(accIntPins[0]))){nop();} // wait for data ready pin
ReadAccelData(0x6,value,3);
g_AccelX = (signed char)value[0];
g_AccelY = (signed char)value[1];
g_AccelZ = (signed char)value[2];
#endif
}
示例12: VBus_Configure
//------------------------------------------------------------------------------
/// Configures the VBus pin to trigger an interrupt when the level on that pin
/// changes.
//------------------------------------------------------------------------------
static void VBus_Configure( void ) {
// Configure PIO
PIO_Configure(&pinVbus, 1);
PIO_ConfigureIt(&pinVbus, ISR_Vbus);
PIO_EnableIt(&pinVbus);
// Check current level on VBus
if (PIO_Get(&pinVbus))
// if VBUS present, force the connect
USBD_Connect();
}
示例13: ISR_PioSmartCard
/**
* PIO interrupt service routine. Checks if the smartcard has been connected
* or disconnected.
*/
static void ISR_PioSmartCard(const Pin *pPin)
{
/* Check all pending interrupts */
if ((pinSmartCard.pio->PIO_ISR & pinSmartCard.mask) != 0) {
/* Check current level on pin */
if (PIO_Get(&pinSmartCard ) == 0)
printf("-I- Smartcard inserted\n\r");
else
printf("-I- Smartcard removed\n\r");
}
}
示例14: prvVBusISRHandler
static void prvVBusISRHandler( void )
{
const Pin xVBusPin = PIN_USB_VBUS;
/* Check current level on VBus to detect a connect/disconnect. */
if( PIO_Get( &xVBusPin ) != 0 ) {
USBD_Connect();
} else {
USBD_Disconnect();
}
}
示例15: ISR_PioSmartCard
//------------------------------------------------------------------------------
/// PIO interrupt service routine. Checks if the smartcard has been connected
/// or disconnected.
//------------------------------------------------------------------------------
static void ISR_PioSmartCard(const Pin *pPin)
{
// Check current level on pin
if (PIO_Get(&pinSmartCard) == 0) {
printf("-H- Insert\n\r");
CCID_Insertion();
} else {
printf("-H- Removal\n\r");
CCID_Removal();
}
}