hw_gpio32_ports.c
656 Bytes
#include <xtensa/tie/xt_ioports.h>
void hw_gpio32_ports_test(void)
{
int abc,ab;
int b = 0x01;
abc = READ_IMPWIRE(); // sample GPIO32 input wires and load variable 'abc' with the 32-bit value.
WUR_EXPSTATE(0xffffffff); // set the GPIO32 output wires to the value from integer variable 'abc'.
ab = READ_IMPWIRE();
abc = RUR_EXPSTATE(); // get the current value of the exported state
//SETB_EXPSTATE( b ); // set only bit 'b' of the exported state (b=0..31)
//CLRB_EXPSTATE(b); // clear only bit 'b' of the exported state
WRMSK_EXPSTATE(abc, b); // masked write of 'abc' to exported state; only the bits set in ma
}