Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hello, I am trying to use CAN pins as GIO. I found the code and understood how to use CAN_3 of TMS570LS as GIO output, but I don't know how to use the value of the register set as an input on my code. I have set my CAN3 register as output using this function code:
int SOC(int value){
if (value==1){
canREG3->TIOC = (uint32)((uint32)1U << 18U )
| (uint32)((uint32)1U << 17U )
| (uint32)((uint32)0U << 16U )
| (uint32)((uint32)0U << 3U )
| (uint32)((uint32)1U << 2U )
| (uint32)((uint32)1U << 1U );
SOCbit=1;
}
else if (value==0){
canREG3->TIOC = (uint32)((uint32)1U << 18U )
| (uint32)((uint32)1U << 17U )
| (uint32)((uint32)0U << 16U )
| (uint32)((uint32)0U << 3U )
| (uint32)((uint32)1U << 2U )
| (uint32)((uint32)0U << 1U );
SOCbit=0;
}
return SOCbit;
}
With halogen and checking the TRM section 24.17.31 I set the CAN3_RX as a GIO input:
canREG3->RIOC = (uint32)((uint32)0U << 18U )
| (uint32)((uint32)0U << 17U )
| (uint32)((uint32)1U << 16U )
| (uint32)((uint32)0U << 3U )
| (uint32)((uint32)0U << 2U )
| (uint32)((uint32)0U << 1U );
My question is, how can I see if in the electronics I have a 0 or a 1? Reading the TMR section 24.27.31, I suppose I have to use bit 0 of register canREG3, but how can I check that bit in the code?
I can't write:
canREG3->RIOC (uint32)((uint32) << 0U )