#ifndef __SI5351_H__
#define __SI5351_H__ __SI5351_H__

#include <stdint.h>

#include "twi.h"

const uint8_t SI5351_ADDRESS = 96;

static inline uint8_t si5351_write8(uint8_t reg, uint8_t value) {
    uint8_t data[3] = {reg, value};
    return twi_write(SI5351_ADDRESS, data, 2);
}

static inline uint8_t si5351_write16(uint8_t reg, uint16_t value) {
    uint8_t data[3] = {reg, value & 0xFF, (value & 0xFF00) >> 8};
    return twi_write(SI5351_ADDRESS, data, 3);
}

#endif
