/*********************************************************
Project:
File name: stm8.h
Description:
Write/Modify:
Time:
*********************************************************/
//port A
ext volatile UCharField U_PA_ODR @0x5000;//Port A output data register
ext volatile UCharField U_PA_IDR @0x5001;//Port A pin input register
ext volatile UCharField U_PA_DDR @0x5002;//Port A data direction register
ext volatile UCharField U_PA_CR1 @0x5003;//Port A control register 1
ext volatile UCharField U_PA_CR2 @0x5004;//Port A control register 2
#define PA_ODR U_PA_ODR.byte
#define PA_ODR0 U_PA_ODR.field.B0
#define PA_ODR1 U_PA_ODR.field.B1
#define PA_ODR2 U_PA_ODR.field.B2
#define PA_ODR3 U_PA_ODR.field.B3
#define PA_ODR4 U_PA_ODR.field.B4
#define PA_ODR5 U_PA_ODR.field.B5
#define PA_ODR6 U_PA_ODR.field.B6
#define PA_ODR7 U_PA_ODR.field.B7
#define PA_IDR U_PA_IDR.byte
#define PA_IDR0 U_PA_IDR.field.B0
#define PA_IDR1 U_PA_IDR.field.B1
#define PA_IDR2 U_PA_IDR.field.B2
#define PA_IDR3 U_PA_IDR.field.B3
#define PA_IDR4 U_PA_IDR.field.B4
#define PA_IDR5 U_PA_IDR.field.B5
#define PA_IDR6 U_PA_IDR.field.B6
#define PA_IDR7 U_PA_IDR.field.B7
#define PA_DDR U_PA_DDR.byte
#define PA_DDR0 U_PA_DDR.field.B0
#define PA_DDR1 U_PA_DDR.field.B1
#define PA_DDR2 U_PA_DDR.field.B2
#define PA_DDR3 U_PA_DDR.field.B3
#define PA_DDR4 U_PA_DDR.field.B4
#define PA_DDR5 U_PA_DDR.field.B5
#define PA_DDR6 U_PA_DDR.field.B6
#define PA_DDR7 U_PA_DDR.field.B7
#define PA_CR1 U_PA_CR1.byte
#define PA_CR10 U_PA_CR1.field.B0
#define PA_CR11 U_PA_CR1.field.B1
#define PA_CR12 U_PA_CR1.field.B2
#define PA_CR13 U_PA_CR1.field.B3
#define PA_CR14 U_PA_CR1.field.B4
#define PA_CR15 U_PA_CR1.field.B5
#define PA_CR16 U_PA_CR1.field.B6
#define PA_CR17 U_PA_CR1.field.B7
#define PA_CR2 U_PA_CR2.byte
#define PA_CR20 U_PA_CR2.field.B0
#define PA_CR21 U_PA_CR2.field.B1
#define PA_CR22 U_PA_CR2.field.B2
#define PA_CR23 U_PA_CR2.field.B3
#define PA_CR24 U_PA_CR2.field.B4
#define PA_CR25 U_PA_CR2.field.B5
#define PA_CR26 U_PA_CR2.field.B6
#define PA_CR27 U_PA_CR2.field.B7
//port B
ext volatile UCharField U_PB_ODR @0x5005;
ext volatile UCharField U_PB_IDR @0x5006;
ext volatile UCharField U_PB_DDR @0x5007;
ext volatile UCharField U_PB_CR1 @0x5008;
ext volatile UCharField U_PB_CR2 @0x5009;
#define PB_ODR U_PB_ODR.byte
#define PB_ODR0 U_PB_ODR.field.B0
#define PB_ODR1 U_PB_ODR.field.B1
#define PB_ODR2 U_PB_ODR.field.B2
#define PB_ODR3 U_PB_ODR.field.B3
#define PB_ODR4 U_PB_ODR.field.B4
#define PB_ODR5 U_PB_ODR.field.B5
#define PB_ODR6 U_PB_ODR.field.B6
#define PB_ODR7 U_PB_ODR.field.B7
#define PB_IDR U_PB_IDR.byte
#define PB_IDR0 U_PB_IDR.field.B0
#define PB_IDR1 U_PB_IDR.field.B1
#define PB_IDR2 U_PB_IDR.field.B2
#define PB_IDR3 U_PB_IDR.field.B3
#define PB_IDR4 U_PB_IDR.field.B4
#define PB_IDR5 U_PB_IDR.field.B5
#define PB_IDR6 U_PB_IDR.field.B6
#define PB_IDR7 U_PB_IDR.field.B7
#define PB_DDR U_PB_DDR.byte
#define PB_DDR0 U_PB_DDR.field.B0
#define PB_DDR1 U_PB_DDR.field.B1
#define PB_DDR2 U_PB_DDR.field.B2
#define PB_DDR3 U_PB_DDR.field.B3
#define PB_DDR4 U_PB_DDR.field.B4
#define PB_DDR5 U_PB_DDR.field.B5
#define PB_DDR6 U_PB_DDR.field.B6
#define PB_DDR7 U_PB_DDR.field.B7
#define PB_CR1 U_PB_CR1.byte
#define PB_CR10 U_PB_CR1.field.B0
#define PB_CR11 U_PB_CR1.field.B1
#define PB_CR12 U_PB_CR1.field.B2
#define PB_CR13 U_PB_CR1.field.B3
#define PB_CR14 U_PB_CR1.field.B4
#define PB_CR15 U_PB_CR1.field.B5
#define PB_CR16 U_PB_CR1.field.B6
#define PB_CR17 U_PB_CR1.field.B7
#define PB_CR2 U_PB_CR2.byte
#define PB_CR20 U_PB_CR2.field.B0
#define PB_CR21 U_PB_CR2.field.B1
#define PB_CR22 U_PB_CR2.field.B2
#define PB_CR23 U_PB_CR2.field.B3
#define PB_CR24 U_PB_CR2.field.B4
#define PB_CR25 U_PB_CR2.field.B5
#define PB_CR26 U_PB_CR2.field.B6
#define PB_CR27 U_PB_CR2.field.B7
//port C
ext volatile UCharField U_PC_ODR @0x500A;
ext volatile UCharField U_PC_IDR @0x500B;
ext volatile UCharField U_PC_DDR @0x500C;
ext volatile UCharField U_PC_CR1 @0x500D;
ext volatile UCharField U_PC_CR2 @0x500E;
#define PC_ODR U_PC_ODR.byte
#define PC_ODR0 U_PC_ODR.field.B0
#define PC_ODR1 U_PC_ODR.field.B1
#define PC_ODR2 U_PC_ODR.field.B2
#define PC_ODR3 U_PC_ODR.field.B3
#define PC_ODR4 U_PC_ODR.field.B4
#define PC_ODR5 U_PC_ODR.field.B5
#define PC_ODR6 U_PC_ODR.field.B6
#define PC_ODR7 U_PC_ODR.field.B7
#define PC_IDR U_PC_IDR.byte
#define PC_IDR0 U_PC_IDR.field.B0
#define PC_IDR1 U_PC_IDR.field.B1
#define PC_IDR2 U_PC_IDR.field.B2
#define PC_IDR3 U_PC_IDR.field.B3
#define PC_IDR4 U_PC_IDR.field.B4
#define PC_IDR5 U_PC_IDR.field.B5
#define PC_IDR6 U_PC_IDR.field.B6
#define PC_IDR7 U_PC_IDR.field.B7
#define PC_DDR U_PC_DDR.byte
#define PC_DDR0 U_PC_DDR.field.B0
#define PC_DDR1 U_PC_DDR.field.B1
#define PC_DDR2 U_PC_DDR.field.B2
#define PC_DDR3 U_PC_DDR.field.B3
#define PC_DDR4 U_PC_DDR.field.B4
#define PC_DDR5 U_PC_DDR.field.B5
#define PC_DDR6 U_PC_DDR.field.B6
#define PC_DDR7 U_PC_DDR.field.B7
#define PC_CR1 U_PC_CR1.byte
#define PC_CR10 U_PC_CR1.field.B0
#define PC_CR11 U_PC_CR1.field.B1
#define PC_CR12 U_PC_CR1.field.B2
#define PC_CR13 U_PC_CR1.field.B3
#define PC_CR14 U_PC_CR1.field.B4
#define PC_CR15 U_PC_CR1.field.B5
#define PC_CR16 U_PC_CR1.field.B6
#define PC_CR17 U_PC_CR1.field.B7
#define PC_CR2 U_PC_CR2.byte
#define PC_CR20 U_PC_CR2.field.B0
#define PC_CR2