This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using NHET without alternative functions as GIO

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN, TMS570LS3137

I have been trying to implement a function that sets NHET pins as GIO outputs and are having difficulties setting the ones that do no have alternate functions.

I am using a TMS570LC4357 and for example I am trying to set N2HET2[23] to have a high output. Is there any special settings that have to be made to get these N2HET pins work as GIO outputs? Sorry for terrible syntax btw.

/* portReg is mapped to the corresponding control register and are setting the right pins */

// Set pull up or down or nothing.
if (pin->config & PORT_PULL_NONE) {
portReg->PULDIS |= mask;
}else {
portReg->PULDIS &= ~mask;

if (pin->config & PORT_PULL_UP) {
portReg->PSL |= mask;

} else {
portReg->PSL &= ~mask;
}
}

if (pin->config & PORT_DIR_OUT) {
portReg->DIR |= mask;

if(pin->config & PORT_PIN_LEVEL_HIGH){
portReg->DOUT |= mask;
}

 

if (pin->config & PORT_ODE_ENABLE) {
portReg->PDR |= mask;
} else {
portReg->PDR &= ~mask;
}

}