This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

bit-type variable

Good moorning,

i would like question you if you know
some library or configuration, to use in uVision with the Cortex M family, bit-type variable instance of having a minimal byte unit.

My object is get a eight bit from a byte. Someone like this:


Example 1

struct {
        int1 irxif;             //CAN BUS Error Message Received Interrupt Flag bit
        int1 wakif;             //CAN BUS Activity Wake-up Interrupt Flag bit
        int1 errif;     //CAN BUS Error Interrupt Flag bit
        int1 txbnif;    //Mode 0: CAN Transmit Buffer 2 Interrupt Flag bit //Mode 1,2: CAN Transmit Flag Interrupt bit
        int1 txb1if;    //CAN Transmit Buffer 1 Interrupt Flag bit
        int1 txb0ef;    //CAN Transmit Buffer 0 Intettupr Flag bit
        int1 rxbnif;    //Mode 0: CAN Receive Buffer 1 Interrupt Flag bit //Mode 1,2: CAN Receive Buffer Interrupts Flag bit
        int1 rxb0if;    //Mode 0: CAN Receive Buffer 0 Interrupt Flag bit //Mode 1:UNIPLEMENTED //Mode 2:FIFO Watermark Interrupt Flag bit
} PIR5;

Example 2

union{
    struct{
        union{
            struct{
                int1 interrupt_receive;
                int1 fifo_mode;
                int1 enable;
                int1 bits_14_mode;
                int1 int_source_readed;
                int1 void678:3;
            };
            unsigned int8 registro;
        }REG_CTRL_FLG;

        union{
            struct{
                unsigned int REG_CTRL_TIMEH;
                unsigned int REG_CTRL_TIMEL;
            };
            unsigned int16 REG_CTRL_TIME;
        };

        unsigned int threshold; //Testing

        AXIS_STRUCT data_axis;
        AXIS_EXTEND_STRUCT data_full_axis;
    }register_acelerometer;
    unsigned int register[3];
}ACELEROMETER;

Thank you very much for you help and time.

Kinds Regards.