/* * spreadspace avr utils * * * Copyright (C) 2013-2015 Christian Pointner * * This file is part of spreadspace avr utils. * * spreadspace avr utils is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * spreadspace avr utils is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with spreadspace avr utils. If not, see . */ #ifndef SPREADAVR_cc1101_h_INCLUDED #define SPREADAVR_cc1101_h_INCLUDED #define CC1101_FREQ_CORR(xtal) ((float)(xtal/65536.0)) typedef struct { void (*spi_cs_enable)(void); void (*spi_cs_disable)(void); uint8_t (*spi_read_miso)(void); void (*spi_write_byte)(const uint8_t); uint8_t (*spi_read_byte)(void); uint8_t (*spi_transfer_byte)(const uint8_t); float freq_corr; } cc1101_driver_conf_t; void cc1101_init(cc1101_driver_conf_t conf); void cc1101_reg_init(void); void cc1101_soft_reset(void); void cc1101_powerdown(void); void cc1101_set_freq_hz(uint32_t hz); uint32_t cc1101_get_freq_hz(void); void cc1101_dump_register(void); #endif