Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
MCR20Drv.h
00001 /*! 00002 * Copyright (c) 2015, Freescale Semiconductor, Inc. 00003 * All rights reserved. 00004 * 00005 * \file MCR20Drv.h 00006 * 00007 * Redistribution and use in source and binary forms, with or without modification, 00008 * are permitted provided that the following conditions are met: 00009 * 00010 * o Redistributions of source code must retain the above copyright notice, this list 00011 * of conditions and the following disclaimer. 00012 * 00013 * o Redistributions in binary form must reproduce the above copyright notice, this 00014 * list of conditions and the following disclaimer in the documentation and/or 00015 * other materials provided with the distribution. 00016 * 00017 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its 00018 * contributors may be used to endorse or promote products derived from this 00019 * software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00023 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00024 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00025 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00026 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00027 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00028 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00029 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 #ifndef __MCR20_DRV_H__ 00034 #define __MCR20_DRV_H__ 00035 00036 #include <stdint.h> 00037 00038 /***************************************************************************** 00039 * INCLUDED HEADERS * 00040 *---------------------------------------------------------------------------* 00041 * Add to this section all the headers that this module needs to include. * 00042 * Note that it is not a good practice to include header files into header * 00043 * files, so use this section only if there is no other better solution. * 00044 *---------------------------------------------------------------------------* 00045 *****************************************************************************/ 00046 00047 /***************************************************************************** 00048 * PRIVATE MACROS * 00049 *---------------------------------------------------------------------------* 00050 * Add to this section all the access macros, registers mappings, bit access * 00051 * macros, masks, flags etc ... 00052 *---------------------------------------------------------------------------* 00053 *****************************************************************************/ 00054 00055 /* Disable XCVR clock output by default, to reduce power consumption */ 00056 #ifndef gMCR20_ClkOutFreq_d 00057 #define gMCR20_ClkOutFreq_d gCLK_OUT_FREQ_DISABLE 00058 #endif 00059 00060 /***************************************************************************** 00061 * PUBLIC FUNCTIONS * 00062 *---------------------------------------------------------------------------* 00063 * Add to this section all the global functions prototype preceded (as a * 00064 * good practice) by the keyword 'extern' * 00065 *---------------------------------------------------------------------------* 00066 *****************************************************************************/ 00067 00068 /*--------------------------------------------------------------------------- 00069 * Name: MCR20Drv_Init 00070 * Description: - 00071 * Parameters: - 00072 * Return: - 00073 *---------------------------------------------------------------------------*/ 00074 extern void MCR20Drv_Init 00075 ( 00076 void 00077 ); 00078 00079 /*--------------------------------------------------------------------------- 00080 * Name: MCR20Drv_SPI_DMA_Init 00081 * Description: - 00082 * Parameters: - 00083 * Return: - 00084 *---------------------------------------------------------------------------*/ 00085 void MCR20Drv_SPI_DMA_Init 00086 ( 00087 void 00088 ); 00089 00090 /*--------------------------------------------------------------------------- 00091 * Name: MCR20Drv_Start_PB_DMA_SPI_Write 00092 * Description: - 00093 * Parameters: - 00094 * Return: - 00095 *---------------------------------------------------------------------------*/ 00096 void MCR20Drv_Start_PB_DMA_SPI_Write 00097 ( 00098 uint8_t *srcAddress, 00099 uint8_t numOfBytes 00100 ); 00101 00102 /*--------------------------------------------------------------------------- 00103 * Name: MCR20Drv_Start_PB_DMA_SPI_Read 00104 * Description: - 00105 * Parameters: - 00106 * Return: - 00107 *---------------------------------------------------------------------------*/ 00108 void MCR20Drv_Start_PB_DMA_SPI_Read 00109 ( 00110 uint8_t *dstAddress, 00111 uint8_t numOfBytes 00112 ); 00113 00114 /*--------------------------------------------------------------------------- 00115 * Name: MCR20Drv_DirectAccessSPIWrite 00116 * Description: - 00117 * Parameters: - 00118 * Return: - 00119 *---------------------------------------------------------------------------*/ 00120 void MCR20Drv_DirectAccessSPIWrite 00121 ( 00122 uint8_t address, 00123 uint8_t value 00124 ); 00125 00126 /*--------------------------------------------------------------------------- 00127 * Name: MCR20Drv_DirectAccessSPIMultiByteWrite 00128 * Description: - 00129 * Parameters: - 00130 * Return: - 00131 *---------------------------------------------------------------------------*/ 00132 void MCR20Drv_DirectAccessSPIMultiByteWrite 00133 ( 00134 uint8_t startAddress, 00135 uint8_t *byteArray, 00136 uint8_t numOfBytes 00137 ); 00138 00139 /*--------------------------------------------------------------------------- 00140 * Name: MCR20Drv_PB_SPIBurstWrite 00141 * Description: - 00142 * Parameters: - 00143 * Return: - 00144 *---------------------------------------------------------------------------*/ 00145 void MCR20Drv_PB_SPIBurstWrite 00146 ( 00147 uint8_t *byteArray, 00148 uint8_t numOfBytes 00149 ); 00150 00151 /*--------------------------------------------------------------------------- 00152 * Name: MCR20Drv_DirectAccessSPIRead 00153 * Description: - 00154 * Parameters: - 00155 * Return: - 00156 *---------------------------------------------------------------------------*/ 00157 uint8_t MCR20Drv_DirectAccessSPIRead 00158 ( 00159 uint8_t address 00160 ); 00161 00162 /*--------------------------------------------------------------------------- 00163 * Name: MCR20Drv_DirectAccessSPIMultyByteRead 00164 * Description: - 00165 * Parameters: - 00166 * Return: - 00167 *---------------------------------------------------------------------------*/ 00168 00169 uint8_t MCR20Drv_DirectAccessSPIMultiByteRead 00170 ( 00171 uint8_t startAddress, 00172 uint8_t *byteArray, 00173 uint8_t numOfBytes 00174 ); 00175 00176 /*--------------------------------------------------------------------------- 00177 * Name: MCR20Drv_PB_SPIByteWrite 00178 * Description: - 00179 * Parameters: - 00180 * Return: - 00181 *---------------------------------------------------------------------------*/ 00182 void MCR20Drv_PB_SPIByteWrite 00183 ( 00184 uint8_t address, 00185 uint8_t value 00186 ); 00187 00188 /*--------------------------------------------------------------------------- 00189 * Name: MCR20Drv_PB_SPIBurstRead 00190 * Description: - 00191 * Parameters: - 00192 * Return: - 00193 *---------------------------------------------------------------------------*/ 00194 uint8_t MCR20Drv_PB_SPIBurstRead 00195 ( 00196 uint8_t *byteArray, 00197 uint8_t numOfBytes 00198 ); 00199 00200 /*--------------------------------------------------------------------------- 00201 * Name: MCR20Drv_IndirectAccessSPIWrite 00202 * Description: - 00203 * Parameters: - 00204 * Return: - 00205 *---------------------------------------------------------------------------*/ 00206 void MCR20Drv_IndirectAccessSPIWrite 00207 ( 00208 uint8_t address, 00209 uint8_t value 00210 ); 00211 00212 /*--------------------------------------------------------------------------- 00213 * Name: MCR20Drv_IndirectAccessSPIMultiByteWrite 00214 * Description: - 00215 * Parameters: - 00216 * Return: - 00217 *---------------------------------------------------------------------------*/ 00218 void MCR20Drv_IndirectAccessSPIMultiByteWrite 00219 ( 00220 uint8_t startAddress, 00221 uint8_t *byteArray, 00222 uint8_t numOfBytes 00223 ); 00224 00225 /*--------------------------------------------------------------------------- 00226 * Name: MCR20Drv_IndirectAccessSPIRead 00227 * Description: - 00228 * Parameters: - 00229 * Return: - 00230 *---------------------------------------------------------------------------*/ 00231 uint8_t MCR20Drv_IndirectAccessSPIRead 00232 ( 00233 uint8_t address 00234 ); 00235 /*--------------------------------------------------------------------------- 00236 * Name: MCR20Drv_IndirectAccessSPIMultiByteRead 00237 * Description: - 00238 * Parameters: - 00239 * Return: - 00240 *---------------------------------------------------------------------------*/ 00241 void MCR20Drv_IndirectAccessSPIMultiByteRead 00242 ( 00243 uint8_t startAddress, 00244 uint8_t *byteArray, 00245 uint8_t numOfBytes 00246 ); 00247 00248 /*--------------------------------------------------------------------------- 00249 * Name: MCR20Drv_IsIrqPending 00250 * Description: - 00251 * Parameters: - 00252 * Return: - 00253 *---------------------------------------------------------------------------*/ 00254 uint32_t MCR20Drv_IsIrqPending 00255 ( 00256 void 00257 ); 00258 00259 /*--------------------------------------------------------------------------- 00260 * Name: MCR20Drv_IRQ_Disable 00261 * Description: - 00262 * Parameters: - 00263 * Return: - 00264 *---------------------------------------------------------------------------*/ 00265 void MCR20Drv_IRQ_Disable 00266 ( 00267 void 00268 ); 00269 00270 /*--------------------------------------------------------------------------- 00271 * Name: MCR20Drv_IRQ_Enable 00272 * Description: - 00273 * Parameters: - 00274 * Return: - 00275 *---------------------------------------------------------------------------*/ 00276 void MCR20Drv_IRQ_Enable 00277 ( 00278 void 00279 ); 00280 00281 /*--------------------------------------------------------------------------- 00282 * Name: MCR20Drv_RST_PortConfig 00283 * Description: - 00284 * Parameters: - 00285 * Return: - 00286 *---------------------------------------------------------------------------*/ 00287 void MCR20Drv_RST_B_PortConfig 00288 ( 00289 void 00290 ); 00291 00292 /*--------------------------------------------------------------------------- 00293 * Name: MCR20Drv_RST_Assert 00294 * Description: - 00295 * Parameters: - 00296 * Return: - 00297 *---------------------------------------------------------------------------*/ 00298 void MCR20Drv_RST_B_Assert 00299 ( 00300 void 00301 ); 00302 00303 /*--------------------------------------------------------------------------- 00304 * Name: MCR20Drv_RST_Deassert 00305 * Description: - 00306 * Parameters: - 00307 * Return: - 00308 *---------------------------------------------------------------------------*/ 00309 void MCR20Drv_RST_B_Deassert 00310 ( 00311 void 00312 ); 00313 00314 /*--------------------------------------------------------------------------- 00315 * Name: MCR20Drv_SoftRST_Assert 00316 * Description: - 00317 * Parameters: - 00318 * Return: - 00319 *---------------------------------------------------------------------------*/ 00320 void MCR20Drv_SoftRST_Assert 00321 ( 00322 void 00323 ); 00324 00325 /*--------------------------------------------------------------------------- 00326 * Name: MCR20Drv_SoftRST_Deassert 00327 * Description: - 00328 * Parameters: - 00329 * Return: - 00330 *---------------------------------------------------------------------------*/ 00331 void MCR20Drv_SoftRST_Deassert 00332 ( 00333 void 00334 ); 00335 00336 00337 /*--------------------------------------------------------------------------- 00338 * Name: MCR20Drv_RESET 00339 * Description: - 00340 * Parameters: - 00341 * Return: - 00342 *---------------------------------------------------------------------------*/ 00343 void MCR20Drv_RESET 00344 ( 00345 void 00346 ); 00347 00348 /*--------------------------------------------------------------------------- 00349 * Name: MCR20Drv_Soft_RESET 00350 * Description: - 00351 * Parameters: - 00352 * Return: - 00353 *---------------------------------------------------------------------------*/ 00354 void MCR20Drv_Soft_RESET 00355 ( 00356 void 00357 ); 00358 00359 /*--------------------------------------------------------------------------- 00360 * Name: MCR20Drv_Set_CLK_OUT_Freq 00361 * Description: - 00362 * Parameters: - 00363 * Return: - 00364 *---------------------------------------------------------------------------*/ 00365 void MCR20Drv_Set_CLK_OUT_Freq 00366 ( 00367 uint8_t freqDiv 00368 ); 00369 00370 #define ProtectFromMCR20Interrupt() MCR20Drv_IRQ_Disable() 00371 #define UnprotectFromMCR20Interrupt() MCR20Drv_IRQ_Enable() 00372 00373 #endif /* __MCR20_DRV_H__ */
Generated on Tue Jul 12 2022 13:54:34 by
