03-12-2007 06:01 AM
03-13-2007 06:35 PM
The 32-bit digital port registers were not included in the chipobject (by mistake). The digital intput register is at offset 0x414 and the digital output register is at 0x510. To access them you can use the tAddressSpace object directly:
u32 value;
value = Bar1.readU32(0x414); // read digital 32-bit port
Bar1.writeU32 (0x510, value); // write digital 32-bit port
For configuration, use the IO_Pin_x_x_Configuration_Register registers to configure the line for input or output.
For example, to configure line 0 and 1 for input
tio->IO_Pin_0_1_Configuration_Register.setIO_Filter_0_Select (0); // no filter
tio->IO_Pin_0_1_Configuration_Register.setIO_Pin_0_Select (0); //input
tio->IO_Pin_0_1_Configuration_Register.setIO_Filter_1_Select (0); // no filter
tio->IO_Pin_0_1_Configuration_Register.setIO_Pin_1_Select (0); //input
tio->IO_Pin_0_1_Configuration_Register.flush (0);
or lines 29, 30 and 31 for output:
tio->IO_Pin_28_29_Configuration_Register.setIO_Filter_29_Select (0); //no filter
tio->IO_Pin_28_29_Configuration_Register.setIO_Pin_29_Select (2); // digital output
tio->IO_Pin_28_29_Configuration_Register.flush (0);
tio->IO_Pin_30_31_Configuration_Register.setIO_Filter_30_Select (0); //no filter
tio->IO_Pin_30_31_Configuration_Register.setIO_Pin_30_Select (2); // digital output
tio->IO_Pin_30_31_Configuration_Register.setIO_Filter_31_Select (0); //no filter
tio->IO_Pin_30_31_Configuration_Register.setIO_Pin_31_Select (2); // digital output
tio->IO_Pin_30_31_Configuration_Register.flush (0);
valid values for the select field are:
0 - input
1 - counter output
2 - digital output
I hope this helps.