aboutsummaryrefslogtreecommitdiff
path: root/Kconfig
blob: ebafb5bea227ed77720feed23248044d2da01664 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
mainmenu "AVR-IOE configuration"

config IOEROOT
    string
    option env="IOEROOT"
source "$IOEROOT/include/mcu/Kconfig"

config F_CPU
    int "CPU frequency in kHz (F_CPU)"
    default 16000

# Toolchain #####################################################################

menu "Compilation options"

config GNUTOOLCHAIN_PREFIX
    string "GNU Toolchain prefix"
    default "avr-"

config CONFCFLAGS
    string "Compilation CFlags"
    default "-Os -ffunction-sections -fdata-sections -fshort-enums -Wall"

endmenu

# Tracing and error handling ####################################################

menu "Tracing and error handling"

config CONFIG_ERRORS
    bool "Errors support"

if CONFIG_ERRORS

menu "Errors handling"

config CONFIG_EH_RESTART
    bool "Restart MCU on error detection"

config CONFIG_EH_MEMORY
    bool "TODO: Write error code and possible stack trase to EEPROM"

config CONFIG_EH_LED
    bool "Signal error detection by LED"
    depends on CONFIG_IOPORTS

config CONFIG_EH_LED_IOPIN
    string "Error detection led output pin"
    depends on CONFIG_EH_LED
    default "IO_B0"
    ---help---
    Specifies IO pin which will be pulled up on error detection.
    This string should be valid IO port (for example "IO_B0") or pair of group
    mask divided by comma (for example "IO_B, _BV(0)").

config CONFIG_EH_USART
    bool "Send error informations by UART"
    depends on CONFIG_USART && CONFIG_USART_OUTPUT_BUFFER

endmenu

config CONFIG_CHECK_ARGUMENTS
    bool "Check arguments for all functions in library"

endif

config CONFIG_TRACING
    bool "TODO: Tracing support"

if CONFIG_TRACING

config CONFIG_TRACE_FUNCTIONCALL
    bool "TODO: Trace all function calls in library"

endif

endmenu

# IO Ports ######################################################################

config MCUSUPPORT_IOPORTS
    bool
    default n

config CONFIG_IOPORTS
    bool "Input/Output ports"
    default y
    depends on MCUSUPPORT_IOPORTS

config MCUSUPPORT_PCINT0
    bool
    default n
config MCUSUPPORT_PCINT1
    bool
    default n
config MCUSUPPORT_PCINT2
    bool
    default n

config CONFIG_IOPORTS_PCINT
    bool "Input/Output ports change interrupts"
	depends on CONFIG_IOPORTS
    depends on MCUSUPPORT_PCINT0 || MCUSUPPORT_PCINT1 || MCUSUPPORT_PCINT2

# SPI ###########################################################################

config MCUSUPPORT_SPI
    bool
    default n

config CONFIG_SPI
	bool "Serial peripheral interface"
    depends on MCUSUPPORT_SPI

# USART #########################################################################
config MCUSUPPORT_USART
    bool
    default n

menuconfig CONFIG_USART
	bool "Universal synchronous/asynchronous transceiver"
    depends on MCUSUPPORT_USART

if CONFIG_USART

config CONFIG_USART_BAUD
	int "Baudrate"
	default 115200

choice USART_PARITY_C
	prompt "Parity"
config USART_PARITY_C_NONE
	bool "None"
config USART_PARITY_C_ODD
	bool "Odd"
config USART_PARITY_C_EVEN
	bool "Even"
endchoice
config CONFIG_USART_PARITY
	string
	default "USART_PARITY_NONE" if USART_PARITY_C_NONE
	default "USART_PARITY_ODD" if USART_PARITY_C_ODD
	default "USART_PARITY_EVEN" if USART_PARITY_C_EVEN

config CONFIG_USART_DATABITS
	int "Data bits"
	default 8
    range 5 8

choice USART_STOPBIT_C
	prompt "Stop bit"
