2016-03-10 08:46:47 -04:00
|
|
|
#pragma once
|
2016-01-10 08:17:33 -04:00
|
|
|
|
|
|
|
#include "AP_HAL_Linux.h"
|
|
|
|
|
2016-03-10 11:28:22 -04:00
|
|
|
#include "ToneAlarm.h"
|
2016-01-10 08:17:33 -04:00
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
namespace Linux {
|
|
|
|
|
|
|
|
class ToneAlarm_Raspilot : public ToneAlarm {
|
2016-01-10 08:17:33 -04:00
|
|
|
public:
|
2016-03-10 08:46:47 -04:00
|
|
|
ToneAlarm_Raspilot();
|
|
|
|
bool init() override;
|
|
|
|
void stop() override;
|
|
|
|
bool play() override;
|
2016-01-10 08:17:33 -04:00
|
|
|
|
|
|
|
private:
|
2016-03-10 08:46:47 -04:00
|
|
|
void _set_pwm0_period(uint32_t time_us);
|
|
|
|
void _set_pwm0_duty(uint8_t percent);
|
2016-01-10 08:17:33 -04:00
|
|
|
|
2016-03-10 08:46:47 -04:00
|
|
|
volatile uint32_t *_pwm;
|
|
|
|
volatile uint32_t *_clk;
|
2016-01-10 08:17:33 -04:00
|
|
|
};
|
2016-07-29 16:14:02 -03:00
|
|
|
|
|
|
|
}
|