1 of 1 people found this helpful
If you look at the parameters of API wiced_hal_aclk_enable(), first parameter is to set the desired output frequency. I would again suggest you to look at /20719-B1_Bluetooth/apps/snip/hal/pwm/hal_pwm.c. Here a GPIO is seletced & configured.
Desired frequency and other parameters are defined.
If you right click on the function name and select 'Open Declaration', you will get more details about the function and its parameters.
Using API wiced_hal_gpio_select_function(), you can configure any GPIO to the required functionality (provided GPIO is not used for any other critical function). Check the snapshot attached in my previous response.
As of now, we have only this option to get the divided frequency. There is no dedicated API or function for the same.
As the following example, I want to confirm that why the value of freq not equal to the value (toggle_cnt - init_cnt)?
/// UINT16 freq = 256;
/// UINT16 init_cnt = 0xFE55;
/// UINT16 toggle_cnt = 0xFF2A;
/// wiced_hal_gpio_configurePin(28, GPIO_OUTPUT_ENABLE, 0);
/// wiced_hal_aclk_enable(freq, ACLK1, ACLK_FREQ_24_MHZ);
/// wiced_hal_pwm_start(PWM2, PMU_CLK, toggle_cnt, init_cnt, 0);
I am not sure which user guide you are referring. Please refer pwm example.