Penn Electric Steering Wheel prototype, using 128x64 KS0108 LCD screen.

Dependencies:   CANBuffer KS0108_fork mbed-rtos mbed

CAN_Filter_LUT.h

Committer:
tmccurbin
Date:
2015-01-11
Revision:
1:ecba213d6524
Parent:
0:640be16d7ee2

File content as of revision 1:ecba213d6524:

/*
Code by Parth Patel, Penn Electric Racing 2014, 9/23/2014
 
This library provides an easy to use, buffered, hardware-filtered CAN interface for
high performance CAN applications.  Provides automatic reception of messages via CAN RX interrupt
into a rx ring buffer.  Provides automatic transmission of messages via CAN TX interrupt.
 
@File CAN_Filter_LUT.h: Contains the formatted lookup tables to program the onboard CAN acceptance filters
 
*/
#ifndef _FILE_CAN_FILTER_LUT_H
#define _FILE_CAN_FILTER_LUT_H
 
#define STDMASK 0x7FF
#define EXTMASK 0x1FFFFFFF
 
// These arrays defines the CAN Controller Acceptance Filter Lookup Table.
// Follow notes below or else the chip's behaviour will be undefined
// MAX SIZE PERMITTED = 512 32bit ints total across all tables
// Note that AF_LUT_SEI is 16bit, divide #entries by 2 for this one
// Note that AF_LUT_EIR is 64bit, multipy #entries by 2 for this one
 
const uint16_t AF_LUT_SEI[] = {
// !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00) !!
 
// STANDARD EXPLICIT IDs - CAN CONTROLLER 1
//( 0xID                              & STDMASK),
 
// STANDARD EXPLICIT IDs - CAN CONTROLLER 2
//( 0xID                              & STDMASK) | 1<<13,
};
 
const uint32_t AF_LUT_SIR[] = {
// !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00), NO OVERLAPPING RANGES !!
 
// STANDARD ID RANGES - CAN CONTROLLER 1
//( 0xLOWERBOUND & STDMASK) << 16         | ( 0xUPPERBOUND & STDMASK),          lower/upperbounds are inclusive
 
// STANDARD ID RANGES - CAN CONTROLLER 2
//( 0xLOWERBOUND & STDMASK | 1<<13) << 16 | ( 0xUPPERBOUND & STDMASK | 1<<13),  lower/upperbounds are inclusive
//( 0x400        & STDMASK | 1<<13) << 16 | ( 0x4FF        & STDMASK | 1<<13),  // Index1
};
 
const uint32_t AF_LUT_EEI[] = {
// !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00) !!
 
// EXTENDED EXPLICIT IDs - CAN CONTROLLER 1
//( 0xID                              & EXTMASK),
 
// EXTENDED EXPLICIT IDs - CAN CONTROLLER 2
//( 0xID                              & EXTMASK) | 1<<29,
};
 
const uint64_t AF_LUT_EIR[] = {
// !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00), NO OVERLAPPING RANGES !!
 
// EXTENDED ID RANGES - CAN CONTROLLER 1
//( 0xLOWERBOUND & EXTMASK) << 32         | ( 0xUPPERBOUND & EXTMASK), lower/upperbounds are inclusive
 
// EXTENDED ID RANGES - CAN CONTROLLER 2
//( 0xLOWERBOUND & EXTMASK | 1<<29) << 32 | ( 0xUPPERBOUND & EXTMASK | 1<<29), lower/upperbounds are inclusive
 
};
 
#endif