Logo
UNICENS V2.3.0-4567
User Manual and API Reference
Ucs_Return_t Ucs_Gpio_WritePort ( Ucs_Inst_t self,
uint16_t  node_address,
uint16_t  gpio_port_handle,
uint16_t  mask,
uint16_t  data,
Ucs_Gpio_PinStateResCb_t  result_fptr 
)

Writes data to the given GPIO port.

 This function corresponds with the INIC function INIC.GPIOPortPinState.
Parameters
selfThe UNICENS instance pointer
node_addressAddress of the target device. Use the UCS_ADDR_LOCAL_NODE macro to target the local device.
The following address ranges are supported:
  • [0x10 ... 0x2FF]
  • [0x500 ... 0xFEF]
  • UCS_ADDR_LOCAL_NODE
gpio_port_handleThe GPIO Port resource handle.
 GPIOPortHandle
maskThe GPIO pin to be written.
 Mask
dataThe state of the GPIO pin to be written.
 Data
result_fptrRequired result callback function pointer.
Returns
Possible return values are shown in the table below.
Value Description
UCS_RET_SUCCESS No error
UCS_RET_ERR_PARAM At least one parameter is wrong.
UCS_RET_ERR_BUFFER_OVERFLOW No message buffer is available.
UCS_RET_ERR_API_LOCKED API is currently locked.
UCS_RET_ERR_NOT_SUPPORTED API is not supported in the current Network Supervisor Mode.
UCS_RET_ERR_NOT_INITIALIZED UNICENS is not initialized.
 See also section Example for Ucs_Gpio_WritePort for an example implementation.