aboutsummaryrefslogtreecommitdiff
path: root/examples/intel-quark-d2000
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-07-27 21:06:48 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-07-27 21:06:48 +0200
commitf9c8c5da8de36b0f95bc92e37e15d299b434c03f (patch)
tree4927f779d0502974b02ac83e4089f7d4dde6e805 /examples/intel-quark-d2000
parent5e846554a48be59ba7278194567b9e1a25058958 (diff)
downloadkicad-utils-f9c8c5da8de36b0f95bc92e37e15d299b434c03f.tar.gz
kicad-utils-f9c8c5da8de36b0f95bc92e37e15d299b434c03f.tar.bz2
kicad-utils-f9c8c5da8de36b0f95bc92e37e15d299b434c03f.tar.xz
kicad-utils-f9c8c5da8de36b0f95bc92e37e15d299b434c03f.zip
more intel stuff.
Diffstat (limited to 'examples/intel-quark-d2000')
-rw-r--r--examples/intel-quark-d2000/schematic.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/intel-quark-d2000/schematic.h b/examples/intel-quark-d2000/schematic.h
index 3ca8e86..62545f0 100644
--- a/examples/intel-quark-d2000/schematic.h
+++ b/examples/intel-quark-d2000/schematic.h
@@ -8,8 +8,45 @@ Generated from schematic for reference U1, part INTEL_QUARK_D2000 in library kic
*/
#include <stddef.h>
+#include <qm_gpio.h>
+enum schematic_direction {
+ schematic_direction_out = 1,
+ schematic_direction_in = 2
+};
static const uint8_t SCHEMATIC_STATUS_LED = 15;
+
+static inline
+qm_rc_t schematic_PUSH_BUTTON_direction(enum schematic_direction dir) {
+ qm_gpio_port_config_t cfg;
+
+ qm_gpio_get_config(QM_GPIO_0, &cfg);
+
+ if (dir == schematic_direction_out) {
+ cfg.direction |= BIT(SCHEMATIC_PUSH_BUTTON);
+ } else {
+ cfg.direction &= ~BIT(SCHEMATIC_PUSH_BUTTON);
+ }
+
+ return qm_gpio_set_config(QM_GPIO_0, &cfg);
+}
+
static const uint8_t SCHEMATIC_PUSH_BUTTON = 11;
+static inline
+qm_rc_t schematic_PUSH_BUTTON_direction(enum schematic_direction dir) {
+ qm_gpio_port_config_t cfg;
+
+ qm_gpio_get_config(QM_GPIO_0, &cfg);
+
+ if (dir == schematic_direction_out) {
+ cfg.direction |= BIT(SCHEMATIC_PUSH_BUTTON);
+ } else {
+ cfg.direction &= ~BIT(SCHEMATIC_PUSH_BUTTON);
+ }
+
+ return qm_gpio_set_config(QM_GPIO_0, &cfg);
+}
+
+
#endif // SCHEMATIC_H