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

Dependencies:   CANBuffer KS0108_fork mbed-rtos mbed

Committer:
tmccurbin
Date:
Sun Jan 11 05:25:13 2015 +0000
Revision:
1:ecba213d6524
Parent:
0:640be16d7ee2
Ver 1.0: Steering wheel display uses KS0108 (64x128 LCD screen) to show real-time updates to driver.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tmccurbin 0:640be16d7ee2 1 /*
tmccurbin 0:640be16d7ee2 2 Code by Parth Patel, Penn Electric Racing 2014, 9/23/2014
tmccurbin 0:640be16d7ee2 3
tmccurbin 0:640be16d7ee2 4 This library provides an easy to use, buffered, hardware-filtered CAN interface for
tmccurbin 0:640be16d7ee2 5 high performance CAN applications. Provides automatic reception of messages via CAN RX interrupt
tmccurbin 0:640be16d7ee2 6 into a rx ring buffer. Provides automatic transmission of messages via CAN TX interrupt.
tmccurbin 0:640be16d7ee2 7
tmccurbin 0:640be16d7ee2 8 @File CAN_Filter_LUT.h: Contains the formatted lookup tables to program the onboard CAN acceptance filters
tmccurbin 0:640be16d7ee2 9
tmccurbin 0:640be16d7ee2 10 */
tmccurbin 0:640be16d7ee2 11 #ifndef _FILE_CAN_FILTER_LUT_H
tmccurbin 0:640be16d7ee2 12 #define _FILE_CAN_FILTER_LUT_H
tmccurbin 0:640be16d7ee2 13
tmccurbin 0:640be16d7ee2 14 #define STDMASK 0x7FF
tmccurbin 0:640be16d7ee2 15 #define EXTMASK 0x1FFFFFFF
tmccurbin 0:640be16d7ee2 16
tmccurbin 0:640be16d7ee2 17 // These arrays defines the CAN Controller Acceptance Filter Lookup Table.
tmccurbin 0:640be16d7ee2 18 // Follow notes below or else the chip's behaviour will be undefined
tmccurbin 0:640be16d7ee2 19 // MAX SIZE PERMITTED = 512 32bit ints total across all tables
tmccurbin 0:640be16d7ee2 20 // Note that AF_LUT_SEI is 16bit, divide #entries by 2 for this one
tmccurbin 0:640be16d7ee2 21 // Note that AF_LUT_EIR is 64bit, multipy #entries by 2 for this one
tmccurbin 0:640be16d7ee2 22
tmccurbin 0:640be16d7ee2 23 const uint16_t AF_LUT_SEI[] = {
tmccurbin 0:640be16d7ee2 24 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00) !!
tmccurbin 0:640be16d7ee2 25
tmccurbin 0:640be16d7ee2 26 // STANDARD EXPLICIT IDs - CAN CONTROLLER 1
tmccurbin 0:640be16d7ee2 27 //( 0xID & STDMASK),
tmccurbin 0:640be16d7ee2 28
tmccurbin 0:640be16d7ee2 29 // STANDARD EXPLICIT IDs - CAN CONTROLLER 2
tmccurbin 0:640be16d7ee2 30 //( 0xID & STDMASK) | 1<<13,
tmccurbin 0:640be16d7ee2 31 };
tmccurbin 0:640be16d7ee2 32
tmccurbin 0:640be16d7ee2 33 const uint32_t AF_LUT_SIR[] = {
tmccurbin 0:640be16d7ee2 34 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00), NO OVERLAPPING RANGES !!
tmccurbin 0:640be16d7ee2 35
tmccurbin 0:640be16d7ee2 36 // STANDARD ID RANGES - CAN CONTROLLER 1
tmccurbin 0:640be16d7ee2 37 //( 0xLOWERBOUND & STDMASK) << 16 | ( 0xUPPERBOUND & STDMASK), lower/upperbounds are inclusive
tmccurbin 0:640be16d7ee2 38
tmccurbin 0:640be16d7ee2 39 // STANDARD ID RANGES - CAN CONTROLLER 2
tmccurbin 0:640be16d7ee2 40 //( 0xLOWERBOUND & STDMASK | 1<<13) << 16 | ( 0xUPPERBOUND & STDMASK | 1<<13), lower/upperbounds are inclusive
tmccurbin 0:640be16d7ee2 41 //( 0x400 & STDMASK | 1<<13) << 16 | ( 0x4FF & STDMASK | 1<<13), // Index1
tmccurbin 0:640be16d7ee2 42 };
tmccurbin 0:640be16d7ee2 43
tmccurbin 0:640be16d7ee2 44 const uint32_t AF_LUT_EEI[] = {
tmccurbin 0:640be16d7ee2 45 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00) !!
tmccurbin 0:640be16d7ee2 46
tmccurbin 0:640be16d7ee2 47 // EXTENDED EXPLICIT IDs - CAN CONTROLLER 1
tmccurbin 0:640be16d7ee2 48 //( 0xID & EXTMASK),
tmccurbin 0:640be16d7ee2 49
tmccurbin 0:640be16d7ee2 50 // EXTENDED EXPLICIT IDs - CAN CONTROLLER 2
tmccurbin 0:640be16d7ee2 51 //( 0xID & EXTMASK) | 1<<29,
tmccurbin 0:640be16d7ee2 52 };
tmccurbin 0:640be16d7ee2 53
tmccurbin 0:640be16d7ee2 54 const uint64_t AF_LUT_EIR[] = {
tmccurbin 0:640be16d7ee2 55 // !! ID's MUST BE IN ASCENDING ORDER (starting at 0x00), NO OVERLAPPING RANGES !!
tmccurbin 0:640be16d7ee2 56
tmccurbin 0:640be16d7ee2 57 // EXTENDED ID RANGES - CAN CONTROLLER 1
tmccurbin 0:640be16d7ee2 58 //( 0xLOWERBOUND & EXTMASK) << 32 | ( 0xUPPERBOUND & EXTMASK), lower/upperbounds are inclusive
tmccurbin 0:640be16d7ee2 59
tmccurbin 0:640be16d7ee2 60 // EXTENDED ID RANGES - CAN CONTROLLER 2
tmccurbin 0:640be16d7ee2 61 //( 0xLOWERBOUND & EXTMASK | 1<<29) << 32 | ( 0xUPPERBOUND & EXTMASK | 1<<29), lower/upperbounds are inclusive
tmccurbin 0:640be16d7ee2 62
tmccurbin 0:640be16d7ee2 63 };
tmccurbin 0:640be16d7ee2 64
tmccurbin 0:640be16d7ee2 65 #endif