diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/ao_cc1120.c | 31 | ||||
| -rw-r--r-- | src/drivers/ao_cc1120.h | 1 | ||||
| -rw-r--r-- | src/drivers/ao_cc1120_CC1120.h | 5 | 
3 files changed, 28 insertions, 9 deletions
diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index 68f7e736..a1d78d9c 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -106,7 +106,7 @@ ao_radio_strobe(uint8_t addr)  	ao_radio_duplex(&addr, &in, 1);  	ao_radio_deselect();  #if CC1120_DEBUG -	printf("%02x\n", in); +	printf("%02x\n", in); flush();  #endif  	return in;  } @@ -254,15 +254,33 @@ ao_radio_rdf(uint8_t len)  	ao_radio_abort = 0;  	for (i = 0; i < sizeof (rdf_setup) / sizeof (rdf_setup[0]); i += 2)  		ao_radio_reg_write(rdf_setup[i], rdf_setup[i+1]); -	ao_radio_reg_write(CC1120_PKT_LEN, len); + +#if 0  	int_pin ("Before CFG");  	ao_radio_reg_write(CC1120_IOCFG2, CC1120_IOCFG_GPIO_CFG_RX0TX1_CFG);  	int_pin ("After CFG"); +#endif + +	ao_radio_fifo_write_fixed(ao_radio_rdf_value, len); + +	ao_radio_reg_write(CC1120_PKT_LEN, len); + +	printf ("packet length: %d\n", ao_radio_reg_read(CC1120_PKT_LEN)); +  	ao_radio_strobe(CC1120_STX); + +	for (i = 0; i < 20; i++) { +		printf ("%d ", i); flush(); +		printf ("Status %02x ", ao_radio_status()); flush(); +		printf ("num_tx_bytes %d ", ao_radio_reg_read(CC1120_NUM_TXBYTES)); flush(); +		printf ("marc status %x\n", ao_radio_marc_status()); flush(); +		ao_delay(AO_MS_TO_TICKS(50)); +	} + +#if 0  	ao_exti_enable(&AO_CC1120_INT_PORT, AO_CC1120_INT_PIN);  	int_pin ("After strobe");  	ao_delay(AO_MS_TO_TICKS(100)); -	ao_radio_fifo_write_fixed(ao_radio_rdf_value, len);  	int_pin ("After delay");  	cli();  	for (i = 0; i < 20; i++) { @@ -278,11 +296,14 @@ ao_radio_rdf(uint8_t len)  #endif  	}  	sei(); +#endif  	printf ("num_tx_bytes %d marc status %x\n",  		ao_radio_reg_read(CC1120_NUM_TXBYTES),  		ao_radio_marc_status()); +#if 0  	if (!ao_radio_tx_done())  		ao_radio_idle(); +#endif  	ao_radio_set_packet();  	ao_radio_put();  } @@ -488,8 +509,8 @@ ao_radio_setup(void)  	ao_radio_reg_write(CC1120_IOCFG2, CC1120_IOCFG_GPIO_CFG_MARC_MCU_WAKEUP);  	/* Enable the EXTI interrupt for the appropriate pin */ -	ao_enable_port(AO_CC1120_INT_PORT); -	ao_exti_setup(&AO_CC1120_INT_PORT, AO_CC1120_INT_PIN, AO_EXTI_MODE_FALLING, ao_radio_isr); +//	ao_enable_port(AO_CC1120_INT_PORT); +//	ao_exti_setup(&AO_CC1120_INT_PORT, AO_CC1120_INT_PIN, AO_EXTI_MODE_FALLING, ao_radio_isr);  	ao_radio_set_packet();  	ao_radio_configured = 1; diff --git a/src/drivers/ao_cc1120.h b/src/drivers/ao_cc1120.h index 0f03f2c7..5822a21a 100644 --- a/src/drivers/ao_cc1120.h +++ b/src/drivers/ao_cc1120.h @@ -281,6 +281,7 @@  #define  CC1120_PKT_CFG1_APPEND_STATUS	0  #define CC1120_PKT_CFG0		0x28 +#define  CC1120_PKT_CFG0_RESERVED7	7  #define  CC1120_PKT_CFG0_LENGTH_CONFIG	5  #define  CC1120_PKT_CFG0_LENGTH_CONFIG_FIXED		0  #define  CC1120_PKT_CFG0_LENGTH_CONFIG_VARIABLE		1 diff --git a/src/drivers/ao_cc1120_CC1120.h b/src/drivers/ao_cc1120_CC1120.h index 1799c274..f86fd384 100644 --- a/src/drivers/ao_cc1120_CC1120.h +++ b/src/drivers/ao_cc1120_CC1120.h @@ -68,7 +68,7 @@          CC1120_PKT_CFG2,                       0x04,       /* Packet Configuration, Reg 2 */
          CC1120_PKT_CFG1,                       0x45,       /* Packet Configuration, Reg 1 */
  #endif
 -        CC1120_PKT_CFG0,                       0x20,       /* Packet Configuration, Reg 0 */
 +        CC1120_PKT_CFG0,                       0x00,       /* Packet Configuration, Reg 0 */
          CC1120_RFEND_CFG1,                     0x0f,       /* RFEND Configuration, Reg 1 */
          CC1120_RFEND_CFG0,                     0x00,       /* RFEND Configuration, Reg 0 */
          CC1120_PA_CFG2,                        0x3f,       /* Power Amplifier Configuration, Reg 2 */
 @@ -87,9 +87,6 @@          CC1120_RCCAL_OFFSET,                   0x00,       /* RC Oscillator Calibration Clock Offset */
          CC1120_FREQOFF1,                       0x00,       /* Frequency Offset (MSB) */
          CC1120_FREQOFF0,                       0x00,       /* Frequency Offset (LSB) */
 -        CC1120_FREQ2,                          0x6c,       /* Frequency Configuration [23:16] */
 -        CC1120_FREQ1,                          0xa3,       /* Frequency Configuration [15:8] */
 -        CC1120_FREQ0,                          0x33,       /* Frequency Configuration [7:0] */
          CC1120_IF_ADC2,                        0x02,       /* Analog to Digital Converter Configuration, Reg 2 */
          CC1120_IF_ADC1,                        0xa6,       /* Analog to Digital Converter Configuration, Reg 1 */
          CC1120_IF_ADC0,                        0x04,       /* Analog to Digital Converter Configuration, Reg 0 */
  | 
