Commit a8ff8f05 authored by devsaurus's avatar devsaurus
Browse files

Add u8g2 module.

parent 329bd73b
...@@ -32,22 +32,24 @@ pages: ...@@ -32,22 +32,24 @@ pages:
- Extension Developer FAQ: 'en/extn-developer-faq.md' - Extension Developer FAQ: 'en/extn-developer-faq.md'
- Support: 'en/support.md' - Support: 'en/support.md'
- Modules: - Modules:
- 'adc': 'en/modules/adc.md' - 'adc': 'en/modules/adc.md'
- 'bit': 'en/modules/bit.md' - 'bit': 'en/modules/bit.md'
- 'bthci': 'en/modules/bthci.md' - 'bthci': 'en/modules/bthci.md'
- 'can': 'en/modules/can.md' - 'can': 'en/modules/can.md'
- 'dht': 'en/modules/dht.md' - 'dht': 'en/modules/dht.md'
- 'file': 'en/modules/file.md' - 'file': 'en/modules/file.md'
- 'gpio': 'en/modules/gpio.md' - 'gpio': 'en/modules/gpio.md'
- 'i2c': 'en/modules/i2c.md' - 'i2c': 'en/modules/i2c.md'
- 'node': 'en/modules/node.md' - 'node': 'en/modules/node.md'
- 'ow (1-Wire)': 'en/modules/ow.md' - 'ow (1-Wire)': 'en/modules/ow.md'
- 'sdmmc': 'en/modules/sdmmc.md' - 'sdmmc': 'en/modules/sdmmc.md'
- 'sigma delta': 'en/modules/sigma-delta.md' - 'sigma delta': 'en/modules/sigma-delta.md'
- 'spi': 'en/modules/spi.md' - 'spi': 'en/modules/spi.md'
- 'struct': 'en/modules/struct.md' - 'struct': 'en/modules/struct.md'
- 'tmr': 'en/modules/tmr.md' - 'tmr': 'en/modules/tmr.md'
- 'uart': 'en/modules/uart.md' - 'u8g2': 'en/modules/u8g2.md'
- 'wifi': 'en/modules/wifi.md' - 'u8g2 Display': 'en/modules/u8g2_disp.md'
- 'ws2812': 'en/modules/ws2812.md' - 'uart': 'en/modules/uart.md'
- 'wifi': 'en/modules/wifi.md'
- 'ws2812': 'en/modules/ws2812.md'
#!/usr/bin/perl -w
my (@i2c_displays, @spi_displays);
# scan provided header file for CONFIG_U8G2_I2C and CONFIG_U8G2_SPI entries
while (<STDIN>) {
if (/^\s*#\s*define\s+CONFIG_U8G2_I2C_([^_]+)_(\S+)\s+1/) {
push(@i2c_displays, lc($1)."_i2c_".lc($2));
}
if (/^\s*#\s*define\s+CONFIG_U8G2_SPI_(\S+)\s+1/) {
push(@spi_displays, lc($1));
}
}
if (@i2c_displays > 0 || @spi_displays > 0) {
print << 'HEADER';
#ifndef _U8G2_DISPLAYS_H
#define _U8G2_DISPLAYS_H
#define U8G2_DISPLAY_TABLE_ENTRY(function, binding)
HEADER
print("#define U8G2_DISPLAY_TABLE_I2C \\\n");
foreach my $display (@i2c_displays) {
print(" U8G2_DISPLAY_TABLE_ENTRY(u8g2_Setup_${display}_f, $display) \\\n");
}
print("\n");
print("#define U8G2_DISPLAY_TABLE_SPI \\\n");
foreach my $display (@spi_displays) {
print(" U8G2_DISPLAY_TABLE_ENTRY(u8g2_Setup_${display}_f, $display) \\\n");
}
print("\n");
print << 'FOOTER';
#endif /* _U8G2_DISPLAYS_H */
FOOTER
}
#!/usr/bin/perl -w
my @font_selection;
# scan provided header file for CONFIG_U8G2_FONT_SELECTION entry
while (<STDIN>) {
if (/^\s*#\s*define\s+CONFIG_U8G2_FONT_SELECTION\s+"([^"]+)"/) {
@font_selection = split(/,/, $1);
last;
}
}
if (@font_selection > 0) {
print << 'HEADER';
#ifndef _U8G2_FONTS_H
#define _U8G2_FONTS_H
#define U8G2_FONT_TABLE_ENTRY(font)
#define U8G2_FONT_TABLE \
HEADER
foreach my $font (@font_selection) {
print(" U8G2_FONT_TABLE_ENTRY($font) \\\n");
}
print << 'FOOTER';
#endif /* _U8G2_FONTS_H */
FOOTER
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment