Example #1
0
 private static extern ResultCode GpioCfgClockUnmanaged(uint microSecs, CpuPeripheral peripheral, uint configSource);
Example #2
0
 /// <summary>
 /// Configures pigpio to use a particular sample rate timed by a specified
 /// peripheral.
 ///
 /// This function is only effective if called before <see cref="GpioInitialise"/>.
 ///
 /// The timings are provided by the specified peripheral (PWM or PCM).
 ///
 /// The default setting is 5 microseconds using the PCM peripheral.
 ///
 /// The approximate CPU percentage used for each sample rate is:
 ///
 /// A sample rate of 5 microseconds seeems to be the sweet spot.
 /// </summary>
 /// <remarks>
 /// sample  cpu
 ///  rate    %
 ///
 ///   1     25
 ///   2     16
 ///   4     11
 ///   5     10
 ///   8     15
 ///  10     14.
 /// </remarks>
 /// <param name="microSecs">1, 2, 4, 5, 8, 10.</param>
 /// <param name="peripheral">0 (PWM), 1 (PCM).</param>
 /// <returns>The result code.</returns>
 public static ResultCode GpioCfgClock(uint microSecs, CpuPeripheral peripheral)
 {
     return(GpioCfgClockUnmanaged(microSecs, peripheral, 0));
 }