quicc_simple.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /***********************************
  2. * $Id: quicc_simple.h,v 1.1 2002/03/02 15:01:10 gerg Exp $
  3. ***********************************
  4. *
  5. ***************************************
  6. * Simple drivers common header
  7. ***************************************
  8. */
  9. #ifndef __SIMPLE_H
  10. #define __SIMPLE_H
  11. /* #include "quicc.h" */
  12. #define GLB_SCC_0 0
  13. #define GLB_SCC_1 1
  14. #define GLB_SCC_2 2
  15. #define GLB_SCC_3 3
  16. typedef void (int_routine)(unsigned short interrupt_event);
  17. typedef int_routine *int_routine_ptr;
  18. typedef void *(alloc_routine)(int length);
  19. typedef void (free_routine)(int scc_num, int channel_num, void *buf);
  20. typedef void (store_rx_buffer_routine)(int scc_num, int channel_num, void *buff, int length);
  21. typedef int (handle_tx_error_routine)(int scc_num, int channel_num, QUICC_BD *tbd);
  22. typedef void (handle_rx_error_routine)(int scc_num, int channel_num, QUICC_BD *rbd);
  23. typedef void (handle_lost_error_routine)(int scc_num, int channel_num);
  24. /* user defined functions for global errors */
  25. typedef void (handle_glob_overrun_routine)(int scc_number);
  26. typedef void (handle_glob_underrun_routine)(int scc_number);
  27. typedef void (glob_intr_q_overflow_routine)(int scc_number);
  28. /*
  29. * General initialization and command routines
  30. */
  31. void quicc_issue_cmd (unsigned short cmd, int scc_num);
  32. void quicc_init(void);
  33. void quicc_scc_init(int scc_number, int number_of_rx_buf, int number_of_tx_buf);
  34. void quicc_smc_init(int smc_number, int number_of_rx_buf, int number_of_tx_buf);
  35. void quicc_scc_start(int scc_num);
  36. void quicc_scc_loopback(int scc_num);
  37. /* Interrupt enable/disable routines for critical pieces of code*/
  38. unsigned short IntrDis(void);
  39. void IntrEna(unsigned short old_sr);
  40. /* For debugging */
  41. void print_rbd(int scc_num);
  42. void print_tbd(int scc_num);
  43. #endif