I have a port pin set in START as an input to an ADC, but in code I also need to set that same pin temporarily as an output with push pull set high. The code I'm using so far is this:
gpio_set_pin_direction(AD0, GPIO_DIRECTION_OUT); //set direction to output
gpio_set_pin_level(AD0, true); //set output level hi
//gpio_set_pin_function(const uint32_t pin, uint32_t function) //the function define I don't know what to set to
I'm trying to set the pin to a push pull style output with a good drive capability. The output does not go hi and I suspect its because I need to add that last line for set_pin_function to set it to push/pull or something. But I can't find any listing for the names (defines) I can use for the second parameter. It's for a SAMS70 chip
Also, when I want to go back to using the AD, is this the only lines I need (i.e. analog)?
gpio_set_pin_direction(AD0, GPIO_DIRECTION_OFF); //pin in low power state