Package org.deepjava.flink.subdevices
Class FlinkDAC
- java.lang.Object
-
- org.deepjava.flink.subdevices.FlinkDAC
-
- All Implemented Interfaces:
FlinkDefinitions
public class FlinkDAC extends Object implements FlinkDefinitions
The flink DAC subdevice realizes analog outputs in a flink device. Its number of channels depends on the actual dac chip used.- Author:
- Urs Graf
-
-
Field Summary
Fields Modifier and Type Field Description FlinkSubDevice
dev
Handle to the subdevice within our flink device-
Fields inherited from interface org.deepjava.flink.core.FlinkDefinitions
ANALOG_INPUT_INTERFACE_ID, ANALOG_OUTPUT_INTERFACE_ID, CHANNEL_OFFSET, COUNTER_INTERFACE_ID, GPIO_INTERFACE_ID, HEADER_SIZE, INFO_DEVICE_ID, INFO_DEVICE_SIZE, INTERFACE_TYPE_MASK, MOD_CONF_OFFSET, MOD_STATUS_OFFSET, PPWA_INTERFACE_ID, PWM_INTERFACE_ID, REGISTER_WIDTH, REGISTER_WIDTH_BIT, SIZE_OFFSET, SUBHEADER_SIZE, TOTAL_HEADER_SIZE, TYPE_OFFSET, UART_INTERFACE_ID, UNIQUE_ID_OFFSET, WD_INTERFACE_ID
-
-
Constructor Summary
Constructors Constructor Description FlinkDAC(FlinkSubDevice dev)
Creates a DAC subdevice.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getResolution()
Reads the resolution field of the subdevice.int
getValue(int channel)
Reads the digital value of a channel.void
setValue(int channel, int value)
Sets the digital value for a channel.
-
-
-
Field Detail
-
dev
public FlinkSubDevice dev
Handle to the subdevice within our flink device
-
-
Constructor Detail
-
FlinkDAC
public FlinkDAC(FlinkSubDevice dev)
Creates a DAC subdevice.- Parameters:
dev
- handle to the subdevice
-
-
Method Detail
-
getResolution
public int getResolution()
Reads the resolution field of the subdevice. The field denotes the number of resolvable steps, e.g. a 12 bit converter delivers 4096 steps.- Returns:
- number of resolvable steps
-
getValue
public int getValue(int channel)
Reads the digital value of a channel. Channel number must be smaller than the total number of channels.- Parameters:
channel
- channel number- Returns:
- digital value
-
setValue
public void setValue(int channel, int value)
Sets the digital value for a channel. Channel number must be smaller than the total number of channels.- Parameters:
channel
- channel numbervalue
- digital output value
-
-