#include <freertos/FreeRTOS.h>
#include <freertos/task.h>

#include "dw3000_spi.h"
#include "dw3000_hw.h"
#include "port.h"

/* @fn      port_set_dw_ic_spi_fastrate
 * @brief   set 36MHz
 *          note: hspi1 is clocked from 72MHz
 * */
void port_set_dw_ic_spi_fastrate(void)
{
	dw3000_spi_speed_fast();
}

/* @fn      reset_DW IC
 * @brief   DW_RESET pin on DW IC has 2 functions
 *          In general it is output, but it also can be used to reset the digital
 *          part of DW IC by driving this pin low.
 *          Note, the DW_RESET pin should not be driven high externally.
 * */
void reset_DWIC(void)
{
	dw3000_hw_reset();
}

/* @fn    Sleep
 * @brief Sleep delay in ms using SysTick timer
 * */
void Sleep(uint32_t x)
{
	vTaskDelay(pdMS_TO_TICKS(x));
}

