2 #include "../firmware.h"
10 {CC112X_IOCFG1, 0xB0},
11 {CC112X_IOCFG0, 0x06},
12 {CC112X_SYNC_CFG1, 0x08},
13 {CC112X_DEVIATION_M, 0xB4},
14 {CC112X_MODCFG_DEV_E, 0x0A},
15 {CC112X_DCFILT_CFG, 0x1C},
16 {CC112X_PREAMBLE_CFG1, 0x00},
17 {CC112X_FREQ_IF_CFG, 0x35},
19 {CC112X_CHAN_BW, 0x10},
20 {CC112X_MDMCFG1, 0x06},
21 {CC112X_MDMCFG0, 0x05},
22 {CC112X_SYMBOL_RATE2, 0x40},
23 {CC112X_SYMBOL_RATE1, 0x62},
24 {CC112X_SYMBOL_RATE0, 0x4E},
25 {CC112X_AGC_REF, 0x20},
26 {CC112X_AGC_CS_THR, 0x19},
27 {CC112X_AGC_CFG1, 0xA9},
28 {CC112X_AGC_CFG0, 0xCF},
29 {CC112X_FIFO_CFG, 0x00},
30 {CC112X_SETTLING_CFG, 0x03},
31 {CC112X_FS_CFG, 0x1B},
32 {CC112X_PKT_CFG2, 0x05},
33 {CC112X_PKT_CFG1, 0x00},
34 {CC112X_PKT_CFG0, 0x20},
35 {CC112X_PA_CFG2, 0x34},
36 {CC112X_PA_CFG0, 0x7E},
37 {CC112X_IF_MIX_CFG, 0x00},
38 {CC112X_FREQOFF_CFG, 0x22},
39 {CC112X_CFM_DATA_CFG, 0x01},
43 {CC112X_IF_ADC0, 0x05},
44 {CC112X_FS_DIG1, 0x00},
45 {CC112X_FS_DIG0, 0x5F},
46 {CC112X_FS_CAL0, 0x0E},
47 {CC112X_FS_DIVTWO, 0x03},
48 {CC112X_FS_DSM0, 0x33},
49 {CC112X_FS_DVC0, 0x17},
50 {CC112X_FS_PFD, 0x50},
51 {CC112X_FS_PRE, 0x6E},
52 {CC112X_FS_REG_DIV_CML, 0x14},
53 {CC112X_FS_SPARE, 0xAC},
57 {CC112X_SERIAL_STATUS, 0x08},
60 #define UART_INTERFACE UART_CAMERA
62 static double freq = 145.5;
63 static double pwr = 10.0;
65 static uint8_t buffer[17] =
"UOS3 UOS3 UOS3 k\0";
66 static uint32_t buffer_length = 16;
68 static void cw_tone_on(
void)
72 radio_reset_config(SPI_RADIO_TX, preferredSettings_cw,
sizeof(preferredSettings_cw)/
sizeof(
registerSetting_t));
73 manualCalibration(SPI_RADIO_TX);
75 radio_set_freq_f(SPI_RADIO_TX, &freq);
77 radio_set_pwr_f(SPI_RADIO_TX, &pwr, &pwr_reg);
79 SPI_cmd(SPI_RADIO_TX, CC112X_STX);
84 static void cw_tone_off(
void)
86 radio_reset_config(SPI_RADIO_TX, preferredSettings_cw,
sizeof(preferredSettings_cw)/
sizeof(
registerSetting_t));
98 UART_puts(UART_INTERFACE,
"\r\nCW Radio Demo\r\n");
100 sprintf(output,
"Freq: %.3fMHz, Power: %+.1fdBmW\r\n", freq, pwr);
105 sprintf(output,
"Sending Beacon :\"%s\"\r\n", buffer);
108 Packet_cw_transmit_buffer(buffer, buffer_length, cw_tone_on, cw_tone_off);
void Delay_ms(uint32_t milliseconds)
void UART_init(uint8_t uart_num, uint32_t baudrate)
void LED_off(uint8_t led_num)
int main(void)
Runs all module tests.
void UART_puts(uint8_t uart_num, char *str)
uint8_t SPI_cmd(uint8_t spi_num, uint8_t cmd)
void LED_on(uint8_t led_num)