line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
31
|
|
|
31
|
|
112
|
use strict; |
|
31
|
|
|
|
|
42
|
|
|
31
|
|
|
|
|
740
|
|
2
|
31
|
|
|
31
|
|
101
|
use warnings; |
|
31
|
|
|
|
|
40
|
|
|
31
|
|
|
|
|
1520
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.31'; |
4
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package VIC::PIC::Roles::CodeGen; |
7
|
|
|
|
|
|
|
{ |
8
|
31
|
|
|
31
|
|
12555
|
use Moo::Role; |
|
31
|
|
|
|
|
182827
|
|
|
31
|
|
|
|
|
181
|
|
9
|
|
|
|
|
|
|
requires qw(type org include chip_config get_chip_config code_config |
10
|
|
|
|
|
|
|
validate validate_modifier_operator update_code_config |
11
|
|
|
|
|
|
|
list_roles is_variable |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package VIC::PIC::Roles::Operators; |
16
|
|
|
|
|
|
|
{ |
17
|
31
|
|
|
31
|
|
8485
|
use Moo::Role; |
|
31
|
|
|
|
|
50
|
|
|
31
|
|
|
|
|
109
|
|
18
|
|
|
|
|
|
|
requires qw( |
19
|
|
|
|
|
|
|
op_assign op_assign_wreg rol ror op_shl op_shr shl shr op_not |
20
|
|
|
|
|
|
|
op_comp op_add_assign_literal op_add_assign op_sub_assign |
21
|
|
|
|
|
|
|
op_mul_assign op_div_assign op_mod_assign op_bxor_assign |
22
|
|
|
|
|
|
|
op_band_assign op_bor_assign op_shl_assign op_shr_assign |
23
|
|
|
|
|
|
|
op_inc op_dec op_add op_sub op_mul op_div op_mod op_bxor |
24
|
|
|
|
|
|
|
op_band op_bor op_eq op_lt op_ge op_ne op_le op_gt op_and |
25
|
|
|
|
|
|
|
op_or op_sqrt break continue store_array store_string |
26
|
|
|
|
|
|
|
store_table op_tblidx op_stridx op_arridx store_bytes |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package VIC::PIC::Roles::Chip; |
31
|
|
|
|
|
|
|
{ |
32
|
31
|
|
|
31
|
|
7464
|
use Moo::Role; |
|
31
|
|
|
|
|
51
|
|
|
31
|
|
|
|
|
98
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
requires qw(f_osc pcl_size stack_size wreg_size |
35
|
|
|
|
|
|
|
memory address banks registers address_bits |
36
|
|
|
|
|
|
|
pins clock_pins oscillator_pins program_pins); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# useful for checking if a chip is PDIP or SOIC or SSOP or QFN |
39
|
|
|
|
|
|
|
# maybe extracted to a separate role defining chip type but not yet |
40
|
|
|
|
|
|
|
requires qw(pin_counts); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
package VIC::PIC::Roles::GPIO; |
44
|
|
|
|
|
|
|
{ |
45
|
31
|
|
|
31
|
|
7737
|
use Moo::Role; |
|
31
|
|
|
|
|
49
|
|
|
31
|
|
|
|
|
98
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# input_pins is a list of input pins. |
48
|
|
|
|
|
|
|
# output pins is a list of output pins. |
49
|
|
|
|
|
|
|
# Bi-directional pins will be in both lists |
50
|
|
|
|
|
|
|
# analog_pins are a list of analog_pins |
51
|
|
|
|
|
|
|
requires qw(input_pins output_pins io_ports |
52
|
|
|
|
|
|
|
analog_pins get_input_pin get_output_pin); |
53
|
|
|
|
|
|
|
requires qw(digital_output digital_input analog_input write read setup); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package VIC::PIC::Roles::ADC; |
57
|
|
|
|
|
|
|
{ |
58
|
31
|
|
|
31
|
|
6903
|
use Moo::Role; |
|
31
|
|
|
|
|
52
|
|
|
31
|
|
|
|
|
92
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
requires qw(adc_enable adc_disable adc_read adc_channels adcs_bits |
61
|
|
|
|
|
|
|
adc_chs_bits analog_pins); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
package VIC::PIC::Roles::Timer; |
65
|
|
|
|
|
|
|
{ |
66
|
31
|
|
|
31
|
|
6219
|
use Moo::Role; |
|
31
|
|
|
|
|
49
|
|
|
31
|
|
|
|
|
100
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
requires qw(timer_enable timer_disable timer timer_prescaler |
69
|
|
|
|
|
|
|
wdt_prescaler timer_pins); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
package VIC::PIC::Roles::ISR; |
73
|
|
|
|
|
|
|
{ |
74
|
31
|
|
|
31
|
|
6450
|
use Moo::Role; |
|
31
|
|
|
|
|
45
|
|
|
31
|
|
|
|
|
98
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
requires qw(eint_pins ioc_pins); |
77
|
|
|
|
|
|
|
requires qw(isr_entry isr_exit isr_var isr_timer isr_ioc); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
package VIC::PIC::Roles::CCP; |
81
|
|
|
|
|
|
|
{ |
82
|
31
|
|
|
31
|
|
6915
|
use Moo::Role; |
|
31
|
|
|
|
|
50
|
|
|
31
|
|
|
|
|
103
|
|
83
|
|
|
|
|
|
|
requires qw(ccp_pins); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
package VIC::PIC::Roles::ECCP; |
87
|
|
|
|
|
|
|
{ |
88
|
31
|
|
|
31
|
|
6106
|
use Moo::Role; |
|
31
|
|
|
|
|
42
|
|
|
31
|
|
|
|
|
146
|
|
89
|
|
|
|
|
|
|
requires qw(eccp_pins pwm_single pwm_halfbridge pwm_fullbridge); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
package VIC::PIC::Roles::Operations; |
93
|
|
|
|
|
|
|
{ |
94
|
31
|
|
|
31
|
|
6396
|
use Moo::Role; |
|
31
|
|
|
|
|
47
|
|
|
31
|
|
|
|
|
85
|
|
95
|
|
|
|
|
|
|
requires qw(delay delay_ms delay_us delay_s debounce); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
package VIC::PIC::Roles::USART; |
99
|
|
|
|
|
|
|
{ |
100
|
31
|
|
|
31
|
|
5896
|
use Moo::Role; |
|
31
|
|
|
|
|
44
|
|
|
31
|
|
|
|
|
93
|
|
101
|
|
|
|
|
|
|
requires qw(usart_pins usart_write usart_read usart_setup usart_baudrates); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
package VIC::PIC::Roles::SPI; |
105
|
|
|
|
|
|
|
{ |
106
|
31
|
|
|
31
|
|
6072
|
use Moo::Role; |
|
31
|
|
|
|
|
50
|
|
|
31
|
|
|
|
|
101
|
|
107
|
|
|
|
|
|
|
requires qw(spi_pins selector_pins); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
package VIC::PIC::Roles::I2C; |
111
|
|
|
|
|
|
|
{ |
112
|
31
|
|
|
31
|
|
6367
|
use Moo::Role; |
|
31
|
|
|
|
|
37
|
|
|
31
|
|
|
|
|
94
|
|
113
|
|
|
|
|
|
|
requires qw(i2c_pins selector_pins); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
package VIC::PIC::Roles::Comparator; |
117
|
|
|
|
|
|
|
{ |
118
|
31
|
|
|
31
|
|
6402
|
use Moo::Role; |
|
31
|
|
|
|
|
42
|
|
|
31
|
|
|
|
|
85
|
|
119
|
|
|
|
|
|
|
requires qw(cmp_output_pins cmp_input_pins); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
package VIC::PIC::Roles::PSP; |
123
|
|
|
|
|
|
|
{ |
124
|
31
|
|
|
31
|
|
5901
|
use Moo::Role; |
|
31
|
|
|
|
|
43
|
|
|
31
|
|
|
|
|
93
|
|
125
|
|
|
|
|
|
|
requires qw(psp_pins); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
package VIC::PIC::Roles::SRLatch; |
129
|
|
|
|
|
|
|
{ |
130
|
31
|
|
|
31
|
|
6117
|
use Moo::Role; |
|
31
|
|
|
|
|
41
|
|
|
31
|
|
|
|
|
88
|
|
131
|
|
|
|
|
|
|
requires qw(srlatch); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
package VIC::PIC::Roles::USB; |
135
|
|
|
|
|
|
|
{ |
136
|
31
|
|
|
31
|
|
6740
|
use Moo::Role; |
|
31
|
|
|
|
|
52
|
|
|
31
|
|
|
|
|
123
|
|
137
|
|
|
|
|
|
|
requires qw(usb_pins); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
package VIC::PIC::Roles::Power; |
141
|
|
|
|
|
|
|
{ |
142
|
31
|
|
|
31
|
|
6164
|
use Moo::Role; |
|
31
|
|
|
|
|
69
|
|
|
31
|
|
|
|
|
100
|
|
143
|
|
|
|
|
|
|
requires qw(sleep); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
1; |
147
|
|
|
|
|
|
|
__END__ |