kopia lustrzana https://github.com/Qyon/STM32_RTTY
				
				
				
			Małe sprzatanie
							rodzic
							
								
									1ffd2e0d6b
								
							
						
					
					
						commit
						5a2176ee12
					
				
							
								
								
									
										5
									
								
								main.c
								
								
								
								
							
							
						
						
									
										5
									
								
								main.c
								
								
								
								
							| 
						 | 
				
			
			@ -16,11 +16,6 @@
 | 
			
		|||
#include "fun.h"
 | 
			
		||||
#include "init.h"
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "radio.h"
 | 
			
		||||
 | 
			
		||||
///////////////////////////// test mode /////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								radio.c
								
								
								
								
							
							
						
						
									
										4
									
								
								radio.c
								
								
								
								
							| 
						 | 
				
			
			@ -21,6 +21,10 @@ uint8_t radio_rw_register(const uint8_t register_addr, uint8_t value, uint8_t wr
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void radio_set_tx_frequency() {
 | 
			
		||||
 | 
			
		||||
  uint8_t gen_div  =  3;  //Stała nie zmieniac
 | 
			
		||||
  uint16_t fc = (uint16_t) (((freq / ((26.0 / gen_div) * (fbsel + 1))) - fb - 24) * 64000);
 | 
			
		||||
 | 
			
		||||
  radio_rw_register(0x75, 0x61, 1); // FIXME: tutaj powinno zdaje się być ustawiane fbsel?!
 | 
			
		||||
  radio_rw_register(0x76, (uint8_t) (((uint16_t)fc >> 8) & 0xff), 1);
 | 
			
		||||
  radio_rw_register(0x77, (uint8_t) ((uint16_t)fc & 0xff), 1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										5
									
								
								radio.h
								
								
								
								
							
							
						
						
									
										5
									
								
								radio.h
								
								
								
								
							| 
						 | 
				
			
			@ -13,11 +13,6 @@
 | 
			
		|||
static const uint16_t radioNSELpin = GPIO_Pin_13;
 | 
			
		||||
static const uint8_t WR = 0x80;
 | 
			
		||||
 | 
			
		||||
//************ do not touch bellow this line;) *********************
 | 
			
		||||
#define gen_div    3  //Stała nie zmieniac
 | 
			
		||||
#define gen  ((26.0/gen_div) *(fbsel+1)) //26 ->26MHZ kwarc napedzajacy nadajnik
 | 
			
		||||
#define fc    (((freq/gen) - fb - 24) * 64000)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
uint8_t _spi_sendrecv(const uint16_t data_word);
 | 
			
		||||
uint8_t radio_rw_register(const uint8_t register_addr, uint8_t value, uint8_t write);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue