sja1000.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2009, Matthias Fuchs <matthias.fuchs@esd.eu>
  3. *
  4. * SJA1000 register layout for basic CAN mode
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef _SJA1000_H_
  25. #define _SJA1000_H_
  26. /*
  27. * SJA1000 register layout in basic can mode
  28. */
  29. struct sja1000_basic_s {
  30. u8 cr;
  31. u8 cmr;
  32. u8 sr;
  33. u8 ir;
  34. u8 ac;
  35. u8 am;
  36. u8 btr0;
  37. u8 btr1;
  38. u8 oc;
  39. u8 txb[10];
  40. u8 rxb[10];
  41. u8 unused;
  42. u8 cdr;
  43. };
  44. /* control register */
  45. #define CR_RR 0x01
  46. /* output control register */
  47. #define OC_MODE0 0x01
  48. #define OC_MODE1 0x02
  49. #define OC_POL0 0x04
  50. #define OC_TN0 0x08
  51. #define OC_TP0 0x10
  52. #define OC_POL1 0x20
  53. #define OC_TN1 0x40
  54. #define OC_TP1 0x80
  55. #endif