Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct MuxRegister {
- Uint16 PIN1:2;
- Uint16 PIN2:2;
- ...
- }
- #define LED PIN1 (in a different file of course)
- #define PWM PIN2
- #define Mux_GPIO 1 (value from 0-3 selects different options)
- #define Mux_PWM 3
- MuxRegister.LED = Mux_GPIO;
- MuxRegister.PWM = Mux_PWM;
- ...
- #define BIT1 0x00000001
- #define BIT2 0x00000002
- #define BIT1 0x00000004
- #define BIT2 0x00000008
- #define LED (BIT1&&BIT2)
- #define PWM (BIT3&&BIT4)
- MuxRegister |= ((Mux_GPIO && LED) || (Mux_PWM && PWM) || ... ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement