Hi,all.i want to use pwm in my code.And i init pwm with APP_PWM_INSTANCE(PWM1,1),then i get an error:identifier "TIMER1_INSTANCE_INDEX" is undefined.Can someone help me ?
Hi,all.i want to use pwm in my code.And i init pwm with APP_PWM_INSTANCE(PWM1,1),then i get an error:identifier "TIMER1_INSTANCE_INDEX" is undefined.Can someone help me ?
i found it,in nrf_drv_config.h,enabled option.
Every peripheral must be enabled in nrf_drv_config.h before it can be used. You can then track which peripherals are being used by checking this config file.
Thanks,Aryan!
Can I know how to enable the nrf_drv_config.h? I have include it in main.c, but the error continues.
Every application is supposed to have it's own copy of nrf_drv_config.h. Then in this config file you need to enable peripheral that you want to use. In that case it's TIMER1 since PWM is configured to use that instance. Find TIMER1_ENABLED define and set it to 1.