TJA1145 Example Code :PortSupervisor() ---Which input GPIO is it?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TJA1145 Example Code :PortSupervisor() ---Which input GPIO is it?

1,092 Views
fengjuntian
Contributor I

 

TJA1145 Example Code :PortSupervisor() ---Which input GPIO is it?

How to implement Byte ScanPort(void) function?

/// Port monitoring
/** This function reads an input port of the microcontroller. Depending on the result 3 different
* mode changes are possible:
* - Enter Sleep Operation Mode
* - Enter Standby Operation Mode
* - Enter Normal Operation Mode
*
* \author jh
* \version 1.0
* \date 2013/06/05
* \return <b>StdReturn_t</b> Function executed successfully or not
* possible values: E_OK, E_NOT_OK
*/
void PortSupervisor (void){
Byte portData = 0;

portData = ScanPort();
if((portData & PORTMASK_NORMAL) == 0){
// Normal
AddTaskToScheduler(CHANGE_TO_NORMAL);
}
else if((portData & PORTMASK_STANDBY) == 0){
// Standby
AddTaskToScheduler(CHANGE_TO_STANDBY);
}
else if((portData & PORTMASK_SLEEP) == 0){
// Sleep
AddTaskToScheduler(CHANGE_TO_SLEEP);
}
}

 


/**
* \brief Read GPIO port configured as input port
* \todo implement this function with your microcontroller specific code
* - Read GPIO port
* \return Port input value
*/
Byte ScanPort(void){
// Insert your microcontroller specific code here
// e.g. Read GPIO port and return value
return 1;
}

0 Kudos
Reply
1 Reply

1,065 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

it's RXD signal.

lukaszadrapa_0-1636046787345.png

Depending on the microcontroller you have, it's necessary to read the state of RXD pin. For example, if you have MPC5xxx or S32K3 device, read corresponding GPDI register in SIUL module.

Regards,

Lukas

0 Kudos
Reply