void read_R() { int i; IO004_ResetPin(CE); delay(50000); uint8_t temp = 0; for (i = 7; i > -1; i--) { if (IO004_ReadPin(DATA)) temp |= (1 << i); pulse_R(); } data_R = temp; IO004_SetPin(CE); delay(50000); }
void encoder_TurnHandler(void) { uint32_t enc2 = IO004_ReadPin(IO004_Handle8); debounce(); uint32_t enc1 = IO002_ReadPin(IO002_Handle0); if(!enc1) { if(enc2) { input = CLOCKWISE; }else { input = COUNTERCLOCKWISE; } } }
int psxTrocaByte(int byteDado) { int c; int aux = 0; for (c = 0; c <= 7; c++) { if (byteDado & (0x01 << c)) IO004_SetPin(CMD); else IO004_ResetPin(CMD); IO004_ResetPin(CONT_CLK); delay(tempoClk); if (!IO004_ReadPin(CONT_DADO)) aux = aux | (1 << c); IO004_SetPin(CONT_CLK); delay(tempoClk); } IO004_SetPin(CMD); delay(tempoEntreByte); return aux; }
int connectStatus(void) { return IO004_ReadPin(IO004_Handle2); }
int checkStatusCts(void) { return IO004_ReadPin(IO004_Handle1); }
int statusRtsFlowControl(void) { return IO004_ReadPin(IO004_Handle0); }