Browse Source

update ad9361

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 5 years ago
parent
commit
09907b9361
  1. 1938
      ad9361/ad9361_api.c
  2. 3
      ad9361/ad9361_api.h
  3. 14
      ad9361/platform.c

1938
ad9361/ad9361_api.c

File diff suppressed because it is too large

3
ad9361/ad9361_api.h

@ -356,7 +356,8 @@ enum ad9361_ensm_mode {
/************************ Functions Declarations ******************************/ /************************ Functions Declarations ******************************/
/******************************************************************************/ /******************************************************************************/
/* Initialize the AD9361 part. */ /* Initialize the AD9361 part. */
int32_t ad9361_init (struct ad9361_rf_phy **ad9361_phy, AD9361_InitParam *init_param); struct spi_device;
int32_t ad9361_init (struct ad9361_rf_phy *ad9361_phy, struct spi_device *spi, AD9361_InitParam *init_param);
/* Set the Enable State Machine (ENSM) mode. */ /* Set the Enable State Machine (ENSM) mode. */
int32_t ad9361_set_en_state_machine_mode (struct ad9361_rf_phy *phy, uint32_t mode); int32_t ad9361_set_en_state_machine_mode (struct ad9361_rf_phy *phy, uint32_t mode);
/* Get the Enable State Machine (ENSM) mode. */ /* Get the Enable State Machine (ENSM) mode. */

14
ad9361/platform.c

@ -31,6 +31,20 @@ void mdelay(unsigned long ms)
int spi_write_then_read(struct spi_device *spi, const unsigned char *txbuf, unsigned n_tx, int spi_write_then_read(struct spi_device *spi, const unsigned char *txbuf, unsigned n_tx,
unsigned char *rxbuf, unsigned n_rx) unsigned char *rxbuf, unsigned n_rx)
{ {
int i;
spi_cs(spi, SPI_CS_LOW);
for (i = 0; i < n_tx; ++i) {
spi_txrx(spi, txbuf[i]);
}
for (i = 0; i < n_rx; ++i) {
rxbuf[i] = spi_txrx(spi, 0xff);
}
spi_cs(spi, SPI_CS_HIGH);
return SUCCESS; return SUCCESS;
} }

Loading…
Cancel
Save