forked from espressif/arduino-esp32
Implement SigmaDelta based on ESP-IDF API (#6053)
Summary This PR is refactoring of SigmaDelta HAL in order to use IDF instead of current Register manipulation approach. Impact Change in API: uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq); changed to --> uint32_t sigmaDeltaSetup(uint8_t pin, uint8_t channel, uint32_t freq); void sigmaDeltaAttachPin(uint8_t pin); removed, no longer needed. Pin is attached in sigmaDeltaSetup()
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
void setup()
|
||||
{
|
||||
//setup channel 0 with frequency 312500 Hz
|
||||
sigmaDeltaSetup(0, 312500);
|
||||
//attach pin 18 to channel 0
|
||||
sigmaDeltaAttachPin(18,0);
|
||||
//setup on pin 18, channel 0 with frequency 312500 Hz
|
||||
sigmaDeltaSetup(18,0, 312500);
|
||||
//initialize channel 0 to off
|
||||
sigmaDeltaWrite(0, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user