libyggdrasil  v1.0.0
sink_driver.h
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Yggdrasil - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #pragma once
27 
28 #include <c/yggdrasil/types.h>
29 
38 };
39 
46 
57 
65 
66 
67 /*
68  * @brief Set the duty cycle
69  *
70  * @param channel Channel which should be changed
71  * @param dutyCycle Duty cycle
72  */
73 C_LINKAGE void yggdrasil_SinkDriver_PWM_SetDuty(enum SinkDriverChannel channel, float dutyCycle);
74 
87 
96 
97 
105 
SinkDriverChannel_B
@ SinkDriverChannel_B
Timer channel B.
Definition: sink_driver.h:35
u16
uint16_t u16
Definition: types.h:37
yggdrasil_SinkDriver_Out_Set
C_LINKAGE void yggdrasil_SinkDriver_Out_Set(enum SinkDriverChannel channel, bool state)
set the sink driver pin state
yggdrasil_SinkDriver_PWM_SetDuty
C_LINKAGE void yggdrasil_SinkDriver_PWM_SetDuty(enum SinkDriverChannel channel, float dutyCycle)
yggdrasil_SinkDriver_Servo_Set
C_LINKAGE void yggdrasil_SinkDriver_Servo_Set(enum SinkDriverChannel channel, float percent)
Set the servo arm rotation in percent relative to its maximal value.
u32
uint32_t u32
Definition: types.h:38
yggdrasil_SinkDriver_Init
C_LINKAGE void yggdrasil_SinkDriver_Init(void)
Initialization function.
yggdrasil_SinkDriver_PWM_SetFrequency
C_LINKAGE bool yggdrasil_SinkDriver_PWM_SetFrequency(u32 frequency, u16 resolution)
Set the pwm frequency and (optional) the maximal ticks within on cycle for all channels.
types.h
SinkDriverChannel
SinkDriverChannel
Sink Driver Timer Channels.
Definition: sink_driver.h:33
SinkDriverChannel_C
@ SinkDriverChannel_C
Timer channel C.
Definition: sink_driver.h:36
SinkDriverChannel_A
@ SinkDriverChannel_A
Timer channel A.
Definition: sink_driver.h:34
yggdrasil_SinkDriver_PWM_GetFrequency
C_LINKAGE u32 yggdrasil_SinkDriver_PWM_GetFrequency(enum SinkDriverChannel channel)
Get the pwm frequency.
yggdrasil_SinkDriver_Servo_SetDeltaHighTime
C_LINKAGE void yggdrasil_SinkDriver_Servo_SetDeltaHighTime(enum SinkDriverChannel channel, u16 delta)
FUnction to set the high time of the pwm pulse.
C_LINKAGE
#define C_LINKAGE
Definition: attributes.h:43
SinkDriverChannel_D
@ SinkDriverChannel_D
Timer channel D.
Definition: sink_driver.h:37