Private
Public Access
2
0

api: Change api licensing as it now has nothing to do with mbed

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-04-30 14:50:01 +01:00
parent 82eacc48e1
commit 35c98aed6d
4 changed files with 67 additions and 64 deletions

View File

@@ -1,19 +1,25 @@
/* /*
* Originally from mbed Microcontroller Library * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
* Copyright (c) 2006-2013 ARM Limited * Copyright (c) 2014 Intel Corporation.
* Copyright (c) 2014 Intel Corporation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Permission is hereby granted, free of charge, to any person obtaining
* you may not use this file except in compliance with the License. * a copy of this software and associated documentation files (the
* You may obtain a copy of the License at * "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:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* *
* Unless required by applicable law or agreed to in writing, software * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* distributed under the License is distributed on an "AS IS" BASIS, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* See the License for the specific language governing permissions and * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* limitations under the License. * 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 #pragma once
@@ -63,8 +69,7 @@ typedef enum {
* *
* @param pin pin number read from the board, i.e IO3 is 3. * @param pin pin number read from the board, i.e IO3 is 3.
* *
* @returns * @returns maa_gpio_context based on the IO pin
* maa_gpio_context based on the IO pin
*/ */
maa_gpio_context* maa_gpio_init(int pin); maa_gpio_context* maa_gpio_init(int pin);

View File

@@ -1,19 +1,25 @@
/* /*
* Originally from mbed Microcontroller Library * Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2006-2013 ARM Limited * Copyright (c) 2014 Intel Corporation.
* Copyright (c) 2014 Intel Corporation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Permission is hereby granted, free of charge, to any person obtaining
* you may not use this file except in compliance with the License. * a copy of this software and associated documentation files (the
* You may obtain a copy of the License at * "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:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* *
* Unless required by applicable law or agreed to in writing, software * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* distributed under the License is distributed on an "AS IS" BASIS, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* See the License for the specific language governing permissions and * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* limitations under the License. * 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 #pragma once
@@ -49,7 +55,7 @@ typedef struct {
maa_i2c_context* maa_i2c_init(); 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 dev the i2c context
* @param hz The bus frequency in hertz * @param hz The bus frequency in hertz
@@ -58,25 +64,17 @@ maa_i2c_context* maa_i2c_init();
*/ */
maa_result_t maa_i2c_frequency(maa_i2c_context* dev, int hz); maa_result_t maa_i2c_frequency(maa_i2c_context* dev, int hz);
/** Checks to see if this I2C Slave has been addressed. /** Read from an i2c context
*
* @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.
* *
* @param dev the i2c context * @param dev the i2c context
* @param data pointer to the byte array to read data in to * @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. * @return maa_result_t the maa result.
*/ */
maa_result_t maa_i2c_read(maa_i2c_context* dev, char *data, int length); 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 * @param dev the i2c context
* *
@@ -84,17 +82,17 @@ maa_result_t maa_i2c_read(maa_i2c_context* dev, char *data, int length);
*/ */
int maa_i2c_read_byte(maa_i2c_context* dev); 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 dev the i2c context
* @param data pointer to the byte array to be transmitted * @param data pointer to the byte array to be written
* @param length the number of bytes to transmite * @param length the number of bytes to transmit
* *
* @return maa_result_t the maa result. * @return maa_result_t the maa result.
*/ */
maa_result_t maa_i2c_write(maa_i2c_context* dev, const char *data, int length); 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 * @param dev the i2c context
* @data the byte to write * @data the byte to write
@@ -103,7 +101,7 @@ maa_result_t maa_i2c_write(maa_i2c_context* dev, const char *data, int length);
*/ */
maa_result_t maa_i2c_write_byte(maa_i2c_context* dev, int data); 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 dev the i2c context
* @param address The address to set for the slave (ignoring the least * @param address The address to set for the slave (ignoring the least

View File

@@ -1,19 +1,25 @@
/* /*
* Originally from mbed Microcontroller Library * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
* Copyright (c) 2006-2013 ARM Limited * Copyright (c) 2014 Intel Corporation.
* Copyright (c) 2014 Intel Corporation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Permission is hereby granted, free of charge, to any person obtaining
* you may not use this file except in compliance with the License. * a copy of this software and associated documentation files (the
* You may obtain a copy of the License at * "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:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* *
* Unless required by applicable law or agreed to in writing, software * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* distributed under the License is distributed on an "AS IS" BASIS, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* See the License for the specific language governing permissions and * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* limitations under the License. * 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 #pragma once
@@ -90,7 +96,7 @@ float maa_pwm_read(maa_pwm_context* pwm);
*/ */
maa_result_t maa_pwm_period(maa_pwm_context* pwm, float seconds); 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 pwm The PWM context to use.
* @param ms milli-seconds for period. * @param ms milli-seconds for period.
@@ -99,7 +105,7 @@ maa_result_t maa_pwm_period(maa_pwm_context* pwm, float seconds);
*/ */
maa_result_t maa_pwm_period_ms(maa_pwm_context* pwm, int ms); 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 pwm The PWM context to use.
* @param ns microseconds as period. * @param ns microseconds as period.
@@ -117,7 +123,7 @@ maa_result_t maa_pwm_period_us(maa_pwm_context* pwm, int us);
*/ */
maa_result_t maa_pwm_pulsewidth(maa_pwm_context* pwm, float seconds); 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 pwm The PWM context to use.
* @param ms milliseconds for pulsewidth. * @param ms milliseconds for pulsewidth.

View File

@@ -48,12 +48,6 @@ maa_i2c_frequency(maa_i2c_context* dev, int hz)
return MAA_SUCCESS; return MAA_SUCCESS;
} }
maa_result_t
maa_i2c_receive(maa_i2c_context* dev)
{
return MAA_ERROR_FEATURE_NOT_IMPLEMENTED;
}
maa_result_t maa_result_t
maa_i2c_read(maa_i2c_context* dev, char *data, int length) maa_i2c_read(maa_i2c_context* dev, char *data, int length)
{ {