The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
128:9bcdf88f62b0
Child:
139:856d2700e60b
Release 136 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 98:8ab26030e058 1 /***************************************************************************//**
Kojto 98:8ab26030e058 2 * @file em_prs.h
Kojto 98:8ab26030e058 3 * @brief Peripheral Reflex System (PRS) peripheral API
<> 128:9bcdf88f62b0 4 * @version 5.0.0
Kojto 98:8ab26030e058 5 *******************************************************************************
Kojto 98:8ab26030e058 6 * @section License
<> 128:9bcdf88f62b0 7 * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
Kojto 98:8ab26030e058 8 *******************************************************************************
Kojto 98:8ab26030e058 9 *
Kojto 98:8ab26030e058 10 * Permission is granted to anyone to use this software for any purpose,
Kojto 98:8ab26030e058 11 * including commercial applications, and to alter it and redistribute it
Kojto 98:8ab26030e058 12 * freely, subject to the following restrictions:
Kojto 98:8ab26030e058 13 *
Kojto 98:8ab26030e058 14 * 1. The origin of this software must not be misrepresented; you must not
Kojto 98:8ab26030e058 15 * claim that you wrote the original software.
Kojto 98:8ab26030e058 16 * 2. Altered source versions must be plainly marked as such, and must not be
Kojto 98:8ab26030e058 17 * misrepresented as being the original software.
Kojto 98:8ab26030e058 18 * 3. This notice may not be removed or altered from any source distribution.
Kojto 98:8ab26030e058 19 *
Kojto 98:8ab26030e058 20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
Kojto 98:8ab26030e058 21 * obligation to support this Software. Silicon Labs is providing the
Kojto 98:8ab26030e058 22 * Software "AS IS", with no express or implied warranties of any kind,
Kojto 98:8ab26030e058 23 * including, but not limited to, any implied warranties of merchantability
Kojto 98:8ab26030e058 24 * or fitness for any particular purpose or warranties against infringement
Kojto 98:8ab26030e058 25 * of any proprietary rights of a third party.
Kojto 98:8ab26030e058 26 *
Kojto 98:8ab26030e058 27 * Silicon Labs will not be liable for any consequential, incidental, or
Kojto 98:8ab26030e058 28 * special damages, or any other relief, or for any claim by any third party,
Kojto 98:8ab26030e058 29 * arising from your use of this Software.
Kojto 98:8ab26030e058 30 *
Kojto 98:8ab26030e058 31 ******************************************************************************/
Kojto 98:8ab26030e058 32
<> 128:9bcdf88f62b0 33 #ifndef EM_PRS_H
<> 128:9bcdf88f62b0 34 #define EM_PRS_H
Kojto 98:8ab26030e058 35
Kojto 98:8ab26030e058 36 #include "em_device.h"
Kojto 98:8ab26030e058 37 #if defined(PRS_COUNT) && (PRS_COUNT > 0)
Kojto 98:8ab26030e058 38
Kojto 98:8ab26030e058 39 #ifdef __cplusplus
Kojto 98:8ab26030e058 40 extern "C" {
Kojto 98:8ab26030e058 41 #endif
Kojto 98:8ab26030e058 42
Kojto 98:8ab26030e058 43 /***************************************************************************//**
<> 128:9bcdf88f62b0 44 * @addtogroup emlib
Kojto 98:8ab26030e058 45 * @{
Kojto 98:8ab26030e058 46 ******************************************************************************/
Kojto 98:8ab26030e058 47
Kojto 98:8ab26030e058 48 /***************************************************************************//**
Kojto 98:8ab26030e058 49 * @addtogroup PRS
Kojto 98:8ab26030e058 50 * @{
Kojto 98:8ab26030e058 51 ******************************************************************************/
Kojto 98:8ab26030e058 52
Kojto 98:8ab26030e058 53 /*******************************************************************************
Kojto 98:8ab26030e058 54 ******************************** ENUMS ************************************
Kojto 98:8ab26030e058 55 ******************************************************************************/
Kojto 98:8ab26030e058 56
Kojto 98:8ab26030e058 57 /** Edge detection type. */
Kojto 98:8ab26030e058 58 typedef enum
Kojto 98:8ab26030e058 59 {
Kojto 98:8ab26030e058 60 prsEdgeOff = PRS_CH_CTRL_EDSEL_OFF, /**< Leave signal as is. */
Kojto 98:8ab26030e058 61 prsEdgePos = PRS_CH_CTRL_EDSEL_POSEDGE, /**< Generate pules on positive edge. */
Kojto 98:8ab26030e058 62 prsEdgeNeg = PRS_CH_CTRL_EDSEL_NEGEDGE, /**< Generate pules on negative edge. */
Kojto 98:8ab26030e058 63 prsEdgeBoth = PRS_CH_CTRL_EDSEL_BOTHEDGES /**< Generate pules on both edges. */
Kojto 98:8ab26030e058 64 } PRS_Edge_TypeDef;
Kojto 98:8ab26030e058 65
Kojto 98:8ab26030e058 66 /*******************************************************************************
Kojto 98:8ab26030e058 67 ***************************** PROTOTYPES **********************************
Kojto 98:8ab26030e058 68 ******************************************************************************/
Kojto 98:8ab26030e058 69
Kojto 98:8ab26030e058 70 /***************************************************************************//**
Kojto 98:8ab26030e058 71 * @brief
Kojto 98:8ab26030e058 72 * Set level control bit for one or more channels.
Kojto 98:8ab26030e058 73 *
Kojto 98:8ab26030e058 74 * @details
Kojto 98:8ab26030e058 75 * The level value for a channel is XORed with both the pulse possible issued
Kojto 98:8ab26030e058 76 * by PRS_PulseTrigger() and the PRS input signal selected for the channel(s).
Kojto 98:8ab26030e058 77 *
Kojto 98:8ab26030e058 78 * @param[in] level
Kojto 98:8ab26030e058 79 * Level to use for channels indicated by @p mask. Use logical OR combination
Kojto 98:8ab26030e058 80 * of PRS_SWLEVEL_CHnLEVEL defines for channels to set high level, otherwise 0.
Kojto 98:8ab26030e058 81 *
Kojto 98:8ab26030e058 82 * @param[in] mask
Kojto 98:8ab26030e058 83 * Mask indicating which channels to set level for. Use logical OR combination
Kojto 98:8ab26030e058 84 * of PRS_SWLEVEL_CHnLEVEL defines.
Kojto 98:8ab26030e058 85 ******************************************************************************/
Kojto 98:8ab26030e058 86 __STATIC_INLINE void PRS_LevelSet(uint32_t level, uint32_t mask)
Kojto 98:8ab26030e058 87 {
Kojto 98:8ab26030e058 88 PRS->SWLEVEL = (PRS->SWLEVEL & ~mask) | (level & mask);
Kojto 98:8ab26030e058 89 }
Kojto 98:8ab26030e058 90
Kojto 98:8ab26030e058 91
Kojto 98:8ab26030e058 92 /***************************************************************************//**
Kojto 98:8ab26030e058 93 * @brief
Kojto 98:8ab26030e058 94 * Trigger a high pulse (one HFPERCLK) for one or more channels.
Kojto 98:8ab26030e058 95 *
Kojto 98:8ab26030e058 96 * @details
Kojto 98:8ab26030e058 97 * Setting a bit for a channel causes the bit in the register to remain high
Kojto 98:8ab26030e058 98 * for one HFPERCLK cycle. The pulse is XORed with both the corresponding bit
Kojto 98:8ab26030e058 99 * in PRS SWLEVEL register and the PRS input signal selected for the
Kojto 98:8ab26030e058 100 * channel(s).
Kojto 98:8ab26030e058 101 *
Kojto 98:8ab26030e058 102 * @param[in] channels
Kojto 98:8ab26030e058 103 * Logical ORed combination of channels to trigger a pulse for. Use
Kojto 98:8ab26030e058 104 * PRS_SWPULSE_CHnPULSE defines.
Kojto 98:8ab26030e058 105 ******************************************************************************/
Kojto 98:8ab26030e058 106 __STATIC_INLINE void PRS_PulseTrigger(uint32_t channels)
Kojto 98:8ab26030e058 107 {
Kojto 98:8ab26030e058 108 PRS->SWPULSE = channels & _PRS_SWPULSE_MASK;
Kojto 98:8ab26030e058 109 }
Kojto 98:8ab26030e058 110
Kojto 98:8ab26030e058 111 void PRS_SourceSignalSet(unsigned int ch,
Kojto 98:8ab26030e058 112 uint32_t source,
Kojto 98:8ab26030e058 113 uint32_t signal,
Kojto 98:8ab26030e058 114 PRS_Edge_TypeDef edge);
Kojto 98:8ab26030e058 115
Kojto 98:8ab26030e058 116 #if defined( PRS_CH_CTRL_ASYNC )
Kojto 98:8ab26030e058 117 void PRS_SourceAsyncSignalSet(unsigned int ch,
Kojto 98:8ab26030e058 118 uint32_t source,
Kojto 98:8ab26030e058 119 uint32_t signal);
Kojto 98:8ab26030e058 120 #endif
Kojto 98:8ab26030e058 121
Kojto 98:8ab26030e058 122 /** @} (end addtogroup PRS) */
<> 128:9bcdf88f62b0 123 /** @} (end addtogroup emlib) */
Kojto 98:8ab26030e058 124
Kojto 98:8ab26030e058 125 #ifdef __cplusplus
Kojto 98:8ab26030e058 126 }
Kojto 98:8ab26030e058 127 #endif
Kojto 98:8ab26030e058 128
Kojto 98:8ab26030e058 129 #endif /* defined(PRS_COUNT) && (PRS_COUNT > 0) */
<> 128:9bcdf88f62b0 130 #endif /* EM_PRS_H */