This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

get port state from output port

Hi everyone:

by default , when a port(Port0) setting to output mode. when i want to read the port(Port0) , i will get the port Output state. but at the nRF51822(NRf6310) , but it always get 0x00 value.

nrf_gpio_range_cfg_output(TWO_LED_3,SENVENT_LED_7); //settting the pin number to output
nrf_gpio_port_write(LED_OUTPORT_0,nrf_gpio_port_read(LED_OUTPORT_0)&(~BIT_FIVE_LED_6));//read the port state and change one bit ,it always get 0x00 from output state

why is it wrong? how to solve it ? (i want to only change one bit at output port)

Parents Reply Children
No Data
Related