コード例 #1
0
 /// <summary>
 /// Specifies that the pin on the controller should be opened in shared read-only mode.
 /// </summary>
 /// <param name="configuration">An instance of Windows.Devices.Gpio.IGpioPinConfiguration
 /// containing the current configuration used top open the pin on the controller.</param>
 /// <returns>Returns an instance of Windows.Devices.Gpio.IGpioPinConfiguration
 /// used to open the pin on the controller.</returns>
 public static IGpioPinConfiguration AsSharedReadOnly(this IGpioPinConfiguration configuration)
 {
     configuration.SharingMode = GpioSharingMode.SharedReadOnly;
     return(configuration);
 }
コード例 #2
0
 /// <summary>
 /// Opens the pin on the controller using the configuration provided.
 /// </summary>
 /// <param name="configuration">An instance of Windows.Devices.Gpio.IGpioPinConfiguration
 /// containing the current configuration used top open the pin on the controller.</param>
 /// <returns>Returns an instance of Windows.Devices.Gpio.GpioPin if it is successfully
 /// opened.</returns>
 public static GpioPin Open(this IGpioPinConfiguration configuration)
 {
     return(configuration.Gpio.OpenPin(configuration.PinNumber, configuration.SharingMode));
 }
コード例 #3
0
 /// <summary>
 /// Specifies that the pin on the controller should be opened in exclusive mode.
 /// </summary>
 /// <param name="configuration">An instance of Windows.Devices.Gpio.IGpioPinConfiguration
 /// containing the current configuration used top open the pin on the controller.</param>
 /// <returns>Returns an instance of Windows.Devices.Gpio.IGpioPinConfiguration
 /// used to open the pin on the controller.</returns>
 public static IGpioPinConfiguration AsExclusive(this IGpioPinConfiguration configuration)
 {
     configuration.SharingMode = GpioSharingMode.Exclusive;
     return(configuration);
 }