Hi:
I want to set physical pin "D3" as input GPIO and this pin has two functions which are "N2HET2[12]" and "MIBSPI2NENA".
In this point, here codes below are the setting of "pinmux" module and "N2HET[12]" module:
pinmux:
pinMuxReg->PINMUX[97] = SIGNAL_N2HET2_12_D3 | SIGNAL_N2HET2_13_D2 | SIGNAL_N2HET2_14_D1 | SIGNAL_N2HET2_15_K4; // n2het2[12]
....
....
PINMUX_GATE_EMIF_CLK_ENABLE(ON);
PINMUX_EMIF_OUTPUT_ENABLE(ON);
PINMUX_GIOA_DISABLE_HET1_ENABLE(OFF);
PINMUX_GIOB_DISABLE_HET2_ENABLE(OFF);
PINMUX_ETHERNET_SELECT(MII);
PINMUX_ALT_ADC_TRIGGER_SELECT(1);
N2HET[12]:
hetREG2->DOUT = (uint32)((uint32)0U << 12U);
hetREG2->DIR = (uint32) 0x00000000U; // all pin are input
hetREG2->PDR = (uint32) 0x00000000U;// Set HET pins open drain enable
hetREG2->PULDIS = (uint32) 0x00000000U;//Set HET pins pullup/down enable
hetREG2->PSL = (uint32) 0x00000000U;//Set HET pins pullup/down select
hetREG2->HRSH = (uint32) 0x00001000U;//Set HET pins high resolution share
hetREG2->AND = (uint32) 0x00000000U; //- Set HET pins AND share
hetREG2->XOR = (uint32) 0x00000000U;//Set HET pins XOR share
/** - Setup prescaler values
* - Loop resolution prescaler
* - High resolution prescaler
*/
hetREG2->PFR = (uint32)((uint32) 6U << 8U)
| ((uint32) 0U);
/** - Parity control register
* - Enable/Disable Parity check
*/
hetREG2->PCR = (uint32) 0x00000005U;
(void)memcpy((void *)hetRAM2, (const void *)het2PROGRAM, sizeof(het2PROGRAM));
hetREG2->PFR = (uint32)((uint32) 6U << 8U)
| ((uint32) 0U);
hetREG2->INTENAC = 0xFFFFFFFFU;
hetREG2->GCR = ( 0x00000001U
| (uint32)((uint32)0U << 24U)
| (uint32)((uint32)1U << 16U)
| (0x00020000U));
The aim is to set D3 as GPIO input pin, so I set D3 as N2HET[12]. and the logic here I want to realize is below.
if ((gioPORT->DIN & (0x1 << FORCED_UPDATE_PIN)) == 0)
{
do_uart_update();
}
else
{
do_nothing;
}
The result is that when I gave 3.3V voltage to D3, there is nothing happend, is there anything wrong in my setup?
