[EGD-7766] Vibration level PWM addition

PWM channels separate control added.
This commit is contained in:
Wojtek Rzepecki
2021-10-15 18:11:01 +02:00
committed by Przemysław Brudny
parent d768eb3665
commit a03817ab96
17 changed files with 218 additions and 130 deletions

View File

@@ -11,7 +11,6 @@
#include <cstdint>
#include <memory>
#include <utility>
namespace sys
{
@@ -35,44 +34,31 @@ bsp::Board EventManagerServiceAPI::GetBoard(sys::Service *serv)
return bsp::Board::none;
}
/*
* @brief Call single vibration pulse
*/
void EventManagerServiceAPI::vibrationPulseOnce(sys::Service *serv)
{
serv->bus.sendUnicast(std::make_shared<sevm::VibratorMessage>(bsp::vibrator::Action::pulse),
service::name::evt_manager);
}
/*
* @brief Call vibration to stop
*/
void EventManagerServiceAPI::vibrationStop(sys::Service *serv)
{
serv->bus.sendUnicast(std::make_shared<sevm::VibratorMessage>(bsp::vibrator::Action::stop),
service::name::evt_manager);
}
/*
* @brief Call repetitive vibration pulses for given time [ms]
*/
void EventManagerServiceAPI::vibrationPulseRepeat(sys::Service *serv, std::chrono::milliseconds time)
{
serv->bus.sendUnicast(std::make_shared<sevm::VibratorMessage>(bsp::vibrator::Action::pulseRepeat, time),
service::name::evt_manager);
}
/*
* @brief Call repetitive vibration pulses until stop message is sent
*/
void EventManagerServiceAPI::vibrationPulseRepeatUntilStop(sys::Service *serv)
{
serv->bus.sendUnicast(std::make_shared<sevm::VibratorMessage>(bsp::vibrator::Action::pulseRepeatInfinite),
service::name::evt_manager);
}
/*
* @brief Set vibration level
*/
void EventManagerServiceAPI::setVibrationLevel(sys::Service *serv, unsigned int vibrationLevel)
{
LOG_ERROR("Message sie wysyla tak ?");
serv->bus.sendUnicast(std::make_shared<sevm::VibratorLevelMessage>(vibrationLevel), service::name::evt_manager);
}