#ifndef PERIPS_H
#define PERIPS_H
/* Perip not implemented */
#define SETCLOCK_BAD_PERIP     0xffffffffUL

/* Trying to set frequency higher than possible or limit */
#define SETCLOCK_MAX_VIOLATION 0xfffffffdUL

/* Trying to set limit on a perip which doesn't have a limit */
#define SETCLOCK_NO_LIMIT      0xfffffffcUL

/* Anything above this is an error code */
#define SETCLOCK_MAX_CLOCK     0xffff0000UL

/* Clockspeed not set (device disabled) */
#define SETCLOCK_NOT_SET       0x00000000UL
enum peripHw {
	ERROR_HW = 0,
	UART0_HW,
	UART0_TX_HW,
	UARTRV_HW,
	UARTRV_TX_HW,
	UARTMUX_HW,
	UARTMUX_TX_HW,
	SPI0_HW,
	SPI1_HW,
	TIMER0_HW,
	TIMER1_HW,
	TIMER2_HW,
	SD_HW,
	RISCV_HW,
	CORE_PLL_HW,
	RF_PLL_HW,
	DDR_HW
};
/* Error code to string */
const char *GetSetClockErr(register u_int32 hz);

/* Get perip enum from name */
enum periphw GetPeripHw(register const char *name);

/* Get perip speed in hertz */
u_int32 GetPeripSpeed(register enum periphw hw);

/* Set speed in hertz. Returns current speed or an error. */
u_int32 SetPeripSpeed(register enum periphw hw, register u_int32 hz);
void PrintPeripSpeeds(register u_int16 verbose);
#endif
