2015-04-11 07:44:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
2015-12-04 23:09:39 +08:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Freescale K20 microprocessor Pin Control register definitions
|
|
|
|
*
|
2015-10-21 00:42:33 +08:00
|
|
|
* This module defines the PCR (Port/Pin Control/Configuration Registers) for
|
|
|
|
* the K20 Family of microprocessors
|
2015-07-02 05:22:39 +08:00
|
|
|
*/
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
#ifndef _K20PCR_H_
|
|
|
|
#define _K20PCR_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#define PCR_PORT_A 0
|
|
|
|
#define PCR_PORT_B 1
|
|
|
|
#define PCR_PORT_C 2
|
|
|
|
#define PCR_PORT_D 3
|
|
|
|
#define PCR_PORT_E 4
|
|
|
|
|
|
|
|
#define PCR_MUX_DISABLED 0
|
|
|
|
#define PCR_MUX_ALT1 1
|
|
|
|
#define PCR_MUX_ALT2 2
|
|
|
|
#define PCR_MUX_ALT3 3
|
|
|
|
#define PCR_MUX_ALT4 4
|
|
|
|
#define PCR_MUX_ALT5 5
|
|
|
|
#define PCR_MUX_ALT6 6
|
|
|
|
#define PCR_MUX_ALT7 7
|
|
|
|
|
2015-10-30 05:05:16 +08:00
|
|
|
union K20_PCR {
|
2015-04-11 07:44:37 +08:00
|
|
|
uint32_t value;
|
|
|
|
struct {
|
2015-05-27 04:16:44 +08:00
|
|
|
uint8_t ps : 1 __packed;
|
|
|
|
uint8_t pe : 1 __packed;
|
|
|
|
uint8_t sre : 1 __packed;
|
|
|
|
uint8_t res_3 : 1 __packed;
|
|
|
|
uint8_t pfe : 1 __packed;
|
|
|
|
uint8_t ode : 1 __packed;
|
|
|
|
uint8_t dse : 1 __packed;
|
|
|
|
uint8_t res_7 : 1 __packed;
|
|
|
|
uint8_t mux : 3 __packed;
|
|
|
|
uint8_t res_11_14 : 4 __packed;
|
|
|
|
uint8_t lk : 1 __packed;
|
|
|
|
uint8_t irqc : 4 __packed;
|
|
|
|
uint8_t res_20_23 : 4 __packed;
|
|
|
|
uint8_t isf : 1 __packed;
|
|
|
|
uint8_t res_25_31 : 7 __packed;
|
2015-04-11 07:44:37 +08:00
|
|
|
} field;
|
2015-10-30 05:05:16 +08:00
|
|
|
}; /* Pin Control Register n, n= 0-31 */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-10-30 05:05:16 +08:00
|
|
|
union K20_GPC {
|
2015-04-11 07:44:37 +08:00
|
|
|
uint32_t value;
|
|
|
|
struct {
|
2015-05-27 04:16:44 +08:00
|
|
|
uint16_t gpwe : 16 __packed;
|
|
|
|
uint16_t gpwd : 16 __packed;
|
2015-04-11 07:44:37 +08:00
|
|
|
} field;
|
2015-10-30 05:05:16 +08:00
|
|
|
}; /* Global Pin Control Low/High Register */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/* K20 Microntroller PCR module register structure */
|
|
|
|
|
2015-10-30 05:05:16 +08:00
|
|
|
struct K20_PORT_PCR {
|
2015-04-11 07:44:37 +08:00
|
|
|
struct {
|
2015-10-30 05:05:16 +08:00
|
|
|
union K20_PCR pcr[32] __packed; /* 0x00-07C */
|
|
|
|
union K20_GPC gpchr __packed; /* 0x80 */
|
|
|
|
union K20_GPC gpclr __packed; /* 0x84 */
|
2015-04-11 07:44:37 +08:00
|
|
|
uint8_t res_88_9F[0xA0 - 0x88]; /* 0x88-0x9F Reserved */
|
2015-05-27 04:16:44 +08:00
|
|
|
uint32_t isfr __packed; /* 0xA0 */
|
2015-04-11 07:44:37 +08:00
|
|
|
uint8_t res_A4_FF[0x1000 - 0xA4]; /* 0xA4-0xFFF Reserved */
|
|
|
|
} port[5];
|
2015-10-30 05:05:16 +08:00
|
|
|
};
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/* pin control register for port A..E on pin 0..31 */
|
|
|
|
#define K20_PCR(base, port, pin) \
|
2015-10-30 05:05:16 +08:00
|
|
|
((union K20_PCR *)(base + (0x1000 * port) + (pin * 4)))
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* _K20PCR_H_ */
|