Squashed commit of the following:
commit 27c0a6ec0813187f125922c81189a70cf04d83d4 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 15:47:27 2017 -0600 Spirit: Bring in a couple ore more radio interface functions. commit 96657af2831487724723a60084831619257fd953 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 14:20:14 2017 -0600 Spirit: Bring in more radio interface functions. commit 640d55399b54a019be68825668fca1446abd082f Merge: 3fcf84a9a247791442a0
Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 12:01:43 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 3fcf84a9a2673e1e1466ce5b114d7b73c257e515 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 12:00:31 2017 -0600 Spirit: Brings in the last of the PktCommon interfaces. commit d26ebd901ba4ba84910e99b4e728b98c30fa4c0b Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 09:54:52 2017 -0600 Spirit: Add a few more PktCommon interfaces. commit b5cb8041d50233a4abb8fb4d1dcef5428ae2c2b2 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 09:33:31 2017 -0600 libc/termios: Remember block comments before empty file sections. commit 0fcab2c1c8c74442d40bd5e8c6af50a34f8a5821 Author: Sebastien Lorquet <sebastien@lorquet.fr> Date: Fri Jul 28 09:31:00 2017 -0600 tcdrain implementation based on a new term ioctl commit 797d4adf7d41068c671f0217d369b797b269de1a Author: Stefan Kolb <Stefan.Kolb@avat.de> Date: Fri Jul 28 09:19:04 2017 -0600 We discovered a problem with the samv7 mcan driver which results, under some circumstances, in a very high CPU load. The problem occurs, and is easily reproducible, if the device is connected to a CAN network with a wrongly configured CAN speed (baud rate). In our tests we set the CAN speed of the device to 1000000 and the speed of the other CAN nodes to 500000. The device is restarted and sends a CANopen “bootup message” to the CAN network. This results in huge amount of errors messages on the CAN bus, probably because of the CAN feature for acknowledging error messages. The error messages can’t be read by the device because of the misconfigured CAN speed, instead the CAN chip reports lots of errors, which are reported to the application which uses the CAN driver (CONFIG_CAN_ERRORS is enabled). The CAN errors are reported from the CAN chip via interrupts and thus the interrupt load is very high in this scenario. To fix the problem the driver now disables each RX error interrupt after it is occurred. The RX error interrupts are turned back on if at least one CAN message is received successfully. commit e298f48e96d9e34017dcab8e4d87032862ae9322 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 28 09:06:26 2017 -0600 Spirit: Bring in PktStack interfaces. commit 4a0f00a7058312dcf6ac392689b9f69112f613ec Merge: 855cf97130b458934ac4
Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 18:05:02 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 855cf9713052a851a1daeb3842db2edd6ff6f658 Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 18:03:56 2017 -0600 Spirit Network Driver: Add some hooks that will eventually support address filtering. commit 3b3fb24ea86cf8233b034871d5c550f47ab852e6 Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 17:13:21 2017 -0600 Spirit: Add a PktStack header file. commit 705e8fff6a21264ab751fb34c107cb109430ac89 Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 15:00:03 2017 -0600 Spirit: Bring in last of timer interfaces. commit f8984b2f82e165f5bba132d6b099222d1beb1fbd Merge: cb79778a30f287cc25d6
Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 11:57:01 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit cb79778a3044ae97a1cc615dfa24099144f04bd0 Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 11:46:31 2017 -0600 Spirit: Bring in last of QI interfaces. commit 0245b330a33aa73531b82ae261b1312be9922e0f Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 10:14:34 2017 -0600 Spirit: Add general interfaces. commit 121845a8f229ec2c88e5721da5512135f6624ee5 Author: Gregory Nutt <gnutt@nuttx.org> Date: Thu Jul 27 09:41:23 2017 -0600 Spirit: Bring in last of GPIO interfaces. commit 279bfcc92bcd0cfa48c0ed7862fa2b75fbee99b8 Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 17:09:19 2017 -0600 Spirit: Add some missing configuration options: Add register -level debug options. commit 4be89324a5908e35afc70373c279f4d05f62b48f Merge: 66e87f9bb3598386ef90
Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 15:36:20 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 66e87f9bb3ef75fddf25400bc08475c5e6ad4c30 Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 15:19:56 2017 -0600 Spirit: Brings in last of PktBasic logic. commit 8b4c89d6a103003fa04363e2c2ae7b9ee390bf49 Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 11:55:50 2017 -0600 Spirit: Bring in AES and MBUS logic. commit d00022d39ab0ce839de29386949481e5c24feff3 Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 09:22:03 2017 -0600 Spirit: Bring in remainder of calibration interfaces. commit 40b4b2f902e04293f8940551a97a9a24a48988dd Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 08:44:32 2017 -0600 Spirit: Bring in DirectRF interfaces. commit 7c109608e1a2989f3edbc2fd939a2d225fff382a Author: Gregory Nutt <gnutt@nuttx.org> Date: Wed Jul 26 07:46:19 2017 -0600 Spirit: Add CSMA support. commit 0f88896595d162c4ac6138e7b1af2fc35c865b3d Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 18:57:43 2017 -0600 Spirit: Add some initial TX logic to network driver. commit 4dc7058dfcdcf40980578680b7e1a4206dea4ea2 Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 17:02:11 2017 -0600 Spirit: Completes ports of spirit_management.* files commit c904eef51d929e041b87d0c8aff6fa3c2f895341 Merge: 91e985a877c9ff8cbab9
Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 15:15:04 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 91e985a87729017a66d19276c4d47681064f95ea Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 15:13:54 2017 -0600 Spirit: Add a few more functions that will soon be needed for packet transmission. commit b5981d29983907c2194fbc26af4b72ad532bee78 Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 13:30:07 2017 -0600 Spirit: Finish off some initialization issues; Started some interrupt handling logic. commit c21073e0bc2870b3d9ba40bdfdfd5151ce4f5890 Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 09:35:52 2017 -0600 Spirit: Completes very basic radio initialization for network driver commit 1b544334361c54f46bcf0ba313c125932e8dafc6 Author: Gregory Nutt <gnutt@nuttx.org> Date: Tue Jul 25 07:58:30 2017 -0600 Spirit: Add more radio initialization logic... getting closer. commit 45d1047db60843c57d394ec910c63e7c127671e0 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 19:15:33 2017 -0600 Spirit: add some CSMA initialization logic commit bcf55c71336d48947fe19bb09a799169852301c2 Merge: 89e9d426e92fc0fbcf7e
Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 16:47:11 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 89e9d426e91c056e659fccf5e5c4392618f8f777 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 16:44:19 2017 -0600 Update some comments commit 9c5d8a5833350006ed389e898b11c8c8a20e5f4f Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 16:15:54 2017 -0600 Spirit: Rename drivers/wireless/spirit/src to lib. Move Spirit network driver out of IEEE802.15.4 into drivers/wireless/spirit/drivers commit cabc0ec9e6eb558dcb715ab17264383aa0105e7a Merge: 87b616414a6bd744c4b3
Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 15:38:40 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 87b616414a79c01a71acea78f8258e05325c1996 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 15:37:27 2017 -0600 Spirit radio driver is mutating into a standalone network driver. commit 507798233868a661ae8adad3e3aa117075a7a146 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 13:32:08 2017 -0600 Spirit: More radio initialization logic commit 33af25704ce9ca83d576300d153cfe31cc6d2576 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 12:19:14 2017 -0600 Spirit: Beginning of radio initialization logic commit 97b20014c016e55952a8f9d8f4ae29e2cc555b23 Author: Gregory Nutt <gnutt@nuttx.org> Date: Mon Jul 24 09:42:06 2017 -0600 Spirit: More initialization logic. commit 295d8e27824c0417fccea2344b30bb5c93ffbabe Author: Gregory Nutt <gnutt@nuttx.org> Date: Sun Jul 23 15:39:53 2017 -0600 Spirit: Add header file containing enumeration of commands. commit 8a2d9dd8eb9cc70cbcdd1b913fc9022b9c9ec8da Author: Gregory Nutt <gnutt@nuttx.org> Date: Sun Jul 23 11:33:50 2017 -0600 Spirit: Add GPIO initialization logic commit 8b6d80c44f92024c45a6ba63ba1af3fdafe94dc3 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sun Jul 23 10:07:25 2017 -0600 Spirit: Add interrupt control logic. commit 423f846fe5c914f92a4bfea4d9d1fa33de1c77a5 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 19:06:52 2017 -0600 Spirit: Yet a little more radio initialization logic. commit 5895b979823e51ddde5ad52e6de66a8ad662e883 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 15:36:05 2017 -0600 Spirit: A little more radio initialization logic. commit 86311ab30aad386203c181c792847dd1d37f9a02 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 13:02:32 2017 -0600 Spirit: A miniscule amount of radio initialization logic. commit ad55e89d5ee12ea1eeea95fcd38ff3da0db4416a Merge: 90a7666655f4e46b0da7
Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 10:56:30 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 90a766665534b05da0157dbc383cb06a98c86a79 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 10:52:52 2017 -0600 Spirit1: A few fixes for a clean build of initial configuration (not much there yet) commit bbbf04c223230a52a7705a2161128265cfbaa480 Merge: 623d54a7f72319ea53a9
Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 09:53:57 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 623d54a7f719e9032099f88f38203efee4b80722 Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 09:43:52 2017 -0600 b-l475e-iot01a: Add a configuration for testing sprit radio. commit d309d73d9f4665f9d870eb03531f450043d9389d Merge: 52c3ddfae6d88dc9b2e5
Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 09:02:06 2017 -0600 Merge remote-tracking branch 'origin/master' into spirit commit 52c3ddfae6802e111c2b5cf1207baf21a61dd00b Author: Gregory Nutt <gnutt@nuttx.org> Date: Sat Jul 22 08:33:04 2017 -0600 Spirit: Add register definition header file. commit 8d842ab5e8f9ca653b42f9ee88dc279f06b4fa98 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 17:27:03 2017 -0600 b-l475e-iot01a: Add initial, unverified support for the SPSRGF/Spirit1 module. commit 73d902a1048616fb9c2dd2147cabcd8ee78e19ac Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 15:49:43 2017 -0600 Spirit: Fixes to get skeleton IEEE 802.15.4 driver build. commit ebc5a8387bb94f0cc3827533795f3e4a33207e67 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 15:16:29 2017 -0600 Spirit1: Add framework for IEEE 802.15.4 driver. Does not yet build. commit 52e195a7ae14ddb18bdd56258f4877381d2501ca Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 14:02:42 2017 -0600 Spirit: A little more SPI logic. commit 90048d0c5b8a5af4d81a15d99535c84ed38d8ae9 Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 11:19:06 2017 -0600 Spirit: Build directories setup. Some initial files added, mostly just to verify build. commit 8273a381ac1f6bb081b292b5e73226185e9e634c Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Jul 21 08:34:04 2017 -0600 USB composite: Remove references to CDC/ACM and USB MSC from composite logic. They are no longer coupled.
This commit is contained in:
parent
47791442a0
commit
38f79543dc
@ -512,7 +512,7 @@ static int spirit_transmit(FAR struct spirit_driver_s *priv)
|
||||
goto errout_with_iob;
|
||||
}
|
||||
|
||||
/* Sets the length of the packet to send */
|
||||
/* Make sure that the TX linear FIFO is completely empty */
|
||||
|
||||
ret = spirit_command(spirit, COMMAND_FLUSHTXFIFO);
|
||||
if (ret < 0)
|
||||
@ -520,6 +520,8 @@ static int spirit_transmit(FAR struct spirit_driver_s *priv)
|
||||
goto errout_with_iob;
|
||||
}
|
||||
|
||||
/* Sets the length of the packet to send */
|
||||
|
||||
ret = spirit_pktbasic_set_payloadlen(spirit, iob->io_len);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -555,14 +557,16 @@ static int spirit_transmit(FAR struct spirit_driver_s *priv)
|
||||
goto errout_with_iob;
|
||||
}
|
||||
|
||||
/* Puts the SPIRIT1 in TX state */
|
||||
/* Put the SPIRIT1 into TX state. This starts the transmission */
|
||||
|
||||
ret = spirit_command(spirit, COMMAND_TX); /* Starts transmission */
|
||||
ret = spirit_command(spirit, COMMAND_TX);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout_with_iob;
|
||||
}
|
||||
|
||||
/* Wait until we have successfully entered the TX state */
|
||||
|
||||
ret = spirit_waitstatus(spirit, MC_STATE_TX, 5);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
@ -390,6 +390,27 @@ struct radio_init_s
|
||||
int spirit_radio_initialize(FAR struct spirit_library_s *spirit,
|
||||
FAR const struct radio_init_s *radioinit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_setup
|
||||
*
|
||||
* Description:
|
||||
* Returns the SPIRIT analog and digital radio structure according to the
|
||||
* registers value.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* radioinit pointer to a struct radio_init_s that
|
||||
* contains the configuration information for the analog radio part of SPIRIT.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) returned on success; a negated errno value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_get_setup(FAR struct spirit_library_s *spirit,
|
||||
FAR struct radio_init_s *radioinit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_xtalflag
|
||||
*
|
||||
@ -528,6 +549,41 @@ int spirit_radio_set_band(FAR struct spirit_library_s *spirit,
|
||||
enum spirit_bandselect_e
|
||||
spirit_radio_get_band(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_channel
|
||||
*
|
||||
* Description:
|
||||
* Returns the actual channel number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Actual channel number.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint8_t spirit_radio_get_channel(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_foffset_ppm
|
||||
*
|
||||
* Description:
|
||||
* Sets the FC OFFSET register starting from xtal ppm value.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* xtaloffset - The xtal offset expressed in ppm.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) returned on success; a negated errno value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_set_foffset_ppm(FAR struct spirit_library_s *spirit,
|
||||
int16_t xtaloffset);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_chspace
|
||||
*
|
||||
@ -588,20 +644,23 @@ int spirit_radio_set_channel(FAR struct spirit_library_s *spirit,
|
||||
uint8_t chnum);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_channel
|
||||
* Name: spirit_radio_set_foffset_hz
|
||||
*
|
||||
* Description:
|
||||
* Returns the actual channel number.
|
||||
* Sets the FC OFFSET register starting from frequency offset expressed in Hz.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* foffset - Frequency offset expressed in Hz as signed word.
|
||||
*
|
||||
* Returned Value:
|
||||
* Actual channel number.
|
||||
* Zero (OK) returned on success; a negated errno value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint8_t spirit_radio_get_channel(FAR struct spirit_library_s *spirit);
|
||||
int spirit_radio_set_foffset_hz(FAR struct spirit_library_s *spirit,
|
||||
int32_t foffset);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_foffset
|
||||
@ -675,6 +734,22 @@ void spirit_radio_enable_wavco_calibration(FAR struct spirit_library_s *spirit,
|
||||
|
||||
uint32_t spirit_radio_get_basefrequency(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_centerfreq
|
||||
*
|
||||
* Description:
|
||||
* Returns the actual channel center frequency.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Actual channel center frequency expressed in Hz.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t spirit_radio_get_centerfreq(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_convert_datarate
|
||||
*
|
||||
@ -697,6 +772,32 @@ int spirit_radio_convert_datarate(FAR struct spirit_library_s *spirit,
|
||||
uint32_t datarate, FAR uint8_t *pcm,
|
||||
FAR uint8_t *pce);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_convert_chbandwidth
|
||||
*
|
||||
* Description:
|
||||
* Returns the mantissa and exponent for a given bandwidth. Even if it is
|
||||
* possible to pass as parameter any value in the below mentioned range, the
|
||||
* API will search the closer value according to a fixed table of channel
|
||||
* bandwidth values (@ref s_vectnBandwidth), as defined in the datasheet,
|
||||
* returning the corresponding mantissa and exponent value.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* bandwidth - bandwidth expressed in Hz. This parameter ranging between
|
||||
* 1100 and 800100.
|
||||
* pcm - pointer to the returned mantissa value.
|
||||
* pce - pointer to the returned exponent value.
|
||||
*
|
||||
* Returned Value:
|
||||
* Error code: 0=no error, <0=error during calibration of VCO.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_convert_chbandwidth(FAR struct spirit_library_s *spirit,
|
||||
uint32_t bandwidth, FAR uint8_t *pcm,
|
||||
FAR uint8_t *pce);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_convert_freqdev
|
||||
*
|
||||
@ -722,33 +823,212 @@ int spirit_radio_convert_freqdev(FAR struct spirit_library_s *spirit,
|
||||
FAR uint8_t *pce);
|
||||
|
||||
/******************************************************************************
|
||||
* Name:
|
||||
* Name: spirit_radio_set_datarate
|
||||
*
|
||||
* Description:
|
||||
* Returns the mantissa and exponent for a given bandwidth. Even if it is
|
||||
* possible to pass as parameter any value in the below mentioned range, the
|
||||
* API will search the closer value according to a fixed table of channel
|
||||
* bandwidth values (@ref s_vectnBandwidth), as defined in the datasheet,
|
||||
* returning the corresponding mantissa and exponent value.
|
||||
* Sets the datarate.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* bandwidth - bandwidth expressed in Hz. This parameter ranging between
|
||||
* 1100 and 800100.
|
||||
* pcm - pointer to the returned mantissa value.
|
||||
* pce - pointer to the returned exponent value.
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* datarate - Datarate expressed in bps. This value must be in the range
|
||||
* [100 500000].
|
||||
*
|
||||
* Returned Value:
|
||||
* Error code: 0=no error, <0=error during calibration of VCO.
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_convert_chbandwidth(FAR struct spirit_library_s *spirit,
|
||||
uint32_t bandwidth, FAR uint8_t *pcm,
|
||||
FAR uint8_t *pce);
|
||||
int spirit_radio_set_datarate(FAR struct spirit_library_s *spirit,
|
||||
uint32_t datarate);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_dbm2reg
|
||||
* Name: spirit_radio_get_datarate
|
||||
*
|
||||
* Description:
|
||||
* Returns the datarate.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Settled datarate expressed in bps.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t spirit_radio_get_datarate(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_freqdev
|
||||
*
|
||||
* Description:
|
||||
* Sets the frequency deviation.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* fdev - Frequency deviation expressed in Hz. Be sure that this value
|
||||
* is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_set_freqdev(FAR struct spirit_library_s *spirit,
|
||||
uint32_t fdev);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_freqdev
|
||||
*
|
||||
* Description:
|
||||
* Returns the frequency deviation.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Frequency deviation value expressed in Hz.
|
||||
* This value will be in the range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t spirit_radio_get_freqdev(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_chfilterbw
|
||||
*
|
||||
* Description:
|
||||
* Sets the channel filter bandwidth.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* bandwidth - Channel filter bandwidth expressed in Hz. This parameter
|
||||
* must be in the range [1100 800100]. The API will search the
|
||||
* closest value according to a fixed table of channel bandwidth
|
||||
* values, as defined in the datasheet. To verify the settled
|
||||
* channel bandwidth it is possible to use the
|
||||
* spirit_radio_get_chfilterbw() API.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_set_chfilterbw(FAR struct spirit_library_s *spirit,
|
||||
uint32_t bandwidth);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_chfilterbw
|
||||
*
|
||||
* Description:
|
||||
* Returns the channel filter bandwidth.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Channel filter bandwidth expressed in Hz.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t spirit_radio_get_chfilterbw(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_modulation
|
||||
*
|
||||
* Description:
|
||||
* Sets the modulation type.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* modulation - Modulation to set.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_set_modulation(FAR struct spirit_library_s *spirit,
|
||||
enum modulation_select_e modulation);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_modulation
|
||||
*
|
||||
* Description:
|
||||
* Returns the modulation type used.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Settled modulation type.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
enum modulation_select_e
|
||||
spirit_radio_get_modulation(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_enable_cwtxmode
|
||||
*
|
||||
* Description:
|
||||
* Enables or Disables the Continuous Wave transmit mode.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* newstate - New state for power ramping. This parameter can be: S_ENABLE
|
||||
* or S_DISABLE .
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_enable_cwtxmode(FAR struct spirit_library_s *spirit,
|
||||
enum spirit_functional_state_e newstate);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_ookpeackdecay
|
||||
*
|
||||
* Description:
|
||||
* Sets the OOK Peak Decay.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* ookdelay - Peak decay control for OOK.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on succes; a negated errnor value is returned on any
|
||||
* failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_set_ookpeackdecay(FAR struct spirit_library_s *spirit,
|
||||
enum spirit_ookpeakdelay_e ookdelay);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_get_ookpeackdecay
|
||||
*
|
||||
* Description:
|
||||
* Returns the OOK Peak Decay.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
*
|
||||
* Returned Value:
|
||||
* Ook peak decay value.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
enum spirit_ookpeakdelay_e
|
||||
spirit_radio_get_ookpeackdecay(FAR struct spirit_library_s *spirit);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_convert_power2reg
|
||||
*
|
||||
* Description:
|
||||
* Returns the PA register value that corresponds to the passed dBm power.
|
||||
@ -766,8 +1046,89 @@ int spirit_radio_convert_chbandwidth(FAR struct spirit_library_s *spirit,
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
uint8_t spirit_radio_dbm2reg(FAR struct spirit_library_s *spirit,
|
||||
uint32_t fbase, float powerdbm);
|
||||
uint8_t spirit_radio_convert_power2reg(FAR struct spirit_library_s *spirit,
|
||||
uint32_t fbase, float powerdbm);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_convert_reg2power
|
||||
*
|
||||
* Description:
|
||||
* Returns the dBm power that corresponds to the value of PA register.
|
||||
*
|
||||
* NOTE: The power interpolation curves used by this function have been
|
||||
* extracted by measurements done on the divisional evaluation boards.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* fbase - Frequency base expressed in Hz.
|
||||
* regval - Register value of the PA.
|
||||
*
|
||||
* Returned Value:
|
||||
* Power in dBm as float.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
float spirit_radio_convert_reg2power(FAR struct spirit_library_s *spirit,
|
||||
uint32_t fbase, uint8_t regval);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_config_patable
|
||||
*
|
||||
* Description:
|
||||
* Configures the Power Amplifier Table and registers with value expressed
|
||||
* in dBm.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* nlevels - Number of levels to set. This parameter must be in the range
|
||||
* [0:7].
|
||||
* width - Step width expressed in terms of bit period units Tb/8. This
|
||||
* parameter must be in the range [1:4].
|
||||
* load - The of the possible value of the enum type enum
|
||||
* pirit_paload_capacitor_e.
|
||||
*
|
||||
* LOAD_0_PF No additional PA load capacitor
|
||||
* LOAD_1_2_PF 1.2pF additional PA load capacitor
|
||||
* LOAD_2_4_PF 2.4pF additional PA load capacitor
|
||||
* LOAD_3_6_PF 3.6pF additional PA load capacitor
|
||||
*
|
||||
* table - Pointer to an array of PA values in dbm between
|
||||
* [-PA_LOWER_LIMIT: PA_UPPER_LIMIT] dbm. The first element must
|
||||
* be the lower level (PA_LEVEL[0]) value and the last element
|
||||
* the higher level one (PA_LEVEL[paLevelMaxIndex]).
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success. A negated errno value is returned on any failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_config_patable(FAR struct spirit_library_s *spirit,
|
||||
uint8_t nlevels, uint8_t width,
|
||||
enum spirit_paload_capacitor_e load,
|
||||
FAR float *table);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: regaddr
|
||||
*
|
||||
* Description:
|
||||
* Returns the Power Amplifier Table and registers, returning values in dBm.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
* nlevels - Pointer to the number of levels settled. This parameter must
|
||||
* be in the range [0:7].
|
||||
* table - Pointer to an array of 8 elements containing the PA value in dbm.
|
||||
* The first element will be the PA_LEVEL_0 and the last element
|
||||
* will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT implies
|
||||
( no output power (output stage is in high impedance).
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success. A negated errno value is returned on any failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int spirit_radio_get_patable(FAR struct spirit_library_s *spirit,
|
||||
FAR uint8_t *nlevels, FAR float *table);
|
||||
|
||||
/******************************************************************************
|
||||
* Name: spirit_radio_set_palevel
|
||||
@ -775,8 +1136,8 @@ uint8_t spirit_radio_dbm2reg(FAR struct spirit_library_s *spirit,
|
||||
* Description:
|
||||
* Sets a specific PA_LEVEL register, with a value given in dBm.
|
||||
*
|
||||
* NOTE: This function makes use of the @ref spirit_radio_dbm2reg fcn to
|
||||
* interpolate the power value.
|
||||
* NOTE: This function makes use of the spirit_radio_convert_power2reg function
|
||||
* to interpolate the power value.
|
||||
*
|
||||
* Input Parameters:
|
||||
* spirit - Reference to a Spirit library state structure instance
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user