GPIO writesingle


#1

Hello again, I’m starting to get the hang of the C++, UARTS, Events etc but now can’t turn on a simple IO!!
Please bear with me! :blush:

the trace returns -3

static u32 uart_hdl;

// select the IO pin
  #define OUTPUT_PIN 44
  adl_ioDefs_t output_pin = ADL_IO_GPIO | OUTPUT_PIN;
  // configure the IO pin as output with default level set to LOW
  adl_ioDefs_t output_pin_cfg = ADL_IO_GPIO | OUTPUT_PIN | ADL_IO_DIR_OUT | ADL_IO_LEV_LOW;
  // io handle
  s32 output_pin_hdl;
.
.
.
	output_pin_hdl = adl_ioSubscribe( 1, &output_pin_cfg, 0, 0, 0 );
	TRACE((1,"IO write %d",adl_ioWriteSingle ( output_pin_hdl,&output_pin, TRUE )));

#2

Could it be that this pin is multiplexed with something else?


#3

and have you looked-up what -3 means :question:

You should also check that the subscription succeeded before using the handle :exclamation:


#4

:blush: wrong pin!!


#5

I’m sure we’ve all been there & done that…! :laughing: