Package io.openems.edge.io.gpio.hardware
Interface HardwarePlatform
- All Known Implementing Classes:
ModBerryX500CM4
,ModberryX500M40804Max
,ModberryX500M40804W
,ModberryX500M40804Wb
public interface HardwarePlatform
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createPinObjects
(List<ChannelId> channels) Creates pin objects based on hardware enum description.Gets all channels of the hardware.getGpioValueByChannelId
(AbstractGpioChannel channelId) Gets the value of a GPIO pin based on the given channel.default List
<ReadChannelId> Gets all read channels of the hardware device.default List
<WriteChannelId> Gets the write channel IDs of the platform.void
setGpio
(WriteChannelId channelId, boolean value) Sets the value of a GPIO based.
-
Method Details
-
getAllChannelIds
Gets all channels of the hardware.- Returns:
- List of hardware pins.
-
getWriteChannelIds
Gets the write channel IDs of the platform.- Returns:
- List of WriteChannelIds.
-
getReadChannelIds
Gets all read channels of the hardware device. These include digital and analog inputs.- Returns:
- List of hardware pins.
-
createPinObjects
Creates pin objects based on hardware enum description.- Parameters:
channels
- List of hardware description values. Each of the will be exported as a channel.
-
getGpioValueByChannelId
Gets the value of a GPIO pin based on the given channel.- Parameters:
channelId
- hardware channel to be queried.- Returns:
- the value of the digital IO.
true
if high, otherwisefalse
.
-
setGpio
Sets the value of a GPIO based.- Parameters:
channelId
- hardware channel to setvalue
- the new requested value. In case of digital IOs, the value should beboolean
.- Throws:
OpenemsException
- thrown in the case if there is an OS/Hardware failure.
-