NXP Touch Cursor example for LPCXpresso54608, modified for use with Mbed OS.
The tutorial for this example can be found here: https://os.mbed.com/blog/entry/How-to-LPCXpresso54608-touch-panel/
board/pin_mux.h@0:c107a6f8c368, 2018-04-11 (annotated)
- Committer:
- jplunkett
- Date:
- Wed Apr 11 20:46:55 2018 +0000
- Revision:
- 0:c107a6f8c368
Init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jplunkett | 0:c107a6f8c368 | 1 | /* |
jplunkett | 0:c107a6f8c368 | 2 | * The Clear BSD License |
jplunkett | 0:c107a6f8c368 | 3 | * Copyright (c) 2016, Freescale Semiconductor, Inc. |
jplunkett | 0:c107a6f8c368 | 4 | * Copyright 2016-2017 NXP |
jplunkett | 0:c107a6f8c368 | 5 | * All rights reserved. |
jplunkett | 0:c107a6f8c368 | 6 | * |
jplunkett | 0:c107a6f8c368 | 7 | * Redistribution and use in source and binary forms, with or without modification, |
jplunkett | 0:c107a6f8c368 | 8 | * are permitted (subject to the limitations in the disclaimer below) provided |
jplunkett | 0:c107a6f8c368 | 9 | * that the following conditions are met: |
jplunkett | 0:c107a6f8c368 | 10 | * |
jplunkett | 0:c107a6f8c368 | 11 | * o Redistributions of source code must retain the above copyright notice, this list |
jplunkett | 0:c107a6f8c368 | 12 | * of conditions and the following disclaimer. |
jplunkett | 0:c107a6f8c368 | 13 | * |
jplunkett | 0:c107a6f8c368 | 14 | * o Redistributions in binary form must reproduce the above copyright notice, this |
jplunkett | 0:c107a6f8c368 | 15 | * list of conditions and the following disclaimer in the documentation and/or |
jplunkett | 0:c107a6f8c368 | 16 | * other materials provided with the distribution. |
jplunkett | 0:c107a6f8c368 | 17 | * |
jplunkett | 0:c107a6f8c368 | 18 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
jplunkett | 0:c107a6f8c368 | 19 | * contributors may be used to endorse or promote products derived from this |
jplunkett | 0:c107a6f8c368 | 20 | * software without specific prior written permission. |
jplunkett | 0:c107a6f8c368 | 21 | * |
jplunkett | 0:c107a6f8c368 | 22 | * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. |
jplunkett | 0:c107a6f8c368 | 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
jplunkett | 0:c107a6f8c368 | 24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
jplunkett | 0:c107a6f8c368 | 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
jplunkett | 0:c107a6f8c368 | 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
jplunkett | 0:c107a6f8c368 | 27 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
jplunkett | 0:c107a6f8c368 | 28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
jplunkett | 0:c107a6f8c368 | 29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
jplunkett | 0:c107a6f8c368 | 30 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
jplunkett | 0:c107a6f8c368 | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
jplunkett | 0:c107a6f8c368 | 32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
jplunkett | 0:c107a6f8c368 | 33 | */ |
jplunkett | 0:c107a6f8c368 | 34 | |
jplunkett | 0:c107a6f8c368 | 35 | #ifndef _PIN_MUX_H_ |
jplunkett | 0:c107a6f8c368 | 36 | #define _PIN_MUX_H_ |
jplunkett | 0:c107a6f8c368 | 37 | |
jplunkett | 0:c107a6f8c368 | 38 | /*********************************************************************************************************************** |
jplunkett | 0:c107a6f8c368 | 39 | * Definitions |
jplunkett | 0:c107a6f8c368 | 40 | **********************************************************************************************************************/ |
jplunkett | 0:c107a6f8c368 | 41 | |
jplunkett | 0:c107a6f8c368 | 42 | /*! @brief Direction type */ |
jplunkett | 0:c107a6f8c368 | 43 | typedef enum _pin_mux_direction |
jplunkett | 0:c107a6f8c368 | 44 | { |
jplunkett | 0:c107a6f8c368 | 45 | kPIN_MUX_DirectionInput = 0U, /* Input direction */ |
jplunkett | 0:c107a6f8c368 | 46 | kPIN_MUX_DirectionOutput = 1U, /* Output direction */ |
jplunkett | 0:c107a6f8c368 | 47 | kPIN_MUX_DirectionInputOrOutput = 2U /* Input or output direction */ |
jplunkett | 0:c107a6f8c368 | 48 | } pin_mux_direction_t; |
jplunkett | 0:c107a6f8c368 | 49 | |
jplunkett | 0:c107a6f8c368 | 50 | /*! |
jplunkett | 0:c107a6f8c368 | 51 | * @addtogroup pin_mux |
jplunkett | 0:c107a6f8c368 | 52 | * @{ |
jplunkett | 0:c107a6f8c368 | 53 | */ |
jplunkett | 0:c107a6f8c368 | 54 | |
jplunkett | 0:c107a6f8c368 | 55 | /*********************************************************************************************************************** |
jplunkett | 0:c107a6f8c368 | 56 | * API |
jplunkett | 0:c107a6f8c368 | 57 | **********************************************************************************************************************/ |
jplunkett | 0:c107a6f8c368 | 58 | |
jplunkett | 0:c107a6f8c368 | 59 | #if defined(__cplusplus) |
jplunkett | 0:c107a6f8c368 | 60 | extern "C" { |
jplunkett | 0:c107a6f8c368 | 61 | #endif |
jplunkett | 0:c107a6f8c368 | 62 | |
jplunkett | 0:c107a6f8c368 | 63 | |
jplunkett | 0:c107a6f8c368 | 64 | #define IOCON_PIO_DIGITAL_EN 0x0100u /*!<@brief Enables digital function */ |
jplunkett | 0:c107a6f8c368 | 65 | #define IOCON_PIO_FUNC0 0x00u /*!<@brief Selects pin function 0 */ |
jplunkett | 0:c107a6f8c368 | 66 | #define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */ |
jplunkett | 0:c107a6f8c368 | 67 | #define IOCON_PIO_FUNC6 0x06u /*!<@brief Selects pin function 6 */ |
jplunkett | 0:c107a6f8c368 | 68 | #define IOCON_PIO_I2CDRIVE_HIGH 0x0400u /*!<@brief High drive: 20 mA */ |
jplunkett | 0:c107a6f8c368 | 69 | #define IOCON_PIO_I2CFILTER_EN 0x00u /*!<@brief I2C 50 ns glitch filter enabled */ |
jplunkett | 0:c107a6f8c368 | 70 | #define IOCON_PIO_I2CSLEW_I2C 0x00u /*!<@brief I2C mode */ |
jplunkett | 0:c107a6f8c368 | 71 | #define IOCON_PIO_INPFILT_OFF 0x0200u /*!<@brief Input filter disabled */ |
jplunkett | 0:c107a6f8c368 | 72 | #define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */ |
jplunkett | 0:c107a6f8c368 | 73 | #define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */ |
jplunkett | 0:c107a6f8c368 | 74 | #define IOCON_PIO_MODE_PULLUP 0x20u /*!<@brief Selects pull-up function */ |
jplunkett | 0:c107a6f8c368 | 75 | #define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */ |
jplunkett | 0:c107a6f8c368 | 76 | #define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */ |
jplunkett | 0:c107a6f8c368 | 77 | |
jplunkett | 0:c107a6f8c368 | 78 | /*! |
jplunkett | 0:c107a6f8c368 | 79 | * @brief Configures pin routing and optionally pin electrical features. |
jplunkett | 0:c107a6f8c368 | 80 | * |
jplunkett | 0:c107a6f8c368 | 81 | */ |
jplunkett | 0:c107a6f8c368 | 82 | void BOARD_InitPins(void); /* Function assigned for the Cortex-M4F */ |
jplunkett | 0:c107a6f8c368 | 83 | |
jplunkett | 0:c107a6f8c368 | 84 | #if defined(__cplusplus) |
jplunkett | 0:c107a6f8c368 | 85 | } |
jplunkett | 0:c107a6f8c368 | 86 | #endif |
jplunkett | 0:c107a6f8c368 | 87 | |
jplunkett | 0:c107a6f8c368 | 88 | /*! |
jplunkett | 0:c107a6f8c368 | 89 | * @} |
jplunkett | 0:c107a6f8c368 | 90 | */ |
jplunkett | 0:c107a6f8c368 | 91 | #endif /* _PIN_MUX_H_ */ |
jplunkett | 0:c107a6f8c368 | 92 | |
jplunkett | 0:c107a6f8c368 | 93 | /*********************************************************************************************************************** |
jplunkett | 0:c107a6f8c368 | 94 | * EOF |
jplunkett | 0:c107a6f8c368 | 95 | **********************************************************************************************************************/ |