summaryrefslogtreecommitdiff
path: root/i2c/SConscript
diff options
context:
space:
mode:
Diffstat (limited to 'i2c/SConscript')
-rw-r--r--i2c/SConscript21
1 files changed, 21 insertions, 0 deletions
diff --git a/i2c/SConscript b/i2c/SConscript
new file mode 100644
index 0000000..c639898
--- /dev/null
+++ b/i2c/SConscript
@@ -0,0 +1,21 @@
+Import('env')
+
+headers = []
+instances = []
+sources = []
+aliases = {}
+
+periph = env['PLATFORM_SPEC'].get('periph', {})
+
+if 'stm32_i2c' in periph:
+ headers.append('stm32_i2c.h')
+ for name, data in periph['stm32_i2c'].items():
+ instances.append({
+ 'type': 'STM32_I2C_t<STM32_I2C_reg_%s_t>' % data['type'],
+ 'name': name,
+ 'args': [data['offset']],
+ })
+
+env.Jinja2('i2c.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases)
+
+Return('sources')