PID regulator v 1.0
 
Loading...
Searching...
No Matches
cytronDriver.h File Reference

Sterownik silnika DC do obsługi prędkości i kierunku obrotów za pomocą PWM. More...

#include "stm32l0xx.h"

Go to the source code of this file.

Data Structures

struct  driver_struct
 Struktura reprezentująca sterownik silnika DC. More...
 

Enumerations

enum  Cytron_Direction { cw = 0 , ccw = 1 }
 Enum określający kierunek obrotów silnika. More...
 

Functions

void Cytron_Set_Motor_Direction (driver_struct *driver, Cytron_Direction direction)
 Ustawia kierunek obrotów silnika.
 
void Cytron_Set_Motor_Speed (driver_struct *driver, uint16_t speed)
 Ustawia prędkość obrotów silnika.
 
void Cytron_Motor_Init (driver_struct *driver, TIM_HandleTypeDef *PWM_timer)
 Inicjalizuje sterownik silnika z początkową prędkością 0 i domyślnym kierunkiem.
 

Detailed Description

Sterownik silnika DC do obsługi prędkości i kierunku obrotów za pomocą PWM.

Struktury:

  • driver_struct: Zawiera wskaźnik do timera PWM, kierunek obrotów i aktualny kanał timera.

    Created on: Dec 1, 2024 Author: Igor

Enumeration Type Documentation

◆ Cytron_Direction

Enum określający kierunek obrotów silnika.

  • cw: zgodnie z ruchem wskazówek zegara.
  • ccw: przeciwnie do ruchu wskazówek zegara.

Function Documentation

◆ Cytron_Motor_Init()

void Cytron_Motor_Init ( driver_struct * driver,
TIM_HandleTypeDef * PWM_timer )

Inicjalizuje sterownik silnika z początkową prędkością 0 i domyślnym kierunkiem.

Parameters
driverWskaźnik do struktury sterownika silnika.
PWM_timerWskaźnik do timera generującego PWM.

Inicjalizuje sterownik silnika z początkową prędkością 0 i domyślnym kierunkiem.

Parameters
driverWskaźnik do struktury sterownika silnika.
PWM_timerWskaźnik do timera generującego PWM.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cytron_Set_Motor_Direction()

void Cytron_Set_Motor_Direction ( driver_struct * driver,
Cytron_Direction direction )

Ustawia kierunek obrotów silnika.

Parameters
driverWskaźnik do struktury sterownika silnika.
directionKierunek obrotów (cw lub ccw).

Ustawia kierunek obrotów silnika.

Parameters
driverWskaźnik do struktury sterownika silnika.
directionKierunek obrotów (cw - zgodnie z ruchem wskazówek zegara, ccw - przeciwnie).
Here is the caller graph for this function:

◆ Cytron_Set_Motor_Speed()

void Cytron_Set_Motor_Speed ( driver_struct * driver,
uint16_t speed )

Ustawia prędkość obrotów silnika.

Parameters
driverWskaźnik do struktury sterownika silnika.
speedWartość PWM określająca prędkość (0 do wartości ARR).

Ustawia prędkość obrotów silnika.

Parameters
driverWskaźnik do struktury sterownika silnika.
speedWartość PWM określająca prędkość (0 do wartości ARR).
Here is the caller graph for this function: