CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches

◆ CAN_SignalObjectEvent()

void CAN_SignalObjectEvent ( uint32_t  obj_idx,
uint32_t  event 
)

After that CAN aneded operation eand the interrupt is generated this object function is called which marks which action completed.

Parameters
[in]obj_idx
[in]event
Returns
No parameters
388void CAN_SignalObjectEvent(uint32_t obj_idx, uint32_t event)
389{
390 uint8_t i;
391
392 tempo=0; //Si resetta il contatore per il powerdown
393 evento_CAN= event;
394 if(event==ARM_CAN_EVENT_RECEIVE) // Se c'\'e un evento di ricezione
395 {
396 if (obj_idx == rx_obj_idx) // Se si riceve l'evento dell'oggetto
397 {
398 messaggio_CAN_arrivato=true; // Se c'\'e un'istruzione dal can, il flag diventa true
399 CANdrv->MessageRead(rx_obj_idx, &rx_msg_info, (uint8_t *) rx_data, 8U); // Viene letto il dato ricevuto
400// for(i=0;i<8;++i)
401// {
402// tx_data[i]=rx_data[i]; // Viene copiato il dato nell'array di ricezione
403// }
404 }
405 }
406
407 if (event == ARM_CAN_EVENT_SEND_COMPLETE) // Se c'\'e un evento di trasmissione
408 {
409 if (obj_idx == tx_obj_idx)
410 {
412 rx_msg_info.id = ARM_CAN_EXTENDED_ID(indirizzo_CAN_della_scheda); // Viene impostato l'indirizzo esteso per il prossimo messaggio da ricevere
413 }
414 }
415}
uint32_t volatile evento_CAN
This is the variable which resembles the flags from the communication.
Definition: Can.c:326
uint32_t tx_obj_idx
This is the variable which resembles the flags from the communication.
Definition: Can.c:323
unsigned int indirizzo_CAN_della_scheda
Per ora lo assegnamo cos\i l'indirizzo della scheda.
Definition: Can.c:335
bool messaggio_CAN_arrivato
This variable is set to true as soon as a reception have been concluded.
Definition: Can.c:328
void CAN_SignalObjectEvent(uint32_t obj_idx, uint32_t event)
After that CAN aneded operation eand the interrupt is generated this object function is called which ...
Definition: Can.c:388
volatile uint8_t rx_data[8]
Received data vector.
Definition: Can.c:318
ARM_DRIVER_CAN * CANdrv
Definition: Can.c:333
bool messaggio_CAN_spedito
This variable is set to true as soon as a transmission have been concluded.
Definition: Can.c:329

Definition at line 388 of file Can.c.

References CANdrv, evento_CAN, indirizzo_CAN_della_scheda, messaggio_CAN_arrivato, messaggio_CAN_spedito, rx_data, and tx_obj_idx.

Referenced by CAN_Inizialize().