Choco OS  V.0.16.9.0
Join to the chocolate world
oc_timer_lld.c
1 
27 #include <oc_timer_lld.h>
28 #include <oc_mem_lld.h>
29 #include <oc_clock_lld.h>
30 #include <oc_gpio_lld.h>
31 #include <oc_gpio_mslld.h>
32 
33 #include <oc_math.h>
34 #include <oc_array.h>
35 
41 #define _________________________________________LOCAL_MACROS_SECTION_______________________________________________________________________
42 
43 #undef _________________________________________LOCAL_MACROS_SECTION_______________________________________________________________________
44 
50 #define _________________________________________LOCAL_TYPES_SECTION________________________________________________________________________
51 
52 #undef _________________________________________LOCAL_TYPES_SECTION________________________________________________________________________
53 
54 
60 #define _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________
61 
62 
63 
64 #undef _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________
65 
71 #define _________________________________________LOCAL_PROTOTYPES_SECTION_________________________________________________________________
72 
73 #undef _________________________________________LOCAL_PROTOTYPES_SECTION_________________________________________________________________
74 
75 
81 #define _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________
82 
83 //==========================================================================================================================================
88 //==========================================================================================================================================
89 oC_ErrorCode_t oC_TIMER_LLD_TurnOnDriver( void )
90 {
91  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
92 
93  return errorCode;
94 }
95 
96 //==========================================================================================================================================
101 //==========================================================================================================================================
102 oC_ErrorCode_t oC_TIMER_LLD_TurnOffDriver( void )
103 {
104  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
105 
106 
107  return errorCode;
108 }
109 
110 //==========================================================================================================================================
115 //==========================================================================================================================================
116 bool oC_TIMER_LLD_IsChannelCorrect( oC_TIMER_Channel_t Channel )
117 {
118  return oC_Channel_IsCorrect(TIMER , Channel);
119 }
120 
121 //==========================================================================================================================================
126 //==========================================================================================================================================
127 bool oC_TIMER_LLD_IsChannelIndexCorrect( oC_ChannelIndex_t ChannelIndex )
128 {
129  return ChannelIndex < oC_ModuleChannel_NumberOfElements(TIMER);
130 }
131 
132 //==========================================================================================================================================
137 //==========================================================================================================================================
138 bool oC_TIMER_LLD_IsModulePinDefined( oC_TIMER_Pin_t ModulePin )
139 {
140  oC_Pin_t pin = oC_ModulePin_GetPin(ModulePin);
141  return oC_GPIO_LLD_IsPinDefined(pin);
142 }
143 
144 //==========================================================================================================================================
149 //==========================================================================================================================================
150 bool oC_TIMER_LLD_IsSubTimerCorrect(oC_TIMER_LLD_SubTimer_t SubTimer)
151 {
152  return SubTimer > oC_TIMER_LLD_SubTimer_None && SubTimer <= oC_TIMER_LLD_SubTimer_Both;
153 }
154 
155 //==========================================================================================================================================
160 //==========================================================================================================================================
161 oC_Pins_t oC_TIMER_LLD_GetPinOfModulePin( oC_TIMER_Pin_t ModulePin )
162 {
163  return oC_ModulePin_GetPin(ModulePin);
164 }
165 
166 //==========================================================================================================================================
171 //==========================================================================================================================================
172 const char * oC_TIMER_LLD_GetModulePinName( oC_TIMER_Pin_t ModulePin )
173 {
174  return oC_GPIO_LLD_GetPinName( oC_ModulePin_GetPin(ModulePin) );
175 }
176 
177 //==========================================================================================================================================
182 //==========================================================================================================================================
183 const char * oC_TIMER_LLD_GetChannelName( oC_TIMER_Channel_t Channel )
184 {
185  return oC_Channel_GetName( Channel );
186 }
187 
188 //==========================================================================================================================================
193 //==========================================================================================================================================
194 oC_TIMER_Channel_t oC_TIMER_LLD_GetChannelOfModulePin( oC_TIMER_Pin_t ModulePin )
195 {
196  return oC_ModulePin_GetChannel(ModulePin);
197 }
198 
199 //==========================================================================================================================================
204 //==========================================================================================================================================
205 oC_ChannelIndex_t oC_TIMER_LLD_ChannelToChannelIndex( oC_TIMER_Channel_t Channel )
206 {
207  return oC_Channel_ToIndex(TIMER,Channel);
208 }
209 
210 //==========================================================================================================================================
215 //==========================================================================================================================================
216 oC_TIMER_Channel_t oC_TIMER_LLD_ChannelIndexToChannel( oC_ChannelIndex_t ChannelIndex )
217 {
218  return oC_Channel_FromIndex(TIMER,ChannelIndex);
219 }
220 
221 //==========================================================================================================================================
226 //==========================================================================================================================================
227 oC_ErrorCode_t oC_TIMER_LLD_SetPower( oC_TIMER_Channel_t Channel , oC_Power_t Power )
228 {
229  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
230 
231  return errorCode;
232 }
233 
234 //==========================================================================================================================================
239 //==========================================================================================================================================
240 oC_ErrorCode_t oC_TIMER_LLD_ReadPower( oC_TIMER_Channel_t Channel , oC_Power_t * outPower )
241 {
242  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
243 
244 
245  return errorCode;
246 }
247 
248 //==========================================================================================================================================
253 //==========================================================================================================================================
254 bool oC_TIMER_LLD_RestoreDefaultStateOnChannel( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
255 {
256  bool stateRestored = false;
257 
258  return stateRestored;
259 }
260 
261 //==========================================================================================================================================
266 //==========================================================================================================================================
267 oC_ErrorCode_t oC_TIMER_LLD_TimerStart( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
268 {
269  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
270 
271 
272  return errorCode;
273 }
274 
275 //==========================================================================================================================================
280 //==========================================================================================================================================
281 oC_ErrorCode_t oC_TIMER_LLD_TimerStop( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
282 {
283  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
284 
285 
286  return errorCode;
287 }
288 
289 //==========================================================================================================================================
294 //==========================================================================================================================================
295 oC_ErrorCode_t oC_TIMER_LLD_ChangeFrequency( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_Frequency_t Frequency , oC_Frequency_t PermissibleDifference )
296 {
297  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
298 
299 
300  return errorCode;
301 }
302 
303 //==========================================================================================================================================
308 //==========================================================================================================================================
309 oC_ErrorCode_t oC_TIMER_LLD_ReadFrequency( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_Frequency_t * outFrequency )
310 {
311  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
312 
313 
314  return errorCode;
315 }
316 
317 //==========================================================================================================================================
322 //==========================================================================================================================================
323 oC_ErrorCode_t oC_TIMER_LLD_ChangeMaximumValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t Value )
324 {
325  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
326 
327 
328  return errorCode;
329 }
330 
331 //==========================================================================================================================================
336 //==========================================================================================================================================
337 oC_ErrorCode_t oC_TIMER_LLD_ReadMaximumValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t * outValue )
338 {
339  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
340 
341 
342  return errorCode;
343 }
344 
345 //==========================================================================================================================================
350 //==========================================================================================================================================
351 oC_ErrorCode_t oC_TIMER_LLD_ChangeCurrentValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t Value )
352 {
353  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
354 
355 
356  return errorCode;
357 }
358 
359 //==========================================================================================================================================
364 //==========================================================================================================================================
365 oC_ErrorCode_t oC_TIMER_LLD_ReadCurrentValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t * outValue )
366 {
367  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
368 
369 
370  return errorCode;
371 }
372 
373 //==========================================================================================================================================
378 //==========================================================================================================================================
379 oC_ErrorCode_t oC_TIMER_LLD_ChangeMatchValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t Value )
380 {
381  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
382 
383  return errorCode;
384 }
385 
386 //==========================================================================================================================================
391 //==========================================================================================================================================
392 oC_ErrorCode_t oC_TIMER_LLD_ReadMatchValue( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , uint64_t * outValue )
393 {
394  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
395 
396 
397  return errorCode;
398 }
399 
400 //==========================================================================================================================================
405 //==========================================================================================================================================
406 oC_ErrorCode_t oC_TIMER_LLD_ChangeMode( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_Mode_t Mode )
407 {
408  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
409 
410  return errorCode;
411 }
412 
413 //==========================================================================================================================================
418 //==========================================================================================================================================
419 oC_ErrorCode_t oC_TIMER_LLD_ReadMode( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_Mode_t * outMode )
420 {
421  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
422 
423  return errorCode;
424 }
425 
426 //==========================================================================================================================================
431 //==========================================================================================================================================
432 oC_ErrorCode_t oC_TIMER_LLD_ChangeCountDirection( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_CountDirection_t CountDirection )
433 {
434  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
435 
436 
437  return errorCode;
438 }
439 
440 //==========================================================================================================================================
445 //==========================================================================================================================================
446 oC_ErrorCode_t oC_TIMER_LLD_ReadCountDirection( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_CountDirection_t * outCountDirection )
447 {
448  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
449 
450  return errorCode;
451 }
452 
453 //==========================================================================================================================================
458 //==========================================================================================================================================
459 oC_ErrorCode_t oC_TIMER_LLD_ChangeTrigger( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_Trigger_t Trigger )
460 {
461  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
462 
463 
464  return errorCode;
465 }
466 
467 //==========================================================================================================================================
472 //==========================================================================================================================================
473 oC_ErrorCode_t oC_TIMER_LLD_ReadTrigger( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_Trigger_t * outTrigger )
474 {
475  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
476 
477 
478  return errorCode;
479 }
480 
481 //==========================================================================================================================================
486 //==========================================================================================================================================
487 oC_ErrorCode_t oC_TIMER_LLD_ChangeEventHandler( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_EventHandler_t EventHandler , oC_TIMER_LLD_EventFlags_t EventFlags )
488 {
489  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
490 
491 
492  return errorCode;
493 }
494 
495 //==========================================================================================================================================
500 //==========================================================================================================================================
501 oC_ErrorCode_t oC_TIMER_LLD_ReadEventHandler(oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_EventHandler_t * outEventHandler , oC_TIMER_LLD_EventFlags_t * outEventFlags )
502 {
503  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
504 
505 
506  return errorCode;
507 }
508 
509 //==========================================================================================================================================
514 //==========================================================================================================================================
515 oC_ErrorCode_t oC_TIMER_LLD_ChangeStartPwmState( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_PwmState_t State)
516 {
517  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
518 
519 
520  return errorCode;
521 }
522 
523 //==========================================================================================================================================
528 //==========================================================================================================================================
529 oC_ErrorCode_t oC_TIMER_LLD_ReadStartPwmState( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer , oC_TIMER_LLD_PwmState_t * outState)
530 {
531  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
532 
533 
534  return errorCode;
535 }
536 
537 //==========================================================================================================================================
542 //==========================================================================================================================================
543 oC_ErrorCode_t oC_TIMER_LLD_ConnectModulePin(oC_TIMER_Pin_t PeripheralPin )
544 {
545  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
546 
547  return errorCode;
548 }
549 
550 //==========================================================================================================================================
555 //==========================================================================================================================================
556 oC_ErrorCode_t oC_TIMER_LLD_ReadSubTimerOfPeripheralPin(oC_TIMER_Pin_t PeripheralPin , oC_TIMER_LLD_SubTimer_t * outSubTimer )
557 {
558  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
559 
560 
561  return errorCode;
562 }
563 
564 //==========================================================================================================================================
569 //==========================================================================================================================================
570 oC_ErrorCode_t oC_TIMER_LLD_SetChannelUsed( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
571 {
572  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
573 
574 
575  return errorCode;
576 }
577 
578 //==========================================================================================================================================
583 //==========================================================================================================================================
584 oC_ErrorCode_t oC_TIMER_LLD_SetChannelUnused( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
585 {
586  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
587 
588  return errorCode;
589 }
590 
591 //==========================================================================================================================================
596 //==========================================================================================================================================
597 bool oC_TIMER_LLD_IsChannelUsed( oC_TIMER_Channel_t Channel , oC_TIMER_LLD_SubTimer_t SubTimer )
598 {
599  return false;
600 }
601 
602 //==========================================================================================================================================
607 //==========================================================================================================================================
608 oC_ErrorCode_t oC_TIMER_LLD_ReadModulePinsOfPin( oC_Pins_t Pin , oC_TIMER_Pin_t * outPeripheralPinsArray , uint32_t * ArraySize )
609 {
610  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
611 
612  return errorCode;
613 }
614 
615 #undef _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________
616 
617 
623 #define _________________________________________LOCAL_FUNCTIONS_SECTION____________________________________________________________________
624 
625 
626 #undef _________________________________________LOCAL_FUNCTIONS_SECTION____________________________________________________________________
627 
628 
634 #define _________________________________________INTERRUPTS_SECTION_________________________________________________________________________
635 
636 
637 #undef _________________________________________INTERRUPTS_SECTION_________________________________________________________________________
638 
Basic math operations.
The file with LLD interface for the TIMER driver.
double oC_Frequency_t
type to store frequency
Definition: oc_frequency.h:76
#define oC_Channel_GetName(Channel)
returns name of channel
Definition: oc_channels.h:391
The file with LLD interface for the MEM driver.
The file with LLD interface for the GPIO driver.
The file with LLD interface for the CLOCK driver.
oC_Channel_t
stores machine channel
Definition: oc_channels.h:573
#define oC_Channel_IsCorrect(MODULE_NAME, Channel)
checks if channel is correct
Definition: oc_channels.h:283
#define oC_Channel_FromIndex(MODULE_NAME, ChannelIndex)
returns channel according to index in module
Definition: oc_channels.h:313
#define oC_ModuleChannel_NumberOfElements(MODULE_NAME)
Number of elements in module channel.
Definition: oc_channels.h:465
Static array definitions.
#define oC_Channel_ToIndex(MODULE_NAME, Channel)
returns index in module according to channel
Definition: oc_channels.h:298
oC_Power_t
stores registers power state
Definition: oc_stdtypes.h:249