line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
31
|
|
|
31
|
|
176
|
use strict; |
|
31
|
|
|
|
|
49
|
|
|
31
|
|
|
|
|
779
|
|
2
|
31
|
|
|
31
|
|
124
|
use warnings; |
|
31
|
|
|
|
|
52
|
|
|
31
|
|
|
|
|
1570
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.32'; |
4
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package VIC::PIC::Roles::CodeGen; |
7
|
|
|
|
|
|
|
{ |
8
|
31
|
|
|
31
|
|
12530
|
use Moo::Role; |
|
31
|
|
|
|
|
223124
|
|
|
31
|
|
|
|
|
163
|
|
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
|
|
9972
|
use Moo::Role; |
|
31
|
|
|
|
|
77
|
|
|
31
|
|
|
|
|
157
|
|
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
|
|
10332
|
use Moo::Role; |
|
31
|
|
|
|
|
57
|
|
|
31
|
|
|
|
|
124
|
|
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
|
|
11646
|
use Moo::Role; |
|
31
|
|
|
|
|
68
|
|
|
31
|
|
|
|
|
1057
|
|
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
|
|
9063
|
use Moo::Role; |
|
31
|
|
|
|
|
62
|
|
|
31
|
|
|
|
|
121
|
|
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
|
|
8759
|
use Moo::Role; |
|
31
|
|
|
|
|
86
|
|
|
31
|
|
|
|
|
143
|
|
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
|
|
9848
|
use Moo::Role; |
|
31
|
|
|
|
|
78
|
|
|
31
|
|
|
|
|
1144
|
|
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
|
|
15692
|
use Moo::Role; |
|
31
|
|
|
|
|
56
|
|
|
31
|
|
|
|
|
1891
|
|
83
|
|
|
|
|
|
|
requires qw(ccp_pins); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
package VIC::PIC::Roles::ECCP; |
87
|
|
|
|
|
|
|
{ |
88
|
31
|
|
|
31
|
|
17254
|
use Moo::Role; |
|
31
|
|
|
|
|
1049
|
|
|
31
|
|
|
|
|
832
|
|
89
|
|
|
|
|
|
|
requires qw(eccp_pins pwm_single pwm_halfbridge pwm_fullbridge); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
package VIC::PIC::Roles::Operations; |
93
|
|
|
|
|
|
|
{ |
94
|
31
|
|
|
31
|
|
11315
|
use Moo::Role; |
|
31
|
|
|
|
|
53
|
|
|
31
|
|
|
|
|
83
|
|
95
|
|
|
|
|
|
|
requires qw(delay delay_ms delay_us delay_s debounce); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
package VIC::PIC::Roles::USART; |
99
|
|
|
|
|
|
|
{ |
100
|
31
|
|
|
31
|
|
7712
|
use Moo::Role; |
|
31
|
|
|
|
|
49
|
|
|
31
|
|
|
|
|
92
|
|
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
|
|
7845
|
use Moo::Role; |
|
31
|
|
|
|
|
50
|
|
|
31
|
|
|
|
|
83
|
|
107
|
|
|
|
|
|
|
requires qw(spi_pins selector_pins); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
package VIC::PIC::Roles::I2C; |
111
|
|
|
|
|
|
|
{ |
112
|
31
|
|
|
31
|
|
8601
|
use Moo::Role; |
|
31
|
|
|
|
|
62
|
|
|
31
|
|
|
|
|
118
|
|
113
|
|
|
|
|
|
|
requires qw(i2c_pins selector_pins); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
package VIC::PIC::Roles::Comparator; |
117
|
|
|
|
|
|
|
{ |
118
|
31
|
|
|
31
|
|
8298
|
use Moo::Role; |
|
31
|
|
|
|
|
47
|
|
|
31
|
|
|
|
|
120
|
|
119
|
|
|
|
|
|
|
requires qw(cmp_output_pins cmp_input_pins); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
package VIC::PIC::Roles::PSP; |
123
|
|
|
|
|
|
|
{ |
124
|
31
|
|
|
31
|
|
8148
|
use Moo::Role; |
|
31
|
|
|
|
|
54
|
|
|
31
|
|
|
|
|
114
|
|
125
|
|
|
|
|
|
|
requires qw(psp_pins); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
package VIC::PIC::Roles::SRLatch; |
129
|
|
|
|
|
|
|
{ |
130
|
31
|
|
|
31
|
|
9676
|
use Moo::Role; |
|
31
|
|
|
|
|
66
|
|
|
31
|
|
|
|
|
107
|
|
131
|
|
|
|
|
|
|
requires qw(srlatch); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
package VIC::PIC::Roles::USB; |
135
|
|
|
|
|
|
|
{ |
136
|
31
|
|
|
31
|
|
8834
|
use Moo::Role; |
|
31
|
|
|
|
|
57
|
|
|
31
|
|
|
|
|
100
|
|
137
|
|
|
|
|
|
|
requires qw(usb_pins); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
package VIC::PIC::Roles::Power; |
141
|
|
|
|
|
|
|
{ |
142
|
31
|
|
|
31
|
|
8451
|
use Moo::Role; |
|
31
|
|
|
|
|
67
|
|
|
31
|
|
|
|
|
127
|
|
143
|
|
|
|
|
|
|
requires qw(sleep); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
1; |
147
|
|
|
|
|
|
|
__END__ |