/*
- * Originally from mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- * Copyright (c) 2014 Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
*
* @param pin pin number read from the board, i.e IO3 is 3.
*
- * @returns
- * maa_gpio_context based on the IO pin
+ * @returns maa_gpio_context based on the IO pin
*/
maa_gpio_context* maa_gpio_init(int pin);
/*
- * Originally from mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- * Copyright (c) 2014 Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Author: Brendan Le Foll <brendan.le.foll@intel.com>
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
maa_i2c_context* maa_i2c_init();
-/** Set the frequency of the I2C interface
+/** Sets the frequency of the i2c context
*
* @param dev the i2c context
* @param hz The bus frequency in hertz
*/
maa_result_t maa_i2c_frequency(maa_i2c_context* dev, int hz);
-/** Checks to see if this I2C Slave has been addressed.
- *
- * @param dev the i2c context
- *
- * @return maa_result_t the maa result.
- */
-maa_result_t maa_i2c_receive(maa_i2c_context* dev);
-
-/** Read from an I2C master.
+/** Read from an i2c context
*
* @param dev the i2c context
* @param data pointer to the byte array to read data in to
- * @param length maximum number of bytes to read
+ * @param length max number of bytes to read
*
* @return maa_result_t the maa result.
*/
maa_result_t maa_i2c_read(maa_i2c_context* dev, char *data, int length);
-/** Read a single byte from an I2C master.
+/** Read a single byte from the i2c context
*
* @param dev the i2c context
*
*/
int maa_i2c_read_byte(maa_i2c_context* dev);
-/** Write to an I2C master
+/** Write to an i2c context
*
* @param dev the i2c context
- * @param data pointer to the byte array to be transmitted
- * @param length the number of bytes to transmite
+ * @param data pointer to the byte array to be written
+ * @param length the number of bytes to transmit
*
* @return maa_result_t the maa result.
*/
maa_result_t maa_i2c_write(maa_i2c_context* dev, const char *data, int length);
-/** Write a single byte to an I2C master.
+/** Write a single byte to an i2c context
*
* @param dev the i2c context
* @data the byte to write
*/
maa_result_t maa_i2c_write_byte(maa_i2c_context* dev, int data);
-/** Sets the I2C slave address.
+/** Sets the i2c context address.
*
* @param dev the i2c context
* @param address The address to set for the slave (ignoring the least
/*
- * Originally from mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- * Copyright (c) 2014 Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
*/
maa_result_t maa_pwm_period(maa_pwm_context* pwm, float seconds);
-/** Set period. milli-oseconds.
+/** Set period, milli-oseconds.
*
* @param pwm The PWM context to use.
* @param ms milli-seconds for period.
*/
maa_result_t maa_pwm_period_ms(maa_pwm_context* pwm, int ms);
-/** Set period. microseconds
+/** Set period, microseconds
*
* @param pwm The PWM context to use.
* @param ns microseconds as period.
*/
maa_result_t maa_pwm_pulsewidth(maa_pwm_context* pwm, float seconds);
-/** Set pulsewidth. Milliseconds
+/** Set pulsewidth, milliseconds
*
* @param pwm The PWM context to use.
* @param ms milliseconds for pulsewidth.
}
maa_result_t
-maa_i2c_receive(maa_i2c_context* dev)
-{
- return MAA_ERROR_FEATURE_NOT_IMPLEMENTED;
-}
-
-maa_result_t
maa_i2c_read(maa_i2c_context* dev, char *data, int length)
{
// this is the read(3) syscall not maa_i2c_read()