ST Expansion SW Team / RFAL

Dependents:   mbed-os-nfc05a1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rfal_chip.h Source File

rfal_chip.h

Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003   * @attention
00004   *
00005   * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
00006   *
00007   * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
00008   * You may not use this file except in compliance with the License.
00009   * You may obtain a copy of the License at:
00010   *
00011   *        http://www.st.com/myliberty
00012   *
00013   * Unless required by applicable law or agreed to in writing, software
00014   * distributed under the License is distributed on an "AS IS" BASIS,
00015   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
00016   * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
00017   * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
00018   * See the License for the specific language governing permissions and
00019   * limitations under the License.
00020   *
00021 ******************************************************************************/
00022 
00023 
00024 /*
00025  *      PROJECT:   ST25R391x firmware
00026  *      $Revision: $
00027  *      LANGUAGE:  ISO C99
00028  */
00029 
00030 /*! \file rfal_chip.h
00031  *
00032  *  \author Gustavo Patricio
00033  *
00034  *  \brief RF Chip specific Layer
00035  *
00036  *  \warning This layer, which provides direct access to RF chip, should
00037  *           only be used for debug purposes and/or advanced features
00038  *
00039  *
00040  * @addtogroup RFAL
00041  * @{
00042  *
00043  * @addtogroup RFAL-HAL
00044  * @brief RFAL Hardware Abstraction Layer
00045  * @{
00046  *
00047  * @addtogroup Chip
00048  * @brief RFAL RF Chip Module
00049  * @{
00050  *
00051  */
00052 
00053 
00054 #ifndef RFAL_CHIP_H
00055 #define RFAL_CHIP_H
00056 
00057 /*
00058 ******************************************************************************
00059 * INCLUDES
00060 ******************************************************************************
00061 */
00062 #include "platform1.h"
00063 #include "st_errno.h"
00064 #include "rfal_rf.h"
00065 
00066 
00067 /*****************************************************************************
00068  *  RF Chip                                                                  *
00069  *****************************************************************************/
00070 
00071 /*!
00072  *****************************************************************************
00073  * \brief Writes a register on the RF Chip
00074  *
00075  * Checks if the given register is valid and if so, writes the value(s)
00076  * on the RF Chip register
00077  *
00078  * \param[in] reg: register address to be written, or the first if len > 1
00079  * \param[in] values: pointer with content to be written on the register(s)
00080  * \param[in] len: number of consecutive registers to be written
00081  *
00082  *
00083  * \return ERR_PARAM Invalid register or bad request
00084  * \return ERR_NONE  Write done with no error
00085  *****************************************************************************
00086  */
00087 ReturnCode rfalChipWriteReg( uint16_t reg, uint8_t* values, uint8_t len, SPI * mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00088 
00089 /*!
00090  *****************************************************************************
00091  * \brief Reads a register on the RF Chip
00092  *
00093  * Checks if the given register is valid and if so, reads the value(s)
00094  * of the RF Chip register(s)
00095  *
00096  * \param[in]  reg: register address to be read, or the first if len > 1
00097  * \param[out] values: pointer where the register(s) read content will be placed
00098  * \param[in]  len: number of consecutive registers to be read
00099  *
00100  * \return ERR_PARAM Invalid register or bad request
00101  * \return ERR_NONE  Read done with no error
00102  *****************************************************************************
00103  */
00104 ReturnCode rfalChipReadReg( uint16_t reg, uint8_t* values, uint8_t len, SPI * mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00105 
00106 /*!
00107  *****************************************************************************
00108  * \brief Change a register on the RF Chip
00109  *
00110  * Change the value of the register bits on the RF Chip Test set in the valueMask.
00111  *
00112  * \param[in] reg: register address to be modified
00113  * \param[in] valueMask: mask value of the register bits to be changed
00114  * \param[in] value: register value to be set
00115  *
00116  * \return ERR_PARAM Invalid register or bad request
00117  * \return ERR_OK    Change done with no error
00118  *****************************************************************************
00119  */
00120 ReturnCode rfalChipChangeRegBits( uint16_t reg, uint8_t valueMask, uint8_t value, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00121 
00122 /*!
00123  *****************************************************************************
00124  * \brief Writes a Test register on the RF Chip
00125  *
00126  * Writes the value on the RF Chip Test register
00127  *
00128  * \param[in] reg: register address to be written
00129  * \param[in] value: value to be written on the register
00130  *
00131  *
00132  * \return ERR_PARAM Invalid register or bad request
00133  * \return ERR_NONE  Write done with no error
00134  *****************************************************************************
00135  */
00136 ReturnCode rfalChipWriteTestReg( uint16_t reg, uint8_t value, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00137 
00138 /*!
00139  *****************************************************************************
00140  * \brief Reads a Test register on the RF Chip
00141  *
00142  * Reads the value of the RF Chip Test register
00143  *
00144  * \param[in]  reg: register address to be read
00145  * \param[out] value: pointer where the register content will be placed
00146  *
00147  * \return ERR_PARAM Invalid register or bad request
00148  * \return ERR_NONE  Read done with no error
00149  *****************************************************************************
00150  */
00151 ReturnCode rfalChipReadTestReg( uint16_t reg, uint8_t* value );
00152 
00153 /*!
00154  *****************************************************************************
00155  * \brief Change a Test register on the RF Chip
00156  *
00157  * Change the value of the register bits on the RF Chip Test set in the valueMask.
00158  *
00159  * \param[in] reg: test register address to be modified
00160  * \param[in] valueMask: mask value of the register bits to be changed
00161  * \param[in] value: register value to be set
00162  *
00163  * \return ERR_PARAM Invalid register or bad request
00164  * \return ERR_OK    Change done with no error
00165  *****************************************************************************
00166  */
00167 ReturnCode rfalChipChangeTestRegBits( uint16_t reg, uint8_t valueMask, uint8_t value, SPI* mspiChannel, ST25R3911* mST25,
00168         DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00169 
00170 /*!
00171  *****************************************************************************
00172  * \brief Execute command on the RF Chip
00173  *
00174  * Checks if the given command is valid and if so, executes it on
00175  * the RF Chip
00176  *
00177  * \param[in] cmd: direct command to be executed
00178  *
00179  * \return ERR_PARAM Invalid command or bad request
00180  * \return ERR_NONE  Direct command executed with no error
00181  *****************************************************************************
00182  */
00183 ReturnCode rfalChipExecCmd( uint16_t cmd, SPI * mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 );
00184 
00185 
00186 #endif /* RFAL_CHIP_H */
00187 
00188 /**
00189   * @}
00190   *
00191   * @}
00192   *
00193   * @}
00194   */