mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-08 12:53:59 +02:00
peanut butter jelly time
This commit is contained in:
parent
f9a133144e
commit
c35e71b061
9 changed files with 242 additions and 95 deletions
100
firmware/src/chars.h
Normal file
100
firmware/src/chars.h
Normal file
|
@ -0,0 +1,100 @@
|
|||
static const uint8_t ASCII[][5] =
|
||||
{
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00} // 20
|
||||
,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 !
|
||||
,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 "
|
||||
,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 #
|
||||
,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $
|
||||
,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 %
|
||||
,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 &
|
||||
,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 '
|
||||
,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 (
|
||||
,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 )
|
||||
,{0x14, 0x08, 0x3e, 0x08, 0x14} // 2a *
|
||||
,{0x08, 0x08, 0x3e, 0x08, 0x08} // 2b +
|
||||
,{0x00, 0x50, 0x30, 0x00, 0x00} // 2c ,
|
||||
,{0x08, 0x08, 0x08, 0x08, 0x08} // 2d -
|
||||
,{0x00, 0x60, 0x60, 0x00, 0x00} // 2e .
|
||||
,{0x20, 0x10, 0x08, 0x04, 0x02} // 2f /
|
||||
,{0x3e, 0x51, 0x49, 0x45, 0x3e} // 30 0
|
||||
,{0x00, 0x42, 0x7f, 0x40, 0x00} // 31 1
|
||||
,{0x42, 0x61, 0x51, 0x49, 0x46} // 32 2
|
||||
,{0x21, 0x41, 0x45, 0x4b, 0x31} // 33 3
|
||||
,{0x18, 0x14, 0x12, 0x7f, 0x10} // 34 4
|
||||
,{0x27, 0x45, 0x45, 0x45, 0x39} // 35 5
|
||||
,{0x3c, 0x4a, 0x49, 0x49, 0x30} // 36 6
|
||||
,{0x01, 0x71, 0x09, 0x05, 0x03} // 37 7
|
||||
,{0x36, 0x49, 0x49, 0x49, 0x36} // 38 8
|
||||
,{0x06, 0x49, 0x49, 0x29, 0x1e} // 39 9
|
||||
,{0x00, 0x36, 0x36, 0x00, 0x00} // 3a :
|
||||
,{0x00, 0x56, 0x36, 0x00, 0x00} // 3b ;
|
||||
,{0x08, 0x14, 0x22, 0x41, 0x00} // 3c <
|
||||
,{0x14, 0x14, 0x14, 0x14, 0x14} // 3d =
|
||||
,{0x00, 0x41, 0x22, 0x14, 0x08} // 3e >
|
||||
,{0x02, 0x01, 0x51, 0x09, 0x06} // 3f ?
|
||||
,{0x32, 0x49, 0x79, 0x41, 0x3e} // 40 @
|
||||
,{0x7e, 0x11, 0x11, 0x11, 0x7e} // 41 A
|
||||
,{0x7f, 0x49, 0x49, 0x49, 0x36} // 42 B
|
||||
,{0x3e, 0x41, 0x41, 0x41, 0x22} // 43 C
|
||||
,{0x7f, 0x41, 0x41, 0x22, 0x1c} // 44 D
|
||||
,{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E
|
||||
,{0x7f, 0x09, 0x09, 0x09, 0x01} // 46 F
|
||||
,{0x3e, 0x41, 0x49, 0x49, 0x7a} // 47 G
|
||||
,{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H
|
||||
,{0x00, 0x41, 0x7f, 0x41, 0x00} // 49 I
|
||||
,{0x20, 0x40, 0x41, 0x3f, 0x01} // 4a J
|
||||
,{0x7f, 0x08, 0x14, 0x22, 0x41} // 4b K
|
||||
,{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L
|
||||
,{0x7f, 0x02, 0x0c, 0x02, 0x7f} // 4d M
|
||||
,{0x7f, 0x04, 0x08, 0x10, 0x7f} // 4e N
|
||||
,{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O
|
||||
,{0x7f, 0x09, 0x09, 0x09, 0x06} // 50 P
|
||||
,{0x3e, 0x41, 0x51, 0x21, 0x5e} // 51 Q
|
||||
,{0x7f, 0x09, 0x19, 0x29, 0x46} // 52 R
|
||||
,{0x46, 0x49, 0x49, 0x49, 0x31} // 53 S
|
||||
,{0x01, 0x01, 0x7f, 0x01, 0x01} // 54 T
|
||||
,{0x3f, 0x40, 0x40, 0x40, 0x3f} // 55 U
|
||||
,{0x1f, 0x20, 0x40, 0x20, 0x1f} // 56 V
|
||||
,{0x3f, 0x40, 0x38, 0x40, 0x3f} // 57 W
|
||||
,{0x63, 0x14, 0x08, 0x14, 0x63} // 58 X
|
||||
,{0x07, 0x08, 0x70, 0x08, 0x07} // 59 Y
|
||||
,{0x61, 0x51, 0x49, 0x45, 0x43} // 5a Z
|
||||
,{0x00, 0x7f, 0x41, 0x41, 0x00} // 5b [
|
||||
,{0x02, 0x04, 0x08, 0x10, 0x20} // 5c ¥
|
||||
,{0x00, 0x41, 0x41, 0x7f, 0x00} // 5d ]
|
||||
,{0x04, 0x02, 0x01, 0x02, 0x04} // 5e ^
|
||||
,{0x40, 0x40, 0x40, 0x40, 0x40} // 5f _
|
||||
,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 `
|
||||
,{0x20, 0x54, 0x54, 0x54, 0x78} // 61 a
|
||||
,{0x7f, 0x48, 0x44, 0x44, 0x38} // 62 b
|
||||
,{0x38, 0x44, 0x44, 0x44, 0x20} // 63 c
|
||||
,{0x38, 0x44, 0x44, 0x48, 0x7f} // 64 d
|
||||
,{0x38, 0x54, 0x54, 0x54, 0x18} // 65 e
|
||||
,{0x08, 0x7e, 0x09, 0x01, 0x02} // 66 f
|
||||
,{0x0c, 0x52, 0x52, 0x52, 0x3e} // 67 g
|
||||
,{0x7f, 0x08, 0x04, 0x04, 0x78} // 68 h
|
||||
,{0x00, 0x44, 0x7d, 0x40, 0x00} // 69 i
|
||||
,{0x20, 0x40, 0x44, 0x3d, 0x00} // 6a j
|
||||
,{0x7f, 0x10, 0x28, 0x44, 0x00} // 6b k
|
||||
,{0x00, 0x41, 0x7f, 0x40, 0x00} // 6c l
|
||||
,{0x7c, 0x04, 0x18, 0x04, 0x78} // 6d m
|
||||
,{0x7c, 0x08, 0x04, 0x04, 0x78} // 6e n
|
||||
,{0x38, 0x44, 0x44, 0x44, 0x38} // 6f o
|
||||
,{0x7c, 0x14, 0x14, 0x14, 0x08} // 70 p
|
||||
,{0x08, 0x14, 0x14, 0x18, 0x7c} // 71 q
|
||||
,{0x7c, 0x08, 0x04, 0x04, 0x08} // 72 r
|
||||
,{0x48, 0x54, 0x54, 0x54, 0x20} // 73 s
|
||||
,{0x04, 0x3f, 0x44, 0x40, 0x20} // 74 t
|
||||
,{0x3c, 0x40, 0x40, 0x20, 0x7c} // 75 u
|
||||
,{0x1c, 0x20, 0x40, 0x20, 0x1c} // 76 v
|
||||
,{0x3c, 0x40, 0x30, 0x40, 0x3c} // 77 w
|
||||
,{0x44, 0x28, 0x10, 0x28, 0x44} // 78 x
|
||||
,{0x0c, 0x50, 0x50, 0x50, 0x3c} // 79 y
|
||||
,{0x44, 0x64, 0x54, 0x4c, 0x44} // 7a z
|
||||
,{0x00, 0x08, 0x36, 0x41, 0x00} // 7b {
|
||||
,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c |
|
||||
,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d }
|
||||
,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ←
|
||||
,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f →
|
||||
};
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
#define USB_VENDOR_ID 0x1FC9 // Vendor ID
|
||||
#define USB_PROD_ID 0x1337 // Product ID
|
||||
#define USB_DEVICE 0x0100 // Device ID
|
||||
|
||||
#define USB_INSIZE 64
|
||||
#define USB_OUTSIZE 64
|
||||
|
|
58
firmware/src/edubrm.c
Normal file
58
firmware/src/edubrm.c
Normal file
|
@ -0,0 +1,58 @@
|
|||
#include "config.h"
|
||||
#include "LPC13xx.h"
|
||||
#include "ssp.h"
|
||||
|
||||
#include "chars.h"
|
||||
#include "pbjt.h"
|
||||
|
||||
void GetInReport (uint8_t src[], uint32_t length)
|
||||
{
|
||||
uint32_t volatile reg = LPC_USB->CmdCode;
|
||||
if (reg & (5<<8)) return;
|
||||
|
||||
static int j = 0;
|
||||
int i;
|
||||
for (i = 0; i < USB_INSIZE; ++i) {
|
||||
src[i] = 'A' + i + j;
|
||||
}
|
||||
if (++j>32) j = 0;
|
||||
}
|
||||
|
||||
void SetOutReport (uint8_t dst[], uint32_t length)
|
||||
{
|
||||
uint32_t i;
|
||||
switch (dst[0]) {
|
||||
|
||||
case 0x00: // send chars to display
|
||||
for (i = 1; dst[i] != 0; ++i) {
|
||||
if (dst[i] >= 0x20 && dst[i] <= 0x7F)
|
||||
SSPSend((uint8_t *)ASCII[dst[i]-0x20], 5);
|
||||
SSPSend((uint8_t *)"\x00", 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x01: // clear screen (white)
|
||||
for (i = 0; i < 84*6; ++i) {
|
||||
SSPSend((uint8_t *)"\x00", 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x02: // clear screen (black)
|
||||
for (i = 0; i < 84*6; ++i) {
|
||||
SSPSend((uint8_t *)"\xFF", 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
switch (dst[1]) {
|
||||
case 0: SSPSend(pbjt1, 504); break;
|
||||
case 1: SSPSend(pbjt2, 504); break;
|
||||
case 2: SSPSend(pbjt3, 504); break;
|
||||
case 3: SSPSend(pbjt4, 504); break;
|
||||
case 4: SSPSend(pbjt5, 504); break;
|
||||
case 5: SSPSend(pbjt6, 504); break;
|
||||
case 6: SSPSend(pbjt7, 504); break;
|
||||
case 7: SSPSend(pbjt8, 504); break;
|
||||
}
|
||||
}
|
||||
}
|
2
firmware/src/edubrm.h
Normal file
2
firmware/src/edubrm.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
void GetInReport (uint8_t src[], uint32_t length);
|
||||
void SetOutReport (uint8_t dst[], uint32_t length);
|
8
firmware/src/pbjt.h
Normal file
8
firmware/src/pbjt.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
static uint8_t *pbjt1 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xf0\x9e\x01\x81\x8e\xb8\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x44\x44\x6c\xf8\x80\x00\x00\x07\xf8\xaa\x28\x27\x28\xaa\x48\x37\xff\x00\x00\x00\x80\xf8\x6c\x44\x44\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x02\x02\xff\x00\x01\x01\x01\x80\xe0\x3c\x07\x02\x02\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x40\x20\x20\x20\x78\xcf\x03\x03\x02\xc3\x4f\x38\x20\x20\x40\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt2 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x40\x40\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x20\x20\x60\xc0\x00\x00\x00\x00\x00\x00\xc0\xf8\x2e\xa3\x20\xc0\x27\xbc\x20\xc0\x00\x00\x00\x00\x00\x00\xc0\x60\x20\x20\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x02\x03\x07\x04\x0c\x08\x18\x30\x20\xff\x0d\x12\x2a\x4a\x49\x4a\x2a\xfe\x21\x30\x10\x18\x08\x0c\x04\x07\x03\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x1e\x70\xc0\x80\x00\x80\x80\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x40\x20\x20\x20\xbc\xe7\x01\x01\x01\xe7\xbc\x20\x20\x20\x40\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt3 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xc0\x60\x38\x0c\x0c\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\x03\xe0\x40\x5c\xa2\xa2\xab\xfe\x2a\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x88\x88\xd8\xf0\x80\x00\x9f\xf0\xc0\x01\x02\x02\x04\x07\x3c\xe0\x80\x00\x80\xf0\xd8\x88\x88\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc1\x21\x20\x21\x3b\x4e\xc4\x0c\x08\x08\xcd\x4f\x2d\x39\x20\x20\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt4 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xe0\x30\x30\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x0e\x83\x01\x70\x88\x88\xaf\xf8\xa8\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x20\x20\x60\xc0\x3f\xe0\x83\x05\x09\x0a\x12\x1e\x73\xc0\x00\xc0\x60\x20\x20\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x02\x03\xc7\x2c\x38\x3f\x76\x5c\xd8\x18\x10\x10\xdb\x5e\x59\x3f\x32\x22\xc1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt5 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xb8\x8e\x81\x01\x9e\xf0\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x44\x44\x68\xf8\x80\x00\x00\x00\xff\x37\x48\xaa\x28\x27\x28\xaa\xf8\x07\x00\x00\x80\xf8\x6c\x44\x44\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x02\x02\x07\x3c\xe0\x80\x01\x01\x01\x00\xff\x02\x02\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x40\x20\x20\x38\x4f\xc3\x02\x03\x03\xcf\x78\x20\x20\x20\x40\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt6 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x40\x40\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x20\x20\x60\xc0\x00\x00\x00\x00\x00\x00\xc0\x20\xbc\x27\xc0\x20\xa3\x2e\xf8\xc0\x00\x00\x00\x00\x00\x00\xc0\x60\x20\x20\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x02\x03\x07\x04\x0c\x08\x18\x10\x30\x21\xfe\x2a\x4a\x49\x4a\x2a\x12\x0d\xff\x20\x30\x18\x08\x0c\x04\x07\x03\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x80\x80\x00\x80\xc0\x70\x1e\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x40\x20\x20\x20\xbc\xe7\x01\x01\x01\xe7\xbc\x20\x20\x20\x40\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt7 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x0c\x0c\x38\x60\xc0\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x2a\xfe\xab\xa2\xa2\x5c\x40\xe0\x03\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x88\x88\xd8\xf0\x80\x00\x80\xe0\x3c\x07\x04\x02\x02\x01\xc0\xf0\x9f\x00\x80\xf0\xd8\x88\x88\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x20\x20\x39\x2d\x4f\xcd\x08\x08\x0c\xc4\x4e\x3b\x21\x20\x21\xc1\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
static uint8_t *pbjt8 = (uint8_t *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x30\x30\xe0\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\xa8\xf8\xaf\x88\x88\x70\x01\x83\x0e\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x20\x20\x60\xc0\x00\xc0\x73\x1e\x12\x0a\x09\x05\x83\xe0\x3f\xc0\x60\x20\x20\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc1\x22\x32\x3f\x59\x5e\xdb\x10\x10\x18\xd8\x5c\x76\x3f\x38\x2c\xc7\x03\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
|
@ -1,7 +1,7 @@
|
|||
#include "LPC13xx.h"
|
||||
#include "ssp.h"
|
||||
|
||||
void SSPSend( char *buf, uint32_t Length )
|
||||
void SSPSend( const uint8_t *buf, uint32_t Length )
|
||||
{
|
||||
uint32_t i;
|
||||
uint8_t Dummy = Dummy;
|
||||
|
@ -27,6 +27,8 @@ void SSPSend( char *buf, uint32_t Length )
|
|||
}
|
||||
|
||||
void SSPInit() {
|
||||
uint32_t i;
|
||||
|
||||
// reset peripherals
|
||||
LPC_SYSCON->PRESETCTRL |= (0x01<<0); // SSP reset de-asserted
|
||||
LPC_SYSCON->SYSAHBCLKCTRL |= (0x01<<11); // Enables clock for SSP.
|
||||
|
@ -56,15 +58,12 @@ LPC_IOCON->PIO0_2 |= 0x01;
|
|||
LPC_SSP->CR0 = 0x0007;
|
||||
LPC_SSP->CPSR = 0x02;
|
||||
|
||||
|
||||
|
||||
LPC_IOCON->PIO0_7 = 0x00; // D/C^
|
||||
LPC_GPIO0->DIR |= 1 << 7;
|
||||
|
||||
LPC_IOCON->PIO2_0 = 0x00; // RES^
|
||||
LPC_GPIO2->DIR |= 1 << 0;
|
||||
|
||||
|
||||
// SSP Enable with Master mode
|
||||
LPC_SSP->CR1 = (0x01<<1) | (0x00<<2);
|
||||
|
||||
|
@ -74,58 +73,19 @@ NVIC_EnableIRQ(SSP_IRQn);
|
|||
/* enable all error related interrupts */
|
||||
LPC_SSP->IMSC = (0x1<<0) | (0x1<<1);
|
||||
|
||||
int i;
|
||||
// reset
|
||||
//LPC_GPIO2->MASKED_ACCESS[0x01<<0] = 1 << 0;
|
||||
// for (i = 0; i < 100; i++);
|
||||
//LPC_GPIO2->MASKED_ACCESS[0x01<<0] = 0 << 0;
|
||||
|
||||
// select
|
||||
//LPC_GPIO0->MASKED_ACCESS[0x01<<2] = 0 << 2;
|
||||
// for (i = 0; i < 100; i++);
|
||||
|
||||
// command
|
||||
LPC_GPIO0->MASKED_ACCESS[0x01<<7] = 0 << 7;
|
||||
// for (i = 0; i < 100; i++);
|
||||
/*
|
||||
SSPSend("\x21\xc8\x06\x13\x20\x0c", 6);
|
||||
// x:0 y:0
|
||||
SSPSend("\x20\x0c", 2);
|
||||
SSPSend("\x80\x40", 2);
|
||||
|
||||
// send init
|
||||
SSPSend((uint8_t *)"\x21\xbf\x04\x14\x0c\x20\x0c", 7);
|
||||
// move to (0,0)
|
||||
SSPSend((uint8_t *)"\x80\x40", 2);
|
||||
|
||||
// data
|
||||
LPC_GPIO0->MASKED_ACCESS[0x01<<7] = 0 << 7;
|
||||
// for (i = 0; i < 100; i++);
|
||||
|
||||
SSPSend("\x21\xc8\x06\x13\x20\x0c", 6);
|
||||
// x:0 y:0
|
||||
SSPSend("\x20\x0c", 2);
|
||||
|
||||
|
||||
LPC_GPIO0->MASKED_ACCESS[0x01<<7] = 0 << 7;
|
||||
*/
|
||||
SSPSend("\x21\xc8\x06\x13\x20\x0c", 6);
|
||||
SSPSend("\x80\x40", 2);
|
||||
//SSPSend("\x20\x0c", 2);
|
||||
|
||||
|
||||
LPC_GPIO0->MASKED_ACCESS[0x01<<7] = 1 << 7;
|
||||
|
||||
for (i=0;i<84*48;i++)
|
||||
SSPSend("\x00", 1);
|
||||
|
||||
SSPSend("\x00", 1);
|
||||
SSPSend("\x00", 1);
|
||||
|
||||
while (1){
|
||||
SSPSend("\x7f\x49\x49\x49\x36\x00", 6); // B
|
||||
SSPSend("\x7f\x09\x19\x29\x46\x00", 6); // R
|
||||
SSPSend("\x7f\x02\x0c\x02\x7f\x00", 6); // M
|
||||
SSPSend("\x7f\x40\x40\x40\x40\x00", 6); // L
|
||||
SSPSend("\x7e\x11\x11\x11\x7e\x00", 6); // A
|
||||
SSPSend("\x7f\x49\x49\x49\x36\x00", 6); // B
|
||||
SSPSend("\x00\x00\x00\x00\x00\x00\x00", 7);
|
||||
for(i=0;i<100000;i++);
|
||||
}
|
||||
// clear display
|
||||
for (i=0;i<84*6;i++)
|
||||
SSPSend((uint8_t *)"\x00", 1);
|
||||
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
SSPReceive() will not be needed. */
|
||||
extern void SSP_IRQHandler (void);
|
||||
extern void SSPInit( void );
|
||||
extern void SSPSend( char *Buf, uint32_t Length );
|
||||
extern void SSPSend( const uint8_t *Buf, uint32_t Length );
|
||||
extern void SSPReceive( uint8_t *buf, uint32_t Length );
|
||||
|
||||
#endif /* __SSP_H__ */
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
#include "rom_drivers.h"
|
||||
#include "config.h"
|
||||
#include "ssp.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "edubrm.h"
|
||||
|
||||
#define EN_TIMER32_1 (1<<10)
|
||||
#define EN_IOCON (1<<16)
|
||||
|
@ -33,53 +32,22 @@ USB_DEV_INFO DeviceInfo;
|
|||
HID_DEVICE_INFO HidDevInfo;
|
||||
ROM ** rom = (ROM **)0x1fff1ff8;
|
||||
|
||||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
#define INSIZE 64
|
||||
#define OUTSIZE 2
|
||||
|
||||
void GetInReport (uint8_t src[], uint32_t length)
|
||||
{
|
||||
int volatile reg = LPC_USB->CmdCode;
|
||||
if (!(reg & (5<<8))) {
|
||||
static int j = 0;
|
||||
int i;
|
||||
for (i = 0; i < INSIZE; ++i) {
|
||||
src[i] = 'A' + i + j;
|
||||
}
|
||||
if (++j>32) j = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SetOutReport (uint8_t dst[], uint32_t length)
|
||||
{
|
||||
// TODO: parse dst
|
||||
}
|
||||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/* for delay loop */
|
||||
volatile int n;
|
||||
volatile uint32_t n;
|
||||
// Code Red Red Suite and LPCXpresso by Code Red both call SystemInit() in
|
||||
// the C startup code
|
||||
//#ifndef __CODERED__
|
||||
SystemInit();
|
||||
//#endif
|
||||
|
||||
/*
|
||||
LPC_GPIO2->MASKED_ACCESS[0x01<<0] = 1 << 0;
|
||||
SSPSend("BIITER", 6);
|
||||
*/
|
||||
|
||||
HidDevInfo.idVendor = USB_VENDOR_ID;
|
||||
HidDevInfo.idProduct = USB_PROD_ID;
|
||||
HidDevInfo.bcdDevice = USB_DEVICE;
|
||||
HidDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
|
||||
HidDevInfo.InReportCount = INSIZE;
|
||||
HidDevInfo.OutReportCount = OUTSIZE;
|
||||
HidDevInfo.InReportCount = USB_INSIZE;
|
||||
HidDevInfo.OutReportCount = USB_OUTSIZE;
|
||||
HidDevInfo.SampleInterval = 1;
|
||||
HidDevInfo.InReport = GetInReport;
|
||||
HidDevInfo.OutReport = SetOutReport;
|
||||
|
@ -99,6 +67,8 @@ int main (void)
|
|||
(*rom)->pUSBD->init(&DeviceInfo); /* USB Initialization */
|
||||
(*rom)->pUSBD->connect(TRUE); /* USB Connect */
|
||||
|
||||
for (n = 0; n < 75; n++) {}
|
||||
|
||||
SSPInit();
|
||||
|
||||
while (1)
|
||||
|
@ -116,7 +86,7 @@ void USB_IRQHandler()
|
|||
|
||||
void SSP_IRQHandler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
}
|
||||
// while(1)
|
||||
// {
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,10 @@ import time
|
|||
|
||||
usbdev = usb.core.find(idVendor = 0x1fc9, idProduct = 0x1337)
|
||||
|
||||
usbdev.detach_kernel_driver(0)
|
||||
try:
|
||||
usbdev.detach_kernel_driver(0)
|
||||
except:
|
||||
pass
|
||||
|
||||
usbdev.set_configuration()
|
||||
|
||||
|
@ -19,6 +22,49 @@ epi = usb.util.find_descriptor(
|
|||
custom_match = lambda e: \
|
||||
usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN)
|
||||
|
||||
for i in xrange(1024):
|
||||
epo.write('@A')
|
||||
epi.read(64)
|
||||
# print epi.read(64)
|
||||
|
||||
epo.write('\x00 \x00')
|
||||
epo.write('\x00 Hackerspace \x00')
|
||||
epo.write('\x00 brmlab \x00')
|
||||
epo.write('\x00 \x00')
|
||||
epo.write('\x00 PRESENTS \x00')
|
||||
epo.write('\x00 \x00')
|
||||
|
||||
time.sleep(1.5)
|
||||
|
||||
epo.write('\x00 \x00')
|
||||
epo.write('\x00 PEANUT \x00')
|
||||
epo.write('\x00 BUTTER \x00')
|
||||
epo.write('\x00 JELLY \x00')
|
||||
epo.write('\x00 TIME! \x00')
|
||||
epo.write('\x00 \x00')
|
||||
|
||||
time.sleep(1.7)
|
||||
|
||||
epo.write('\x00 \x00')
|
||||
epo.write('\x00 PEANUT \x00')
|
||||
epo.write('\x00 BUTTER \x00')
|
||||
epo.write('\x00 JELLY \x00')
|
||||
epo.write('\x00 TIME! \x00')
|
||||
epo.write('\x00 \x00')
|
||||
|
||||
time.sleep(1.7)
|
||||
|
||||
epo.write('\x00 \x00')
|
||||
epo.write('\x00 PEANUT \x00')
|
||||
epo.write('\x00 BUTTER \x00')
|
||||
epo.write('\x00 JELLY \x00')
|
||||
epo.write('\x00 TIME! \x00')
|
||||
epo.write('\x00 \x00')
|
||||
|
||||
time.sleep(1.45)
|
||||
|
||||
# for i in xrange(100):
|
||||
# epo.write('\x01')
|
||||
# epo.write('\x02')
|
||||
|
||||
while 1:
|
||||
for i in xrange(8):
|
||||
time.sleep(0.1)
|
||||
epo.write('\x03'+chr(i))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue