Document number 205065Version Rev. NIssue date 2019-02-04Sirius OBC and TCM User Manualwww.aacmicrotec.com Page 73 of 1745.8. GPIO5.8.1. DescriptionThis driver software for the GPIO IP handles the setting and reading of general purposeinput/output pins. It implements the standard set of device file operations according to [RD7].The GPIO IP has, apart from logical pin and input/output operations, also a number of otherfeatures.5.8.1.1. Falling and rising edge detectionOnce configured, the GPIO IP can detect rising or falling edges on a pin and alert the driversoftware by the means of an interrupt.5.8.1.2. Time stamping in SCETInstead, or in addition to the interrupt, the GPIO IP can also signal the SCET to sample thecurrent timer when a rising or falling edge is detected on a pin. Reading the time of thetimestamp requires interaction with the SCET and exact register address depends on thecurrent board configuration. One SCET sample register is shared by all GPIOs.5.8.1.3. RTEMS differential modeIn RTEMS, a GPIO pin can also be set to operate in differential mode on output only. Thisrequires two pins working in tandem and if this functionality is enabled, the driver willautomatically adjust the setting of the paired pin to output mode as well. The pins are pairedin logical sequence, which means that pin 0 and 1 are paired as are pin 2 and 3 etc. Thus, indifferential mode it is recommended to operate on the lower numbered pin only to avoidconfusion. Pins can be set in differential mode on specific pair only, i.e. both normal singleended and differential mode pins can operate simultaneously (though not on the same pinsobviously).5.8.1.4. Operating on pins with pull-up or pull-downFor scenarios when one or multiple pins are connected to a pull-up or pull-down (for e.g.open-drain operation), it's recommended that the output value of such a pin should alwaysbe set to 1 for pull-down or 0 for pull-up mode. The actual pin value should then be selectedby switching between input or output mode on the pin to comply with the external pullfeature.5.8.2. RTEMS APIThis API represents the driver interface of the module from an RTEMS user application'sperspective.The driver functionality is accessed through the RTEMS POSIX API for ease of use. In caseof a failure on a function call, the errno value is set for determining the cause.5.8.2.1. Function int open(...)Opens access to the specified GPIO pin, but do not reset the pin interface and insteadretains the settings from any previous access.