pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT

Dependencies:   mbed MMA8451Q USBDevice WakeUp vt100

Fork of afero_node_suntory_2017_06_15 by Orefatoi

Committer:
wataloh
Date:
Tue Dec 20 01:51:02 2016 +0000
Revision:
0:20bce0dcc921
kl25z teensy merged

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wataloh 0:20bce0dcc921 1 /**
wataloh 0:20bce0dcc921 2 * \file base64.h
wataloh 0:20bce0dcc921 3 *
wataloh 0:20bce0dcc921 4 * \brief RFC 1521 base64 encoding/decoding
wataloh 0:20bce0dcc921 5 *
wataloh 0:20bce0dcc921 6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
wataloh 0:20bce0dcc921 7 * SPDX-License-Identifier: Apache-2.0
wataloh 0:20bce0dcc921 8 *
wataloh 0:20bce0dcc921 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
wataloh 0:20bce0dcc921 10 * not use this file except in compliance with the License.
wataloh 0:20bce0dcc921 11 * You may obtain a copy of the License at
wataloh 0:20bce0dcc921 12 *
wataloh 0:20bce0dcc921 13 * http://www.apache.org/licenses/LICENSE-2.0
wataloh 0:20bce0dcc921 14 *
wataloh 0:20bce0dcc921 15 * Unless required by applicable law or agreed to in writing, software
wataloh 0:20bce0dcc921 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
wataloh 0:20bce0dcc921 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
wataloh 0:20bce0dcc921 18 * See the License for the specific language governing permissions and
wataloh 0:20bce0dcc921 19 * limitations under the License.
wataloh 0:20bce0dcc921 20 *
wataloh 0:20bce0dcc921 21 * This file is part of mbed TLS (https://tls.mbed.org)
wataloh 0:20bce0dcc921 22 */
wataloh 0:20bce0dcc921 23 #ifndef MBEDTLS_BASE64_H
wataloh 0:20bce0dcc921 24 #define MBEDTLS_BASE64_H
wataloh 0:20bce0dcc921 25
wataloh 0:20bce0dcc921 26 //wsugi #include <stddef.h>
wataloh 0:20bce0dcc921 27 #include "mbed.h" //wsugi
wataloh 0:20bce0dcc921 28
wataloh 0:20bce0dcc921 29 #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */
wataloh 0:20bce0dcc921 30 #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */
wataloh 0:20bce0dcc921 31
wataloh 0:20bce0dcc921 32 #ifdef __cplusplus
wataloh 0:20bce0dcc921 33 //wsugi extern "C" {
wataloh 0:20bce0dcc921 34 #endif
wataloh 0:20bce0dcc921 35
wataloh 0:20bce0dcc921 36 /**
wataloh 0:20bce0dcc921 37 * \brief Encode a buffer into base64 format
wataloh 0:20bce0dcc921 38 *
wataloh 0:20bce0dcc921 39 * \param dst destination buffer
wataloh 0:20bce0dcc921 40 * \param dlen size of the destination buffer
wataloh 0:20bce0dcc921 41 * \param olen number of bytes written
wataloh 0:20bce0dcc921 42 * \param src source buffer
wataloh 0:20bce0dcc921 43 * \param slen amount of data to be encoded
wataloh 0:20bce0dcc921 44 *
wataloh 0:20bce0dcc921 45 * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL.
wataloh 0:20bce0dcc921 46 * *olen is always updated to reflect the amount
wataloh 0:20bce0dcc921 47 * of data that has (or would have) been written.
wataloh 0:20bce0dcc921 48 * If that length cannot be represented, then no data is
wataloh 0:20bce0dcc921 49 * written to the buffer and *olen is set to the maximum
wataloh 0:20bce0dcc921 50 * length representable as a size_t.
wataloh 0:20bce0dcc921 51 *
wataloh 0:20bce0dcc921 52 * \note Call this function with dlen = 0 to obtain the
wataloh 0:20bce0dcc921 53 * required buffer size in *olen
wataloh 0:20bce0dcc921 54 */
wataloh 0:20bce0dcc921 55 int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen,
wataloh 0:20bce0dcc921 56 const unsigned char *src, size_t slen );
wataloh 0:20bce0dcc921 57
wataloh 0:20bce0dcc921 58 /**
wataloh 0:20bce0dcc921 59 * \brief Decode a base64-formatted buffer
wataloh 0:20bce0dcc921 60 *
wataloh 0:20bce0dcc921 61 * \param dst destination buffer (can be NULL for checking size)
wataloh 0:20bce0dcc921 62 * \param dlen size of the destination buffer
wataloh 0:20bce0dcc921 63 * \param olen number of bytes written
wataloh 0:20bce0dcc921 64 * \param src source buffer
wataloh 0:20bce0dcc921 65 * \param slen amount of data to be decoded
wataloh 0:20bce0dcc921 66 *
wataloh 0:20bce0dcc921 67 * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or
wataloh 0:20bce0dcc921 68 * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is
wataloh 0:20bce0dcc921 69 * not correct. *olen is always updated to reflect the amount
wataloh 0:20bce0dcc921 70 * of data that has (or would have) been written.
wataloh 0:20bce0dcc921 71 *
wataloh 0:20bce0dcc921 72 * \note Call this function with *dst = NULL or dlen = 0 to obtain
wataloh 0:20bce0dcc921 73 * the required buffer size in *olen
wataloh 0:20bce0dcc921 74 */
wataloh 0:20bce0dcc921 75 int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
wataloh 0:20bce0dcc921 76 const unsigned char *src, size_t slen );
wataloh 0:20bce0dcc921 77
wataloh 0:20bce0dcc921 78 /**
wataloh 0:20bce0dcc921 79 * \brief Checkup routine
wataloh 0:20bce0dcc921 80 *
wataloh 0:20bce0dcc921 81 * \return 0 if successful, or 1 if the test failed
wataloh 0:20bce0dcc921 82 */
wataloh 0:20bce0dcc921 83 int mbedtls_base64_self_test( int verbose );
wataloh 0:20bce0dcc921 84
wataloh 0:20bce0dcc921 85 #ifdef __cplusplus
wataloh 0:20bce0dcc921 86 //wsugi }
wataloh 0:20bce0dcc921 87 #endif
wataloh 0:20bce0dcc921 88
wataloh 0:20bce0dcc921 89 #endif /* base64.h */