You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
498 B
Go
36 lines
498 B
Go
package device
|
|
|
|
// do sensor and methods
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type PWMManager struct {
|
|
// do sensor manager
|
|
*ControllerManager
|
|
sync.RWMutex
|
|
Frequency int
|
|
DutyCycle int
|
|
}
|
|
|
|
func NewPWMManager() (*PWMManager, error) {
|
|
cm, err := NewControllerManager()
|
|
|
|
return &PWMManager{
|
|
ControllerManager: cm,
|
|
}, err
|
|
}
|
|
|
|
// freq changing
|
|
func (m *PWMManager) GetFrequency() (int, error) {
|
|
m.Lock()
|
|
defer m.Unlock()
|
|
return m.Frequency, nil
|
|
}
|
|
|
|
func (m *PWMManager) String() string {
|
|
// TODO
|
|
return ""
|
|
}
|