config USART_STOPBIT_C_SINGLE
	bool "Single"
config USART_STOPBIT_C_DOUBLE
	bool "Double"
endchoice
config CONFIG_USART_STOPBIT
	string
	default "USART_STOPBIT_SINGLE" if USART_STOPBIT_C_SINGLE
	default "USART_STOPBIT_DOUBLE" if USART_STOPBIT_C_DOUBLE

config CONFIG_USART_OUTPUT_BUFFER
	bool "Use output buffer"
	default n

config CONFIG_USART_OUTBUFFER_SIZE
	int "Output buffer size in bytes." if CONFIG_USART_OUTPUT_BUFFER
	default 0 if ! CONFIG_USART_OUTPUT_BUFFER
    range 1 512000 if CONFIG_USART_OUTPUT_BUFFER
	default 32

choice USART_OUTBUFFER_MODE_C
	prompt "Output buffer replacement policy" if CONFIG_USART_OUTPUT_BUFFER
config USART_OUTBUFFER_MODE_C_BLOCK
	bool "Block"
config USART_OUTBUFFER_MODE_C_OVERWRITE
	bool "Overwrite"
config USART_OUTBUFFER_MODE_C_DROP
	bool "Drop"
endchoice
config CONFIG_USART_OUTBUFFER_MODE
	int
	default 1 if USART_OUTBUFFER_MODE_C_OVERWRITE
	default 2 if USART_OUTBUFFER_MODE_C_DROP
	default 0

config CONFIG_USART_INPUT_BUFFER
	bool "Use input buffer"

config CONFIG_USART_INBUFFER_SIZE
	int "Input buffer size in bytes." if CONFIG_USART_INPUT_BUFFER
	default 0 if ! CONFIG_USART_INPUT_BUFFER
    range 1 512000 if CONFIG_USART_INPUT_BUFFER
	default 32

choice USART_INBUFFER_MODE_C
	prompt "Input buffer replacement policy" if CONFIG_USART_INPUT_BUFFER
config USART_INBUFFER_MODE_C_BLOCK
	bool "Block"
config USART_INBUFFER_MODE_C_OVERWRITE
	bool "Overwrite"
config USART_INBUFFER_MODE_C_DROP
	bool "Drop"
endchoice
config CONFIG_USART_INBUFFER_MODE
	int
	default 1 if USART_INBUFFER_MODE_C_OVERWRITE
	default 2 if USART_INBUFFER_MODE_C_DROP
	default 0

config CONFIG_USART_OUTFILE
    bool "STD FILE support for output"
    depends on CONFIG_USART_OUTPUT_BUFFER

config CONFIG_USART_INFILE
    bool "STD FILE support for input"
    depends on CONFIG_USART_INPUT_BUFFER

endif

# Timers ########################################################################

config CONFIG_TIMERS
    bool "Timers"

# Tasks #########################################################################

menuconfig CONFIG_TASKS
    bool "Taks support"
    depends on CONFIG_TIMERS

if CONFIG_TASKS

config CONFIG_TASKS_TIME
    bool "Measure approximate real time"

choice TASKS_TIMER
    prompt "Timer used for tasks planning and interrupts"
    default TASKS_TIMER_2

config TASKS_TIMER_0
    bool "Timer0 (8-bit)"

config TASKS_TIMER_1
    bool "Timer1 (16-bit)"

config TASKS_TIMER_2
    bool "Timer2 (8-bit asynchronous)"

endchoice

endif

# Jobs ##########################################################################

menuconfig CONFIG_JOBS
    bool "Jobs support"
    ---help---
    Job support allows you to plan and execute functions periodically. This is
    designed for realtime control.

if CONFIG_JOBS

choice JOBS_DURATION
    prompt "Jobs duration source"

config JOBS_DURATION_CONSTANT
    bool "Predefined constants"

config JOBS_DURATION_PREV
    bool "Previous execution time"

config JOBS_DURATION_MAX
    bool "Maximum previous time"

endchoice

endif