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 "" }