static void data_ready(uint32_t pins) { (void)pins; data_event_flag = true; // Data ready from accellerometer start to acquire event_do(&data_ready_ev); }
static void send_kill_event() { event_do(handle, EA_Experiment, pideid, EA_Type, TBDB_OBJECTTYPE_LINKTEST, EA_Name, "linktest", EA_Event, TBDB_EVENTTYPE_KILL, EA_TAG_DONE); if (token != ~0) { event_do(handle, EA_Experiment, pideid, EA_Type, TBDB_OBJECTTYPE_LINKTEST, EA_Name, "linktest", EA_Event, TBDB_EVENTTYPE_COMPLETE, EA_ArgInteger, "ERROR", 1, EA_ArgInteger, "CTOKEN", token, EA_TAG_DONE); token = ~0; } }
static DECLARE_ISR(emac_irqHandler) { /* Read interrupt status and disable interrupts. */ uint32_t isr = EMAC_ISR; /* Receiver interrupt */ if ((isr & EMAC_RX_INTS)) { if (isr & BV(EMAC_RCOMP)) event_do(&recv_wait); EMAC_RSR = EMAC_RX_INTS; } /* Transmitter interrupt */ if (isr & EMAC_TX_INTS) { if (isr & BV(EMAC_TCOMP)) event_do(&send_wait); EMAC_TSR = EMAC_TX_INTS; } //AIC_EOICR = 0; }
static void sam3x_dac_stop(struct Dac *dac) { dac->hw->end = false; next_idx = 0; remaing_size = 0; chunk_size = 0; /* Disable the irq, timer and channel */ DACC_IDR = BV(DACC_ENDTX); DACC_PTCR |= BV(DACC_PTCR_TXTDIS); DAC_TC_CCR = BV(TC_CCR_CLKDIS); event_do(&buff_emtpy); }
static DECLARE_ISR(irq_dac) { if (DACC_ISR & BV(DACC_ENDTX)) { if (remaing_size > 0) { DACC_TNPR = (uint32_t)&sample_buff[next_idx]; DACC_TNCR = chunk_size; remaing_size -= chunk_size; next_idx += chunk_size; } else /* Clear the pending irq when the dma ends the conversion */ DACC_TCR = 1; } event_do(&buff_emtpy); }
static void acc_event(uint32_t pins) { (void)pins; acc_event_flag = true; event_do(&data_ready_ev); }