Class x74595
Provide an interface to connect to a 74595 shift register
Assembly: x74595.dll
View Source
public class x74595 : IDigitalOutputController, IPinController, ISpiPeripheral
Implements:
Meadow.Hardware.IDigitalOutputController
, Meadow.Hardware.IPinController
, Meadow.Hardware.ISpiPeripheral
Properties
Pins
The pin definitions
View Source
public x74595.PinDefinitions Pins { get; }
DefaultSpiBusSpeed
The default SPI bus speed for the device
View Source
public Frequency DefaultSpiBusSpeed { get; }
SpiBusSpeed
The SPI bus speed for the device
View Source
public Frequency SpiBusSpeed { get; set; }
DefaultSpiBusMode
The default SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }
SpiBusMode
The SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode SpiBusMode { get; set; }
Fields
spiComms
SPI Communication bus used to communicate with the peripheral
View Source
protected ISpiCommunications spiComms
Methods
CreateDigitalOutputPort(IPin, bool, OutputType)
Creates a new DigitalOutputPort using the specified pin and initial state
View Source
public IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState, OutputType outputType)
Returns
Meadow.Hardware.IDigitalOutputPort
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin number to create the port on |
System.Boolean | initialState | Whether the pin is initially high or low |
Meadow.Hardware.OutputType | outputType | The port output type |
Clear(bool)
Clear the shift register buffer
View Source
public void Clear(bool update = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | update | If true, send changes to the shift register |
WriteToPin(IPin, bool)
Sets a particular pin's value.
View Source
public void WriteToPin(IPin pin, bool value)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin to write to. |
System.Boolean | value | The value to write. True for high, false for low. |
IsValidPin(IPin)
Checks whether or not the pin passed in exists on the chip.
View Source
protected bool IsValidPin(IPin pin)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
Meadow.Hardware.IPin | pin |
GetPin(string)
Get pin from name
View Source
public IPin GetPin(string pinName)
Returns
Meadow.Hardware.IPin
: An IPin object
Parameters
Type | Name | Description |
---|---|---|
System.String | pinName | The pin name |
Implements
Meadow.Hardware.IDigitalOutputController
Meadow.Hardware.IPinController
Meadow.Hardware.ISpiPeripheral