@@ -10,7 +10,9 @@ extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to c
10
10
//use cortex_m::asm;
11
11
use cortex_m_rt:: entry;
12
12
use stm32f4:: stm32f401;
13
- use cortex_m_semihosting:: dbg;
13
+ //use cortex_m_semihosting::dbg;
14
+
15
+ use misakifont:: font88:: FONT88 ;
14
16
15
17
#[ entry]
16
18
fn main ( ) -> ! {
@@ -25,25 +27,24 @@ fn main() -> ! {
25
27
device. GPIOA . bsrr . write ( |w| w. bs10 ( ) . set ( ) ) ;
26
28
//device.GPIOA.bsrr.write(|w| w.bs11().set());
27
29
28
- send_oneline_mat_led ( & device , 0 , 0b00111000_01100000_00000000_00000010 ) ;
29
- send_oneline_mat_led ( & device , 1 , 0b01000100_10010000_00000000_00010101 ) ;
30
- send_oneline_mat_led ( & device , 2 , 0b10000011_00001000_00000000_00101010 ) ;
31
- send_oneline_mat_led ( & device , 3 , 0b01000000_00010000_00000000_00010000 ) ;
32
- send_oneline_mat_led ( & device , 4 , 0b00100000_00100000_01000101_00010000 ) ;
33
- send_oneline_mat_led ( & device , 5 , 0b00010000_01000000_01000101_00010000 ) ;
34
- send_oneline_mat_led ( & device , 6 , 0b00001000_10000000_00101000_10100000 ) ;
35
- send_oneline_mat_led ( & device , 7 , 0b00000111_00000000_00010000_01000000 ) ;
36
- /*
37
- send_oneline_mat_led(&device, 0, 0x5555AAAA) ;
38
- send_oneline_mat_led(&device, 1, 0xAAAA5555);
39
- send_oneline_mat_led(&device, 2, 0x5555AAAA);
40
- send_oneline_mat_led(&device, 3, 0xAAAA5555 );
41
- send_oneline_mat_led(&device, 4, 0x5555AAAA);
42
- send_oneline_mat_led(&device, 5, 0xAAAA5555);
43
- send_oneline_mat_led(&device, 6, 0x5555AAAA);
44
- send_oneline_mat_led(&device, 7, 0xAAAA5555);
30
+ let mut video = [ 0u32 ; 8 ] ;
31
+ //let font = FONT48.get_char(0x52 );
32
+ let chars= [ 0xc3 , 0xdd , 0xb2 , 0xd6 , 0xcd , 0xa5 , 0xbb , 0xd2 ] ;
33
+ let mut x = 24 ;
34
+ for c in 0 .. 4 {
35
+ let font = FONT88 . get_char ( chars [ c * 2 ] , chars [ c * 2 + 1 ] ) ;
36
+ for i in 0 .. 8 {
37
+ video [ i ] |= ( font [ i ] as u32 ) << x ;
38
+ }
39
+ x -= 8 ;
40
+ }
41
+ for i in 0 .. 8 {
42
+ send_oneline_mat_led ( & device, i , video [ i as usize ] ) ;
43
+ }
44
+
45
+
46
+
45
47
device. GPIOA . bsrr . write ( |w| w. bs11 ( ) . set ( ) ) ;
46
- */
47
48
48
49
loop {
49
50
// your code goes here
@@ -74,7 +75,7 @@ fn send_oneline_mat_led(device: &stm32f401::Peripherals, line_num: u32, pat: u32
74
75
fn init_mat_led ( device : & stm32f401:: Peripherals ) {
75
76
const INIT_PAT : [ u16 ; 5 ] = [ 0x0F00 , // テストモード解除
76
77
0x0900 , // BCDデコードバイパス
77
- 0x0A08 , // 輝度制御 下位4bit MAX:F
78
+ 0x0A03 , // 輝度制御 下位4bit MAX:F
78
79
0x0B07 , // スキャン桁指定 下位4bit MAX:7
79
80
0x0C01 , // シャットダウンモード 解除
80
81
] ;
0 commit comments