IPC Module - Digital Inputs Service

This page contains documentation of the Digital Inputs Outputs API.

The available digital inputs and the possible configurations are hardware dependent. Check the hardware specification to find the available ports and possible configurations for your device.

Wake-up enabled pins will wake up the system regardless of the pin being requested or not.

Messages

message digital_input_channel_set_configuration_req
Parameters:
  • channel (enum digital_input_channel) – The channel to configure

  • analog_low_threshold_mv (uint32) – Thresholds for analog-as-digital inputs in millivolts. When the voltage value drops below the Low threshold, the input will be considered low, and when the voltage value rises above the High threshold it will be considered high. Check hardware specification for minimum and maximum values. Values are ignored for digital input pins.

  • analog_high_threshold_mv (uint32) – see a_ipc_msg_digital_input_channel_set_configuration_req::analog_low_threshold_mv

  • enable_wakeup (uint8) – Use pin to wake system up from sleep or standby. Any transition will trigger a wakeup. Values are ignored for analog-as-digital inputs.

Return message:

digital_input_channel_set_configuration_rsp

Configure a digital input channel.

Values configured are stored persistently.

Not valid to call for ONSW.

message digital_input_channel_set_configuration_rsp
Parameters:
message digital_input_channel_get_configuration_req
Parameters:

channel (enum digital_input_channel) – The channel to read configuration of

Return message:

digital_input_channel_get_configuration_rsp

Read configuration of a digital input channel.

Not valid to call for ONSW.

message digital_input_channel_get_configuration_rsp
Parameters:
  • result (enum digital_input_result) – Result of the operation.

  • channel (enum digital_input_channel) – The channel that was read configuration for.

  • analog_low_threshold_mv (uint32) – Current thresholds for analog-as-digital inputs in millivolts. Values should be ignored for digital input pins.

  • analog_high_threshold_mv (uint32) – see a_ipc_msg_digital_input_channel_get_configuration_rsp::analog_low_threshold_mv

  • enable_wakeup (uint8) – Enabled pin to wake system up from sleep or standby. Values should be ignored for analog-as-digital inputs.

message digital_input_channel_request_req
Parameters:
Return message:

digital_input_channel_request_rsp

Request a digital input channel to be enabled.

The channel will be enabled if there is at least one user request.

message digital_input_channel_request_rsp
Parameters:
message digital_input_channel_release_req_norsp
Parameters:

Release a digital input channel for given ‘user’.

The channel will be disabled if there are no outstanding requests.

message digital_input_channel_status_req
Parameters:

channel (enum digital_input_channel) – The channel to read status of.

Return message:

digital_input_channel_status_rsp

Read status of a digital input channel.

message digital_input_channel_status_rsp
Parameters:

The current status of a digital input channel.

values are only valid when result is OK.

message digital_input_channel_status_publish_ind
Parameters:

Event indicator for channel values.

Sent periodically or on each ONSW and DIN prefixed input change.

At least one input must be enabled for the event to be sent. Disabled inputs will not be included in this event,

message digital_input_channel_status_subscribe_req

Subscribe to digital_input_channel_status_publish_ind messages

message digital_input_channel_status_subscribe_rsp
Parameters:

result (enum ipc_subscribe_result)

Result from digital_input_channel_status_subscribe_req

message digital_input_channel_status_unsubscribe_req_norsp

Unsubscribe from digital_input_channel_status_publish_ind messages

Enums

enum digital_input_result

Result codes.

Constant

Value

Description

OK

0

OK

ERROR_INVALID_PARAMETER

1

Invalid parameter

ERROR_CHANNEL_NOT_AVAILABLE

2

Channel not available

ERROR_INTERNAL

3

Internal

enum digital_input_channel

Digital channels. These channels correspond to physical pins in the main connector. It is possible that not all channels are available. Check hardware specification to find available channels. Analog inputs when used through this API function as digital inputs, refer to ServiceLink{analog inputs,analog-inputs} to use them as true analog inputs.

Constant

Value

Description

ONSW

0

ONSW

DIN_1

1

DIN_1

DIN_2

2

DIN_2

DIN_3

3

DIN_3

DIN_4

4

DIN_4

DIN_5

5

DIN_5

DIN_6

6

DIN_6

DIN_7

7

DIN_7

DIN_8

8

DIN_8

AIN_1

9

AIN_1

AIN_2

10

AIN_2

AIN_3

11

AIN_3

AIN_4

12

AIN_4

AIN_5

13

AIN_5

AIN_6

14

AIN_6

AIN_7

15

AIN_7

AIN_8

16

AIN_8

NUMBER_OF_CHANNELS

17

enum digital_input_value

Possible values for digital input pins.

Constant

Value

Description

LOW

0

Signal is low

HIGH

1

Signal is high

UNAVAILABLE

2

Signal level cannot be determined, i.e. a floating analog pin.

enum digital_input_state

State of a digital input.

Constant

Value

Description

DISABLED

0

Disabled

ENABLED

1

Enabled