blob: b93334443936fe203e4b7dab4a996ba24cb75dd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#pragma once
#include "quantum.h"
#include <stdint.h>
#include <stdbool.h>
void init_ergodox(void);
inline void ergodox_board_led_on(void) { DDRB |= (1<<PB7); PORTB |= (1<<PB7); }
inline void ergodox_right_led_1_on(void) { DDRB |= (1<<PB5); PORTB &= ~(1<<PB5); }
inline void ergodox_right_led_2_on(void) { DDRB |= (1<<PB6); PORTB &= ~(1<<PB6); }
inline void ergodox_right_led_3_on(void) { DDRB |= (1<<PB4); PORTB &= ~(1<<PB4); }
inline void ergodox_board_led_off(void) { DDRB |= (1<<PB7); PORTB &= ~(1<<PB7); }
inline void ergodox_right_led_1_off(void) { DDRB |= (1<<PB5); PORTB |= (1<<PB5); }
inline void ergodox_right_led_2_off(void) { DDRB |= (1<<PB6); PORTB |= (1<<PB6); }
inline void ergodox_right_led_3_off(void) { DDRB |= (1<<PB4); PORTB |= (1<<PB4); }
inline void ergodox_right_led_on(uint8_t l) {
switch (l) {
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
case 3:
ergodox_right_led_3_on();
break;
default:
break;
}
}
inline void ergodox_right_led_off(uint8_t l) {
switch (l) {
case 1:
ergodox_right_led_1_off();
break;
case 2:
ergodox_right_led_2_off();
break;
case 3:
ergodox_right_led_3_off();
break;
default:
break;
}
}
inline void ergodox_led_all_on(void) {
ergodox_board_led_on();
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
}
inline void ergodox_led_all_off(void) {
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
}
inline void ergodox_right_led_1_set(uint8_t n) {}
inline void ergodox_right_led_2_set(uint8_t n) {}
inline void ergodox_right_led_3_set(uint8_t n) {}
inline void ergodox_right_led_set(uint8_t l, uint8_t n) {}
inline void ergodox_led_all_set(uint8_t n) {}
void ergodox_blink_all_leds(void);
|