Jasper Lee / mbed_helloworld

Dependents:   twr_helloworld

Committer:
Jasper_lee
Date:
Tue Dec 23 03:35:08 2014 +0000
Revision:
0:b16d94660a33
change some io setting used in TWR-K22F120M

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jasper_lee 0:b16d94660a33 1 /*******************************************************************************
Jasper_lee 0:b16d94660a33 2 * DISCLAIMER
Jasper_lee 0:b16d94660a33 3 * This software is supplied by Renesas Electronics Corporation and is only
Jasper_lee 0:b16d94660a33 4 * intended for use with Renesas products. No other uses are authorized. This
Jasper_lee 0:b16d94660a33 5 * software is owned by Renesas Electronics Corporation and is protected under
Jasper_lee 0:b16d94660a33 6 * all applicable laws, including copyright laws.
Jasper_lee 0:b16d94660a33 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
Jasper_lee 0:b16d94660a33 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
Jasper_lee 0:b16d94660a33 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
Jasper_lee 0:b16d94660a33 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
Jasper_lee 0:b16d94660a33 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
Jasper_lee 0:b16d94660a33 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
Jasper_lee 0:b16d94660a33 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
Jasper_lee 0:b16d94660a33 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
Jasper_lee 0:b16d94660a33 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Jasper_lee 0:b16d94660a33 16 * Renesas reserves the right, without notice, to make changes to this software
Jasper_lee 0:b16d94660a33 17 * and to discontinue the availability of this software. By using this software,
Jasper_lee 0:b16d94660a33 18 * you agree to the additional terms and conditions found by accessing the
Jasper_lee 0:b16d94660a33 19 * following link:
Jasper_lee 0:b16d94660a33 20 * http://www.renesas.com/disclaimer
Jasper_lee 0:b16d94660a33 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
Jasper_lee 0:b16d94660a33 22 *******************************************************************************/
Jasper_lee 0:b16d94660a33 23 /*******************************************************************************
Jasper_lee 0:b16d94660a33 24 * File Name : riic_iobitmask.h
Jasper_lee 0:b16d94660a33 25 * $Rev: 1114 $
Jasper_lee 0:b16d94660a33 26 * $Date:: 2014-07-09 14:56:39 +0900#$
Jasper_lee 0:b16d94660a33 27 * Description : RIIC register define header
Jasper_lee 0:b16d94660a33 28 *******************************************************************************/
Jasper_lee 0:b16d94660a33 29 #ifndef RIIC_IOBITMASK_H
Jasper_lee 0:b16d94660a33 30 #define RIIC_IOBITMASK_H
Jasper_lee 0:b16d94660a33 31
Jasper_lee 0:b16d94660a33 32
Jasper_lee 0:b16d94660a33 33 /* ==== Mask values for IO registers ==== */
Jasper_lee 0:b16d94660a33 34 #define RIICn_RIICnCR1_SDAI (0x01u)
Jasper_lee 0:b16d94660a33 35 #define RIICn_RIICnCR1_SCLI (0x02u)
Jasper_lee 0:b16d94660a33 36 #define RIICn_RIICnCR1_SDAO (0x04u)
Jasper_lee 0:b16d94660a33 37 #define RIICn_RIICnCR1_SCLO (0x08u)
Jasper_lee 0:b16d94660a33 38 #define RIICn_RIICnCR1_SOWP (0x10u)
Jasper_lee 0:b16d94660a33 39 #define RIICn_RIICnCR1_CLO (0x20u)
Jasper_lee 0:b16d94660a33 40 #define RIICn_RIICnCR1_IICRST (0x40u)
Jasper_lee 0:b16d94660a33 41 #define RIICn_RIICnCR1_ICE (0x80u)
Jasper_lee 0:b16d94660a33 42
Jasper_lee 0:b16d94660a33 43 #define RIICn_RIICnCR2_ST (0x02u)
Jasper_lee 0:b16d94660a33 44 #define RIICn_RIICnCR2_RS (0x04u)
Jasper_lee 0:b16d94660a33 45 #define RIICn_RIICnCR2_SP (0x08u)
Jasper_lee 0:b16d94660a33 46 #define RIICn_RIICnCR2_TRS (0x20u)
Jasper_lee 0:b16d94660a33 47 #define RIICn_RIICnCR2_MST (0x40u)
Jasper_lee 0:b16d94660a33 48 #define RIICn_RIICnCR2_BBSY (0x80u)
Jasper_lee 0:b16d94660a33 49
Jasper_lee 0:b16d94660a33 50 #define RIICn_RIICnMR1_BC (0x07u)
Jasper_lee 0:b16d94660a33 51 #define RIICn_RIICnMR1_BCWP (0x08u)
Jasper_lee 0:b16d94660a33 52 #define RIICn_RIICnMR1_CKS (0x70u)
Jasper_lee 0:b16d94660a33 53 #define RIICn_RIICnMR1_MTWP (0x80u)
Jasper_lee 0:b16d94660a33 54
Jasper_lee 0:b16d94660a33 55 #define RIICn_RIICnMR2_TMOS (0x01u)
Jasper_lee 0:b16d94660a33 56 #define RIICn_RIICnMR2_TMOL (0x02u)
Jasper_lee 0:b16d94660a33 57 #define RIICn_RIICnMR2_TMOH (0x04u)
Jasper_lee 0:b16d94660a33 58 #define RIICn_RIICnMR2_SDDL (0x70u)
Jasper_lee 0:b16d94660a33 59 #define RIICn_RIICnMR2_DLCS (0x80u)
Jasper_lee 0:b16d94660a33 60
Jasper_lee 0:b16d94660a33 61 #define RIICn_RIICnMR3_NF (0x03u)
Jasper_lee 0:b16d94660a33 62 #define RIICn_RIICnMR3_ACKBR (0x04u)
Jasper_lee 0:b16d94660a33 63 #define RIICn_RIICnMR3_ACKBT (0x08u)
Jasper_lee 0:b16d94660a33 64 #define RIICn_RIICnMR3_ACKWP (0x10u)
Jasper_lee 0:b16d94660a33 65 #define RIICn_RIICnMR3_RDRFS (0x20u)
Jasper_lee 0:b16d94660a33 66 #define RIICn_RIICnMR3_WAIT (0x40u)
Jasper_lee 0:b16d94660a33 67 #define RIICn_RIICnMR3_SMBS (0x80u)
Jasper_lee 0:b16d94660a33 68
Jasper_lee 0:b16d94660a33 69 #define RIICn_RIICnFER_TMOE (0x01u)
Jasper_lee 0:b16d94660a33 70 #define RIICn_RIICnFER_MALE (0x02u)
Jasper_lee 0:b16d94660a33 71 #define RIICn_RIICnFER_NALE (0x04u)
Jasper_lee 0:b16d94660a33 72 #define RIICn_RIICnFER_SALE (0x08u)
Jasper_lee 0:b16d94660a33 73 #define RIICn_RIICnFER_NACKE (0x10u)
Jasper_lee 0:b16d94660a33 74 #define RIICn_RIICnFER_NFE (0x20u)
Jasper_lee 0:b16d94660a33 75 #define RIICn_RIICnFER_SCLE (0x40u)
Jasper_lee 0:b16d94660a33 76 #define RIICn_RIICnFER_FMPE (0x80u)
Jasper_lee 0:b16d94660a33 77
Jasper_lee 0:b16d94660a33 78 #define RIICn_RIICnSER_SAR0E (0x01u)
Jasper_lee 0:b16d94660a33 79 #define RIICn_RIICnSER_SAR1E (0x02u)
Jasper_lee 0:b16d94660a33 80 #define RIICn_RIICnSER_SAR2E (0x04u)
Jasper_lee 0:b16d94660a33 81 #define RIICn_RIICnSER_GCAE (0x08u)
Jasper_lee 0:b16d94660a33 82 #define RIICn_RIICnSER_DIDE (0x20u)
Jasper_lee 0:b16d94660a33 83 #define RIICn_RIICnSER_HOAE (0x80u)
Jasper_lee 0:b16d94660a33 84
Jasper_lee 0:b16d94660a33 85 #define RIICn_RIICnIER_TMOIE (0x01u)
Jasper_lee 0:b16d94660a33 86 #define RIICn_RIICnIER_ALIE (0x02u)
Jasper_lee 0:b16d94660a33 87 #define RIICn_RIICnIER_STIE (0x04u)
Jasper_lee 0:b16d94660a33 88 #define RIICn_RIICnIER_SPIE (0x08u)
Jasper_lee 0:b16d94660a33 89 #define RIICn_RIICnIER_NAKIE (0x10u)
Jasper_lee 0:b16d94660a33 90 #define RIICn_RIICnIER_RIE (0x20u)
Jasper_lee 0:b16d94660a33 91 #define RIICn_RIICnIER_TEIE (0x40u)
Jasper_lee 0:b16d94660a33 92 #define RIICn_RIICnIER_TIE (0x80u)
Jasper_lee 0:b16d94660a33 93
Jasper_lee 0:b16d94660a33 94 #define RIICn_RIICnSR1_AAS0 (0x01u)
Jasper_lee 0:b16d94660a33 95 #define RIICn_RIICnSR1_AAS1 (0x02u)
Jasper_lee 0:b16d94660a33 96 #define RIICn_RIICnSR1_AAS2 (0x04u)
Jasper_lee 0:b16d94660a33 97 #define RIICn_RIICnSR1_GCA (0x08u)
Jasper_lee 0:b16d94660a33 98 #define RIICn_RIICnSR1_DID (0x20u)
Jasper_lee 0:b16d94660a33 99 #define RIICn_RIICnSR1_HOA (0x80u)
Jasper_lee 0:b16d94660a33 100
Jasper_lee 0:b16d94660a33 101 #define RIICn_RIICnSR2_TMOF (0x01u)
Jasper_lee 0:b16d94660a33 102 #define RIICn_RIICnSR2_AL (0x02u)
Jasper_lee 0:b16d94660a33 103 #define RIICn_RIICnSR2_START (0x04u)
Jasper_lee 0:b16d94660a33 104 #define RIICn_RIICnSR2_STOP (0x08u)
Jasper_lee 0:b16d94660a33 105 #define RIICn_RIICnSR2_NACKF (0x10u)
Jasper_lee 0:b16d94660a33 106 #define RIICn_RIICnSR2_RDRF (0x20u)
Jasper_lee 0:b16d94660a33 107 #define RIICn_RIICnSR2_TEND (0x40u)
Jasper_lee 0:b16d94660a33 108 #define RIICn_RIICnSR2_TDRE (0x80u)
Jasper_lee 0:b16d94660a33 109
Jasper_lee 0:b16d94660a33 110 #define RIICn_RIICnSAR0_SVA0 (0x0001u)
Jasper_lee 0:b16d94660a33 111 #define RIICn_RIICnSAR0_SVA (0x03FEu)
Jasper_lee 0:b16d94660a33 112 #define RIICn_RIICnSAR0_FSy (0x8000u)
Jasper_lee 0:b16d94660a33 113
Jasper_lee 0:b16d94660a33 114 #define RIICn_RIICnSAR1_SVA0 (0x0001u)
Jasper_lee 0:b16d94660a33 115 #define RIICn_RIICnSAR1_SVA (0x03FEu)
Jasper_lee 0:b16d94660a33 116 #define RIICn_RIICnSAR1_FSy (0x8000u)
Jasper_lee 0:b16d94660a33 117
Jasper_lee 0:b16d94660a33 118 #define RIICn_RIICnSAR2_SVA0 (0x0001u)
Jasper_lee 0:b16d94660a33 119 #define RIICn_RIICnSAR2_SVA (0x03FEu)
Jasper_lee 0:b16d94660a33 120 #define RIICn_RIICnSAR2_FSy (0x8000u)
Jasper_lee 0:b16d94660a33 121
Jasper_lee 0:b16d94660a33 122 #define RIICn_RIICnBRL_BRL (0x1Fu)
Jasper_lee 0:b16d94660a33 123
Jasper_lee 0:b16d94660a33 124 #define RIICn_RIICnBRH_BRH (0x1Fu)
Jasper_lee 0:b16d94660a33 125
Jasper_lee 0:b16d94660a33 126 #define RIICn_RIICnDRT_DRT (0xFFu)
Jasper_lee 0:b16d94660a33 127
Jasper_lee 0:b16d94660a33 128 #define RIICn_RIICnDRR_DRR (0xFFu)
Jasper_lee 0:b16d94660a33 129
Jasper_lee 0:b16d94660a33 130
Jasper_lee 0:b16d94660a33 131 /* ==== Shift values for IO registers ==== */
Jasper_lee 0:b16d94660a33 132 #define RIICn_RIICnCR1_SDAI_SHIFT (0u)
Jasper_lee 0:b16d94660a33 133 #define RIICn_RIICnCR1_SCLI_SHIFT (1u)
Jasper_lee 0:b16d94660a33 134 #define RIICn_RIICnCR1_SDAO_SHIFT (2u)
Jasper_lee 0:b16d94660a33 135 #define RIICn_RIICnCR1_SCLO_SHIFT (3u)
Jasper_lee 0:b16d94660a33 136 #define RIICn_RIICnCR1_SOWP_SHIFT (4u)
Jasper_lee 0:b16d94660a33 137 #define RIICn_RIICnCR1_CLO_SHIFT (5u)
Jasper_lee 0:b16d94660a33 138 #define RIICn_RIICnCR1_IICRST_SHIFT (6u)
Jasper_lee 0:b16d94660a33 139 #define RIICn_RIICnCR1_ICE_SHIFT (7u)
Jasper_lee 0:b16d94660a33 140
Jasper_lee 0:b16d94660a33 141 #define RIICn_RIICnCR2_ST_SHIFT (1u)
Jasper_lee 0:b16d94660a33 142 #define RIICn_RIICnCR2_RS_SHIFT (2u)
Jasper_lee 0:b16d94660a33 143 #define RIICn_RIICnCR2_SP_SHIFT (3u)
Jasper_lee 0:b16d94660a33 144 #define RIICn_RIICnCR2_TRS_SHIFT (5u)
Jasper_lee 0:b16d94660a33 145 #define RIICn_RIICnCR2_MST_SHIFT (6u)
Jasper_lee 0:b16d94660a33 146 #define RIICn_RIICnCR2_BBSY_SHIFT (7u)
Jasper_lee 0:b16d94660a33 147
Jasper_lee 0:b16d94660a33 148 #define RIICn_RIICnMR1_BC_SHIFT (0u)
Jasper_lee 0:b16d94660a33 149 #define RIICn_RIICnMR1_BCWP_SHIFT (3u)
Jasper_lee 0:b16d94660a33 150 #define RIICn_RIICnMR1_CKS_SHIFT (4u)
Jasper_lee 0:b16d94660a33 151 #define RIICn_RIICnMR1_MTWP_SHIFT (7u)
Jasper_lee 0:b16d94660a33 152
Jasper_lee 0:b16d94660a33 153 #define RIICn_RIICnMR2_TMOS_SHIFT (0u)
Jasper_lee 0:b16d94660a33 154 #define RIICn_RIICnMR2_TMOL_SHIFT (1u)
Jasper_lee 0:b16d94660a33 155 #define RIICn_RIICnMR2_TMOH_SHIFT (2u)
Jasper_lee 0:b16d94660a33 156 #define RIICn_RIICnMR2_SDDL_SHIFT (4u)
Jasper_lee 0:b16d94660a33 157 #define RIICn_RIICnMR2_DLCS_SHIFT (7u)
Jasper_lee 0:b16d94660a33 158
Jasper_lee 0:b16d94660a33 159 #define RIICn_RIICnMR3_NF_SHIFT (0u)
Jasper_lee 0:b16d94660a33 160 #define RIICn_RIICnMR3_ACKBR_SHIFT (2u)
Jasper_lee 0:b16d94660a33 161 #define RIICn_RIICnMR3_ACKBT_SHIFT (3u)
Jasper_lee 0:b16d94660a33 162 #define RIICn_RIICnMR3_ACKWP_SHIFT (4u)
Jasper_lee 0:b16d94660a33 163 #define RIICn_RIICnMR3_RDRFS_SHIFT (5u)
Jasper_lee 0:b16d94660a33 164 #define RIICn_RIICnMR3_WAIT_SHIFT (6u)
Jasper_lee 0:b16d94660a33 165 #define RIICn_RIICnMR3_SMBS_SHIFT (7u)
Jasper_lee 0:b16d94660a33 166
Jasper_lee 0:b16d94660a33 167 #define RIICn_RIICnFER_TMOE_SHIFT (0u)
Jasper_lee 0:b16d94660a33 168 #define RIICn_RIICnFER_MALE_SHIFT (1u)
Jasper_lee 0:b16d94660a33 169 #define RIICn_RIICnFER_NALE_SHIFT (2u)
Jasper_lee 0:b16d94660a33 170 #define RIICn_RIICnFER_SALE_SHIFT (3u)
Jasper_lee 0:b16d94660a33 171 #define RIICn_RIICnFER_NACKE_SHIFT (4u)
Jasper_lee 0:b16d94660a33 172 #define RIICn_RIICnFER_NFE_SHIFT (5u)
Jasper_lee 0:b16d94660a33 173 #define RIICn_RIICnFER_SCLE_SHIFT (6u)
Jasper_lee 0:b16d94660a33 174 #define RIICn_RIICnFER_FMPE_SHIFT (7u)
Jasper_lee 0:b16d94660a33 175
Jasper_lee 0:b16d94660a33 176 #define RIICn_RIICnSER_SAR0E_SHIFT (0u)
Jasper_lee 0:b16d94660a33 177 #define RIICn_RIICnSER_SAR1E_SHIFT (1u)
Jasper_lee 0:b16d94660a33 178 #define RIICn_RIICnSER_SAR2E_SHIFT (2u)
Jasper_lee 0:b16d94660a33 179 #define RIICn_RIICnSER_GCAE_SHIFT (3u)
Jasper_lee 0:b16d94660a33 180 #define RIICn_RIICnSER_DIDE_SHIFT (5u)
Jasper_lee 0:b16d94660a33 181 #define RIICn_RIICnSER_HOAE_SHIFT (7u)
Jasper_lee 0:b16d94660a33 182
Jasper_lee 0:b16d94660a33 183 #define RIICn_RIICnIER_TMOIE_SHIFT (0u)
Jasper_lee 0:b16d94660a33 184 #define RIICn_RIICnIER_ALIE_SHIFT (1u)
Jasper_lee 0:b16d94660a33 185 #define RIICn_RIICnIER_STIE_SHIFT (2u)
Jasper_lee 0:b16d94660a33 186 #define RIICn_RIICnIER_SPIE_SHIFT (3u)
Jasper_lee 0:b16d94660a33 187 #define RIICn_RIICnIER_NAKIE_SHIFT (4u)
Jasper_lee 0:b16d94660a33 188 #define RIICn_RIICnIER_RIE_SHIFT (5u)
Jasper_lee 0:b16d94660a33 189 #define RIICn_RIICnIER_TEIE_SHIFT (6u)
Jasper_lee 0:b16d94660a33 190 #define RIICn_RIICnIER_TIE_SHIFT (7u)
Jasper_lee 0:b16d94660a33 191
Jasper_lee 0:b16d94660a33 192 #define RIICn_RIICnSR1_AAS0_SHIFT (0u)
Jasper_lee 0:b16d94660a33 193 #define RIICn_RIICnSR1_AAS1_SHIFT (1u)
Jasper_lee 0:b16d94660a33 194 #define RIICn_RIICnSR1_AAS2_SHIFT (2u)
Jasper_lee 0:b16d94660a33 195 #define RIICn_RIICnSR1_GCA_SHIFT (3u)
Jasper_lee 0:b16d94660a33 196 #define RIICn_RIICnSR1_DID_SHIFT (5u)
Jasper_lee 0:b16d94660a33 197 #define RIICn_RIICnSR1_HOA_SHIFT (7u)
Jasper_lee 0:b16d94660a33 198
Jasper_lee 0:b16d94660a33 199 #define RIICn_RIICnSR2_TMOF_SHIFT (0u)
Jasper_lee 0:b16d94660a33 200 #define RIICn_RIICnSR2_AL_SHIFT (1u)
Jasper_lee 0:b16d94660a33 201 #define RIICn_RIICnSR2_START_SHIFT (2u)
Jasper_lee 0:b16d94660a33 202 #define RIICn_RIICnSR2_STOP_SHIFT (3u)
Jasper_lee 0:b16d94660a33 203 #define RIICn_RIICnSR2_NACKF_SHIFT (4u)
Jasper_lee 0:b16d94660a33 204 #define RIICn_RIICnSR2_RDRF_SHIFT (5u)
Jasper_lee 0:b16d94660a33 205 #define RIICn_RIICnSR2_TEND_SHIFT (6u)
Jasper_lee 0:b16d94660a33 206 #define RIICn_RIICnSR2_TDRE_SHIFT (7u)
Jasper_lee 0:b16d94660a33 207
Jasper_lee 0:b16d94660a33 208 #define RIICn_RIICnSAR0_SVA0_SHIFT (0u)
Jasper_lee 0:b16d94660a33 209 #define RIICn_RIICnSAR0_SVA_SHIFT (1u)
Jasper_lee 0:b16d94660a33 210 #define RIICn_RIICnSAR0_FSy_SHIFT (15u)
Jasper_lee 0:b16d94660a33 211
Jasper_lee 0:b16d94660a33 212 #define RIICn_RIICnSAR1_SVA0_SHIFT (0u)
Jasper_lee 0:b16d94660a33 213 #define RIICn_RIICnSAR1_SVA_SHIFT (1u)
Jasper_lee 0:b16d94660a33 214 #define RIICn_RIICnSAR1_FSy_SHIFT (15u)
Jasper_lee 0:b16d94660a33 215
Jasper_lee 0:b16d94660a33 216 #define RIICn_RIICnSAR2_SVA0_SHIFT (0u)
Jasper_lee 0:b16d94660a33 217 #define RIICn_RIICnSAR2_SVA_SHIFT (1u)
Jasper_lee 0:b16d94660a33 218 #define RIICn_RIICnSAR2_FSy_SHIFT (15u)
Jasper_lee 0:b16d94660a33 219
Jasper_lee 0:b16d94660a33 220 #define RIICn_RIICnBRL_BRL_SHIFT (0u)
Jasper_lee 0:b16d94660a33 221
Jasper_lee 0:b16d94660a33 222 #define RIICn_RIICnBRH_BRH_SHIFT (0u)
Jasper_lee 0:b16d94660a33 223
Jasper_lee 0:b16d94660a33 224 #define RIICn_RIICnDRT_DRT_SHIFT (0u)
Jasper_lee 0:b16d94660a33 225
Jasper_lee 0:b16d94660a33 226 #define RIICn_RIICnDRR_DRR_SHIFT (0u)
Jasper_lee 0:b16d94660a33 227
Jasper_lee 0:b16d94660a33 228
Jasper_lee 0:b16d94660a33 229 #endif /* RIIC_IOBITMASK_H */
Jasper_lee 0:b16d94660a33 230
Jasper_lee 0:b16d94660a33 231 /* End of File */