2 * Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
3 * Copyright (c) 2015 Intel Corporation.
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #include <sys/types.h>
32 #include "x86/intel_sofia_3gr.h"
34 #define PLATFORM_NAME "SoFIA 3GR"
37 mraa_intel_sofia_3gr()
39 mraa_board_t* b = (mraa_board_t*) calloc(1, sizeof(mraa_board_t));
44 b->platform_name = PLATFORM_NAME;
45 b->phy_pin_count = MRAA_INTEL_SOFIA_3GR_PINCOUNT;
47 b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
48 if (b->adv_func == NULL) {
52 b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * MRAA_INTEL_SOFIA_3GR_PINCOUNT);
53 if (b->pins == NULL) {
58 strncpy(b->pins[0].name, "I2C1SCL", 8);
59 b->pins[0].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
60 b->pins[0].i2c.pinmap = 1;
61 b->pins[0].i2c.mux_total = 0;
63 strncpy(b->pins[1].name, "I2C1SDA", 8);
64 b->pins[1].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
65 b->pins[1].i2c.pinmap = 1;
66 b->pins[1].i2c.mux_total = 0;
68 strncpy(b->pins[2].name, "I2C2SCL", 8);
69 b->pins[2].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
70 b->pins[2].i2c.pinmap = 1;
71 b->pins[2].i2c.mux_total = 0;
73 strncpy(b->pins[3].name, "I2C2SDA", 8);
74 b->pins[3].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
75 b->pins[3].i2c.pinmap = 1;
76 b->pins[3].i2c.mux_total = 0;
78 strncpy(b->pins[4].name, "I2C3SCL", 8);
79 b->pins[4].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
80 b->pins[4].i2c.pinmap = 1;
81 b->pins[4].i2c.mux_total = 0;
83 strncpy(b->pins[5].name, "I2C3SDA", 8);
84 b->pins[5].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
85 b->pins[5].i2c.pinmap = 1;
86 b->pins[5].i2c.mux_total = 0;
88 strncpy(b->pins[6].name, "I2C4SCL", 8);
89 b->pins[6].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
90 b->pins[6].i2c.pinmap = 1;
91 b->pins[6].i2c.mux_total = 0;
93 strncpy(b->pins[7].name, "I2C4SDA", 8);
94 b->pins[7].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 0, 1, 0, 0 };
95 b->pins[7].i2c.pinmap = 1;
96 b->pins[7].i2c.mux_total = 0;
100 syslog(LOG_CRIT, "SoFIA 3GR: Platform failed to initialise");