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;
}
}