- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the WICED SMART SDK, under the include directory structure in bleprofile.h, starting on line 74, there are several #defines for GPIO flag bits. The first section appears to define direction, initialization state, etc. I can make sense of these.
// GPIO flag bit (this is different than definition that used in gpio driver source code (GPIO_INPUT_ENABLE, etc)
#define GPIO_NUM_MAX 16
#define GPIO_INPUT 0x0000
#define GPIO_OUTPUT 0x0001
#define GPIO_INIT_LOW 0x0000
#define GPIO_INIT_HIGH 0x0002
#define GPIO_POLL 0x0000
#define GPIO_INT 0x0004 // Interrupt
#define GPIO_BOTHEDGE_INT 0x0008 // Both Edge
Just under those, starting on line 82, there are another series of magic numbers. Can anyone explain why the values are what they are?
#define GPIO_WP 0x0010 //EEPROM write protect
#define GPIO_BAT 0x0020
#define GPIO_BUTTON 0x0100
#define GPIO_BUTTON1 0x0100
#define GPIO_BUTTON2 0x0200
#define GPIO_BUTTON3 0x0400
#define GPIO_LED 0x1000
#define GPIO_BUZ 0x2000
Thank you,
-Troy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the magic numbers are for led buzzer button as labelled .. If you notice these are based on masking the bits 0,2,4,8 ..