2016-12-24 19:54:27 +00:00
|
|
|
//
|
2016-12-28 10:53:34 +00:00
|
|
|
// Created by SQ5RWU on 2016-12-24.
|
2016-12-24 19:54:27 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef STM32_RTTY_RADIO_H
|
|
|
|
#define STM32_RTTY_RADIO_H
|
|
|
|
|
2016-12-24 20:12:31 +00:00
|
|
|
#include "config.h"
|
2016-12-24 19:54:27 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stm32f10x_spi.h>
|
|
|
|
#include <stm32f10x_gpio.h>
|
|
|
|
|
2017-01-10 01:24:10 +00:00
|
|
|
static const uint16_t radioNSELpin = GPIO_Pin_13; // @ GPIOC
|
|
|
|
static const uint16_t radioSDIpin = GPIO_Pin_15; // @ GPIOB!
|
2016-12-24 19:54:27 +00:00
|
|
|
static const uint8_t WR = 0x80;
|
2017-01-07 17:55:09 +00:00
|
|
|
static const float SI4032_CLOCK = 26.0;
|
2016-12-24 19:54:27 +00:00
|
|
|
|
2017-01-10 01:24:10 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2016-12-24 20:12:31 +00:00
|
|
|
|
2016-12-24 19:54:27 +00:00
|
|
|
uint8_t _spi_sendrecv(const uint16_t data_word);
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2016-12-24 19:54:27 +00:00
|
|
|
uint8_t radio_rw_register(const uint8_t register_addr, uint8_t value, uint8_t write);
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2017-01-07 17:55:09 +00:00
|
|
|
void radio_set_tx_frequency(const float radio_set_tx_frequency);
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2016-12-24 21:23:49 +00:00
|
|
|
void radio_disable_tx();
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2016-12-24 21:23:49 +00:00
|
|
|
void radio_soft_reset();
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2016-12-24 21:23:49 +00:00
|
|
|
void radio_enable_tx();
|
2017-01-10 01:24:10 +00:00
|
|
|
|
2016-12-27 23:03:08 +00:00
|
|
|
int8_t radio_read_temperature();
|
2016-12-24 19:54:27 +00:00
|
|
|
|
2017-01-10 01:24:10 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-12-24 19:54:27 +00:00
|
|
|
#endif //STM32_RTTY_RADIO_H
|