drivers/ecos_lpc2138_sja1000/sja1000.c
author frdupin
Mon, 29 Jan 2007 14:42:32 +0100
changeset 80 37354e408645
parent 3 d9cf34cd6823
permissions -rw-r--r--
compilers compatibility
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
 Author: Christian Fortin (canfestival@canopencanada.ca)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
3
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    23
#include <cyg/kernel/kapi.h>
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    24
#include <cyg/hal/hal_arch.h>
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
3
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    26
#include "lpc2138_pinout.h"
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    27
#include "lpc2138_defs.h"
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    28
#include "lpc2138.h"
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    29
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    30
#include "sja1000.h"
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    31
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    32
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    33
#define CYGNUM_HAL_INTERRUPT_1 CYGNUM_HAL_INTERRUPT_EINT1
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    34
#define CYGNUM_HAL_PRI_HIGH    0
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    35
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    36
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    37
cyg_uint32 interrupt_1_isr(cyg_vector_t vector, cyg_addrword_t data);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    38
void interrupt_1_dsr(cyg_vector_t   vector,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    39
                            cyg_ucount32   count,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    40
                            cyg_addrword_t data);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    41
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    42
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    43
/* Interrupt for CAN device. */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    44
static cyg_interrupt interrupt_1;
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    45
static cyg_handle_t  interrupt_1_handle;
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    46
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    47
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    48
void init_sja1000(void)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    49
{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    50
    do
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    51
    {
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    52
        sja1000_write(MOD, 1<<RM);                  /* demande reset */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    53
    }
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    54
    while ((sja1000_read(MOD) & (1<<RM)) == 0);   /* loop until reset good */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    55
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    56
/*
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    57
    sja1000_write(bustiming0, ((0<<SJW1)|(0<<SJW0)|(0<<BRP5)|(0<<BRP4)|(0<<BRP3)|(0<<BRP2)|(0<<BRP1)|(0<<BRP0)));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    58
    sja1000_write(bustiming1, ((1<<SAM)|(0<<TSEG22)|(1<<TSEG21)|(0<<TSEG20)|(0<<TSEG13)|(1<<TSEG12)|(0<<TSEG11)|(0<<TSEG10)));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    59
*/
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    60
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    61
/* OUTPUT CONTROL REGISTER */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    62
    sja1000_write(outputcontrol, ((1<<OCTP1)|(1<<OCTN1)|(0<<OCPOL1)|(1<<OCTP0)|(1<<OCTN0)|(0<<OCPOL0)|(1<<OCMODE1)|(0<<OCMODE0)));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    63
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    64
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    65
    sja1000_write(clockdivider, ((1<<CANmode)|(1<<CBP)|(1<<RXINTEN)|(0<<clockoff)|(1<<CD2)|(1<<CD1)|(1<<CD0)));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    66
    sja1000_write(16,  0x01);   /* 0 code all accept block high bit */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    67
    sja1000_write(17,  0x00);   /* 0 all accept block high bit */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    68
    sja1000_write(18,  0x00);   /* 0 all accept block high bit */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    69
    sja1000_write(19,  0x00);   /* 0 all accept block high bit */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    70
    sja1000_write(20,  0xFE);   /* 1 mask */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    71
    sja1000_write(21,  0xFF);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    72
    sja1000_write(22,  0xFF);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    73
    sja1000_write(23,  0xFF);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    74
    sja1000_write(IER, 0x01);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    75
    sja1000_write(clockdivider, ((1<<CANmode)|(1<<CBP)|(1<<RXINTEN)|(0<<clockoff)|(1<<CD2)|(1<<CD1)|(0<<CD0)));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    76
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    77
    do
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    78
    {
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    79
        sja1000_write(MOD, (1<<AFM)|(0<<STM)|(0<<RM));
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    80
    }
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    81
    while ((sja1000_read(MOD) & (1<<RM)) == 1);   /* loop until reset gone */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    82
}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    83
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    84
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    85
/***************************************************************************/
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    86
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    87
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    88
void init_interrupts(void)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    89
{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    90
    cyg_vector_t   interrupt_1_vector   = CYGNUM_HAL_INTERRUPT_1;
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    91
    cyg_priority_t interrupt_1_priority = CYGNUM_HAL_PRI_HIGH;
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    92
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    93
    cyg_interrupt_create(
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    94
        interrupt_1_vector,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    95
        interrupt_1_priority,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    96
        (cyg_addrword_t) 0,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    97
        (cyg_ISR_t *) &interrupt_1_isr,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    98
        (cyg_DSR_t *) &interrupt_1_dsr,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
    99
        &interrupt_1_handle,
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   100
        &interrupt_1);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   101
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   102
    cyg_interrupt_attach(interrupt_1_handle);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   103
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   104
    cyg_interrupt_acknowledge(interrupt_1_vector);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   105
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   106
    cyg_interrupt_unmask(interrupt_1_vector);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   107
}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   108
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   109
/* External Interrupt 1 Service */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   110
void eint1_srv(void) /*__irq*/ 
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   111
{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   112
	//++intrp_count;                              // increment interrupt count
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   113
	EXTINT      = 2;                            // Clear EINT1 interrupt flag
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   114
	VICVectAddr = 0;                            // Acknowledge Interrupt
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   115
}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   116
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   117
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   118
/* Initialize EINT1 Interrupt Pin */
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   119
void init_eint1(void)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   120
{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   121
	EXTMODE       = 0x2;                         // Edge sensitive mode on EINT1
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   122
	EXTPOLAR      = 0;                           // falling edge sensitive
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   123
	P0_PINSEL0   |= 2 << 28;                     // Enable EINT1 on GPIO_0.14
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   124
	VICVectAddr0  = (unsigned long) eint1_srv;   // set interrupt vector in VIC 0
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   125
	VICVectCntl0  = 0x20 | 15;                   // use VIC 0 for EINT1 Interrupt
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   126
	EXTINT        = 2;
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   127
	VICIntEnable  = 1 << 15;                     // Enable EINT1 Interrupt
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   128
}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   129
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   130
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   131
/*
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   132
{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   133
	unsigned char byte=sja1000_read(0x02);
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   134
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   135
	if (byte & 0x01)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   136
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   137
		// RXFIFO full
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   138
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   139
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   140
	if (byte & 0x02)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   141
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   142
		// overrun
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   143
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   144
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   145
	if (byte & 0x04)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   146
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   147
		// the cpu may write a msg
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   148
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   149
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   150
	if (byte & 0x08)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   151
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   152
		// tx complete
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   153
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   154
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   155
	if (byte & 0x10)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   156
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   157
		// receiving
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   158
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   159
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   160
	if (byte & 0x20)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   161
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   162
		// transmitting
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   163
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   164
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   165
	if (byte & 0x40)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   166
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   167
		// at least one of the error counter has reached or exceeeded
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   168
		// the CPU warning limit
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   169
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   170
	
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   171
	if (byte & 0x80)
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   172
	{
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   173
		// bus off
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   174
	}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   175
}
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   176
*/
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   177
d9cf34cd6823 ADDED LED to TESTMASTERSLAVE. It looks nice!
oremeq
parents: 0
diff changeset
   178