Refactor out clock ppm interface so that it can be reused for Periodic Advertising Sync feature. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
37 lines
614 B
C
37 lines
614 B
C
/*
|
|
* Copyright (c) 2018-2020 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/types.h>
|
|
#include <soc.h>
|
|
#include <device.h>
|
|
#include <drivers/clock_control.h>
|
|
|
|
#define LOG_MODULE_NAME bt_ctlr_llsw_openisa_lll_clock
|
|
#include "common/log.h"
|
|
#include "hal/debug.h"
|
|
|
|
static uint16_t const sca_ppm_lut[] = {500, 250, 150, 100, 75, 50, 30, 20};
|
|
|
|
int lll_clock_wait(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
uint8_t lll_clock_sca_local_get(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
uint32_t lll_clock_ppm_local_get(void)
|
|
{
|
|
return sca_ppm_lut[0];
|
|
}
|
|
|
|
uint32_t lll_clock_ppm_get(uint8_t sca)
|
|
{
|
|
return sca_ppm_lut[sca];
|
|
}
|