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
2 years ago
|
package device
|
||
2 years ago
|
|
||
|
// do sensor and methods
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
type PWMManager struct {
|
||
|
// do sensor manager
|
||
|
*ControllerManager
|
||
|
sync.RWMutex
|
||
|
Frequency int
|
||
|
DutyCycle int
|
||
|
}
|
||
|
|
||
2 years ago
|
func NewPWMManager() (*PWMManager, error) {
|
||
|
cm, err := NewControllerManager()
|
||
|
|
||
|
return &PWMManager{
|
||
|
ControllerManager: cm,
|
||
|
}, err
|
||
2 years ago
|
}
|
||
|
|
||
|
// freq changing
|
||
|
func (m *PWMManager) GetFrequency() (int, error) {
|
||
|
m.Lock()
|
||
|
defer m.Unlock()
|
||
|
return m.Frequency, nil
|
||
|
}
|
||
|
|
||
|
func (m *PWMManager) String() string {
|
||
|
// TODO
|
||
|
return ""
|
||
|
}
|