| Electronic Components Datasheet Search |
|
MCP2200T-I/SS Datasheet(PDF) 20 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
MCP2200T-I/SS Datasheet(HTML) 20 Page - Microchip Technology |
|
20 / 44 page ![]() MCP2200 DS20002228C-page 20 2011-2015 Microchip Technology Inc. 2.3.1.19 ReadPinValue Function: int SimpleIOClass::ReadPinValue(unsigned int pin) EXAMPLE 2-19: 2.3.1.20 ReadPort Function: bool SimpleIOClass::ReadPort(unsigned int *returnvalue) EXAMPLE 2-20: Summary: Reads the specified pin. Description: Reads the specified pin and returns the value as the return value. If the pin has been configured as a digital input, the return value will be either ‘0’ or ‘1’. If an error occurs, the function will return a value of 0x8000. Precondition: Must be previously configured as an input via a ConfigureIO call. VID and PID must be previously set via a call to InitMCP2200(VID, PID). Parameters: pin - the pin number to set (0-7) Returns: This function returns the read value of the pin, or returns a value of 0x8000, if an error occurs. Remarks: None. Summary: Reads the GPIO port as digital input. Description: Reads the GPIO port and returns the value in returnvalue. This provides a means to read all pins simultaneously, instead of one-by-one. Precondition: Must be previously configured as an input via a ConfigureIO call. VID and PID must be previously set via a call to InitMCP2200(VID, PID). Parameters: • pin - the pin number to set (0-7) • returnvalue - the value read on the pin (‘0’ or ‘1’) Returns: This function returns True if the transmission is successful and returns False if the transmission fails. Remarks: Pins configured for output return the current state of the port. Pins configured as input read as zero. unsigned int rv; if (SimpleIOClass::ReadPinValue(0) != 0x8000) { lblStatusBar->Text = “Success”; } else lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError; unsigned int rv; if (SimpleIOClass::ReadGPIOPort (0, &rv)) { lblStatusBar->Text = “Success”; } else lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError; |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |